spring @EnableAspectJAutoProxy @Aspect的使用和源码流程
目录
- 测试代码
- @EnableAspectJAutoProxy
- AspectJAutoProxyRegistrar
- AnnotationAwareAspectJAutoProxyCreator
- org.springframework.context.support.AbstractApplicationContext#registerBeanPostProcessors 实例化AnnotationAwareAspectJAutoProxyCreator
- bean "a"的代理处理
- 重点分析 org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator#wrapIfNecessary
- 反问下Advisor怎么来的?
- @Aspect Bean的缓存
- 怎么判断bean "a" 要代理
- 总结 bean "a"的代理对象的由来
测试代码
@Service
public class A {public A() {System.out.println("A()");}public void say(){System.out.println("say A");}
}
@Aspect, say方法前打印log
@Aspect
@Service
public class LogAspect {@Before("execution(public * com.aop.dependency..*.say(..))")public void before() {System.out.println("... before say...");}}
@Configuration类
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableAspectJAutoProxy;@EnableAspectJAutoProxy
@Configuration
@ComponentScan("com.aop.dependency")
public class ConfigOne {
}
@EnableAspectJAutoProxy
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Import(AspectJAutoProxyRegistrar.class)
public @interface EnableAspectJAutoProxy {
看到了@Import
,瞬间联想到ConfigurationClassPostProcessor
这个BeanFactoryPostProcessor
, 联想不到的可阅读:https://doctording.blog.csdn.net/article/details/144865082
AspectJAutoProxyRegistrar
class AspectJAutoProxyRegistrar implements ImportBeanDefinitionRegistrar {/*** Register, escalate, and configure the AspectJ auto proxy creator based on the value* of the @{@link EnableAspectJAutoProxy#proxyTargetClass()} attribute on the importing* {@code @Configuration} class.*/@Overridepublic void registerBeanDefinitions(AnnotationMetadata importingClassMetadata, BeanDefinitionRegistry registry) {AopConfigUtils.registerAspectJAnnotationAutoProxyCreatorIfNecessary(registry);AnnotationAttributes enableAspectJAutoProxy =AnnotationConfigUtils.attributesFor(importingClassMetadata, EnableAspectJAutoProxy.class);if (enableAspectJAutoProxy != null) {if (enableAspectJAutoProxy.getBoolean("proxyTargetClass")) {AopConfigUtils.forceAutoProxyCreatorToUseClassProxying(registry);}if (enableAspectJAutoProxy.getBoolean("exposeProxy")) {AopConfigUtils.forceAutoProxyCreatorToExposeProxy(registry);}}}}
构造了一个BeanDefinition,beanName为"“org.springframework.aop.config.internalAutoProxyCreator”"
对应类为:org.springframework.aop.aspectj.annotation.AnnotationAwareAspectJAutoProxyCreator
AnnotationAwareAspectJAutoProxyCreator
类图如下,可以发现是一个BeanPostProcessor
org.springframework.context.support.AbstractApplicationContext#registerBeanPostProcessors 实例化AnnotationAwareAspectJAutoProxyCreator
bean "a"的代理处理
bean创建的createBean方法中会应用所有的InstantiationAwareBeanPostProcessor,org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory#resolveBeforeInstantiation
接着到bean的生命周期方法的doCreateBean方法org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory#doCreateBean
在实例化之后会先应用MergedBeanDefinitionPostProcessor: org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory#applyMergedBeanDefinitionPostProcessors
AnnotationAwareAspectJAutoProxyCreator不是MergedBeanDefinitionPostProcessor,先跳过
然后是添加lambda表达式的早期对象缓存
addSingletonFactory(beanName, () -> getEarlyBeanReference(beanName, mbd, bean));
初始化后发现exposedObject是代理类了:
初始化前后会执行所有Bpp的postProcessBeforeInitialization和postProcessAfterInitialization方法(可阅读:https://doctording.blog.csdn.net/article/details/145044487)
对于AnnotationAwareAspectJAutoProxyCreator,其postProcessBeforeInitialization方法是
org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator#postProcessBeforeInitialization
,未做处理
postProcessAfterInitialization则有处理,是
org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator#postProcessAfterInitialization
/*** Create a proxy with the configured interceptors if the bean is* identified as one to proxy by the subclass.* @see #getAdvicesAndAdvisorsForBean*/
@Override
public Object postProcessAfterInitialization(@Nullable Object bean, String beanName) {if (bean != null) {Object cacheKey = getCacheKey(bean.getClass(), beanName);if (!this.earlyProxyReferences.contains(cacheKey)) {return wrapIfNecessary(bean, beanName, cacheKey);}}return bean;
}
走到了wrapIfNecessary方法
在探究spring bean循环依赖的时候也见过,见文章:https://doctording.blog.csdn.net/article/details/145224918
重点分析 org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator#wrapIfNecessary
首先找bean的Advisor,可以看到其中一个是我们自定义的,另外一个应该是内置的
然后即可以创建代理了
反问下Advisor怎么来的?
继续debug发现是通过内部缓存的aspect Bean来的
另外注意到AbstractAutoProxyCreator是实现了BeanAware的,其可以获取到beanFactory, 在org.springframework.aop.framework.autoproxy.BeanFactoryAdvisorRetrievalHelper#findAdvisorBeans
中可以看到使用了beanFactory
/*** Find all eligible Advisor beans in the current bean factory,* ignoring FactoryBeans and excluding beans that are currently in creation.* @return the list of {@link org.springframework.aop.Advisor} beans* @see #isEligibleBean*/
public List<Advisor> findAdvisorBeans() {// Determine list of advisor bean names, if not cached already.String[] advisorNames = this.cachedAdvisorBeanNames;if (advisorNames == null) {// Do not initialize FactoryBeans here: We need to leave all regular beans// uninitialized to let the auto-proxy creator apply to them!advisorNames = BeanFactoryUtils.beanNamesForTypeIncludingAncestors(this.beanFactory, Advisor.class, true, false);this.cachedAdvisorBeanNames = advisorNames;}if (advisorNames.length == 0) {return new ArrayList<>();}List<Advisor> advisors = new ArrayList<>();for (String name : advisorNames) {if (isEligibleBean(name)) {if (this.beanFactory.isCurrentlyInCreation(name)) {if (logger.isTraceEnabled()) {logger.trace("Skipping currently created advisor '" + name + "'");}}else {try {advisors.add(this.beanFactory.getBean(name, Advisor.class));}catch (BeanCreationException ex) {Throwable rootCause = ex.getMostSpecificCause();if (rootCause instanceof BeanCurrentlyInCreationException) {BeanCreationException bce = (BeanCreationException) rootCause;String bceBeanName = bce.getBeanName();if (bceBeanName != null && this.beanFactory.isCurrentlyInCreation(bceBeanName)) {if (logger.isTraceEnabled()) {logger.trace("Skipping advisor '" + name +"' with dependency on currently created bean: " + ex.getMessage());}// Ignore: indicates a reference back to the bean we're trying to advise.// We want to find advisors other than the currently created bean itself.continue;}}throw ex;}}}}return advisors;
}
@Aspect Bean的缓存
debug发现是在@Config的全注解类生命周期执行的时候InstantiationAwareBeanPostProcessor会应用AnnotationAwareAspectJAutoProxyCreator这个beanPostProcessor(因为AnnotationAwareAspectJAutoProxyCreator确实是一个InstantiationAwareBeanPostProcessor,查看类图可知)
在org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator#postProcessBeforeInstantiation
方法中会查找所有的Advisor
@Override
protected boolean shouldSkip(Class<?> beanClass, String beanName) {// TODO: Consider optimization by caching the list of the aspect namesList<Advisor> candidateAdvisors = findCandidateAdvisors();for (Advisor advisor : candidateAdvisors) {if (advisor instanceof AspectJPointcutAdvisor &&((AspectJPointcutAdvisor) advisor).getAspectName().equals(beanName)) {return true;}}return super.shouldSkip(beanClass, beanName);
}
对所有bean判断是否Aspect 得到
@Aspect注解很普通,如下
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface Aspect {/*** Per clause expression, defaults to singleton aspect* <p/>* Valid values are "" (singleton), "perthis(...)", etc*/public String value() default "";
}
判断Aspect Bean方法
/*** We consider something to be an AspectJ aspect suitable for use by the Spring AOP system* if it has the @Aspect annotation, and was not compiled by ajc. The reason for this latter test* is that aspects written in the code-style (AspectJ language) also have the annotation present* when compiled by ajc with the -1.5 flag, yet they cannot be consumed by Spring AOP.*/
@Override
public boolean isAspect(Class<?> clazz) {return (hasAspectAnnotation(clazz) && !compiledByAjc(clazz));
}private boolean hasAspectAnnotation(Class<?> clazz) {return (AnnotationUtils.findAnnotation(clazz, Aspect.class) != null);
}
最后缓存到org.springframework.aop.aspectj.annotation.BeanFactoryAspectJAdvisorsBuilder#aspectBeanNames
list结构中
AnnotationAwareAspectJAutoProxyCreator作为InstantiationAwareBeanPostProcessor各个bean实例化都会执行到,因为有缓存,所以@Aspect bean的缓存逻辑只会执行一次
随意当执行到bean "a"的时候,可以直接从缓存中拿到
怎么判断bean “a” 要代理
bean “a” initializeBean过程中,应用AnnotationAwareAspectJAutoProxyCreator这个bpp,判断是否要代理,从缓存中取出@Aspect的bean,然后通过org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator#findAdvisorsThatCanApply
方法判断,比较复杂,如下图
本例 bean “a” 的say方法被LogAspect代理了,所以最后判断出有代理
@Aspect
@Service
public class LogAspect {@Before("execution(public * com.aop.dependency..*.say(..))")public void before() {System.out.println("... before say...");}}
总结 bean "a"的代理对象的由来
简单一句话就是,AnnotationAwareAspectJAutoProxyCreator这个BeanPostProcessor集合内部缓存的@Aspect bean, 应用到raw bean, 判断是否有代理,有则创建代理类而来。
AnnotationAwareAspectJAutoProxyCreator怎么来的则是当全注解类加上@EnableAspectJAutoProxy
,会通过spring内置的ConfigurationClassPostProcessor
BeanFactoryPostProcessor添加一个AnnotationAwareAspectJAutoProxyCreator
BeanPostProcessor
具体怎么创建代理的,则要阅读org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator#createProxy
方法,需要先回忆下Java动态代理相关知识。
相关文章:
spring @EnableAspectJAutoProxy @Aspect的使用和源码流程
目录 测试代码EnableAspectJAutoProxyAspectJAutoProxyRegistrarAnnotationAwareAspectJAutoProxyCreatororg.springframework.context.support.AbstractApplicationContext#registerBeanPostProcessors 实例化AnnotationAwareAspectJAutoProxyCreator bean "a"的代理…...
项目实战--网页五子棋(游戏大厅)(3)
我们的游戏大厅界面主要需要包含两个功能,一是显示用户信息,二是匹配游戏按钮 1. 页面实现 hall.html <!DOCTYPE html> <html lang"ch"> <head><meta charset"UTF-8"><meta name"viewport"…...
『 实战项目 』Cloud Backup System - 云备份
文章目录 云备份项目服务端功能服务端功能模块划分客户端功能客户端模块划分 项目条件Jsoncpp第三方库Bundle第三方库httplib第三方库Request类Response类Server类Client类搭建简单服务器搭建简单客户端 服务端工具类实现 - 文件实用工具类服务器配置信息模块实现- 系统配置信息…...
【机器学习实战入门】使用OpenCV和Keras的驾驶员疲劳检测系统
嗜睡驾驶者警报系统 防止司机疲劳驾驶警报系统 中级 Python 项目 - 司机疲劳检测系统 疲劳检测是一种安全技术,能够预防因司机在驾驶过程中入睡而造成的事故。 本中级 Python 项目的目标是建立一个疲劳检测系统,该系统将检测到一个人的眼睛闭合了一段时…...
使用 spring boot 2.5.6 版本时缺少 jvm 配置项
2.5.6我正在使用带有版本和springfox-boot-starter版本的Spring Boot 项目3.0.0。我的项目还包括一个WebSecurityConfig扩展WebSecurityConfigurerAdapter并实现WebMvcConfigurer的类。但是,我面临的问题是指标在端点jvm_memory_usage_after_gc_percent中不可见/act…...
【强化学习】Soft Actor-Critic (SAC) 算法
📢本篇文章是博主强化学习(RL)领域学习时,用于个人学习、研究或者欣赏使用,并基于博主对相关等领域的一些理解而记录的学习摘录和笔记,若有不当和侵权之处,指出后将会立即改正,还望谅…...
2024年博客之星主题创作|Android 开发:前沿技术、跨领域融合与就业技能展望
目录 引言 一、推动 Android 应用创新的核心力量 1.1 人工智能与机器学习的崛起 1.2 增强现实(AR)与虚拟现实(VR)的应用扩展 1.3 5G技术的推动 1.4 跨平台开发技术的成熟 1.4.1 React Native 1.4.2 Flutter 1.4.3 Taro …...
Spring Boot--@PathVariable、@RequestParam、@RequestBody
目录 声明!! 什么是RESTful? RESTful 的基本原则 无状态性(Stateless) 统一接口(Uniform Interface) 分层系统(Layered System) 缓存(Cacheable&#…...
网站HTTP改成HTTPS
您不仅需要知道如何将HTTP转换为HTTPS,还必须在不妨碍您的网站自成立以来建立的任何搜索排名权限的情况下进行切换。 为什么应该从HTTP转换为HTTPS? 与非安全HTTP于不同,安全域使用SSL(安全套接字层)服务器上的加密代…...
Spring Boot + Netty + WebSocket 实现消息推送
1、关于Netty Netty 是一个利用 Java 的高级网络的能力,隐藏其背后的复杂性而提供一个易于使用的 API 的客户端/服务器框架。 2、Maven依赖 <dependencies><!-- https://mvnrepository.com/artifact/io.netty/netty-all --><dependency><gr…...
AI之HardWare:英伟达NvidiaGPU性价比排名(消费级/专业级/中高端企业级)以及据传英伟达Nvidia2025年将推出RTX 5090/5080、华为2025年推出910C/910D
AI之HardWare:英伟达NvidiaGPU性价比排名(消费级/专业级/中高端企业级)以及据传英伟达Nvidia2025年将推出RTX 5090/5080、华为2025年推出910C/910D 目录 英伟达NvidiaGPU性能排名(消费级/专业级/中高端企业级) NVIDIA中消费级和专业级 GPU NVIDIA中高端企业GPU …...
ESP32云开发二( http + led + lcd)
文章目录 前言先上效果图platformio.iniwokwi.tomldiagram.json源代码编译编译成功上传云端完结撒花⭐⭐⭐⭐⭐ 前言 阅读此篇前建议先看 此片熟悉下wokwi https://blog.csdn.net/qq_20330595/article/details/144289986 先上效果图 Column 1Column 2 platformio.ini wokwi…...
JavaScript语言的软件工程
JavaScript语言的软件工程 引言 在当今软件开发的浪潮中,JavaScript已不仅仅是一个简单的前端脚本语言。它的位置已经升华为全栈开发的重要语言之一,借助Node.js等技术,JavaScript不仅可以用于浏览器环境,还可以在后端服务器中运…...
【Qt】04-Lambda表达式
前言一、概念引入二、使用方法2.1 基本用法代码示例2.2 捕获外部变量2.3 参数列表 三、完整代码mywidget.cppsecondwidget.cppmywidget.hsecondwidget.h 总结 前言 一、概念引入 Lambda表达式(Lambda Expressions)是C11标准引入的一种匿名函数对象&…...
Golang 生态学习
1. Go 语言基础 在深入 Go 语言的生态之前,首先需要掌握 Go 语言本身的核心特性。 • Go 语言官方文档:https://golang.org/doc/ Go 官方文档是学习语言基础和标准库的首选资源。 • 学习内容: • 基础语法:数据类型、控制流…...
Arcgis Pro安装完成后启动失败的解决办法
场景 之前安装的Arcgis Pro 今天突然不能使用了,之前是可以使用的,自从系统更新了以后就出现了这个问题。 环境描述 Arcgis Pro 3.0 Windows 10 问题描述 打开Arcgis Pro,页面也不弹出来,打开任务管理器可以看到进程创建之后&…...
支持向量机SVM的应用案例
支持向量机(Support Vector Machine,SVM)是一种强大的监督学习算法,广泛应用于分类和回归任务。 基本原理 SVM的主要目标是周到一个最优的超平面,该超平面能够将不同类别的数据点尽可能分开,并且使离该超平面最近的数…...
Linux中的Iptables介绍
文章目录 iptables1. 概述2. **工作原理**3. 数据包处理流程与规则匹配顺序4. 常用的匹配条件5. 动作类型6. 基本命令7. 高级功能 iptables 1. 概述 Iptables 是一个用于配置 Linux 内核防火墙的用户空间工具。它能够对进出服务器的网络数据包进行过滤、修改和转发等操作&…...
14天学习微服务-->第2天:Spring Cloud深入与实践
第2天:Spring Cloud深入与实践 一、Spring Cloud核心组件深入 在微服务架构中,Spring Cloud 提供了一系列核心组件来支持服务的注册与发现、配置管理、负载均衡等功能。今天我们将深入学习其中的三个关键组件:Eureka/Nacos(服务…...
使用 Box2D 库开发愤怒的小鸟游戏
使用 Box2D 库开发愤怒的小鸟游戏 Box2D 是一个开源的 2D 物理引擎,广泛应用于游戏开发中,特别是在模拟物体的运动、碰撞、重力等方面。在本文中,我们将利用 Box2D 库开发一个简化版的 愤怒的小鸟 游戏。我们将一步步展示如何实现物理引擎的…...
C# ComboBox 控件属性
ComboBox 的基本属性 在C#中,ComboBox控件具有多种属性,这些属性可以帮助开发者更好地控制和管理控件的各个方面。以下是一些基本的ComboBox属性及其功能: 公共属性 AccessibilityObject:获取分配给该控件的AccessibleObject。 Ac…...
《keras 3 内卷神经网络》
keras 3 内卷神经网络 作者:Aritra Roy Gosthipaty 创建日期:2021/07/25 最后修改时间:2021/07/25 描述:深入研究特定于位置和通道无关的“内卷”内核。 (i) 此示例使用 Keras 3 在 Colab 中查看 GitHub …...
Linux:文件描述符fd、系统调用open
目录 一、文件基础认识 二、C语言操作文件的接口 1.> 和 >> 2.理解“当前路径” 三、相关系统调用 1.open 2.文件描述符 3.一切皆文件 4.再次理解重定向 一、文件基础认识 文件 内容 属性。换句话说,如果在电脑上新建了一个空白文档࿰…...
ToDesk设置临时密码和安全密码都可以当做连接密码使用
ToDesk 在各领域办公都已经是非常常见了 为了安全 ToDesk 设置了连接密码,想连接 需要输入远程码和连接密码 我们刚打开 系统默认给我们用的是临时密码,安全性确实很强 和定时Tokey一样,固定时间切换。 但是 如果我们要经常连接这个电脑&a…...
C#防止重复提交
C#防止重复提交 文章目录 C#防止重复提交前言防止重复提交的思路Web API 防止重复提交代码实现代码讲解使用方法 MVC防止重复提交总结 前言 当用户在前端进行提交数据时,如果网络出现卡顿和前端没有给出响应的话顾客通常都会狂点提交按钮,这样就很容易导…...
递归算法学习v2.2
46. 全排列 class Solution {List<List<Integer>> ret;List<Integer> path;boolean[] check;public List<List<Integer>> permute(int[] nums) {ret new ArrayList<>();path new ArrayList<>();check new boolean[nums.length…...
unity插件Excel转换Proto插件-ExcelToProtobufferTool
unity插件Excel转换Proto插件-ExcelToProtobufferTool **ExcelToProtobufTool 插件文档****1. 插件概述****2. 默认配置类:DefaultIProtoPathConfig****属性说明** **3. 自定义配置类****定义规则****示例代码** **4. 使用方式****4.1 默认路径****4.2 自定义路径**…...
manim(manimgl)安装教学-win11(2024-08)
manim 目前的两种版本:★★ 稍微捋一捋【项目中的 readme.md 十分重要】 manimgl 是 Grant Sanderson(YouTube频道 3Blue1Brown的作者)等人开发。 现在为 manimgl,在维护中。 manimCE 是2020年后的 manim 分支 manim community e…...
【语言处理和机器学习】概述篇(基础小白入门篇)
前言 自学笔记,分享给语言学/语言教育学方向的,但对语言数据处理感兴趣但是尚未入门,却需要在论文中用到的小伙伴,欢迎大佬们补充或绕道。ps:本文不涉及公式讲解(文科生小白友好体质)ÿ…...
脚本工具:PYTHON
Python 是一种高级编程语言,以其简洁清晰的语法和强大的功能被广泛应用于各种领域,包括自动化脚本编写、数据分析、机器学习、Web开发等。以下是一些关于使用 Python 编写脚本工具的基本介绍、常用库以及一些实用技巧总结。 这里写目录标题 基础知识安装…...
一文讲解Redis常见使用方式
1. 单机模式部署 适用场景: • 开发和测试环境,或者对高可用性要求不高的小型项目。 部署步骤: 1. 拉取 Redis 镜像: docker pull redis:latest 2. 运行 Redis 容器: docker run -d --name redis-single -p 637…...
Gin 源码概览 - 路由
本文基于gin 1.1 源码解读 https://github.com/gin-gonic/gin/archive/refs/tags/v1.1.zip 1. 注册路由 我们先来看一段gin代码,来看看最终得到的一颗路由树长啥样 func TestGinDocExp(t *testing.T) {engine : gin.Default()engine.GET("/api/user", f…...
【计算机网络】传输层协议TCP与UDP
传输层 传输层位于OSI七层网络模型的第四层,主要负责端到端通信,可靠性保障(TCP),流量控制(TCP),拥塞控制(TCP),数据分段与分组,多路复用与解复用等,通过TCP与UDP协议实现…...
iOS UIScrollView的一个特性
1如果UIScrollView 的contentSize.height > scrollView.bounds.size.height - scrollView.contentInset.top - scrollView.contentInset.bottom , 则scrollView就可以滚动,否则无法滚动 并且最大的滚动范围就是 contentSize.height - ( s…...
Docker 实现MySQL 主从复制
一、拉取镜像 docker pull mysql:5.7相关命令: 查看镜像:docker images 二、启动镜像 启动mysql01、02容器: docker run -d -p 3310:3306 -v /root/mysql/node-1/config:/etc/mysql/ -v /root/mysql/node-1/data:/var/lib/mysql -e MYS…...
python爬虫入门(实践)
python爬虫入门(实践) 一、对目标网站进行分析 二、博客爬取 获取博客所有h2标题的路由 确定目标,查看源码 代码实现 """ 获取博客所有h2标题的路由 """url "http://www.crazyant.net"import re…...
通过Ukey或者OTP动态口令实现windows安全登录
通过 安当SLA(System Login Agent)实现Windows安全登录认证,是一种基于双因素认证(2FA)的解决方案,旨在提升 Windows 系统的登录安全性。以下是详细的实现方法和步骤: 1. 安当SLA的核心功能 安…...
C 语言雏启:擘画代码乾坤,谛观编程奥宇之初瞰
大家好啊,我是小象٩(๑ω๑)۶ 我的博客:Xiao Xiangζั͡ޓއއ 很高兴见到大家,希望能够和大家一起交流学习,共同进步。* 这一课主要是让大家初步了解C语言,了解我们的开发环境,main函数,库…...
【Linux系统编程】—— 进程替换及其在操作系统中的应用与实现
文章目录 什么是进程替换?进程替换当中的接口单进程替换多进程的替换详解exec接口execlexeclpexecv 前言: 本篇博客将深入探讨进程替换的概念及其在操作系统中的作用。我们将介绍进程替换的基本原理,探讨操作系统如何通过进程的切换来实现任务…...
“裸奔”时代下该如何保护网络隐私
网络隐私的保护之道 引言 在这个信息爆炸的时代,网络已经深入到我们生活的每一个角落。你是否曾想过,在享受这些便利时,你的个人隐私正面临着严峻的挑战?网络隐私的现状警示着我们,信息泄露的事件屡见不鲜࿰…...
分类问题(二元,多元逻辑回归,费歇尔判别分析)spss实操
分类模型: 二分类和多分类: 对于二分类模型 ,我们将介绍逻辑回归和Fisher线性判别分析两种分类算法; 对于多分类模型,我们将简单介绍Spss中的多分类线性判别分析和多分类逻辑回归的操作步骤 二分类: 基于广义线性模型&#x…...
推荐一个开源的轻量级任务调度器!TaskScheduler!
大家好,我是麦鸽。 这次推荐一款轻量级的嵌入式任务调度器,目前已经有1.4K的star,这个项目比较轻量化,只有5个源文件,可以作为学习的一个开源项目。 核心文件 项目概述: 这是一个轻量级的协作式多任务处理&…...
Spring 核心技术解析【纯干货版】- IV:Spring 切面编程模块 Spring-Aop 模块精讲
随着软件开发技术的不断进步,面向切面编程(AOP)作为一种重要的编程思想,已经在现代开发中占据了重要地位。它通过将横切逻辑从业务逻辑中分离出来,使得代码更加清晰、易于维护。Spring AOP 作为 Spring 框架的核心模块…...
STM32之FreeRTOS开发介绍(十九)
STM32F407 系列文章 - freertos(十九) 目录 前言 一、简述 二、开源网址 三、原理及功能特性 1.原理简介 2.功能介绍 1.任务调度 2.任务管理 3.中断管理 4.消息队列 3.特点说明 4.优缺点 四、参考书籍 五、实现方式 总结 前言 FreeRTOS是…...
2024年美赛C题评委文章及O奖论文解读 | AI工具如何影响数学建模?从评委和O奖论文出发-O奖论文做对了什么?
模型假设仅仅是简单陈述吗?允许AI的使用是否降低了比赛难度?还在依赖机器学习的模型吗?处理题目的方法有哪些?O奖论文的优点在哪里? 本文调研了当年赛题的评委文章和O奖论文,这些问题都会在文章中一一解答…...
第14篇:从入门到精通:掌握python上下文管理器
第14篇:上下文管理器 内容简介 本篇文章将深入探讨Python中的上下文管理器(Context Manager)。您将了解上下文管理器的概念与用途,学习如何实现自定义的上下文管理器,以及如何使用contextlib模块来简化上下文管理器的…...
cuda从零开始手搓PB神经网络
cuda实现PB神经网络 基于上一篇的矩阵点乘,实现了矩阵的加减乘除、函数调用等。并且复用之前元编程里面写的梯度下降、Adam、NAdam优化方法。实现PB神经网络如下: #ifndef __BP_NETWORK_HPP__ #define __BP_NETWORK_HPP__ #include "matrix.hpp&quo…...
Java 大视界 -- Java 大数据物联网应用:数据处理与设备管理(八)
💖💖💖亲爱的朋友们,热烈欢迎你们来到 青云交的博客!能与你们在此邂逅,我满心欢喜,深感无比荣幸。在这个瞬息万变的时代,我们每个人都在苦苦追寻一处能让心灵安然栖息的港湾。而 我的…...
大模型之三十三- 开源Melo 语音合成
大模型之三十三- 开源Melo 语音合成 文本到语音(TTS)系统从基于基础音素的模型演变成复杂的端到端神经方法,这种方法可以直接将文本转换为语音。这一变革得益于深度学习的进步和计算能力的提升,已经在语音的自然度、韵律控制和跨语言能力方面取得了重大进展 。现代TTS系统…...
全同态加密理论、生态现状与未来展望(上)
《全同态加密理论、生态现状与未来展望》系列由lynndell2010gmail.com和mutourend2010gmail.com整理原创发布,分为上中下三个系列: 全同态加密理论、生态现状与未来展望(上):专注于介绍全同态加密理论知识。全同态加密…...