AbstractApplicationContext#refresh

spring 关键方法

org.springframework.context.support.AbstractApplicationContext#refresh

这个方法 是 线程安全的

synchronized (this.startupShutdownMonitor) { }

第一步,资源相关,初始化 属性资源 并验证

org.springframework.context.support.AbstractApplicationContext#prepareRefresh

initPropertySources(); 该方法提供给子类实现,实现该方法的子类有:

// org.springframework.web.context.support.AbstractRefreshableWebApplicationContext#initPropertySources
protected void initPropertySources() {
		ConfigurableEnvironment env = getEnvironment();
		if (env instanceof ConfigurableWebEnvironment) {
			((ConfigurableWebEnvironment) env).initPropertySources(this.servletContext, this.servletConfig);
		}
	}

public static void initServletPropertySources(MutablePropertySources sources,
			@Nullable ServletContext servletContext, @Nullable ServletConfig servletConfig) {

		Assert.notNull(sources, "'propertySources' must not be null");
		String name = StandardServletEnvironment.SERVLET_CONTEXT_PROPERTY_SOURCE_NAME;
		if (servletContext != null && sources.get(name) instanceof StubPropertySource) {
			sources.replace(name, new ServletContextPropertySource(name, servletContext));
		}
		name = StandardServletEnvironment.SERVLET_CONFIG_PROPERTY_SOURCE_NAME;
		if (servletConfig != null && sources.get(name) instanceof StubPropertySource) {
			sources.replace(name, new ServletConfigPropertySource(name, servletConfig));
		}
	}

// org.springframework.web.context.support.GenericWebApplicationContext#initPropertySources
protected void initPropertySources() {
		ConfigurableEnvironment env = getEnvironment();
		if (env instanceof ConfigurableWebEnvironment) {
			((ConfigurableWebEnvironment) env).initPropertySources(this.servletContext, null);
		}
	}


public static void initServletPropertySources(MutablePropertySources sources,
			@Nullable ServletContext servletContext, @Nullable ServletConfig servletConfig) {

		Assert.notNull(sources, "'propertySources' must not be null");
		String name = StandardServletEnvironment.SERVLET_CONTEXT_PROPERTY_SOURCE_NAME;
		if (servletContext != null && sources.get(name) instanceof StubPropertySource) {
			sources.replace(name, new ServletContextPropertySource(name, servletContext));
		}
		name = StandardServletEnvironment.SERVLET_CONFIG_PROPERTY_SOURCE_NAME;
		if (servletConfig != null && sources.get(name) instanceof StubPropertySource) {
			sources.replace(name, new ServletConfigPropertySource(name, servletConfig));
		}
	}
// org.springframework.web.context.support.StaticWebApplicationContext#initPropertySources
protected void initPropertySources() {
		WebApplicationContextUtils.initServletPropertySources(getEnvironment().getPropertySources(),
				this.servletContext, this.servletConfig);
	}

public static void initServletPropertySources(MutablePropertySources sources,
			@Nullable ServletContext servletContext, @Nullable ServletConfig servletConfig) {

		Assert.notNull(sources, "'propertySources' must not be null");
		String name = StandardServletEnvironment.SERVLET_CONTEXT_PROPERTY_SOURCE_NAME;
		if (servletContext != null && sources.get(name) instanceof StubPropertySource) {
			sources.replace(name, new ServletContextPropertySource(name, servletContext));
		}
		name = StandardServletEnvironment.SERVLET_CONFIG_PROPERTY_SOURCE_NAME;
		if (servletConfig != null && sources.get(name) instanceof StubPropertySource) {
			sources.replace(name, new ServletConfigPropertySource(name, servletConfig));
		}
	}

getEnvironment().validateRequiredProperties(); 验证属性值

// 获取 applicationListeners

// Store pre-refresh ApplicationListeners...
		if (this.earlyApplicationListeners == null) {
			this.earlyApplicationListeners = new LinkedHashSet<>(this.applicationListeners);
		}
		else {
			// Reset local application listeners to pre-refresh state.
			this.applicationListeners.clear();
			this.applicationListeners.addAll(this.earlyApplicationListeners);
		}

第二步:

// Tell the subclass to refresh the internal bean factory.
ConfigurableListableBeanFactory beanFactory = obtainFreshBeanFactory();

org.springframework.context.support.AbstractApplicationContext#refreshBeanFactory 是一个抽象方法,有两个实现:

第一个实现:

org.springframework.context.support.AbstractRefreshableApplicationContext#refreshBeanFactory

首先 DefaultListableBeanFactory beanFactory = new DefaultListableBeanFactory(getInternalParentBeanFactory());

配置 是否可以 覆盖bean 和 循环依赖

protected void customizeBeanFactory(DefaultListableBeanFactory beanFactory) {
		if (this.allowBeanDefinitionOverriding != null) {
			beanFactory.setAllowBeanDefinitionOverriding(this.allowBeanDefinitionOverriding);
		}
		if (this.allowCircularReferences != null) {
			beanFactory.setAllowCircularReferences(this.allowCircularReferences);
		}
	}

org.springframework.context.support.AbstractRefreshableApplicationContext#loadBeanDefinitions 调用 该方法加载bean信息,该方法由子类实现:

org.springframework.context.support.AbstractXmlApplicationContext#loadBeanDefinitions(org.springframework.beans.factory.support.DefaultListableBeanFactory)

org.springframework.web.context.support.AnnotationConfigWebApplicationContext#loadBeanDefinitions

org.springframework.web.context.support.GroovyWebApplicationContext#loadBeanDefinitions(org.springframework.beans.factory.support.DefaultListableBeanFactory)

org.springframework.web.context.support.XmlWebApplicationContext#loadBeanDefinitions(org.springframework.beans.factory.support.DefaultListableBeanFactory)

第二个实现:

org.springframework.context.support.GenericApplicationContext#refreshBeanFactory

protected final void refreshBeanFactory() throws IllegalStateException {
		if (!this.refreshed.compareAndSet(false, true)) {
			throw new IllegalStateException(
					"GenericApplicationContext does not support multiple refresh attempts: just call 'refresh' once");
		}
		this.beanFactory.setSerializationId(getId());
	}

因为 spring boot 启动 servlet模式使用的是 org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext 继承自 org.springframework.web.context.support.GenericWebApplicationContext,因此 这里实际基本等于啥都没做。而 beanfactory 在实例化 时构造。

public GenericApplicationContext() {
		this.beanFactory = new DefaultListableBeanFactory();
	}

第三步:

prepareBeanFactory(beanFactory);

设置 类加载器

beanFactory.setBeanClassLoader(getClassLoader());

设置Bean表达式解析器,以便解析Bean定义中的SpEL表达式

beanFactory.setBeanExpressionResolver(newStandardBeanExpressionResolver(beanFactory.getBeanClassLoader()));

 注册资源编辑器注册器,用于自定义属性编辑器支持

beanFactory.addPropertyEditorRegistrar(new ResourceEditorRegistrar(this, getEnvironment()));

// 添加ApplicationContextAwareProcessor,使得Bean能感知到ApplicationContext,加入private final List<BeanPostProcessor> beanPostProcessors = new CopyOnWriteArrayList<>();

beanFactory.addBeanPostProcessor(new ApplicationContextAwareProcessor(this));

// 配置BeanFactory忽略特定接口的依赖注入,这些接口的实现通常由框架直接提供服务,加入private final Set<Class<?>> ignoredDependencyInterfaces = new HashSet<>();

beanFactory.ignoreDependencyInterface(EnvironmentAware.class);
beanFactory.ignoreDependencyInterface(EmbeddedValueResolverAware.class);
beanFactory.ignoreDependencyInterface(ResourceLoaderAware.class);
beanFactory.ignoreDependencyInterface(ApplicationEventPublisherAware.class);
beanFactory.ignoreDependencyInterface(MessageSourceAware.class);
beanFactory.ignoreDependencyInterface(ApplicationContextAware.class);

// 注册可解析依赖:BeanFactory、ResourceLoader、ApplicationEventPublisher和ApplicationContext本身

beanFactory.registerResolvableDependency(BeanFactory.class, beanFactory);
beanFactory.registerResolvableDependency(ResourceLoader.class, this);
beanFactory.registerResolvableDependency(ApplicationEventPublisher.class, this);
beanFactory.registerResolvableDependency(ApplicationContext.class, this);

    // 添加早期后处理器,用于检测内部Bean作为ApplicationListener

beanFactory.addBeanPostProcessor(new ApplicationListenerDetector(this));

    // 如果存在LoadTimeWeaver,准备进行类加载期织入的配置

if (beanFactory.containsBean(LOAD_TIME_WEAVER_BEAN_NAME)) {
beanFactory.addBeanPostProcessor(new LoadTimeWeaverAwareProcessor(beanFactory));
// Set a temporary ClassLoader for type matching.

beanFactory.setTempClassLoader(new ContextTypeMatchClassLoader(beanFactory.getBeanClassLoader()));
}

    // 注册默认的环境相关Bean,如Environment、系统属性和系统环境变量

f (!beanFactory.containsLocalBean(ENVIRONMENT_BEAN_NAME)) {
beanFactory.registerSingleton(ENVIRONMENT_BEAN_NAME, getEnvironment());
}
if (!beanFactory.containsLocalBean(SYSTEM_PROPERTIES_BEAN_NAME)) {
beanFactory.registerSingleton(SYSTEM_PROPERTIES_BEAN_NAME, getEnvironment().getSystemProperties());
}
if (!beanFactory.containsLocalBean(SYSTEM_ENVIRONMENT_BEAN_NAME)) {
beanFactory.registerSingleton(SYSTEM_ENVIRONMENT_BEAN_NAME, getEnvironment().getSystemEnvironment());
}

第四步:

postProcessBeanFactory(beanFactory);

这个方法的实现比较多,有8个

// 	org.springframework.web.context.support.AbstractRefreshableWebApplicationContext#postProcessBeanFactory
protected void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) {
		beanFactory.addBeanPostProcessor(new ServletContextAwareProcessor(this.servletContext, this.servletConfig));
		beanFactory.ignoreDependencyInterface(ServletContextAware.class);
		beanFactory.ignoreDependencyInterface(ServletConfigAware.class);

		WebApplicationContextUtils.registerWebApplicationScopes(beanFactory, this.servletContext);
		WebApplicationContextUtils.registerEnvironmentBeans(beanFactory, this.servletContext, this.servletConfig);
	}

// org.springframework.boot.web.reactive.context.AnnotationConfigReactiveWebServerApplicationContext#postProcessBeanFactory
protected void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) {
		super.postProcessBeanFactory(beanFactory);
		if (!ObjectUtils.isEmpty(this.basePackages)) {
			this.scanner.scan(this.basePackages);
		}
		if (!this.annotatedClasses.isEmpty()) {
			this.reader.register(ClassUtils.toClassArray(this.annotatedClasses));
		}
	}

// org.springframework.boot.web.servlet.context.AnnotationConfigServletWebApplicationContext#postProcessBeanFactory
protected void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) {
		super.postProcessBeanFactory(beanFactory);
		if (!ObjectUtils.isEmpty(this.basePackages)) {
			this.scanner.scan(this.basePackages);
		}
		if (!this.annotatedClasses.isEmpty()) {
			this.reader.register(ClassUtils.toClassArray(this.annotatedClasses));
		}
	}
// org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext#postProcessBeanFactory
protected void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) {
		super.postProcessBeanFactory(beanFactory);
		if (this.basePackages != null && this.basePackages.length > 0) {
			this.scanner.scan(this.basePackages);
		}
		if (!this.annotatedClasses.isEmpty()) {
			this.reader.register(ClassUtils.toClassArray(this.annotatedClasses));
		}
	}

// org.springframework.web.context.support.GenericWebApplicationContext#postProcessBeanFactory
protected void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) {
		if (this.servletContext != null) {
			beanFactory.addBeanPostProcessor(new ServletContextAwareProcessor(this.servletContext));
			beanFactory.ignoreDependencyInterface(ServletContextAware.class);
		}
		WebApplicationContextUtils.registerWebApplicationScopes(beanFactory, this.servletContext);
		WebApplicationContextUtils.registerEnvironmentBeans(beanFactory, this.servletContext);
	}
// org.springframework.jca.context.ResourceAdapterApplicationContext#postProcessBeanFactory
protected void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
        beanFactory.addBeanPostProcessor(new BootstrapContextAwareProcessor(this.bootstrapContext));
        beanFactory.ignoreDependencyInterface(BootstrapContextAware.class);
        beanFactory.registerResolvableDependency(BootstrapContext.class, this.bootstrapContext);
        BootstrapContext var10002 = this.bootstrapContext;
        beanFactory.registerResolvableDependency(WorkManager.class, var10002::getWorkManager);
    }
}
//org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext#postProcessBeanFactory
protected void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) {
		beanFactory.addBeanPostProcessor(new WebApplicationContextServletContextAwareProcessor(this));
		beanFactory.ignoreDependencyInterface(ServletContextAware.class);
		registerWebApplicationScopes();
	}
//org.springframework.web.context.support.StaticWebApplicationContext#postProcessBeanFactory
protected void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) {
		beanFactory.addBeanPostProcessor(new ServletContextAwareProcessor(this.servletContext, this.servletConfig));
		beanFactory.ignoreDependencyInterface(ServletContextAware.class);
		beanFactory.ignoreDependencyInterface(ServletConfigAware.class);

		WebApplicationContextUtils.registerWebApplicationScopes(beanFactory, this.servletContext);
		WebApplicationContextUtils.registerEnvironmentBeans(beanFactory, this.servletContext, this.servletConfig);
	}

第五步:

invokeBeanFactoryPostProcessors(beanFactory);

protected void invokeBeanFactoryPostProcessors(ConfigurableListableBeanFactory beanFactory) {
		PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(beanFactory, getBeanFactoryPostProcessors());

		// Detect a LoadTimeWeaver and prepare for weaving, if found in the meantime
		// (e.g. through an @Bean method registered by ConfigurationClassPostProcessor)
		if (beanFactory.getTempClassLoader() == null && beanFactory.containsBean(LOAD_TIME_WEAVER_BEAN_NAME)) {
			beanFactory.addBeanPostProcessor(new LoadTimeWeaverAwareProcessor(beanFactory));
			beanFactory.setTempClassLoader(new ContextTypeMatchClassLoader(beanFactory.getBeanClassLoader()));
		}
	}

.获取所有的BeanFactoryPostProcessor

public List<BeanFactoryPostProcessor> getBeanFactoryPostProcessors() {
		return this.beanFactoryPostProcessors;
	}

. PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(beanFactory, getBeanFactoryPostProcessors());

这里也比较复杂,该函数用于在Spring应用程序上下文中调用BeanFactoryPostProcessor和BeanDefinitionRegistryPostProcessor的实例。这些处理器可以在Spring容器实例化任何bean之前修改bean的定义或bean工厂的配置。

第一部分:调用 BeanDefinitionRegistryPostProcessor

行 org.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor#postProcessBeanDefinitionRegistry

从bean工厂中读取所有的 BeanDefinitionRegistryPostProcessor

优先排序 并调用 实现了 org.springframework.core.PriorityOrdered 接口的。

然后排序 并调用 实现了 org.springframework.core.Ordered 接口的

最后调用剩下的

调用 所有的 org.springframework.beans.factory.config.BeanFactoryPostProcessor#postProcessBeanFactory

第二部分:调用 BeanFactoryPostProcessor

也是按照PriorityOrdered/Ordered 顺序调用

第六步:registerBeanPostProcessors(beanFactory);

这一步看着停复杂,实际就做一件事,读取所有的 BeanPostProcessor,按照优先级排序后

写入 org.springframework.beans.factory.support.AbstractBeanFactory#beanPostProcessors

第七/八步:

initMessageSource();

initApplicationEventMulticaster();

第九步:

onRefresh();

实现类也挺多

org.springframework.web.context.support.AbstractRefreshableWebApplicationContext#onRefresh

protected void onRefresh() {
this.themeSource = UiApplicationContextUtils.initThemeSource(this);
}

org.springframework.web.context.support.GenericWebApplicationContext#onRefresh

protected void onRefresh() {
this.themeSource = UiApplicationContextUtils.initThemeSource(this);
}

org.springframework.boot.web.reactive.context.ReactiveWebServerApplicationContext#onRefresh

protected void onRefresh() {
super.onRefresh();
try {
createWebServer();
}
catch (Throwable ex) {
throw new ApplicationContextException("Unable to start reactive web server", ex);
}
}

org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext#onRefresh

protected void onRefresh() {
super.onRefresh();
try {
createWebServer();
}
catch (Throwable ex) {
throw new ApplicationContextException("Unable to start web server", ex);
}
}

org.springframework.web.context.support.StaticWebApplicationContext#onRefresh

protected void onRefresh() {
this.themeSource = UiApplicationContextUtils.initThemeSource(this);
}

第十步:

registerListeners();

注册 ApplicationListener

第十一步:

finishBeanFactoryInitialization(beanFactory);

完成bean的实例化

第十二步:

/**
 * 完成此上下文的刷新操作,包括调用生命周期处理器的onRefresh()方法,
 * 发布ContextRefreshedEvent事件,以及参与LiveBeansView MBean(如激活)。
 */
protected void finishRefresh() {
    // 清除上下文级别的资源缓存(例如扫描期间获取的ASM元数据)。
    clearResourceCaches();

    // 初始化此上下文的生命周期处理器。
    initLifecycleProcessor();

    // 首先将刷新操作传播给生命周期处理器。
    getLifecycleProcessor().onRefresh();

    // 发布最终的刷新事件。
    publishEvent(new ContextRefreshedEvent(this));

    // 如LiveBeansView MBean处于活动状态,注册此应用上下文以参与其中。
    LiveBeansView.registerApplicationContext(this);
}

 

finally:

protected void resetCommonCaches() {
ReflectionUtils.clearCache();
AnnotationUtils.clearCache();
ResolvableType.clearCache();
CachedIntrospectionResults.clearClassLoader(getClassLoader());
}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mfbz.cn/a/746363.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

一家大型银行的电子课程示例

Logrus IT的专家为最大的金融公司之一开发了一门课程&#xff0c;作为一个交互式路线图&#xff0c;向用户介绍公司的业务部门。我们的设计师以企业风格创造了独特的布局&#xff0c;每个课程模块都被创造性地表示为一个单独的建筑。用户可以在部门之间进行非线性导航&#xff…

Java基础:常用类(四)

Java基础&#xff1a;常用类&#xff08;四&#xff09; 文章目录 Java基础&#xff1a;常用类&#xff08;四&#xff09;1. String字符串类1.1 简介1.2 创建方式1.3 构造方法1.4 连接操作符1.5 常用方法 2. StringBuffer和StringBuilder类2.1 StringBuffer类2.1.1 简介2.1.2 …

编程设计思想

健康检查脚本 nmap:扫描端口 while true do healthycurl B:httpPORT/healthy -i | grep HTTP/1.1 | tail -n 1 | awk {print $2} done 批量操作类型脚本&#xff08;记录每一步日志&#xff09; 将100个nginx&#xff1a;vn推送到harbor仓库192.168.0.100 根据镜像对比sha值…

jdk1.8升级到jdk11遇到的各种问题

一、第三方依赖使用了BASE64Decoder 如果项目中使用了这个类 sun.misc.BASE64Decoder&#xff0c;就会导致错误&#xff0c;因为再jdk11中&#xff0c;该类已经被删除。 Caused by: java.lang.NoClassDefFoundError: sun/misc/BASE64Encoder 当然这个类也有替换方式&#xf…

mysql查询2个日期之间的数据,表字段只有年和月,无日期字段查询的解决

1.核心mysql查询 SELECT * FROM 表名 WHERE CONCAT(year, -, LPAD(month, 2, 0)) > 2022-02-08 AND CONCAT(year, -, LPAD(month, 2, 0)) < 2024-06-06;2.表结构 CREATE TABLE ys_datezzq (id int(10) NOT NULL AUTO_INCREMENT,bid int(10) NOT NULL DEFAULT 0 COMMEN…

海外云服务器与传统服务器的对比与选择

在信息技术快速发展的今天&#xff0c;海外云服务器和传统服务器成为企业和个人用户的两大选择。它们各有优势&#xff0c;适用于不同的使用场景和需求。下面&#xff0c;我们将从多个角度对这两种服务器进行深入对比&#xff0c;帮助您做出更明智的决策。 基础设施 海外云服务…

【神经网络】深入理解多层神经网络(深度神经网络

&#x1f388;个人主页&#xff1a;豌豆射手^ &#x1f389;欢迎 &#x1f44d;点赞✍评论⭐收藏 &#x1f91d;希望本文对您有所裨益&#xff0c;如有不足之处&#xff0c;欢迎在评论区提出指正&#xff0c;让我们共同学习、交流进步&#xff01; 深入理解多层神经网络&#x…

【若依前后端分离】前端vue页面查看服务器本地的PDF

后端实现&#xff1a; 使用FileSystemResource包装文件&#xff0c;以便Spring MVC可以处理该资源 创建HttpHeaders对象以设置响应头 设置Content-Disposition头&#xff0c;使得浏览器以内联方式显示PDF&#xff08;即在浏览器中直接打开&#xff09; 设置Content-Type为appli…

编译器优化禁用对计算浮点加法运算时间的影响

编译器优化是现代编译器的重要功能&#xff0c;旨在提升程序的执行效率和性能。然而&#xff0c;在某些特定的测试或精确计算场景中&#xff0c;我们需要禁用这些优化以确保所有计算按预期执行。下面研究在 Keil 编译器中禁用和启用优化对执行多次次浮点除法运算时间的影响。 …

从云原生视角看 AI 原生应用架构的实践

本文核心观点&#xff1a; 基于大模型的 AI 原生应用将越来越多&#xff0c;容器和微服务为代表的云原生技术将加速渗透传统业务。API 是 AI 原生应用的一等公民&#xff0c;并引入了更多流量&#xff0c;催生企业新的生命力和想象空间。AI 原生应用对网关的需求超越了传统的路…

【SpringMVC】_SpringMVC实现留言墙

目录 1. 需求分析 2. 接口定义 2.1 提交留言 2.2 获取全部留言 3. 响应数据 4. 服务器代码 4.1 MessageInfo 文件 4.2 MessageController 文件 5. 前端页面代码 5. 运行测试 1. 需求分析 实现如下页面&#xff1a; 1、输入留言信息&#xff0c;点击提交后&#xff0…

Java版小程序商城免费搭建-直播商城平台规划及常见营销模式解析

平台概述 1. 平台组成 管理平台&#xff1a;提供全方位的系统设置、数据统计、商家管理、订单管理等后台管理功能。商家端&#xff1a;支持PC端和移动端操作&#xff0c;便于商家进行商品管理、订单处理、营销活动设置等。买家平台&#xff1a;覆盖H5网页、微信公众号、小程序…

MySQL实训--原神数据库

原神数据库 er图DDL/DML语句查询语句存储过程/触发器 er图 DDL/DML语句 SET NAMES utf8mb4; SET FOREIGN_KEY_CHECKS 0;DROP TABLE IF EXISTS artifacts; CREATE TABLE artifacts (id int NOT NULL AUTO_INCREMENT,artifacts_name varchar(255) CHARACTER SET utf8 COLLATE …

精益管理真的需要请咨询公司吗?看完这篇再决定

在当今这个追求效率和效益的时代&#xff0c;精益管理已成为众多企业提升竞争力的重要法宝。然而&#xff0c;面对复杂的精益转型过程&#xff0c;不少企业主和管理者开始犯难&#xff1a;做精益管理&#xff0c;一定要请咨询公司来帮忙吗&#xff1f;今天&#xff0c;我们就来…

DWC USB2.0协议学习1--产品概述

目录 1. 系统概述 1.1 AHB总线接口 1.2 Data RAM接口 1.3 PHY 接口 1.4 外部DMA控制器接口 1.5 其他可选接口 1.6 发送和接收FIFO 2. 功能列表 2.1 一般功能 2.2 可配置功能 2.3 应用接口功能 2.4 MAC-PHY接口特征 2.5 系统Memory体系结构 2.6 Non-DWORD对齐支持…

实训作业-人事资源管理系统

er图 模型图 DDL与DML DROP TABLE IF EXISTS departments; CREATE TABLE departments (department_id int(11) NOT NULL AUTO_INCREMENT COMMENT 部门ID,department_name varchar(100) NOT NULL COMMENT 部门名称,PRIMARY KEY (department_id),UNIQUE KEY department_name (de…

《黑神话悟空》电脑配置要求

《黑神话&#xff1a;悟空》这款国内优秀的3A游戏大作&#xff0c;拥有顶级的特效与故事剧情&#xff0c;自公布以来便备受玩家期待&#xff0c;其精美的画面与流畅的战斗体验&#xff0c;对玩家的电脑配置提出一定要求。那么这款优秀的游戏需要什么样的电脑配置&#xff0c;才…

BenchmarkSQL 对 MySQL 测试时请注意隔离级别!

BenchmarkSQL 是一款经典的开源数据库测试工具&#xff0c;内含了TPC-C测试脚本&#xff0c;可支持 Oracle、MySQL、PostgreSQL、SQL Server以及一些国产数据库的基准测试。 作者&#xff1a;李彬&#xff0c;爱可生 DBA 团队成员&#xff0c;负责项目日常问题处理及公司平台问…

GitLab配置免密登录之后仍然需要Git登录的解决办法

GitLab配置免密登录之后仍然需要Git登录的解决办法 因为实习工作需要&#xff0c;要在本地拉取gitlab上的代码&#xff0c;设置了密钥之后连接的时候还需要登录的token&#xff0c;摸索之后有了下面的解决办法。 方法一&#xff1a; 根据报错的提示&#xff0c;去网站上设置个人…

pytorch基础知识Tensor算术运算

1、Tensor的基本概念 标量是零维的张量&#xff0c;向量是一维的张量&#xff0c;矩阵是二维的张量 2、Tensor的创建 import torch"""常见的几个tensor创建""" a torch.Tensor([[1,2],[3,4]]) #2行2列的 print(a, a.type()) print(torch.on…