Data sending method and device and electronic equipment
By using countdown processing technology in DDS, the problems of data transmission delay inconsistency and jitter caused by traditional scheduling strategies are solved, and the deterministic data transmission and the reliability and timeliness of data transmission during autonomous driving are realized.
Patent Information
- Application Number
- CN202411286519.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-13
- Publication Date
- 2024-12-13
AI Technical Summary
When DDS processes concurrent data, traditional scheduling strategies such as FIFO and RR lead to inconsistent data transmission delay and large jitter, and cannot process all data requests in time during high load, resulting in large jitter in deterministic transmission delay, affecting transmission predictability.
By obtaining the time to send data to be sent during the data transmission process, calculating its remaining sending time, and performing countdown processing in the preset timer, ensuring that the data is sent at a specified time, avoiding the time caused by uncertainty in the scheduling policy Delay jitter.
It realizes precise control of data transmission time, reduces the problem of time delay inconsistency, ensures deterministic data transmission, improves the timeliness and reliability of data transmission during autonomous driving, and reduces the risk of accidents.
Smart Images

Figure CN119135625A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a data sending method, device and electronic device. Background Art
[0002] When DDS (Data Distribution Service) processes concurrent data, traditional scheduling strategies such as FIFO (First Input First Output) will cause some data packets to queue for a long time when the network is congested, waiting for processing. Therefore, it is difficult to strictly control the data transmission delay, resulting in inconsistent data transmission delay and large jitter. Traditional scheduling strategies such as RR (Round, Robin) will frequently switch contexts, increasing system overhead, and under high load, FIFO and RR cannot process all data requests in time, causing delays. Competition among multiple data streams will lead to scheduling uncertainty, affecting the predictability of delays and leading to unstable transmission delays, which makes it difficult to strictly meet the requirements for ensuring deterministic transmission, and the deterministic delay of data transmission has large jitter. Summary of the invention
[0003] The present disclosure provides a data transmission method, device, electronic device and storage medium to at least solve the technical problems in the related art that it is difficult to strictly meet the requirements of deterministic transmission and the jitter of the deterministic delay of data transmission is large. The technical solution of the present disclosure is as follows:
[0004] According to a first aspect of an embodiment of the present disclosure, a data sending method is provided, including:
[0005] In the process of processing multiple preset sending ends to send data simultaneously, if any to-be-sent data carrying the to-be-sent time is received, obtaining a first current time;
[0006] Determine a first remaining sending duration corresponding to the data to be sent based on the to-be-sent time and the first current time;
[0007] Adding the first remaining sending duration to a preset timer, and performing a countdown process in the preset timer based on the first remaining sending duration;
[0008] When the countdown ends, the data to be sent is sent.
[0009] In an optional embodiment, the method includes:
[0010] In the process of processing the data being sent by the multiple preset sending ends at the same time, if any of the to-be-sent data carrying the to-be-sent time is received, the to-be-sent data is added to the preset cache;
[0011] When the countdown ends, sending the data to be sent includes:
[0012] When the countdown ends, obtaining the data to be sent from the preset cache;
[0013] Encapsulating the data to be sent to obtain encapsulated data;
[0014] The encapsulated data is sent.
[0015] In an optional embodiment, the method includes:
[0016] Obtaining a storage address of the data to be sent in the preset cache;
[0017] Establish association information between the storage address and the first remaining sending duration.
[0018] In an optional embodiment, when the countdown ends, obtaining the to-be-sent data from the preset cache includes:
[0019] When the countdown ends, the to-be-sent data is obtained from the preset cache based on the first remaining sending duration and the associated information.
[0020] In an optional embodiment, the data to be sent is data sent by any preset sending end among multiple preset sending ends, and adding the data to be sent to a preset cache includes:
[0021] The data to be sent is added to the preset cache corresponding to the preset sending end of the data to be sent.
[0022] In an optional embodiment, sending the encapsulated data includes:
[0023] Based on the bypass core, the encapsulated data is sent.
[0024] In an optional embodiment, encapsulating the data to be sent to obtain encapsulated data includes:
[0025] Encapsulating the data to be sent based on a real-time publish-subscribe protocol at the application layer to obtain a first message;
[0026] encapsulate the first message based on the user datagram protocol at the transport layer to obtain a second message, where the second message includes the user datagram protocol port information and the first message;
[0027] encapsulate the second message based on the Internet protocol at the network layer to obtain a third message, wherein the third message includes an Internet Protocol address, the User Datagram Protocol port information and the first message;
[0028] The third message is encapsulated based on the multiple access control protocol at the data link layer to obtain the encapsulated data, wherein the encapsulated data includes the media access control address, the Internet Protocol address, the user datagram protocol port information and the first message.
[0029] In an optional embodiment, in the process of processing the multiple preset sending ends sending the data simultaneously, if any of the to-be-sent data carrying the to-be-sent time is received, adding the to-be-sent data to the preset cache includes:
[0030] In the process of processing the data being sent by the multiple preset sending ends at the same time, if any of the to-be-sent data carrying the to-be-sent time is received, the to-be-sent data is added to the preset communication protocol stack, and based on the preset communication protocol, the protocol conversion is performed on the to-be-sent data to obtain the converted data;
[0031] The converted data is added to a preset cache.
[0032] In an optional embodiment, the method further includes:
[0033] detecting the preset timer in real time;
[0034] When an abnormality of the preset timer is detected, obtaining a second current time;
[0035] Determine a second remaining sending duration corresponding to the data to be sent based on the to-be-sent time and the second current time;
[0036] The second remaining sending duration is added to a standby timer, and a countdown process is performed in the standby timer based on the second remaining sending duration; and the process jumps to the step of sending the data to be sent when the countdown ends.
[0037] According to a second aspect of an embodiment of the present disclosure, there is provided a data sending device, including:
[0038] A first current time acquisition module is used to acquire the first current time when any to-be-sent data carrying the to-be-sent time is received during the process of processing multiple preset sending ends sending data simultaneously;
[0039] A first remaining sending duration acquisition module, used to determine a first remaining sending duration corresponding to the data to be sent based on the to-be-sent time and the first current time;
[0040] A countdown module, configured to add the first remaining sending duration to a preset timer, and perform countdown processing in the preset timer based on the first remaining sending duration;
[0041] The module for sending data to be sent is used to send the data to be sent when the countdown ends.
[0042] In an optional embodiment, the device comprises:
[0043] A preset cache adding module, used for adding the to-be-sent data to the preset cache if any to-be-sent data carrying the to-be-sent time is received during the process of processing the multiple preset sending ends sending the data simultaneously;
[0044] The data to be sent sending module includes:
[0045] A to-be-sent data acquisition unit, configured to acquire the to-be-sent data from the preset cache when the countdown ends;
[0046] A data encapsulation unit, used for encapsulating the data to be sent to obtain encapsulated data;
[0047] A data sending unit is used to send the encapsulated data.
[0048] In an optional embodiment, the device comprises:
[0049] A storage address acquisition module, used to acquire the storage address of the data to be sent in the preset cache;
[0050] An association information establishing module is used to establish association information between the storage address and the first remaining sending duration.
[0051] In an optional embodiment, the to-be-sent data acquisition unit includes:
[0052] The to-be-sent data acquisition subunit is used to acquire the to-be-sent data from the preset cache based on the first remaining sending duration and the associated information when the countdown ends.
[0053] In an optional embodiment, the data to be sent is data sent by any preset sending end among multiple preset sending ends, and the preset cache adding module includes:
[0054] The preset cache adding unit is used to add the data to be sent to the preset cache corresponding to the preset sending end of the data to be sent.
[0055] In an optional embodiment, the data sending unit includes:
[0056] The data sending subunit is used to send the encapsulated data based on the bypass core.
[0057] In an optional embodiment, the data encapsulation unit includes:
[0058] A first message acquisition subunit is used to encapsulate the converted data based on a real-time publish-subscribe protocol at the application layer to obtain a first message;
[0059] A second message acquisition subunit, configured to encapsulate the first message based on the user datagram protocol at the transport layer to obtain a second message, wherein the second message includes the user datagram protocol port information and the first message;
[0060] A third message acquisition subunit, configured to encapsulate the second message based on an Internet protocol at a network layer to obtain a third message, wherein the third message includes an Internet Protocol address, the User Datagram Protocol port information, and the first message;
[0061] The encapsulated data acquisition subunit is used to encapsulate the third message based on the multiple access control protocol at the data link layer to obtain the encapsulated data, wherein the encapsulated data includes the media access control address, the Internet Protocol address, the user datagram protocol port information and the first message.
[0062] In an optional embodiment, the preset cache adding module includes:
[0063] A converted data acquisition unit is used for, in the process of processing the data being sent by the multiple preset sending ends at the same time, if any of the to-be-sent data carrying the to-be-sent time is received, adding the to-be-sent data to a preset communication protocol stack, and performing protocol conversion on the to-be-sent data based on the preset communication protocol to obtain converted data;
[0064] The preset cache adding unit is used to add the converted data to the preset cache.
[0065] In an optional embodiment, the device further comprises:
[0066] A detection module, used for detecting the preset timer in real time;
[0067] A second current time acquisition module, configured to acquire a second current time when an abnormality of the preset timer is detected;
[0068] A second remaining sending duration acquisition module, used to determine a second remaining sending duration corresponding to the data to be sent based on the to-be-sent time and the second current time;
[0069] The second countdown module is used to add the second remaining sending duration to a standby timer, and perform countdown processing in the standby timer based on the second remaining sending duration; and jump to the data sending module to be sent.
[0070] According to a third aspect of an embodiment of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions to implement a method as described in any one of the above-mentioned first aspects.
[0071] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided. When instructions in the storage medium are executed by a processor of an electronic device, the electronic device can execute any one of the data sending methods of the embodiments of the present disclosure.
[0072] According to a fifth aspect of an embodiment of the present disclosure, there is provided a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute a method as described in any one of the above-mentioned first aspects.
[0073] The technical solution provided by the embodiments of the present disclosure brings at least the following beneficial effects:
[0074] By setting the waiting time in the data to be sent, and after receiving the data to be sent, combining the waiting time and the first current time to accurately calculate the first remaining sending time, accurate control of the data transmission time is achieved. Setting a timer and countdown processing ensures that the data is sent at the specified time, avoiding the delay or early sending of data that may be caused by manual or imprecise time triggering, thereby reducing the delay jitter caused by the uncertainty of the scheduling strategy, and sending data when the countdown ends, eliminating the delay inconsistency problem caused by concurrency and resource competition, realizing deterministic data transmission, ensuring the timeliness and reliability of related data transmission during autonomous driving, ensuring the safety of autonomous driving, minimizing the risk of accidents, and ensuring the stable driving of autonomous driving vehicles.
[0075] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0076] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.
[0077] Figure 1 is a flowchart of a data sending method according to an exemplary embodiment;
[0078] Figure 2 is a flowchart of another data sending method according to an exemplary embodiment;
[0079] Figure 3 is a flowchart of another data sending method according to an exemplary embodiment;
[0080] Figure 4 is a block diagram of a device for sending data according to an exemplary embodiment;
[0081] Figure 5 is a principle block diagram of data transmission according to an exemplary embodiment;
[0082] Figure 6 It is a block diagram of an electronic device for data transmission according to an exemplary embodiment. DETAILED DESCRIPTION
[0083] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.
[0084] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0085] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for display, data for analysis, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties.
[0086] See also Figure 1 , Figure 1 This is a flow chart of a data sending method according to an exemplary embodiment, which is applied to a terminal. Specifically, the method may include the following steps:
[0087] Step S101, in the process of processing that multiple preset sending ends send data simultaneously, if any to-be-sent data carrying a to-be-sent time is received, a first current time is obtained.
[0088] In a specific embodiment, the above-mentioned data to be sent is data sent by any preset sending end among multiple preset sending ends. In practical applications, in an application scenario where deterministic delay is required for data transmission in autonomous driving, the terminal will receive multiple data to be sent sent by multiple preset sending ends among a large number of preset sending ends. Correspondingly, the data to be sent in the present application is any one of the multiple data to be sent; specifically, taking the terminal as a vehicle-mounted terminal as an example, the preset sending end may be different sensors in the vehicle-mounted regional controller. Exemplarily, the sensor may be at least one of a laser radar sensor, a millimeter-wave radar sensor, a throttle position sensor, a brake sensor, a brake pressure sensor, and a steering angle sensor. Correspondingly, the data to be sent may be at least one of three-dimensional point cloud data, millimeter-wave radar data, throttle control data, brake control data, brake pressure data, and steering angle data. In a specific embodiment, the preset sending end may be different vehicle-mounted regional controllers.
[0089] In practical applications, in the environment of high-level autonomous driving, this solution can be used to transmit data with high deterministic latency requirements.
[0090] For example, in a high-level autonomous driving environment, the laser radar sensor emits a laser beam and receives its reflected signal to measure the distance to each laser point, obtain the precise distance and contour information of the surrounding environment, and thus generate high-precision three-dimensional point cloud data. The millimeter wave radar sensor emits high-frequency electromagnetic waves and receives reflected waves to measure the distance, speed and relative angle of the target object. Due to the large volume of high-precision point cloud data and the timeliness requirements of millimeter wave radar data (distance, speed and relative angle of the target object), its transmission needs to ensure high bandwidth and low latency. The laser radar sensor and millimeter wave radar sensor send the acquired data to the autonomous driving controller within a delay of 500 microseconds, and the high-precision three-dimensional point cloud data and millimeter wave radar data (distance, speed and relative angle of the target object) are fused in the autonomous driving controller to obtain a more accurate high-precision environmental map, the position and speed of the target object. The autonomous driving controller transmits the fused data (high-precision environmental map, position and speed of the target object) to the vehicle's control system in real time within a delay of 300 microseconds so that the system can respond quickly. The autonomous driving vehicle can obtain more reliable perception results under various environmental conditions through the fused data.
[0091] For example, in a high-level autonomous driving environment, the laser radar sensor measures the distance to each laser point by emitting a laser beam and receiving its reflected signal, obtains the precise distance and contour information of the surrounding environment, and generates high-precision three-dimensional point cloud data. The inertial measurement unit measures the acceleration and angular velocity of the surrounding vehicles through the accelerometer and gyroscope, thereby calculating the vehicle's motion state (such as speed, acceleration, and direction change), and the on-board navigation system module obtains the global positioning information of the autonomous driving vehicle. The laser radar sensor, the inertial measurement unit, and the on-board navigation system send the acquired data to the autonomous driving controller within a delay of 500 microseconds, and the high-precision three-dimensional point cloud data, the acceleration and angular velocity of the surrounding vehicles, and the global positioning information of the autonomous driving vehicle are fused in the autonomous driving controller to obtain more accurate high-precision maps, high-precision position information, high-precision attitude information, and dynamic obstacle information. The autonomous driving controller transmits the fused data (high-precision map, high-precision position information, high-precision attitude information, and dynamic obstacle information) to the vehicle's control system in real time within a delay of 300 microseconds so that the system can respond quickly. Through the fused data, autonomous vehicles can update the precise position and posture of the vehicle in real time, optimizing the decision-making and control of the autonomous driving system.
[0092] Exemplarily, in a high-level autonomous driving environment, a vehicle speed sensor obtains the speed of the autonomous driving vehicle, an engine control unit obtains the engine speed, throttle position and fuel injection amount, a transmission control unit obtains the current gear and transmission oil temperature, a lidar sensor obtains high-precision three-dimensional point cloud data, a camera obtains information on detected traffic signs, lane markings and obstacles ahead, and an on-board navigation system obtains real-time road information, slopes, curves and traffic signals; the vehicle speed sensor, engine control unit, transmission control unit, lidar sensor and camera send the acquired data to the autonomous driving controller within a delay of 500 microseconds, and the above data are fused in the autonomous driving controller to obtain the current vehicle's acceleration, speed, power demand, acceleration command, braking command, steering command, transmission gear information and other data; the autonomous driving controller transmits the fused data (the current vehicle's acceleration, speed, power demand, acceleration command, braking command, steering command, transmission gear information and other data) in real time to the vehicle's control system within a delay of 300 microseconds, so that the system can respond quickly, thereby ensuring safe and reliable autonomous driving and avoiding the risk of accidents.
[0093] In a specific embodiment, the above-mentioned waiting time for transmission is a scheduled transmission time of the data to be transmitted.
[0094] Step S103: determining a first remaining sending duration corresponding to the data to be sent based on the to-be-sent time and the first current time.
[0095] In a specific embodiment, the first remaining sending time is the time difference between the to-be-sent time and the first current time, and is used to indicate how much time is left for the to-be-sent data to be sent.
[0096] Step S105: adding the first remaining sending duration to a preset timer, and performing countdown processing in the preset timer based on the first remaining sending duration.
[0097] In a specific embodiment, the preset timer is used to count down the first remaining sending time, and when the waiting time for sending the data to be sent is reached, the execution of data sending is triggered.
[0098] In a specific embodiment, the countdown processing based on the first remaining sending duration in the preset timer may be counting down the first remaining sending duration in the preset timer.
[0099] Step S107: When the countdown ends, the data to be sent is sent.
[0100] In a specific embodiment, the countdown may end when the first remaining sending time counts down to 0, that is, the first current time reaches the waiting time for sending the data to be sent.
[0101] In a specific embodiment, Figure 2 As shown, the above method includes:
[0102] Step S201, in the process of processing multiple preset sending ends sending data simultaneously, if any to-be-sent data carrying a to-be-sent time is received, the to-be-sent data is added to a preset cache.
[0103] In a specific embodiment, the preset cache is used to save the data to be sent to ensure that the data can be stored safely, and at the time when the data is to be sent, the data is accurately sent in the preset cache, which is beneficial to subsequent data transmission and management.
[0104] In practical applications, because the vehicle terminal receives a plurality of to-be-sent data sent by a plurality of preset sending ends among a large number of preset sending ends, if the plurality of data from different preset sending ends are placed in the same preset cache, data access competition will be caused, and delays in data retrieval and data access will be caused. Therefore, in a specific embodiment, the above-mentioned adding the to-be-sent data to the preset cache includes:
[0105] The data to be sent is added to a preset cache corresponding to a preset sending end of the data to be sent.
[0106] In a specific embodiment, the data to be sent carries an identifier of its preset sending end. Accordingly, the adding of the data to be sent to the preset cache corresponding to the preset sending end of the data to be sent can be based on the identifier carried by the data to be sent and the preset mapping relationship, determining the preset cache corresponding to the preset sending end of the data to be sent, and adding the data to be sent to the corresponding preset cache. Specifically, the preset mapping relationship represents the preset caches corresponding to each of the multiple preset sending ends.
[0107] In the above embodiment, the data to be sent is accurately added to the preset cache corresponding to the preset sending end of the data to be sent, which helps to quickly access and process the data when subsequent data is sent, reduces the delay in data retrieval and data access, improves the speed and efficiency of data transmission, and enhances the reliability of the system, significantly optimizes the performance of the system, and maintains good performance.
[0108] For a plurality of data to be sent from any preset sending end, in a specific embodiment, the method includes:
[0109] Obtain the storage address of each data to be sent in the preset cache;
[0110] Establish association information between the storage address of each data to be sent and its first remaining sending time.
[0111] In a specific embodiment, in the above-mentioned process of adding the data to be sent to the preset cache corresponding to the preset sending end of the data to be sent, the storage address of each data to be sent in the preset cache is obtained, and association information between the storage address of each data to be sent and its first remaining sending duration is established.
[0112] In the above embodiment, before data transmission, the storage location of the data to be sent in the preset cache is accurately obtained, and the association information of the storage address and the first remaining sending time is established to ensure that the exact location of each data to be sent can be accurately identified and its first remaining sending time is known. Therefore, when the countdown of the first remaining sending time of multiple data to be sent is 0, that is, when the waiting time of multiple data to be sent is reached, the multiple data to be sent can be quickly found through the association information of the storage address and the first remaining sending time, avoiding congestion and waiting caused by searching for multiple data, thereby avoiding communication errors and delays caused by incorrect or missing data sequence, and improving the stability and performance of the system.
[0113] In a specific embodiment, in the process of processing multiple preset sending ends to send data simultaneously, if any to-be-sent data carrying a to-be-sent time is received, adding the to-be-sent data to the preset cache includes:
[0114] In the process of processing multiple preset sending ends to send data simultaneously, if any to-be-sent data carrying a to-be-sent time is received, the to-be-sent data is added to the preset communication protocol stack, and based on the preset communication protocol, the to-be-sent data is converted into a protocol to obtain converted data;
[0115] Add the converted data to the preset cache.
[0116] In a specific embodiment, the preset communication protocol stack may be a DDS protocol stack, and correspondingly, the preset communication protocol may be a DDS protocol.
[0117] In the above embodiment, the data to be sent is converted through the DDS protocol stack in order to format the data to be sent, because the data in the preset cache of DDS has the same format. Exemplarily, the unified format may include a sample data format (data type, sequence number), a cache management strategy (fixed size, quantity-based cache) and a storage structure (linked list, array, index).
[0118] In a specific embodiment, when the countdown ends, sending the data to be sent includes:
[0119] Step S203: when the countdown ends, the data to be sent is obtained from the preset buffer.
[0120] In a specific embodiment, when the countdown ends, obtaining the to-be-sent data from the preset cache includes:
[0121] When the countdown ends, the data to be sent is obtained from the preset cache based on the first remaining sending duration and the associated information.
[0122] In a specific embodiment, when the countdown ends, the data to be sent can be obtained from the preset cache based on the first remaining sending duration and the associated information. When the countdown of the first remaining sending duration is 0, that is, when the first current time reaches the waiting time of the data to be sent, the storage address of the data to be sent corresponding to the first remaining sending duration with a countdown of 0 in the preset cache can be obtained based on the associated information, and the data to be sent is taken out from the preset cache and sent.
[0123] In the above embodiment, at the end of the countdown, the data to be sent is located and extracted quickly and accurately based on the first remaining sending time and related information, ensuring the real-time and efficiency of data sending, ensuring that the data is prepared within the specified time and sent in a timely manner, and ensuring that the system reasonably schedules and allocates resources according to demand when processing multiple data requests, thereby improving the efficiency of the overall system.
[0124] Step S205, encapsulate the data to be sent to obtain encapsulated data.
[0125] In a specific embodiment, the encapsulation of the data to be sent to obtain the encapsulated data includes:
[0126] Encapsulating the data to be sent based on a real-time publish-subscribe protocol at the application layer to obtain a first message;
[0127] encapsulating the first message based on the user datagram protocol at the transport layer to obtain a second message;
[0128] encapsulating the second message based on the Internet protocol at the network layer to obtain a third message;
[0129] The third message is encapsulated based on the multiple access control protocol at the data link layer to obtain encapsulated data.
[0130] In a specific embodiment, the first message may be a DDS message.
[0131] In a specific embodiment, the second message includes user datagram protocol port information and the first message. In a specific embodiment, the user datagram protocol port information is used to identify a specific application or service in the network, and each user datagram protocol port information is associated with a specific application or service. Through the user datagram protocol port information, it can be determined to which application or service the first message should be delivered.
[0132] In a specific embodiment, the third message includes an Internet Protocol address, user datagram protocol port information and the first message. In a specific embodiment, the Internet Protocol address is used to uniquely identify and locate each device in the Internet or local area network. Through the Internet Protocol address, the second message can be correctly routed to the target device.
[0133] In a specific embodiment, the encapsulated data includes a media access control address, an Internet Protocol address, a user datagram protocol port information, and the first message. The media access control address is used to uniquely identify the physical address of a network device in a computer network. When the third message is transmitted from one device to another, the media access control address of the target device is placed in the target address field. In this way, a network device such as a switch or a hub can correctly forward the third message to the target device according to the target media access control address.
[0134] Step S207, sending the encapsulated data.
[0135] In a specific embodiment, sending the encapsulated data includes:
[0136] Based on the bypass core, the encapsulated data is sent.
[0137] In a specific embodiment, the bypass kernel technology is a method for directly processing data by bypassing the operating system kernel protocol stack. Specifically, based on the bypass kernel, the encapsulated data can be sent to the vehicle control system.
[0138] In the above embodiments, the use of a bypass kernel can significantly improve data transmission performance, increase the response speed and throughput of the overall system, reduce processing delays during data transmission, and help improve the security and reliability of the system, thereby achieving higher efficiency in overall resource utilization.
[0139] In practical applications, factors such as too long a time to execute a scheduled task and unstable network may cause the currently working timer to fail. Therefore, in a specific embodiment, the method further includes:
[0140] Real-time detection of preset timers;
[0141] When an abnormality of a preset timer is detected, obtaining a second current time;
[0142] Determine a second remaining sending duration corresponding to the data to be sent based on the to-be-sent time and the second current time;
[0143] The second remaining sending duration is added to a standby timer, and a countdown process is performed in the standby timer based on the second remaining sending duration; and the process jumps to the above step of sending the data to be sent when the countdown ends.
[0144] In a specific embodiment, a preset timer can be detected in real time through a preset monitoring program, and when a currently working timer fails, a second current time is obtained; based on the to-be-sent time of the data to be sent and the second current time, the second remaining sending duration corresponding to the data to be sent is re-determined, and second association information between the second remaining sending duration and the storage address of the data to be sent is established; the second remaining sending duration is added to the standby timer, and a countdown is performed. When the countdown reaches 0, that is, when the to-be-sent time is reached, the data to be sent is taken out from the preset cache according to the second association information for sending.
[0145] In the above embodiment, by real-time detection of the currently working preset timer, when the currently working preset timer fails, the second remaining sending duration of the data to be sent is recalculated, and the second remaining sending duration is added to the backup timer mechanism to ensure that when the currently working timer fails, the backup timer can continue to work normally, thereby enhancing the stability and reliability of data transmission.
[0146] In a specific embodiment, Figure 3 As shown, Figure 3 This is a flow chart of another data sending method according to an exemplary embodiment, which may include the following steps:
[0147] Step S301, adding the data to be sent into a preset communication protocol stack, and performing protocol conversion on the data to be sent based on the preset communication protocol to obtain converted data.
[0148] Step S303, obtaining a first current time.
[0149] Step S305: adding the converted data to a preset buffer corresponding to a preset sending end of the data to be sent.
[0150] Step S307, obtaining the storage address of the converted data in the preset cache.
[0151] Step S309: Determine a first remaining sending duration corresponding to the converted data based on the waiting time and the first current time.
[0152] Step S311: establishing association information between the storage address and the first remaining sending duration.
[0153] Step S313: adding the first remaining sending duration to a preset timer, and performing a countdown process in the preset timer based on the first remaining sending duration.
[0154] Step S315: when the countdown ends, the converted data is obtained from the preset cache based on the first remaining sending duration and the associated information.
[0155] Step S317: encapsulate the converted data at the application layer based on the real-time publish-subscribe protocol to obtain a first message.
[0156] Step S319: encapsulate the first message based on the user datagram protocol at the transport layer to obtain a second message.
[0157] Step S321, encapsulate the second message based on the Internet protocol at the network layer to obtain a third message.
[0158] Step S323: encapsulate the third message based on the multiple access control protocol at the data link layer to obtain an encapsulated message.
[0159] Step S325, sending the encapsulated data based on the bypass core.
[0160] Figure 4 is a block diagram of a data sending device according to an exemplary embodiment. Figure 4 , the device comprises:
[0161] A first current time acquisition module 410 is used to acquire the first current time when any to-be-sent data carrying the to-be-sent time is received during the process of processing multiple preset sending ends sending data simultaneously;
[0162] A first remaining sending duration acquisition module 420, configured to determine a first remaining sending duration corresponding to the data to be sent based on the to-be-sent time and the first current time;
[0163] A countdown module 430, configured to add the first remaining sending duration to a preset timer, and perform countdown processing in the preset timer based on the first remaining sending duration;
[0164] The data to be sent sending module 440 is used to send the data to be sent when the countdown ends.
[0165] In an optional embodiment, the above device includes:
[0166] A preset cache adding module is used to add the to-be-sent data to the preset cache if any to-be-sent data carrying the to-be-sent time is received during the process of processing multiple preset sending ends sending data simultaneously;
[0167] The data to be sent sending module 440 includes:
[0168] A to-be-sent data acquisition unit, used to acquire the to-be-sent data from a preset cache when the countdown ends;
[0169] A data encapsulation unit is used to encapsulate the data to be sent to obtain encapsulated data;
[0170] The data sending unit is used to send the encapsulated data.
[0171] In an optional embodiment, the above device includes:
[0172] A storage address acquisition module is used to obtain the storage address of the data to be sent in a preset cache;
[0173] The association information establishing module is used to establish association information between the storage address and the first remaining sending duration.
[0174] In an optional embodiment, the above-mentioned data to be sent acquiring unit includes:
[0175] The to-be-sent data acquisition subunit is used to acquire the to-be-sent data from a preset cache based on the first remaining sending duration and the associated information when the countdown ends.
[0176] In an optional embodiment, the data to be sent is data sent by any preset sending end among multiple preset sending ends, and the preset cache adding module includes:
[0177] The preset cache adding unit is used to add the data to be sent into the preset cache corresponding to the preset sending end of the data to be sent.
[0178] In an optional embodiment, the data sending unit includes:
[0179] The data sending subunit is used to send the encapsulated data based on the bypass core.
[0180] In an optional embodiment, the data encapsulation unit includes:
[0181] A first message acquisition subunit is used to encapsulate the converted data based on a real-time publish-subscribe protocol at the application layer to obtain a first message;
[0182] A second message acquisition subunit is used to encapsulate the first message based on the user datagram protocol at the transport layer to obtain a second message;
[0183] A third message acquisition subunit is used to encapsulate the second message based on the Internet protocol at the network layer to obtain a third message;
[0184] The encapsulated data acquisition subunit is used to encapsulate the third message based on the multiple access control protocol at the data link layer to obtain encapsulated data.
[0185] In an optional embodiment, the preset cache adding module includes:
[0186] A converted data acquisition unit is used to, in the process of processing multiple preset sending ends to send data simultaneously, if any to-be-sent data carrying a to-be-sent time is received, add the to-be-sent data to a preset communication protocol stack, and perform protocol conversion on the to-be-sent data based on the preset communication protocol to obtain converted data;
[0187] The preset cache adding unit is used to add the converted data to the preset cache.
[0188] In an optional embodiment, the above device further includes:
[0189] A detection module, used for real-time detection of a preset timer;
[0190] A second current time acquisition module, used to acquire a second current time when an abnormality of a preset timer is detected;
[0191] A second remaining sending duration acquisition module, used to determine a second remaining sending duration corresponding to the data to be sent based on the to-be-sent time and the second current time;
[0192] The second countdown module is used to add the second remaining sending duration to the standby timer, and perform countdown processing in the standby timer based on the second remaining sending duration; and jump to the data sending module to be sent.
[0193] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0194] Figure 5It is a principle block diagram of data transmission according to an exemplary embodiment; there are multiple WHs (writerhistory, write history cache), that is, there are multiple preset caches corresponding to multiple preset sending ends, each WH contains multiple changes (converted data), each change carries its own Wh-txTime (waiting time to be sent), based on Wh-txTime and Currenttime (first current time), determine the diff (first remaining sending time) corresponding to each change; add the diff to the TimerQueue (preset timer), and in the TimerQueue, countdown processing is performed based on the diff; when the countdown ends, send the change. It should be understood that although multiple changes in each WH in the figure correspond to one diff, in actual applications, each change in each WH has its own diff.
[0195] Figure 6 is a block diagram of an electronic device for data transmission according to an exemplary embodiment. The electronic device may be a terminal, and its internal structure diagram may be as shown in FIG. Figure 6 As shown. The electronic device includes a processor, a memory, a network interface, a display screen and an input device connected via a system bus. Among them, the processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the electronic device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a data sending method is implemented. The display screen of the electronic device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the electronic device can be a touch layer covering the display screen, or a key, trackball or touchpad provided on the housing of the electronic device, or an external keyboard, touchpad or mouse, etc.
[0196] Those skilled in the art will understand that Figure 6 The structure shown in the figure is merely a block diagram of a partial structure related to the scheme of the present disclosure, and does not constitute a limitation on the electronic device to which the scheme of the present disclosure is applied. The specific electronic device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0197] In an exemplary embodiment, an electronic device is also provided, including: a processor; and a memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions to implement the data sending method in the embodiment of the present disclosure.
[0198] In an exemplary embodiment, a computer-readable storage medium is also provided. When instructions in the storage medium are executed by a processor of an electronic device, the electronic device can execute the data sending method in the embodiment of the present disclosure.
[0199] In an exemplary embodiment, a computer program product including instructions is also provided. When the computer program product is run on a computer, the computer is enabled to execute the data sending method in the embodiment of the present disclosure.
[0200] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0201] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.
[0202] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A data transmission method, characterized in that: include: In the process of processing multiple preset sending ends to send data simultaneously, if any to-be-sent data carrying the to-be-sent time is received, obtaining a first current time; Determine a first remaining sending duration corresponding to the data to be sent based on the to-be-sent time and the first current time; Adding the first remaining sending duration to a preset timer, and performing a countdown process in the preset timer based on the first remaining sending duration; When the countdown ends, the data to be sent is sent.
2. The method according to claim 1, characterized in that: The method comprises: In the process of processing the data being sent by the multiple preset sending ends at the same time, if any of the to-be-sent data carrying the to-be-sent time is received, the to-be-sent data is added to the preset cache; When the countdown ends, sending the data to be sent includes: When the countdown ends, obtaining the data to be sent from the preset cache; Encapsulating the data to be sent to obtain encapsulated data; The encapsulated data is sent.
3. The method according to claim 2, characterized in that: The method comprises: Obtaining a storage address of the data to be sent in the preset cache; Establish association information between the storage address and the first remaining sending duration.
4. The method according to claim 3, characterized in that: When the countdown ends, obtaining the to-be-sent data from the preset cache includes: When the countdown ends, the to-be-sent data is obtained from the preset cache based on the first remaining sending duration and the associated information.
5. The method according to claim 2, characterized in that: The data to be sent is data sent by any preset sending end among multiple preset sending ends, and adding the data to be sent into a preset cache includes: The data to be sent is added to the preset cache corresponding to the preset sending end of the data to be sent.
6. The method according to claim 2, characterized in that: The sending of the encapsulated data comprises: Based on the bypass core, the encapsulated data is sent.
7. The method according to claim 2, characterized in that: The encapsulating the data to be sent to obtain the encapsulated data comprises: Encapsulating the data to be sent based on a real-time publish-subscribe protocol at the application layer to obtain a first message; encapsulate the first message based on the user datagram protocol at the transport layer to obtain a second message, where the second message includes the user datagram protocol port information and the first message; encapsulate the second message based on the Internet protocol at the network layer to obtain a third message, wherein the third message includes an Internet Protocol address, the User Datagram Protocol port information and the first message; The third message is encapsulated based on the multiple access control protocol at the data link layer to obtain the encapsulated data, which includes the media access control address, the Internet Protocol address, the user datagram protocol port information and the first message.
8. The method according to claim 2, characterized in that: In the process of processing the data being sent simultaneously by the multiple preset sending ends, if any of the to-be-sent data carrying the to-be-sent time is received, adding the to-be-sent data to the preset cache includes: In the process of processing the data being sent by the multiple preset sending ends at the same time, if any of the to-be-sent data carrying the to-be-sent time is received, the to-be-sent data is added to a preset communication protocol stack, and based on the preset communication protocol, a protocol conversion is performed on the to-be-sent data to obtain converted data; The converted data is added to a preset cache.
9. The method according to claim 1, characterized in that: The method further comprises: detecting the preset timer in real time; When an abnormality of the preset timer is detected, obtaining a second current time; Determine a second remaining sending duration corresponding to the data to be sent based on the to-be-sent time and the second current time; The second remaining sending duration is added to a standby timer, and a countdown process is performed in the standby timer based on the second remaining sending duration; and the process jumps to the step of sending the data to be sent when the countdown ends.
10. A data sending device, characterized in that: include: A first current time acquisition module is used to acquire the first current time when any to-be-sent data carrying the to-be-sent time is received during the process of processing multiple preset sending ends sending data simultaneously; A first remaining sending duration acquisition module, used to determine a first remaining sending duration corresponding to the data to be sent based on the to-be-sent time and the first current time; A countdown module, configured to add the first remaining sending duration to a preset timer, and perform countdown processing in the preset timer based on the first remaining sending duration; The module for sending data to be sent is used to send the data to be sent when the countdown ends.
11. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the data sending method according to any one of claims 1 to 9.
