Vehicle cloud communication method and device, storage medium and electronic equipment

By using a data dictionary between the on-board terminal and the cloud server for packet matching and compression, the problems of network congestion and resource waste in traditional vehicle cloud communication are solved, and efficient data transmission and decompression are achieved.

CN119854327APending Publication Date: 2025-04-18CHINA AUTOMOTIVE INNOVATION CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411812706.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-10
Publication Date
2025-04-18

AI Technical Summary

Technical Problem

In the traditional vehicle cloud communication method, directly sending all CAN messages leads to network congestion and resource waste.

Method used

By using a data dictionary to match and compress messages in the on-board terminal, only matching target messages are sent, and version number matching and decompression are performed in the cloud server to ensure the effectiveness of data transmission.

Benefits of technology

It reduces unnecessary data transmission, avoids redundant transmission of full CAN messages, improves network transmission efficiency, effectively alleviates network congestion problems, and avoids decompression errors or data loss caused by inconsistent data dictionary.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119854327A_ABST
    Figure CN119854327A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a vehicle cloud communication method and device, a storage medium and electronic equipment, and the method comprises the steps: matching a first identifier corresponding to each message with a plurality of second identifiers stored in a preset first data dictionary; determining a message, of which the corresponding first identifier has a matched second identifier, in the plurality of messages as a target message, and obtaining a group of target messages; generating a data compression packet according to the group of target messages; the data package corresponds to a first version number; and sending the data compression package to a cloud server to instruct the cloud server to match the first version number of the data compression package with a pre-stored second version number, and decompressing the data compression package under the condition that the first version number is matched with the second version number to obtain a group of target messages. The problems of network congestion and resource waste caused by directly sending all CAN messages in related technologies are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of vehicle-to-cloud communication technology, and specifically, to a vehicle-to-cloud communication method, device, storage medium, and electronic device. Background Art

[0002] With the development of automotive electronic systems, the CAN bus, as the main communication medium between various control units inside the car, generates huge amounts of data and frequently transmits them to the cloud, which becomes a challenge. Traditional data transmission methods usually use the method of directly sending all CAN messages, which easily causes network congestion and waste of resources. Summary of the invention

[0003] The embodiments of the present application provide a vehicle-cloud communication method, device, storage medium and electronic device to at least solve the problem in the related art of directly sending all CAN messages leading to network congestion and waste of resources.

[0004] According to one aspect of an embodiment of the present application, a vehicle-cloud communication method is provided, which is applied to a vehicle-mounted terminal, and includes: obtaining multiple messages to be sent; each message in the multiple messages corresponds to a first identifier; matching the first identifier corresponding to each message with multiple second identifiers stored in a preset first data dictionary; each of the multiple second identifiers is used to identify a message designated for transmission to a cloud server; determining the message in the multiple messages whose corresponding first identifier has a matching second identifier as a target message to obtain a group of target messages; generating a data compression package based on the group of target messages; the data compression package corresponds to a first version number, and the first version number is used to identify the first data dictionary; sending the data compression package to a cloud server to instruct the cloud server to match the first version number of the data compression package with a pre-stored second version number, and when the first version number matches the second version number, decompressing the data compression package to obtain the group of target messages; the second version number is used to identify the second data dictionary.

[0005] According to another aspect of an embodiment of the present application, a vehicle-cloud communication method is provided, which is applied to a cloud server, including: receiving a data compression package sent by a vehicle-mounted terminal; the data compression package is a data packet obtained by compressing a group of target messages pre-specified for transmission; each target message in the group of target messages corresponds to a first identifier; each target message refers to a message whose corresponding first identifier has a matching second identifier in a first data dictionary; a plurality of second identifiers are stored in the first data dictionary, and each of the plurality of second identifiers is used to identify a message designated for transmission to the cloud server; the data compression package corresponds to a first version number, and the first version number is used to identify the first data dictionary; when the first version number of the data compression package matches the pre-stored second version number, the data compression package is decompressed to obtain the group of target messages; the second version number is used to identify the second data dictionary.

[0006] According to another aspect of the embodiment of the present application, a vehicle-cloud communication device is provided, which is applied to a vehicle-mounted terminal, and includes: a message acquisition module, which is used to acquire multiple messages to be sent; each message in the multiple messages corresponds to a first identifier; a message matching module, which is used to match the first identifier corresponding to each message with multiple second identifiers stored in a preset first data dictionary; each of the multiple second identifiers is used to identify a message to be transmitted to a cloud server; a message designation module, which is used to determine the message in the multiple messages, in which the corresponding first identifier has a matching second identifier, as a target message, to obtain a group of target messages; a message compression module, which is used to generate a data compression package according to the group of target messages; the data compression package corresponds to a first version number, and the first version number is used to identify the first data dictionary; a message transmission module, which is used to send the data compression package to the cloud server to instruct the cloud server to match the first version number of the data compression package with the pre-stored second version number, and when the first version number matches the second version number, decompress the data compression package to obtain the group of target messages; the second version number is used to identify the second data dictionary.

[0007] According to another aspect of an embodiment of the present application, a vehicle-cloud communication device is provided, which is applied to a cloud server, including: a message receiving module, used to receive a data compression package sent by a vehicle-mounted terminal; the data compression package is a data packet obtained by compressing a group of target messages pre-specified for transmission; each target message in the group of target messages corresponds to a first identifier; each target message refers to a message whose corresponding first identifier has a matching second identifier in a first data dictionary; a plurality of second identifiers are stored in the first data dictionary, and each of the plurality of second identifiers is used to identify a message designated for transmission to the cloud server; the data compression package corresponds to a first version number, and the first version number is used to identify the first data dictionary; a message parsing module, used to decompress the data compression package to obtain the group of target messages when the first version number of the data compression package matches the pre-stored second version number; the second version number is used to identify the second data dictionary.

[0008] According to another aspect of an embodiment of the present application, a computer-readable storage medium is further provided, in which a computer program is stored, wherein the computer program is configured to execute the above-mentioned vehicle-cloud communication method when running.

[0009] According to another aspect of an embodiment of the present application, an electronic device is also provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the vehicle-cloud communication method through the computer program.

[0010] According to another aspect of the embodiments of the present application, a computer program product is also provided, including a computer program, which, when executed by a processor, implements the steps in any of the above-mentioned vehicle-to-cloud communication method embodiments.

[0011] Through the embodiment of the present application, the first data dictionary stored in the vehicle terminal stores multiple second identifiers for identifying the designated transmission to the cloud server. The first identifier corresponding to each message is matched with the second identifier in the first data dictionary, and the target message for the designated transmission can be screened out. Only the target message that matches successfully will be packaged into a data compression package and sent to the cloud server, which reduces the amount of unnecessary data transmission, avoids the redundant sending of the full CAN message, improves the efficiency of network transmission, and effectively alleviates the problem of network congestion. To further ensure that the message transmitted to the cloud server is the target message for the designated transmission, the packaged and sent data compression package corresponds to a first version number for identifying the first data dictionary. By matching the first version number with the second version number pre-stored in the cloud server for identifying the second data dictionary, it can be ensured that the data compression package is compressed based on a data dictionary recognized by both parties (that is, the first data dictionary and the second data dictionary are consistent in content), avoiding decompression errors or data loss caused by inconsistent data dictionaries, thereby avoiding the problem of resource waste caused by re-transmission, and solving the network congestion and resource waste caused by directly sending all CAN messages in the related art. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] Figure 1 It is a hardware structure block diagram of an optional vehicle-to-cloud communication method of an embodiment of the present application;

[0013] Figure 2 is a flow chart of an optional vehicle-cloud communication method according to an embodiment of the present application;

[0014] Figure 3 is a structural diagram of an optional data compression package according to an embodiment of the present application;

[0015] Figure 4 is a structural diagram of an optional target message according to an embodiment of the present application;

[0016] Figure 5 is a data structure diagram of an optional reassembled message according to an embodiment of the present application;

[0017] Figure 6 is a flowchart of another optional vehicle-cloud communication method according to an embodiment of the present application;

[0018] Figure 7 is a structural block diagram of an optional vehicle-to-cloud communication device according to an embodiment of the present application;

[0019] Figure 8 is a structural block diagram of another optional vehicle-to-cloud communication device according to an embodiment of the present application;

[0020] Fig. 9It is a structural block diagram of an optional electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0021] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0022] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application 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 interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0023] According to one aspect of an embodiment of the present application, a vehicle-to-cloud communication method is provided. Optionally, in this embodiment, the vehicle-to-cloud communication method can be applied to Figure 1 In the hardware environment composed of the vehicle terminal 102 and the cloud server 104 shown in FIG. Figure 1 As shown, the cloud server 104 is connected to the vehicle-mounted terminal 102 via a network, and can be used to provide services (such as application services, etc.) for the terminal or a client installed on the terminal. A database can be set up on the server or independently of the server to provide data storage services for the cloud server 104. Cloud computing and / or edge computing services can be configured on the server or independently of the server to provide data computing services for the cloud server 104.

[0024] The above network may include but is not limited to at least one of the following: wired network, wireless network. The above wired network may include but is not limited to at least one of the following: wide area network, metropolitan area network, local area network, and the above wireless network may include but is not limited to at least one of the following: WIFI, Bluetooth.

[0025] The vehicle-to-cloud communication method of the embodiment of the present application can be executed by the vehicle-mounted terminal 102, or can be executed by the cloud server 104 and the vehicle-mounted terminal 102 together. Taking the vehicle-to-cloud communication method of the embodiment executed by the vehicle-mounted terminal 102 as an example, Figure 2 is a flow chart of an optional vehicle-to-cloud communication method according to an embodiment of the present application, such as Figure 2 As shown, the process of the method may include the following steps:

[0026] Step S202, obtaining a plurality of messages to be sent; each of the plurality of messages corresponds to a first identifier.

[0027] The first identifier refers to a unique identification code of a CAN message sent by the vehicle-mounted terminal. For example, the first identifier is a CAN message ID, which is used to distinguish different CAN messages.

[0028] Step S204, matching the first identifier corresponding to each message with a plurality of second identifiers stored in a preset first data dictionary; each of the plurality of second identifiers is used to identify a message designated for transmission to a cloud server.

[0029] The first data dictionary refers to a data dictionary stored in the vehicle terminal, which contains multiple second identifiers for identifying which CAN messages need to be transmitted to the cloud server. Since not all CAN messages need to be transmitted to the cloud, the first data dictionary only sets the corresponding second identifier for the first identifier of the CAN message that needs to be transmitted.

[0030] The second identifier refers to an identifier stored in the first data dictionary, which is used to identify the message to be transmitted to the cloud server, and corresponds to the first identifier of the vehicle terminal CAN message. For example, the second identifier can be a dictionary ID.

[0031] Step S206: among the multiple messages, the messages whose corresponding first identifiers have matching second identifiers are determined as target messages, thereby obtaining a group of target messages.

[0032] Among them, the target message refers to a message whose first identifier matches the second identifier in the first data dictionary among multiple CAN messages to be sent by the vehicle terminal, that is, the target message is a message designated to be transmitted to the cloud server.

[0033] Optionally, the vehicle-mounted terminal collects CAN messages from various control units inside the car, each CAN message contains a unique first identifier (such as a CAN message ID), reads the first data dictionary, and checks whether the first identifier of each CAN message matches the second identifier (such as a dictionary ID) in the first data dictionary. If they do not match, they are skipped (i.e., not sent). If they match, it means that the message needs to be transmitted to the cloud server, and the message with the corresponding first identifier and a matching second identifier is determined as the target message. The vehicle-mounted terminal collects all successfully matched target messages to form a group of target messages, takes out the message ID of each target message and corresponds it to the dictionary ID, and simultaneously takes out the data length and data content for packaging.

[0034] Step S208, generating a data compression package according to a group of target messages; the data compression package corresponds to a first version number, and the first version number is used to identify a first data dictionary.

[0035] The data compression packet refers to a data packet formed by compressing a group of target messages, which is used to reduce the amount of transmitted data and improve transmission efficiency.

[0036] The first version number is used to identify the version of the first data dictionary of the vehicle terminal to ensure that the cloud server can correctly parse the data compression package. Figure 3 is a structural diagram of a data compression package in an embodiment, such as Figure 3 As shown, the data compression package includes two parts: header and body. The header part includes the vehicle model, VIN code of the vehicle and the first version number of the first data dictionary used, and the body is a collection of a group of data.

[0037] Optionally, the vehicle-mounted terminal sorts, reorganizes and compresses a group of target messages to form a data compression package. When generating the data compression package, the first version number of the first data dictionary is embedded in the header of the data compression package.

[0038] Step S210, sending the data compression package to the cloud server to instruct the cloud server to match the first version number of the data compression package with the pre-stored second version number, and when the first version number matches the second version number, decompress the data compression package to obtain a set of target messages; the second version number is used to identify the second data dictionary.

[0039] Among them, the second data dictionary refers to the data dictionary stored in the cloud, which is the same as the first data dictionary of the vehicle terminal and contains multiple third identifiers (such as dictionary IDs) used to instruct the cloud server to receive and parse specified messages sent from the vehicle terminal.

[0040] The second version number is used to identify the version of the second data dictionary of the cloud server to ensure the consistency of the data dictionaries stored in the vehicle terminal and the cloud server. When the vehicle leaves the factory, a first data dictionary of the CAN message is written into the vehicle terminal. The first data dictionary mainly sets a second identifier (such as a dictionary ID) for the first identifier (such as an ID) of the CAN message. The cloud server also needs to retain the second data dictionary that is the same as the first data dictionary. At the same time, the first data dictionary corresponds to the first version number, and the second data dictionary corresponds to the second version number. The version number of the data dictionary needs to be saved on both ends of the vehicle and the cloud, and the first version number saved by the vehicle terminal matches or is consistent with the second version number saved by the cloud server.

[0041] Optionally, the vehicle-mounted terminal sends the data compression package to the cloud server via the network. After receiving the data compression package, the cloud server reads the first version number in the header of the data compression package. The cloud server compares the first version number with the second version number stored in itself to confirm the consistency of the data dictionary. If the first version number matches the second version number, the cloud server decompresses the data compression package using the same decompression algorithm as the vehicle-mounted terminal. After decompression, the cloud server obtains a set of target messages and restores them to the original CAN messages based on the second data dictionary.

[0042] Through the above steps S202 to S210, the first data dictionary stored in the vehicle terminal stores multiple second identifiers for identifying the designated transmission to the cloud server. The first identifier corresponding to each message is matched with the second identifier in the first data dictionary, and the target message for the designated transmission can be screened out. Only the target message that matches successfully will be packaged into a data compression package and sent to the cloud server, which reduces unnecessary data transmission, avoids redundant transmission of the full CAN message, improves the efficiency of network transmission, and effectively alleviates the network congestion problem; to further ensure that the message transmitted to the cloud server is the target message for the designated transmission, the packaged and sent data compression package corresponds to a first version number for identifying the first data dictionary. By matching the first version number with the second version number for identifying the second data dictionary pre-stored in the cloud server, it can be ensured that the data compression package is compressed based on a data dictionary recognized by both parties (that is, the first data dictionary and the second data dictionary are consistent in content), avoiding decompression errors or data loss caused by inconsistent data dictionaries, thereby avoiding the problem of resource waste caused by re-transmission, and solving the network congestion and resource waste caused by directly sending all CAN messages in the related art.

[0043] In an exemplary embodiment, before generating a data compression package according to a set of target messages, the vehicle-to-cloud communication method further includes:

[0044] Determine whether a group of target messages meets preset compression conditions; the preset compression conditions are conditions that allow message compression based on specified message parameters; when a group of target messages meets the preset compression conditions, trigger the execution of the step of generating a data compression package based on a group of target messages.

[0045] The specified message parameters refer to parameters used to determine whether a group of target messages meet the compression conditions, such as message size, message type, message content, etc.

[0046] The preset compression condition refers to a condition set based on the specified message parameters. When a group of target messages meets the preset compression condition, it is considered that the group of target messages can be compressed. For example, the preset compression condition can be that the message size of a group of target messages exceeds a certain value, the message type is a specific type, etc.

[0047] Optionally, the vehicle-mounted terminal determines which message parameters (such as message size, message type, etc.) will be used as the basis for judging the compression conditions based on business needs, sets specific preset compression conditions, obtains a group of target messages, counts the specific parameter values ​​of specified message parameters in a group of target messages, compares the specific parameter value domain with the preset compression conditions, and when a group of target messages meets the preset compression conditions, generates a data compression package based on the group of target messages.

[0048] Through this embodiment, it is determined whether a group of target messages meets the preset compression conditions. Only when a group of target messages meets the preset compression conditions, the step of generating a data compression package based on a group of target messages is triggered. The preset compression conditions are used to determine when to compress a group of target messages, thereby avoiding blind compression or missing compression and ensuring the accuracy and consistency of data processing.

[0049] In an exemplary embodiment, determining whether a group of target messages meets a preset compression condition includes:

[0050] Determine a group of target messages and parameter values ​​corresponding to the specified message parameters to obtain the target parameter values; the specified message parameters include at least one of the following: waiting time, message size; when the target parameter value is greater than or equal to a preset parameter threshold, determine that a group of target messages meet a preset compression condition; the preset compression condition is that the parameter value of the specified message parameter is greater than or equal to the preset parameter threshold.

[0051] In this embodiment, the specified message parameters include the waiting time and message size of a group of target messages. The waiting time of a group of target messages refers to the length of time from obtaining the first target message to being compressed; the message size of a group of target messages refers to the sum of the message sizes of each target message in a group of target messages.

[0052] The target parameter value refers to the actual value of a set of target messages corresponding to the specified message parameters.

[0053] The preset parameter threshold is a threshold used for comparison with the target parameter value. When the target parameter value is greater than or equal to the preset parameter threshold, it is considered that a group of target messages meets the preset compression condition. In this embodiment, the preset compression condition refers to the condition that the target parameter value of a specified message parameter of a group of target messages is greater than or equal to the preset parameter threshold; when a group of target messages meets the preset compression condition, the group of target messages can be compressed.

[0054] Optionally, the vehicle terminal sets preset parameter thresholds corresponding to the waiting time and message size of a group of target messages, and determines the corresponding target parameter value according to the waiting time or message size of a group of target messages. When the target parameter value corresponding to the waiting time or message size of a group of target messages is greater than or equal to the corresponding preset parameter threshold, the vehicle terminal determines that a group of target messages meets the preset compression condition, and can compress the group of messages.

[0055] Through this embodiment, by setting the waiting time, the messages received within a period of time can be accumulated. When the accumulated number of messages or the waiting time reaches the preset conditions, the messages are compressed and processed. Multiple small messages can be merged into a large compressed message for sending, thereby reducing the number of messages in the network and reducing the risk of network congestion. By setting the message size as the basis for judging the timing of starting compression, it can be ensured that the message is compressed only when the size reaches a certain threshold, and unnecessary compression operations on messages that are too small can be avoided, thereby saving processing time and resources.

[0056] In an exemplary embodiment, target messages within a group of target messages are sorted according to a preset rule; each target message in the group of target messages is divided into a plurality of byte segments according to a preset byte length.

[0057] The preset rule refers to a predefined rule for guiding the ordering of target messages within a group of target messages. For example, the preset rule may be based on factors such as the data length, priority, timestamp, content type, etc. of the message.

[0058] The preset byte length refers to a predefined byte length used to divide the target message.

[0059] A byte segment refers to a data segment containing a certain number of bytes obtained by dividing the target message according to a preset byte length.

[0060] In some embodiments, generating a data compression package according to a group of target messages includes:

[0061] Determine a group of target byte segments corresponding to each target message; the group of target byte segments corresponding to each target message includes byte segments that have changed relative to a previous target message of each target message among multiple byte segments of each target message; generate a data compression package according to the group of target byte segments corresponding to each target message.

[0062] The target byte segment refers to a byte segment in each target message that has changed relative to the previous target message.

[0063] Optionally, the vehicle terminal obtains a determined set of target messages, sorts the target messages according to preset rules, divides each target message according to a preset byte length (such as 8 bytes, etc.), obtains a byte segment sequence (including multiple byte segments) corresponding to each target message, reads the byte segment sequence corresponding to the first target message, and regards all of them as initial byte segments and adds them to the data compression package. The target messages other than the first target message are taken as the current target messages, and the byte segment sequence corresponding to the current target message is read. The byte segment sequence of the current target message is traversed, and for each byte segment, it is determined whether it has changed relative to the corresponding byte segment in the previous target message. If it has changed, the byte segment is regarded as the target byte segment and added to the data compression package. If it has not changed, the byte segment is skipped. After processing all the target messages in a set of target messages, the final data compression package is obtained.

[0064] Through this embodiment, the target message is divided into multiple byte segments, which can more finely control the transmission of data. When sending data, only the byte segments that have changed in the target message specified for transmission are transmitted, rather than the entire message. This can further reduce the amount of data transmission, significantly reduce the redundancy of data transmission, and reduce network congestion.

[0065] In an exemplary embodiment, the target messages other than the first target message in a group of target messages are respectively used as current target messages to perform the following determination operations to obtain a group of target byte segments corresponding to each target message:

[0066] 1. Perform an XOR process on each byte segment of the current target message and the corresponding byte segment in the previous target message of the current target message to obtain an XOR result corresponding to each byte segment of the current target message;

[0067] The XOR process is a binary operation that performs an XOR operation on each bit of two binary numbers (0 for the same bits and 1 for the different bits). In this embodiment, the XOR process is used to compare whether the data of two byte segments are the same.

[0068] The XOR result refers to the result obtained by performing XOR processing on each byte segment of the current target message and the previous target message of the current target message. If the two target messages are exactly the same, the XOR result is all 0; if the two target messages are different, the XOR result is not all 0.

[0069] Alternatively, if Figure 3 As shown, the vehicle terminal regards all the byte segment sequences corresponding to the first target message (i.e., the first-ranked target message) as initial byte segments and adds them to the data compression package. Starting from the second target message, each target message is used as the current target message to perform the following operations: the current target message is divided into Bi (0<=i<=8, the maximum message size is 8 bytes) byte segments according to the preset byte length, any byte segment is used as the current byte segment in the current target message, the current byte segment in the current target message is XORed with the corresponding byte segment in the previous target message of the current target message, and the XOR result corresponding to the current byte segment is obtained, and the XOR result corresponding to each byte segment in the current target message is collected to obtain the XOR result corresponding to each byte segment of the current target message.

[0070] 2. Determine the byte segment in the current target message whose data is represented by the XOR result as the target byte segment corresponding to the current target message, and obtain a group of target byte segments corresponding to the current target message.

[0071] Optionally, the vehicle terminal traverses all byte segments of the current target message and their corresponding XOR results. If the XOR result representation data of the current byte segment has changed (i.e., the XOR result is not all 0), the vehicle terminal finds Bi that is not 0 after XOR, records the non-0 subscript i of this data (this subscript is used to record the change of the i-th byte segment), and determines the byte segment whose XOR result is not 0 as the target byte segment corresponding to the current target message. Among the multiple byte segments of the current target message, all byte segments determined as target byte segments are determined as a group of target byte segments corresponding to the current target message. If the XOR result representation data of the current byte segment has not changed, the current byte segment is discarded.

[0072] In some embodiments, if the XOR result of each byte segment of the current target message and all byte segments in the previous target message of the current target message is 0, the current target message is directly discarded without being added to the data compression package.

[0073] For example, the first target message (reference message) is: A|B (this embodiment uses "|" to separate two byte segments); the second target message (current target message) is: A|B'. For the second target message, first select the first byte segment A, and perform XOR processing on the current byte segment A and the corresponding byte segment A in the first target message. The result of the XOR processing is: 0, indicating that the data of the two byte segments has not changed. Next, select the second byte segment B' of the second target message, and perform XOR processing on the current byte segment B' and the corresponding byte segment B in the first target message. The result of the XOR processing is: 1, indicating that the data of the two byte segments has changed (the second byte has changed). According to the XOR result, it can be determined that the byte segment that has changed in the current target message is the second byte segment B'. Therefore, the set of target byte segments corresponding to the current target message is the second byte segment B'.

[0074] Through this embodiment, by performing XOR processing on each byte segment of the current target message and the corresponding byte segment in the previous target message, it is possible to effectively identify which data has changed. If the XOR result is 0, it means that the data of the two byte segments are the same and have not changed; if the XOR result is not 0, it means that the data has changed. Therefore, when sending data, only the byte segments that have changed need to be transmitted, without transmitting the entire message, which can significantly reduce the amount of data transmission, thereby reducing the network load.

[0075] In an exemplary embodiment, the target messages within a group of target messages are sorted in ascending order of data length.

[0076] In the sorting process, if the data lengths of two target messages are the same, the two target messages are sorted according to their first identifiers, or they may be sorted according to their second identifiers corresponding to their first identifiers.

[0077] In some embodiments, before performing XOR processing on each byte segment of the current target message and the corresponding byte segment in the previous target message of the current target message, the vehicle-cloud communication method further includes:

[0078] When the data length of the current target message is different from the data length of the previous target message of the current target message, zeros are padded at the starting position of the previous target message of the current target message so that the data length of the previous target message of the current target message after padding is consistent with the data length of the current target message.

[0079] Among them, before performing XOR processing, there is a situation where the data length of the current target message is different from the data length of the previous target message of the current target message. In this case, it is necessary to padded the target message with shorter data length (since the target messages in a group of target messages are sorted in ascending order according to the data length, the target message with shorter data length refers to the target message sorted in front) so that the data length of the previous target message of the current target message after filling is consistent with the data length of the current target message.

[0080] Optionally, the vehicle-mounted terminal uses a sorting algorithm (such as bubble sort, quick sort, etc.) to sort the target messages according to the data length of each target message to ensure that the data length is in order from small to large. The vehicle-mounted terminal traverses a group of sorted target messages, starting from the second target message (because the first target message does not have a previous target message to compare with), and for the current target message, checks whether its data length is different from the data length of the previous target message. If the same, skip the current loop iteration and continue to check the next target message. If different, fill zero bytes after the starting position of the previous target message of the current target message until the data length of the previous target message is consistent with the data length of the current target message, and then executes the step of XORing each byte segment of the current target message with the corresponding byte segment in the previous target message of the current target message.

[0081] Through this embodiment, the XOR processing requires that the two compared messages have the same length, otherwise an effective byte segment comparison cannot be performed. Therefore, the target messages in a group of target messages are sorted in ascending order of data length, and when the current target message and the previous target message have different data lengths, the starting position of the previous target message is filled with zeros to make its length consistent with the current target message, thereby ensuring the smooth progress of subsequent XOR processing steps.

[0082] In an exemplary embodiment, generating a data compression package according to a set of target byte segments corresponding to each target message includes:

[0083] 1. Generate a reassembled message corresponding to each target message according to a group of target byte segments corresponding to each target message and a preset byte corresponding to each target message; the preset byte corresponding to each target message is used to record the XOR result between each byte segment of each target message and the corresponding byte segment in the previous target message of each target message.

[0084] Among them, the data length of the preset bytes corresponding to each target message may be consistent or inconsistent, depending on the data length of each target message. For example, the data length of the preset bytes corresponding to each target message is L0 / 8, where L0 represents the data length of each target message. If the data length of each target message is consistent, the data length of the preset bytes corresponding to each target message is consistent, otherwise, they are inconsistent. Starting from the left side of the preset byte corresponding to the current target message, the i-th bit is used to record the XOR result of the i-th byte segment of the current target message and the i-th byte segment of the previous target message. If the XOR result is not 0, it is recorded as 1, and if the XOR result is 0, it is recorded as 0.

[0085] Reassembled message refers to a new message generated based on the target byte segment and preset bytes of the target message. For example, Figure 4 is a structural diagram of a target message in an embodiment, such as Figure 4 As shown, the target message includes a second identifier (such as a dictionary ID) corresponding to the first identifier of the target message, an original / reorganized identifier, a data length, and data content. In order to distinguish the target message from the reorganized message, a 1-bit original / reorganized identifier is added after the second identifier (such as a dictionary ID) of the target message and the reorganized message, 0 represents the target message, and 1 represents the reorganized message; in the data structure of the target message, the original / reorganized identifier is fixed to 0. The data length of the second identifier is 16 bits. The data length of the target message is 4 bits, which complies with the length regulations of the DLC in the CAN message, as shown in Table 1:

[0086] Table 1

[0087] Binary Value Data length (Byte) 0000 0 0001 1 0010 2 0011 3 0100 4

[0088] Table 1 (continued)

[0089] Binary Value Data length (Byte) 0101 5 0110 6 0111 7 1000 8 1001 12 1010 16 1011 20 1100 24 1101 32 1110 48 1111 64

[0090] The data length and data content of the reassembled message are different from the target message corresponding to the reassembled message. Figure 5 FIG. 4 is a data structure diagram of a reassembled message in an embodiment, such as Figure 5As shown, the reassembled message includes a preset byte in addition to the second identifier corresponding to the first identifier of the original target message (such as dictionary ID, data length is 16 bits), the original / reassembled identifier (data length is 1 bit), the original data length (4 bits, also complying with the length provisions of DLC in the CAN message) and the data content, and the data length of the preset byte corresponding to each target message is L0 / 8, where L0 represents the data length of each target message. In addition, the data content in the target message and the reassembled message is also different, where the data content in the target message includes each byte segment into which the target message is divided, and the data content in the reassembled message includes a group of target byte segments corresponding to the target message.

[0091] Optionally, the vehicle terminal traverses each target message to obtain a set of target byte segments corresponding thereto. For each target message, the vehicle terminal calculates the XOR result between each byte segment in each target message and the corresponding byte segment in the previous target message, and uses a preset byte to record the XOR result corresponding to each byte segment in each target message, combines the target byte segment in each target message with the preset byte, and generates a reassembled message corresponding to each target message.

[0092] 2. According to the reassembled message corresponding to each target message, a group of target messages is divided into a group of first target messages and a group of second target messages; a first target message in a group of first target messages is a target message in a group of target messages, and the data length of the corresponding reassembled message is smaller than the data length of the target message itself; a second target message in a group of second target messages is a target message in a group of target messages, and the data length of the corresponding reassembled message is greater than or equal to the data length of the target message itself.

[0093] Optionally, the on-board terminal traverses a group of target messages and their corresponding reassembled messages, compares the data length of each target message with its corresponding reassembled message, classifies the target messages whose corresponding reassembled message data length is smaller than their own data length as first target messages, and groups them into a group of first target messages, classifies the target messages whose corresponding reassembled message data length is greater than or equal to their own data length as second target messages, and groups them into a group of second target messages.

[0094] 3. According to the order of the target messages in a group of target messages, data compression is performed on a group of reassembled messages corresponding to a group of first target messages and a group of second target messages to obtain a data compression package.

[0095] Among them, for the first target message, during the data compression process, the reassembled message corresponding to the first target message is added to the data compression package, and for the second target message, during the data compression process, the second target message is added to the data compression package. Therefore, Figure 3As shown, in the data compression package, the first packet message is the first target message in a group of target messages, and each subsequent packet message may be the second target message or a reassembled message. It can be understood that the packet messages in the data compression package include a group of target messages (such as the first target message and a group of second target messages) and a group of reassembled messages.

[0096] Optionally, the vehicle-mounted terminal sequentially extracts a group of reassembled messages and a group of second target messages corresponding to a group of first target messages according to the order of the target messages in a group of target messages, and performs data compression processing to obtain a data compression package.

[0097] For example, compare the data length L1 (including the preset byte length L0 / 8) of the reassembled message with the data length L0 of the corresponding target message. If L1<L0, the target message with L1<L0 is divided into a first target message, and the reassembled message corresponding to the first target message is added to the data compression package; if L1>=L0, the target message with L1>=L0 is divided into a second target message, and the second target message is added to the data compression package.

[0098] Through this embodiment, a corresponding reassembled message is generated for each target message, and according to the size relationship between the data length of the reassembled message and the data length of the corresponding target message, the target message is divided into a group of first target messages (target messages whose data length of the reassembled message is less than their own data length) and a group of second target messages (target messages whose data length of the reassembled message is greater than or equal to their own data length) according to the data length of the reassembled message. For the first target message, since its reassembled message is shorter, the reassembled message is used to replace the corresponding first target message during the data compression process. For the second target message, since its data length is less than the corresponding reassembled message, the second target message is used instead of the reassembled message for data compression during the data compression process. This classification processing and different compression strategies corresponding to different categories can reduce the amount of data transmitted in the network, improve data transmission efficiency and network performance, and reduce resource waste.

[0099] In an exemplary embodiment, the vehicle-to-cloud communication method in this embodiment is executed by the cloud server 104 as an example, wherein the contents of the vehicle-to-cloud communication method executed by the vehicle-mounted terminal have been described and will not be repeated here. Figure 6 is a flow chart of an optional vehicle-to-cloud communication method according to an embodiment of the present application, such as Figure 6 As shown, the process of the method may include the following steps:

[0100] Step S602, receiving a data compression package sent by the vehicle-mounted terminal; the data compression package is a data packet obtained by compressing a group of target messages for transmission in advance; each target message in a group of target messages corresponds to a first identifier; each target message refers to a message whose corresponding first identifier has a matching second identifier in the first data dictionary; the first data dictionary stores multiple second identifiers, and each of the multiple second identifiers is used to identify a message specified for transmission to a cloud server; the data compression package corresponds to a first version number, and the first version number is used to identify the first data dictionary.

[0101] Step S604, when the first version number of the data compression package matches the pre-stored second version number, the data compression package is decompressed to obtain a group of target messages; the second version number is used to identify the second data dictionary.

[0102] Optionally, the vehicle-mounted terminal sends the data compression package to the cloud server via the network. After receiving the data compression package, the cloud server reads the first version number in the header of the data compression package. The cloud server compares the first version number with the second version number stored in itself to confirm the consistency of the data dictionary. If the first version number matches the second version number, the cloud server decompresses the data compression package using the same decompression algorithm as the vehicle-mounted terminal. After decompression, the cloud server obtains a set of target messages and restores them to the original CAN messages based on the second data dictionary.

[0103] Through the above steps S602 to S604, the first data dictionary stored in the vehicle terminal stores multiple second identifiers for identifying the designated transmission to the cloud server. The first identifier corresponding to each message is matched with the second identifier in the first data dictionary, and the target message for the designated transmission can be screened out. Only the target message that matches successfully will be packaged into a data compression package and sent to the cloud server, which reduces unnecessary data transmission, avoids redundant transmission of the full CAN message, improves the efficiency of network transmission, and effectively alleviates the network congestion problem; to further ensure that the message transmitted to the cloud server is the target message for the designated transmission, the packaged and sent data compression package corresponds to a first version number for identifying the first data dictionary. By matching the first version number with the second version number for identifying the second data dictionary pre-stored in the cloud server, it can be ensured that the data compression package is compressed based on a data dictionary recognized by both parties (that is, the first data dictionary and the second data dictionary are consistent in content), avoiding decompression errors or data loss caused by inconsistent data dictionaries, thereby avoiding the problem of resource waste caused by re-transmission, and solving the network congestion and resource waste caused by directly sending all CAN messages in the related art.

[0104] In an exemplary embodiment, a plurality of third identifiers are stored in the second data dictionary, and each of the plurality of third identifiers is used to identify a message to be received.

[0105] Among them, the third identifier is an identifier stored in the second data dictionary, each third identifier is associated with a specific message and is used to identify or specify the received message during the data communication process.

[0106] In some embodiments, the vehicle-to-cloud communication method further includes:

[0107] When the first version number of the data compression package does not match the pre-stored second version number, the second data dictionary is sent to the vehicle terminal to instruct the vehicle terminal to match the first identifier of the message to be sent with multiple third identifiers stored in the second data dictionary, and transmit the message with the matching third identifier to the cloud server.

[0108] Optionally, after the data compression package is transmitted to the cloud server, the cloud server checks whether the first version number carried in the data compression package matches the second version number pre-stored in the cloud server. If the first version number does not match the second version number, it means that the message format or content in the data compression package is different from the format or content currently supported by the cloud server. The cloud server sends the second data dictionary to the vehicle terminal so that the vehicle terminal understands the message format and content currently supported by the cloud server. After receiving the second data dictionary, the vehicle terminal stores it locally or in a designated location. When the vehicle terminal is preparing to send a message to the cloud server, it first extracts the first identifier of the message, and matches the extracted first identifier with multiple third identifiers stored in the second data dictionary one by one. If a third identifier matching the first identifier is found during the matching process, it means that the message is currently supported by the cloud server. The vehicle terminal transmits the message with the matching third identifier to the cloud server to complete the message sending process.

[0109] In some embodiments, the cloud server also checks the latest version of the second data dictionary in real time. If the second version number stored locally on the cloud server does not match the version number of the latest version of the second data dictionary, the latest version of the second data dictionary is obtained and the latest version of the second data dictionary is sent to the vehicle terminal to instruct the vehicle terminal to match the first identifier of the message to be sent with multiple third identifiers stored in the latest version of the second data dictionary, and transmit the message with the matching third identifier to the cloud server.

[0110] In some embodiments, the cloud service area can also change the third identifier stored in the second data dictionary, and send the changed second data dictionary to the vehicle terminal to instruct the vehicle terminal to match the first identifier of the message to be sent with the multiple second identifiers stored in the changed second data dictionary, and transmit the message with the matching third identifier to the cloud server.

[0111] Through this embodiment, by sending a second data dictionary to the vehicle-mounted terminal when the data compression package version number does not match, and instructing the vehicle-mounted terminal to match the message identifier, it can be ensured that only messages that conform to the message format and content currently supported by the cloud server can be successfully transmitted, effectively solving the problem of communication failure or data error caused by message format or content mismatch, thereby reducing the risk of network congestion.

[0112] In an exemplary embodiment, a group of target messages is divided into a group of first target messages and a group of second target messages; the first target message in the group of first target messages is a target message whose corresponding reassembled message in the group of target messages has a data length less than its own data length; the second target message in the group of second target messages is a target message whose corresponding reassembled message in the group of target messages has a data length greater than or equal to its own data length.

[0113] In some embodiments, the data compression packet is decompressed to obtain a set of target messages, including:

[0114] 1. Decompress the data compression package to obtain a group of in-package messages; the group of in-package messages includes a group of reassembled messages corresponding to a group of first target messages and a group of second target messages; each in-package message in the group of in-package messages corresponds to a fourth identifier, and the fourth identifier corresponding to each in-package message is used to identify whether each in-package message is a reassembled message.

[0115] The group of intra-packet messages refers to messages in the data compression packet, including a group of target messages (such as a first target message and a group of second target messages) and a group of reassembled messages.

[0116] The fourth identifier corresponding to each message in the packet refers to a specific identifier used to distinguish the target message from the reassembled message. Figure 4 and Figure 5 As shown, the fourth identifier may be a 1-bit original / reassembled identifier added after the second identifier (such as the dictionary ID) of the second target message and the reassembled message.

[0117] 2. Extracting a group of reassembled messages and a group of second target messages from a group of messages in the packets according to the fourth identifier corresponding to each message in the packet.

[0118] Optionally, the cloud server decompresses the data compression packet to obtain a group of in-packet messages, each in-packet message corresponds to a fourth identifier, parses each in-packet message in the group of in-packet messages, extracts the fourth identifier in each in-packet message, determines in-packet messages in the group of in-packet messages corresponding to the fourth identifier as reassembled messages based on the fourth identifier, determines the in-packet messages as a group of reassembled messages, determines in-packet messages in the group of in-packet messages other than a group of reassembled messages as a group of second target messages, and for each second target message in the group of second target messages, directly extracts the second target message according to the data length of each second target message, and saves the second target message.

[0119] 3. Restore a group of reassembled messages into a group of first target messages.

[0120] Optionally, the cloud server performs a reverse transformation or reassembly operation on each reassembled message according to a specific transformation or segmentation rule of the reassembled message (the rule should be known during data compression or message transformation), and restores the reassembled message to the original first target message through reverse transformation or reassembly.

[0121] Through this embodiment, the fourth identifier is introduced into the packet in the data compression packet, which can accurately distinguish the reassembled message and the second target message in the packet, and only perform necessary recovery processing on the reassembled message in the packet, avoiding unnecessary waste of resources.

[0122] In an exemplary embodiment, each reassembled message in a group of reassembled messages includes a group of target byte segments and a preset byte; the group of target byte segments in each reassembled message includes: in the case where a group of target messages are sorted according to a preset rule, in the first target message corresponding to each reassembled message, the byte segment whose data is changed by the XOR result of the byte segment and the corresponding byte segment in the previous target message corresponding to the first target message of each reassembled message; the preset byte in each reassembled message is used to record the XOR result of each byte segment of the first target message corresponding to each reassembled message and the corresponding byte segment in the previous target message corresponding to the first target message of each reassembled message.

[0123] In some embodiments, each reassembled message in a group of reassembled messages is respectively used as a current reassembled message to perform the following recovery operation to obtain a first target message restored from each reassembled message; the preset byte of the current reassembled message is the current preset byte, and when the previous message of the current reassembled message is a reassembled message, the previous reassembled message of the current reassembled message has been restored to the corresponding first target message:

[0124] The following determination operations are performed in turn with each bit position in the current preset byte as the current bit position: the XOR result at the current bit position is extracted from the current preset byte; when the data representing the XOR result at the current bit position has not changed, the byte segment indicated by the current bit position is extracted from the previous target message of the current reassembled message, and the byte segment indicated by the current bit position in the first target message restored from the current reassembled message is obtained; when the data representing the XOR result at the current bit position has changed, the target byte segment indicated by the current bit position is extracted from a group of target byte segments of the current reassembled message, and the byte segment indicated by the current bit position in the first target message restored from the current reassembled message is obtained.

[0125] The current bit position refers to the bit position currently being processed in the current preset byte.

[0126] It should be noted that the number of positions of the current preset byte is the same as the number of byte segments of the previous target message. Therefore, the byte segment indicated by the current bit position in the previous target message of the current reassembled message refers to the jth byte segment in the previous target message of the current reassembled message, where j represents the position of the current bit position in the current preset byte. For example, if the current bit position is the third position in the current preset byte, then the byte segment indicated by the current bit position in the previous target message of the current reassembled message refers to the third byte segment in the previous target message of the current reassembled message.

[0127] It should be noted that the current reassembled message includes a group of target byte segments, that is, the byte segments that have changed relative to the previous target message. Therefore, the number of target byte segments in the current reassembled message is less than or equal to the number of byte segments in the previous target message. It can be understood that the number of target byte segments in the current reassembled message must also be less than or equal to the number of positions of the current preset byte segments. Therefore, the target byte segment indicated by the current bit position in a group of target byte segments of the current reassembled message refers to the kth target byte segment in the current reassembled message, wherein k represents the bit position of the kth XOR result characterizing data change in the current preset byte. For example, the current preset byte of the current reassembled message is 01101 (indicating that the 2nd, 3rd, and 5th byte segments of the first target message corresponding to the current reassembled message have changed relative to the previous target message), then the first bit position in the current preset byte indicating that the XOR result characterizing data has changed is the current bit position in the current preset byte, and the target byte segment indicated by the current bit position in a group of target byte segments of the current reassembled message refers to the first target byte segment in the current reassembled message.

[0128] The previous target message of the current reassembled message may be a reassembled message that has been restored to a corresponding first target message, or may be a second target message.

[0129] Optionally, the cloud server uses each reassembled message in a group of reassembled messages as the current reassembled message. If the previous message of the current reassembled message is also a reassembled message and has been restored to the corresponding first target message, the first target message is recorded. For the preset bytes of the current reassembled message, the cloud server uses each bit position therein as the current bit position in turn. The cloud server extracts the XOR result at the current bit position from the current preset byte. If the XOR result representation data at the current bit position has not changed (for example, the XOR result is 0), the byte segment indicated by the current bit position is extracted from the previous target message of the current reassembled message, and the byte segment will be used as the byte segment indicated by the current bit position in the first target message restored from the current reassembled message. If the XOR result representation data at the current bit position changes (for example, the XOR result is 1), the target byte segment indicated by the current bit position is extracted from a group of target byte segments of the current reassembled message, and the byte segment will also be used as the byte segment indicated by the current bit position in the first target message restored from the current reassembled message. When the current bit position is the last bit, it indicates that all byte segments of the first target message corresponding to the current reassembled message are correctly restored, and all restored byte segments are combined to form the first target message restored from the current reassembled message.

[0130] For example, assuming that the previous target message is A|B|C|D|E (where A~E are byte segments, and | is used to separate two adjacent byte segments), the current preset byte of the current reassembled message is 01101 (indicating that the 2nd, 3rd, and 5th byte segments of the first target message corresponding to the current reassembled message have changed relative to the previous target message), and a group of target byte segments of the current reassembled message are B', C', and E'. The cloud server traverses each bit position in the current preset byte 01101 from left to right. The XOR result representation data of the 1st bit position (value 0) has not changed. Therefore, the first byte segment (i.e., byte segment A) in the previous target message is extracted, and the first byte segment A is used as the first byte segment of the first target message corresponding to the current reassembled message. The XOR result representation data of the 2nd bit position (value 1) has changed. Therefore, the first target byte segment (i.e., target byte segment B') in a group of target byte segments of the current reassembled message is extracted, and the first target byte segment B' is used as the second byte segment of the first target message corresponding to the current reassembled message. The XOR result representation data of the 3rd bit position (value is 1) has changed, therefore, the second target byte segment (i.e., target byte segment C') in a group of target byte segments of the current reassembled message is extracted, and the second target byte segment C' is used as the third byte segment of the first target message corresponding to the current reassembled message. The XOR result representation data of the 4th bit position (value is 0) has not changed, therefore, the 4th byte segment (i.e., byte segment D) in the previous target message is extracted, and byte segment D is used as the fourth byte segment of the first target message corresponding to the current reassembled message. The XOR result representation data of the 5th bit position (value is 1) has changed, therefore, the third target byte segment (i.e., target byte segment E') in a group of target byte segments of the current reassembled message is extracted, and target byte segment E' is used as the fifth byte segment of the first target message corresponding to the current reassembled message. The above-recovered byte segments are combined in order to form the first target message, and the combined first target message is: A|B'|C'|D|E'.

[0131] Through this embodiment, when the vehicle-mounted terminal sends a message, a reorganized message is used for sending. The cloud server determines which byte segments have changed based on the XOR results in the preset bytes of the reorganized message, and selectively restores the byte segments whose XOR results represent data changes, thereby reducing the number of messages that need to be sent or processed, thereby reducing the risk of network congestion. For data that has not changed, it is directly extracted from the previous target message to avoid unnecessary repeated sending. For data that has changed, it is extracted from a set of target byte segments of the current reorganized message, ensuring the accuracy of the data. Only the changed byte segments are processed, thereby significantly reducing the occupancy of network bandwidth and processor resources and improving the transmission efficiency of the network.

[0132] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

[0133] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware server, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM (Read-Only Memory) / RAM (Random Access Memory), a disk, or an optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods of each embodiment of the present application.

[0134] According to another aspect of the embodiments of the present application, a vehicle-to-cloud communication device is also provided, which is used to implement the vehicle-to-cloud communication method provided in the above-mentioned embodiments, and will not be repeated hereafter. As used below, the term "module" may be a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0135] Figure 7 is a structural block diagram of an optional vehicle-to-cloud communication device according to an embodiment of the present application, which is applied to a vehicle-mounted terminal, such as Figure 7 As shown, the device may include:

[0136] The message acquisition module 701 is used to acquire multiple messages to be sent; each message in the multiple messages corresponds to a first identifier;

[0137] The message matching module 702 is used to match the first identifier corresponding to each message with a plurality of second identifiers stored in a preset first data dictionary; each of the plurality of second identifiers is used to identify a message designated for transmission to a cloud server;

[0138] The message specifying module 703 is used to determine, among the multiple messages, messages whose corresponding first identifiers have matching second identifiers as target messages, to obtain a group of target messages;

[0139] The message compression module 704 is used to generate a data compression package according to a group of target messages; the data compression package corresponds to a first version number, and the first version number is used to identify a first data dictionary;

[0140] The message transmission module 705 is used to send the data compression package to the cloud server to instruct the cloud server to match the first version number of the data compression package with the pre-stored second version number, and when the first version number matches the second version number, decompress the data compression package to obtain a set of target messages; the second version number is used to identify the second data dictionary.

[0141] In an exemplary embodiment, the message compression module 704 is also used to determine whether a group of target messages meets preset compression conditions; the preset compression conditions are conditions that allow message compression based on specified message parameters; when a group of target messages meets the preset compression conditions, the step of generating a data compression package based on a group of target messages is triggered.

[0142] In an exemplary embodiment, the message compression module 704 is also used to determine a group of target messages and parameter values ​​corresponding to specified message parameters to obtain target parameter values; the specified message parameters include at least one of the following: waiting time, message size; when the target parameter value is greater than or equal to a preset parameter threshold, determine that a group of target messages meet a preset compression condition; the preset compression condition is that the parameter value of the specified message parameter is greater than or equal to the preset parameter threshold.

[0143] In an exemplary embodiment, target messages within a group of target messages are sorted according to preset rules; each target message in a group of target messages is divided into multiple byte segments according to a preset byte length; the message compression module 704 is further used to determine a group of target byte segments corresponding to each target message; the group of target byte segments corresponding to each target message includes the byte segments that have changed relative to the previous target message of each target message among the multiple byte segments of each target message; and a data compression package is generated according to the group of target byte segments corresponding to each target message.

[0144] In an exemplary embodiment, the message compression module 704 is also used to perform the following determination operations on the other target messages in a group of target messages except the first target message as the current target messages, so as to obtain a group of target byte segments corresponding to each target message: perform XOR processing on each byte segment of the current target message with the corresponding byte segment in the previous target message of the current target message, so as to obtain an XOR result corresponding to each byte segment of the current target message; determine the byte segment in the current target message in which the corresponding XOR result represents the data change as the target byte segment corresponding to the current target message, so as to obtain a group of target byte segments corresponding to the current target message.

[0145] In an exemplary embodiment, target messages within a group of target messages are sorted in ascending order of data length; the message compression module 704 is also used to fill the starting position of the previous target message of the current target message with zeros when the data length of the current target message is different from the data length of the previous target message of the current target message, so that the data length of the previous target message of the current target message after filling is consistent with the data length of the current target message.

[0146] In an exemplary embodiment, the message compression module 704 is also used to generate a reassembled message corresponding to each target message according to a group of target byte segments corresponding to each target message and a preset byte corresponding to each target message; the preset byte corresponding to each target message is used to record the XOR result between each byte segment of each target message and the corresponding byte segment in the previous target message of each target message; according to the reassembled message corresponding to each target message, a group of target messages is divided into a group of first target messages and a group of second target messages; the first target message in a group of first target messages is a target message in a group of target messages, and the data length of the corresponding reassembled message is less than the data length of itself; the second target message in a group of second target messages is a target message in a group of target messages, and the data length of the corresponding reassembled message is greater than or equal to the data length of itself; according to the order of the target messages in the group of target messages, a group of reassembled messages corresponding to a group of first target messages and a group of second target messages are data compressed to obtain a data compression package.

[0147] Figure 8 is a structural block diagram of an optional vehicle-to-cloud communication device according to an embodiment of the present application, which is applied to a cloud server, such as Figure 8 As shown, the device may include:

[0148] The message receiving module 801 is used to receive a data compression package sent by the vehicle terminal; the data compression package is a data packet obtained by compressing a group of target messages for transmission in advance; each target message in the group of target messages corresponds to a first identifier; each target message refers to a message whose corresponding first identifier has a matching second identifier in the first data dictionary; the first data dictionary stores a plurality of second identifiers, and each of the plurality of second identifiers is used to identify a message designated for transmission to a cloud server; the data compression package corresponds to a first version number, and the first version number is used to identify the first data dictionary;

[0149] The message parsing module 802 is used to decompress the data compression package to obtain a set of target messages when the first version number of the data compression package matches the pre-stored second version number; the second version number is used to identify the second data dictionary.

[0150] In an exemplary embodiment, a plurality of third identifiers are stored in the second data dictionary, and each of the plurality of third identifiers is used to identify a designated received message; the message parsing module 802 is also used to send the second data dictionary to the vehicle terminal when the first version number of the data compression package does not match the pre-stored second version number, so as to instruct the vehicle terminal to match the first identifier of the message to be sent with the plurality of third identifiers stored in the second data dictionary, and to transmit the message with the matching third identifier to the cloud server.

[0151] In an exemplary embodiment, a group of target messages is divided into a group of first target messages and a group of second target messages; a first target message in a group of first target messages is a target message whose corresponding reassembled message in a group of target messages has a data length less than its own data length; a second target message in a group of second target messages is a target message whose corresponding reassembled message in a group of target messages has a data length greater than or equal to its own data length; the message parsing module 802 is further used to decompress the data compression package to obtain a group of in-packet messages; a group of in-packet messages includes a group of reassembled messages and a group of second target messages corresponding to a group of first target messages; each in-packet message in a group of in-packet messages corresponds to a fourth identifier, and the fourth identifier corresponding to each in-packet message is used to identify whether each in-packet message is a reassembled message; according to the fourth identifier corresponding to each in-packet message, a group of reassembled messages and a group of second target messages are extracted from the group of in-packet messages; and a group of reassembled messages is restored to a group of first target messages.

[0152] In an exemplary embodiment, each reassembled message in a group of reassembled messages includes a group of target byte segments and a preset byte; the group of target byte segments in each reassembled message includes: in the case where a group of target messages are sorted according to a preset rule, in the first target message corresponding to each reassembled message, the byte segment with the XOR result of the corresponding byte segment in the previous target message corresponding to the first target message of each reassembled message represents the byte segment whose data has changed; the preset byte in each reassembled message is used to record the XOR result of each byte segment of the first target message corresponding to each reassembled message with the corresponding byte segment in the previous target message corresponding to the first target message of each reassembled message; the message parsing module 802 is also used to perform the following recovery operation on each reassembled message in the group of reassembled messages as the current reassembled message, so as to obtain the first target message restored to each reassembled message; the preset byte of the current reassembled message is the current preset byte, and when the previous message of the current reassembled message is the reassembled message, the previous reassembled message of the current reassembled message has been restored to the corresponding first target message: each bit position in the current preset byte is sequentially used as the current bit position to perform the following determination operations: extract the XOR result at the current bit position from the current preset byte; when the XOR result at the current bit position represents data that has not changed, extract the byte segment indicated by the current bit position from the previous target message of the current reassembled message, and obtain the byte segment indicated by the current bit position in the first target message restored from the current reassembled message; when the XOR result at the current bit position represents data that has changed, extract the target byte segment indicated by the current bit position from a group of target byte segments of the current reassembled message, and obtain the byte segment indicated by the current bit position in the first target message restored from the current reassembled message.

[0153] It should be noted that the examples and application scenarios implemented by the above modules and corresponding steps are the same, but are not limited to the contents disclosed in the above embodiments. It should be noted that the above modules as part of the device can be run in Figure 1 In the hardware environment shown, it can be implemented by software or by hardware, wherein the hardware environment includes a network environment.

[0154] According to another aspect of the embodiment of the present application, a storage medium is further provided. Optionally, in this embodiment, the storage medium can be used to execute the program code of any of the above vehicle-to-cloud communication methods in the embodiment of the present application.

[0155] Optionally, in this embodiment, the storage medium may be located on at least one network device among a plurality of network devices in the network shown in the above embodiment.

[0156] Optionally, in this embodiment, the storage medium is configured to store program code for executing any of the above-mentioned vehicle-cloud communication methods.

[0157] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, which will not be described in detail in this embodiment.

[0158] Optionally, in this embodiment, the storage medium may include, but is not limited to, various media that can store program codes, such as a USB flash drive, a ROM, a RAM, a mobile hard disk, a magnetic disk, or an optical disk.

[0159] According to another aspect of the embodiments of the present application, a computer program product or a computer program is also provided. Optionally, in this embodiment, the computer program product or the computer program includes a computer instruction, and the processor of the computer device reads the computer instruction from the computer readable storage medium, and the processor executes the computer instruction, so that the computer device performs the steps in any of the above method embodiments.

[0160] Optionally, in this embodiment, the computer program product or computer program may be located on at least one network device among a plurality of network devices in the network shown in the above embodiment.

[0161] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, which will not be described in detail in this embodiment.

[0162] According to another aspect of an embodiment of the present application, an electronic device for implementing the above-mentioned vehicle-cloud communication method is also provided. The electronic device may be a smart device, a server, a terminal, or a combination thereof.

[0163] Fig. 9 is a structural block diagram of an optional electronic device according to an embodiment of the present application, such as Fig. 9 As shown, it includes a processor 902, a communication interface 904, a memory 906 and a communication bus 908, wherein the processor 902, the communication interface 904 and the memory 906 communicate with each other through the communication bus 908, wherein,

[0164] Memory 906, used to store computer programs;

[0165] The processor 902 is used to implement the program code of any of the above-mentioned vehicle-cloud communication methods when executing the computer program stored in the memory 906.

[0166] Optionally, the communication bus may be a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus, etc. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig. 9 The communication interface is used for communication between the above electronic device and other devices.

[0167] The memory may include RAM, or may include non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0168] As an example, the memory 906 may include, but is not limited to, each module in the vehicle-to-cloud communication device. In addition, it may also include, but is not limited to, other module units in the vehicle-to-cloud communication device, which will not be described in detail in this example.

[0169] The above-mentioned processor can be a general-purpose processor, which can include but not be limited to: CPU (Central Processing Unit), NP (Network Processor), etc.; it can also be DSP (Digital Signal Processing), ASIC (Application Specific Integrated Circuit), FPGA (Field-Programmable Gate Array) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0170] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, and this embodiment will not be described in detail here.

[0171] It can be understood by those skilled in the art that Fig. 9 The structure shown is for illustration only. The device for implementing the above-mentioned vehicle-cloud communication method may be a terminal device, which may be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a PDA, a mobile Internet device (Mobile Internet Devices, MID), a PAD, and other terminal devices. Fig. 9 The structure of the electronic device is not limited. Fig. 9 More or fewer components (such as network interfaces, display devices, etc.) shown in, or having Fig. 9 Different configurations shown.

[0172] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.

[0173] An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.

[0174] The embodiments of the present application also provide a computer program, which includes computer instructions, which are stored in a computer-readable storage medium; a processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the steps in any one of the above method embodiments.

[0175] A person of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the hardware related to the terminal device through a program, and the program can be stored in a computer-readable storage medium, which can include: a flash drive, ROM, RAM, a magnetic disk or an optical disk, etc.

[0176] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0177] If the integrated units in the above embodiments are implemented in the form of software functional units and sold or used as independent products, they can be stored in the above computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling one or more computer devices (which may be personal computers, servers, or network devices, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application.

[0178] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

[0179] In the several embodiments provided in the present application, it should be understood that the disclosed client can be implemented in other ways. Among them, the device embodiments described above are only 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 interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0180] 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 provided in this embodiment.

[0181] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, each unit may exist physically separately, or at least two units may be integrated into one unit. The above integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0182] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A vehicle-cloud communication method, characterized in that: Applied to vehicle terminals, including: Acquire multiple messages to be sent; each of the multiple messages corresponds to a first identifier; Matching the first identifier corresponding to each message with a plurality of second identifiers stored in a preset first data dictionary; each of the plurality of second identifiers is used to identify a message designated for transmission to a cloud server; Determine, among the multiple messages, messages whose corresponding first identifiers have matching second identifiers as target messages, to obtain a group of target messages; Generate a data compression package according to the group of target messages; the data compression package corresponds to a first version number, and the first version number is used to identify the first data dictionary; The data compression package is sent to a cloud server to instruct the cloud server to match the first version number of the data compression package with a pre-stored second version number, and when the first version number matches the second version number, the data compression package is decompressed to obtain the set of target messages; the second version number is used to identify a second data dictionary.

2. The method according to claim 1, characterized in that Before generating the data compression package according to the group of target messages, the method further includes: Determining whether the group of target messages meets a preset compression condition; the preset compression condition is a condition set based on a specified message parameter and allowing message compression; When the group of target messages meets the preset compression condition, the step of generating a data compression package according to the group of target messages is triggered.

3. The method according to claim 2, characterized in that The determining whether the group of target messages meets a preset compression condition includes: Determine the parameter values ​​corresponding to the set of target messages and the specified message parameters to obtain the target parameter values; the specified message parameters include at least one of the following: waiting time, message size; When the target parameter value is greater than or equal to a preset parameter threshold, it is determined that the group of target messages meets the preset compression condition; the preset compression condition is that the parameter value of the specified message parameter is greater than or equal to the preset parameter threshold.

4. The method according to claim 1, characterized in that: The target messages in the group of target messages are sorted according to a preset rule; each target message in the group of target messages is divided into a plurality of byte segments according to a preset byte length; The step of generating a data compression package according to the group of target messages comprises: Determine a group of target byte segments corresponding to each target message; the group of target byte segments corresponding to each target message includes byte segments that have changed relative to a previous target message of each target message among the multiple byte segments of each target message; The data compression package is generated according to a group of target byte segments corresponding to each target message.

5. The method according to claim 4, characterized in that The determining a set of target byte segments corresponding to each target message includes: The other target messages in the group of target messages except the first target message are respectively used as current target messages to perform the following determination operations to obtain a group of target byte segments corresponding to each target message: Performing an XOR process on each byte segment of the current target message and the corresponding byte segment in the previous target message of the current target message to obtain an XOR result corresponding to each byte segment of the current target message; The byte segments in which the corresponding XOR results represent data changes in the current target message are determined as the target byte segments corresponding to the current target message, and a group of target byte segments corresponding to the current target message are obtained.

6. The method according to claim 5, characterized in that The target messages in the group of target messages are sorted in ascending order of data length; before performing XOR processing on each byte segment of the current target message and the corresponding byte segment in the previous target message of the current target message, the method further includes: When the data length of the current target message is different from the data length of the previous target message of the current target message, zeros are padded at the starting position of the previous target message of the current target message so that the data length of the previous target message of the current target message after padding is consistent with the data length of the current target message.

7. The method according to any one of claims 4 to 6, characterized in that The step of generating a data compression package according to a group of target byte segments corresponding to each target message includes: Generate a reassembled message corresponding to each target message according to a group of target byte segments corresponding to each target message and a preset byte corresponding to each target message; the preset byte corresponding to each target message is used to record an exclusive OR result between each byte segment of each target message and a corresponding byte segment in a previous target message of each target message; According to the reassembled message corresponding to each target message, the group of target messages is divided into a group of first target messages and a group of second target messages; the first target message in the group of first target messages is a target message in the group of target messages, the data length of the corresponding reassembled message is less than the data length of the target message itself; the second target message in the group of second target messages is a target message in the group of target messages, the data length of the corresponding reassembled message is greater than or equal to the data length of the target message itself; According to the order of the target messages in the group of target messages, data compression is performed on a group of reassembled messages corresponding to the group of first target messages and the group of second target messages to obtain the data compression package.

8. A vehicle-cloud communication method, characterized in that: Applied to cloud servers, including: Receive a data compression package sent by the vehicle-mounted terminal; the data compression package is a data packet obtained by compressing a group of target messages for transmission in advance; each target message in the group of target messages corresponds to a first identifier; each target message refers to a message whose corresponding first identifier has a matching second identifier in the first data dictionary; the first data dictionary stores a plurality of second identifiers, each of the plurality of second identifiers is used to identify a message designated for transmission to the cloud server; the data compression package corresponds to a first version number, and the first version number is used to identify the first data dictionary; In the case where the first version number of the data compression package matches the pre-stored second version number, the data compression package is decompressed to obtain the group of target messages; the second version number is used to identify the second data dictionary.

9. The method according to claim 8, characterized in that The second data dictionary stores a plurality of third identifiers, each of the plurality of third identifiers being used to identify a designated received message; The method further comprises: When the first version number of the data compression package does not match the pre-stored second version number, the second data dictionary is sent to the vehicle-mounted terminal to instruct the vehicle-mounted terminal to match the first identifier of the message to be sent with the multiple third identifiers stored in the second data dictionary, and transmit the message with the matching third identifier to the cloud server.

10. The method according to claim 8, characterized in that The group of target messages is divided into a group of first target messages and a group of second target messages; the first target message in the group of first target messages is a target message whose corresponding reassembled message in the group of target messages has a data length smaller than its own data length; The second target message in the group of second target messages is a target message whose data length of the corresponding reassembled message in the group of target messages is greater than or equal to its own data length; The decompressing the data compression package to obtain the set of target messages includes: Decompressing the data compression packet to obtain a group of in-packet messages; the group of in-packet messages includes a group of reassembled messages corresponding to the group of first target messages and the group of second target messages; each in-packet message in the group of in-packet messages corresponds to a fourth identifier, and the fourth identifier corresponding to each in-packet message is used to identify whether each in-packet message is a reassembled message; Extracting the group of reassembled messages and the group of second target messages from the group of messages in the packets according to the fourth identifier corresponding to each message in the packets; The group of reassembled messages is restored into the group of first target messages.

11. The method according to claim 10, characterized in that Each reassembled message in the group of reassembled messages includes a group of target byte segments and a preset byte; The group of target byte segments in each reassembled message includes: in the case where the group of target messages are sorted according to a preset rule, in the first target message corresponding to each reassembled message, the XOR result of the byte segment and the corresponding byte segment in the previous target message corresponding to the first target message of each reassembled message represents the byte segment whose data has changed; the preset bytes in each reassembled message are used to record the XOR result of each byte segment of the first target message corresponding to each reassembled message and the corresponding byte segment in the previous target message corresponding to the first target message of each reassembled message; The step of restoring the group of reassembled messages into the group of first target messages comprises: Each reassembled message in the group of reassembled messages is used as a current reassembled message to perform the following recovery operation to obtain a first target message restored from each reassembled message; the preset byte of the current reassembled message is the current preset byte, and when the previous message of the current reassembled message is a reassembled message, the previous reassembled message of the current reassembled message has been restored to the corresponding first target message: The following determination operations are performed using each bit position in the current preset byte as the current bit position in turn: Extracting the XOR result at the current bit position from the current preset byte; When the data represented by the XOR result at the current bit position has not changed, extract the byte segment indicated by the current bit position from the previous target message of the current reassembled message, and obtain the byte segment indicated by the current bit position in the first target message restored from the current reassembled message; When the data represented by the XOR result at the current bit position changes, the target byte segment indicated by the current bit position is extracted from a group of target byte segments of the current reassembled message, and the byte segment indicated by the current bit position in the first target message restored from the current reassembled message is obtained.

12. A vehicle-to-cloud communication device, characterized in that: Applied to vehicle terminals, including: A message acquisition module, used to acquire multiple messages to be sent; each of the multiple messages corresponds to a first identifier; A message matching module, used for matching the first identifier corresponding to each message with a plurality of second identifiers stored in a preset first data dictionary; each of the plurality of second identifiers is used for identifying a message designated for transmission to a cloud server; A message specifying module, used for determining, among the plurality of messages, messages whose corresponding first identifiers have matching second identifiers as target messages, to obtain a group of target messages; A message compression module, used for generating a data compression package according to the group of target messages; the data compression package corresponds to a first version number, and the first version number is used to identify the first data dictionary; A message transmission module is used to send the data compression package to a cloud server to instruct the cloud server to match the first version number of the data compression package with a pre-stored second version number, and to decompress the data compression package to obtain the set of target messages when the first version number matches the second version number; the second version number is used to identify a second data dictionary.

13. A vehicle-to-cloud communication device, characterized in that: Applied to cloud servers, including: A message receiving module, used for receiving a data compression package sent by a vehicle-mounted terminal; the data compression package is a data packet obtained by compressing a group of target messages for transmission in advance; each target message in the group of target messages corresponds to a first identifier; each target message refers to a message whose corresponding first identifier has a matching second identifier in the first data dictionary; the first data dictionary stores a plurality of second identifiers, each of the plurality of second identifiers is used to identify a message designated for transmission to the cloud server; the data compression package corresponds to a first version number, and the first version number is used to identify the first data dictionary; The message parsing module is used to decompress the data compression package to obtain the set of target messages when the first version number of the data compression package matches the pre-stored second version number; the second version number is used to identify the second data dictionary.

14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program implements the steps of the method according to any one of claims 1 to 11 when executed by a processor.

15. 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 11 are implemented.