High-precision and high-reliability vehicle cloud communication method and device and electronic equipment
By adopting the quic feature of the MQTT protocol and clock synchronization technology in the Internet of Vehicles system, combined with the priority control and message confirmation mechanism, the problem of clock synchronization and data transmission certainty in the Internet of Vehicles system in a high-speed mobile environment is solved, and high accuracy is achieved. and highly reliable vehicle-to-cloud communication.
Patent Information
- Application Number
- CN202410951273.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-16
- Publication Date
- 2024-10-29
AI Technical Summary
Existing Internet of Vehicles systems are difficult to achieve high-precision clock synchronization and deterministic data transmission in high-speed mobile environments, resulting in unsatisfied demands for applications such as autonomous driving.
Use the quic feature of the MQTT protocol to establish multiple data channels between vehicles and the cloud, achieve clock synchronization through GPS signals or external clock sources, and introduce priority control and message confirmation mechanisms into the data channels, carrying timestamp information for clock calibration and dynamic adjustment QoS levels and traffic distribution to prevent network congestion.
It achieves microsecond-level synchronization accuracy in the car and millisecond-level in the car cloud, improves the reliability and certainty of data transmission, and ensures real-time and accuracy in complex network environments.
Smart Images

Figure CN118869745A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of vehicle networking, and in particular to a high-precision and high-reliability vehicle-cloud communication method, device and electronic equipment. Background Art
[0002] With the rapid development of Internet of Vehicles technology, various applications such as advanced driver assistance systems (ADAS), autonomous driving, and in-vehicle entertainment and information services are increasingly integrated into modern cars. These applications have put forward unprecedented requirements for the real-time and reliability of data transmission. Especially for the application of autonomous driving and intelligent AI large models, any slight delay or data transmission error may lead to serious consequences. Therefore, it becomes crucial to ensure high-precision synchronization between internal and external components of the vehicle and the determinism of data transmission.
[0003] In the existing technology, most car networking systems use standard wireless communication protocols (such as 4G / 5G, Wi-Fi, etc.) for data transmission. Although these technologies can provide relatively high data transmission rates, in an environment where vehicles are moving at high speeds, network instability and latency variations may make it difficult for data synchronization accuracy to meet the requirements of applications such as autonomous driving. In addition, existing car-to-cloud communication solutions usually fail to fully consider the determinism of data transmission, resulting in data transmission delays or losses when the network is congested or service quality decreases.
[0004] On the other hand, the lightweight message queue telemetry transport protocol (MQTT) has been widely used in Internet of Things (IoT) communications due to its lightweight design, low overhead, and easy implementation. However, the MQTT protocol itself is not optimized for high-precision clock synchronization and deterministic data transmission in high-speed mobile environments, which limits its application in high-demand Internet of Vehicles application scenarios.
[0005] Although the existing technology has made some progress in the field of vehicle networking communication, there are still technical defects and deficiencies, which are specifically manifested in the following aspects:
[0006] Insufficient synchronization accuracy: The clock synchronization technology in existing Internet of Vehicles systems often fails to achieve the microsecond-level in-vehicle synchronization accuracy and millisecond-level vehicle-cloud synchronization accuracy required for autonomous driving and intelligent AI applications.
[0007] Insufficient data certainty: In complex network environments, especially when the network is congested or the service quality is unstable, existing communication solutions can hardly guarantee the certainty of data transmission, resulting in data delay or loss, and cannot meet the needs of high real-time applications.
[0008] The protocol is not adaptable: Although the MQTT protocol performs well in the field of lightweight communications, it lacks optimization for high-speed mobile environments and high-precision clock synchronization requirements, which limits its further application in the field of Internet of Vehicles.
[0009] In summary, how to achieve high-precision synchronization of vehicle-cloud communications and ensure the determinism of data transmission based on the MQTT protocol has become a technical problem that needs to be solved urgently. Summary of the invention
[0010] In view of this, the purpose of the present invention is to provide a high-precision and high-reliability vehicle-cloud communication method, device and electronic device to alleviate the technical problem that the prior art cannot achieve high-precision synchronization of vehicle-cloud communication based on the MQTT protocol and ensure the determinism of data transmission.
[0011] In a first aspect, an embodiment of the present invention provides a high-precision and high-reliability vehicle-to-cloud communication method, which is applied to a vehicle-to-cloud communication system. The method includes:
[0012] After the vehicle is started, the quic feature of the MQTT protocol is used to establish multiple data channels for communication between the vehicle and the cloud, and receive GPS signals or external clock source signals to obtain the time reference therein, and then synchronize the time reference to the component to be synchronized in the vehicle, complete the clock synchronization in the vehicle, and send an MQTT message carrying timestamp information, wherein each data channel corresponds to a different priority;
[0013] Determine a corresponding target data channel in the multiple data channels according to the priority carried by the MQTT message, and transmit the MQTT message through the target data channel, wherein, when the QoS level of the MQTT message is a preset level, after the sending end sends the MQTT message, the sending end waits for the receiving end to reply with a confirmation message, and if the sending end does not receive the confirmation message within a preset time, the sending end automatically retransmits until the confirmation message is received or the number of retransmissions reaches a preset threshold;
[0014] The clock synchronization calibration between the vehicle and the cloud is performed according to the timestamp information carried in the MQTT message.
[0015] Furthermore, if the MQTT message is an MQTT message sent by the vehicle to the cloud, the timestamp information carried by the MQTT message includes: the time when the vehicle sends the MQTT message and the network transmission delay, and the clock synchronization calibration between the vehicle and the cloud is performed according to the timestamp information carried by the MQTT message, including:
[0016] The cloud obtains the time when the vehicle sends the MQTT message and the time when the cloud receives the MQTT message in the MQTT message;
[0017] The cloud calculates the actual clock deviation according to the time when the vehicle sends the MQTT message, the time when the cloud receives the MQTT message and the network transmission delay, and sends the actual clock deviation to the vehicle, wherein the network transmission delay is calculated by the vehicle according to the time when it sends the time synchronization request and the time when the vehicle receives the response, and the response is the response sent by the cloud to the vehicle according to the time synchronization request;
[0018] The vehicle adjusts a clock of the vehicle based on the actual clock deviation.
[0019] Furthermore, if the MQTT message is a time synchronization request sent by the vehicle to the cloud at a preset period, the timestamp information carried by the MQTT message is the time when the vehicle sends the time synchronization request, and the clock synchronization calibration between the vehicle and the cloud is performed according to the timestamp information carried by the MQTT message, including:
[0020] The cloud obtains the time when the vehicle sends the time synchronization request and the time when the cloud receives the time synchronization request in the MQTT message, and sends a response to the time synchronization request carrying the time when the vehicle sends the time synchronization request, the time when the cloud receives the time synchronization request, and the time when the cloud sends the response to the vehicle;
[0021] The vehicle obtains the time when the vehicle sends the time synchronization request, the time when the cloud receives the time synchronization request, the time when the cloud sends the response, and the time when the vehicle receives the response in the response, and calculates the clock deviation according to the time when the vehicle sends the time synchronization request, the time when the cloud receives the time synchronization request, the time when the cloud sends the response, and the time when the vehicle receives the response;
[0022] The vehicle adjusts a clock of the vehicle based on the clock deviation.
[0023] Furthermore, the method further comprises:
[0024] When transmitting the MQTT message, dynamically adjust the QoS level of the MQTT message data of each data channel based on the acquired current network status and current data transmission demand of each data channel, so as to preliminarily prevent network congestion of each data channel;
[0025] Adjusting the flow distribution of MQTT message data in each of the data channels after the QoS levels are adjusted based on the obtained current network conditions of each of the data channels after the QoS levels are adjusted and the flow conditions of each of the data channels after the QoS levels are adjusted, so as to prevent network congestion of each of the data channels after the QoS levels are adjusted;
[0026] The network congestion prediction model is used to predict the network congestion of the network data of each data channel after the flow distribution adjustment, and the network congestion prediction result is obtained;
[0027] If the network congestion prediction result indicates that the target data channel has a congestion risk at the target time, a prevention mechanism is started before the target time to prevent network congestion of the target data channel.
[0028] Furthermore, the prevention mechanism includes: transferring a certain amount of MQTT message data of the target data channel through other data channels after traffic allocation adjustment, and reducing the sending frequency of MQTT message data corresponding to non-urgent data in the target data channel.
[0029] Furthermore, the network data includes: flow status data, service request data, network status data, and a network congestion prediction model is used to perform network congestion prediction on the network data of each data channel after the flow distribution adjustment, including:
[0030] Extracting target characteristic data from the network data, wherein the target characteristic data includes: data packet size, transmission frequency, and bandwidth utilization;
[0031] A network congestion prediction model is used to perform network congestion prediction on the target characteristic data of each data channel after the flow distribution adjustment.
[0032] Furthermore, the priority level carried by the MQTT message is obtained by presetting the MQTT message according to the type of the MQTT message.
[0033] In a second aspect, an embodiment of the present invention further provides a high-precision, high-reliability vehicle-to-cloud communication device, which is applied to a vehicle-to-cloud communication system, and the device includes:
[0034] The vehicle clock synchronization unit is used to establish multiple data channels for communication between the vehicle and the cloud using the quic feature of the MQTT protocol after the vehicle is started, and receive GPS signals or external clock source signals to obtain the time reference therein, and then synchronize the time reference to the component to be synchronized in the vehicle, complete the vehicle clock synchronization, and send an MQTT message carrying timestamp information, wherein each data channel corresponds to a different priority;
[0035] A determination unit, configured to determine a corresponding target data channel in the plurality of data channels according to the priority level carried by the MQTT message, and transmit the MQTT message through the target data channel, wherein when the QoS level of the MQTT message is a preset level, after the sending end sends the MQTT message, the sending end waits for the receiving end to reply with a confirmation message, and if the sending end does not receive the confirmation message within a preset time, the sending end automatically retransmits until the confirmation message is received or the number of retransmissions reaches a preset threshold;
[0036] The vehicle-cloud clock synchronization calibration unit is used to perform clock synchronization calibration between the vehicle and the cloud according to the timestamp information carried by the MQTT message.
[0037] In a third aspect, an embodiment of the present invention further provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of any one of the methods described in the first aspect when executing the computer program.
[0038] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores machine-executable instructions. When the machine-executable instructions are called and executed by a processor, the machine-executable instructions prompt the processor to execute any method described in the first aspect above.
[0039] In an embodiment of the present invention, a high-precision and high-reliability vehicle-cloud communication method is provided, which is applied to a vehicle-cloud communication system. The method includes: after the vehicle is started, multiple data channels for communication between the vehicle and the cloud are established using the quic feature of the MQTT protocol, and a GPS signal or an external clock source signal is received to obtain a time reference therein, and then the time reference is synchronized to the component to be synchronized in the vehicle, so as to complete the clock synchronization in the vehicle, so as to send an MQTT message carrying timestamp information, wherein each data channel corresponds to a different priority; according to the priority carried by the MQTT message, a corresponding target data channel is determined in the multiple data channels, and the MQTT message is transmitted through the target data channel, wherein when the QoS level of the MQTT message is a preset level, after the sending end sends the MQTT message, the sending end waits for the receiving end to reply with a confirmation message, and if the sending end does not receive the confirmation message within the preset time, the sending end automatically retransmits until the confirmation message is received or the number of retransmissions reaches a preset threshold; and the clock synchronization calibration between the vehicle and the cloud is performed according to the timestamp information carried by the MQTT message. From the above description, it can be seen that in the high-precision and high-reliability vehicle-cloud communication method of the present invention, by integrating the improved lightweight message queue telemetry transmission protocol (MQTT messages carry timestamp information) and high-precision clock synchronization technology, it is possible to achieve microsecond-level synchronization accuracy in the vehicle and millisecond-level synchronization accuracy in the vehicle-cloud. In addition, on the basis of the standard MQTT protocol, priority control (i.e., determining the corresponding target data channel in multiple data channels for the transmission of MQTT messages according to the priority carried by the MQTT message) and a message confirmation mechanism (i.e., confirming the reply of the message) are introduced to improve the communication reliability and the certainty of data transmission in a high-speed mobile environment, thereby alleviating the technical problem that the prior art cannot achieve high-precision synchronization of vehicle-cloud communications and ensure the certainty of data transmission based on the MQTT protocol. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0041] Figure 1 A flow chart of a high-precision and high-reliability vehicle-to-cloud communication method provided by an embodiment of the present invention;
[0042] Figure 2 A schematic diagram of a high-precision and high-reliability vehicle-to-cloud communication device provided by an embodiment of the present invention;
[0043] Figure 3 An electronic device is provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0044] The technical solution of the present invention will be clearly and completely described below in conjunction with the embodiments. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0045] Traditional technologies cannot achieve high-precision synchronization of vehicle-cloud communications and ensure the determinism of data transmission based on the MQTT protocol.
[0046] Based on this, the high-precision and high-reliability vehicle-cloud communication method of the present invention can achieve microsecond-level synchronization accuracy in the vehicle and millisecond-level synchronization accuracy in the vehicle-cloud by integrating the improved lightweight message queue telemetry transmission protocol (MQTT messages carry timestamp information) and high-precision clock synchronization technology. In addition, on the basis of the standard MQTT protocol, priority control (i.e., determining the corresponding target data channel in multiple data channels for MQTT message transmission according to the priority carried by the MQTT message) and message confirmation mechanism (i.e., confirming the reply of the message) are introduced to improve the communication reliability and certainty of data transmission in high-speed mobile environments.
[0047] To facilitate understanding of this embodiment, a high-precision and high-reliability vehicle-to-cloud communication method disclosed in an embodiment of the present invention is first introduced in detail.
[0048] Embodiment 1:
[0049] According to an embodiment of the present invention, an embodiment of a high-precision and high-reliability vehicle-to-cloud communication method is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in an order different from that shown here.
[0050] Figure 1 is a flow chart of a high-precision and high-reliability vehicle-to-cloud communication method according to an embodiment of the present invention. Figure 1 As shown, the method comprises the following steps:
[0051] Step S102, after the vehicle is started, the quic feature of the MQTT protocol is used to establish multiple data channels for communication between the vehicle and the cloud, and receive GPS signals or external clock source signals to obtain the time reference therein, and then synchronize the time reference to the component to be synchronized in the vehicle, complete the clock synchronization in the vehicle, and send an MQTT message carrying timestamp information, wherein each data channel corresponds to a different priority;
[0052] In an embodiment of the present invention, the high-precision and high-reliability vehicle-to-cloud communication method can be applied to a vehicle-to-cloud communication system. After the vehicle is started, the quic feature of the MQTT protocol is used to establish a multi-data channel for communication between the vehicle and the cloud, and at the same time, the high-precision clock synchronization module is automatically activated. By receiving GPS signals or external clock source signals, the precise time reference is obtained, and then the time reference is distributed to all components in the vehicle that need to be synchronized (i.e., components to be synchronized, such as sensors, control units, etc.).
[0053] The high-precision clock synchronization module uses the clock synchronization algorithm: IEEE 1588 Precision Time Protocol (PTP) to achieve microsecond-level time synchronization between key components such as sensors and control units inside the vehicle. The module provides a unified time reference for the vehicle through GPS signals or other high-precision clock sources (such as external clock source signals) to ensure the time consistency of data collection and processing.
[0054] Step S104, determining the corresponding target data channel in the multiple data channels according to the priority carried by the MQTT message, and transmitting the MQTT message through the target data channel, wherein, when the QoS level of the MQTT message is a preset level, after the sending end sends the MQTT message, the sending end waits for the receiving end to reply with a confirmation message, and if the sending end does not receive the confirmation message within a preset time, the sending end automatically retransmits until the confirmation message is received or the number of retransmissions reaches a preset threshold;
[0055] Specifically, priority control is implemented to ensure that each MQTT message can be effectively managed according to its importance and urgency. The core purpose of priority control is to ensure that key information can be sent and processed first in the case of network congestion or unstable quality, thereby improving the response speed and reliability of the system. This mechanism involves key steps such as message priority marking, message sending queue management, and dynamic adjustment of sending strategies.
[0056] Message priority label settings:
[0057] Define priority levels: First, define a priority level system, using numbers from 1 to N. The smaller the number, the higher the priority. The specific number of levels can be flexibly set according to actual application scenarios and requirements.
[0058] Label assignment mechanism: Define a priority label for each type of MQTT message. This step is usually performed during the MQTT message definition phase, and the MQTT messages are graded according to their functions and roles. For example, for an autonomous driving system, messages about the vehicle's instant location and speed may be given the highest priority, while log information and the like may be given a lower priority.
[0059] Message encapsulation: When encapsulating MQTT messages, the priority tag is included as part of the message header to ensure that the priority information can be retained and identified during the MQTT message transmission process.
[0060] Message sending queue management:
[0061] Queue design: Multiple sending queues are designed inside the communication module (i.e., data channels, responsible for data transmission between the vehicle and the cloud, supporting high-frequency, large-volume information exchange). Each queue corresponds to a priority level. MQTT messages are assigned to the corresponding queues according to their priority tags before being sent.
[0062] Queue scheduling strategy: Implement queue scheduling strategy to ensure that high-priority message queues (i.e. data channels) can be processed before low-priority message queues. When there are MQTT messages to be sent in multiple queues, the MQTT messages in the highest priority queue are always checked and sent first.
[0063] The specific implementation process is as follows:
[0064] Message priority label settings:
[0065] 1. Define priority levels:
[0066] Priority level system: Define priority levels, represented by numbers from 1 to N, with smaller numbers indicating higher priorities. The specific number of levels can be flexibly set according to actual application scenarios and requirements. For example, define three priority levels: 1 (high priority), 2 (medium priority), and 3 (low priority).
[0067] 2. Label allocation mechanism:
[0068] Message classification: Classify MQTT messages according to their functions and roles, and assign a priority label to each type of MQTT message. For example:
[0069] For autonomous driving systems, MQTT messages about the vehicle’s immediate position and speed are given the highest priority (priority 1).
[0070] Monitoring data regarding the vehicle status is given a medium priority (priority 2).
[0071] Log information etc. is given the lowest priority (priority 3).
[0072] 3. Message encapsulation:
[0073] Add priority tags: When encapsulating MQTT messages, include the priority tag as part of the message header. For example, when an MQTT message about the vehicle's real-time location is encapsulated, the header information contains the tag "Priority: 1". Ensure that priority information can be retained and identified during MQTT message transmission.
[0074] Message sending queue management
[0075] 1. Queue design:
[0076] Multi-queue system: Design multiple sending queues (i.e. data channels) inside the communication module, each queue corresponds to a priority level. According to the priority level system defined above, set up three sending queues: high priority queue, medium priority queue and low priority queue.
[0077] 2. Queue scheduling strategy:
[0078] Message allocation: MQTT messages are allocated to the corresponding queues according to their priority tags before being sent. For example, an MQTT message with a "Priority: 1" tag will be placed in a high-priority queue.
[0079] Priority Scheduling: Implement queue scheduling strategies to ensure that high-priority message queues are processed before low-priority message queues. When there are MQTT messages to be sent in multiple queues, the MQTT messages in the highest priority queue are always checked and sent first. For example:
[0080] If there are MQTT messages in the high-priority queue, all MQTT messages in the high-priority queue will be processed and sent first; after the high-priority queue is processed, the medium-priority queue will be checked and the MQTT messages in it will be sent; finally, the MQTT messages in the low-priority queue will be processed.
[0081] In addition, a message confirmation and retransmission mechanism is implemented to ensure that each important MQTT message (that is, when the QoS level of the MQTT message reaches the preset level) can be correctly received by the receiving end; the MQTT message that is not successfully transmitted is automatically retransmitted until it is confirmed to be received or the retry limit is exceeded.
[0082] Step S106, performing clock synchronization calibration between the vehicle and the cloud according to the timestamp information carried in the MQTT message.
[0083] Specifically, it includes: calibration feedback mechanism and periodic synchronization calibration. The calibration feedback mechanism further improves the clock synchronization accuracy through delay calculation in a short period of time. Periodic synchronization calibration mainly acts on vehicles and the cloud. Periodic synchronization calibration can correct the accumulated clock drift and ensure the clock synchronization accuracy in long-term operation.
[0084] In an embodiment of the present invention, a high-precision and high-reliability vehicle-cloud communication method is provided, which is applied to a vehicle-cloud communication system. The method includes: after the vehicle is started, multiple data channels for communication between the vehicle and the cloud are established using the quic feature of the MQTT protocol, and a GPS signal or an external clock source signal is received to obtain a time reference therein, and then the time reference is synchronized to the component to be synchronized in the vehicle, so as to complete the clock synchronization in the vehicle, so as to send an MQTT message carrying timestamp information, wherein each data channel corresponds to a different priority; according to the priority carried by the MQTT message, a corresponding target data channel is determined in the multiple data channels, and the MQTT message is transmitted through the target data channel, wherein when the QoS level of the MQTT message is a preset level, after the sending end sends the MQTT message, the sending end waits for the receiving end to reply with a confirmation message, and if the sending end does not receive the confirmation message within the preset time, the sending end automatically retransmits until the confirmation message is received or the number of retransmissions reaches a preset threshold; and the clock synchronization calibration between the vehicle and the cloud is performed according to the timestamp information carried by the MQTT message. From the above description, it can be seen that in the high-precision and high-reliability vehicle-cloud communication method of the present invention, by integrating the improved lightweight message queue telemetry transmission protocol (MQTT messages carry timestamp information) and high-precision clock synchronization technology, it is possible to achieve microsecond-level synchronization accuracy in the vehicle and millisecond-level synchronization accuracy in the vehicle-cloud. In addition, on the basis of the standard MQTT protocol, priority control (i.e., determining the corresponding target data channel in multiple data channels for the transmission of MQTT messages according to the priority carried by the MQTT message) and a message confirmation mechanism (i.e., confirming the reply of the message) are introduced to improve the communication reliability and the certainty of data transmission in a high-speed mobile environment, thereby alleviating the technical problem that the prior art cannot achieve high-precision synchronization of vehicle-cloud communications and ensure the certainty of data transmission based on the MQTT protocol.
[0085] The above content briefly introduces the high-precision and high-reliability vehicle-to-cloud communication method of the present invention. The specific contents involved are described in detail below.
[0086] In an optional embodiment of the present invention, if the MQTT message is an MQTT message sent by the vehicle to the cloud, the timestamp information carried by the MQTT message includes: the time when the vehicle sends the MQTT message and the network transmission delay, and the clock synchronization calibration between the vehicle and the cloud is performed according to the timestamp information carried by the MQTT message, which specifically includes the following steps:
[0087] (1) The cloud obtains the time when the vehicle sends the MQTT message and the time when the cloud receives the MQTT message;
[0088] (2) The cloud calculates the actual clock deviation based on the time when the vehicle sends the MQTT message, the time when the cloud receives the MQTT message, and the network transmission delay, and sends the actual clock deviation to the vehicle, where the network transmission delay is calculated based on the time when the vehicle sends the time synchronization request and the time when the vehicle receives the response, and the response is the response sent by the cloud to the vehicle based on the time synchronization request;
[0089] Specifically, the actual clock deviation = [(the time when the cloud receives the MQTT message - the time when the vehicle sends the MQTT message) - network transmission delay] / 2.
[0090] Steps to obtain network transmission delay:
[0091] The vehicle sends a time synchronization request to the cloud and records the sending time t1.
[0092] After receiving the time synchronization request, the cloud immediately sends a response and records the receiving time t2 and the sending time t3 of the response.
[0093] After the vehicle receives the response, it records the receiving time t4.
[0094] The network transmission delay is estimated by measuring the RTT (Round Trip Time) multiple times.
[0095] Calculate RTT: RTT = (t4 - t1).
[0096] Estimate network transmission delay: Generally, you can assume that network transmission delay is half of RTT: network transmission delay = RTT / 2.
[0097] Take multiple measurements and take the average:
[0098] In order to estimate the network transmission delay more accurately, the above steps can be repeated multiple times and the average of these measurement results can be calculated.
[0099] (3) The vehicle adjusts the vehicle's clock according to the actual clock deviation.
[0100] Specifically, the vehicle clock = the vehicle's current clock ± the actual clock deviation. This process is the process of calibrating the feedback mechanism.
[0101] In an optional embodiment of the present invention, if the MQTT message is a time synchronization request sent by the vehicle to the cloud at a preset period, the timestamp information carried by the MQTT message is the time when the vehicle sends the time synchronization request, and the clock synchronization calibration between the vehicle and the cloud is performed according to the timestamp information carried by the MQTT message, which specifically includes the following steps:
[0102] (1) The cloud obtains the time when the vehicle sends the time synchronization request and the time when the cloud receives the time synchronization request in the MQTT message, and sends a response to the time synchronization request that carries the time when the vehicle sends the time synchronization request, the time when the cloud receives the time synchronization request, and the time when the cloud sends the response to the vehicle;
[0103] During implementation, the vehicle sends a time synchronization request and records the timestamp t1 (i.e., the time when the vehicle sends the time synchronization request). For example, the vehicle sends a time synchronization request to the cloud at regular intervals (for example, every hour) and records the sending time t1; after the cloud receives the time synchronization request, it records the receiving time t2.
[0104] (2) The vehicle obtains the time when the vehicle sends the time synchronization request, the time when the cloud receives the time synchronization request, the time when the cloud sends the response, and the time when the vehicle receives the response in the response, and calculates the clock deviation based on the time when the vehicle sends the time synchronization request, the time when the cloud receives the time synchronization request, the time when the cloud sends the response, and the time when the vehicle receives the response;
[0105] Specifically, the cloud responds to the time synchronization request and records the time t3 when the cloud sends the response, the vehicle receives the response, and records the time t4 when the vehicle receives the response. The clock deviation is then calculated based on the time when the vehicle sends the time synchronization request, the time when the cloud receives the time synchronization request, the time when the cloud sends the response, and the time when the vehicle receives the response.
[0106] Clock deviation = [(t2-t1)+(t4-t3)] / 2.
[0107] (3) The vehicle adjusts the vehicle's clock according to the clock deviation.
[0108] Specifically, the vehicle clock = the vehicle's current clock ± the clock deviation. This process is the process of regular synchronization and calibration.
[0109] Periodic synchronization calibration: Regularly correct the accumulated clock drift to ensure the accuracy of clock synchronization during long-term operation; provide a stable time synchronization mechanism to ensure clock synchronization even when the MQTT message frequency is low or the network conditions are poor.
[0110] Calibration feedback mechanism: further improves clock synchronization accuracy through delay calculation in a short period of time; provides instant clock adjustment to ensure high-precision clock synchronization.
[0111] Combined with network congestion control and flow regulation technology, the data transmission strategy is dynamically adjusted to ensure that the stability and accuracy of data transmission can be maintained when the network conditions change. By monitoring the network conditions in real time and automatically optimizing the data transmission priority (QoS level) and flow distribution according to the network quality, the network resources can be maximized and the data transmission delay and packet loss rate can be reduced. In an optional embodiment of the present invention, the method also includes the following steps:
[0112] (1) When transmitting MQTT messages, dynamically adjust the QoS level of the MQTT message data of each data channel based on the current network status and current data transmission requirements of each data channel to preliminarily prevent network congestion of each data channel;
[0113] The specific process may be: obtaining a first correspondence between network conditions, data transmission requirements and QoS levels; determining a target QoS level corresponding to the current network conditions and the current data transmission requirements based on the first correspondence, the current network conditions and the current data transmission requirements; and adjusting the QoS level of the MQTT message data of the corresponding data channel based on the target QoS level.
[0114] The above first correspondence is summarized in the measurement, which includes the correspondence between various network conditions, data transmission requirements and QoS levels, such as network condition 1, data transmission requirement 1 corresponds to QoS level 1, network condition 2, data transmission requirement 2 corresponds to QoS level 2, etc.
[0115] The above-mentioned current network status and current data transmission demand are obtained by calling the interface on the vehicle. When determining the target QoS level corresponding to the current network status and the current data transmission demand, it is determined according to the first corresponding relationship.
[0116] After adjusting the QoS level of MQTT message data, data transmission can be optimized. The QoS level complies with the MQTT protocol standard (0: at most once, 1: at least once, 2: only once), that is, when the level is 0, no response is returned; when the level is 1, a response is returned once; when the level is 2, it is necessary to wait for the message to be processed before it can be processed again. The higher the level, the better the transmission reliability; the lower the level, the shorter the waiting time, which can effectively alleviate network congestion. For example, when the network load is low, the QoS level of data transmission can be increased to ensure the reliability of data transmission; when the network load is high, the QoS level of non-urgent data can be reduced to alleviate network congestion.
[0117] (2) adjusting the flow distribution of MQTT message data in the data channels after each QoS level is adjusted based on the obtained current network conditions of the data channels after each QoS level is adjusted and the flow conditions of the data channels after each QoS level is adjusted, so as to prevent network congestion of the data channels after each QoS level is adjusted;
[0118] The specific process may be: determining whether the current network status and traffic status meet the preset traffic allocation conditions; if so, transmitting the target MQTT message data in the data channel adjusted to the corresponding QoS level, and not transmitting other MQTT message data in the data channel adjusted to the corresponding QoS level, wherein the target MQTT message data is pre-defined data that must be transmitted.
[0119] When implemented, the interface on the vehicle is called to obtain the current network status and traffic status, and determine whether the current network status and traffic status meet the preset traffic allocation conditions. For example, if the current network status is not good and the data traffic is large, then the preset traffic allocation conditions are met. Of course, in actual implementation, the preset traffic allocation conditions include specific network status thresholds and traffic status thresholds. When the thresholds are reached, it means that the preset traffic allocation conditions are met.
[0120] If the current network condition is not good and the data traffic is large, then only the target MQTT message data is transmitted in the data channel after the corresponding QoS level is adjusted. In other words, only the data that must be transmitted (that is, high QoS level data) is transmitted, and other data is not transmitted, giving priority to ensuring the data transmission of high-priority services. When the network conditions are restored, all the data that should be transmitted in the data channel after the QoS level is adjusted is restored to achieve intelligent scheduling.
[0121] (3) Using a network congestion prediction model to perform network congestion prediction on the network data of each data channel after the traffic distribution adjustment, and obtaining a network congestion prediction result;
[0122] Specifically, the network congestion prediction model (a network congestion prediction model based on machine learning, used to predict the time and location of possible network congestion, specifically the data channel) can identify the possibility of network congestion in advance and initiate a prevention mechanism when the risk of congestion is predicted.
[0123] (4) If the network congestion prediction result indicates that the target data channel is at risk of congestion at the target time, a prevention mechanism is initiated before the target time to prevent network congestion of the target data channel.
[0124] Specifically, the prevention mechanism includes: transferring a certain amount of MQTT message data of the target data channel through other data channels after traffic allocation adjustment, and reducing the sending frequency of MQTT message data corresponding to non-urgent data in the target data channel, thereby avoiding or alleviating network congestion.
[0125] In an optional embodiment of the present invention, the network data includes: flow status data, service request data, and network status data. A network congestion prediction model is used to perform network congestion prediction on the network data of each data channel after the flow distribution adjustment, specifically including the following steps:
[0126] (1) extracting target feature data from the network data, wherein the target feature data includes: data packet size, transmission frequency, and bandwidth utilization;
[0127] Specifically, these target feature data all carry timestamps.
[0128] (2) The network congestion prediction model is used to predict the network congestion of the target feature data of each data channel after the traffic distribution is adjusted.
[0129] In an optional embodiment of the present invention, the priority carried by the MQTT message is obtained by presetting the MQTT message according to the type of the MQTT message.
[0130] The high-precision and high-reliability vehicle-cloud communication method of the present invention can effectively solve the clock synchronization and data determinism problems in vehicle-cloud communication, and solve the high requirements for real-time performance and data transmission accuracy in application scenarios such as autonomous driving, intelligent AI large models, and cloud service virtualization through high-precision clock synchronization and deterministic communication technology. The core of the present invention is to integrate the improved lightweight message queue telemetry transmission protocol (MQTT) with high-precision clock synchronization technology to build a new type of vehicle-cloud communication system, thereby achieving microsecond-level synchronization accuracy in the vehicle and millisecond-level synchronization accuracy in the vehicle-cloud, as well as high determinism of data transmission.
[0131] The high-precision and high-reliability vehicle-to-cloud communication method of the present invention has the following advantages:
[0132] Achieved microsecond-level synchronization accuracy in the car and millisecond-level synchronization accuracy in the car-cloud: Through the dual-layer (in-car and car-cloud) clock synchronization mechanism, the accuracy of time synchronization is significantly improved, providing a basis for the realization of advanced driver assistance systems (ADAS), automatic driving and other functions. Compared with existing technologies, this progress makes it possible to accurately control vehicles and process high-speed data, greatly expanding the functional scope of Internet of Vehicles applications.
[0133] Improved performance: Ensures high certainty of data transmission: Through the optimized MQTT communication protocol and the network state adaptive adjustment mechanism, the reliability and certainty of data transmission in a complex network environment are ensured. Compared with traditional communication protocols, the present invention can effectively reduce data loss and delay, especially in a high-speed mobile environment, ensuring the timely transmission of key data, thereby significantly improving the overall performance of the system.
[0134] Improved convenience: Significant improvement in user experience: The technical advancement of the present invention is directly reflected in the user experience, for example, more accurate navigation services are provided through high-precision clock synchronization, and real-time cloud services are ensured through highly deterministic communication. These improvements increase the intelligence level of the vehicle, allowing users to enjoy a more convenient and safe driving experience.
[0135] The present invention includes the following points:
[0136] Dual-layer clock synchronization mechanism: It combines microsecond-level high-precision in-vehicle clock synchronization and millisecond-level vehicle-cloud clock synchronization. This mechanism is not only suitable for precise time alignment between components inside the vehicle, but also ensures the synchronization accuracy between the vehicle and remote cloud services, providing a basis for real-time data processing and decision-making.
[0137] Improved MQTT communication protocol: Based on the standard MQTT, data packet priority tags and message confirmation mechanisms are added. This improvement significantly improves the reliability and certainty of data transmission, especially in high-speed mobile environments and unstable network conditions.
[0138] Clock synchronization calibration method: ensure high-precision synchronization in long-term operation, especially considering the special needs in high-speed mobile environment.
[0139] Embodiment 2:
[0140] An embodiment of the present invention also provides a high-precision, high-reliability vehicle-cloud communication device, which is mainly used to execute the high-precision, high-reliability vehicle-cloud communication method provided in Embodiment 1 of the present invention. The high-precision, high-reliability vehicle-cloud communication device provided in the embodiment of the present invention is specifically introduced below.
[0141] Figure 2 is a schematic diagram of a high-precision and high-reliability vehicle-to-cloud communication device according to an embodiment of the present invention. Figure 2 As shown, the device mainly includes: a vehicle clock synchronization unit 10, a determination unit 20, and a vehicle-cloud clock synchronization calibration unit 30, wherein:
[0142] The vehicle clock synchronization unit is used to establish multiple data channels for communication between the vehicle and the cloud using the quic feature of the MQTT protocol after the vehicle is started, and receive GPS signals or external clock source signals to obtain the time reference therein, and then synchronize the time reference to the components to be synchronized in the vehicle, complete the vehicle clock synchronization, and send MQTT messages carrying timestamp information, wherein each data channel corresponds to a different priority;
[0143] A determination unit, configured to determine a corresponding target data channel in multiple data channels according to the priority carried by the MQTT message, and transmit the MQTT message through the target data channel, wherein when the QoS level of the MQTT message is a preset level, after the sending end sends the MQTT message, the sending end waits for the receiving end to reply with a confirmation message, and if the sending end does not receive the confirmation message within a preset time, the sending end automatically retransmits until the confirmation message is received or the number of retransmissions reaches a preset threshold;
[0144] The vehicle-cloud clock synchronization calibration unit is used to synchronize and calibrate the clocks between the vehicle and the cloud based on the timestamp information carried in the MQTT message.
[0145] In an embodiment of the present invention, a high-precision and high-reliability vehicle-cloud communication device is provided, which is applied to a vehicle-cloud communication system. The device includes: after the vehicle is started, multiple data channels for communication between the vehicle and the cloud are established using the quic feature of the MQTT protocol, and a GPS signal or an external clock source signal is received to obtain a time reference therein, and then the time reference is synchronized to a component to be synchronized in the vehicle, so as to complete the clock synchronization in the vehicle, so as to send an MQTT message carrying timestamp information, wherein each data channel corresponds to a different priority; according to the priority carried by the MQTT message, a corresponding target data channel is determined in the multiple data channels, and the MQTT message is transmitted through the target data channel, wherein when the QoS level of the MQTT message is a preset level, after the sending end sends the MQTT message, the sending end waits for the receiving end to reply with a confirmation message, and if the sending end does not receive the confirmation message within the preset time, the sending end automatically retransmits until the confirmation message is received or the number of retransmissions reaches a preset threshold; and the clock synchronization calibration between the vehicle and the cloud is performed according to the timestamp information carried by the MQTT message. From the above description, it can be seen that in the high-precision and high-reliability vehicle-cloud communication device of the present invention, by integrating the improved lightweight message queue telemetry transmission protocol (MQTT messages carry timestamp information) and high-precision clock synchronization technology, it is possible to achieve microsecond-level synchronization accuracy in the vehicle and millisecond-level synchronization accuracy in the vehicle-cloud. In addition, on the basis of the standard MQTT protocol, priority control (i.e., determining the corresponding target data channel in multiple data channels for the transmission of MQTT messages according to the priority carried by the MQTT message) and a message confirmation mechanism (i.e., confirming the reply of the message) are introduced to improve the communication reliability and the certainty of data transmission in a high-speed mobile environment, thereby alleviating the technical problem that the prior art cannot achieve high-precision synchronization of vehicle-cloud communications and ensure the certainty of data transmission based on the MQTT protocol.
[0146] Optionally, if the MQTT message is an MQTT message sent by the vehicle to the cloud, the timestamp information carried by the MQTT message includes: the time when the vehicle sends the MQTT message and the network transmission delay. The vehicle-cloud clock synchronization calibration unit is also used for: the cloud obtains the time when the vehicle sends the MQTT message and the time when the cloud receives the MQTT message in the MQTT message; the cloud calculates the actual clock deviation based on the time when the vehicle sends the MQTT message, the time when the cloud receives the MQTT message and the network transmission delay, and sends the actual clock deviation to the vehicle, wherein the network transmission delay is calculated by the vehicle based on the time when it sends the time synchronization request and the time when the vehicle receives the response, and the response is the response sent by the cloud to the vehicle based on the time synchronization request; the vehicle adjusts the vehicle's clock according to the actual clock deviation.
[0147] Optionally, if the MQTT message is a time synchronization request sent by the vehicle to the cloud at a preset period, the timestamp information carried by the MQTT message is the time when the vehicle sends the time synchronization request, and the vehicle-cloud clock synchronization calibration unit is also used for: the cloud obtains the time when the vehicle sends the time synchronization request and the time when the cloud receives the time synchronization request in the MQTT message, and sends a response to the time synchronization request carrying the time when the vehicle sends the time synchronization request, the time when the cloud receives the time synchronization request, and the time when the cloud sends the response to the vehicle; the vehicle obtains the time when the vehicle sends the time synchronization request, the time when the cloud receives the time synchronization request, the time when the cloud sends the response, and the time when the vehicle receives the response in the response, and calculates the clock deviation based on the time when the vehicle sends the time synchronization request, the time when the cloud receives the time synchronization request, the time when the cloud sends the response, and the time when the vehicle receives the response; the vehicle adjusts the vehicle's clock according to the clock deviation.
[0148] Optionally, the device is also used to: when transmitting MQTT messages, dynamically adjust the QoS level of the MQTT message data of each data channel based on the current network status of each data channel and the current data transmission demand, so as to preliminarily prevent network congestion of each data channel; adjust the traffic distribution of the MQTT message data in the data channels after each QoS level is adjusted based on the current network status of the data channels after each QoS level is adjusted and the traffic status of the data channels after each QoS level is adjusted, so as to prevent network congestion of the data channels after each QoS level is adjusted; use a network congestion prediction model to predict network congestion for the network data of each data channel after the traffic distribution is adjusted to obtain a network congestion prediction result; if the network congestion prediction result is that the target data channel is at risk of congestion at the target time, then start the prevention mechanism before the target time to further prevent network congestion of the target data channel.
[0149] Optionally, the prevention mechanism includes: transferring a certain amount of MQTT message data of the target data channel through other data channels after traffic allocation adjustment, and reducing the sending frequency of MQTT message data corresponding to non-urgent data in the target data channel.
[0150] Optionally, the network data includes: traffic status data, service request data, and network status data. The device is also used to: extract target feature data from the network data, wherein the target feature data includes: data packet size, sending frequency, and bandwidth utilization; and use a network congestion prediction model to perform network congestion prediction on the target feature data of each data channel after traffic distribution adjustment.
[0151] Optionally, the priority carried by the MQTT message is obtained by pre-setting the MQTT message according to the type of the MQTT message.
[0152] The device provided in the embodiment of the present invention has the same implementation principle and technical effects as those of the aforementioned method embodiment. For the sake of brief description, for matters not mentioned in the device embodiment, reference may be made to the corresponding contents in the aforementioned method embodiment.
[0153] like Figure 3 As shown, an electronic device 600 provided in an embodiment of the present application includes: a processor 601, a memory 602 and a bus, wherein the memory 602 stores machine-readable instructions executable by the processor 601. When the electronic device is running, the processor 601 communicates with the memory 602 through the bus, and the processor 601 executes the machine-readable instructions to perform the steps of the high-precision and high-reliability vehicle-to-cloud communication method as described above.
[0154] Specifically, the above-mentioned memory 602 and processor 601 can be general-purpose memory and processor, which are not specifically limited here. When the processor 601 runs the computer program stored in the memory 602, it can execute the above-mentioned high-precision and high-reliability vehicle-cloud communication method.
[0155] The processor 601 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 601. The above processor 601 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application can be directly embodied as a hardware decoding processor for execution, or a combination of hardware and software modules in the decoding processor for execution. The software module may be located in a storage medium mature in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 602, and the processor 601 reads the information in the memory 602 and completes the steps of the above method in combination with its hardware.
[0156] Corresponding to the above-mentioned high-precision and high-reliability vehicle-cloud communication method, an embodiment of the present application also provides a computer-readable storage medium, which stores machine-executable instructions. When the computer-executable instructions are called and executed by the processor, the computer-executable instructions prompt the processor to execute the steps of the above-mentioned high-precision and high-reliability vehicle-cloud communication method.
[0157] The high-precision and high-reliability vehicle-to-cloud communication device provided in the embodiment of the present application can be specific hardware on the device or software or firmware installed on the device. The implementation principle and technical effects of the device provided in the embodiment of the present application are the same as those of the aforementioned method embodiment. For the sake of brief description, for matters not mentioned in the device embodiment, reference can be made to the corresponding contents in the aforementioned method embodiment. Technical personnel in the relevant field can clearly understand that for the convenience and conciseness of description, the specific working processes of the systems, devices and units described above can all refer to the corresponding processes in the aforementioned method embodiment, and will not be repeated here.
[0158] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.
[0159] For another example, the flowchart and block diagram in the accompanying drawings show the possible architecture, function and operation of the device, method and computer program product according to multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of the code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or the flowchart, and the combination of the boxes in the block diagram and / or the flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0160] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0161] In addition, each functional unit in the embodiments provided in the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0162] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can essentially or partly contribute to the prior art or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for enabling an electronic device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the high-precision and high-reliability vehicle-cloud communication method described in each embodiment of the present application. The aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, and other media that can store program codes.
[0163] It should be noted that similar numbers and letters represent similar items in the following figures. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. In addition, the terms "first", "second", "third", etc. are only used to distinguish the description and are not to be understood as indicating or implying relative importance.
[0164] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present application, which are used to illustrate the technical solution of the present application, rather than to limit it. The protection scope of the present application is not limited thereto. Although the present application is described in detail with reference to the aforementioned embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solution recorded in the aforementioned embodiments within the technical scope disclosed in the present application, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solution deviate from the scope of the technical solution of the embodiment of the present application. They should all be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.
Claims
1. A high-precision and high-reliability vehicle-to-cloud communication method, characterized in that: Applied to a vehicle-to-cloud communication system, the method comprises: After the vehicle is started, the quic feature of the MQTT protocol is used to establish multiple data channels for communication between the vehicle and the cloud, and receive GPS signals or external clock source signals to obtain the time reference therein, and then synchronize the time reference to the component to be synchronized in the vehicle, complete the clock synchronization in the vehicle, and send an MQTT message carrying timestamp information, wherein each data channel corresponds to a different priority; Determine a corresponding target data channel in the multiple data channels according to the priority carried by the MQTT message, and transmit the MQTT message through the target data channel, wherein, when the QoS level of the MQTT message is a preset level, after the sending end sends the MQTT message, the sending end waits for the receiving end to reply with a confirmation message, and if the sending end does not receive the confirmation message within a preset time, the sending end automatically retransmits until the confirmation message is received or the number of retransmissions reaches a preset threshold; The clock synchronization calibration between the vehicle and the cloud is performed according to the timestamp information carried in the MQTT message.
2. The method according to claim 1, characterized in that If the MQTT message is an MQTT message sent by the vehicle to the cloud, the timestamp information carried by the MQTT message includes: the time when the vehicle sends the MQTT message and the network transmission delay, and the clock synchronization calibration between the vehicle and the cloud is performed according to the timestamp information carried by the MQTT message, including: The cloud obtains the time when the vehicle sends the MQTT message and the time when the cloud receives the MQTT message in the MQTT message; The cloud calculates the actual clock deviation according to the time when the vehicle sends the MQTT message, the time when the cloud receives the MQTT message and the network transmission delay, and sends the actual clock deviation to the vehicle, wherein the network transmission delay is calculated by the vehicle according to the time when it sends the time synchronization request and the time when the vehicle receives the response, and the response is the response sent by the cloud to the vehicle according to the time synchronization request; The vehicle adjusts a clock of the vehicle based on the actual clock deviation.
3. The method according to claim 1, characterized in that If the MQTT message is a time synchronization request sent by the vehicle to the cloud at a preset period, the timestamp information carried by the MQTT message is the time when the vehicle sends the time synchronization request, and the clock synchronization calibration between the vehicle and the cloud is performed according to the timestamp information carried by the MQTT message, including: The cloud obtains the time when the vehicle sends the time synchronization request and the time when the cloud receives the time synchronization request in the MQTT message, and sends a response to the time synchronization request carrying the time when the vehicle sends the time synchronization request, the time when the cloud receives the time synchronization request, and the time when the cloud sends the response to the vehicle; The vehicle obtains the time when the vehicle sends the time synchronization request, the time when the cloud receives the time synchronization request, the time when the cloud sends the response, and the time when the vehicle receives the response in the response, and calculates the clock deviation according to the time when the vehicle sends the time synchronization request, the time when the cloud receives the time synchronization request, the time when the cloud sends the response, and the time when the vehicle receives the response; The vehicle adjusts a clock of the vehicle based on the clock deviation.
4. The method according to claim 1, characterized in that: The method further comprises: When transmitting the MQTT message, dynamically adjust the QoS level of the MQTT message data of each data channel based on the acquired current network status and current data transmission demand of each data channel, so as to preliminarily prevent network congestion of each data channel; Adjusting the flow distribution of MQTT message data in each of the data channels after the QoS levels are adjusted based on the obtained current network conditions of each of the data channels after the QoS levels are adjusted and the flow conditions of each of the data channels after the QoS levels are adjusted, so as to prevent network congestion of each of the data channels after the QoS levels are adjusted; The network congestion prediction model is used to predict the network congestion of the network data of each data channel after the flow distribution adjustment, and the network congestion prediction result is obtained; If the network congestion prediction result indicates that the target data channel has a congestion risk at the target time, a prevention mechanism is started before the target time to prevent network congestion of the target data channel.
5. The method according to claim 4, characterized in that The prevention mechanism includes: transferring a certain amount of MQTT message data of the target data channel through other data channels after traffic allocation adjustment, and reducing the sending frequency of MQTT message data corresponding to non-urgent data in the target data channel.
6. The method according to claim 4, characterized in that The network data includes: flow status data, service request data, and network status data. The network congestion prediction model is used to perform network congestion prediction on the network data of each data channel after the flow distribution adjustment, including: Extracting target characteristic data from the network data, wherein the target characteristic data includes: data packet size, transmission frequency, and bandwidth utilization; A network congestion prediction model is used to perform network congestion prediction on the target characteristic data of each data channel after the flow distribution adjustment.
7. The method according to claim 1, characterized in that The priority carried by the MQTT message is obtained by presetting the MQTT message according to the type of the MQTT message.
8. A high-precision, high-reliability vehicle-to-cloud communication device, characterized in that: Applied to a vehicle-to-cloud communication system, the device comprises: The vehicle clock synchronization unit is used to establish multiple data channels for communication between the vehicle and the cloud using the quic feature of the MQTT protocol after the vehicle is started, and receive GPS signals or external clock source signals to obtain the time reference therein, and then synchronize the time reference to the component to be synchronized in the vehicle, complete the vehicle clock synchronization, and send an MQTT message carrying timestamp information, wherein each data channel corresponds to a different priority; A determination unit, configured to determine a corresponding target data channel in the plurality of data channels according to the priority level carried by the MQTT message, and transmit the MQTT message through the target data channel, wherein when the QoS level of the MQTT message is a preset level, after the sending end sends the MQTT message, the sending end waits for the receiving end to reply with a confirmation message, and if the sending end does not receive the confirmation message within a preset time, the sending end automatically retransmits until the confirmation message is received or the number of retransmissions reaches a preset threshold; The vehicle-cloud clock synchronization calibration unit is used to perform clock synchronization calibration between the vehicle and the cloud according to the timestamp information carried by the MQTT message.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores machine-executable instructions. When the machine-executable instructions are called and executed by a processor, the machine-executable instructions prompt the processor to execute the method according to any one of claims 1 to 7.
Citation Information
Cited By
Vehicle-mounted time synchronization method and device
CN120602030A
