Communication method and device of multi-node cascade, electronic equipment and storage medium

CN121056313BActive Publication Date: 2026-10-20SAIC MOTOR
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410696615.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-31
Publication Date
2026-10-20
Estimated Expiration
2044-05-31

AI Technical Summary

Benefits of technology

[0034]本发明提供一种多节点级联的通信方法、装置、电子设备及存储介质,获取目标业务的节点级联配置,节点级联配置中包含用于执行目标业务的多个数据节点的通信连接关系;基于多个数据节点的通信连接关系创建节点拓扑连接,节点拓扑连接中包含每个数据节点的输入通道和输出通道、且每个数据节点的输出通道被分配有内存,多个数据节点中接收端的输入通道共享其发送端的输出通道的内存;触发多个数据节点按照节点拓扑连接进行通信,以实现:接收端从其输入通道所共享的内存中读取第一数据,并将处理第一数据所获得的第二数据写入至其输出通道的内存中。本发明采用乒乓原理,接收端的输入通道共享其发送端的输出通道的内存,数据节点作为接收端时可以从其输入通道所共享的内存中读取数据、在完成数据处理后作为发送端将处理后的数据写入至其输出通道的内存中,以共享内存的方式实现多级数据收发的通信操作,使得任意两个数据节点之间实现数据的零拷贝通信,这就可以降低数据传输与处理时的资源消耗、提升通信能力。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121056313B_ABST
    Figure CN121056313B_ABST
Patent Text Reader

Abstract

The application provides a kind of multi-node cascade communication method, device, electronic equipment and storage medium, it is related to software technical field, obtain the node cascade configuration of target service, node cascade configuration contains the communication connection relationship of multiple data nodes for executing target service;Based on the communication connection relationship of multiple data nodes, create node topology connection, node topology connection contains the input channel and output channel of each data node, and the output channel of each data node is allocated with memory, the input channel of receiving end in multiple data nodes shares the memory of output channel of its sending end;Trigger multiple data nodes to communicate according to node topology connection, to achieve: receiving end reads first data from the memory shared by its input channel, and writes second data obtained by processing first data into the memory of its output channel.The application uses ping-pong principle, to realize the communication operation of multistage data transceiving in the mode of shared memory.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of software technology, and more specifically, to a multi-node cascaded communication method, apparatus, electronic device, and storage medium. Background Technology

[0002] In the field of autonomous driving, with the continuous development of autonomous driving technology and the introduction of deep learning and multi-sensor fusion technologies, the complexity of algorithms and the size of sensor data are constantly increasing, especially megapixel camera data. For a car to achieve truly safe and reliable autonomous driving, the requirement for data timeliness is inevitably very high. This places higher demands on the transmission and processing of sensor data and data from various algorithm nodes between processes or threads.

[0003] Therefore, reducing the memory bandwidth consumed during data transmission and processing has become an important direction for optimizing the performance of autonomous driving software at this stage. Summary of the Invention

[0004] In view of this, to solve the above problems, the present invention provides a multi-node cascaded communication method, device, electronic device, and storage medium, the technical solution of which is as follows:

[0005] A multi-node cascaded communication method, the multi-node cascaded communication method comprising:

[0006] Obtain the node cascading configuration of the target service, wherein the node cascading configuration contains the communication connection relationship of multiple data nodes used to execute the target service;

[0007] A node topology connection is created based on the communication connection relationship of the multiple data nodes. The node topology connection includes the input channel and output channel of each data node, and the output channel of each data node is allocated memory. The input channel of the receiving end of the multiple data nodes shares the memory of the output channel of its sending end.

[0008] The multiple data nodes are triggered to communicate according to the node topology connection, so as to achieve the following: the receiving end reads the first data from the memory shared by its input channel, and writes the second data obtained by processing the first data into the memory of its output channel.

[0009] Preferably, the step of creating a node topology connection based on the communication connection relationship of the plurality of data nodes includes:

[0010] The communication connection relationship of the multiple data nodes is described by a node topology to obtain the topology description information of each data node. The topology description information includes the number of input nodes, the number of output nodes, and the location depth.

[0011] For each data node, an input channel is created according to the number of its input nodes, and an output channel is created according to the number of its output nodes. A circular queue is allocated to its output channel, and when the data node acts as a transmitter, its circular queue is shared by the input channel of its corresponding receiver.

[0012] The number of circular queues for the plurality of data nodes is the same as the maximum value of the location depth of the plurality of data nodes.

[0013] Preferably, the step of creating a node topology connection based on the communication connection relationship of the plurality of data nodes further includes:

[0014] The location depth difference for each data node is calculated based on the location depth of each data node. The location depth difference is used to characterize the difference in location depth between the data node as a receiver and its corresponding data node as a transmitter.

[0015] For each data node, the maximum value among its corresponding position depth differences is used as the number of data caches in the circular queue corresponding to that data node.

[0016] Preferably, the step of creating a node topology connection based on the communication connection relationship of the plurality of data nodes further includes:

[0017] Identify multiple receivers among the plurality of data nodes that have the same sending end;

[0018] Configure the input channels of the identified multiple receivers to be shared, and make the circular queue corresponding to their transmitters the same.

[0019] Preferably, the step of creating a node topology connection based on the communication connection relationship of the plurality of data nodes further includes:

[0020] The data node with zero input nodes is designated as the head node, and the data node with zero output nodes is designated as the tail node.

[0021] Establish a virtual input channel from the tail node to the head node.

[0022] Preferably, the multi-node cascaded communication method further includes:

[0023] Node link management is performed on the multiple data nodes based on the node topology connection.

[0024] A multi-node cascaded communication device, the multi-node cascaded communication device comprising:

[0025] A configuration acquisition module is used to acquire the node cascading configuration of the target service, wherein the node cascading configuration contains the communication connection relationship of multiple data nodes for executing the target service;

[0026] The topology connection creation module is used to create node topology connections based on the communication connection relationships of the multiple data nodes. The node topology connection includes the input channel and output channel of each data node, and the output channel of each data node is allocated memory. The input channel of the receiving end of the multiple data nodes shares the memory of the output channel of its sending end.

[0027] The communication triggering module is used to trigger the multiple data nodes to communicate according to the node topology connection, so as to realize that: the receiving end reads the first data from the memory shared by its input channel, and writes the second data obtained by processing the first data into the memory of its output channel.

[0028] Preferably, the topology connection creation module is specifically used for:

[0029] A node topology description is performed on the communication connection relationship of the multiple data nodes to obtain topology description information for each data node. The topology description information includes the number of input nodes, the number of output nodes, and the location depth. For each data node, an input channel is created according to the number of its input nodes, and an output channel is created according to the number of its output nodes. A circular queue is allocated to its output channel. When the data node acts as a transmitter, its circular queue is shared by the input channel of its corresponding receiver. The number of circular queues of the multiple data nodes is the same as the maximum value of the location depth of the multiple data nodes.

[0030] An electronic device includes a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the multi-node cascaded communication method.

[0031] A storage medium storing a computer program / instruction thereon, which, when executed by a processor, implements the multi-node cascaded communication method described above.

[0032] A computer program product includes a computer program / instructions that, when executed by a processor, implement the multi-node cascaded communication method.

[0033] Compared with the prior art, the beneficial effects achieved by the present invention are as follows:

[0034] This invention provides a multi-node cascaded communication method, apparatus, electronic device, and storage medium. It acquires a node cascaded configuration for a target service, which includes communication connection relationships among multiple data nodes executing the target service. A node topology connection is created based on the communication connection relationships among the multiple data nodes. This node topology connection includes an input channel and an output channel for each data node, and each data node's output channel is allocated memory. The input channels of the receiving end among the multiple data nodes share the memory of the output channel of its sending end. The invention triggers multiple data nodes to communicate according to the node topology connection, so that: the receiving end reads first data from the memory shared by its input channels and writes second data obtained by processing the first data into the memory of its output channel. This invention employs the ping-pong principle, where the input channel of the receiving end shares the memory of the output channel of its transmitting end. When a data node acts as a receiving end, it can read data from the memory shared by its input channel. After completing data processing, it acts as a transmitting end and writes the processed data into the memory of its output channel. This shared memory approach enables multi-level data transmission and reception communication, allowing zero-copy communication between any two data nodes. This reduces resource consumption during data transmission and processing and improves communication capabilities. Attached Figure Description

[0035] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0036] Figure 1 A flowchart illustrating a multi-node cascaded communication method provided in an embodiment of the present invention;

[0037] Figure 2 An example of the communication connection relationship of multiple data nodes provided in an embodiment of the present invention;

[0038] Figure 3 A partial flowchart of a multi-node cascaded communication method provided in an embodiment of the present invention;

[0039] Figure 4 This is a schematic diagram of the structure of a multi-node cascaded communication device provided in an embodiment of the present invention. Detailed Implementation

[0040] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0041] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0042] The inventors discovered through research that, in the field of autonomous driving, the existing communication processing methods for data nodes (processes or threads) mainly fall into the following three categories:

[0043] 1) Direct copy communication. In this communication method, the sending end copies the data before sending it out, and the receiving end copies the data again for its current use. This ensures isolated data between the sending and receiving ends, eliminating contention for access and resulting in secure and reliable data. Common middleware like ROS1 uses this method. However, in Linux systems, this method requires multiple data copies from user memory to kernel memory, severely consuming processor resources and kernel memory bandwidth, thus degrading system performance.

[0044] 2) The sender does not copy, but the receiver does. In this communication method, the sender directly sends the data, and the receiver copies the data for its current use. This eliminates read / write conflicts between the sender and receiver. Compared to method 1), this method offers improved performance, but the data copying operation still occurs, and performance will decrease as the amount of communication data increases.

[0045] 3) Zero-copy shared memory. In this communication method, neither the sender nor the receiver copies data. The sender handles write operations, and the receiver handles read-only operations. After reading the data, the receiver processes it and then releases the corresponding data buffer. If the buffer is not released for an extended period, the sender will either lose the transmitted data or overwrite the buffered data when it enters its processing cycle. This communication method is highly suitable for point-to-point single-producer and single-consumer scenarios.

[0046] The three methods described above are all for single-node receiving and sending, i.e., single-node to single-node communication. For cascaded multi-node communication, where a node acts as both a producer and a consumer, no reliable method is provided. Application developers need to adapt these three methods according to different business requirements. However, this adaptation and combination can lead to contention for data usage across multiple nodes when data needs to be processed dependently. For security and reliability, synchronization protection is required at both the sending and receiving ends. Common methods include locking for protection or tiered copying for data isolation. For example, using zero-copy in the DDS middleware for multi-level producer-consumer model communication requires locking or data copy isolation for the multi-level communication data.

[0047] However, in the context of multiple nodes running in a multi-threaded or multi-process environment, such locks or copies will be frequently and continuously operated as the threads or processes run. This will bring a lot of system overhead, waste the processor's computing resources, reduce communication efficiency, and also increase the complexity of software implementation and the uncontrollable factors of the software system.

[0048] To address the aforementioned issues, this invention provides a multi-node cascaded communication method. Based on the condition that all processor cores on a single chip share physical memory, multiple copies of the memory for communication data are requested in a Linux system or other system environment. Using the ping-pong principle, multi-level data transmission and reception communication operations between multiple threads or processes are achieved through shared memory, enabling zero-copy communication between any two data nodes.

[0049] See Figure 1 , Figure 1 This is a flowchart illustrating a multi-node cascaded communication method provided in an embodiment of the present invention. Figure 1 As shown, the communication method for multi-node cascading includes the following steps:

[0050] S10, obtain the node cascading configuration of the target service. The node cascading configuration contains the communication connection relationship of multiple data nodes used to execute the target service.

[0051] In this embodiment of the invention, a data node can be a process or a thread. When executing a target task, multiple processes or multiple threads can run on the processor core. For this purpose, a process or a thread can be used as a data node.

[0052] To address this, by obtaining the node cascading configuration of the target service, the multiple data nodes required to execute the target task and their communication connections can be determined. See also Figure 2 , Figure 2This is an example of the communication connection relationship between multiple data nodes provided in an embodiment of the present invention. For example... Figure 2 As shown, six data nodes, node0 to node5, are required to execute the target task. Node0 is the head node and node5 is the tail node. Taking node0 as an example, the communication connection relationship is explained. The child nodes of node0 include three data nodes: node1, node2, and node4. That is, when node0 is the sender, its corresponding receivers include node1, node2, and node4.

[0053] S20: Create a node topology connection based on the communication connection relationship of multiple data nodes. The node topology connection includes the input channel and output channel of each data node, and the output channel of each data node is allocated memory. The input channel of the receiving end of multiple data nodes shares the memory of the output channel of its sending end.

[0054] In this embodiment of the invention, a node topology connection for executing a target task can be created based on the communication connection relationship of multiple data nodes in a node cascading configuration. Each data node in this node topology connection has its corresponding input channel and output channel. The output channel is allocated memory. The input channel is defined as receiving data, and the output channel is defined as sending data. The output of a data node and the input channel of another data node that depends on the data node share a memory. That is, the input channel of the receiving end shares the memory of the output channel of its corresponding sending end. In practical applications, memory sharing can be achieved by using a mutex lock and a condition variable.

[0055] In the specific implementation process, a circular queue can be used to manage the memory address of the data. The step S20, "creating node topology connections based on the communication connection relationships of multiple data nodes," can be implemented using the following steps, as shown in the flowchart. Figure 3 As shown:

[0056] S201, perform node topology description on the communication connection relationship of multiple data nodes to obtain topology description information for each data node. The topology description information includes the number of input nodes, the number of output nodes, and the location depth.

[0057] S202, for each data node, an input channel is created according to the number of its input nodes, and an output channel is created according to the number of its output nodes. A circular queue is allocated to its output channel. When the data node acts as a transmitter, its circular queue is shared by the input channel of its corresponding receiver. The number of circular queues of multiple data nodes is the same as the maximum value of the location depth of the multiple data nodes.

[0058] Specifically, in this embodiment of the invention, a circular queue shared by data nodes can be created. This circular queue can be used as an input or output element for a certain data node. The sending end can perform non-blocking transmission to the circular queue, and the receiving end can perform blocking reception to the circular queue. In addition, the size of the memory block in the circular queue can be determined according to the data structure definition, and this embodiment of the invention does not limit it in this regard.

[0059] Based on this, a node topology description is performed on the communication connections of multiple data nodes to obtain the topology description information of each data node. Specifically, the communication connections of multiple data nodes can be described in the form of a topology graph. By traversing the topology graph, the number of input data nodes that each data node depends on (i.e., the number of input nodes) and the number of output data nodes that depend on it (i.e., the number of output nodes) can be obtained. Furthermore, assuming that in a certain topology graph there are... One data node, The node numbers of the data nodes are as follows: , , , Set the head node The positional depth is 0, and the number of data nodes contained in the longest path from the head node to the tail node is equal to the positional depth of the entire topology graph. The depth of the tail node is The depth of the data node containing the input that the tail node depends on is then... By analogy, data nodes can be obtained. , , , Their respective position depth , , , .

[0060] For each data node, input channels can be created based on the number of its input nodes, and output channels can be created based on the number of its output nodes. For example, if the number of input nodes for this data node is... Then create The number of input channels and output nodes is Then create There are one output channel. And according to the transmit and receive relationship specified by the communication connection relationship of multiple data nodes, the output channels of different data nodes are connected to the input channels of other data nodes. After traversing all data nodes, only the output channel of the tail node is not connected.

[0061] Additionally, for each data node, a circular queue can be allocated to its output channel, so that when that data node acts as a transmitter, its circular queue is shared by the input channels of data nodes that depend on its output (acting as receivers). Based on this, the total number of circular queues for all data nodes is the same as the maximum value among the location depths of the data nodes.

[0062] Based on this, to implement data caching for the circular queue, embodiments of the present invention can also determine the number of data caches based on the location depth of the data nodes. In this regard, in embodiments of the present invention, step S20, "creating node topology connections based on the communication connection relationships of multiple data nodes," can further include the following steps:

[0063] The location depth difference for each data node is calculated based on its location depth. The location depth difference is used to represent the difference in location depth between the data node as a receiver and its corresponding data node as a sender. For each data node, the maximum value of its location depth difference is used as the number of data buffers in the circular queue corresponding to that data node.

[0064] In this embodiment of the invention, for Any data node among the data nodes In other words, its location depth can be obtained. And the location and depth of the data nodes (as senders) that it depends on when acting as a receiver. ,Will and The difference between the two values ​​is taken as the location depth difference of the data node. Of course, if the data node depends on multiple data nodes, then... There are multiple such data nodes. To address this, the maximum value among the location depth differences can be used as the number of data caches in the circular queue of that data node's output channel. Therefore, when allocating a circular queue for each data node, memory can be allocated according to the corresponding number of data caches.

[0065] In addition, to reduce the memory consumption of circular queues, in this embodiment of the invention, multiple circular queues corresponding to multiple receivers with the same sending end can be set as one. Step S20, "creating node topology connections based on the communication connection relationships of multiple data nodes," may further include the following steps:

[0066] Identify multiple receivers with the same transmitter among multiple data nodes; configure the input channels of the identified multiple receivers to be shared, and make the circular queue corresponding to their transmitters the same.

[0067] In this embodiment of the invention, by traversing the topology graph, multiple receivers with the same sending end among multiple data nodes can be identified, and then the input channels of multiple receivers can be configured to share the same circular queue of their sending end. Thus, multiple receivers belonging to the same sending end share the same circular queue, reducing the memory allocation of the circular queue.

[0068] Furthermore, in some scenarios, feedback adjustments are required based on the final data processing results. In this embodiment of the invention, step S20, "creating node topology connections based on the communication connection relationships of multiple data nodes," further includes the following steps:

[0069] Among multiple data nodes, the data node with zero input nodes is designated as the head node, and the data node with zero output nodes is designated as the tail node; a virtual input channel is established from the tail node to the head node.

[0070] In this embodiment of the invention, data nodes with zero input nodes are designated as head nodes, and data nodes with zero output nodes are designated as tail nodes. A virtual input channel is established from the tail node to the head node; that is, a connection is established between the output channel of the tail node and the input channel of the head node through the virtual input channel. The input channel of the head node shares the memory of the output channel of the tail node. Furthermore, it is assumed that the number of tail nodes is... And the number of communication channels within each tail node is Then the number of virtual input channels in the head node is Therefore, a communication ring with multiple data nodes can be created.

[0071] S30, trigger multiple data nodes to communicate according to the node topology connection, so as to achieve: the receiving end reads the first data from the memory shared by its input channel, and writes the second data obtained by processing the first data into the memory of its output channel.

[0072] In this embodiment of the invention, by responding to the communication triggering event of the target service, multiple data nodes can be triggered to communicate according to the node topology connection. During the communication process, the receiving end reads data (i.e., the first data) from the memory shared by its input channel, processes the first data to obtain the second data, and writes the second data into the memory of its output channel.

[0073] To illustrate this using a scenario of creating a communication ring with multiple data nodes, the location and depth of the entire topology graph are considered. Create for the head node Each corresponding input is sent, and each trigger input is sent. This allows all head nodes to enter the receiving operation, thereby triggering continuous communication throughout the entire node link.

[0074] It should be noted that the hardware environment required for the implementation of this invention is a chip system, and the software environment is a Linux system or a system with a POSIX (Portable Operating System Interface) standard interface. For example, this invention can be applied to mobile platforms, such as drones, unmanned boats, unmanned vehicles, robots, etc. The perception system on an unmanned vehicle generates a large amount of perception data that needs to be transmitted and processed. This invention can be used to achieve communication between different processes or threads. The perception system includes visual sensors, lidar, millimeter-wave radar, etc. Specifically, threads directly share the process's global memory, while processes can share memory with the same name through the POSIX interface; a circular queue for communication between multiple processes and threads is implemented based on the POSIX interface, using mutexes and condition variables; broadcasting and receiving messages between processes or threads is implemented using the Linux operating system's System V interface or the socket interface, where the receiving end receives messages in a blocking manner to avoid the overhead of processor polling; a topology information table is established using the communication connection relationships between processes or threads, and two threads are created within the data nodes, one thread to handle broadcast reception information and the other thread to handle broadcast transmission information. The communication topology relationships between processes or threads are updated and the communication status information of each is maintained by receiving and sending broadcast messages.

[0075] In some scenarios, embodiments of the present invention can also manage node links among multiple data nodes based on node topology connections. Specifically, embodiments of the present invention can create components for recording and managing information and link relationships of each node, used for indexing, controlling, and searching link relationships among each data node, including the data node's sequence number, the process number or thread number that the data node depends on, the operation information of the input and output channels possessed by the data node, the data node's sequence number and position in the topology graph, the farthest distance between two data nodes in the topology graph, and the depth of the entire topology graph.

[0076] Based on the above description, the multi-node cascaded communication method provided by this invention can avoid the performance loss caused by data transmission to the system when performing node cascaded communication in conventional multi-process or multi-threaded scenarios, even for arbitrarily complex node topology connections. The use of processors and memory bandwidth no longer increases with the increase of communication data, fundamentally solving the problem that communication performance depends on the size of data packets in inter-process or inter-thread communication.

[0077] Moreover, this invention can realize the topological relationship of various algorithm connections through simple configuration, reducing the engineering complexity and error rate of pipeline deployment of multi-process or multi-threaded nodes, enabling multi-node algorithms to be quickly and easily deployed on a single chip system, shortening the algorithm development and deployment cycle, improving work efficiency, and saving human resource costs.

[0078] Based on the multi-node cascaded communication method provided in the above embodiments, this invention provides a corresponding apparatus for executing the multi-node cascaded communication method. A schematic diagram of the structure of the multi-node cascaded communication apparatus is shown below. Figure 4 As shown, it includes:

[0079] The configuration acquisition module 10 is used to acquire the node cascading configuration of the target service. The node cascading configuration contains the communication connection relationship of multiple data nodes used to execute the target service.

[0080] The topology connection creation module 20 is used to create node topology connections based on the communication connection relationship of multiple data nodes. The node topology connection includes the input channel and output channel of each data node, and the output channel of each data node is allocated memory. The input channel of the receiving end in multiple data nodes shares the memory of the output channel of its sending end.

[0081] The communication trigger module 30 is used to trigger multiple data nodes to communicate according to the node topology connection, so as to achieve: the receiving end reads the first data from the memory shared by its input channel, and writes the second data obtained by processing the first data into the memory of its output channel.

[0082] Optional, the topology connection creation module 20 is specifically used for:

[0083] A node topology description is performed on the communication connection relationship of multiple data nodes to obtain the topology description information of each data node. The topology description information includes the number of input nodes, the number of output nodes, and the location depth. For each data node, an input channel is created according to the number of its input nodes, and an output channel is created according to the number of its output nodes. A circular queue is allocated to its output channel. When the data node acts as a transmitter, its circular queue is shared by the input channel of its corresponding receiver. The number of circular queues of multiple data nodes is the same as the maximum value of the location depth of the multiple data nodes.

[0084] Optionally, the topology connection creation module 20 is also used for:

[0085] The location depth difference for each data node is calculated based on its location depth. The location depth difference is used to represent the difference in location depth between the data node as a receiver and its corresponding data node as a sender. For each data node, the maximum value of its location depth difference is used as the number of data buffers in the circular queue corresponding to that data node.

[0086] Optionally, the topology connection creation module 20 is also used for:

[0087] Identify multiple receivers with the same transmitter among multiple data nodes; configure the input channels of the identified multiple receivers to be shared, and make the circular queue corresponding to their transmitters the same.

[0088] Optionally, the topology connection creation module 20 is also used for:

[0089] Among multiple data nodes, the data node with zero input nodes is designated as the head node, and the data node with zero output nodes is designated as the tail node; a virtual input channel is established from the tail node to the head node.

[0090] Optionally, the topology connection creation module 20 is also used for:

[0091] Node link management is performed on multiple data nodes based on node topology connections.

[0092] It should be noted that the detailed functions of each module in the embodiments of the present invention can be found in the corresponding disclosure of the above-mentioned multi-node cascaded communication method embodiments, and will not be repeated here.

[0093] Based on the multi-node cascaded communication method provided in the above embodiments, this invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the multi-node cascaded communication method.

[0094] Based on the multi-node cascaded communication method provided in the above embodiments, this embodiment of the invention also provides a storage medium storing a computer program / instruction thereon, wherein the computer program / instruction is executed by a processor to realize the multi-node cascaded communication method.

[0095] Based on the multi-node cascaded communication method provided in the above embodiments, this invention also provides a computer program product, including a computer program / instruction, wherein the computer program / instruction, when executed by a processor, implements a multi-node cascaded communication method.

[0096] The foregoing has provided a detailed description of a multi-node cascaded communication method, apparatus, electronic device, and storage medium provided by the present invention. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.

[0097] It should be noted that the various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to the method section.

[0098] It should also be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that elements inherent to a process, method, article, or apparatus that comprises a list of elements, or elements inherent to such processes, methods, articles, or apparatus, are also included. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0099] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A communication method for multi-node cascading, characterized in that, The multi-node cascaded communication method includes: Obtain the node cascading configuration of the target service, wherein the node cascading configuration contains the communication connection relationship of multiple data nodes used to execute the target service; A node topology connection is created based on the communication connection relationship of the multiple data nodes. The node topology connection includes the input channel and output channel of each data node, and the output channel of each data node is allocated memory. The input channel of the receiving end of the multiple data nodes shares the memory of the output channel of its sending end. The multiple data nodes are triggered to communicate according to the node topology connection, so as to achieve the following: the receiving end reads the first data from the memory shared by its input channel, and writes the second data obtained by processing the first data into the memory of its output channel.

2. The multi-node cascaded communication method according to claim 1, characterized in that, The creation of node topology connections based on the communication connection relationships of the multiple data nodes includes: The communication connection relationship of the multiple data nodes is described by a node topology to obtain the topology description information of each data node. The topology description information includes the number of input nodes, the number of output nodes, and the location depth. For each data node, an input channel is created according to the number of its input nodes, and an output channel is created according to the number of its output nodes. A circular queue is allocated to its output channel, and when the data node acts as a transmitter, its circular queue is shared by the input channel of its corresponding receiver. The number of circular queues for the plurality of data nodes is the same as the maximum value of the location depth of the plurality of data nodes.

3. The multi-node cascaded communication method according to claim 2, characterized in that, The creation of node topology connections based on the communication connection relationships of the multiple data nodes further includes: The location depth difference for each data node is calculated based on the location depth of each data node. The location depth difference is used to characterize the difference in location depth between the data node as a receiver and its corresponding data node as a transmitter. For each data node, the maximum value among its corresponding position depth differences is used as the number of data caches in the circular queue corresponding to that data node.

4. The multi-node cascaded communication method according to claim 2, characterized in that, The creation of node topology connections based on the communication connection relationships of the multiple data nodes further includes: Identify multiple receivers among the plurality of data nodes that have the same sending end; Configure the input channels of the identified multiple receivers to be shared, and make the circular queue corresponding to their transmitters the same.

5. The multi-node cascaded communication method according to claim 2, characterized in that, The creation of node topology connections based on the communication connection relationships of the multiple data nodes further includes: The data node with zero input nodes is designated as the head node, and the data node with zero output nodes is designated as the tail node. Establish a virtual input channel from the tail node to the head node.

6. The multi-node cascaded communication method according to claim 1, characterized in that, The multi-node cascaded communication method also includes: Node link management is performed on the multiple data nodes based on the node topology connection.

7. A multi-node cascaded communication device, characterized in that, The multi-node cascaded communication device includes: A configuration acquisition module is used to acquire the node cascading configuration of the target service, wherein the node cascading configuration contains the communication connection relationship of multiple data nodes for executing the target service; The topology connection creation module is used to create node topology connections based on the communication connection relationships of the multiple data nodes. The node topology connection includes the input channel and output channel of each data node, and the output channel of each data node is allocated memory. The input channel of the receiving end of the multiple data nodes shares the memory of the output channel of its sending end. The communication triggering module is used to trigger the multiple data nodes to communicate according to the node topology connection, so as to realize that: the receiving end reads the first data from the memory shared by its input channel, and writes the second data obtained by processing the first data into the memory of its output channel.

8. The multi-node cascaded communication device according to claim 7, characterized in that, The topology connection creation module is specifically used for: A node topology description is performed on the communication connection relationship of the multiple data nodes to obtain topology description information for each data node. The topology description information includes the number of input nodes, the number of output nodes, and the location depth. For each data node, an input channel is created according to the number of its input nodes, and an output channel is created according to the number of its output nodes. A circular queue is allocated to its output channel. When the data node acts as a transmitter, its circular queue is shared by the input channel of its corresponding receiver. The number of circular queues of the multiple data nodes is the same as the maximum value of the location depth of the multiple data nodes.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory, characterized in that, The processor executes the computer program to implement the multi-node cascaded communication method according to any one of claims 1-6.

10. A storage medium having a computer program / instruction stored thereon, characterized in that, When the computer program / instructions are executed by the processor, they implement the multi-node cascaded communication method according to any one of claims 1-6.

Citation Information

Patent Citations

  • Multi-process zero-copy communication method and device for sensor data

    CN114968616A

  • Dual-system multi-channel memory sharing method for vehicle-mounted cabin entertainment system

    CN115809158A