Radar real-time stream data transmission method, device and computer storage medium

By introducing a gateway device as an intermediate layer in the Kubernetes cluster and using UDP and TCP protocols to process radar data, the communication problem of the master device under dynamic port allocation is solved, and stable and efficient transmission of radar data is achieved.

CN120301870BActive Publication Date: 2025-12-09GUANGXI TIEXIANG TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510464142.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-04-14
Publication Date
2025-12-09
Estimated Expiration
2045-04-14

AI Technical Summary

Technical Problem

In a Kubernetes cluster, the master device is unable to establish a stable communication connection with multiple radar devices due to dynamic port allocation and port resource limitations, resulting in unstable and inefficient radar data transmission.

Method used

A gateway device is introduced as an intermediate layer to communicate with the radar device via the UDP protocol. Point cloud data and IMU data are encapsulated into independent data packets and written into a memory queue. The TCP protocol is used to communicate with the master device to achieve orderly transmission and buffering of data packets, bypassing the dynamic port allocation mechanism of the K8S cluster.

Benefits of technology

It improves the transmission efficiency and stability of real-time radar streaming data, reduces the port resource pressure on the main device, ensures the integrity and order of data packets, and solves the problems of port conflicts and resource exhaustion.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120301870B_ABST
    Figure CN120301870B_ABST
Patent Text Reader

Abstract

The application discloses a radar real-time stream data transmission method and device and a computer storage medium, relates to the technical field of data transmission, and comprises the following steps: acquiring point cloud data and IMU data sent by a radar device, and encapsulating the point cloud data and the IMU data into independent data packets respectively; sequentially writing the data packets into the tail of a memory queue according to a preset order; in response to a data request initiated by a host device, taking out a preset number of data packets from the head of the memory queue, and sending the taken-out data packets to the host device in the form of a data stream. By introducing a gateway device as an intermediate layer, the gateway device receives a connection request of a fixed port, and the host device actively connects the gateway device, thereby bypassing the limitation of a K8S cluster dynamic port allocation mechanism. Meanwhile, the data packets are buffered by using the memory queue, direct interaction between the host device and the radar device is reduced, the port resource pressure of the host device is reduced, and the transmission efficiency of the radar real-time stream data is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of data transmission, in particular to a radar real-time stream data transmission method, device and computer storage medium. BACKGROUND

[0002] At present, radar equipment is usually used for long-distance obstacle measurement. The radar equipment usually sends device information in the form of UDP (User Datagram Protocol) broadcast, and the master device obtains the radar equipment information by monitoring a specified port and establishes a handshake connection with the radar equipment. After the handshake is successful, the radar equipment sends point cloud data and IMU (Inertial Measurement Unit) data to the master device through the UDP protocol. However, when the master device is deployed in a Kubernetes (K8S) cluster, since the K8S network service plug-in usually adopts a dynamic port allocation mechanism, the master device cannot bind a fixed port in advance when running in the cluster, nor can it real-time perceive the port information allocated to itself. At the same time, as the number of radar devices increases, the master device needs to allocate an independent receiving port for each radar device, and the port resources of the K8S cluster are limited, which can easily cause port conflicts or resource exhaustion, thereby causing the master device to fail to establish a stable communication connection with the radar device. SUMMARY

[0003] The main purpose of the present application is to provide a radar real-time stream data transmission method, device and computer storage medium, which aims to solve the technical problem that the master device cannot establish a stable communication connection with multiple radar devices due to dynamic port allocation and port resource limitation in the Kubernetes cluster.

[0004] To achieve the above purpose, the radar real-time stream data transmission method provided by the embodiments of the present application is applied to a gateway device, one side of the gateway device is in communication connection with a radar device, and the other side is in communication connection with a master device, and the radar real-time stream data transmission method comprises the following steps.

[0005] Obtaining point cloud data and IMU data sent by the radar device, and encapsulating the point cloud data and the IMU data into independent data packets respectively;

[0006] Writing the data packets into the tail of a memory queue in a preset order;

[0007] In response to a data request initiated by the master device, taking out a preset number of data packets from the head of the memory queue, and sending the taken out data packets to the master device in the form of a data stream.

[0008] In an embodiment, before the step of obtaining the point cloud data and the IMU data sent by the radar device and encapsulating the point cloud data and the IMU data into independent data packets, the method further comprises:

[0009] receiving device information sent by the radar device through UDP broadcast;

[0010] establishing a radar device registry according to the device information, the radar device registry being used to store and map the identification, IP address and port number of the radar device;

[0011] generating a connection request message according to the IP address and port number of the radar device in the radar device registry;

[0012] sending the connection request message to the radar device to establish a communication connection with the radar device.

[0013] In an embodiment, the step of obtaining the point cloud data and the IMU data sent by the radar device and encapsulating the point cloud data and the IMU data into independent data packets comprises:

[0014] initializing memory space and constructing a memory management table based on a pre-allocated memory pool, the memory management table being used to record the start address, size and usage state of each memory space;

[0015] after encapsulating the point cloud data and the IMU data into data packets, searching for unused memory space from the memory management table and allocating the unused memory space to the data packets, while locking the allocated memory space.

[0016] In an embodiment, the step of sequentially writing the data packets to the tail of the memory queue according to a preset order comprises:

[0017] creating a linked list node for each data packet;

[0018] connecting the linked list nodes corresponding to the data packets in sequence according to the receiving order of the data packets to obtain a data packet linked list;

[0019] sequentially writing the data packets to the tail of the memory queue based on the order of the linked list nodes of the data packet linked list.

[0020] In an embodiment, the step of sequentially writing the data packets to the tail of the memory queue based on the order of the linked list nodes of the data packet linked list comprises:

[0021] writing the data packet corresponding to the first linked list node in the data packet linked list to the tail of the memory queue;

[0022] According to the order of the chain table nodes of the data packet chain table, a pointer is automatically positioned to a next chain table node, and a data packet corresponding to the next chain table node is written into a tail of the memory queue.

[0023] In an embodiment, the step of writing the data packet corresponding to the first chain table node in the data packet chain table into the tail of the memory queue comprises:

[0024] When the data packet is written into the tail of the memory queue, a mutual exclusion lock is used to lock the data packet being written;

[0025] When the data packet being written is written into the memory queue, the mutual exclusion lock is released, and the next data packet to be written is locked.

[0026] In an embodiment, before the step of sequentially writing the data packets into the tail of the memory queue according to the preset order, the method further comprises:

[0027] If the memory queue has reached a preset maximum number of nodes, the data packets in the memory queue are sequentially moved one position forward, covering the original data packet corresponding to the head of the memory queue, to vacate the tail position of the memory queue;

[0028] The tail pointer of the memory queue is updated so that the tail pointer points to the vacated tail position;

[0029] The new data packet is written into the tail position of the memory queue.

[0030] In an embodiment, before the step of taking out a preset number of data packets from the head of the memory queue in response to a data request initiated by a host device, and sending the taken out data packets to the host device in the form of a data stream, the method further comprises:

[0031] A connection request initiated by the host device is received, and a TCP connection is established with the host device;

[0032] After the TCP connection is established, a data storage state of the memory queue is detected, the data storage state including a number of data packets and a storage rate of the memory queue;

[0033] Based on the data storage state of the memory queue, data transmission parameters between the gateway device and the host device are adjusted;

[0034] If the number of data packets is lower than a preset number threshold, the data packet size is reduced and / or the transmission rate is reduced, and / or the number of times of timeout retransmission is increased; or

[0035] If the storage rate exceeds a preset rate threshold, increase the data packet size and / or increase the transmission rate, and / or reduce the number of timeout retransmissions.

[0036] The embodiment of the present application also provides a radar real-time stream data transmission device, which comprises a memory, a processor and a computer program stored in the memory and executable on the processor, and the computer program is configured to implement the steps of the radar real-time stream data transmission method.

[0037] The embodiment of the present application also provides a computer storage medium, which is a computer readable storage medium, and a computer program is stored on the computer storage medium, and the computer program is executed by a processor to implement the steps of the radar real-time stream data transmission method.

[0038] The embodiment of the present application discloses a radar real-time stream data transmission method, which comprises the following steps: acquiring point cloud data and IMU data sent by a radar device, and encapsulating the point cloud data and the IMU data into independent data packets respectively; writing the data packets into the tail of a memory queue in a preset order; in response to a data request initiated by a host device, taking out a preset number of the data packets from the head of the memory queue, and sending the taken-out data packets to the host device in the form of a data stream. The application introduces a gateway device as an intermediate layer, the gateway device receives a connection request of a fixed port as a server, and the host device actively connects the fixed port of the gateway device as a client, so that the limitation of the K8S cluster dynamic port allocation mechanism is bypassed. At the same time, the data packets are buffered by the memory queue, the direct interaction between the host device and the radar device is reduced, the port resource pressure of the host device is reduced, and the transmission efficiency of the radar real-time stream data is significantly improved. BRIEF DESCRIPTION OF DRAWINGS

[0039] Figure 1 A flowchart of a radar real-time stream data transmission method according to a first embodiment of the embodiment of the present application is shown in the figure;

[0040] Figure 2 A brief flowchart of a radar real-time stream data transmission method according to a first embodiment of the embodiment of the present application is shown in the figure;

[0041] Figure 3 A flowchart of a radar real-time stream data transmission method according to a second embodiment of the embodiment of the present application is shown in the figure;

[0042] Figure 4 A flowchart of a radar real-time stream data transmission method according to a third embodiment of the embodiment of the present application is shown in the figure;

[0043] Figure 5A flowchart of a fourth embodiment of a radar real-time stream data transmission method related to the embodiment scheme of the present application is shown in the figure;

[0044] Figure 6 A structural diagram of a radar real-time stream data transmission device related to the embodiment scheme of the present application is shown in the figure.

[0045] The object implementation, functional features and advantages of the present application will be further described with reference to the embodiments and the accompanying drawings. DETAILED DESCRIPTION

[0046] It should be understood that the specific embodiments described herein are merely intended to explain the present application and not to limit the present application.

[0047] Currently, radar devices are often used for long-distance obstacle measurement. The radar device usually sends device information in the form of UDP (User Datagram Protocol) broadcast, and the master device obtains radar device information by monitoring a specified port and establishes a handshake connection with the radar device. After the handshake is successful, the radar device sends point cloud data and IMU (Inertial Measurement Unit) data to the master device through the UDP protocol. However, when the master device is deployed in a Kubernetes (K8S) cluster, since the K8S network service plug-in usually adopts a dynamic port allocation mechanism, the master device cannot bind a fixed port in advance when running in the cluster, nor can it real-time perceive the port information allocated to itself. At the same time, as the number of radar devices increases, the master device needs to allocate an independent receiving port for each radar device, and the port resources of the K8S cluster are limited, which can easily cause port conflicts or resource exhaustion, thereby leading to the inability to establish a stable communication connection with the radar device.

[0048] In order to solve the above-mentioned defects existing in the related art, the present application embodiment proposes a radar real-time stream data transmission method, which obtains point cloud data and IMU data sent by a radar device, and encapsulates the point cloud data and the IMU data into independent data packets respectively; writes the data packets into the tail of a memory queue in a predetermined order; in response to a data request initiated by a master device, takes out a predetermined number of data packets from the head of the memory queue, and sends the taken out data packets to the master device in the form of a data stream. The present application introduces a gateway device as an intermediate layer, the gateway device receives the connection request of a fixed port as a server, and the master device actively connects the fixed port of the gateway device as a client, thereby bypassing the limitation of the dynamic port allocation mechanism of the K8S cluster. At the same time, the data packets are buffered by the memory queue, which reduces the direct interaction between the master device and the radar device, reduces the port resource pressure of the master device, and significantly improves the transmission efficiency of the radar real-time stream data.

[0049] It should be noted that the execution subject of the embodiment can be a computing service device with data processing, network communication and program running functions, such as a gateway device, an embedded system, etc., or a radar real-time stream data transmission device capable of realizing the above functions. The gateway device is taken as an example to describe the embodiment and the following embodiments.

[0050] In the traditional radar and master device communication mode, the radar device directly communicates with the master device through the UDP protocol. The radar device sends its device information through UDP broadcast, and the master device monitors a specified port to obtain the device information of the radar device. After obtaining the device information, the master device sends handshake information to the radar device by acquiring the IP address and port number of the radar device in the device information. The handshake information contains the port of the master device for receiving data. After the radar device and the master device successfully handshake, the radar device sends point cloud data and IMU data to the specified data port through the UDP mode. In this architecture, the radar device acts as a UDP client and actively sends radar data to the master device, while the master device acts as a UDP server and is responsible for receiving the radar data sent by the radar device. Since the UDP protocol cannot guarantee reliable data transmission, data packet loss or out-of-order may occur during data transmission, affecting the accuracy of the data.

[0051] In this communication mode, the master device needs to inform the radar device of the port number for receiving data in advance, so that the radar device can correctly send radar data to the specified port of the master device. However, in the case of changes in the network environment, such as changes in the port number of the master device, the master device may not be able to update the port number in time, and the radar device cannot automatically perceive these changes, resulting in failure of radar data transmission. Taking the deployment of the master device in a Kubernetes (K8S) cluster as an example, since the K8S network service plug-in usually adopts a dynamic port allocation mechanism, the master device cannot bind a fixed port in advance when running in the cluster, nor can it perceive the port information allocated to itself in real time. The radar device needs to know the port information of the master device to send radar data.

[0052] In the K8S environment, the port of the master device may change with the restart or scheduling of the service. At the same time, as the number of radar devices increases, the master device needs to allocate independent receiving ports for each radar device. However, the port resources of the K8S cluster are limited, which may easily cause port conflicts or resource exhaustion, resulting in the radar device being unable to establish stable communication connection with the master device.

[0053] In addition, the master device usually adopts a question-and-answer mode when communicating with the radar device, that is, the master device needs to wait for the response of the radar device after sending a command to ensure correct data transmission. Although this synchronous communication method is simple, it reduces the overall efficiency of data transmission, especially in the case of high concurrency or unstable network, the communication delay will increase significantly.

[0054] To solve the above problems, the embodiment introduces a gateway device as an intermediate layer between the radar device and the master device. The radar device still communicates with the gateway through the UDP protocol, while the gateway communicates with the master device through the TCP protocol. Specifically, the radar device sends the generated point cloud data and IMU data to the gateway through the UDP protocol, and the gateway device receives the point cloud data and IMU data, encapsulates them into independent data packets respectively, and writes the data packets into the memory queue in a preset order for caching through the linked list method. The memory queue adopts a first-in first-out (FIFO) data structure to ensure the order of the data packets. When the master device initiates a data request to the gateway device through the TCP protocol, the gateway device takes a preset number of data packets from the head of the memory queue and sends them to the master device in the form of a data stream.

[0055] In the above manner, the gateway device, as a fixed communication node, directly establishes a UDP connection with the radar device. The port of the gateway device is statically configured, and the master device actively connects to the fixed port of the gateway device through the TCP protocol, without the need to sense the change of its own port, thereby bypassing the limitation of the K8S dynamic port allocation mechanism and avoiding the problem that the master device cannot bind to a fixed port in the K8S cluster due to dynamic port allocation.

[0056] Meanwhile, the gateway device, as a server, uniformly receives the data of the radar device, and the master device, as a client, communicates with the gateway device, reducing the direct interaction between the master device and the radar device, and the master device no longer needs to allocate an independent receiving port for each radar device, thereby reducing the port resource pressure of the master device. In addition, the reliable connection feature of the TCP protocol solves the problem of unreliable data transmission of the UDP protocol. At the same time, the FIFO mechanism of the memory queue ensures the orderliness and integrity of the radar data, avoids data transmission failure caused by changes in the network environment, and significantly improves the transmission efficiency of the radar real-time stream data.

[0057] Based on this, the radar real-time stream data transmission method of the first embodiment of the application is applied to a gateway device, wherein one side of the gateway device is in communication connection with a radar device, and the other side is in communication connection with a master device, please refer to Figure 1 The method comprises steps S10-S30:

[0058] Step S10: Obtain the point cloud data and IMU data sent by the radar device, and encapsulate the point cloud data and the IMU data into independent data packets respectively.

[0059] When the radar device measures a long-distance obstacle, it generates multiple radar data, including point cloud data and IMU (Inertial Measurement Unit) data, etc. The point cloud data is a set of three-dimensional coordinate points generated after the radar detects an object, which is used to construct a three-dimensional model of the detected object. The IMU data is the motion state of the radar device detected by the inertial measurement unit, such as acceleration, angular velocity, etc.

[0060] In this embodiment, the gateway device monitors the UDP (User Datagram Protocol) port in real time, receives the point cloud data and IMU data transmitted by the radar device through UDP, and then parses the received point cloud data and IMU data, adds header information including timestamp, data type identifier, data length, and check code, etc., and encapsulates the point cloud data and IMU data into data packets respectively. The timestamp is used to record the generation time of the data; the data type identifier is used to distinguish the point cloud data and the IMU data, so that the host device can process the data according to the data type; the data length indicates the size of the data packet, and the check code is used to verify the integrity of the data, such as CRC check code. Through these header information, the host device can correctly identify and process the received data packet, ensure the integrity and order of the data, and improve the reliability and parsing efficiency of the radar data transmission.

[0061] When encapsulating the point cloud data and the IMU data into independent data packets, a specific data format can be used to ensure the integrity and parsability of the data. For example, a custom binary protocol or serialization format (such as Protobuf, JSON or MessagePack) can be used to encapsulate the point cloud data and the IMU data.

[0062] If the data volume of the point cloud data or the IMU data is large, the point cloud data or the IMU data can also be fragmented and encapsulated into multiple data packets. Each data packet contains part of the data, and the serial number and total number of fragments are identified in the data header. After receiving the data packet transmitted by the gateway device, the host device can reassemble the radar data according to the fragment serial number.

[0063] In an optional embodiment, steps S10 can include steps S101-S103 before it:

[0064] Step S101: Receive the device information broadcasted by the radar device through UDP.

[0065] In this embodiment, the radar device sends its device information to devices in the network through UDP broadcast when starting, and the device information includes the identifier, IP address, port number and other configuration parameters of the radar device. The gateway device captures the broadcast information by monitoring the specified UDP port, thereby obtaining the device information of the radar device.

[0066] Step S102: According to the device information, a radar device registry is established, which is used to map and store the identifier, IP address and port number of the radar device.

[0067] The radar device registry is a database or memory structure for storing and managing radar device information, which maps and stores the identifier, IP address and port number of the radar device. In this way, the gateway device can maintain all connected radar devices and assign an identifier to each radar device, facilitating the gateway device to quickly find and manage radar devices.

[0068] It should be noted that the radar device registry can be generated by device discovery protocol, configuration file or administrator manual configuration, and stored in the gateway device. Specifically, the gateway device can automatically capture the identifier, IP address and port number of the radar device by monitoring the UDP broadcast information sent by the radar device, dynamically generate the radar device registry; it can also load a preset configuration file to obtain radar device information and generate a registry; in addition, it can manually register radar device information through the management interface of the gateway device and update it to the radar device registry.

[0069] Step S103: According to the IP address and port number of the radar device in the radar device registry, a connection request message is generated.

[0070] Based on the radar device IP address and port number stored in the radar device registry, the gateway device generates a connection request message containing its own IP address, port number and handshake information. The connection request message not only identifies the identity of the gateway device, but also contains handshake information such as keys or tokens to verify the legality of communication, thereby ensuring the security and reliability of communication. In this way, the gateway device can actively initiate a connection request to the radar device.

[0071] It should be noted that the keys or tokens in the handshake information can be generated by a key management system and distributed to the gateway device and the radar device.

[0072] Step S104: Send the connection request message to the radar device to establish a communication connection with the radar device.

[0073] The gateway device sends the generated connection request message to the radar device through the UDP protocol. After receiving the connection request message, the radar device verifies the handshake information and returns confirmation information containing device state information and a session identifier. After receiving the confirmation information, the gateway device establishes a communication connection with the radar device.

[0074] Step S20: The data packets are sequentially written into the tail of the memory queue according to the preset order.

[0075] It should be noted that the preset order can be the receiving order when the gateway device receives radar data, that is, the corresponding data packets are sequentially written into the tail of the memory queue according to the network interface capture time of the gateway device; or the preset order can be the sending order when the radar device sends radar data, that is, the corresponding data packets are sequentially written into the tail of the memory queue according to the sending timestamp attached in the radar data; or the preset order can be the encapsulation order when the gateway device encapsulates data packets, that is, the corresponding data packets are sequentially written into the tail of the memory queue according to the order in which the encapsulation operation is completed.

[0076] In this embodiment, the memory queue can be implemented by using a linked list structure, which means that each data packet is connected by a pointer between linked list nodes. When a new data packet arrives at the gateway device, the data packet can be quickly added to the tail of the linked list to complete the insertion operation of the data packet.

[0077] In addition, the memory queue can also be implemented by using a ring buffer. The ring buffer is implemented by using a fixed-size array, and the last element of the array is connected back to the first element to form a ring structure. In the ring buffer, two index pointers, namely a read pointer and a write pointer, are set. When writing a data packet, the write pointer moves in the array according to the order, stores the data packet in the corresponding position, and updates the write pointer. When the write pointer reaches the end of the array, it automatically wraps back to the beginning of the array.

[0078] When writing a data packet, the gateway device assigns a sequence number to each data packet. The sequence number can be in the form of an incremental integer, and the sequence number is automatically incremented by 1 each time a data packet is written into the memory queue.

[0079] Before receiving the data packet, the memory queue is pre-set with a capacity limit. When the memory queue reaches the maximum capacity, the gateway device can process the newly arrived data packet according to a strategy, such as discarding the oldest data packet or pausing writing. In the strategy of discarding the oldest data packet, for the linked list structure, the head node can be directly removed; for the ring buffer, the read pointer can be moved forward by one position to overwrite the original data. If the pause writing strategy is adopted, a flag bit or a condition variable can be set, and when the queue is full, the writing thread enters a waiting state until the memory queue has free space and is awakened to continue writing.

[0080] Step S30: In response to the data request initiated by the host device, a preset number of data packets are taken out from the head of the memory queue, and the taken-out data packets are sent to the host device in the form of a data stream.

[0081] In this embodiment, the gateway device and the host device establish a communication connection through the TCP protocol. The gateway device serves as an intermediate layer, responsible for receiving data sent by the radar device and storing it in the memory queue. When the host device acts as a client and initiates a data request to the gateway device, the gateway device acts as a server and takes out a preset number of data packets from the head of the memory queue and sends them to the host device in the form of a data stream.

[0082] When taking out data packets from the memory queue, the gateway device can dynamically adjust the number of data packets sent according to the request of the host device. The host device can request a specific number of data packets according to its processing capacity or network conditions, and the gateway device takes out the corresponding number of data packets from the head of the memory queue and sends them to the host device in the form of a data stream. In order to efficiently take out data packets from the memory queue, the gateway device can set a counter variable, which increments by one each time a data packet is successfully taken out, until it reaches a preset number, ensuring the ordered reading and efficient transmission of data packets.

[0083] In an optional implementation, the gateway device can compress and encrypt data packets to improve the efficiency and security of data transmission. Compression can reduce the size of data packets, reduce the bandwidth occupation of network transmission, and improve transmission efficiency; encryption can ensure the security of data and prevent data from being stolen or tampered with during transmission. In addition, the gateway device can also set priorities for different types of radar data. For example, IMU data is usually more real-time than point cloud data, so a higher priority can be set for IMU data to ensure that IMU data is processed first during transmission.

[0084] In another optional implementation, steps S30 can also include steps S301-S303 before it:

[0085] Step S301: Receive the connection request initiated by the host device and establish a TCP connection with the host device.

[0086] TCP connection is a connection-oriented communication method that establishes a connection through a three-way handshake process to ensure that both parties can reliably transmit data. When establishing a TCP connection, the gateway device exchanges necessary connection parameters such as window size, maximum packet segment length, etc. with the host device to ensure the efficiency and reliability of subsequent data transmission. Through the TCP connection, the gateway device can establish a stable communication link with the host device to ensure that data packets can be transmitted to the host device in order and completeness.

[0087] Step S302: After establishing the TCP connection, detecting a data storage state of the memory queue, the data storage state including a data packet quantity and a storage rate of the memory queue.

[0088] The data packet quantity refers to an amount of data to be transmitted in the memory queue, and the storage rate reflects a rate at which the radar device transmits data to the gateway device, i.e., a quantity of data packets received by the gateway device per unit time.

[0089] Step S303: Based on the data storage state of the memory queue, adjusting a data transmission parameter between the gateway device and the host device.

[0090] After step S303, if the data packet quantity is lower than a preset quantity threshold, reducing a data packet size and / or reducing a transmission rate and / or increasing a timeout retransmission quantity; or, if the storage rate exceeds a preset rate threshold, increasing the data packet size and / or increasing the transmission rate and / or reducing the timeout retransmission quantity.

[0091] In this embodiment, the gateway device dynamically adjusts the data transmission parameter according to the data storage state of the memory queue, so as to optimize the transmission efficiency of the radar data.

[0092] If the data packet quantity is lower than the preset quantity threshold, the data packet size is reduced and / or the transmission rate is reduced and / or the timeout retransmission quantity is increased. Specifically, reducing the data packet size means that a large data packet is split into multiple small data packets to reduce the amount of data transmitted at a time, so as to adapt to a situation that the network bandwidth is low or the host device has weak processing capability; reducing the transmission rate means that the data transmission rate is reduced to avoid network congestion and data loss, and to ensure the stability of data transmission; and increasing the timeout retransmission quantity means that the upper limit of the retransmission quantity is increased to ensure that the data can be successfully transmitted in the case of unstable network.

[0093] If the storage rate exceeds the preset rate threshold, the data packet size is increased and / or the transmission rate is increased and / or the timeout retransmission quantity is reduced. Increasing the data packet size means that multiple small data packets are combined into a large data packet to reduce the transmission times and improve the transmission efficiency; increasing the transmission rate means that the data transmission rate is increased to fully utilize the network bandwidth and meet the data transmission demand in a high-load scenario; and reducing the timeout retransmission quantity means that the upper limit of the retransmission quantity is reduced to reduce redundant data transmission and improve the transmission efficiency.

[0094] It should be noted that the data packet size can be optimized according to the network condition and the processing capability of the host device. For example, when the network bandwidth is sufficient and the host device has strong processing capability, the data packet size can be increased to improve the transmission efficiency; and when the network bandwidth is limited or the host device has weak processing capability, the data packet size can be reduced to reduce the transmission delay.

[0095] In an optional embodiment, the transmission rate is adjusted by a sliding window mechanism, the size of the sending window is controlled to avoid network congestion and data loss. The size of the sliding window is determined by the minimum value of the receiving window and the congestion window, wherein the size of the receiving window is determined by the buffer capacity of the master device, and the size of the congestion window is adjusted according to the degree of network congestion.

[0096] In addition, the number of retransmission times is used to ensure the reliable transmission of data packets. When a data packet fails to be confirmed within a predetermined time, the gateway device can resend the data packet until the maximum number of retransmissions is reached or the transmission is successful.

[0097] It can be understood that, in order to ensure the real-time of radar data transmission, the gateway device can reduce the maximum number of retransmissions in some scenarios to avoid affecting the real-time of subsequent data due to retransmission delay.

[0098] In this embodiment, the gateway device serves as an intermediate layer and communicates with the radar device through a fixed port configuration. The radar device only needs to send radar data to the fixed port of the gateway device, and does not need to be aware of the specific network configuration of the master device. At the same time, the master device actively connects to the fixed port of the gateway device through the TCP protocol, and no longer needs to be aware of the change of its own port, thereby bypassing the limitation of the K8S cluster dynamic port allocation mechanism. In addition, the gateway device uniformly receives the radar data sent by the radar device, reducing the direct interaction between the master device and the radar device and reducing the port resource pressure of the master device. Through the above-mentioned manner, the embodiment effectively solves the problem that the master device cannot establish stable communication connection with multiple radar devices due to dynamic port allocation and port resource limitation in the K8S cluster, and improves the stability and efficiency of radar data transmission.

[0099] For the purpose of facilitating understanding of the implementation process of the radar real-time stream data transmission method in the embodiment, an exemplary implementation process of the radar real-time stream data transmission method is provided as follows. Figure 2 , Figure 2 A schematic diagram of a brief process of a radar real-time stream data transmission method is provided, specifically:

[0100] In this embodiment, a gateway device is introduced as an intermediate layer. The radar device serves as a UDP client and sends radar data to the gateway device through the UDP protocol. The master device serves as a TCP client and receives radar data from the gateway device through the TCP protocol. The gateway device serves as both a UDP server and a TCP server, receiving radar data from the radar device and establishing a TCP connection with the master device. After receiving the radar data sent by the radar device, the gateway device encapsulates the radar data into independent data packets and writes them into a memory queue. The master device, as a TCP client, initiates a data request to the gateway device through the TCP protocol, and the gateway device takes the data packets from the memory queue and sends them to the master device in the form of a data stream.

[0101] The embodiment introduces a gateway device as an intermediate layer to effectively solve the problem that the master device cannot bind a fixed port in the K8S cluster due to dynamic port allocation, while reducing the direct interaction between the master device and the radar device and reducing the port resource pressure of the master device. In addition, by combining UDP transmission and TCP transmission, the embodiment ensures the real-time data transmission while improving the stability and reliability of data transmission, significantly improving the transmission efficiency of radar real-time stream data.

[0102] Please refer to Figure 3 The radar real-time stream data transmission method of the second embodiment of the application includes steps S110-S120.

[0103] Step S110: Based on the pre-allocated memory pool, initialize the memory space and build a memory management table, which is used to record the starting address, size and usage state of each memory space.

[0104] The pre-allocated memory pool refers to a continuous memory area that is pre-divided as a data storage resource pool before the gateway device runs. The size of the pre-allocated memory pool can avoid frequent memory dynamic allocation and release operations, reduce memory fragmentation, and improve memory usage efficiency. When initializing the memory space, the memory pool is divided into multiple fixed or variable size memory spaces according to the estimated size and number of data packets.

[0105] Further, in order to effectively track the state of these memory spaces, a memory management table can be built. The memory management table can be implemented using a data structure such as a hash table, where each table entry records the starting address of each memory space, i.e. the first address of the memory space in the memory pool, for locating the memory space; the memory size indicates the amount of data that the memory space can accommodate; the usage state indicates whether the memory space has been occupied, for example, using a Boolean value to represent, "true" represents used, "false" represents unused.

[0106] Step S120: After encapsulating the point cloud data and the IMU data into data packets, find unused memory space from the memory management table, and allocate the unused memory space to the data packet, and lock the allocated memory space.

[0107] In the embodiment, the gateway device finds unused memory space from the memory management table and allocates the unused memory space to the encapsulated data packet. The memory management table is a data structure for recording the usage of memory space, which contains the start address, size and usage state of each memory space. By traversing the memory management table, the gateway device can filter out the unused memory space according to the usage state, so as to allocate the memory space to the corresponding data packet. The process of memory allocation usually includes finding the idle memory space, updating the usage state in the memory management table and writing the data packet into the allocated memory space.

[0108] In an optional embodiment, the memory pool is first divided into memory block units of different sizes. When a data packet needs memory space, the smallest memory block unit that matches the size of the data packet and is greater than or equal to the size of the data packet is found from the memory management table. If the matching smallest memory block unit is found, the smallest memory block unit is directly allocated to the data packet, and the usage state of the corresponding memory block unit in the memory management table is updated. If the matching smallest memory block unit is not found, a larger memory block unit is allocated from the memory pool, and the memory block unit is split into a memory block unit conforming to the size of the data packet and a remaining memory block unit. The memory block unit conforming to the size of the data packet is allocated to the data packet, and the remaining memory block unit is recorded in the memory management table as a new available memory block unit. Alternatively, if multiple adjacent memory block units can be combined to meet the size of the data packet, a combination operation can also be performed and allocated to the corresponding data packet.

[0109] In another optional embodiment, a hierarchical index table is constructed in advance. The hierarchical index table is layered according to the size of the memory space, and each layer corresponds to a memory block unit of a different size range. For example, the first layer is 1MB-2MB, the second layer is 2MB-4MB, and so on. The memory management table records detailed information of each memory block unit, including the index layer to which it belongs, the start address, the memory size and the usage state.

[0110] When a data packet needs memory space, the corresponding index layer is first determined according to the size of the data packet, and then the memory management table associated with the index layer is searched for an unused memory block unit that matches the size of the data packet. If the matching memory block unit is found, the memory block unit is directly allocated to the data packet, and the usage state of the memory block unit in the memory management table is updated. If the index layer does not find the matching memory block unit, the adjacent index layers are searched upwards or downwards. For example, if the current index layer does not have a matching memory block unit, but multiple adjacent memory block units can be combined to meet the size of the data packet, a combination operation is performed and allocated; if a larger index layer has a too large memory block unit, a splitting operation is performed and allocated.

[0111] To prevent the memory space from being accidentally accessed and modified by other threads during packet processing, the gateway device performs memory locking on the allocated memory space. Memory locking is a synchronization mechanism that ensures that after the memory space is allocated, other threads cannot access the memory space until the memory space is released.

[0112] For example, in a Linux system, the mlock function can be used to lock the specified memory space in physical memory, preventing the specified memory space from being swapped to disk. The mlock function is a memory management interface provided by the Linux system, which is used to lock the virtual memory region of a process in physical memory, avoiding the memory region from being swapped to disk by the memory management mechanism of the operating system. By using the mlock function, the gateway device can ensure the stability of the memory data during packet processing, ensuring that data is not lost or damaged due to memory swapping and other operations, thereby ensuring the reliability of data processing during radar real-time stream data transmission.

[0113] For example, in a Linux system, the mlock function can be used to lock the specified memory space in physical memory, preventing the specified memory space from being swapped to disk. The mlock function is a memory management interface provided by the Linux system, which is used to lock the virtual memory region of a process in physical memory, avoiding the memory region from being swapped to disk by the memory management mechanism of the operating system. By using the mlock function, the gateway device can ensure the stability of the memory data during packet processing, ensuring that data is not lost or damaged due to memory swapping and other operations, thereby ensuring the reliability of data processing during radar real-time stream data transmission. Figure 4 The radar real-time stream data transmission method of the third embodiment of the present application further includes steps S210-S230 in step S20.

[0114] Step S210: Create a linked list node for each data packet.

[0115] In this embodiment, the linked list node includes a data pointer, a previous pointer, and a next pointer. The data pointer points to the memory space where the data packet is located, and through the data pointer, the storage location of the data packet can be quickly located, thereby obtaining the point cloud data or IMU data in the data packet. The previous pointer points to the previous linked list node, and the next pointer points to the next linked list node. The previous pointer and the next pointer are used to connect the linked list nodes into an ordered linked list structure, thereby reflecting the order relationship between the data packets.

[0116] Specifically, the data type of the linked list node can be defined using a common structure in a programming language. Then, a dynamic memory allocation function, such as the malloc function, is used to allocate memory space for each linked list node. Then, the values of the pointers are correctly set, the data pointer is pointed to the actual storage location of the corresponding data packet in the memory, and the previous pointer and the next pointer are pointed to the correct previous linked list node and the next linked list node according to the order relationship of the data packets.

[0117] Exemplarily, when the linked list structure is initialized, three structure bodies need to be defined: packet, pool and queue. Among them, the packet structure body is used to define the size of the data packet, and the respective data packets are connected in order by using the pointer. The data packet size facilitates the gateway device to reasonably allocate memory space for the data packet, and the connection by the pointer can make the data packet form an ordered linked list structure. The pool structure body is used to define how many data packets the storage pool has, and whether the data packet needs to be specified to lock the memory area in the physical memory. The queue structure body is used to define the head packet and the tail packet of the linked list structure, and a mutex can be defined in the queue structure body to ensure the thread safety when the same data packet is read and written, and to avoid the data competition and inconsistency problem caused by the simultaneous read and write operation on the same data packet in the multi-thread environment.

[0118] It should be noted that the head packet and the tail packet of the linked list structure explicitly indicate the starting position and the ending position of the linked list structure, so that the gateway device can quickly locate the two ends of the linked list, and facilitate the data insertion and deletion operation.

[0119] Step S220: sequentially connecting the linked list nodes corresponding to the data packets according to the receiving order of the data packets to obtain a data packet linked list.

[0120] In this embodiment, the gateway device sequentially connects the linked list nodes corresponding to the data packets according to the receiving order of the data packets to form a data packet linked list. The data packet linked list can store and manage the data packets according to the receiving order of the data packets. By sequentially connecting the linked list nodes, the gateway device can ensure that the order of the data packets in the linked list is consistent with the receiving order, and avoid the out-of-order problem of the data packets.

[0121] It should be noted that the connection process of the linked list nodes includes updating the front pointer and the rear pointer, so as to ensure that each linked list node can correctly point to the predecessor node and the successor node corresponding to the linked list node.

[0122] Step S230: sequentially writing the data packets to the tail of the memory queue based on the order of the linked list nodes of the data packet linked list.

[0123] The data packet linked list is an ordered structure for the data received from the radar device and encapsulated, and the memory queue is a buffer for temporarily storing the data to meet the subsequent data request of the host device. The writing operation based on the order of the linked list nodes can ensure that the storage order of the data packets in the memory queue is consistent with the order of the data sent by the radar device, and avoid the disorder of the data.

[0124] In an optional embodiment, step S230 can include steps S2310-S2320:

[0125] Step S2310: Write the data packet corresponding to the first linked list node in the data packet linked list to the tail of the memory queue.

[0126] In this embodiment, the gateway device first locates the first linked list node of the data packet linked list, which represents the data packet received earliest in time among all data packets received by the gateway device. Then, the gateway device writes the data packet corresponding to the first linked list node to the tail of the memory queue. After completing the write operation, the tail pointer of the memory queue is updated to mark the storage location of the new data packet, ensuring that subsequent data packets can be correctly appended to the memory queue.

[0127] In an optional implementation, step S2310 further includes: when writing the data packet to the tail of the memory queue, using a mutex to lock the data packet being written; and when the data packet being written is written to the memory queue, releasing the mutex and locking the next data packet to be written.

[0128] The mutex is a synchronization mechanism used to ensure that only one thread can access a shared resource at the same time. In a multi-threaded environment, the gateway device performs both write and read operations on data packets, i.e., one side receives data packets from the radar device and writes them to the memory queue, and the other side reads data packets from the memory queue and transmits them to the host device. Through the mutex mechanism, the gateway device can ensure that the write thread and the read thread do not access the same data packet in the memory queue at the same time, thereby avoiding data race and out-of-order issues and ensuring the integrity of data transmission.

[0129] After releasing the mutex, other threads can acquire the mutex and continue to perform read or write operations. In this way, the gateway device can efficiently manage data access in a multi-threaded environment, allowing the gateway device and the host device to efficiently and concurrently access the memory queue without causing data loss or queue state confusion, ensuring the thread safety of the memory queue and improving the efficiency and reliability of data transmission.

[0130] Step S2320: According to the order of the linked list nodes of the data packet linked list, automatically locate the next linked list node with a pointer and write the data packet corresponding to the next linked list node to the tail of the memory queue.

[0131] When the first data packet is successfully written into the memory queue, the gateway device automatically locates the next linked list node using the rear pointer of the linked list node. Then, the gateway device continues to write the data packet corresponding to the next linked list node into the tail of the memory queue and updates the tail pointer of the memory queue again. The gateway device repeats the above write operation and tail pointer update operation until all data packets corresponding to the linked list nodes in the data packet linked list are written into the memory queue. In this way, the ordered transfer of data packets from the linked list to the memory queue is realized, ensuring the continuity and integrity of data transmission.

[0132] In this embodiment, the gateway device starts from the starting node (i.e., the first linked list node) of the data packet linked list and writes each data packet corresponding to a linked list node into the tail of the memory queue in sequence according to the order of the linked list nodes. Since the nodes in the data packet linked list are connected to each other through pointers, the gateway device can automatically locate the next node to be written into using the pointer of the linked list after the current data packet is successfully written into the memory queue. The above method ensures that the data packets are continuously and orderly transmitted during the transfer from the linked list to the memory queue, avoiding interruption or disorder of data transmission.

[0133] Please refer to Figure 5 The radar real-time stream data transmission method of the fourth embodiment of the present application can further include steps S201-S203 before step S20:

[0134] Step S201: If the memory queue has reached the pre-set maximum number of nodes, the data packets in the memory queue are moved forward one position in sequence, covering the original data packets corresponding to the head of the memory queue to free up the tail position of the memory queue.

[0135] In this embodiment, when the number of data packets stored in the memory queue reaches the pre-set maximum number of nodes, the memory queue is in a full state. In order to ensure that newly received data packets can be written in time to realize radar real-time stream data transmission, the gateway device will first move the data packets in the memory queue forward one position in sequence, covering the earliest stored original data packets corresponding to the head of the memory queue. This covering mechanism ensures that the capacity of the memory queue is always within the pre-set range, while preferentially retaining the latest data packets, ensuring the real-time nature of radar data transmission and meeting the needs of radar data real-time stream data transmission.

[0136] Therefore, by updating the tail pointer and covering the old data packets, the gateway device can efficiently process the continuously incoming data packets under limited memory resources, avoid data loss or system failure due to queue overflow, and ensure the real-time nature of the data packets, meeting the needs of real-time data transmission.

[0137] Step S202: updating the tail pointer of the memory queue so that the tail pointer points to the vacated tail position.

[0138] After the front-moving operation of the data packet in the memory queue is completed, the gateway device updates the tail pointer of the memory queue so that the tail pointer points to the tail position vacated due to the front-moving of the data packet. By updating the tail pointer, the gateway device can determine the writing position of the new data packet and provide accurate positioning information for the writing of subsequent data packets.

[0139] Step S203: writing the new data packet into the tail position of the memory queue.

[0140] After the updating of the tail pointer is completed, the gateway device writes the new data packet into the tail position of the memory queue. In this way, the gateway device can track the writing state of the memory queue in real time, ensure that the new data packet can be correctly stored, and keep the capacity of the memory queue within the preset range.

[0141] The embodiment of the present application provides a radar real-time stream data transmission device, which comprises at least one processor and a memory connected with the at least one processor in communication; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the radar real-time stream data transmission method in the above embodiment one.

[0142] Reference will be made to the following description Figure 6 which shows a structural schematic diagram of the radar real-time stream data transmission device suitable for being used to implement the embodiment of the present application. The radar real-time stream data transmission device in the embodiment of the present application can comprise various hardware and software components for implementing the radar real-time stream data transmission method. Figure 6 The radar real-time stream data transmission device shown is only an example and should not bring any limitation to the function and use range of the embodiment of the present application.

[0143] As Figure 6As shown, the radar real-time stream data transmission device can include a processing device 1001 (for example, a central processor, a graphics processor, etc.), which can perform various appropriate actions and processes according to programs stored in a read-only memory (ROM) 1002 or programs loaded from a storage device 1003 to a random access memory (RAM) 1004. In the random access memory 1004, various programs and data required for the operation of the radar real-time stream data transmission device are also stored. The processing device 1001, the read-only memory 1002, and the random access memory 1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, etc.; an output device 1008 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; the storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the radar real-time stream data transmission device to communicate with other devices wirelessly or by wire to exchange data. Although the radar real-time stream data transmission device with various systems is shown in the figure, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be alternatively implemented or provided.

[0144] In particular, according to the embodiments disclosed in the present application, the processes described above with reference to the flowcharts can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product comprising a computer program carried on a computer readable medium, the computer program containing program codes for executing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network through the communication device, or installed from the storage device 1003, or installed from the read-only memory 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the methods of the embodiments disclosed in the present application are performed.

[0145] The radar real-time stream data transmission device provided by the present application adopts the radar real-time stream data transmission method in the above-mentioned embodiments, and can solve the technical problem that the master device cannot establish stable communication connection with multiple radar devices due to dynamic port allocation and port resource limitation in the Kubernetes cluster. Compared with the prior art, the radar real-time stream data transmission device provided by the present application has the same beneficial effects as the radar real-time stream data transmission method provided by the above-mentioned embodiments, and other technical features in the radar real-time stream data transmission device are the same as the features disclosed in the previous embodiment method, which will not be repeated here.

[0146] It should be understood that various parts of the present application can be realized in hardware, software, firmware, or a combination thereof. In the above description of embodiments, specific functional, structural, material or characteristic features are combined in a manner appropriate for the particular example or embodiment. However, each feature can also be provided separately or in any appropriate sub-combination.

[0147] The above description is only specific embodiments of the present application, but the protection scope of the present application is not limited thereto, and any person skilled in the art can easily think of changes or replacements within the technical scope disclosed by the present application, which should be covered by the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

[0148] The embodiment of the present application provides a computer readable storage medium having computer readable program instructions (i.e. computer programs) stored thereon, the computer readable program instructions being used to execute the radar real-time stream data transmission method in the above-described embodiments.

[0149] The computer readable storage medium provided by the present application may, for example, be a U disk, but is not limited to an electric, magnetic, optical, electromagnetic, infrared, or semiconductor system, system or device, or any combination thereof. More specific examples of the computer readable storage medium can include, but are not limited to, an electric connection with one or more conductive lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present embodiment, the computer readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer readable storage medium can be transmitted by any appropriate medium, including but not limited to an electric wire, an optical cable, a radio frequency (RF), etc., or any suitable combination thereof.

[0150] The above computer readable storage medium can be contained in the radar real-time stream data transmission device; or can exist separately without being assembled into the radar real-time stream data transmission device.

[0151] The computer readable storage medium described above carries one or more programs, when the one or more programs are executed by the radar real-time stream data transmission device, the radar real-time stream data transmission device: acquires point cloud data and IMU data sent by a radar device, and encapsulates the point cloud data and the IMU data into independent data packets respectively; writes the data packets into the tail of a memory queue in a preset order in sequence; in response to a data request initiated by a host device, takes out a preset number of the data packets from the head of the memory queue, and sends the taken out data packets to the host device in the form of a data stream.

[0152] Computer program code for carrying out operations of the present application can be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computer (for example, through the Internet using an Internet Service Provider).

[0153] The flow diagrams and the block diagrams in the drawings are illustrations of architectures, functionalities, and operations of possible implementations of systems, methods, and computer program products according to various embodiments of present application. In this regard, each block in the flow diagrams or block diagrams can represent a module, a segment, or a portion of code, which comprises one or more executable instructions for implementing the specified logical functions. It should also be noted that in some alternative implementations, the functions noted in the blocks can occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently or the blocks may

[0154] The modules involved in the embodiments of the present application can be implemented in the form of software or in the form of hardware. Among them, the name of the module does not constitute a limitation on the unit itself in some cases.

[0155] The readable storage medium provided by the application is a computer readable storage medium, which stores computer readable program instructions (i.e., a computer program) for executing the radar real-time stream data transmission method described above, and can solve the technical problem that the master device cannot establish a stable communication connection with multiple radar devices due to dynamic port allocation and port resource limitations in the Kubernetes cluster. Compared with the prior art, the computer readable storage medium provided by the application has the same beneficial effects as the radar real-time stream data transmission method provided by the above-mentioned embodiments, and will not be described here.

[0156] The embodiment of the application provides a computer program product, comprising a computer program, which is executed by a processor to realize the steps of the radar real-time stream data transmission method described above.

[0157] The computer program product provided by the application can solve the technical problem that the master device cannot establish a stable communication connection with multiple radar devices due to dynamic port allocation and port resource limitations in the Kubernetes cluster. Compared with the prior art, the computer program product provided by the embodiment of the application has the same beneficial effects as the radar real-time stream data transmission method provided by the above-mentioned embodiments, and will not be described here.

[0158] The above is only the preferred embodiment of the application, and does not limit the patent scope of the application, and any equivalent structure or equivalent process transformation using the content of the specification and drawings, or direct or indirect application in other related technical fields, are also included in the patent processing scope of the application.

[0159] It should be noted that in this paper, the term "includes", "contains" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, article or system including a series of elements not only includes those elements, but also includes other elements not explicitly listed, or includes elements inherent to such process, method, article or system. Without more limitations, the element defined by the sentence "includes a" does not exclude the presence of other identical elements in the process, method, article or system including the element.

[0160] Through the description of the above embodiments, those skilled in the art can clearly understand that the above-mentioned embodiment method can be realized by means of software and necessary general hardware platform, of course, it can also be realized by hardware, but in many cases, the former is a better embodiment.

[0161] The above merely preferred embodiments of the present application and are not intended to limit the patent scope of the present application, any equivalent structure or equivalent process transformation made by using the content of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.

Claims

1. A radar real-time stream data transmission method, characterized in that, The radar real-time stream data transmission method is applied to a gateway device, one side of the gateway device is in communication connection with a radar device, and the other side is in communication connection with a host device, and the radar real-time stream data transmission method comprises the following steps: Obtain point cloud data and IMU data sent by the radar device, and encapsulate the point cloud data and the IMU data into independent data packets respectively; Write the data packets in a preset order into the tail of a memory queue in sequence; In response to a data request initiated by the host device through a TCP protocol, take out a preset number of data packets from the head of the memory queue, and send the taken-out data packets to the host device in the form of a data stream; wherein the host device is deployed in a Kubernetes cluster; Before the steps of obtaining the point cloud data and the IMU data sent by the radar device and encapsulating the point cloud data and the IMU data into independent data packets respectively, the method further comprises the following steps: Receive device information sent by the radar device through UDP broadcast; According to the device information, establish a radar device registry, which is used to map and store the identification, IP address and port number of the radar device; Generate a connection request message according to the IP address and port number of the radar device in the radar device registry; Send the connection request message to the radar device to establish a communication connection with the radar device; wherein the gateway device communicates with the radar device through a fixed port configuration.

2. The radar real-time streaming data transfer method of claim 1, wherein, The step of obtaining the point cloud data and the IMU data sent by the radar device and encapsulating the point cloud data and the IMU data into independent data packets comprises the following steps: Based on a pre-allocated memory pool, initialize memory space and build a memory management table, which is used to record the starting address, size and usage state of each memory space; After encapsulating the point cloud data and the IMU data into data packets, find unused memory space from the memory management table, and allocate the unused memory space to the data packets, and lock the allocated memory space.

3. The radar real-time streaming data transfer method of claim 1, wherein, The step of writing the data packets in a preset order into the tail of a memory queue in sequence comprises the following steps: Create a linked list node for each data packet; According to the receiving order of the data packets, connect the linked list nodes corresponding to the data packets in sequence to obtain a data packet linked list; Based on the order of the linked list nodes of the data packet linked list, write the data packets into the tail of the memory queue in sequence.

4. The radar real-time streaming data transfer method of claim 3, wherein, The step of writing the data packets in a preset order into the tail of a memory queue in sequence comprises the following steps: Write the data packet corresponding to the first linked list node in the data packet linked list into the tail of the memory queue; According to the order of the linked list nodes of the data packet linked list, automatically position the pointer to the next linked list node, and write the data packet corresponding to the next linked list node into the tail of the memory queue.

5. The radar real-time streaming data transfer method of claim 4, wherein, The step of writing the data packet corresponding to the first linked list node in the data packet linked list into the tail of the memory queue comprises the following steps: In the step of writing the data packets into the tail of the memory queue, a mutual exclusion lock is used to lock the data packet being written; After the data packet being written is written into the memory queue, the mutual exclusion lock is released, and the next data packet to be written is locked.

6. The radar real-time streaming data transfer method of claim 1, wherein, Before the step of writing the data packets into the tail of the memory queue in the preset order, the method further comprises: If the memory queue has reached a preset maximum number of nodes, the data packets in the memory queue are moved one position forward in turn, covering the original data packets corresponding to the head of the memory queue to vacate the tail position of the memory queue; The tail pointer of the memory queue is updated to point to the vacated tail position; A new data packet is written into the tail position of the memory queue.

7. The radar real-time streaming data transfer method of claim 1, wherein, Before the step of taking out a preset number of data packets from the head of the memory queue in response to a data request initiated by a host device and sending the taken data packets to the host device in the form of a data stream, the method further comprises: Receiving a connection request initiated by the host device and establishing a TCP connection with the host device; After establishing the TCP connection, detecting the data storage state of the memory queue, the data storage state including the number of data packets and the storage rate of the memory queue; Based on the data storage state of the memory queue, adjusting the data transmission parameters between the gateway device and the host device; If the number of data packets is below a preset number threshold, reducing the data packet size and / or reducing the transmission rate, and / or increasing the number of timeout retransmissions; or If the storage rate exceeds a preset rate threshold, increasing the data packet size and / or increasing the transmission rate, and / or reducing the number of timeout retransmissions.

8. A radar real-time stream data transmission device, characterized by comprising: The radar real-time stream data transmission device comprises a memory, a processor, and a computer program stored on the memory and executable on the processor, the computer program being configured to implement the steps of the radar real-time stream data transmission method according to any one of claims 1 to 7.

9. A computer storage medium, characterized in that The computer storage medium is a computer readable storage medium, and the computer storage medium stores a computer program, the computer program being executed by a processor to implement the steps of the radar real-time stream data transmission method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Cache management method and device as well as network switching equipment

    CN102185725A

  • Cross-network data transmission method and device, storage medium and electronic equipment

    CN116708381A