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

SOME/IP-SD -- 协议英文原文讲解5

前言
SOME/IP协议越来越多的用于汽车电子行业中,关于协议详细完全的中文资料却没有,所以我将结合工作经验并对照英文原版协议做一系列的文章。基本分三大块:

1. SOME/IP协议讲解

2. SOME/IP-SD协议讲解

3. python/C++举例调试讲解


5.1.2.5 Service Entries
find/offer/stop offer Entries 讲解

注:find/offer/stop offer Entries 发出的报文只提供服务ID信息 说明哪个服务可以被订阅,但不提供事件组 即显示哪些事件组可以被订阅 -- 隐藏起来了。所以client订阅时要参照客户发出的矩阵表订阅。

5.1.2.5.1 Find Service Entry
find报文entry

[PRS_SOMEIPSD_00350]
Upstream requirements: RS_SOMEIPSD_00008, RS_SOMEIPSD_00021
The Find Service entry type shall be used for finding service instances and shall
only be sent if the current state of a service is unknown (no current Service Offer was
received and is still valid).
find报文是在没有offer的情况下发出的,否则不能发送find报文了

[PRS_SOMEIPSD_00351]
Upstream requirements: RS_SOMEIPSD_00008, RS_SOMEIPSD_00021
Find Service entries shall set the entry fields in the following way:
• Type shall be set to 0x00 (FindService). -- 固定值
• Service ID shall be set to the Service ID of the service that shall be found.
• Instance ID shall be set to 0xFFFF, if all service instances shall be returned. It
shall be set to the Instance ID of a specific service instance, if just a single service
instance shall be returned.
0xFFFF 找所有的Instance 或是找指定的Instance 前面文章有讲

• Major Version shall be set to 0xFF, that means that services with any version shall
be returned. If set to value different than 0xFF, services with this specific major
version shall be returned only.
匹配所有的主版本号,则设置为0xff,否则设置为需要的版本号

• Minor Version shall be set to 0xFFFF FFFF, that means that services with any
version shall be returned. If set to a value different to 0xFFFF FFFF, services
with this specific minor version shall be returned only.
道理同 上面主版本号,只不过是值大了些

• TTL is not used for FindService entries and can be set to an arbitrary value.The
field is only defined for backward compatibility, and the value shall be ignored by
the receiver of the message.
对于 find报文来说 TTL不用设置 ,接收端应该忽略此值。一般设置为0 就行。

Note: It is expected that the Major Version on client side is configured to a specific
value in normal operation since the client should look for an specific interface version.
Different Major Versions are not compatible to each other.
[PRS_SOMEIPSD_00528]
Upstream requirements: RS_SOMEIPSD_00008, RS_SOMEIPSD_00025
A sender shall not reference Endpoint Options nor Multicast Options in a Find Service
Entry.
find报文不用设置 单播、多播 选项,如果有 接收端应该忽略。
其它选项可以配置

[PRS_SOMEIPSD_00529]
Upstream requirements: RS_SOMEIPSD_00013, RS_SOMEIPSD_00025
A receiver shall ignore Endpoint Options and Multicast Options in a Find Service
Entry.
[PRS_SOMEIPSD_00530]
Upstream requirements: RS_SOMEIPSD_00013, RS_SOMEIPSD_00025
Other Options (neither Endpoint nor Multicast Options), shall still be allowed to be
used in a Find Service Entry.
[PRS_SOMEIPSD_00825]
Upstream requirements: RS_SOMEIPSD_00008, RS_SOMEIPSD_00013
When receiving a FindService Entry the Service ID, Instance ID, Major Version, and
Minor Version shall match exactly to the configured values to identify a Service Instance, except if "any values" are in the Entry (i.e. 0xFFFF for Service ID, 0xFFFF for
Instance ID, 0xFF for Major Version, and 0xFFFFFFFF for Minor Version.)
接收端接收到 find报文,对于entry中的配置项 如果是指定的值 应该精确匹配 成功后再回复offer,否则是通配值 的话就算了

[PRS_SOMEIPSD_00839]
Upstream requirements: RS_SOMEIPSD_00008, RS_SOMEIPSD_00013
If a FindService Entry is received within the Initial Wait Phase for this Server Service
Instance, it shall be ignored.
初始化阶段 收到find 应该忽略 不用先解析 等到初始化完成给回复

5.1.2.5.2 Offer Service Entry

[PRS_SOMEIPSD_00355]
Upstream requirements: RS_SOMEIPSD_00013
The Offer Service entry type shall be used to offer a service to other communication
partners.
[PRS_SOMEIPSD_00356] -- 以下为格式定义 容易理解
Upstream requirements: RS_SOMEIPSD_00013, RS_SOMEIPSD_00025
Offer Service entries shall set the entry fields in the following way:
• Type shall be set to 0x01 (OfferService).
• Service ID shall be set to the Service ID of the service instance offered.
• Instance ID shall be set to the Instance ID of the service instance that is offered.
• Major Version shall be set to the Major Version of the service instance that is
offered.
• Minor Version shall be set to the Minor Version of the service instance that is
offered.
• TTL shall be set to the lifetime of the service instance. After this lifetime the
service instance shall considered not been offered.
offer的有效期 超过后 服务会失效。
• If TTL is set to 0xFFFFFF, the Offer Service entry shall be considered valid until
the next reboot. 长期有效
• If CYCLIC_OFFER_DELAY is defined, TTL shall be greater or equal to the value
for CYCLIC_OFFER_DELAY. 客户指定这个值 则应设置 >=这个值
• TTL shall not be set to 0x000000 since this is considered to be the Stop Offer
Service Entry. 设置为0 表示stop offer 所有offer中不能设置为0.

[PRS_SOMEIPSD_00357]
Upstream requirements: RS_SOMEIPSD_00013, RS_SOMEIPSD_00025
Offer Service entries shall always reference either an IPv4 or IPv6 Endpoint Option to
signal how the service is reachable.
offer应该携带IPv4或IPv6选项 表示服务的发出方式 和 源地址源Port
[PRS_SOMEIPSD_00358]
Upstream requirements: RS_SOMEIPSD_00013, RS_SOMEIPSD_00025
For each Transport Layer Protocol needed for the service (i.e. UDP and/or TCP) an
IPv4 Endpoint option shall be added if IPv4 is supported.
[PRS_SOMEIPSD_00359]
Upstream requirements: RS_SOMEIPSD_00013, RS_SOMEIPSD_00025
For each Transport Layer Protocol needed for the service (i.e. UDP and/or TCP) an
IPv6 Endpoint option shall be added if IPv6 is supported.

[PRS_SOMEIPSD_00826]
Upstream requirements: RS_SOMEIPSD_00012, RS_SOMEIPSD_00013, RS_SOMEIPSD_00025
When receiving the initial OfferService Entry the Service ID, Instance ID, Major Version and Minor Version shall match exactly to the configured values to identify a Service Instance, except if "any values" are in the service configuration (i.e. 0xFFFF for
Instance ID and 0xFFFFFFFF for Minor Version.)
[PRS_SOMEIPSD_00827]
Upstream requirements: RS_SOMEIPSD_00012, RS_SOMEIPSD_00013, RS_SOMEIPSD_-
00025
When receiving a subsequent OfferService Entry or a StopOfferService Entry the
Service ID, Instance ID, Major Version shall match exactly to the values in the initial
OfferService entry to identify a Service Instance.
在收到offer/stopoffer时 要精确匹配Service ID, Instance ID, Major Version 检查是否是自己需要订阅的

注意:sub /suback/ subnack entry 在5.1.3.1章节讲解

5.1.2.5.3 Stop Offer Service Entry

[PRS_SOMEIPSD_00363]
Upstream requirements: RS_SOMEIPSD_00014
The Stop Offer Service entry type shall be used to stop offering service instances.
[PRS_SOMEIPSD_00364]
Upstream requirements: RS_SOMEIPSD_00014
dStop Offer Service entries shall set the entry fields exactly like the Offer Service entry
they are stopping, except:
• TTL shall be set to 0x000000. -- 和offer报文基本一致除了要改TTL为0x000000

[PRS_SOMEIPSD_00840]
Upstream requirements: RS_SOMEIPSD_00014
A StopOfferService (type 0x01), shall carry, i.e. reference, the same options as the
entries trying to stop.


5.1.2.5.4 Usage of Options in Entries 不同类型entries 携带 options数量说明

5.1.2.6 Endpoint Handling for Services and Events -- 针对offer报文的讲解

[PRS_SOMEIPSD_00476]
Upstream requirements: RS_SOMEIPSD_00025
The Service Discovery shall overwrite IP Addresses and Port Numbers with those
transported in Endpoint and Multicast Options if the statically configured values are
different from those in these options.
Note: In other words if a mix of a static and dynamic configuration exists (static configuration that defines the communication endpoints exists and at the same time endpoint
options are exchanged via SD messages at runtime) and the endpoint options in the
static configuration are different from the endpoint options received via SD then the
endpoints options received over SD take precedence over the preconfigured endpoint
options.
SD报文中的IP和PORT 如果和静态配置不一致 则优先动态报文中的 ,并覆盖静态配置
其它 选项 也是优先 动态 覆盖静态

[PRS_SOMEIPSD_00360]
Upstream requirements: RS_SOMEIPSD_00013, RS_SOMEIPSD_00025
The IP addresses and port numbers of the Endpoint Options shall also be used for
transporting events and notification events.
端点选项的ip /port用来 传输 事件、通知。

[PRS_SOMEIPSD_00361]
Upstream requirements: RS_SOMEIPSD_00013, RS_SOMEIPSD_00025
In case of UDP the endpoint option shall be used for the source address and the
source port of the events and notification events, it is also the address the client can
send method requests to.
offer报文中 UDP 端点选项的ip /port用来 传输 事件、通知。同时client也可通过这个IP、PORT请求method
[PRS_SOMEIPSD_00362]
Upstream requirements: RS_SOMEIPSD_00013, RS_SOMEIPSD_00025
In case of TCP the endpoint option shall be used for the IP address and port the client
needs to open a TCP connection in order to receive events using TCP.
接收TCP的事件时 要先 tcp握手建链

[PRS_SOMEIPSD_00801]
Upstream requirements: RS_SOMEIPSD_00013, RS_SOMEIPSD_00025
SOME/IP shall allow services to use UDP and TCP at the same time.
同一个服务 可以同时使用TCP和UDP

[PRS_SOMEIPSD_00802]
Upstream requirements: RS_SOMEIPSD_00013, RS_SOMEIPSD_00025
Which message is sent by which underlying transport protocol shall be determined by
configuration: A Service can use UDP and TCP endpoints at the same time. But per
element of the service it shall to be configured whether TCP or UDP is used.
Note: It needs to be restricted in the configuration which methods and which events
are provided over TCP/UDP. This also means that the same event can not be provided
over TCP and UDP.
虽然可以同时使用TCP和UDP,但是对于具体的event/method/field 只能用一种 不能同时支持。

5.1.2.6.1 Service Endpoints offer报文中 服务端点的讲解

The referenced Endpoint Options of the Offer Service entries denotes the
• IP Address and Port Numbers the service instance is reachable at the server.
• IP Address and Port Numbers the service instance sends the events from.
offfer中的 端点选项中IP、PORT 是可以被访问的 且是用来发送events的,
注:如果这个报文没有events 就不用发送offer

[PRS_SOMEIPSD_00480]
Upstream requirements: RS_SOMEIPSD_00013, RS_SOMEIPSD_00025
Events of this service instance shall not be sent from any other Endpoints than those
given in the Endpoint Options of the Offer Service entries.
事件不能通过除了选项中描述的IP、PORT之外的地址发送。

[PRS_SOMEIPSD_00481]
Upstream requirements: RS_SOMEIPSD_00013, RS_SOMEIPSD_00025
If an ECU offers multiple service instances, SOME/IP messages of these service
instances shall be differentiated by the information transported in the Endpoint Options
referenced by the Offer Service entries.
就算是同一服务的不同instance 在同一个ECU中,端点的IP、PORT也必须不一样。

5.1.2.6.2 Eventgroup Endpoints

[PRS_SOMEIPSD_00484]
Upstream requirements: RS_SOMEIPSD_00015, RS_SOMEIPSD_00025
The Endpoint Options referenced in the Subscribe Eventgroup entries shall also be
used to send unicast UDP or TCP SOME/IP events for this Service Instance.
Thus the Endpoint Options referenced in the Subscribe Eventgroup entries are the IP
Address and the Port Numbers on the client side.

client发送订阅包时,订阅entry对应的Option中的ip/port 是client的,用以发送udp单播或TCP的events

[PRS_SOMEIPSD_00486]
Upstream requirements: RS_SOMEIPSD_00015, RS_SOMEIPSD_00025
TCP events are transported using the TCP connection the client has opened to the
server before sending the Subscribe Eventgroup entry.

如果被订阅的事件是TCP协议类型,则client在发送订阅之前 要先完成TCP的握手建链过程。

[PRS_SOMEIPSD_00487]
Upstream requirements: RS_SOMEIPSD_00015, RS_SOMEIPSD_00025
The initial value of field notifiers (i.e., fields and not pure events) shall be transported
using unicast from Server to Client.
field notifiers 的别订阅后的首次通知 要通过单播、TCP形式发送(单对单)
因为有可能有多个client订阅 如果广播通知的话 会让已经订阅的client端多次收到

[PRS_SOMEIPSD_00488]
Upstream requirements: RS_SOMEIPSD_00015, RS_SOMEIPSD_00025
Subscribe Eventgroup Ack entries shall reference up to 1 Multicast Option for the
Internet Protocol used (IPv4 or IPv6).
suback报文中的 最多只能包含一条 多播option(ipv4/ipv6)

[PRS_SOMEIPSD_00489]
Upstream requirements: RS_SOMEIPSD_00015, RS_SOMEIPSD_00025
The Multicast Option shall be set to UDP as transport protocol.
多播用于UDP -- 前面已经讲过了

[PRS_SOMEIPSD_00490]
Upstream requirements: RS_SOMEIPSD_00015, RS_SOMEIPSD_00025
The client shall open the Endpoint specified in the Multicast Option referenced by the
Subscribe Eventgroup Ack entry as fast as possible to not miss multicast events.
Example: Figure 5.15 shows an example with the different Endpoint and a Multicast
client收到订阅回复中有携带了server events的多播地址时,要尽快配置加入到这个组播中,否则有可能错过组播的事件

Option:
• The Server offers the Service Instance on Server UDP-Endpoint SU and Server
TCP-Endpoint ST
    服务端 offer 提供服务 option中有UDP 也有TCP
• The Client opens a TCP connection client 发起并完成tcp连接
• The Client sends a Subscribe Eventgroup entry with Client UDP-Endpoint CU
(unicast) and a Client TCP-Endpoint CT. client发送订阅报文 携带client的UDP单播 IP+PORT 以及 TCP IP+PORT
• The Server answers with a Subscribe Eventgroup Ack entry with Multicast MU
    服务端单播回复 client 订阅ack 包 ,并携带一个server的组播地址(有的事件要通过组播发送)
Then the following operations happen: 可能会有下面的交互情况
• The Client calls a method on the Server 
  client向server请求method(使用UDP协议 -- 因为假设矩阵中这个Method配置UDP协议)
  
• Request is sent from CU to SU and Response from SU to CU
    server用UDP单播回复
• For TCP this would be: Request dyn to ST and RESPONSE from ST to CT
    也有可能client向server请求TCP协议的method, server通过TCP 回复
• The Server sends a Unicast UDP Event: SU to CU
    server发送UDP单播事件
• The Server sends a Unicast TCP Event: ST to CT
    server发送TCP事件
• The Server sends a Multicast UDP Event: SU to MU
    server发送UDP广播事件
Keep in mind that Multicast Endpoints use a Multicast IP Address on the receiver side,
i.e. the client, and TCP cannot be used for Multicast communication.
    client端配置加入组播 但不能用组播主动发送消息。

注:30490端口号 是协议建议的SOME/IP组播端口号 

相关文章:

SOME/IP-SD -- 协议英文原文讲解5

前言 SOME/IP协议越来越多的用于汽车电子行业中,关于协议详细完全的中文资料却没有,所以我将结合工作经验并对照英文原版协议做一系列的文章。基本分三大块: 1. SOME/IP协议讲解 2. SOME/IP-SD协议讲解 3. python/C举例调试讲解 5.1.2.5 S…...

C#异步编程之async与await

一:需求起因 在 C# 中使用异步编程(特别是使用 async 和 await 关键字)通常是为了提高应用程序的响应性和性能,特别是在需要进行 I/O 操作或执行长时间运行的任务时。 常见应用场景如下: 1. 网络请求 HTTP 请求&…...

Spring Security 登录流程中的自定义解密实现

文章目录 前言1. Spring Security 核心组件介绍2. 前端密码多加密场景的处理3. 重写 DaoAuthenticationProvider4. 让 Spring Security 使用自定义 Provider5. 验证流程总结6. 完整性与调试 总结 前言 在现代 Web 安全体系中,Spring Security 是最常用的安全框架之一…...

考研出分24小时,人类精神状态图鉴

2月24日,上午10点起,各省考研初试成绩陆续公布,考生们或紧张的输入准考证号,或抱团等待“审判”。然而更魔幻的还在后头——下午4点,教育部竟在同一天直接发布了《2025年研考国家分数线》。 不少网友表示:…...

顶顶通呼叫中心中间件(mod_cti基于FreeSWITCH)-大模型电话机器人

语音流直接对接Realtime API 多模态大模型 直接把音频流输出给大模型,大模型返回音频流。 顶顶通CTI对Realtime API 的支持 提供了以下2个APP可对接任意 •cti_audio_stream 通过TCP推流和播放流,适合用于人机对话场景。 •cti_unicast_start 通过旁…...

《Kafka 理解: Broker、Topic 和 Partition》

Kafka 核心架构解析:从概念到实践 Kafka 是一个分布式流处理平台,广泛应用于日志收集、实时数据分析和事件驱动架构。本文将从 Kafka 的核心组件、工作原理、实际应用场景等方面进行详细解析,帮助读者深入理解 Kafka 的架构设计及其在大数据领域的重要性。 ​1. Kafka 的背…...

【前端】XML,XPATH,与HTML的关系

XML与HTML关系 XML(可扩展标记语言)和 HTML(超文本标记语言)是两种常见的标记语言,但它们有不同的目的和用途。它们都使用类似的标记结构(标签),但在设计上存在一些关键的差异。 XML…...

(九)趣学设计模式 之 桥接模式!

目录 一、 啥是桥接模式?二、 为什么要用桥接模式?三、 桥接模式的实现方式四、 桥接模式的优缺点五、 桥接模式的应用场景六、 总结 🌟我的其他文章也讲解的比较有趣😁,如果喜欢博主的讲解方式,可以多多支…...

Web Worker 使用教程

一、概述 JavaScript 语言采用的是单线程模型,也就是说,所有任务只能在一个线程上完成,一次只能做一件事。前面的任务没做完,后面的任务只能等着。随着电脑计算能力的增强,尤其是多核 CPU 的出现,单线程带…...

算法仿真平台搭建1-FFMPEG+RtspSever快速搭建一个RTSP服务器

一、前言 本文相关的全部源码和RtspSever库,我已打包上传,欢迎大家免费下载,testRTSPSever。 每一个嵌入式视觉算法工程师,都应该有一套属于自己的算法仿真和测试环境。可以方便地进行视频、图像等素材进行在线导入,可…...

网络安全审计员

在当今数字化时代,随着信息技术的迅猛发展,网络安全问题日益凸显,成为各行各业不容忽视的重要议题。特别是对于企业、政府机构等组织而言,网络安全不仅关乎数据资产的安全,更与组织的声誉、客户信任乃至法律法规的遵从…...

SQL Server查询计划操作符(7.3)——查询计划相关操作符(7)

7.3. 查询计划相关操作符 58)Nested Loops:该操作符执行Inner Join,Left Outer Join,Left Semi Join,以及Left Anti Semi Join等逻辑操作。该操作符用其外(上面)输入中的每行数据对其内(下面)输入进行一个搜索,典型场景为其使用一个索引。查询处理器基于预期的成本决…...

数据库测试

TPCH 22条SQL语句分析 - xibuhaohao - 博客园 TPCH模型规范、测试说明及22条语句 - zhjh256 - 博客园 TPC-DS 性能比较:TiDB 与 Impala-PingCAP | 平凯星辰 揭秘Oracle TPC-H性能优化:如何提升数据库查询速度,揭秘实战技巧与挑战 引言 T…...

数据结构——排序4

上次我们讲解了快速排序的递归的几种做法。 那么,作为一名合格的程序员,改递归为非递归是必要的,现在我们来学习一下非递归的做法: 快速排序非递归: 首先,我们先了解一下,为什么要改为非递归…...

Pycharm中怎么加快下载三方包速度

Pycharm中怎么加快下载三方包速度 使用命令行下载,-i pip install transformers -i https://mirrors.aliyun.com/pypi/simple/ 在Windows系统的PyCharm中使用Python 3.12环境时,可通过以下几种方式配置不同镜像源来加快下载包的速度。 方式一:在PyCharm界面中直接配置镜…...

Spring MVC框架二:创建第一个MVC程序

精心整理了最新的面试资料和简历模板&#xff0c;有需要的可以自行获取 点击前往百度网盘获取 点击前往夸克网盘获取 有两种方式 利用配置 1、利用IDEA新建一个Maven项目&#xff0c;添加一个web支持 2、导入常用的依赖 <dependencies><dependency><groupId…...

Netty为什么性能很高?

大家好&#xff0c;我是锋哥。今天分享关于【Netty为什么性能很高?】面试题。希望对大家有帮助&#xff1b; Netty为什么性能很高? 1000道 互联网大厂Java工程师 精选面试题-Java资源分享网 Netty是一款高性能的网络通信框架&#xff0c;主要用于构建高性能的网络应用程序。…...

目标检测tricks

A. Stochastic Weight Averaging (SWA) 1. 基本思想 SWA 的核心思想是通过对训练过程中不同时间点的模型参数进行加权平均&#xff0c;从而获得一个更好的模型。具体来说&#xff0c;SWA 在训练过程的后期阶段对多个不同的模型快照&#xff08;snapshots&#xff09;进行平均…...

ai-2、机器学习之线性回归

机器学习之线性回归 1、机器学习2、线性回归2.1、梯度下降法 3、python下调用scikit-learn 1、机器学习 2、线性回归 ####所以y可以当成我们需要的结果&#xff0c;根据公式可以求的y一撇的值更小&#xff0c;所以更接近需要的结果&#xff0c;所以y一撇拟合性更好 2.1、梯度下…...

版图自动化连接算法开发 00001 ------ 直接连接两个给定的坐标点

版图自动化连接算法开发 00001 ------ 直接连接两个给定的坐标点 引言正文定义坐标点的类绘图显示代码直接连接两个坐标点引言 由于人工智能的加速普及,每次手动绘制版图都会觉得特别繁琐,作者本人在想可否搞一个自动化连接器件端口的算法,后期可以根据一些设定的限制进行避…...

删除变慢问题

问题&#xff1a; 有一个场景&#xff0c;每天都会删除数据&#xff0c;SQL为delete from xxx where record_date < DATE_SUB(now(), INTERVAL ? DAY) limit 1000 &#xff0c;一直循环执行&#xff0c;当执行到最后一次满足条件的时候&#xff0c;就会很慢 原理分析 索引与…...

第十四届蓝桥杯Scratch11月stema选拔赛真题——小猫照镜子

编程实现&#xff1a; 小猫照镜子。(背景非源素材) 具体要求&#xff1a; 1). 运行程序&#xff0c;角色、背景如图所示&#xff1b; 完整题目可点击下方链接查看&#xff0c;支持在线编程~ 小猫照镜子_scratch_少儿编程题库学习中心-嗨信奥https://www.hixinao.com/tiku/s…...

Python标准库【os.path】操作路径

文章目录 1 该模块的源文件2 提取路径信息3 获取文件信息4 判定路径状态5 变换路径6 路径拆分 os.path模块实现了一些操作路径相关的函数。它们都接收字符串、字节串格式的路径或类路径对象(实现os.PathLike协议)为参数。 接收字符串时&#xff0c;函数返回的结果也是字符串&am…...

vue3 keep-alive 页面切换不触发onActivated和onDeactivated方法周期

<script setup lang"ts"> import { onActivated, onDeactivated, shallowRef } from vue import CompA from ../components/CompA.vue import CompB from ../components/CompB.vue const current shallowRef(CompA) onActivated(() > {console.log(组件被激…...

Qt 中集成mqtt协议

一&#xff0c;引入qmqtt 库 我是将整个头文件/源文件都添加到了工程中进行编译&#xff0c;这样 跨平台时 方便&#xff0c;直接编译就行了。 原始仓库路径&#xff1a;https://github.com/emqx/qmqtt/tree/master 二&#xff0c;使用 声明一个单例类&#xff0c;将订阅到…...

JAVA面试_进阶部分_23种设计模式总结

1. 单例模式&#xff1a;确保某一个类只有一个实例&#xff0c;而且自行实例化并向整个系统提供这 个实例。 &#xff08;1&#xff09;懒汉式 public class Singleton { /* 持有私有静态实例&#xff0c;防止被引用&#xff0c;此处赋值为null&#xff0c;目的是实现延迟加载…...

初阶数据结构(C语言实现)——3顺序表和链表(3)

3.链表 3.1 链表的概念及结构 概念&#xff1a;链表是一种物理存储结构上非连续、非顺序的存储结构&#xff0c;数据元素的逻辑顺序是通过链表中的指针链接次序实现的 链表的物理结构 1.从上图可看出&#xff0c;链式结构在逻辑上是连续的&#xff0c;但是在物理上不一定连续…...

Vue打包(webpack)缓存

解决方法&#xff1a; 1、修改vue.config.js文件 const Timestamp new Date().getTime();module.exports defineConfig({configureWebpack{output: {filename: [name].${Timestamp}.js,chunkFilename: [name].${Timestamp}.js},},css: {extract: { // 打包后css文件名称添加…...

磁盘阵列新秀GSx并行文件存储是HPC高性能计算/AI 大模型-1替3好省预算

Infortrend 普安存储GSx 并行文件存储系统凭一体化设计&#xff0c;颠覆了传统存储系统的复杂配置模式。内置并行文件系统&#xff0c;支持私有协议或 CIFS 协议&#xff0c;实现客户端/服务器与存储设备的直接连接,无需额外配置I/O节点、元数据服务器及并行系统软件&#xff0…...

数据基础4: 线性代数基础行列式(矩阵)

二阶 三阶 矩阵和数据之间的关系。 行列式 n,n &#xff1b;矩阵m行&#xff0c;n列 逆序数 在行列式的计算中&#xff0c;逆序数用于决定每一项前面的符号。 如果一个排列的逆序数是偶数&#xff0c;则该项前面的符号为正&#xff1b; 如果是奇数&#xff0c;则符号为负。 …...

【Project】基于Prometheus监控docker平台

一、设计背景 1.1项目简介 本项目旨在创建一个全面的容器化应用程序监控解决方案&#xff0c;基于Prometheus监控Docker平台上的各种服务。在当今的软件开发环境中&#xff0c;容器化技术已成为一种关键的工具&#xff0c;使应用程序能够更快速、可靠地交付和扩展。然而&…...

AcWing 蓝桥杯集训·每日一题2025·密接牛追踪2

密接牛追踪2 农夫约翰有 N 头奶牛排成一排&#xff0c;从左到右依次编号为 1∼N。 不幸的是&#xff0c;有一种传染病正在蔓延。 最开始时&#xff0c;只有一部分奶牛受到感染。 每经过一个晚上&#xff0c;受感染的牛就会将病毒传染给它左右两侧的牛&#xff08;如果有的话…...

面试(进阶) —虚拟列表在什么场景使用,如何实现?

面试(进阶) —虚拟列表在什么场景使用&#xff0c;如何实现&#xff1f; 在前端开发中&#xff0c;当需要渲染大量数据时&#xff0c;传统的渲染方式往往会遇到性能瓶颈。一次性将大量数据渲染到DOM中&#xff0c;不仅会导致页面加载缓慢&#xff0c;还可能占用大量内存&#x…...

Linux基础 -- ARM 32位常用机器码(指令)整理

ARM 32位常用机器码&#xff08;指令&#xff09;整理 1. 数据处理指令&#xff08;运算、逻辑、比较&#xff09; 指令含义示例备注MOV赋值&#xff08;寄存器传输&#xff09;MOV R0, R1直接将 R1 复制到 R0MVN取反MVN R0, R1R0 ~R1ADD加法ADD R0, R1, R2R0 R1 R2ADC带进…...

【JAVA】阿里云百炼平台对接DeepSeek-V3大模型使用详解

1、DeepSeek简介 DeepSeek的火热让全世界见证了一场国产AI大模型走向巅峰的盛宴。DeepSeek的横空出世一方面让AI大模型的格局得到重塑&#xff0c;另一方面&#xff0c;对于普通人来说&#xff0c;也有机会零距离的体验到更懂国人的AI大模型。从很多使用过后的小伙伴们的反馈来…...

STM32之时钟树

左边是时钟产生电路&#xff0c;右边是时钟分配电路。中间的SYSCLK就是系统时钟72MHz&#xff0c;在产生电路有四个时钟源&#xff0c;分别是内部8MHz高速RC振荡器&#xff0c;外部的4-16MHz高速石英晶体振荡器&#xff0c;这个一般接8MHz,第三个是外部的32.768kHz低速晶振&…...

QT day1

作业 代码 class Widget: public QWidget {QPushButton* button; //按钮Widget* other; //显示对面 public:Widget(){button new QPushButton("按钮",this); //控件 认this作父this->resize(300,300); //界面大小button->resize(100,10…...

【机器学习】梯度下降法及使用一元二次方程模拟使用梯度下降法的代码实现

梯度下降法 一、摘要二、梯度下降法三、线性方程中使用梯度下降法 一、摘要 文本主要讲述了梯度下降法作为机器学习中的一种优化方法&#xff0c;用于最小化损失函数。它并非直接解决机器学习问题&#xff0c;而是作为求解最优参数的工具。通过二维坐标图直观展示了梯度下降法…...

Hive配置

目录 1. 引言2. 通过docker-compose联动启动Hadoop和MySQL容器3. 配置Hive3.1 下载并解压Hive-4.0.12.2 配置环境变量2.3 安装mysql-connector的jar包2.4 配置Hive2.4.1 hive-env.sh2.4.2 hive-site.xml2.4.2.1 javax.jdo.option.ConnectionURL2.4.2.2 javax.jdo.option.Connec…...

网络安全 越权分为几种

1. 权限查看 Linux 系统中的每个文件和目录都有访问许可权限&#xff0c;通过其确定谁可以通过何种方式对文件和目录进行访问和操作。 文件或目录的访问权限分为只读、只写和可执行3种。以文件为例&#xff0c;只读权限表示只允许读其内容&#xff0c;而禁止对其做任何的更改…...

PHP面试题--后端部分

本文章持续更新内容 之前没来得及整理时间问题导致每次都得找和重新背 这次整理下也方便各位小伙伴一起更轻松的一起踏入编程之路 欢迎各位关注博主不定期更新各种高质量内容适合小白及其初级水平同学一起学习 一起成为大佬 数组函数有那些 ps&#xff1a;本题挑难的背因为…...

HTTP~文件 MIME 类型

MIME&#xff08;Multipurpose Internet Mail Extensions&#xff09;类型&#xff0c;即多用途互联网邮件扩展类型&#xff0c;是一种标准&#xff0c;用来表示文档、文件或字节流的性质和格式。最初是为了在电子邮件系统中支持非 ASCII 字符文本、二进制文件附件等而设计的&a…...

工程化与框架系列(4)--Webpack 高级配置详解

Webpack 高级配置详解 &#x1f6e0;️ Webpack 是前端工程化中最流行的构建工具之一&#xff0c;掌握其高级配置可以帮助我们构建更高效、更优化的应用。本文将深入探讨Webpack的高级配置技巧和最佳实践。 Webpack 核心概念回顾 &#x1f31f; &#x1f4a1; 小知识&#xf…...

Let‘s Encrypt免费证书的应用示例

文章目录 前言证书申请证书介绍cert.pemchain.pemfullchain.pemprivkey.pem 使用步骤搭建简易demo应用新建nginx配置文件测试SSL是否生效 总结 前言 最近在搞苹果应用上架的问题&#xff0c;据说用HTTP会被拒&#xff0c;但貌似不绝对&#xff0c;2017年苹果曾发公告说必须要求…...

线性模型 - 支持向量机

支持向量机&#xff08;SVM&#xff09;是一种用于分类&#xff08;和回归&#xff09;的监督学习算法&#xff0c;其主要目标是找到一个最佳决策超平面&#xff0c;将数据点分为不同的类别&#xff0c;并且使得分类边界与最近的数据点之间的间隔&#xff08;margin&#xff09…...

455. 分发饼干(LeetCode)

题目来源&#xff1a; 455. 分发饼干 - 力扣&#xff08;LeetCode&#xff09; 题目内容&#xff1a; 假设你是一位很棒的家长&#xff0c;想要给你的孩子们一些小饼干。但是&#xff0c;每个孩子最多只能给一块饼干。 对每个孩子 i&#xff0c;都有一个胃口值 g[i]&#xf…...

Harmony os next~鸿蒙应用开发入门教程

鸿蒙应用开发入门教程 基础准备与环境搭建 1. 了解鸿蒙系统 1.1 核心理念学习 HarmonyOS&#xff08;鸿蒙系统&#xff09;是华为推出的全场景分布式操作系统&#xff0c;其核心特点如下&#xff1a; 分布式能力 设备协同&#xff1a;手机、平板、智能手表、IoT设备等可无…...

数据库数据恢复—SQL Server附加数据库报错“错误 823”怎么办?

SQL Server数据库附加数据库过程中比较常见的报错是“错误 823”&#xff0c;附加数据库失败。 如果数据库有备份则只需还原备份即可。但是如果没有备份&#xff0c;备份时间太久&#xff0c;或者其他原因导致备份不可用&#xff0c;那么就需要通过专业手段对数据库进行数据恢复…...

树莓派安装ros docker

系统&#xff1a;bookworm或者ubuntu24都行 一、下载docker和拉取ros:noetic镜像 ubuntu 用鱼香ros脚本安装docker并拉取ros:noetic镜像&#xff1a; https://fishros.org.cn/forum/topic/20/小鱼的一键安装系列 wget http://fishros.com/install -O fishros && . …...

MyBatis-Plus 自动填充功能

MyBatis-Plus&#xff08;MP&#xff09; 提供了一个非常强大的功能——自动填充功能。该功能可以在执行插入或更新操作时&#xff0c;自动为某些字段赋值&#xff0c;免去手动设置这些字段的麻烦。常见的应用场景包括 创建时间 和 更新时间 字段的自动填充&#xff0c;帮助开发…...