当前位置: 首页 > news >正文

spring cloud config server源码学习(一)

文章目录

  • 1. 注解EnableConfigServer
  • 2. ConfigServerAutoConfiguration
    • 2.1 @ConditionalOnBean和@ConditionalOnProperty
    • 2.2 @Import注解
      • 2.2.1. EnvironmentRepositoryConfiguration.class
      • 2.2.2. CompositeConfiguration.class
      • 2.2.3. ResourceRepositoryConfiguration.class
      • 2.2.4. ConfigServerEncryptionConfiguration.class
      • 2.2.5. ConfigServerMvcConfiguration.class
      • 2.2.6. ResourceEncryptorConfiguration.class
  • 3. EnvironmentRepository
  • 4. EnvironmentRepositoryConfiguration.class
  • 5. rest接口

spring cloud config server 作为一个spring boot工程,到底是如何运行起来的?似乎如上一篇文章中那样,引入了starter,启动了注解,配置了git的信息,就可以获取到数据了。那具体的原理是什么呢?

1. 注解EnableConfigServer

@EnableConfigServer
@SpringBootApplication
@EnableDiscoveryClient
public class ConfigServer {public static void main(String[] args) {SpringApplication.run(ConfigServer.class, args);}
}

可以看到启动类上加入注解@EnableConfigServer。我们查看该注解的源码:

@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Import(ConfigServerConfiguration.class)
public @interface EnableConfigServer {}

这个注解的定义当中,通过Import注解加载Bean ConfigServerConfiguration.class

@Configuration(proxyBeanMethods = false)
public class ConfigServerConfiguration {@Beanpublic Marker enableConfigServerMarker() {return new Marker();}class Marker {}}

这个Configuration类只是加载了一个 Bean Marker。
这是spring加载Bean的一种常用方式。

2. ConfigServerAutoConfiguration

在spring cloud config Server的jar中,org.springframework.boot.autoconfigure.AutoConfiguration.imports文件内包含了多个自动配置的类,其中就包括ConfigServerAutoConfiguration类。

org.springframework.cloud.config.server.bootstrap.ConfigServerBootstrapOverridesAutoConfiguration
org.springframework.cloud.config.server.config.ConfigServerAutoConfiguration
org.springframework.cloud.config.server.config.RsaEncryptionAutoConfiguration
org.springframework.cloud.config.server.config.DefaultTextEncryptionAutoConfiguration
org.springframework.cloud.config.server.config.EncryptionAutoConfiguration
org.springframework.cloud.config.server.config.VaultEncryptionAutoConfiguration

根据命名,可以看到各个自动配置类的功能,是启用bootstrap配置还是启用RSA加密等等。这里暂时先关注
ConfigServerAutoConfiguration类:

@Configuration(proxyBeanMethods = false)
@ConditionalOnBean(ConfigServerConfiguration.Marker.class)
@ConditionalOnProperty(name = ConfigServerProperties.PREFIX + ".enabled", matchIfMissing = true)
@EnableConfigurationProperties(ConfigServerProperties.class)
@Import({ EnvironmentRepositoryConfiguration.class, CompositeConfiguration.class, ResourceRepositoryConfiguration.class,ConfigServerEncryptionConfiguration.class, ConfigServerMvcConfiguration.class,ResourceEncryptorConfiguration.class })
public class ConfigServerAutoConfiguration {}

这个类的注解包含了三个重要的注解@ConditionalOnBean、@ConditionalOnProperty和@Import。

2.1 @ConditionalOnBean和@ConditionalOnProperty

当这两个注解出现在同一个类上的时候,两个Conditional条件必须同时满足,即ConfigServerConfiguration.Marker.class这个Bean存在的同时,还要满足Spring环境属性中存在 ConfigServerProperties.PREFIX + “.enabled” 属性且其值为 true,或者该属性缺失(由于 matchIfMissing = true)。这个PREFIX是spring.cloud.config.server。
这里刚好好上面通过@EnableConfigServer加载的Bean Marker.class呼应上。

2.2 @Import注解

Import注解引入了六个类要加载到spring context中。

2.2.1. EnvironmentRepositoryConfiguration.class

EnvironmentRepositoryConfiguration 是Spring Cloud Config Server中配置存储库的核心配置类。它负责创建和配置EnvironmentRepository实例,EnvironmentRepository用于从各种后端(如Git、SVN、本地文件系统等)获取配置属性。

定义和配置不同类型的EnvironmentRepository(如GitEnvironmentRepository、NativeEnvironmentRepository)。
通过注入不同的配置属性,来灵活配置不同类型的存储库。

2.2.2. CompositeConfiguration.class

CompositeConfiguration 负责配置和管理CompositeEnvironmentRepository。CompositeEnvironmentRepository允许将多个EnvironmentRepository组合在一起,以便从多个源获取配置。

配置CompositeEnvironmentRepository,将多个EnvironmentRepository实例组合成一个逻辑上的存储库。
提供从多个配置源合并配置属性的功能,以实现更复杂的配置管理场景。

2.2.3. ResourceRepositoryConfiguration.class

ResourceRepositoryConfiguration 负责配置与管理资源存储库(ResourceRepository)。ResourceRepository用于访问和管理配置服务器上的静态资源,如配置文件、密钥等。

配置不同类型的ResourceRepository,如文件系统资源存储库或Git资源存储库。
通过REST接口提供资源访问和管理功能。

2.2.4. ConfigServerEncryptionConfiguration.class

ConfigServerEncryptionConfiguration 负责配置加密和解密功能。它提供加密和解密配置属性的能力,确保敏感数据在传输和存储时得到保护。

配置加密器(TextEncryptor),用于加密和解密敏感配置信息。
提供加密和解密端点,允许客户端通过API进行加密和解密操作。

2.2.5. ConfigServerMvcConfiguration.class

ConfigServerMvcConfiguration 配置Spring MVC相关的组件,为Spring Cloud Config Server提供RESTful API。它定义了Config Server的主要控制器和路由。

定义Config Server的REST API端点,处理配置属性的请求。
配置HTTP请求处理、路由和控制器。

2.2.6. ResourceEncryptorConfiguration.class

ResourceEncryptorConfiguration 负责配置与资源加密相关的功能。它确保资源存储库中的敏感数据在存储和访问时得到加密保护。

配置用于资源加密和解密的组件。
提供加密资源的支持,确保静态资源的安全性。

3. EnvironmentRepository

对于 Spring Cloud Config 而言,它把所有的配置信息抽象为一种 Environment(环境),而存储这些配置信息的地方就称为 EnvironmentRepository。

public interface EnvironmentRepository {Environment findOne(String application, String profile, String label);default Environment findOne(String application, String profile, String label, boolean includeOrigin) {return findOne(application, profile, label);}}

spring cloud中把配置信息抽象为application,profile和label三个维度来管理,即哪一个应用application在什么样的环境profile下,使用哪一个label的配置数据。

4. EnvironmentRepositoryConfiguration.class

这个类里加载很多的内容,包括svn、git、jdbc等等的RepositoryConfiguration。其中有一个Configuration类是DefaultRepositoryConfiguration.class。这个是放在最后一个加载的配置,即默认的配置:

@Configuration(proxyBeanMethods = false)
@ConditionalOnMissingBean(value = EnvironmentRepository.class, search = SearchStrategy.CURRENT)
class DefaultRepositoryConfiguration {@Beanpublic MultipleJGitEnvironmentRepository defaultEnvironmentRepository(MultipleJGitEnvironmentRepositoryFactory gitEnvironmentRepositoryFactory,MultipleJGitEnvironmentProperties environmentProperties) throws Exception {return gitEnvironmentRepositoryFactory.build(environmentProperties);}}

这里是加载MultipleJGitEnvironmentRepository的Bean,由gitEnvironmentRepositoryFactory的build方法来构建:

public MultipleJGitEnvironmentRepository build(MultipleJGitEnvironmentProperties environmentProperties)throws Exception {if (this.connectionFactory.isPresent()) {HttpTransport.setConnectionFactory(this.connectionFactory.get());this.connectionFactory.get().addConfiguration(environmentProperties);}MultipleJGitEnvironmentRepository repository = new MultipleJGitEnvironmentRepository(this.environment,environmentProperties, ObservationRegistry.NOOP);repository.setTransportConfigCallback(transportConfigCallbackFactory.build(environmentProperties));if (this.server.getDefaultLabel() != null) {repository.setDefaultLabel(this.server.getDefaultLabel());}repository.setGitCredentialsProviderFactory(gitCredentialsProviderFactory);repository.getRepos().forEach((name, repo) -> repo.setGitCredentialsProviderFactory(gitCredentialsProviderFactory));return repository;}

而DefaultRepositoryConfiguration这个类,被GitRepositoryConfiguration继承了。

@Configuration(proxyBeanMethods = false)
@Profile("git")
class GitRepositoryConfiguration extends DefaultRepositoryConfiguration {}

也就是说 Spring Cloud Config 中默认使用 Git 作为配置仓库来完成配置信息的存储和管理,提供的 EnvironmentRepository 就是 MultipleJGitEnvironmentRepository,而 MultipleJGitEnvironmentRepository 则继承了抽象类 JGitEnvironmentRepository。

当服务器启动时,在 JGitEnvironmentRepository 中会决定是否调用 initClonedRepository() 方法来完成从远程 Git 仓库 Clone 代码。如果执行了这一操作,相当于会将配置文件从 Git 上 clone 到本地,然后再进行其他的操作。在 JGitEnvironmentRepository 抽象类中,提供了大量针对第三方 Git 仓库的操作代码,无论采用诸如 Git、SVN 等具体某一种配置仓库的实现方式,最终我们处理的对象都是位于本地文件系统中的配置文件。

请添加图片描述
在AbstractScmEnvironmentRepository类中

@Overridepublic synchronized Environment findOne(String application, String profile, String label) {return findOne(application, profile, label, false);}@Overridepublic synchronized Environment findOne(String application, String profile, String label, boolean includeOrigin) {NativeEnvironmentRepository delegate = new NativeEnvironmentRepository(getEnvironment(),new NativeEnvironmentProperties(), this.observationRegistry);Locations locations = getLocations(application, profile, label);delegate.setSearchLocations(locations.getLocations());Environment result = delegate.findOne(application, profile, "", includeOrigin);result.setVersion(locations.getVersion());result.setLabel(label);return this.cleaner.clean(result, getWorkingDirectory().toURI().toString(), getUri());}

在上面的findOne方法中,调用了NativeEnvironmentRepository类的findOne方法:

@Overridepublic Environment findOne(String config, String profile, String label, boolean includeOrigin) {try {ConfigurableEnvironment environment = getEnvironment(config, profile, label);DefaultResourceLoader resourceLoader = new DefaultResourceLoader();Map<org.springframework.core.env.PropertySource<?>, PropertySourceConfigData> propertySourceToConfigData = new HashMap<>();ConfigDataEnvironmentPostProcessor.applyTo(environment, resourceLoader, null,StringUtils.commaDelimitedListToSet(profile), new ConfigDataEnvironmentUpdateListener() {@Overridepublic void onPropertySourceAdded(org.springframework.core.env.PropertySource<?> propertySource,ConfigDataLocation location, ConfigDataResource resource) {propertySourceToConfigData.put(propertySource,new PropertySourceConfigData(location, resource));}});environment.getPropertySources().remove("config-data-setup");return clean(ObservationEnvironmentRepositoryWrapper.wrap(this.observationRegistry, new PassthruEnvironmentRepository(environment)).findOne(config, profile, label, includeOrigin), propertySourceToConfigData);}catch (Exception e) {String msg = String.format("Could not construct context for config=%s profile=%s label=%s includeOrigin=%b",config, profile, label, includeOrigin);String completeMessage = NestedExceptionUtils.buildMessage(msg,NestedExceptionUtils.getMostSpecificCause(e));throw new FailedToConstructEnvironmentException(completeMessage, e);}}

我们看到最终委托 PassthruEnvironmentRepository 完成配置文件的读取,然后通过 clean 方法完成本地文件地址与远程仓库之间地址的转换。ConfigDataEnvironmentUpdateListener用于监听Environment的更新。

5. rest接口

Server端获取到了数据,是通过rest接口来提供给client的。这里EnvironmentController提供了rest接口:

@GetMapping(path = "/{name}/{profiles:(?!.*\\b\\.(?:ya?ml|properties|json)\\b).*}",produces = MediaType.APPLICATION_JSON_VALUE)public Environment defaultLabel(@PathVariable String name, @PathVariable String profiles) {return getEnvironment(name, profiles, null, false);}@GetMapping(path = "/{name}/{profiles:(?!.*\\b\\.(?:ya?ml|properties|json)\\b).*}",produces = EnvironmentMediaType.V2_JSON)public Environment defaultLabelIncludeOrigin(@PathVariable String name, @PathVariable String profiles) {return getEnvironment(name, profiles, null, true);}@GetMapping(path = "/{name}/{profiles}/{label:.*}", produces = MediaType.APPLICATION_JSON_VALUE)public Environment labelled(@PathVariable String name, @PathVariable String profiles, @PathVariable String label) {return getEnvironment(name, profiles, label, false);}@GetMapping(path = "/{name}/{profiles}/{label:.*}", produces = EnvironmentMediaType.V2_JSON)public Environment labelledIncludeOrigin(@PathVariable String name, @PathVariable String profiles,@PathVariable String label) {return getEnvironment(name, profiles, label, true);}

这里要注意path路径的配置,在类注解上有@RequestMapping(method = RequestMethod.GET, path = “${spring.cloud.config.server.prefix:}”)可以配置前缀,不配置的话就是默认值“”。
在方法上的路径,是/name/profile/label。这个正是配置文件中配置的内容。

相关文章:

spring cloud config server源码学习(一)

文章目录 1. 注解EnableConfigServer2. ConfigServerAutoConfiguration2.1 ConditionalOnBean和ConditionalOnProperty2.2 Import注解2.2.1. EnvironmentRepositoryConfiguration.class2.2.2. CompositeConfiguration.class2.2.3. ResourceRepositoryConfiguration.class2.2.4.…...

人脸识别——探索戴口罩对人脸识别算法的影响

1. 概述 人脸识别是一种机器学习技术&#xff0c;广泛应用于各种领域&#xff0c;包括出入境管制、电子设备安全登录、社区监控、学校考勤管理、工作场所考勤管理和刑事调查。然而&#xff0c;当 COVID-19 引发全球大流行时&#xff0c;戴口罩就成了日常生活中的必需品。广泛使…...

磁盘管理后续——盘符漂移问题解决

之前格式化磁盘安装了文件系统&#xff0c;且对磁盘做了相应的挂载&#xff0c;但是服务器重启后挂载信息可能有问题&#xff0c;或者出现盘符漂移、盘符变化、盘符错乱等故障&#xff0c;具体是dev/sda, sdb, sdc 等等在某些情况下会混乱掉 比如sda变成了sdb或者sdc变成了sdb等…...

基于GO 写的一款 GUI 工具,M3u8视频下载播放器-飞鸟视频助手

M3u8视频下载播放器-飞鸟视频助手 M3u8视频飞鸟视频助手使用m3u8下载m3u8 本地播放 软件下载地址m3u8嗅探 M3u8视频 M3u8视频格式是为网络视频播放设计&#xff0c;视频网站多数采用 m3u8格式。如腾讯&#xff0c;爱奇艺等网站。 m3u8和 mp4的区别&#xff1a; 一个 mp4是一个…...

关于EasyExcel导入数据时表格日期格式识别为数字问题

参考官方地址 自定义日期转字符串转换器 /*** 自定义excel日期转换器** author li* date 2024-05-29*/ public class CustomStringDateConverter implements Converter<String> {Overridepublic Class<?> supportJavaTypeKey() {return String.class;}Overridep…...

高通Android 12/13打开省电模式宏开关

1、添加到SettingsProvider配置项宏开关 默认节电助手自动开启百分比battery saver frameworks\base\packages\SettingsProvider\src\com\android\providers\settings\DatabaseHelper.java private void loadGlobalSettings(SQLiteDatabase db) {在该方法中添加 ......final i…...

2023年西安交通大学校赛(E-雪中楼)

E.雪中楼 如果算出按南北的序列&#xff0c;再转成从低到高的编号序列&#xff0c;岂不是太麻烦了&#xff0c;幸好&#xff0c;没有在这方面费长时间&#xff0c;而是意识到&#xff0c;本质就是要从低到高的编号序列&#xff0c;所以我就按样例模拟了一下&#xff0c;当a[i]0…...

如何在vue2中使用tailwind

查看官方文档&#xff0c;不要去看过时的文章&#xff01; 使用官网推荐的第一个安装方法 Installation - Tailwind CSS vue版本&#xff1a;2.6.10 1. 安装tailwind的包 npm install -D tailwindcss npx tailwindcss init 2. tailwind.config.js 文件中的content是你需要…...

【OrangePi AIpro】开箱初体验以及OAK深度相机测试

1. 简介 Orangepi AIPRO 是一款采用昇腾AI技术路线&#xff0c;集成4核64位处理器AI处理器的单板计算机&#xff0c;集成图形处理器&#xff0c;支持8TOPS AI算力&#xff0c;拥有8GB/16GB LPDDR4X&#xff0c;可以外接eMMC模块&#xff0c;支持双4K高清输出。 Orange Pi AIpr…...

滑动窗口模板(Java)

题目描述 有一个长为 &#x1d45b; 的序列 &#x1d44e;&#xff0c;以及一个大小为 &#x1d458; 的窗口。现在这个从左边开始向右滑动&#xff0c;每次滑动一个单位&#xff0c;求出每次滑动后窗口中的最大值和最小值。 例如&#xff0c;对于序列 [1,3,−1,−3,5,3,6,7] …...

transformers.BertTokenizer入门使用

教程link 示例代码 from transformers import OpenAIGPTLMHeadModel, GPT2LMHeadModel, BertTokenizer import torch tokenizer BertTokenizer.from_pretrained("thu-coai/CDial-GPT_LCCC-large") model OpenAIGPTLMHeadModel.from_pretrained("thu-coai/CD…...

快乐数-力扣

使用一个set来存储遇到的每个数&#xff0c;如果遇到的数在set中&#xff0c;那么说明这个数不是快乐数&#xff0c;否则一直循环下去&#xff0c;直到n 1结束循环&#xff0c;表示这个数是个快乐数。 需要注意的是&#xff0c;给定一个数 n, 怎样对这个数 n 进行每一位求和。…...

Git标签的使用

天行健&#xff0c;君子以自强不息&#xff1b;地势坤&#xff0c;君子以厚德载物。 每个人都有惰性&#xff0c;但不断学习是好好生活的根本&#xff0c;共勉&#xff01; 文章均为学习整理笔记&#xff0c;分享记录为主&#xff0c;如有错误请指正&#xff0c;共同学习进步。…...

【uni-app】Pinia 持久化

小程序端 Pinia 持久化 说明&#xff1a;Pinia 用法与 Vue3 项目完全一致&#xff0c;uni-app 项目仅需解决持久化插件兼容性问题。 持久化存储插件 安装持久化存储插件&#xff1a; pinia-plugin-persistedstate pnpm i pinia-plugin-persistedstate插件默认使用 localStor…...

Flink 窗口

窗口&#xff08;Window&#xff09; 窗口是处理无限流的核心。 窗口将流分割成有限大小的“桶”&#xff0c;我们可以计算窗口中的数据。 窗口程序一般有键控流&#xff08;keyed streams&#xff09;的窗口程序 和 非键控流&#xff08;non-keyed streams&#xff09;的窗口…...

基于大模型和RAG技术实现的开源项目

基于大模型和RAG技术实现的开源项目 为解决大模型的不足&#xff0c;使用RAG技术增强大模型生成内容的针对性和可读性能力&#xff0c;有很多不错的开源项目。例如下面的项目。 1 ragflow 优点&#xff1a;可以对文档和知识库进行管理&#xff0c;构建不同的知识库&#xff…...

mac m1安装homebrew管理工具(brew命令)完整流程

背景 因为mac上的brew很久没用了&#xff0c;版本非常旧&#xff0c;随着mac os的更新&#xff0c;本机的homebrew大部分的功能都无法使用&#xff0c;幸好过去通过brew安装的工具比较少&#xff0c;于是决定重新安装一遍brew。 卸载旧版brew 法一&#xff1a;通过使用线上…...

Liunx学习随笔

Linux学习随笔 Linux学习随笔一.前期准备1.安装Vmware Workstation软件2.下载linux镜像3.安装操作系统4.配置静态ip5.下载安装远程连接工具 二.语法2.1 linux哲学思想(原则)2.2 小命令 夕阳无限好&#xff0c;只是近黄昏&#xff0c;时隔一年&#xff0c;重新提笔 没有比脚更远…...

mac中文件夹怎么显示.git隐藏文件

1. 打开终端应用程序&#xff0c;然后进入到包含.git文件夹的目录&#xff0c;可以使用以下命令来显示隐藏文件和文件夹&#xff1a; defaults write com.apple.finder AppleShowAllFiles YES 2. 然后重启 Finder&#xff1a; killall Finder...

【PB案例学习笔记】-13 徒手做个电子时钟

写在前面 这是PB案例学习笔记系列文章的第11篇&#xff0c;该系列文章适合具有一定PB基础的读者。 通过一个个由浅入深的编程实战案例学习&#xff0c;提高编程技巧&#xff0c;以保证小伙伴们能应付公司的各种开发需求。 文章中设计到的源码&#xff0c;小凡都上传到了gite…...

国防科技大学计算机基础课程笔记02信息编码

1.机内码和国标码 国标码就是我们非常熟悉的这个GB2312,但是因为都是16进制&#xff0c;因此这个了16进制的数据既可以翻译成为这个机器码&#xff0c;也可以翻译成为这个国标码&#xff0c;所以这个时候很容易会出现这个歧义的情况&#xff1b; 因此&#xff0c;我们的这个国…...

[2025CVPR]DeepVideo-R1:基于难度感知回归GRPO的视频强化微调框架详解

突破视频大语言模型推理瓶颈,在多个视频基准上实现SOTA性能 一、核心问题与创新亮点 1.1 GRPO在视频任务中的两大挑战 ​安全措施依赖问题​ GRPO使用min和clip函数限制策略更新幅度,导致: 梯度抑制:当新旧策略差异过大时梯度消失收敛困难:策略无法充分优化# 传统GRPO的梯…...

线程同步:确保多线程程序的安全与高效!

全文目录&#xff1a; 开篇语前序前言第一部分&#xff1a;线程同步的概念与问题1.1 线程同步的概念1.2 线程同步的问题1.3 线程同步的解决方案 第二部分&#xff1a;synchronized关键字的使用2.1 使用 synchronized修饰方法2.2 使用 synchronized修饰代码块 第三部分&#xff…...

Mybatis逆向工程,动态创建实体类、条件扩展类、Mapper接口、Mapper.xml映射文件

今天呢&#xff0c;博主的学习进度也是步入了Java Mybatis 框架&#xff0c;目前正在逐步杨帆旗航。 那么接下来就给大家出一期有关 Mybatis 逆向工程的教学&#xff0c;希望能对大家有所帮助&#xff0c;也特别欢迎大家指点不足之处&#xff0c;小生很乐意接受正确的建议&…...

连锁超市冷库节能解决方案:如何实现超市降本增效

在连锁超市冷库运营中&#xff0c;高能耗、设备损耗快、人工管理低效等问题长期困扰企业。御控冷库节能解决方案通过智能控制化霜、按需化霜、实时监控、故障诊断、自动预警、远程控制开关六大核心技术&#xff0c;实现年省电费15%-60%&#xff0c;且不改动原有装备、安装快捷、…...

《基于Apache Flink的流处理》笔记

思维导图 1-3 章 4-7章 8-11 章 参考资料 源码&#xff1a; https://github.com/streaming-with-flink 博客 https://flink.apache.org/bloghttps://www.ververica.com/blog 聚会及会议 https://flink-forward.orghttps://www.meetup.com/topics/apache-flink https://n…...

用docker来安装部署freeswitch记录

今天刚才测试一个callcenter的项目&#xff0c;所以尝试安装freeswitch 1、使用轩辕镜像 - 中国开发者首选的专业 Docker 镜像加速服务平台 编辑下面/etc/docker/daemon.json文件为 {"registry-mirrors": ["https://docker.xuanyuan.me"] }同时可以进入轩…...

网络编程(UDP编程)

思维导图 UDP基础编程&#xff08;单播&#xff09; 1.流程图 服务器&#xff1a;短信的接收方 创建套接字 (socket)-----------------------------------------》有手机指定网络信息-----------------------------------------------》有号码绑定套接字 (bind)--------------…...

什么是Ansible Jinja2

理解 Ansible Jinja2 模板 Ansible 是一款功能强大的开源自动化工具&#xff0c;可让您无缝地管理和配置系统。Ansible 的一大亮点是它使用 Jinja2 模板&#xff0c;允许您根据变量数据动态生成文件、配置设置和脚本。本文将向您介绍 Ansible 中的 Jinja2 模板&#xff0c;并通…...

人机融合智能 | “人智交互”跨学科新领域

本文系统地提出基于“以人为中心AI(HCAI)”理念的人-人工智能交互(人智交互)这一跨学科新领域及框架,定义人智交互领域的理念、基本理论和关键问题、方法、开发流程和参与团队等,阐述提出人智交互新领域的意义。然后,提出人智交互研究的三种新范式取向以及它们的意义。最后,总结…...