SpringBoot学习(四)NoSQL、接口文档、远程调用、消息服务、Web安全、可观测性、AOT

文章目录

  • NoSQL
    • Redis整合
      • 场景整合
      • 自动配置原理
      • 定制化
        • 序列化机制
        • redis客户端
  • 接口文档
    • OpenAPI3架构
    • 整合
    • 使用
      • 常用注解
      • Docket配置
  • 远程调用
    • WebClient
      • 创建与配置
      • 获取响应
      • 定义请求体
    • HTTP interface
      • 导入依赖
      • 定义接口
      • 创建代理&测试
  • 消息服务
    • 消息队列-场景
      • 异步
      • 解耦
      • 削峰
      • 缓冲
    • 消息队列-Kafka
      • 消息模式
      • Kafka工作原理
      • SpringBoot整合
      • 消息发送
      • 消息监听
      • 参数配置
  • Web安全
    • 安全架构
      • 认证:`Authentication`
      • 授权:`Authorization`
      • 攻击防护
      • 权限模型
    • Spring Security原理
      • 过滤器链架构
      • `FilterChainProxy`
      • `SecurityFilterChain`
    • 使用
      • `HttpSecurity`
      • `MethodSecurity`
      • 核心
    • 实际应用
  • 可观测性
    • SpringBoot Actuator
      • 实战
        • 引入依赖
        • 暴露指标
        • 访问数据
      • Endpoint
        • 常用端点
        • 定制端点
    • 监控案例
      • 安装Prometheus+Grafana
      • 导入依赖
      • 配置Prometheus拉取数据
  • AOT
    • AOT与JIT
      • Complier与Interpreter
      • AOT与JIT对比
      • JVM架构
      • Java的执行过程
        • 流程概要
        • 详细流程
        • JVM编译器
        • 分层编译

NoSQL

Redis整合

场景整合

  1. 依赖
<dependency>
	<groupId>org.springframework.boot</groupId>
	<artifactId>spring-boot-starter-data-redis</artifactId>
</dependency>
  1. 配置
spring.data.redis.host=192.168.200.100
spring.data.redis.password=AbC123!@!
  1. 数据类型
    k/v:value可以为许多类型
    sring:普通字符串:redisTemplate.opsForValue()
    list:列表:redisTemplate.opsForList()
    set:集合:redisTemplate.opsForSet()
    zset:有序集合:redisTemplate.opsForZSse()
    hash:map结构:redisTemplate.opsForHash()

自动配置原理

  1. META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports中导入RedisAutoConfigurationRedisReactiveAutoConfigurationRedisRepositoriesAutoCOnfiguration,所有属性绑定RedisProperties
  2. RedisReactiveAutoConfiguration属于响应式编程,RedisRepositoriesAutoCOnfiguration属于JPA操作,两者无需主动处理
  3. RedisAutoConfiguration配置了:
  • LettuceConnectionConfiguration:向容器中注入连接工厂LettuceConnectionFactory和操作redis的客户端DefaultClientResources
  • RedisTemplate<Object, Object>:可给redis中存储任意对象,会使用jdk默认序列化方式
  • StringRedisTemplate:给redis中存储字符串,若要存储对象,则需使用者自行序列化,key-value都以字符串形式进行操作

定制化

序列化机制
@Configuration
public class AppRedisConfiguration {
	/**
	 *允许Object类型的key-value都能够转换为json存储
	 *@param redisConnectionFactory自动配置好连接工厂
	 *@return
	 */
	@Bean
	public RedisTemplate<Object, Object> redisTemplate(RedisConnectionFactory redisconnectionFactory) {
		RedisTemplate<Object, Object> template = new RedisTemplate<>();
		template.setConnectionFactory(redisConnectionFactory);
		template.setDefaultSerializer(new GenericJackson2JsonRedisSerializer());
		return template;
	}
}
redis客户端
  1. RedisTemplateStringRedisTemplate:操作redis的工具类
  2. 要从redis连接工厂获取连接才能操作redis
  3. redis客户端:
  • Lettuce:默认
  • Jedis:可以使用以下依赖切换
<dependency>
	<groupId>org.springframework.boot</groupId>
	<artifactId>spring-boot-starter-data-redis</artifactId>
	<exclusions>
		<exclusion>
			<groupId>io.lettuce</groupId>
			<artifactId>lettuce-core</artifactId>
		</exclusion>
	</exclusions>
</dependency>
<!--切换jedis作为redis底层客户端-->
<dependency>
	<groupId>redis.clients</groupId>
	<artifactId>jedis</artifactId>
</dependency>

接口文档

Swagger快速生成实时接口文档,便于前后开发人员进行协调沟通,遵循OpenAPI规范

OpenAPI3架构

在这里插入图片描述

整合

  1. 导入依赖
<dependency>
	<groupId>org.springdoc</groupId>
	<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
	<version>2.1.0</version>
</dependency>
  1. 配置
springdoc.api-docs.path=/api-docs
springdoc.swagger-ui.path=/swagger-ui.html
springdoc.show-actuator=true

使用

常用注解

注解标注位置作用
@Tagcontroller类标识controller作用
@Parameter参数标识参数作用
@Parameters参数参数多重说明
@Schemamodel层的JavaBean描述模型作用及每个属性
@Operation方法描述方法作用
@ApiResponse方法描述响应状态码等

Docket配置

  1. 若有多个Docket
@Bean
public GroupedOpenApi publicApi() {
	return GroupedOpenApi.builder()
			.group("springshop-public")
			.pathsToMatch("/public/**")
			.build();
}
@Bean
public GroupedOpenApi adminApi() {
	return GroupedOpenApi.builder()
			.group("springshop-admin")
			.pathsToMatch("/admin/**")
			.addMethodFilter(method->method.isAnnotationPresent(Admin.class))
			.build();
}
  1. 若只有一个Docket
springdoc.packageToScan=package1, package2
springdoc.pathToMatch=/v1,/api/balance/**

远程调用

  1. RPC(Remote Procedure Call)
  2. 本地过程调用:不同方法在同一个JVM上运行
    远程过程调用:
  • 服务提供者
  • 服务消费者
  • 通过连接对方服务器进行请求/相应交互,实现调用效果

WebClient

非阻塞、响应式HTTP客户端

创建与配置

  1. 发送请求
  • 请求方式:GET POST DELETE XXX
  • 请求路径:/xxx
  • 请求参数:aa=bb&cc=dd&xxx
  • 请求头:aa=bb cc=dd
  • 请求体
  1. 创建:
  • WebClient.create()
  • WebClient(String baseUrl)
  1. 使用WebClient.builder()配置参数项
  • uriBuilderFactory
  • defaultUriVariables默认uri变量
  • defaultHeader每个请求默认头
  • defaultCookie每个请求默认cookie
  • defaultRequest-Consumer自定义每个请求
  • filter过滤client发送的每个请求
  • exchangeStrategies自定义HTTP消息reader/writer
  • clientConnectorHTTPclient库设置
WebClient client = WebClient.create("https://example.org");

获取响应

retrieve()方法用于声明如何提取响应数据

//获取响应完整信息
WebClient client = WebClient.create("https://example.org");
Mono<ResponseEntity<Person>> result = client.get()
		.uri("/persons/{id}",id)
		.accept(MediaType.APPLICATION_JSON)
		.retrieve()
		.toEntity(Person.class);
//只获取body
WebClient client = WebClient.create("https://example.org");
Mono<Person> result = client.get()
		.uri("/persons/{id}",id)
		.accept(MediaType.APPLICATION_JSON)
		.retrieve()
		.bodyToMono(Person.class);
//stream数据
Flux<Quoto> result = client.get()
		.uri("/quotes")
		.accept(MediaType.TEXT_EVENT_STREAM)
		.retrieve()
		.bodyToFlux(Quoto.class);
//定义错误处理
Mono<Person> result = client.get()
		.uri("/persons/{id}",id)
		.accept(MediaType.APPLICATION_JSON)
		.retrieve()
		.onStatus(HttpStatus::is4xxClientError,response->...)
		.onStatus(HttpStatus::is5xxClientError,response->...)
		.bodyToMono(Person.class);

定义请求体

  1. 响应式-单个数据
Mono<Person> personMono = ...;
Mono<Void> result = client.post()
		.uri("/persons/{id}",id)
		.contentType(MediaType.APPLICATION_JSON)
		.body(personMono, Person.class)
		.retrieve()
		.bodyToMono(Void.class);
  1. 响应式-多个数据
Flux<Person> personFlux = ...;
Mono<Void> result = client.post()
		.uri("/persons/{id}",id)
		.contentType(MediaType.APPLICATION_STREAM_JSON)
		.body(personFlux, Person.class)
		.retrieve()
		.bodyToMono(Void.class);
  1. 普通对象
Person person = ...;
Mono<Void> result = client.post()
		.uri("/persons/{id}",id)
		.contentType(MediaType.APPLICATION_JSON)
		.bodyValue(person)
		.retrieve()
		.bodyToMono(Void.class);

HTTP interface

Spring允许通过定义接口的方式,向任意位置发送http请求,实现远程调用。可用来简化HTTP远程访问,需在webflux场景下

导入依赖

<dependency>
	<groupId>org.springframework.boot</groupId>
	<artifactId>spring-boot-starter-webflux</artifactId>
</dependency>

定义接口

public class BingService {
	@GetExchange(url = "/search")
	String search(@RequestParam("q") String keyword);
}

创建代理&测试

@SpringBootTest
class ApplicationTest {
	@Test
	void contextLoad() throws InterruptedException {
		//创建客户端
		WebClient client = WebClient.builder()
				.baseUrl("https://cn.bing.com")
				.codecs(clientCodeConfigurer->{
					clientCodeConfigurer
							.defaultCodecs()
							.maxInMemorySize(256*1024*1024);
					})
				.build();
		//创建工厂
		HttpServiceProxyFactory factory = HttpServiceProxyFactory
				.builder(WebClientAdapter.forClient(client)).build();
		//获取代理对象
		BingService bingService = factory.createClient(BingService.class);
		//测试调用
		Mono<String> search = bingService.search("xxx");
		System.out.println("---------");
		search.subscribe(str->System.out.println(str));
		Thread.sleep(10000);
	}
}

消息服务

消息队列-场景

异步

在这里插入图片描述

解耦

在这里插入图片描述

削峰

在这里插入图片描述

缓冲

在这里插入图片描述

消息队列-Kafka

消息模式

在这里插入图片描述

Kafka工作原理

在这里插入图片描述

SpringBoot整合

  1. 导入依赖
<dependency>
	<groupId>org.springfrramework.kafka</groupId>
	<artifactId>spring-kafka</artifactId>
</dependency>
  1. 配置
#服务器公网IP:本机端口号
spring.kafka.bootstrap-servers=172.20.128.1:9002
  1. host
    C:\Windows\System32\drivers\etc\hosts文件配置x.x.x.x(IP地址) kafka(主机名)

消息发送

@SpringBootTest
class KafkaTest {
	@Autowired
	KafkaTemplate kafkaTemplate;
	@Test
	void contextLoads() throws ExecutionException, InterruptedException {
		StopWatch watch = new StopWatch();
		watch.start();
		CompletableFuture[] futures = new CompletableFuture[10000];
		for (int i = 0; i < 10000; i++) {
			CompletableFuture send = kafkaTemplate.send("order", "order.create."+i, "订单"+i);
			futures[i] = send;
		}
		CompletableFuture.allof(futures).join();
		watch.stop();
		System.out.println(watch.getTotalTimeMillis());
	}
}
@Component
public class MyBean {
	private final KafkaTemplate<String, String> kafkaTemplate;
	public MyBean(KafkaTemplate<String, String> kafkaTemplate) {
		this.kafkaTemplate = kafkaTemplate;
	}
	public void someMethod() {
		this.kafkaTemplate.send("someTopic", "Hello");
	}
}

消息监听

@Component
public class OrderMsgListener {
	@KafkaListener(topics = "order", groupId = "order-service")
	public void listen(ConsumerRecord record) {
		System.out.println("收到"+record);
	}
	@KafkaListener(groupId = "order-service-2", topicPartitions = {
		@TopicPartition(topic = "order", partitionOffsets = {
			@PartitionOffset(partition = "0", initialOffset = "0")
		})
	})
	public void listenAll(ConsumerRecord record) {
		System.out.println("收到" + record);
	}
}

参数配置

KafkaAutoConfiguration

  1. kafka的所有配置都以spring.kafka.开头
  • bootstrapServers:kafka集群的所有服务器地址
  • properties:参数设置
  • consumer:消费者
  • producer:生产者
  1. @EnableKafka:开启kafka的注解驱动功能
  2. KafkaTemplate:收发消息
  3. KafkaAdmin:维护主题等
  4. @EnableKafka + @KafkaListener接收消息
  • 消费者来接受消息,须有group-id
  • 收消息使用@KafkaListener + ConsumerRecord
  • spring.kafka.开始的所有配置

Web安全

  • Apache Shiro
  • Spring Security(使用)

安全架构

认证:Authentication

登录系统、用户系统

  • 身份

授权:Authorization

权限管理、用户授权

  • 权限

攻击防护

  • XSS(Cross-site scripting)
  • CSRF(Cross-site request forgery)
  • CORS(Cross-Origion Resource Sharing)
  • SQL注入

权限模型

  1. RBAC(Role Based Access Controll)
  • 用户
  • 角色
  • 权限
  1. ACL(Access Controll List)
  • 用户
  • 用户_权限【N-N关系需要中间表】
  • 权限

Spring Security原理

过滤器链架构

在这里插入图片描述

FilterChainProxy

在这里插入图片描述

SecurityFilterChain

在这里插入图片描述

使用

HttpSecurity

@Configuration
@Order(SecurityProperties.BASIC_AUTH_ORDER - 10)
public class ApplicationConfigurerAdapter extends WebSecurityConfigurerAdapter {
	@Override
	protected void configure(HttpSecurity http) throws Exception {
		http.antMatcher("/match1/**")
			.authorizeRequests()
			.antMatchers("/match1/user"),hasRole("USER")
			.antMatchers("/match1/spam").hasRole("SPAM")
			.anyRequest().isAuthenticated();
	}
}

MethodSecurity

@SpringBootApplication
@EnableGlobalMethodSecurity(securedEnabled = true)
public class SamleSecureApplication {...}
@Service
public class MyService {
	@Secured("ROLE_USER")
	public String secure() {
		return "Security";
	}
}

核心

  1. WebSecurityConfigurerAdapter
  2. @EnableGlobalMethodSecurity:开启全局方法安全配置
  • @Secured
  • @PreAuthorize
  • @PostAuthorize
  1. UserDetailDervice:向数据库查询用户详细信息的Service

实际应用

  1. 引入依赖
<dependency>
	<groupId>org.springframework.boot</groupId>
	<artifactId>spring-boot-starter-security</artifactId>
</dependency>
  1. Security场景的自动配置类
  • SecurityAutoConfiguration
  • SpringBootWebSecurityConfiguration
  • SecurityFilterAutoConfiguration
  1. security所有配置在SecurityProperties中以spring.security.开头
  2. 默认SecurityFilterChain组件
  • 所有请求都要求认证(登录)
  • 开启表单登录:spring security提供默认登录页,所有请求都要求登录
  • httpbasic方式登录
  1. @EnableWebSecurity生效
  • WebSecurityConfiguration生效:web安全配置
  • HttpSecurityConfiguration生效:http安全配置
  • @EnableGlobalAuthentication生效:全局认证生效
  • AuthenticationConfiguration:认证配置

可观测性

Observability

  • 健康状况(组件状态、存活状态)
  • 运行指标(cpu、内存、垃圾回收、吞吐量、相应成功率)
  • 链路追踪

SpringBoot Actuator

实战

引入依赖
<dependency>
	<groupId>org.springframework.boot</groupId>
	<artifactId>spring-boot-starter-actuator</artifactId>
<dependency>
暴露指标
management:
  endpoints:
    enabled-by-default:true #暴露所有站点信息
    web:
      exposure:
        include:'*' #以web方式暴露
访问数据

访问http://localhost:8080:/actuator展示出所有可用的监控端点

  • http://localhost:8080:/actuator/beans
  • http://localhost:8080:/actuatorconfigprops
  • http://localhost:8080:/actuator/metrics
  • http://localhost:8080:/actuatormetrics/jvm.gc.pause
  • http://localhost:8080:/actuator/endpointName/detailPath

Endpoint

常用端点
ID描述
auditevents暴露当前应用程序的审核事件。需要一个AuditEventRepository组件
beans显示应用程序中所有SpringBean的完整列表
caches暴露可用缓存
conditions显示自动配置的所有条件信息,包括匹配或不匹配的原因
configprops显示所有@ConfigurationProperties
env暴露Spring的属性ConfigurableEnviroment
flyway显示已应用的所有Flyway数据库迁移。需要一个或多个Flyway组件
health显示应用程序运行状况信息
httptrace显示HTTP跟踪信息(默认情况下,最近的100个HTTP请求-响应)。需要一个HttpTraceRepository组件
info显示应用程序信息
integrationgraph显示SpringIntegrationgraph。需要spirng-integration-core依赖
loggers显示和修改应用程序中日志的配置
liquibase显示已应用的所有Liquibase数据库迁移。需要一个或多个Liquibase组件
metrics显示当前应用程序的“指标”信息
mappings显示所有@RequestMapping路径列表
scheduletasks显示应用程序中的计划任务
sessions允许从Spring Session支持的会话存储中检索和删除用户会话。需要使用Spring Session中基于Servlet的Web应用程序
shutdown使应用程序正常关闭。默认禁用
startup显示由ApplicationStartup收集的启动步骤数据。需要使用SpringApplication进行配置BufferingApplicationStartup
threaddump执行线程转储
heapdump返回hprof堆转储文件
jolokia通过HTTP暴露JMX bean。需要引入jolokia-core依赖,不适用于WebFlux
logfile返回日志文件的内容(若已设置logging.file.namelogging.file.path属性)。支持使用HTTPRange标头来检索部分日志文件的内容
prometheus以Prometheus服务器可抓取的格式公开指标。需要micrometer-registry-prometheus依赖
定制端点
  • 健康监控:返回存活、死亡
  • 指标监控:次数、率
  1. HealthEndpoint
@Component
public class MyHealthIndicator implements HealthIndicator {
	@Override
	public Health health() {
		int errorCode = check();
		if (errorCode != 0) {
			return Health.downI();
		}
		return Health.up().build();
	}
}
  1. MetricsEndpoint
class MyService  {
	Counter counter;
	public MyService(MeterRegistry meterRegistry){
		counter = meterResgistry.counter"
	}
	public void hello() {
		counter.increment();
	}
}

监控案例

安装Prometheus+Grafana

# Prometheus:时序数据库
docker run -p 9090:9090 -d\
-v pc:/etc/prometheus
# grafana:默认账号密码admin:admin
docker run -d --name = grafana -p 3000: 3000 grafana/grafana

导入依赖

<dependency>
   <groupId>org.springframewokr.boot</groupId>
   <artifactId>spring-boot-starter-actuator</artifactId>
<dependency>
<dependency>
   <groupId>io.micrometer</groupId>
   <artifactId>micrometer-registry-prometheus</artifactId>
   <version>1.10.6</version>
<dependency>
management:
  endpoints:
    web:
      exposure: #暴露所有监控哨点
        include: '*'

配置Prometheus拉取数据

scrape_configs:
  - job_name:'spring-boot-actuator-exporter'
    metrics_path:'/actuator/prometheus'# 抓取指定路径
    static_configs:
      - targets:['192.168.200.1:8001']
        labels:
          nodename:'app_demo'

AOT

AOT与JIT

  • AOT(Ahead-of-Time,提前编译)程序执行前,全部被编译成机器码
  • JIT(Just in Time,即时编译)程序边编译,边运行

Complier与Interpreter

在这里插入图片描述

对比项编译器解释器
机器执行效率快,源代码只需转换一次慢,每行代码都需要被解释才能执行
开发效率慢,编译耗时长快,无需等待生成目标代码,更快的开发与测试
调试难以调试编译器生成的目标代码易于调试源代码
可移植性不同平台需要编译对应代码同一份源码可跨平台执行,仅需切换对应平台解释器
学习难度较高,额外了解源代码、编译器及目标机器的知识较低,无需了解机器细节
错误检查编译器可在编译阶段检查错误解释器只在执行时检查错误
运行时增强可动态增强

AOT与JIT对比

对比项AOTJIT
优点1.速度快,优化运行时编译时间和内存消耗
2.程序初期就能达到最高性能
3.加快程序启动速度
1.具备适时调整能力
2.生成最优机器指令
3.根据代码运行情况优化内存占用
缺点1.程序第一次编译占时长
2.牺牲高级语言部分特性
1.运行期间编译速度慢
2.初始编译不能达到最高性能

JVM架构

在这里插入图片描述
JVM即拥有解释器,也拥有编辑器(JIT)

Java的执行过程

流程概要

在这里插入图片描述

详细流程

在这里插入图片描述

JVM编译器
  1. JVM中集成了两种编译器
  • Client Compiler注重启动速度和局部优化。使用C1编译器,编译后的机器码文件运行效率低于C2
  • Server Compiler关注全局优化和更优性能,但由于进行了更多的全局分析,所以启动速度会减慢。拥有C2和Graal两种编译器,默认使用C2编译器
分层编译

结合C1和C2的优势,追求启动速度和峰值性能的一个平衡,将JVM执行状态分为五个层级:

  • 解释执行
  • 执行不带profiling的C1代码
  • 执行仅带方法调用次数,以及循环回边执行次数profiling的C1代码
  • 执行带所有profiling的C1代码
  • 执行C2代码
    (profiling即收集能够反映程序执行状态的数据,eg.方法调用次数、循环回边执行次数)
    在这里插入图片描述
    在这里插入图片描述

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

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

相关文章

学习Docker笔记

在23号刚刚学完新版本的docker还想说回去继续学习老版本的springcloud课程里面的docker 结果一看黑马首页新版本课程出了&#xff0c;绷不住了。以下是我学习新版本docker的笔记&#xff0c;记录了我学习过程遇到的各种bug和解决&#xff0c;也参考了黑马老师的笔记&#xff1a…

统一SQL 支持Oracle decode函数到TDSQL-MySQL的转换

统一SQL介绍 https://www.light-pg.com/docs/LTSQL/current/index.html 源和目标 源数据库&#xff1a;Oracle 目标数据库&#xff1a;TDSQL-MySQL 操作目标 在Oracle中&#xff0c;decode函数语法如下图&#xff1a;该函数功能是将 expr与每个 search 依次做比较&#x…

告别SQL注入攻击之扰!揭秘强大防护策略,筑牢网站安全防线,畅享无忧体验!

SQL注入攻击是一种极具破坏性的Web漏洞&#xff0c;它利用应用程序对用户输入的处理不当&#xff0c;让恶意用户能够执行非授权的SQL查询&#xff0c;进而对数据库造成巨大损害。这种攻击方式可能导致数据泄露、系统崩溃等严重后果&#xff0c;因此必须引起高度重视。 为了有效…

免费又好用的五款电脑监控软件(先收藏再看)

电脑监控软件可以为企业的管理提供一臂之力&#xff0c;然而市面上的监控软件品牌众多&#xff0c;良莠不齐&#xff0c;导致企业不知道用哪个&#xff0c;今天为大家盘点免费又好用的五款电脑监控软件。 安企神&#xff08;点击试用7天&#xff09; 安企神是一款专业的电脑监…

OpenAIGPT-4.5提前曝光?

OpenAI GPT-4.5的神秘面纱&#xff1a;科技界的震撼新篇章 在人工智能的世界里&#xff0c;每一次技术的飞跃都不仅仅是一次更新&#xff0c;而是对未来无限可能的探索。近日&#xff0c;科技巨头OpenAI似乎再次站在了这场革命的前沿&#xff0c;其潜在的新产品——GPT-4.5 Tur…

电力调度自动化系统,如何减少配电安全隐患?

“双碳”战略目标下&#xff0c;数据中心迎来了更多发展机遇&#xff0c;同时电力调度自动化系统也迎来更多挑战&#xff0c;如何保障持续稳定的电力供应、确保关键负载的可靠运行&#xff0c;并兼顾数字化管理、绿色可持续转型等等议题成为数据中心行业构建未来领导力的重要关…

使用gdb调试遇到No symbol table is loaded. Use the “file“ command.怎么办?

问题排查 出现下面问题&#xff0c;通常是没有处于调式模式环境下&#xff0c;所以我们需要在gcc指令后加 【-g】。 因为&#xff0c;我么的gcc编辑器默认是动态链接&#xff0c;而且是realese发布版本。 想要解决也很简单 主要思路就是在gcc -g。 在makefile文件如下进行修改即…

MES与ERP强强联手

MES系统是企业信息管理的基础&#xff0c;通过将ERP系统与实时生产过程联系起来&#xff0c;使企业能够有效控制和组织生产。 MES系统与ERP系统如何集成&#xff1f;   集成中&#xff0c;ERP与MES系统功能需要在整体的设计架构内&#xff0c;统一规划&#xff0c;划分边界。…

学习操作系统路线

操作系统 简介 本课程为计算机专业学生量身定制&#xff0c;补足计算机操作系统相关知识&#xff0c;查漏补缺&#xff0c;也可用于考研复习。内容包括&#xff1a;操作统概述、进程管理、内存管理、文件管理、输入/输出管理等章节。内容力求精炼、重点突出、条理清晰、深入浅…

干货:一篇文章让你掌握用户运营 沈阳新媒体运营培训

用户对于产品的重要性不言而喻&#xff0c;而用户运营作为最接近用户的一环&#xff0c;自然而然受到了各大互联网公司的重视。想要掌握用户运营&#xff0c;必须得先知道其市场需求和主要技能&#xff0c;本文从这两个方面对用户运营展开了分析拆解&#xff0c;梳理用户运营的…

ruoyi-nbcio-plus基于vue3的flowable修正加签与跳转的前端问题

更多ruoyi-nbcio功能请看演示系统 gitee源代码地址 前后端代码&#xff1a; https://gitee.com/nbacheng/ruoyi-nbcio 演示地址&#xff1a;RuoYi-Nbcio后台管理系统 http://122.227.135.243:9666/ 更多nbcio-boot功能请看演示系统 gitee源代码地址 后端代码&#xff1a…

LLMs——扩展数据受限的语言模型解决方案

概述 在自然语言处理&#xff08;NLP&#xff09;领域&#xff0c;大型语言模型的发展一直是研究的热点。这些模型通过增加参数数量和训练数据量来提升性能&#xff0c;但这种增长趋势是否会有一个极限&#xff1f;实际上&#xff0c;研究者们已经注意到&#xff0c;为了有效地…

npm常用的命令大全(2024-04-21)

nodejs中npm常见的命令 npm主要是node包管理和发布的工具。 npm官网网址&#xff1a;npm | Homehttps://www.npmjs.com/官网英文文档&#xff1a; npm DocsDocumentation for the npm registry, website, and command-line interfacehttps://docs.npmjs.com/about-npm官网中文文…

我的读书摘记《点燃孩子的学习动力:关于儿童学习兴趣的真相》

德韦克认为乔丹的经历揭示了那些最卓越的学习者身上的一个秘密&#xff1a;人的天赋&#xff0c;是可以不断发展的&#xff01;不管早期的天赋如何&#xff0c;人终将不断超越自己&#xff0c;发展自己的天赋。 思维方式决定了学习的成功与否&#xff01;这也意味着&#xff0…

软考-系统集成项目管理中级--信息(文档)和配置管理

本章历年考题分值统计(16年11月及以后按新教材考的) 本章重点常考知识点汇总清单(学握部分可直接理解记忆) 本章历年考题及答案解析 12、2018 年下半年第 14题 关于配置管理&#xff0c;不正确的是(14) A、配置管理计划制定时需了解组织结构环境和组织单元之间的联系 B、配置…

windows驱动开发-设备栈

设备栈是windows内核中非常重要的部分&#xff0c;这部分理解可以让我们在调试中节省大量的时间&#xff0c; 在windows NT体系中&#xff0c;内核所有的设备被按照连接次序加载到设备树上&#xff0c;这棵树的根节点是ROOT节点&#xff0c;每一个设备可以从当前路径一直遍历到…

【ARMv9 DSU-120 系列 4.1 -- Utility bus 详细介绍 2】

文章目录 ARM DSU-120DSU-120 Utiity BusCluster and core PPUPPU寄存器的访问性PPU寄存器的作用系统组件基地址ARM DSU-120 DSU-120 Utiity Bus 在ARMv9架构中,DSU-120(Dynamic Shared Unit 120)是一个关键组件,用于管理核心和系统组件之间的通信与协作。某些系统组件寄存…

【漏洞复现】号卡极团管理系统 index.php SQL注入漏洞

0x01 产品简介 号卡极团管理系统是一款专为号卡行业打造的管理系统&#xff0c;它具备一系列强大的功能&#xff0c;能够满足号卡行业推广人员在业务运营中的各类需求。 0x02 漏洞概述 号卡极团管理系统存在SQL注入漏洞&#xff0c;未授权的攻击者可以通过该漏洞获取数据库敏…

vue 请求php接口 header 传自定义参数 提示cors 跨域问题

前端地址 http://192.168.0.125:4021 请求后端地址的时候报 from origin http://192.168.0.125:4021 has been blocked by CORS policy: Request header field userid is not allowed by Access-Control-Allow-Headers in preflight response. 大概意思是请求 header里有个…

【leetcode面试经典150题】74. 填充每个节点的下一个右侧节点指针 II(C++)

【leetcode面试经典150题】专栏系列将为准备暑期实习生以及秋招的同学们提高在面试时的经典面试算法题的思路和想法。本专栏将以一题多解和精简算法思路为主&#xff0c;题解使用C语言。&#xff08;若有使用其他语言的同学也可了解题解思路&#xff0c;本质上语法内容一致&…
最新文章