CN-121309657-B - Communication method, vehicle and storage medium for intra-domain node
Abstract
The disclosure provides a communication method, a vehicle and a storage medium of an intra-domain node, and relates to the technical field of embedded real-time operating systems. The method comprises the steps of responding to a process restarting operation, creating a service node and creating a name of the service node, if the name of the service node does not exist in a named communication channel, keeping the name of the service node, responding to a connection message sent by a client node, judging whether the client node exists based on a function of opening a server connection, if the client node exists, acquiring the name of the client node, and determining whether to establish a connection relation between the client node and the service node according to the relation between the name of the client node and client node list information. By adopting the technical scheme, the stability of the embedded real-time operating system can be improved and the load of the CPU can be reduced.
Inventors
- Lin Lvqu
- LU ZHE
- DOU PING
- Zhen haichuan
Assignees
- 浙江吉利控股集团有限公司
- 吉利汽车研究院(宁波)有限公司
Dates
- Publication Date
- 20260508
- Application Date
- 20251212
Claims (9)
- 1. The communication method of the intra-domain node is characterized by being applied to a service terminal, wherein the service terminal and a client node communicate based on a message transmission mechanism, and comprises the following steps: Responding to a process restarting operation, creating a service node and creating a name of the service node; if the name of the service node does not exist in the named communication channel, the name of the service node is maintained, wherein the named communication channel is a communication channel named by the name of the service node already created; Responding to a connection message sent by the client node, and judging whether the client node exists or not based on a function of opening a server connection, wherein the connection message is used for establishing a connection relation between the client node and the service node; If the client node exists, acquiring the name of the client node, and determining whether to establish the connection relation between the client node and the service node according to the relation between the name of the client node and the client node list information, wherein the name of the client node comprises the name of the service node to be connected corresponding to the client node, the process number of the process where the client node is located and the unique number of the incremental process where the process is located.
- 2. The method of claim 1, wherein after the determining whether the client node exists based on the function of opening a server connection, the method further comprises: If the client node does not exist, determining that the authentication of the client node fails, and ignoring the connection message sent by the client node.
- 3. The method of claim 1, wherein determining whether to establish the connection relationship between the client node and the service node based on the relationship between the name of the client node and the client node list information comprises: And if the name of the client node is in the client node list information, determining that the client node is repeatedly connected with the service node, and ignoring the connection message sent by the client node.
- 4. The method of claim 1, wherein determining whether to establish the connection relationship between the client node and the service node based on the relationship between the name of the client node and the client node list information comprises: And if the name of the client node is not in the client node list information, establishing a connection relation between the client node and the service node.
- 5. The method according to claim 4, wherein after said establishing a connection relationship of said client node and said service node, said method comprises: And storing the names of the client nodes in the client node list information.
- 6. The method according to claim 4, wherein after said establishing a connection relationship of said client node and said service node, said method comprises: Recording node information of the client node, and if no data exists in a message queue and an abnormal message exists in the message queue based on a preset function, traversing the client node list information to detect whether the name of the client node exists or not, wherein the preset function is used for data transmission between the client node and the service node; If the name of the client node does not exist, determining that the client node is disconnected with the service node, deleting the node information of the client node, and reporting the message of the disconnection of the client node.
- 7. The method according to claim 1, wherein after said creating a service node and creating a name of said service node, said method comprises: If the name of the service node exists in the named communication channel, an abnormal notification message is sent, and the creation of the name of the service node and the allocation of the name of a new service node are terminated.
- 8. A vehicle, characterized by comprising: a processor and a memory, wherein the memory has stored therein a computer program which, when executed by the processor, performs the method of any of claims 1-7.
- 9. A computer readable storage medium, characterized in that the storage medium has stored therein a computer program which, when executed by a processor, implements the method according to any of claims 1-7.
Description
Communication method, vehicle and storage medium for intra-domain node Technical Field The embodiment of the disclosure relates to the technical field of embedded real-time operating systems, in particular to a communication method, a vehicle and a storage medium of an intra-domain node. Background Currently, embedded real-time operating systems are used in intelligent drive controllers and cockpit instrumentation. In the embedded real-time operating system, an extensible service-oriented middleware protocol (Scalable service-Oriented Middleware over IP, SOMEIP) is used as a communication mode, and specifically, an unix socket is used for communication between processes. However, in the manner of communication using unix socket, crashes easily occur and high cpu load is caused in the embedded real-time operating system. Therefore, there is a need for a communication method of nodes in a domain, which can improve the stability of an embedded real-time operating system and reduce the load of a CPU. Disclosure of Invention In order to solve the above technical problems or at least partially solve the above technical problems, embodiments of the present disclosure provide a communication method, a vehicle, and a storage medium of an intra-domain node. A first aspect of an embodiment of the present disclosure provides a communication method of an intra-domain node, applied to a service terminal, the method including: Responding to a process restarting operation, creating a service node and creating a name of the service node; if the name of the service node does not exist in the named communication channel, the name of the service node is maintained, wherein the named communication channel is a communication channel named by the name of the service node already created; Responding to a connection message sent by a client node, judging whether the client node exists or not based on a function of opening a server connection, wherein the connection message is used for establishing a connection relation between the client node and the service node; If the client node exists, the name of the client node is obtained, and whether the connection relation between the client node and the service node is established is determined according to the relation between the name of the client node and the client node list information. In one example, after the function of opening a server connection determines whether the client node is present, the method further comprises: If the client node does not exist, determining that the authentication of the client node fails, and ignoring the connection message sent by the client node. In one example, the determining whether to establish the connection relationship between the client node and the service node according to the relationship between the name of the client node and the client node list information includes: And if the name of the client node is in the client node list information, determining that the client node is repeatedly connected with the service node, and ignoring the connection message sent by the client node. In one example, the determining whether to establish the connection relationship between the client node and the service node according to the relationship between the name of the client node and the client node list information includes: And if the name of the client node is not in the client node list information, establishing a connection relation between the client node and the service node. In one example, after the establishing the connection relationship of the client node and the service node, the method includes: And storing the names of the client nodes in the client node list information. In one example, after the establishing the connection relationship of the client node and the service node, the method includes: Recording node information of the client node, and if no data exists in a message queue and an abnormal message exists in the message queue based on a preset function, traversing the client node list information to detect whether the name of the client node exists or not, wherein the preset function is used for data transmission between the client node and the service node; If the name of the client node does not exist, determining that the client node is disconnected with the service node, deleting the node information of the client node, and reporting the message of the disconnection of the client node. In one example, after the creating a service node and creating a name of the service node, the method includes: If the name of the service node exists in the named communication channel, an abnormal notification message is sent, and the creation of the name of the service node and the allocation of the name of a new service node are terminated. A second aspect of an embodiment of the present disclosure provides a communication method of an intra-domain node, applied to a client terminal, the method including: The method comprises the s