Data communication system for automatic driving

By adopting the correspondence between data type and topic combination and data transmission channel in the autonomous driving communication system, combining shared memory and coroutine switching technology, the problems of bandwidth waste and inefficiency in the autonomous driving communication system are solved, and more efficient and Stable data transmission meets the needs of rich autonomous driving scenarios.

CN119155296APending Publication Date: 2024-12-17SHANGHAI XIANTU INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411048508.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-31
Publication Date
2024-12-17

AI Technical Summary

Technical Problem

In the autonomous driving communication system, bandwidth resources are wasted and inefficient due to multi-node cross-machine data transmission, and the efficiency and stability of a single thread performs native and cross-machine transmission operations are affected by the network status.

Method used

The combination of data types and topics is used to correspond to the data transmission channel one-to-one. The target data type and topic are determined through the data cross-computer sending module to transmit data using a single data transmission channel, and shared memory and coroutines are used on the sending and receiving ends. Switching technology optimizes data transmission, and the monitoring and alarm modules monitor data transmission parameters in real time.

Benefits of technology

It greatly reduces the waste of bandwidth resources, improves the efficiency and stability of autonomous driving communication, meets the needs of different driving scenarios, and ensures the safety of autonomous driving and the rational use of resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119155296A_ABST
    Figure CN119155296A_ABST
Patent Text Reader

Abstract

The invention discloses a data communication system for automatic driving, and the system comprises a data transmitting end which comprises a transmitting end data publishing node and is used for publishing to-be-published data; the sending end data subscription node is used for acquiring the data to be published when the data to be published is confirmed; the data cross-machine sending module is used for determining a target data type and a target theme of the to-be-published data when the to-be-published data is confirmed, and transmitting the to-be-published data by adopting a data transmission channel corresponding to the target data type and the target theme; the data receiving end comprises a data cross-machine receiving module which is used for receiving the data to be published from the data transmission channel corresponding to the target data type and the target theme; and the plurality of receiving end data subscription nodes are used for acquiring the data to be published from the data cross-machine receiving module. When the automatic driving communication system is used for multi-node cross-machine data transmission, the waste of bandwidth resources can be effectively reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of autonomous driving communication technology, and in particular to a data communication system for autonomous driving. Background Art

[0002] In current autonomous driving communication systems, data communication is usually achieved using the Robot Operating System (ROS) or the second generation ROS (ROS2). Since ROS / ROS2 is a communication tool used between a single node and a node, duplication of bandwidth will occur when transmitting data across multiple nodes.

[0003] Specifically, the duplicate bandwidth problem refers to the fact that when data is transmitted between every two nodes across machines, multiple bandwidth resources are used to transmit the same data, which results in the repeated waste of limited bandwidth resources. Especially in autonomous driving application scenarios, the number and types of functional nodes are numerous, and cross-machine data communication between different nodes is very frequent. The duplicate bandwidth problem will lead to a significant increase in the load and resource consumption of the autonomous driving network.

[0004] In addition, ROS2 usually uses a single thread (or process) to perform multiple operations such as local transmission and cross-machine transmission. Specifically, for the same data to be published, ROS2 uses a single thread to perform multiple operations such as transmitting the data to be published to other subscription nodes of the local machine and transmitting the data to be published across machines to subscription nodes of other hosts. This causes mutual influence between local transmission and cross-machine transmission. For example, the efficiency and stability of local transmission may be affected by the network status of cross-machine transmission. Summary of the invention

[0005] The technical problem solved by the embodiments of the present invention is how to reduce the waste of bandwidth resources in multi-node cross-machine data transmission in an autonomous driving communication system, and improve the efficiency and stability of autonomous driving data communication as a whole.

[0006] To solve the above technical problems, an embodiment of the present invention provides a data communication method for autonomous driving, comprising: a data sending end, the data sending end comprising: a sending end data publishing node, used to publish data to be published; a sending end data subscription node, used to obtain the data to be published when confirming that there is data to be published; a data cross-machine sending module, used to determine the target data type and target topic of the data to be published when confirming that there is data to be published, and determine the data transmission channel corresponding to the target data type and the target topic, and use the data transmission channel to transmit the data to be published, wherein the combination of the data type and the topic has a one-to-one correspondence with the data transmission channel; a data receiving end, the data receiving end comprising: a data cross-machine receiving module, used to receive the data to be published from the data transmission channel corresponding to the target data type and the target topic; multiple receiving end data subscription nodes, used to obtain the data to be published from the data cross-machine receiving module; wherein the sending end data publishing node and the multiple receiving end data subscription nodes are associated through the target data type and the target topic.

[0007] Optionally, the data sending end also includes a first shared memory; the sending end data publishing node is also used to write the data to be published into the first shared memory; the sending end data subscription node is used to read the data to be published from the first shared memory when it is confirmed that the first shared memory has data to be published; the data cross-machine sending module is used to read the data to be published from the first shared memory when it is confirmed that the first shared memory has data to be published, and then execute the steps of determining the data transmission channel of the data to be published and using the data transmission channel to transmit the data to be published.

[0008] Optionally, the first shared memory is divided into multiple first memory blocks, and the combination of data types and topics corresponds one-to-one to the first memory blocks; writing the data to be published into the first shared memory includes: determining the target data type and target topic of the data to be published; writing the data to be published into the first memory block corresponding to the target data type and target topic.

[0009] Optionally, the data receiving end also includes: a second shared memory; the data cross-machine receiving module is also used to write the data to be published into the second shared memory; wherein each receiving end data subscription node associated with the sending end data publishing node reads the data to be published from the second shared memory respectively.

[0010] Optionally, the second shared memory is divided into multiple second memory blocks, and the combination of data types and topics corresponds one-to-one to the second memory blocks; writing the data to be published into the second shared memory includes: determining the target data type and target topic of the data to be published; writing the data to be published into the second memory block corresponding to the target data type and target topic; wherein each receiving-end data subscription node associated with the sending-end data publishing node reads the data to be published from the second memory block.

[0011] Optionally, the data sending end includes a plurality of sending end data subscription nodes, each sending end data subscription node has its own associated data type and topic, and the plurality of sending end data subscription nodes correspond one-to-one to a plurality of pre-created coroutines, wherein when the coroutine is in a running state, the sending end data subscription node corresponding to the coroutine obtains the data to be published with the associated data type and topic, and when the coroutine is in a suspended state, the sending end data subscription node corresponding to the coroutine stops obtaining the data to be published; the coroutines corresponding to the respective sending end data subscription nodes of the data sending end are run in the order of the coroutines indicated by the wake-up queue; wherein, whenever the sending end data subscription node corresponding to the currently running coroutine completes obtaining the data to be published, the currently running coroutine is suspended, and then the next coroutine in the wake-up queue is run.

[0012] Optionally, the wake-up queue is determined in the following manner: whenever it is confirmed that there is new data to be published, the target data type and target topic of the data to be published are determined, and then all sending data subscription nodes associated with the target data type and target topic are determined, recorded as target subscription nodes; the suspended coroutines corresponding to each target subscription node are woken up, and each coroutine is placed in the wake-up queue in the order of being awakened, and the coroutines with earlier awakening order are placed earlier in the wake-up queue.

[0013] Optionally, running the next coroutine in the wake-up queue includes: saving the CPU register state of the currently running coroutine as a process; and loading the CPU register state of the next coroutine into the CPU register.

[0014] Optionally, the data sending end also includes a network stack; and the use of the data transmission channel to transmit the data to be published includes: writing the data to be published into the network stack, and then reading the data to be published from the network stack and sending it to the data transmission channel.

[0015] Optionally, the data sending end also includes: a monitoring module, used to perform real-time monitoring of the data transmission parameters of the data transmission channel, wherein the data transmission parameters are selected from one or more of the following: data transmission frequency, data transmission delay, and data transmission flow; an alarm module, used to issue a corresponding alarm indication signal according to the monitoring result of the monitoring module; wherein, when the monitored data transmission frequency is less than a preset frequency threshold and / or the data transmission flow is less than a preset flow threshold, the corresponding alarm indication signal is used to indicate that there is data packet loss in the data transmission channel; when the monitored data transmission delay is greater than a preset delay threshold, the corresponding alarm indication signal is used to indicate that the bandwidth of the data transmission channel exceeds the network card limit or there is a network failure.

[0016] Compared with the prior art, the technical solution of the embodiment of the present invention has the following beneficial effects:

[0017] Compared with the existing conventional autonomous driving communication system, which creates a corresponding data transmission channel between every two nodes, resulting in the problem of repeated occupation and waste of bandwidth resources, the embodiment of the present invention establishes a one-to-one correspondence between the combination of "data type + topic" and the data transmission channel, and specially sets a data cross-machine transmission module at the data sending end of the autonomous driving communication system. After determining the target data type and target topic of the data to be published by the data publishing node of the sending end, the module determines the single data transmission channel corresponding to the target data type and the target topic, and then uses the single data transmission channel to transmit the data to be published; accordingly, the multiple receiving-end data subscription nodes at the data receiving end that have subscribed to the target data type and the target topic can obtain the data to be published from the single data transmission channel. Therefore, no matter how many subscription nodes there are at the data receiving end, as long as they subscribe to the data of the same "data type + topic", they can use the only corresponding data transmission channel (i.e., a single data transmission channel) to realize cross-machine data transmission, which greatly reduces the waste of bandwidth resources, thereby improving the efficiency and stability of autonomous driving communication as a whole.

[0018] Furthermore, in the field of autonomous driving, in order to meet the needs of different driving scenarios, the same type of data often needs to be divided into different topics. Therefore, compared with only binding the "data type" to the data transmission channel (i.e., using a single data transmission channel to transmit data of multiple topics under the same data type), this implementation scheme binds the combination of "data type + topic" to the data transmission channel one by one, which can effectively improve the efficiency and timeliness of data transmission, which is conducive to meeting the needs of richer autonomous driving scenarios and ensuring the safety of autonomous driving. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 is a schematic diagram of the architecture of a data communication system for autonomous driving in an embodiment of the present invention;

[0020] Figure 2 is a schematic diagram comparing the cross-machine transmission performed by the autonomous driving communication system of an embodiment of the present invention and the autonomous driving communication system of the prior art;

[0021] Figure 3 2 is a schematic diagram of the architecture of another data communication system for autonomous driving in an embodiment of the present invention. DETAILED DESCRIPTION

[0022] As mentioned in the background technology, the existing autonomous driving communication system (for example, ROS or ROS2) is mainly used as a communication tool between single nodes, and duplicate bandwidth problems will occur when multiple nodes are transmitted across machines. The following example illustrates the duplicate bandwidth problem.

[0023] For a data publishing node a of local machine A (for example, a point cloud data publishing node), the nodes in this local machine that subscribe to the point cloud data include data subscription nodes b and c (for example, a map generation function node, a route planning function node, etc.), and the nodes in another host B that subscribe to the point cloud data include data subscription nodes x and y (for example, an obstacle avoidance function node, a lane line generation node, etc.).

[0024] The way ROS / ROS2 performs cross-machine data transmission between the data publishing node a of host A and the data subscription nodes x and y of host B is as follows: a data transmission channel is established between node a and node x, and a data transmission channel is also established between node a and node y (that is, each two cross-machine nodes have their own data transmission channel). It can be seen that the data transmitted between node a and node x and between node a and node y are consistent, but two data transmission channels are used to realize data transmission, which leads to repeated occupation of bandwidth resources (that is, the so-called repeated bandwidth problem).

[0025] It is understandable that in autonomous driving application scenarios, due to the large number and types of data publishing nodes and data subscription nodes, and the large frequency and amount of cross-machine data transmission between different nodes, this will lead to excessive duplication of bandwidth resources, greatly increasing the load and resource consumption of the autonomous driving network, and thus affecting the overall efficiency and stability of autonomous driving data communication.

[0026] In order to solve the above technical problems, in an embodiment of the present invention, the combination of "data type + topic" is bound to the data transmission channel one by one, and a data cross-machine sending module is specially set at the data sending end of the autonomous driving communication system, which is used to determine the target data type and target topic of the data to be published in the data publishing node of the sending end, and then determine the single data transmission channel (for example, data transmission channel X) corresponding to the target data type and target topic, and then use the data transmission channel X to transmit the data to be published; accordingly, multiple receiving-end data subscription nodes at the data receiving end that have subscribed to the target data type and target topic can all obtain the data to be published from the data transmission channel X.

[0027] From the above, for data with the same "data type + topic", no matter how many nodes the data receiving end subscribes to, a unique corresponding data transmission channel (i.e., a single data transmission channel) can be used to achieve cross-machine data transmission. In this way, the repeated occupation and waste of bandwidth resources are greatly reduced, and the limited bandwidth resources in the autonomous driving network can be more reasonably utilized, which can improve the overall efficiency and stability of autonomous driving communication.

[0028] In order to make the above-mentioned objects, features and beneficial effects of the present invention more obvious and understandable, specific embodiments of the present invention are described in detail below with reference to the accompanying drawings.

[0029] Reference Figure 1 , Figure 1 Schematic diagram of the architecture of a data communication system for autonomous driving in an embodiment of the present invention.

[0030] Specifically, the data communication system for autonomous driving (hereinafter referred to as "autonomous driving communication system") includes: a data transmitting end 10 and a data receiving end 20. The data transmitting end 10 and the data receiving end 20 can be different terminals (or different electronic devices, hosts) with data communication functions in the autonomous driving communication system, for example, they can be selected from but not limited to computers, mobile phones, tablet computers, servers, cloud platforms, and other vehicle-mounted devices or external devices required in actual application scenarios.

[0031] The data sending end 10 comprises:

[0032] The data publishing node 101 at the sending end is used to publish the data to be published;

[0033] The data subscription node 103 at the sending end is used to obtain the data to be published when confirming that there is data to be published;

[0034] The data cross-machine sending module 104 is used to determine the target data type and target subject of the data to be published when confirming that there is data to be published, and determine the data transmission channel corresponding to the target data type and target subject, and use the data transmission channel to transmit the data to be published, wherein the combination of data type and subject has a one-to-one correspondence with the data transmission channel.

[0035] Wherein, the data receiving end 20 includes:

[0036] The data cross-machine receiving module 201 is used to receive the data to be published from the data transmission channel corresponding to the target data type and the target topic;

[0037] The multiple receiving-end data subscription nodes 202 are used to obtain the data to be published from the data cross-machine receiving module 201; the sending-end data publishing node 101 and the multiple receiving-end data subscription nodes 202 are associated through the target data type and target topic.

[0038] In a specific implementation, the sending end data publishing node 101, the sending end data subscription node 103, and the receiving end data subscription node 202 can be applications (APPs) or components, algorithm modules, software and hardware combination modules, etc. used to implement different functions in the autonomous driving scenario, for example, data acquisition function modules (including but not limited to image and / or video data acquisition modules, point cloud data acquisition modules, vehicle body motion related data acquisition modules), map generation function modules, map update function modules, vehicle body positioning and navigation function modules, obstacle avoidance function modules, target recognition function modules, vehicle power control function modules, etc. Specifically, different modules or applications can be configured in the same or different terminals or electronic devices.

[0039] In a specific implementation, the data transmitting end 10 may include multiple transmitting end data publishing nodes 101 and transmitting end data subscription nodes 103, and the data receiving end 20 may include multiple receiving end data subscription nodes 202. Each transmitting end data publishing node 101 may publish data of one or more data types to be published, each transmitting end data subscription node 103 and receiving end data subscription node 202 may obtain (or subscribe to) data of one or more data types to be published, and each data type may include one or more topics.

[0040] The sender data publishing node 101 is associated with one or more sender data subscription nodes 103 through data types and topics. Similarly, the sender data publishing node 101 is also associated with one or more receiver data subscription nodes 202 through data types and topics. More specifically, the data types and topics published by the sender data publishing node 101 are consistent with the data types and topics subscribed by the associated sender data subscription nodes 103 and the associated receiver data subscription nodes 202.

[0041] In a specific implementation, the data types of the data to be published can be divided according to the actual application scenario requirements. In some embodiments, the data to be published can be divided into data types such as image data, video data, point cloud data, voice data, angular velocity data, acceleration data, posture data, temperature data, and humidity data according to the source of the data to be published (for example, sensor type) or the data representation form. In other embodiments, the data to be published can be divided into 2D data, 3D data, and data types of other dimensions according to the dimensions of the data to be published. In some other embodiments, the data types can be divided according to the format of the data to be published. For example, for image data collected by a camera, it can be divided into PSD format images, PDT format images, WebP format images, XMP format images, GIF format images, JPEG format images, and the like.

[0042] Furthermore, for each data type, it can be divided into one or more themes according to actual needs. For example, for the image data type, it can be further divided into multiple themes such as night driving scenes, evening driving scenes, daytime driving scenes, etc. according to the driving period, that is, the image data to be released is divided into image data collected under night driving scenes, image data collected under evening driving scenes, and image data collected under daytime driving scenes. For another example, for the point cloud data type, it can be further divided into multiple themes such as urban road driving scenes, parking lot driving scenes, residential driving scenes, and industrial park driving scenes according to the driving geographical location, that is, the point cloud data to be released is divided into point cloud data collected under urban road driving scenes, point cloud data collected under parking lot driving scenes, point cloud data collected under residential driving scenes, point cloud data collected under industrial park driving scenes, etc.

[0043] In practical applications, the division of data types and topics is not limited to the above-mentioned ones, and other appropriate methods can be used for division according to actual needs.

[0044] In existing conventional autonomous driving communication systems, for multi-node cross-machine data communication (i.e., data transmission between nodes between different terminals or devices), a corresponding data transmission channel will be created between every two nodes regardless of whether the transmitted data is consistent, resulting in multiple data transmission channels transmitting completely consistent data, thereby causing duplicate occupation and waste of bandwidth resources.

[0045] In comparison, in an embodiment of the present invention, the combination of "data type + topic" is bound one by one to the data transmission channel, and a data cross-machine sending module 104 (also referred to as a gateway tool) is specially provided at the data sending end 10 of the autonomous driving communication system. After determining the target data type and target topic of the data to be published of the sending end data publishing node 101, the module determines the data transmission channel (hereinafter referred to as data transmission channel X) corresponding to the target data type and target topic, and then uses the data transmission channel X to transmit the data to be published; accordingly, multiple receiving end data subscription nodes 202 of the data receiving end 20 that have subscribed to the target data type and target topic can all obtain the data to be published from the data transmission channel X.

[0046] From the above, for data with the same "data type + topic", no matter how many nodes the data receiving end subscribes to, a unique corresponding data transmission channel (i.e., a single data transmission channel) can be used to achieve cross-machine data transmission. In this way, the repeated occupation and waste of bandwidth resources are greatly reduced, and the limited bandwidth resources in the autonomous driving network can be more reasonably utilized, which can improve the overall efficiency and stability of autonomous driving communication.

[0047] Furthermore, in the field of autonomous driving, in order to meet the needs of different driving scenarios, the same type of data often needs to be divided into different topics. For example, the obstacle avoidance function node usually only needs to subscribe to the point cloud data collected in driving scenarios with many obstacles (for example, urban roads, residential areas), but does not need to subscribe to the point cloud data collected in open park or plain driving scenarios, and the obstacle avoidance function node has very high requirements for the timeliness of data transmission; for example, the lane line automatic generation node usually only needs to subscribe to the point cloud data collected in the road driving scenario, but does not need to subscribe to the point cloud data collected in the non-road driving scenario. Based on this, in an embodiment of the present invention, the combination of "data type + topic" is bound to the data transmission channel one by one. Compared with only binding the "data type" to the data transmission channel (that is, using a single data transmission channel to transmit data of multiple topics under the same data type), this implementation scheme can effectively improve the efficiency and timeliness of data transmission, which is conducive to meeting the needs of richer autonomous driving scenarios and ensuring the safety of autonomous driving.

[0048] Reference Figure 2 , Figure 2FIG. 1 is a schematic diagram comparing the cross-machine transmission performed by the autonomous driving communication system of the embodiment of the present invention and the autonomous driving communication system of the prior art. Figure 2 The left side is a schematic diagram of cross-machine data transmission between a sending-end data publishing node and multiple receiving-end data subscription nodes of an autonomous driving communication system according to an embodiment of the present invention; Figure 2 On the right is a schematic diagram of cross-machine data transmission between a transmitting data publishing node and multiple receiving data subscription nodes in an autonomous driving communication system of the prior art.

[0049] Specifically, Figure 2 The gateway tool (awmgateway) on the left side at the data sending end is actually equivalent to Figure 1 The data cross-machine sending module 104 in the data receiving end is actually equivalent to the gateway tool (awmgateway) Figure 1 The data cross-machine sending module 201.

[0050] from Figure 2 It can be seen that in the prior art, for data on the same topic between the data sending end and the data receiving end, each two cross-machine nodes have their own data transmission channel, that is, multiple data transmission channels are used to repeatedly transmit data on the same topic, thereby causing the problem of repeated occupation of bandwidth resources; while in the embodiment of the present invention, for data on the same topic between the data sending end and the data receiving end, multi-node cross-machine transmission is achieved only through a single data transmission channel, which greatly saves bandwidth resources.

[0051] Reference Figure 3 , Figure 3 is a schematic diagram of the architecture of another data communication system for autonomous driving in an embodiment of the present invention. The another data communication system for autonomous driving may include Figure 1 The data sending end 10 and the data receiving end 20 shown in the figure, as well as each node and module, may further include a first shared memory 105 arranged at the data sending end 10 , and a second shared memory 203 arranged at the data receiving end 20 .

[0052] Furthermore, the sending-end data publishing node 101 is further used to write the data to be published into the first shared memory 105;

[0053] The sending-end data subscription node 103 is used to read the to-be-published data from the first shared memory when confirming that the first shared memory 105 has to-be-published data;

[0054] The data cross-machine sending module 104 is used to read the to-be-published data from the first shared memory 105 when confirming that the first shared memory 105 has to-be-published data, and then execute the steps of determining the data transmission channel for the to-be-published data and using the data transmission channel to transmit the to-be-published data.

[0055] In a specific implementation, the sending end data publishing node 101 may adopt a zero-copy transmission method to write the data to be published into the first shared memory 105; accordingly, the sending end data subscription node 103 may also adopt a zero-copy method to read the data to be published from the first shared memory.

[0056] In the conventional technology, independent storage areas are divided for the data publishing node 101 and the data subscription node 103, and the kernel buffer is used to realize data publishing and subscription between the two. For example, the data publishing node 101 writes the data to be published into the corresponding storage area 1, and the data successfully written into the storage area 1 is copied to the kernel buffer. Then the data in the kernel buffer is copied to the storage area 2 corresponding to the data subscription node 103, and finally the data subscription node 103 obtains the data to be published from the storage area 2. It can be seen that this solution needs to divide multiple storage areas and repeat the data copy operation multiple times, which has a large resource overhead.

[0057] In comparison, the embodiment of the present invention utilizes the first shared memory, and the sending end data publishing node 101, the sending end data subscription node 103, and the data cross-machine sending module 104 can share the first shared memory 105 to read and write data. In this way, the division of multiple storage areas and repeated data copy operations can be avoided, and the storage space occupation and computing resource consumption can be reduced.

[0058] Furthermore, the process to which the sending-end data publishing node 101 belongs and the process to which the data cross-machine sending module 104 belongs are independent of each other, wherein the sending-end data publishing node 101 uses its own process (for example, process 1) to execute the operation of writing the data to be published into the first shared memory 105, and the data cross-machine sending module 104 uses its own process (for example, process 2) to execute the operation of determining the target data type and target subject of the data to be published, and determining the data transmission channel corresponding to the target data type and target subject, and using the data transmission channel to transmit the data to be published.

[0059] In existing conventional autonomous driving communication systems (such as ROS2), a single thread (or process) is usually used to perform multiple operations such as local transmission and cross-machine transmission. Specifically, for the same data to be published, a single thread is used to execute (for example, sequentially) multiple operations such as transmitting the data to be published to other subscription nodes of the local machine and transmitting the data to be published across the machine to the subscription nodes of other hosts. This leads to mutual influence between local transmission and cross-machine transmission. For example, the efficiency and stability of local transmission may be affected by the network status of cross-machine transmission.

[0060] In comparison, in the embodiment of the present invention, the processes to which the sending-end data publishing node 101 and the data cross-machine sending module 104 belong are independent of each other, that is, local data transmission and cross-machine data transmission can be completed independently of each other, effectively solving the problem of mutual influence of transmission efficiency and stability caused by using a single thread or process to perform multiple operations such as local transmission and cross-machine transmission.

[0061] Furthermore, the data cross-machine receiving module 203 is also used to write the data to be published into the second shared memory 203; wherein each receiving-end data subscription node 202 associated with the sending-end data publishing node 101 reads the data to be published from the second shared memory 203 respectively.

[0062] Furthermore, the data sending end 10 may also include a first monitoring module for data to be published (not shown in the figure), which is used to monitor whether there is data to be published in the first shared memory 105; accordingly, the data receiving end may also include a second monitoring module for data to be published (not shown in the figure), which is used to monitor whether there is data to be published in the second shared memory 203 (that is, data to be read by each receiving end data subscription node 202).

[0063] Regarding the implementation principle and technical effect of the second shared memory 203, please refer to the above description about the first shared memory 105, which will not be repeated here.

[0064] Furthermore, the first shared memory 105 is divided into multiple first memory blocks, and the combination of data types and topics corresponds one-to-one to the first memory blocks; writing the data to be published into the first shared memory includes: determining the target data type and target topic of the data to be published; writing the data to be published into the first memory block corresponding to the target data type and target topic.

[0065] Furthermore, the second shared memory 203 is divided into multiple second memory blocks, and the combination of data types and topics corresponds one-to-one to the second memory blocks; writing the data to be published into the second shared memory 203 includes: determining the target data type and target topic of the data to be published; writing the data to be published into the second memory block corresponding to the target data type and target topic; wherein, each receiving-end data subscription node 202 associated with the sending-end data publishing node 101 reads the data to be published from the second memory block.

[0066] In an embodiment of the present invention, the first shared memory 105 and the second shared memory 203 are further divided into multiple memory blocks and bound one by one to the combination of "data type + subject". In this way, it is possible to effectively avoid writing data with the same "data type + subject" into different storage areas of the shared memory, further reducing the storage space occupancy.

[0067] Furthermore, the sending-end data publishing node 101 may also serialize the data to be published before writing the data to be published into the first memory block corresponding to the target data type and the target topic; correspondingly, each receiving-end data subscription node 202 associated with the sending-end data publishing node 101 may also deserialize the data to be published after reading the data to be published from the second memory block.

[0068] Furthermore, the data sending end 10 includes a plurality of sending end data subscription nodes 103, each sending end data subscription node 103 having its own associated data type and subject, and the plurality of sending end data subscription nodes 103 correspond one-to-one to a plurality of pre-created coroutines, wherein, when the coroutine is in a running state, the sending end data subscription node 103 corresponding to the coroutine obtains the to-be-published data having the associated data type and subject, and when the coroutine is in a suspended state, the sending end data subscription node 103 corresponding to the coroutine stops obtaining the to-be-published data; the coroutines corresponding to the respective sending end data subscription nodes 103 of the data sending end 10 are run in the order of the coroutines indicated by the wake-up queue; wherein, whenever the sending end data subscription node 103 corresponding to the currently running coroutine obtains the to-be-published data, the currently running coroutine is suspended, and then the next coroutine in the wake-up queue is run.

[0069] The next coroutine in the wake-up queue refers to a coroutine that is located after the currently running coroutine in the wake-up queue and is adjacent to the currently running coroutine.

[0070] Among them, running the next coroutine in the wake-up queue includes: saving the CPU register state of the currently running coroutine as a process; and loading the CPU register state of the next coroutine into the CPU register.

[0071] In a specific implementation, the wake-up queue can be determined in the following manner: whenever it is confirmed that there is new data to be published, the target data type and target topic of the data to be published are determined, and then all sending end data subscription nodes 103 associated with the target data type and target topic are determined, recorded as target subscription nodes; the suspended coroutines corresponding to each target subscription node are woken up, and each coroutine is placed in the wake-up queue in the order of being awakened, and the coroutines with an earlier awakening order are placed earlier in the wake-up queue.

[0072] Specifically, coroutine is a concept relative to thread and process. The running process of coroutine is more similar to subroutine. In other words, the running process of coroutine can be regarded as a function call without return value. A program can contain multiple coroutines, which can be compared to a process containing multiple threads. The main differences between coroutines, threads and processes in context switching (the so-called context can refer to all the state information required by the operating system to keep track of the process running, such as the current value of the register file and the content of the main memory, etc.) are as follows:

[0073] The context switch of a process involves the process from [user state] -> [kernel state] -> [user state]. The context contains a lot of data, such as process ID, state, priority, permissions, memory, stack, registers, program I / O state, etc.

[0074] The context switch of a thread involves the process from [user state] -> [kernel state] -> [user state]. Multiple threads are relatively independent and have their own contexts. The switch is controlled by the system. Although the data contained in the context is not as much as that in the process, the whole process is also very time-consuming. The specific data included includes: status, priority, registers, stack, etc.

[0075] Coroutines only need to switch contexts in [user mode]. In comparison, coroutines are relatively independent and have their own contexts. Their switching is controlled by themselves. Switching from the current coroutine to other coroutines is controlled by the current coroutine. In addition, less context information needs to be switched, usually including stack and register information. Therefore, the context switching efficiency of coroutines is much higher and the resource overhead is smaller.

[0076] The states of the coroutine usually include two types: suspended state and running state. The suspended state can also be called a paused state or a blocked state. When the coroutine is in the suspended state, the sender data subscription node corresponding to the suspended coroutine does not receive data. The running state can also be called an execution state. When the coroutine is in the running state, the sender data subscription node corresponding to the running coroutine receives data.

[0077] In the embodiment of the present invention, the coroutine switching method is adopted to move the scheduling from the kernel space to the user space. Only the state needs to be judged, and the switching cost is much lower than the cost of thread switching from user state to kernel state. Therefore, the efficiency of data transmission between nodes of the local machine can be effectively improved and the waste of resource overhead can be reduced.

[0078] Furthermore, in the prior art, the coroutine switching is often performed according to a preset priority order, and the sending-end data subscription node to which the next coroutine to be switched belongs may not have data to be received, which will lead to the invalid operation of the coroutine and waste of resource overhead. In the embodiment of the present invention, the suspended coroutine will only be awakened whenever it is confirmed that there is new data to be published (that is, data to be received), so the system resource consumption caused by the invalid operation of the coroutine can be reduced. Furthermore, since each coroutine is run in the order of coroutines indicated by the wake-up queue, and the order of coroutines indicated by the wake-up queue is the order in which each coroutine is awakened. Thereby, it can be ensured that the sending-end data subscription node corresponding to the coroutine that is awakened first can obtain the required data first, so that each sending-end data subscription node can obtain data efficiently, orderly and stably.

[0079] Furthermore, the data sending end 10 may also include a network stack (not shown); the use of the data transmission channel to transmit the data to be published includes: writing the data to be published into the network stack, and then reading the data to be published from the network stack and sending it to the data transmission channel.

[0080] Furthermore, the data sending end 10 may also include: a monitoring module (not shown in the figure), which is used to perform real-time monitoring of the data transmission parameters of the data transmission channel, and the data transmission parameters are selected from one or more of the following: data transmission frequency, data transmission delay, and data transmission flow; an alarm module (not shown in the figure), which is used to issue a corresponding alarm indication signal according to the monitoring results of the monitoring module.

[0081] Among them, when the monitored data transmission frequency is less than the preset frequency threshold and / or the data transmission flow is less than the preset flow threshold, the corresponding alarm indication signal is used to indicate that there is data packet loss in the data transmission channel; when the monitored data transmission delay is greater than the preset delay threshold, the corresponding alarm indication signal is used to indicate that the bandwidth of the data transmission channel exceeds the network card limitation or there is a network failure.

[0082] It should be noted that Figures 1 to 3 The functional modules and number of nodes shown are only non-limiting examples and do not constitute a limitation on the number of functional modules and nodes of the autonomous driving communication system in actual application scenarios. That is, in actual applications, the autonomous driving communication system may include other appropriate functional modules and other appropriate numbers of nodes.

[0083] It should be understood that the term "and / or" in this article is only a description of the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article indicates that the associated objects before and after are in an "or" relationship.

[0084] The "plurality" appearing in the embodiments of the present application refers to two or more.

[0085] The first, second, etc. descriptions appearing in the embodiments of the present application are only used for illustration and distinction of the description objects. There is no order, nor do they indicate any special limitation on the number of devices in the embodiments of the present application, and cannot constitute any limitation on the embodiments of the present application.

[0086] It should be pointed out that the serial numbers of the steps in this embodiment do not limit the execution order of the steps.

[0087] Although the present invention is disclosed as above, the present invention is not limited thereto. Any person skilled in the art can make various changes and modifications without departing from the spirit and scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the scope defined by the claims.

Claims

1. A data communication system for autonomous driving, It is characterized in that include: A data sending end, the data sending end comprising: The data publishing node at the sending end is used to publish the data to be published; The data subscription node at the sending end is used to obtain the data to be published when confirming that there is data to be published; The data cross-machine sending module is used to determine the target data type and target subject of the data to be published when confirming that there is data to be published, and determine the data transmission channel corresponding to the target data type and target subject, and use the data transmission channel to transmit the data to be published, wherein the combination of data type and subject has a one-to-one correspondence with the data transmission channel; A data receiving end, the data receiving end comprising: A data cross-machine receiving module, used to receive the data to be published from the data transmission channel corresponding to the target data type and the target topic; A plurality of receiving-end data subscription nodes, used for obtaining the data to be published from the data cross-machine receiving module; The sending-end data publishing node and the plurality of receiving-end data subscription nodes are associated through the target data type and the target topic.

2. The data communication system for autonomous driving according to claim 1, It is characterized in that The data sending end also includes a first shared memory; The sending-end data publishing node is further used to write the data to be published into the first shared memory; The sending-end data subscription node is configured to read the to-be-published data from the first shared memory when confirming that the first shared memory has to-be-published data; The data cross-machine sending module is used to read the to-be-published data from the first shared memory when confirming that the first shared memory has to-be-published data, and then execute the steps of determining a data transmission channel for the to-be-published data and using the data transmission channel to transmit the to-be-published data.

3. The data communication system for autonomous driving according to claim 2, It is characterized in that The first shared memory is divided into a plurality of first memory blocks, and the combination of data types and topics corresponds one to one with the first memory blocks; Writing the data to be published into the first shared memory includes: Determine the target data type and target subject of the data to be published; The data to be published is written into a first memory block corresponding to the target data type and the target topic.

4. The data communication system for autonomous driving according to claim 1, It is characterized in that The data receiving end also includes: a second shared memory; The data cross-machine receiving module is also used to write the to-be-published data into the second shared memory; Wherein, each receiving-end data subscription node associated with the sending-end data publishing node reads the to-be-published data from the second shared memory respectively.

5. The data communication system for autonomous driving according to claim 4, It is characterized in that The second shared memory is divided into a plurality of second memory blocks, and the combination of data types and topics corresponds one to one with the second memory blocks; Writing the to-be-published data into the second shared memory comprises: Determine the target data type and target subject of the data to be published; The data to be published is written into a second memory block corresponding to the target data type and the target topic; wherein each receiving-end data subscription node associated with the sending-end data publishing node reads the data to be published from the second memory block.

6. The data communication system for autonomous driving according to claim 1, It is characterized in that The data sending end includes a plurality of sending end data subscription nodes, each sending end data subscription node has its own associated data type and subject, and the plurality of sending end data subscription nodes correspond one-to-one to the plurality of pre-created coroutines, wherein when the coroutine is in a running state, the sending end data subscription node corresponding to the coroutine obtains the to-be-published data with the associated data type and subject, and when the coroutine is in a suspended state, the sending end data subscription node corresponding to the coroutine stops obtaining the to-be-published data; The coroutines corresponding to the data subscription nodes of the data sending end are run in the order of the coroutines indicated by the wake-up queue; Wherein, whenever the sending-end data subscription node corresponding to the currently running coroutine completes acquiring the data to be published, the currently running coroutine is suspended, and then the next coroutine in the wake-up queue is run.

7. The data communication system for autonomous driving according to claim 6, It is characterized in that The wake-up queue is determined in the following manner: Whenever it is confirmed that there is new data to be published, the target data type and target subject of the data to be published are determined, and then all the sending-end data subscription nodes associated with the target data type and target subject are determined and recorded as target subscription nodes; The suspended coroutines corresponding to each target subscription node are awakened, and each coroutine is placed in the awakening queue in the order of being awakened, and the coroutine with the earlier awakening order is placed at the front of the awakening queue.

8. The data communication system for autonomous driving according to claim 6, It is characterized in that Running the next coroutine in the wakeup queue includes: Save the CPU register state of the currently running coroutine as a process; The CPU register state of the next coroutine is loaded into the CPU register.

9. The data communication system for autonomous driving according to claim 1, It is characterized in that The data sending end also includes a network stack; The adopting the data transmission channel to transmit the data to be published comprises: The data to be published is written into the network stack, and then the data to be published is read from the network stack and sent to the data transmission channel.

10. The data communication system for autonomous driving according to claim 1, It is characterized in that The data transmitting end also includes: A monitoring module, used for real-time monitoring of data transmission parameters of the data transmission channel, wherein the data transmission parameters are selected from one or more of the following: data transmission frequency, data transmission delay, and data transmission flow; An alarm module is used to issue a corresponding alarm indication signal according to the monitoring result of the monitoring module; Wherein, when the monitored data transmission frequency is less than a preset frequency threshold and / or the data transmission flow is less than a preset flow threshold, a corresponding alarm indication signal is used to indicate that data packet loss exists in the data transmission channel; When the monitored data transmission delay is greater than a preset delay threshold, a corresponding alarm indication signal is used to indicate that the bandwidth of the data transmission channel exceeds the network card limit or there is a network failure.