Vehicle data transmission method and device, electronic equipment and storage medium
By performing variable-length serialization and encryption on vehicle data, the problems of large data volume and high latency of traditional CAN messages in cloud or remote monitoring scenarios are solved, and efficient and secure data transmission is achieved.
Patent Information
- Application Number
- CN202411769608.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-04
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2044-12-04
AI Technical Summary
Traditional CAN messages are difficult to apply directly to cloud or remote monitoring scenarios due to the large amount of data and high transmission latency requirements, resulting in high costs and low efficiency.
By obtaining N serialization processing types of vehicle data, the vehicle data is serialized in variable length, the target data is determined and encrypted, and then sent to the TSP server according to the service quality level.
The flexibility and security of data transmission are improved, and the efficiency of data transmission is improved.
Smart Images

Figure CN119628915B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the Internet of Vehicles technology field, and particularly relates to a vehicle data transmission method and device, electronic equipment and a storage medium. BACKGROUND
[0002] With the complication of vehicle electronic control systems, the CAN (Controller Area Network) / CANFD (CAN with Flexible Data Rate) bus, as a standard communication bus in the vehicle, is widely used in the control systems of various vehicles. CAN messages can transmit the data of various sensors and controllers in the vehicle in real time. However, with the development of IoT (Internet of Things) technology, more and more application scenarios require vehicle data to be transmitted to a remote server or cloud for processing and analysis.
[0003] Traditional CAN messages cannot be directly applied to cloud or remote monitoring scenarios, and the data volume of vehicle CAN message transmission is large, the requirement for transmission delay is high, the overall transmission cost is high and the efficiency is low. SUMMARY
[0004] Therefore, the embodiments of the present application provide a vehicle data transmission method and device, electronic equipment and a storage medium to solve the problem of high cost and low efficiency when a vehicle machine exchanges vehicle data with a TSP server in the prior art.
[0005] In a first aspect, a vehicle data transmission method is provided. The method is performed by a vehicle machine and is used for transmitting vehicle data between the vehicle machine and a content service provider (TSP) server. The method includes:
[0006] obtaining first vehicle data;
[0007] obtaining N serialization processing types of the first vehicle data, N being a positive integer;
[0008] performing variable-length serialization processing on the first vehicle data according to the N serialization processing types, to obtain N compressed first vehicle data;
[0009] determining target data in the N compressed first vehicle data based on a data transmission strategy, and performing encryption processing on the target data to obtain encrypted target data;
[0010] sending the target data to the content service provider (TSP) server according to a quality of service (QoS) level.
[0011] In a second aspect, a vehicle data transmission device is provided. The device includes:
[0012] an acquisition module configured to acquire first vehicle data and N serialization processing types of the first vehicle data, N being a positive integer;
[0013] a serialization processing module configured to perform variable-length serialization processing on the first vehicle data according to the N serialization processing types, to obtain N compressed first vehicle data;
[0014] an encryption module configured to determine target data in the N compressed first vehicle data based on a data transmission strategy, and perform encryption processing on the target data to obtain encrypted target data;
[0015] a transmission module configured to send the target data to a content service provider (TSP) server according to a quality of service (QoS) level.
[0016] In a third aspect, an electronic device is provided, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the steps of the above method when executing the computer program.
[0017] In a fourth aspect, a computer readable storage medium is provided, which stores a computer program, and the computer program implements the steps of the above method when executed by a processor.
[0018] Compared with the prior art, the embodiments of the present application have the beneficial effects that: by acquiring vehicle data and N serialization processing types of the vehicle data, performing variable-length serialization processing on the vehicle data according to the N serialization processing types to obtain N compressed vehicle data, determining target data in the N compressed first vehicle data based on a data transmission strategy, performing encryption processing on the target data, and finally sending the encrypted target data to a TSP server according to a QoS level, the vehicle data can be compressed through serialization processing, and the compressed vehicle data of a target type is selected for transmission, thereby improving the flexibility of data transmission, and the transmission security and reliability are improved by using encryption processing and a quality level transmission strategy, thereby improving the data transmission efficiency. BRIEF DESCRIPTION OF DRAWINGS
[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiments or prior art description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0020] Figure 1is a flowchart of a vehicle data transmission method provided by an embodiment of the present application.
[0021] Figure 2 is a flowchart of a method for obtaining N serialization processing types of first vehicle data provided by an embodiment of the present application.
[0022] Figure 3 is a flowchart of a method for determining N serialization processing types in M vehicle data structured objects provided by an embodiment of the present application.
[0023] Figure 4 is a flowchart of a method for determining target data in N compressed first vehicle data based on a data transmission strategy provided by an embodiment of the present application.
[0024] Figure 5 is a flowchart of a method for performing variable length serialization processing on first vehicle data to obtain compressed first vehicle data provided by an embodiment of the present application.
[0025] Figure 6 is a flowchart of another vehicle data transmission method provided by an embodiment of the present application.
[0026] Figure 7 is a flowchart of still another vehicle data transmission method provided by an embodiment of the present application.
[0027] Figure 8 is a schematic diagram of a vehicle data transmission device provided by an embodiment of the present application.
[0028] Figure 9 is a schematic diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0029] In the following description, specific details are set forth, such as particular system configurations, techniques, etc., in order to provide a thorough understanding of the present application. However, persons skilled in the art will understand that the present application can be practiced without these specific details. In other instances, well-known structures, devices, circuits, and methods have not been described in detail in order to avoid obscuring the present application.
[0030] A vehicle data transmission method and device according to an embodiment of the present application will be described in detail below with reference to the accompanying drawings.
[0031] With the development of IoT technology, more and more application scenarios need to transmit vehicle data to a remote server or cloud for processing and analysis. However, the traditional CAN message is difficult to be directly applied to the cloud or remote monitoring scenario, and the data volume of vehicle CAN message transmission is large, the requirement for transmission delay is high, the overall transmission cost is high and the efficiency is low.
[0032] Specifically, the traditional CAN bus communication mode faces the following problems:
[0033] The traditional CAN message is mainly transmitted in the in-vehicle local area network and is difficult to be directly applied to the cloud or remote monitoring scenario.
[0034] The data volume of vehicle CAN message transmission is large, and the requirement for transmission delay is high, and the existing MQTT (Message Queuing Telemetry Transport) and TCP (Transmission Control Protocol) or other communication protocol mode is often difficult to meet.
[0035] In addition, the CAN message is in binary format, and efficient serialization needs to be used for data analysis and processing, and there is a lack of efficient and flexible data serialization mechanism in the related art.
[0036] At the same time, the current transparent transmission scheme transmits the vehicle CAN / CANFD message to the target device without changing, or uses the shortened cycle to reduce data transmission, for example, changes the data acquisition cycle of 1 ms (millisecond) to 100 ms. The transparent transmission will cause a large amount of redundant data transmission, especially in the case of frequent vehicle data updates, which will cause the network bandwidth to be occupied very high, easily causing network congestion and affecting transmission efficiency. While the shortened cycle transmission data reduces the amount of data transmission, it may discard the changed data, resulting in the loss of important information.
[0037] Therefore, the embodiment of the present application provides a vehicle data transmission method, which acquires vehicle data and N serialization processing types of vehicle data, respectively processes the vehicle data according to the N serialization processing types to obtain N compressed vehicle data, determines target data in the first N compressed vehicle data based on a data transmission strategy, performs encryption processing on the target data, and finally sends the encrypted target data to a TSP server according to a quality of service level. The vehicle data can be compressed by serialization processing, and the compressed vehicle data of the target type is selected for transmission, which improves the flexibility of data transmission, and the encryption processing and quality level transmission strategy improve the transmission security and reliability, and improve the data transmission efficiency.
[0038] Figure 1 is a flowchart of a vehicle data transmission method provided by an embodiment of the present application. As shown in the figure, the method comprises the following steps: Figure 1
[0039] In step S101, first vehicle data is acquired.
[0040] In step S102, N serialization processing types of the first vehicle data are acquired.
[0041] Wherein, N is a positive integer.
[0042] In step S103, the first vehicle data is subjected to variable-length serialization processing according to the N serialization processing types, to obtain N compressed first vehicle data.
[0043] In step S104, target data in the N compressed first vehicle data is determined based on a data transmission strategy, and the target data is subjected to encryption processing to obtain encrypted target data.
[0044] In step S105, the target data is sent to a TSP server according to a quality of service level.
[0045] In some embodiments of the present application, the method can be executed by a car machine, for example, a TBOX in a vehicle. Further, the method is used for transmitting vehicle data between the car machine and a TSP (Telematics Service Provider, content service provider) server.
[0046] Wherein, the vehicle data can be Ethernet data from an ECU (Electronic Control Unit) in a vehicle gateway, or Ethernet data in the vehicle gateway that needs to be sent to the ECU, or CAN message data from a vehicle MCU (Microcontroller Unit) in the vehicle gateway, or CAN message data in the vehicle gateway that needs to be sent to the vehicle MCU. In some embodiments, the vehicle data can also be other possible vehicle data, which is not limited here.
[0047] In some embodiments of the present application, the car machine can acquire first vehicle data and acquire N serialization processing types of the first vehicle data. In an example, the first vehicle data is vehicle data that needs to be transmitted by the car machine to the TSP server. The car machine can acquire a serialization processing description file of the first vehicle data, and then determine the serialization processing types of the first vehicle data specified in the serialization processing description file through a preset interface. The acquisition method of the serialization processing types is described in detail below, and will not be repeated here.
[0048] In some embodiments, the vehicle machine can perform variable-length serialization processing on the first vehicle data according to the N serialization processing types, to obtain N compressed first vehicle data. In an example, the N types of processing objects in the first vehicle data can be subjected to Protobuf variable-length serialization processing, to compress the N types of processing objects respectively. In another example, the N types of processing objects can be combinations of different types of data in the first vehicle data, such as combinations of full-amount data in the first vehicle data, or combinations of partial types of data in the first vehicle data.
[0049] In some embodiments of the present application, target data in the N compressed first vehicle data can be determined based on a data transmission strategy. The data transmission strategy is used to specify target data for this data transmission, and the target data is one of the N compressed first vehicle data. For example, the data transmission strategy can specify the full-amount data of the compressed first vehicle data as the target data. For another example, the data transmission strategy can also specify partial types of data in the compressed first vehicle data as the target data.
[0050] In some embodiments, the target data can be subjected to encryption processing to obtain encrypted target data. In an example, the target data can be encrypted using a tls protocol combined with an authentication issued by the vehicle machine vendor, and a national cryptographic chip can be used to improve the key exchange speed and encryption / decryption speed during encryption.
[0051] In some embodiments, the encrypted target data can be sent to the TSP server according to the quality of service level, to achieve efficient data transmission between the vehicle machine and the TSP server. The service instruction level can be preset or dynamically determined, which is not limited here.
[0052] According to the technical scheme provided by the embodiments of the present application, by obtaining vehicle data and N serialization processing types of the vehicle data, performing variable-length serialization processing on the vehicle data according to the N serialization processing types to obtain N compressed vehicle data, determining target data in the N compressed first vehicle data based on a data transmission strategy, performing encryption processing on the target data, and finally sending the encrypted target data to the TSP server according to the quality of service level, the vehicle data can be compressed through serialization processing, and the compressed vehicle data of the target type is selected for transmission, which improves the flexibility of data transmission. At the same time, the encryption processing and the quality level transmission strategy are used to improve the transmission security and reliability, and the data transmission efficiency is improved.
[0053] Figure 2 is a flowchart of a method for obtaining N serialization processing types of first vehicle data provided by the embodiments of the present application. As shown in Figure 2 the method comprises the following steps:
[0054] In step S201 , a serialization process description file is generated based on a DBC table corresponding to the first vehicle data.
[0055] The serialization processing description file includes M vehicle data structured objects, where M is a positive integer greater than or equal to N, and each vehicle data structured object corresponds to a serialization processing type.
[0056] In step S202 , N serialization processing types are determined in M vehicle data structured objects.
[0057] In certain embodiments of the present application, the vehicle computer can generate a serialized processing description file based on the first vehicle data. The serialized processing description file can be generated by a serialization and deserialization processing framework, such as protobuf (Protocol Buffers, a data structure serialization and deserialization framework), based on the DBC (Database Connector) table corresponding to the first vehicle data. In other words, the vehicle computer can obtain the DCB table corresponding to its vehicle data and use the DCB table to generate a description file in .proto syntax.
[0058] The serialization process description file may include M custom vehicle data structured objects, each corresponding to a serialization process type. For example, the serialization process description file may include a first vehicle data structured object corresponding to a serialization process type for processing all vehicle data. In another example, the serialization process description file may also include a second vehicle data structured object corresponding to a serialization process type for processing a portion of selected vehicle data.
[0059] In some implementations, the vehicle computer may determine N serialization processing types in the M vehicle data structured objects.
[0060] In some embodiments of the present application, the vehicle data structured object may include a type structured object and a selection structured object, wherein the type structured object defines different types of vehicle data structured objects, and the selection structured object determines valid structured objects among the defined vehicle data structured objects.
[0061] Figure 3 FIG. 1 is a flow chart of a method for determining N serialization processing types in M vehicle data structured objects provided by an embodiment of the present application. Figure 3 As shown, the method includes the following steps:
[0062] In step S301, in response to determining that the selection structured object is not included in the serialization processing description file, it is determined that the serialization processing types corresponding to all type structured objects are N serialization processing types.
[0063] In step S302, in response to determining that the selection structured object is included in the serialization processing description file, it is determined that the effective structured object determined by the selection structured object and the independent type structured object are N serialization processing types.
[0064] The independent type structured object is a structured object independent of the selection structured object. That is, the selection structured object can include multiple selected type structured objects, and the independent type structured object is a type structured object not included in the selection structured object.
[0065] In some embodiments of the present application, if the selection structured object is not included in the serialization processing description file, it can be determined that the serialization processing types corresponding to all type structured objects are N serialization processing types. Conversely, if the selection structured object is included in the serialization processing description file, it is determined that the effective structured object determined by the selection structured object and the independent type structured object are N serialization processing types.
[0066] That is, the car machine can obtain the message type of the vehicle data structured object recorded in the serialization processing description file through the proto interface. The vehicle data structured object in the serialization processing description file can be defined in the following way:
[0067] syntax = "proto3";
[0068] / / Define CanMessage message
[0069] message CanMessage{
[0070] uint32 can_id = 1; / / CAN ID, type uint32
[0071] uint64 timestamp = 2; / / timestamp, type int64
[0072] bytes raw_data = 3; / / raw data, type bytes
[0073] uint32 crc32 = 4;
[0074] }
[0075] / / Define DBCMessage message
[0076] message DBCMessage{
[0077] uint32 can_id=1; / / CAN ID, type is uint32
[0078] uint32 vehicle_speed = 2; / / vehicle speed, type is uint32
[0079] uint32 crc32 = 3;
[0080] }
[0081] / / Define VehicleMessage message,
[0082] message VehicleMessage{
[0083] oneof vehicle_data{
[0084] CanMessage can_message=1; / / Option 1: CAN message
[0085] DBCMessage dbc_message = 2; / / Option 2: DBC message
[0086] }
[0087] }
[0088] Syntax is the syntactical rule, and proto3 is the grammatical format. CanMessage is a type structured object in vehicle data, and its serialized processing object is the original data of the vehicle data. The type structured object in DBCMessage is a serialized processing object for the selected data of the vehicle data, such as vehicle speed data. VehicleMessage is a selected structured object in vehicle data, and its processing object is the selected type structured object. When oneofvehicle_data in the VehicleMessage is 1, its processing object is the CanMessage structured object. When oneofvehicle_data in the VehicleMessage is 2, its processing object is the DBCMessage structured object.
[0089] It is understandable that the selected data in the DBCMessage in the above example is the vehicle speed. In actual use, the selected data can be set to any one or more items of vehicle data as needed, and there is no limitation here.
[0090] That is, the type for serializing the first vehicle data can be defined in the source code generated based on the proto framework first, and then it is determined whether to select the original data of the first vehicle data for DBC parsing or the selected data for DBC parsing according to the determined type.
[0091] In the parsed data, the vehicle data of different fields can be segmented by using the structure of key-value pairs. For the optional field, if the field does not exist in the vehicle data message to be transmitted, the field is not included in the compressed vehicle data, so that the message size of the transmitted vehicle data can be saved.
[0092] Before communication, the data sending and receiving parties can agree on the field number, and the field number itself does not directly occupy the bit in the binary sequence of the compressed vehicle data, but the field number and the type are encoded into a key together. The size of the key is variable and depends on the field number and the type. The specific encoding method can be to left shift the field number by 3 bits and then perform AND operation with the field type, that is, (field_number << 3) | wire_type, where field_number is the field number, wire_type is the field type, << is the left shift symbol, and | is the AND operator.
[0093] After generating the description file of the.proto syntax, the source code of the corresponding platform can also be generated by the proto compiler. The generated source code can provide general data structures and related serialization and deserialization interfaces on different platforms, and cross-platform communication can be achieved through the interface.
[0094] Figure 4 is a flowchart of a method for determining target data in N compressed first vehicle data based on a data transmission strategy provided by an embodiment of the present application. As shown in Figure 4 the method includes the following steps:
[0095] In step S401, a preset data transmission strategy is obtained, and target data in N compressed first vehicle data is determined based on the preset transmission strategy.
[0096] In step S402, in response to receiving a data transmission strategy adjustment message, the data transmission strategy is adjusted, and target data in N compressed first vehicle data is determined based on the adjusted data transmission strategy.
[0097] In some embodiments of the present application, in determining target data in N compressed first vehicle data based on a data transmission strategy, a preset data transmission strategy can be obtained, and target data in N compressed first vehicle data is determined based on the preset transmission strategy.
[0098] In an example, the preset data transmission strategy can set priorities of vehicle data processed using different serialization processing types, and the vehicle data corresponding to the type with the highest priority in the preset data transmission strategy can be determined as the target data from the N compressed first vehicle data.
[0099] For example, the preset data transmission strategy can set that vehicle data processed using serialization processing on full data has the highest priority, and vehicle data processed using serialization processing on vehicle speed has the second highest priority. If the N compressed first vehicle data includes first vehicle data processed using serialization processing on full data, the first vehicle data processed using serialization processing on full data can be determined as the target data. Conversely, if the N compressed first vehicle data does not include first vehicle data processed using serialization processing on full data, but includes first vehicle data processed using serialization processing on vehicle speed, the first vehicle data processed using serialization processing on vehicle speed can be determined as the target data. Similarly, the above can be applied.
[0100] In some embodiments, the data transmission strategy can also be adjusted in real time. For example, the data transmission strategy can be adjusted in real time based on user instructions. For another example, the data transmission strategy can also be adjusted in real time based on current vehicle infotainment system running state, network quality between the vehicle infotainment system and the TSP server, and the like.
[0101] In an example, if the current running load of the vehicle infotainment system is high, the processing speed is slow, or the network quality between the vehicle infotainment system and the TSP server is poor, and the remaining bandwidth is small, the data transmission strategy can be adjusted to reduce the data transmission amount to ensure the transmission quality of important data.
[0102] For example, the preset data transmission strategy is to transmit first vehicle data processed using serialization processing on full data, and the adjusted data transmission strategy can be to transmit first vehicle data processed using serialization processing on partial data.
[0103] For another example, the preset data transmission strategy is to transmit first vehicle data processed using serialization processing on a first part of data, and the adjusted data transmission strategy can be to transmit first vehicle data processed using serialization processing on a second part of data, where the number of the second part of data is less than that of the first part of data, and the transmission priority of the second part of data is higher than that of at least one data in the first part of data.
[0104] In another example, if the current running load of the vehicle infotainment system is reduced, the processing speed is improved, or the network quality between the vehicle infotainment system and the TSP server is improved, and the remaining bandwidth is increased, the data transmission strategy can be adjusted to increase the data transmission amount to ensure the real-time performance of vehicle data transmission.
[0105] For example, the preset data transmission strategy is to transmit the first vehicle data after serializing a part of the data, and the adjusted data transmission strategy can be to transmit the first vehicle data after serializing the full amount of data.
[0106] For example, the preset data transmission strategy is to transmit the first vehicle data after serializing a part of the data, and the adjusted data transmission strategy can be to transmit the first vehicle data after serializing the full amount of data.
[0107] Figure 5 is a flowchart of a method for performing variable-length serialization processing on first vehicle data to obtain compressed first vehicle data, provided by an embodiment of the present application. As shown in Figure 5 The method comprises the following steps:
[0108] In step S501, the key-value pair representation of the first vehicle data is obtained based on the DBC table corresponding to the first vehicle data.
[0109] In step S502, the numerical value of the first vehicle data is obtained from the key-value pair representation of the first vehicle data.
[0110] In step S503, in response to determining that the numerical value of the first vehicle data is a positive number, the numerical value of the first vehicle data is variable-length Varint encoded to obtain the compressed first vehicle data.
[0111] In step S504, in response to determining that the numerical value of the first vehicle data is a negative number, the numerical value of the first vehicle data is mapped to a positive number using the compression curve Zigzag encoding method.
[0112] In step S505, the first vehicle data mapped to a positive number is variable-length Varint encoded to obtain the compressed first vehicle data.
[0113] In some embodiments of the present application, when performing variable-length serialization processing on the first vehicle data, the key-value pair representation of the first vehicle data can be obtained based on the DBC table corresponding to the first vehicle data, and the numerical value of the first vehicle data can be obtained from the key-value pair representation of the first vehicle data. If the obtained numerical value of the first vehicle data is an integer type positive number, such as an unsigned integer (unit32) or a signed integer (int32), the numerical value of the first vehicle data can be variable-length Varint encoded to obtain the compressed first vehicle data.
[0114] For example, if the value of the first vehicle data is an integer value of 1, its binary representation is 00000001, and the result of Varint encoding is 00000001, in which the highest bit 0 indicates that this is the last byte. For another example, if the value of the first vehicle data is an integer value of 300, its binary representation is 100101100, and the result of Varint encoding is 10101100 00000010, in which the highest bit 1 of the first byte indicates that there are subsequent bytes, and the highest bit 0 of the second byte indicates that this is the last byte.
[0115] For small integer values, using Varint encoding can greatly save space, and since the vehicle data is mostly small value data, using Varint encoding can effectively improve the data compression rate.
[0116] On the other hand, if the value of the obtained first vehicle data is a negative number, the value of the first vehicle data can be first mapped to a positive number using the compression curve Zigzag encoding method, and then the first vehicle data mapped to a positive number is subjected to variable length Varint encoding to obtain compressed first vehicle data.
[0117] The Zigzag encoding rule can be: for a positive number, it is mapped to n->2*n; for a negative number, it is mapped to n->2*|n|-1. Wherein, n is the value to be encoded.
[0118] In some embodiments of the present application, the encrypted first vehicle data can be obtained by encrypting the compressed first vehicle data, which can be obtained by obtaining encryption information, and the encryption information is determined according to the security certificate issued by the car machine supplier; and the encrypted first vehicle data is obtained by encrypting the compressed first vehicle data using the encryption information.
[0119] Further, the encrypted first vehicle data can be transmitted to the content service provider TSP server according to the quality of service level, which can be obtained by obtaining the priority of the first vehicle data and the current network quality parameter; determining the service quality level of this transmission according to the priority and the current network quality parameter; and transmitting the encrypted first vehicle data to the content service provider TSP server according to the service quality level.
[0120] In an example, the first vehicle data can be transmitted through the MQTTs (such as the version of the MQTT protocol encrypted by TLS / SSL, i.e. MQTT Secure) protocol, and a security layer can be added to ensure the confidentiality, integrity and authentication of data transmission.
[0121] MQTT is a lightweight publish / subscribe messaging protocol widely used in the IoT field. MQTTs adds a TLS (Transport Layer Security) / SSL (Secure Socket Layer) encryption layer on the basis of the MQTT protocol to ensure the confidentiality and integrity of data transmission. Through the TLS / SSL handshake process, the client and the Broker (proxy server) can use custom certificates to establish an encrypted communication channel, and all transmitted data will be encrypted to prevent eavesdropping or tampering. The encrypted vehicle data is sent to the TSP server through the MQTT protocol.
[0122] In some embodiments of the present application, the vehicle data transmission method can further include the step of receiving vehicle data from the TSP server by the car machine. In an example, the car machine can receive the second vehicle data sent by the TSP server, and then perform deserialization processing on the second vehicle data to obtain second vehicle data executable by the car machine. The second vehicle data can be original vehicle data or selected vehicle data.
[0123] Figure 6 is another flowchart of a vehicle data transmission method provided by an embodiment of the present application. As shown in Figure 6 The car machine can use a python tool to parse DBC table data to generate a.proto file, protect custom.proto message types, serialize vehicle data based on the.proto file, and send the serialized vehicle data to the policy module. After determining the sending strategy, the policy module sends the vehicle data to the data encryption and decryption module. The encrypted vehicle data is sent to the data transmission module, which transmits the vehicle data to the TSP server.
[0124] On the other hand, the TSP server can send vehicle data to the data transmission module, which sends the data to the data encryption and decryption module for decryption. The decrypted vehicle data is transmitted to the data sending strategy module, which determines the sending strategy and performs deserialization processing on the vehicle data based on the sending strategy. Then, the deserialized vehicle data is sent to the car machine.
[0125] That is, the head unit can use MQTT protocol and TSL protocol and protobuf serialized data to realize effective compression of CAN / CANFD data, use TLS to realize encryption of data transmission. Use the QoS (Quality of Service) of MQTT to realize reliable transmission of data. Ethernet data from other ECUs on the gateway and CAN raw data on the MCU can be parsed into signal and value format by a dbc parsing module, then serialized into binary data by a protobuf serialization module, encrypted into encrypted data by a TLS encryption module, and finally sent to the TSP server according to the defined QoS level of the message by the MQTT sending module.
[0126] Figure 7 is a flowchart of another vehicle data transmission method provided by the embodiment of the application. As shown in Figure 7 , each module in the head unit can be initialized first, then the priority of the vehicle data and the serialization processing and transmission type are parsed and configured by the configuration file, that is, whether to directly transmit CAN or transmit part of the DBC bits. Next, the serialization module packs the vehicle data into binary data, and the data transmission format selection module determines the forwarding strategy according to the configuration. The current system performance can select to use CAN byte stream data in the parameter message or select to pass the parsed DBC signal data. After the data is filled by the selection module, the data stream is transferred to the encryption module.
[0127] Among them, the forwarding strategy can be dynamically adjusted, that is, the head unit can detect the system and network performance in real time, and dynamically configure the forwarding strategy. After determining the vehicle data according to the determined forwarding strategy, the vehicle data can be sent to the encryption module, and the vehicle data is encrypted by the encryption module and sent to the TSP server through the MQTT protocol.
[0128] The MQTT protocol is based on the publish / subscribe mode, which allows devices to communicate through the Broker. The publisher publishes messages to the Broker, the Broker stores the messages in the queue associated with the topic (Topic), and then distributes them to all subscribers who subscribe to the topic. Use QoS to control the reliability and transmission speed of the message.
[0129] The MQTT protocol supports three QoS levels, which are QoS 0 (at most once), QoS1 (at least once) and QoS2 (exactly once).
[0130] According to the technical scheme provided in the embodiment, the message type defined by the protobuff tool can be generated by the tool, and the C, C++, java, and the like code increases the cross-platform and portability. By defining the data model through the.proto file, the fields can be easily added or deleted without destroying the existing protocol, so that the smooth version upgrade and backward compatibility are realized. Meanwhile, the TLS is used to improve the security of data transmission, and the MQTT QOS is used to improve the stability of data.
[0131] All the optional technical schemes described above can be combined to form optional embodiments of the present application, which will not be described here.
[0132] The following is an apparatus embodiment of the present application, which can be used to execute the method embodiments of the present application. For details not disclosed in the apparatus embodiments of the present application, please refer to the method embodiments of the present application.
[0133] Figure 8 FIG. 1 is a schematic diagram of a vehicle data transmission device provided in an embodiment of the present application. As shown in FIG. 1, the device comprises: Figure 8
[0134] The acquisition module 801 is configured to acquire first vehicle data and N serialization processing types of the first vehicle data, N being a positive integer.
[0135] The serialization processing module 802 is configured to perform variable-length serialization processing on the first vehicle data according to the N serialization processing types, to obtain N compressed first vehicle data.
[0136] The encryption module 803 is configured to determine target data in the N compressed first vehicle data based on a data transmission strategy, and perform encryption processing on the target data to obtain encrypted target data.
[0137] The transmission module 804 is configured to send the target data to a content service provider (TSP) server according to a quality of service (QoS) level.
[0138] According to the technical scheme provided in the embodiment, by acquiring vehicle data and N serialization processing types of the vehicle data, performing variable-length serialization processing on the vehicle data according to the N serialization processing types to obtain N compressed vehicle data, determining target data in the N compressed first vehicle data based on a data transmission strategy, performing encryption processing on the target data, and finally sending the encrypted target data to a TSP server according to a QoS level, the vehicle data can be compressed through serialization processing, and the compressed vehicle data of a target type is selected for transmission, which improves the flexibility of data transmission, and at the same time, the encryption processing and the QoS level sending strategy are used to improve the transmission security and reliability, thereby improving the data transmission efficiency.
[0139] In some embodiments, the N serialization processing types of the first vehicle data are obtained by: generating a serialization processing description file based on the DBC table corresponding to the first vehicle data, the serialization processing description file including M vehicle data structured objects, M being a positive integer greater than or equal to N, each vehicle data structured object corresponding to a serialization processing type; and determining the N serialization processing types from the M vehicle data structured objects.
[0140] In some embodiments, the vehicle data structured object includes a type structured object and a selection structured object, the type structured object defining different types of vehicle data structured objects, and the selection structured object determining a valid structured object from the defined vehicle data structured objects; and the N serialization processing types are determined from the M vehicle data structured objects by: in response to determining that the serialization processing description file does not include the selection structured object, determining that the serialization processing types corresponding to all type structured objects are the N serialization processing types; and in response to determining that the serialization processing description file includes the selection structured object, determining that the valid structured object determined by the selection structured object and an independent type structured object are the N serialization processing types, the independent type structured object being a structured object independent of the selection structured object.
[0141] In some embodiments, the target data in the N compressed first vehicle data is determined based on a data transmission strategy by: obtaining a preset data transmission strategy, determining the target data in the N compressed first vehicle data based on the preset transmission strategy; and in response to receiving a data transmission strategy adjustment message, adjusting the data transmission strategy and determining the target data in the N compressed first vehicle data based on the adjusted data transmission strategy.
[0142] In some embodiments, the first vehicle data is subjected to variable-length serialization processing to obtain compressed first vehicle data by: obtaining a key-value pair representation of the first vehicle data based on a DBC table corresponding to the first vehicle data; obtaining a numerical value of the first vehicle data from the key-value pair representation of the first vehicle data; in response to determining that the numerical value of the first vehicle data is positive, performing variable-length Varint encoding on the numerical value of the first vehicle data to obtain the compressed first vehicle data; or in response to determining that the numerical value of the first vehicle data is negative, mapping the numerical value of the first vehicle data to a positive number using a compression curve Zigzag encoding method; and performing variable-length Varint encoding on the first vehicle data mapped to a positive number to obtain the compressed first vehicle data.
[0143] In some embodiments, the compressed first vehicle data is encrypted to obtain encrypted first vehicle data, including: obtaining encryption information, the encryption information being determined according to a security certificate issued by a vehicle machine provider; encrypting the compressed first vehicle data by using the encryption information to obtain the encrypted first vehicle data; and sending the encrypted first vehicle data to a content service provider TSP server according to a quality of service level, including: obtaining a priority of the first vehicle data and a current network quality parameter; determining the quality of service level of this transmission according to the priority and the current network quality parameter; and sending the encrypted first vehicle data to the content service provider TSP server according to the quality of service level.
[0144] In some embodiments, the method further includes: receiving second vehicle data sent by the content service provider TSP server; and performing deserialization processing on the second vehicle data to obtain second vehicle data executable by the vehicle machine.
[0145] It should be understood that the size of the serial number of each step in the above embodiments does not mean the order of execution, and the execution order of each process should be determined according to its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0146] Figure 9 is a schematic diagram of an electronic device provided by an embodiment of the present application. As shown in Figure 9 The electronic device 9 of this embodiment includes a processor 901, a memory 902, and a computer program 903 stored in the memory 902 and executable on the processor 901. The processor 901 implements the steps in each of the above method embodiments when executing the computer program 903. Alternatively, the processor 901 implements the functions of each module / unit in each of the above device embodiments when executing the computer program 903.
[0147] The electronic device 9 can be a desktop computer, a notebook, a palm computer, and a cloud server, etc. The electronic device 9 can include but is not limited to the processor 901 and the memory 902. Those skilled in the art can understand that Figure 9 The electronic device 9 is only an example and does not constitute a limitation on the electronic device 9, and can include more or fewer components or different components than those shown.
[0148] The processor 901 can be a central processing unit (CPU), and can also be other general-purpose processors, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
[0149] The memory 902 can be an internal storage unit of the electronic device 9, for example, a hard disk or a memory of the electronic device 9. The memory 902 can also be an external storage device of the electronic device 9, for example, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device 9. The memory 902 can also include both the internal storage unit and the external storage device of the electronic device 9. The memory 902 is used to store computer programs and other programs and data required by the electronic device.
[0150] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the division of the above functional units and modules is exemplified, and in actual application, the above functions can be completed by different functional units and modules according to needs, that is, the internal structure of the device is divided into different functional units or modules to complete all or part of the functions described above. Each functional unit and module in the embodiment can be integrated in one processing unit, or each unit can exist physically, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software functional unit.
[0151] The integrated modules / units, if implemented in the form of software functional units and sold or used as independent products, can be stored in a computer readable storage medium. Based on such understanding, all or part of the processes in the above-mentioned embodiment methods can also be completed by a computer program instructing related hardware, and the computer program can be stored in a computer readable storage medium. The computer program can be executed by a processor to implement the steps of the above-mentioned various method embodiments. The computer program can include computer program code, which can be in the form of source code, object code, executable files, or some intermediate forms. The computer readable medium can include any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal, and software distribution medium, etc.
[0152] The above embodiments are only used to illustrate the technical solutions of the present application, but not limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacements for part of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application.
Claims
1. A vehicle data transmission method, characterized in that: The method is executed by the vehicle computer and is used to transmit vehicle data between the vehicle computer and a content service provider TSP server; The method comprises: Acquiring first vehicle data; Generate a serialization processing description file based on the DBC table corresponding to the first vehicle data, the serialization processing description file including M vehicle data structured objects, each vehicle data structured object corresponding to a serialization processing type, in response to determining that the serialization processing description file does not include a selected structured object, determine that the serialization processing types corresponding to all types of structured objects are N serialization processing types; in response to determining that the serialization processing description file includes a selected structured object, determine that valid structured objects and independent type structured objects determined by the selected structured object are N serialization processing types, the type structured object defines different types of vehicle data structured objects, the selected structured object determines a valid structured object in the defined vehicle data structured object, and the independent type structured object is a structured object independent of the selected structured object, N is a positive integer, and M is a positive integer greater than or equal to N; performing variable-length serialization processing on the first vehicle data according to the N serialization processing types to obtain N compressed first vehicle data; determining target data among the N compressed first vehicle data based on a data transmission strategy, and encrypting the target data to obtain encrypted target data; The target data is sent to the content service provider TSP server according to the service quality level.
2. The method according to claim 1, characterized in that The determining the target data in the N compressed first vehicle data based on the data transmission strategy includes: Obtaining a preset data transmission strategy, and determining target data among the N compressed first vehicle data based on the preset data transmission strategy; In response to receiving the data transmission strategy adjustment message, the data transmission strategy is adjusted, and target data among the N compressed first vehicle data are determined based on the adjusted data transmission strategy.
3. The method according to claim 2, characterized in that The first vehicle data is subjected to variable-length serialization processing to obtain compressed first vehicle data, including: Obtaining a key-value pair representation of the first vehicle data based on the DBC table corresponding to the first vehicle data; Obtaining a value of the first vehicle data from the first vehicle data represented in a key-value pair format; In response to determining that the value of the first vehicle data is a positive number, performing variable-length Varint encoding on the value of the first vehicle data to obtain compressed first vehicle data; or In response to determining that the value of the first vehicle data is a negative number, mapping the value of the first vehicle data to a positive number using a compression curve Zigzag encoding method; The first vehicle data mapped to a positive number is subjected to variable-length Varint encoding to obtain compressed first vehicle data.
4. The method according to claim 1, wherein Encrypting the compressed first vehicle data to obtain encrypted first vehicle data includes: Obtaining encrypted information, where the encrypted information is determined based on a security certificate issued by the vehicle computer supplier; encrypting the compressed first vehicle data using the encryption information to obtain encrypted first vehicle data; The step of sending the encrypted first vehicle data to the content service provider TSP server according to the service quality level includes: Obtaining the priority of the first vehicle data and current network quality parameters; Determine the quality of service level of this transmission according to the priority and the current network quality parameter; The encrypted first vehicle data is sent to the content service provider TSP server according to the service quality level.
5. The method according to any one of claims 1 to 4, characterized in that The method further comprises: receiving second vehicle data sent by the content service provider TSP server; The second vehicle data is deserialized to obtain second vehicle data executable by the vehicle computer.
6. A vehicle data transmission device, characterized in that: include: an acquisition module configured to acquire first vehicle data and generate a serialization processing description file based on a DBC table corresponding to the first vehicle data, wherein the serialization processing description file includes M vehicle data structured objects, each vehicle data structured object corresponding to a serialization processing type, and in response to determining that the serialization processing description file does not include a selected structured object, determine that the serialization processing types corresponding to all types of structured objects are N serialization processing types; In response to determining that the serialization process description file includes a selected structured object, determining that valid structured objects and independent type structured objects determined by the selected structured object are N serialization process types, the type structured objects defining different types of vehicle data structured objects, the selected structured object determining valid structured objects in the defined vehicle data structured objects, the independent type structured objects being structured objects independent of the selected structured object, N being a positive integer, and M being a positive integer greater than or equal to N; a serialization processing module configured to perform variable-length serialization processing on the first vehicle data according to the N serialization processing types to obtain N compressed first vehicle data; an encryption module configured to determine target data among the N compressed first vehicle data based on a data transmission strategy, and encrypt the target data to obtain encrypted target data; The transmission module is configured to send the target data to the content service provider TSP server according to the service quality level.
7. 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 5 are implemented.
8. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Configurable method for multi-vehicle model body information acquisition system
CN104980516A
In-vehicle interactive audio encryption method, device and equipment
CN111681662A