Vehicle data transmission method and device, electronic equipment and storage medium
By serializing the vehicle data, encryption and quality level transmission strategies, the problem of high efficiency and low cost of vehicle data transmission between the vehicle machine and the TSP server is solved, and more efficient and secure data transmission is achieved.
Patent Information
- Application Number
- CN202411769608.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-04
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2044-12-04
AI Technical Summary
The prior art vehicle machine exchanges vehicle data with TSP servers with high cost and low efficiency.
By acquiring vehicle data and its N serialization processing types, variable-length serialization processing is performed to compress the data; target data is determined based on the data transmission strategy, and encryption is performed; finally, the encrypted target data is sent to the TSP server according to the service quality level.
Improves the flexibility and efficiency of data transmission, and enhances the security and reliability of transmission.
Smart Images

Figure CN119628915A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of vehicle networking technology, and in particular to a vehicle data transmission method, device, electronic device and storage medium. Background Art
[0002] As vehicle electronic control systems become more complex, CAN (Controller Area Network) / CANFD (CAN with Flexible Data Rate) buses are widely used in the control systems of various vehicles as standard communication buses inside cars. CAN messages can transmit data from various sensors and controllers inside the vehicle in real time. However, with the development of IoT (Internet of Things) technology, more and more application scenarios require the transmission of vehicle data to remote servers or the cloud for processing and analysis.
[0003] Traditional CAN messages are difficult to apply directly to cloud or remote monitoring scenarios. In addition, vehicle CAN messages transmit a large amount of data, have high requirements for transmission delay, and have high overall transmission costs and low efficiency. Summary of the invention
[0004] In view of this, the embodiments of the present application provide a vehicle data transmission method, device, electronic device and storage medium to solve the problem of high cost and low efficiency when exchanging vehicle data between a vehicle computer and a TSP server in the prior art.
[0005] In a first aspect of an embodiment of the present application, a vehicle data transmission method is provided, the method being executed by a vehicle computer and used to transmit vehicle data between the vehicle computer and a content service provider TSP server, the method comprising:
[0006] Acquiring first vehicle data;
[0007] Obtain N serialization processing types of the first vehicle data, where N is a positive integer;
[0008] Perform variable-length serialization processing on the first vehicle data according to N serialization processing types to obtain N compressed first vehicle data;
[0009] Determine target data in the N compressed first vehicle data based on the data transmission strategy, encrypt the target data, and obtain encrypted target data;
[0010] Send target data to the content service provider TSP server according to the service quality level.
[0011] According to a second aspect of the present application, a vehicle data transmission device is provided, including:
[0012] An acquisition module is configured to acquire first vehicle data and acquire N serialization processing types of the first vehicle data, where N is a positive integer;
[0013] A serialization processing module is configured to perform variable-length serialization processing on the first vehicle data according to N serialization processing types to obtain N compressed first vehicle data;
[0014] An encryption module is configured to determine target data in the N compressed first vehicle data based on a data transmission strategy, encrypt the target data, and obtain encrypted target data;
[0015] The transmission module is configured to send the target data to the content service provider TSP server according to the service quality level.
[0016] According to a third aspect of an embodiment of the present application, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above method when executing the computer program.
[0017] According to a fourth aspect of an embodiment of the present application, a computer-readable storage medium is provided, which stores a computer program, and when the computer program is executed by a processor, the steps of the above method are implemented.
[0018] Compared with the prior art, the embodiments of the present application have the following beneficial effects: the embodiments of the present application obtain vehicle data and N serialization processing types of vehicle data, perform variable-length serialization processing on the vehicle data according to the N serialization processing types, obtain N compressed vehicle data, determine the target data in the N compressed first vehicle data based on the data transmission strategy, encrypt the target data, and finally send the encrypted target data to the TSP server according to the service quality level. The vehicle data can be compressed through serialization processing, and the compressed vehicle data of the target type can be selected for transmission, thereby improving the flexibility of data transmission, and at the same time, the encryption processing and quality level sending strategy are used to improve the transmission security and reliability, thereby improving the data transmission efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0020] Figure 1It is a flow chart of a vehicle data transmission method provided in an embodiment of the present application.
[0021] Figure 2 It is a flowchart of a method for obtaining N serialization processing types of first vehicle data provided in an embodiment of the present application.
[0022] Figure 3 It is a flowchart of a method for determining N serialization processing types in M vehicle data structured objects provided in an embodiment of the present application.
[0023] Figure 4 It is a flowchart of a method for determining target data among N compressed first vehicle data based on a data transmission strategy provided in an embodiment of the present application.
[0024] Figure 5 It is a flowchart of a method provided in an embodiment of the present application for performing variable-length serialization processing on first vehicle data to obtain compressed first vehicle data.
[0025] Figure 6 It is a flowchart of another vehicle data transmission method provided in an embodiment of the present application.
[0026] Figure 7 It is a flow chart of another vehicle data transmission method provided in an embodiment of the present application.
[0027] Figure 8 It is a schematic diagram of a vehicle data transmission device provided in an embodiment of the present application.
[0028] Fig. 9 It is a schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0029] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of 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] As mentioned above, with the development of IoT technology, more and more application scenarios require the transmission of vehicle data to remote servers or the cloud for processing and analysis. However, traditional CAN messages are difficult to directly apply to the cloud or remote monitoring scenarios, and the amount of data transmitted by vehicle CAN messages is large, the transmission delay requirements are high, the overall transmission cost is high and the efficiency is low.
[0032] Specifically, the traditional CAN bus communication method faces the following problems:
[0033] Traditional CAN messages are mainly transmitted in the local area network within the vehicle and are difficult to be directly applied to the cloud or remote monitoring scenarios.
[0034] Vehicle CAN messages transmit a large amount of data and have high requirements for transmission delay. Existing methods based on MQTT (Message Queuing Telemetry Transport) and TCP (Transmission Control Protocol) or other communication protocols are often difficult to meet.
[0035] In addition, CAN messages are in binary format, and data parsing and processing require an efficient serialization method. The relevant technology lacks an efficient and flexible data serialization mechanism.
[0036] At the same time, the current transparent transmission scheme transmits the vehicle CAN / CANFD message intact to the target device, or reduces the data transmission by shortening the cycle, for example, changing the data collection cycle of 1ms (milliseconds) to a 100ms cycle. Transparent transmission will lead to the transmission of a large amount of redundant data, especially when the vehicle data is frequently updated, which will lead to a very high network bandwidth occupation, easily causing network congestion and affecting transmission efficiency. Although shortening the cycle to transmit data reduces the amount of data transmission, it may also discard the changed data, resulting in the loss of important information.
[0037] In view of this, an embodiment of the present application provides a vehicle data transmission method, which obtains vehicle data and N serialization processing types of vehicle data, performs variable-length serialization processing on the vehicle data according to the N serialization processing types, obtains N compressed vehicle data, determines the target data in the N compressed first vehicle data based on the data transmission strategy, encrypts the target data, and finally sends the encrypted target data to the TSP server according to the service quality level. The vehicle data can be compressed through serialization processing, and compressed vehicle data of the target type can be selected for transmission, thereby improving the flexibility of data transmission, and at the same time, encryption processing and quality level sending strategies are used to improve transmission security and reliability, thereby improving data transmission efficiency.
[0038] Figure 1 FIG. 1 is a flow chart of a vehicle data transmission method provided by an embodiment of the present application. Figure 1 As shown, the method comprises the following steps:
[0039] In step S101 , first vehicle data is acquired.
[0040] In step S102, N serialization processing types of the first vehicle data are obtained.
[0041] Wherein, N is a positive integer.
[0042] In step S103, variable-length serialization processing is performed on the first vehicle data according to N serialization processing types to obtain N compressed first vehicle data.
[0043] In step S104, target data among the N compressed first vehicle data is determined based on the data transmission strategy, and the target data is encrypted to obtain encrypted target data.
[0044] In step S105, the target data is sent to the content service provider TSP server according to the service quality level.
[0045] In some embodiments of the present application, the method may be executed by a vehicle computer, such as a TBOX in a vehicle. Further, the method is used to transmit vehicle data between the vehicle computer and a TSP (Telematics Service Provider) server.
[0046] The vehicle data may be Ethernet data from an ECU (Electronic Control Unit) in a vehicle gateway, or Ethernet data that needs to be sent to an ECU in a vehicle gateway, or CAN message data from an onboard MCU (Microcontroller Unit) in a vehicle gateway, or CAN message data that needs to be sent to an onboard MCU in a vehicle gateway. In some embodiments, the vehicle data may also be other possible vehicle data, which is not limited here.
[0047] In some embodiments of the present application, the vehicle computer can obtain the first vehicle data and obtain N serialization processing types of the first vehicle data. In one example, the first vehicle data is the vehicle data that the vehicle computer needs to transmit to the TSP server. The vehicle computer can obtain the serialization processing description file of the first vehicle data, and then determine the serialization processing type of the first vehicle data specified in the serialization processing description file through a preset interface. The method for obtaining the serialization processing type is described in detail below and will not be repeated here.
[0048] In some implementations, the vehicle computer 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 one example, the N types of processing objects in the first vehicle data can be Protobuf variable-length serialization processing to compress the N types of processing objects. In another example, the N types of processing objects can be a combination of different types of data in the first vehicle data, such as a combination of all data in the first vehicle data, or a combination of some types of data in the first vehicle data.
[0049] In some embodiments of the present application, the target data in the N compressed first vehicle data can be determined based on the data transmission strategy. The data transmission strategy is used to specify the target data of 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 of compressed first vehicle data as the target data. For another example, the data transmission strategy can also specify some types of data in the compressed first vehicle data as the target data.
[0050] In some embodiments, the target data may be encrypted to obtain the encrypted target data. In one example, the target data may be encrypted using the TLS protocol in combination with the certification issued by the vehicle computer supplier itself, and a national encryption chip may be used during encryption to increase the key exchange speed and encryption and decryption speed.
[0051] In some implementations, the encrypted target data may be sent to the TSP server according to the service quality level, thereby achieving efficient data transmission between the vehicle and the TSP server. The service instruction level may be preset or dynamically determined, which is not limited here.
[0052] According to the technical solution provided in the embodiment of the present application, by acquiring vehicle data and N serialization processing types of vehicle data, variable-length serialization processing is performed on the vehicle data according to the N serialization processing types to obtain N compressed vehicle data, and the target data in the N compressed first vehicle data is determined based on the data transmission strategy, the target data is encrypted, and finally the encrypted target data is sent to the TSP server according to the service quality level. The vehicle data can be compressed through serialization processing, and compressed vehicle data of the target type can be selected for transmission, thereby improving the flexibility of data transmission, and at the same time, encryption processing and quality level sending strategies are used to improve transmission security and reliability, thereby improving data transmission efficiency.
[0053] Figure 2 1 is a flow chart of a method for obtaining N serialization processing types of first vehicle data provided by an embodiment of the present application. Figure 2 As shown, the method comprises the following steps:
[0054] In step S201, a serialization process description file is generated based on the 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, and the serialized processing description file can be generated by a serialization and deserialization processing framework, such as protobuf (Protocol Buffers, data structure serialization and deserialization framework) according to the DBC (Database Connector, database connection) 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 processing description file may include M customized vehicle data structured objects, and each vehicle data structured object corresponds to a serialization processing type. For example, the serialization processing description file may include a first vehicle data structured object, and the first vehicle data structured object corresponds to a serialization processing type for processing the entire amount of vehicle data. For another example, the serialization processing description file may also include a second vehicle data structured object, and the second vehicle data structured object corresponds to a serialization processing 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 a valid structured object in the defined vehicle data structured objects.
[0061] Figure 3 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 comprises the following steps:
[0062] In step S301, in response to determining that the serialization process description file does not include the selected structured object, it is determined that the serialization process types corresponding to all types of structured objects are N serialization process types.
[0063] In step S302, in response to determining that the serialization process description file includes a selected structured object, valid structured objects and independent type structured objects determined by the selected structured object are determined to be N serialization process types.
[0064] The independent type structured object is a structured object independent of the selected structured object. That is, the selected structured object may include multiple selected type structured objects, and the independent type structured object is a type structured object not included in the selected structured object.
[0065] In some embodiments of the present application, if the serialization process description file does not include the selected structured object, it can be determined that the serialization process types corresponding to all types of structured objects are N serialization process types. Conversely, if the serialization process description file includes the selected structured object, it is determined that the valid structured objects and independent type structured objects determined by the selected structured object are N serialization process types.
[0066] That is to say, the vehicle computer can obtain the message type of the vehicle data structured object recorded in the serialization processing description file through the proto interface. Among them, the vehicle data structured object in the serialization processing description file can be defined in the following way:
[0067] syntax="proto3";
[0068] / / Define the CanMessage message
[0069] message CanMessage{
[0070] uint32 can_id=1; / / CAN ID, type is uint32
[0071] uint64 timestamp=2; / / timestamp, type is int64
[0072] bytes raw_data=3; / / Original data, type is 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 the 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 syntax rule, and proto3 is the syntax format. CanMessage is a type structured object in vehicle data, and its serialized processing object is the original data of vehicle data. The type structured object in DBCMessage, and its serialized processing object is the selected data of vehicle data, such as vehicle speed data. VehicleMessage is a selection 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, and when oneof vehicle_data in the VehicleMessage is 2, its processing object is the DBCMessage structured object.
[0089] It can be understood that, in the above example, the selected data in the DBCMessage message is the vehicle speed. In actual use, the selected data can be set to any one or more of the vehicle data as needed, and there is no limitation here.
[0090] That is, the type of serialization processing for the first vehicle data may be first defined in the source code generated based on the proto framework, and then, according to the determined type, it may be selected whether to perform DBC parsing on the original data of the first vehicle data or on the selected data.
[0091] In the parsed data, a key-value pair structure can be used to separate vehicle data in different fields. For optional fields, if the field does not exist in the vehicle data message to be transmitted, the compressed vehicle data will not include the field, which can save the message size of the vehicle data transmission.
[0092] Before communication, the data sender and receiver can agree on the field number. The field number itself does not directly occupy the bit in the binary sequence of the compressed vehicle data, but is encoded into a key together with the field type. The size of this key is variable and depends on the field number and type. The specific encoding method can be to shift the field number left by 3 bits and then AND it 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 .proto syntax description file, you can also use the proto compiler to generate source code for the corresponding platform. The generated source code can provide common data structures and related serialization and deserialization interfaces on different platforms, through which cross-platform communication can be achieved.
[0094] Figure 4 is a flow chart 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. Figure 4 As shown, the method comprises the following steps:
[0095] In step S401, a preset data transmission strategy is obtained, and target data among 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 among the N compressed first vehicle data is determined based on the adjusted data transmission strategy.
[0097] In some embodiments of the present application, when determining target data among N compressed first vehicle data based on a data transmission strategy, a preset data transmission strategy may be obtained, and the target data among N compressed first vehicle data may be determined based on the preset transmission strategy.
[0098] In one example, the preset data transmission strategy can set the priority of vehicle data processed using different serialization processing types, and determine the vehicle data corresponding to the type with the highest priority in the preset data transmission strategy as the target data among the N compressed first vehicle data.
[0099] For example, the preset data transmission strategy sets that the vehicle data after serialization of the full data has the highest priority, and the vehicle data after serialization of the vehicle speed has the second highest priority. If the N compressed first vehicle data include the first vehicle data after serialization of the full data, then the first vehicle data after serialization of the full data can be determined as the target data. Conversely, if the N compressed first vehicle data do not include the first vehicle data after serialization of the full data, but include the first vehicle data after serialization of the vehicle speed, then the first vehicle data after serialization of the vehicle speed can be determined as the target data. And so on.
[0100] In some implementations, 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 factors such as the current vehicle system operating status, the network quality between the vehicle and the TSP server, etc.
[0101] In one example, if the vehicle computer system is currently running under a heavy load and has a slow processing speed, or the network quality between the vehicle computer and the TSP server is poor and the remaining bandwidth is small, the data transmission strategy can be adjusted to reduce the data transmission volume to ensure the transmission quality of important data.
[0102] For example, the preset data transmission strategy is to transmit the first vehicle data after serializing the full data, and the adjusted data transmission strategy may be to transmit the first vehicle data after serializing part of the data.
[0103] For another example, the preset data transmission strategy is to transmit the first vehicle data after serializing the first part of data, and the adjusted data transmission strategy may be to transmit the first vehicle data after serializing the second part of data, wherein the amount of the second part of data is less than that of the first part of data, and the transmission priority in the second part of data is higher than the transmission priority of at least one item of data in the first part of data.
[0104] In another example, if the current operating load of the vehicle system is reduced, the processing speed is increased, or the network quality between the vehicle and the TSP server is improved and the remaining bandwidth is increased, the data transmission strategy can be adjusted and the data transmission volume can be increased to ensure the real-time transmission of vehicle data.
[0105] For example, the preset data transmission strategy is to transmit the first vehicle data after serializing part of the data, and the adjusted data transmission strategy may be to transmit the first vehicle data after serializing the entire data.
[0106] For another example, the preset data transmission strategy is to transmit the first vehicle data after serializing the second part of the data, and the adjusted data transmission strategy may be to transmit the first vehicle data after serializing the first part of the data, wherein the amount of the second part of the data is less than that of the first part of the data, and the transmission priority in the second part of the data is higher than the transmission priority of at least one item of data in the first part of the data.
[0107] Figure 5 1 is a flow chart 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. Figure 5 As shown, the method comprises the following steps:
[0108] In step S501, a key-value pair representation of the first vehicle data is obtained based on a DBC table corresponding to the first vehicle data.
[0109] In step S502 , the value of the first vehicle data is obtained from the first vehicle data in the key-value pair representation.
[0110] In step S503 , in response to determining that the value of the first vehicle data is a positive number, variable-length Varint encoding is performed on the value of the first vehicle data to obtain compressed first vehicle data.
[0111] In step S504, in response to determining that the value of the first vehicle data is a negative number, the value of the first vehicle data is mapped to a positive number using a compression curve Zigzag encoding method.
[0112] In step S505, variable-length Varint encoding is performed on the first vehicle data mapped to a positive number to obtain compressed first vehicle data.
[0113] In some embodiments of the present application, when the first vehicle data is subjected to variable-length serialization processing, a key-value pair representation of the first vehicle data can be obtained based on the DBC table corresponding to the first vehicle data, and a value of the first vehicle data can be obtained from the first vehicle data in the key-value pair representation. If the value of the first vehicle data obtained is a positive integer type, such as an unsigned integer (unit32) or a positive signed integer (int32), the value of the first vehicle data can be subjected to variable-length Varint encoding to obtain 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, where 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, where the highest bit 1 of the first byte indicates that there are bytes to follow, and the highest bit 0 of the second byte indicates that this is the last byte.
[0115] For integers with smaller values, using Varint encoding can significantly save space. Since 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 acquired 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 can be variable-length Varint encoded to obtain the compressed first vehicle data.
[0117] The Zigzag encoding rule may be: for a positive number, it is mapped to n->2*n; for a negative number, it is mapped to n->2*|n|-1, where n is the value to be encoded.
[0118] In some embodiments of the present application, the compressed first vehicle data is encrypted to obtain the encrypted first vehicle data by obtaining encryption information, where the encryption information is determined based on a security certificate issued by a vehicle computer supplier; and the compressed first vehicle data is encrypted using the encryption information to obtain the encrypted first vehicle data.
[0119] Furthermore, sending the encrypted first vehicle data to the content service provider TSP server according to the service quality level may be: obtaining the priority of the first vehicle data and the current network quality parameters; determining the service quality level of this transmission according to the priority and the current network quality parameters; and sending the encrypted first vehicle data to the content service provider TSP server according to the service quality level.
[0120] In one example, the first vehicle data can be transmitted via the MQTTs protocol (such as a version of the MQTT protocol encrypted via TLS / SSL, i.e., MQTT Secure), and a security layer is added to ensure confidentiality, integrity, and authentication of data transmission.
[0121] MQTT is a lightweight publish / subscribe message transmission 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 confidentiality and integrity during 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 via the MQTT protocol.
[0122] In some embodiments of the present application, the vehicle data transmission method may further include a step in which the vehicle computer receives vehicle data from a TSP server. In one example, the vehicle computer may receive second vehicle data sent by the TSP server, and then deserialize the second vehicle data to obtain second vehicle data executable by the vehicle computer. The second vehicle data may also be original data based on the vehicle data, or selected data of the vehicle data.
[0123] Figure 6 FIG. 1 is a flow chart of another vehicle data transmission method provided by an embodiment of the present application. Figure 6 As shown, the DBC table data can be parsed on the vehicle side using a python tool to generate a .proto file, protect the custom .proto message type, and then serialize the vehicle data based on the .proto file, and send the serialized vehicle data to the strategy module. After the strategy module determines the sending strategy, it sends the vehicle data to the data encryption and decryption module, and 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 the vehicle data to the data transmission module, and the data transmission module sends the data to the data encryption and decryption module for decryption. The decrypted vehicle data is transmitted to the data sending strategy module. After the sending strategy is determined, the vehicle data is deserialized based on the sending strategy, and then the deserialized vehicle data is sent to the vehicle computer.
[0125] In other words, the vehicle side can use the MQTT protocol, TSL protocol and protobuf serialization data to achieve effective compression of CAN / CANFD data, and use TLS to encrypt data transmission. Use MQTT's QoS (Quality of Service) to achieve reliable data transmission. The Ethernet data from other ECUs on the gateway and the original CAN data on the MCU can be parsed into signal and value formats through a dbc parsing module, and then serialized into binary data through the protobuf serialization module, and then encrypted into encrypted data through the TLS encryption module. Finally, according to the QoS level defined by the message, the encrypted data is sent to the TSP server through the MQTT sending module.
[0126] Figure 7 FIG. 1 is a flow chart of another vehicle data transmission method provided in an embodiment of the present application. Figure 7 As shown, each module in the vehicle computer can be initialized first, and then the configuration file can be parsed and configured with the priority of the vehicle data, serialization processing and transmission type, that is, direct CAN transparent transmission or partial DBC bit transmission. Next, the serialization module packages 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 choose to use the CAN byte stream data in the parameter message or choose to transmit the parsed DBC signal data. After the selection module fills the data, the data stream is transferred to the encryption module.
[0127] Among them, the forwarding strategy can be adjusted dynamically, that is, the vehicle computer can detect the system and network performance in real time and dynamically configure the forwarding strategy. After the vehicle data is determined according to the determined forwarding strategy, the vehicle data can be sent to the encryption module, which encrypts the vehicle data and sends it to the TSP server through the MQTT protocol.
[0128] The MQTT protocol is based on the publish / subscribe model, allowing devices to communicate through the Broker. The publisher publishes the message to the Broker, which stores the message in a queue associated with the topic and then distributes it to all subscribers who have subscribed to the topic. QoS is used to control the reliability and transmission speed of the message.
[0129] The MQTT protocol supports three QoS levels: QoS 0 (at most once), QoS 1 (at least once), and QoS 2 (exactly once).
[0130] By adopting the technical solution provided in the embodiment of the present application, the message type defined by the protobuff tool can be generated by the tool, and the C, C++, java, and other codes are increased to increase cross-platform and portability. By defining the data model by the .proto file, fields can be easily added or deleted without destroying the existing protocol, achieving smooth version upgrades and backward compatibility. At the same time, TLS is used to improve the security of data transmission, and MQTT QOS is used to improve the stability of data.
[0131] All the above optional technical solutions can be arbitrarily combined to form optional embodiments of the present application, which will not be described one by one here.
[0132] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.
[0133] Figure 8 Schematic diagram of a vehicle data transmission device provided in an embodiment of the present application. Figure 8 As shown, the device comprises:
[0134] The acquisition module 801 is configured to acquire first vehicle data and acquire N serialization processing types of the first vehicle data, where N is a positive integer.
[0135] The serialization processing module 802 is configured to perform variable-length serialization processing on the first vehicle data according to N serialization processing types to obtain N compressed first vehicle data.
[0136] The encryption module 803 is configured to determine target data among the N compressed first vehicle data based on the data transmission strategy, and encrypt the target data to obtain encrypted target data.
[0137] The transmission module 804 is configured to send the target data to the content service provider TSP server according to the service quality level.
[0138] According to the technical solution provided in the embodiment of the present application, by acquiring vehicle data and N serialization processing types of vehicle data, variable-length serialization processing is performed on the vehicle data according to the N serialization processing types to obtain N compressed vehicle data, and the target data in the N compressed first vehicle data is determined based on the data transmission strategy, the target data is encrypted, and finally the encrypted target data is sent to the TSP server according to the service quality level. The vehicle data can be compressed through serialization processing, and compressed vehicle data of the target type can be selected for transmission, thereby improving the flexibility of data transmission, and at the same time, encryption processing and quality level sending strategies are used to improve transmission security and reliability, thereby improving data transmission efficiency.
[0139] In some embodiments, obtaining N serialization processing types of the first vehicle data includes: 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 is a positive integer greater than or equal to N, and each vehicle data structured object corresponds to a serialization processing type; determining N serialization processing types among 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 defines different types of vehicle data structured objects, the selection structured object determines a valid structured object among the defined vehicle data structured objects; N serialization processing types are determined among the M vehicle data structured objects, including: 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 N serialization processing types; in response to determining that the serialization processing description file includes the selection structured object, determining that the valid structured objects determined by the selection structured object and the independent type structured objects are N serialization processing types, and the independent type structured object is a structured object independent of the selection structured object.
[0141] In some embodiments, determining target data among N compressed first vehicle data based on a data transmission strategy includes: obtaining a preset data transmission strategy, determining target data among N compressed first vehicle data based on the preset transmission strategy; adjusting the data transmission strategy in response to receiving a data transmission strategy adjustment message, and determining target data among 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, including: obtaining a key-value pair representation of the first vehicle data based on a DBC table corresponding to the first vehicle data; obtaining a value of the first vehicle data from the first vehicle data in the key-value pair representation; 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; performing variable-length Varint encoding on the first vehicle data mapped to a positive number to obtain compressed first vehicle data.
[0143] In some implementations, the compressed first vehicle data is encrypted to obtain the encrypted first vehicle data, including: obtaining encryption information, where the encryption information is determined based on a security certificate issued by a vehicle computer supplier; using the encryption information to encrypt the compressed first vehicle data to obtain the encrypted first vehicle data; sending the encrypted first vehicle data to a content service provider TSP server according to a service quality level, including: obtaining a priority level and a current network quality parameter of the first vehicle data; determining a service quality level for this transmission based on the priority level and the current network quality parameter; and sending the encrypted first vehicle data to a content service provider TSP server according to the service quality level.
[0144] In some implementations, the method further includes: receiving second vehicle data sent by a content service provider TSP server; and deserializing the second vehicle data to obtain second vehicle data executable by the vehicle computer.
[0145] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0146] Fig. 9 Schematic diagram of an electronic device provided in an embodiment of the present application. Fig. 9 As shown, 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. When the processor 901 executes the computer program 903, the steps in the above-mentioned method embodiments are implemented. Alternatively, when the processor 901 executes the computer program 903, the functions of the modules / units in the above-mentioned device embodiments are implemented.
[0147] The electronic device 9 may be a desktop computer, a notebook, a PDA, a cloud server, or other electronic device. The electronic device 9 may include, but is not limited to, a processor 901 and a memory 902. Those skilled in the art will appreciate that Fig. 9 The electronic device 9 is merely an example and does not limit the electronic device 9 , and may include more or less components than those shown in the figure, or different components.
[0148] The processor 901 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
[0149] The memory 902 may be an internal storage unit of the electronic device 9, for example, a hard disk or memory of the electronic device 9. The memory 902 may 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 may also include both an internal storage unit of the electronic device 9 and an external storage device. 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 simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units.
[0151] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. The computer program may include computer program code, which may be in source code form, object code form, executable file or some intermediate form. Computer-readable media may include: any entity or device capable of carrying computer program code, recording medium, U disk, mobile hard disk, 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, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all 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; Obtaining N serialization processing types of the first vehicle data, where N is a positive integer; Perform variable-length serialization processing on the first vehicle data according to the N serialization processing types to obtain N compressed first vehicle data; Determine target data in the N compressed first vehicle data based on a data transmission strategy, and encrypt 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 obtaining of N serialization processing types of the first vehicle data includes: Generate a serialization processing description file based on the DBC table corresponding to the first vehicle data, wherein 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; The N serialization processing types are determined in the M vehicle data structured objects.
3. The method according to claim 2, characterized in that The vehicle data structured object includes 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 a valid structured object in the defined vehicle data structured objects; The determining the N serialization processing types in the M vehicle data structured objects includes: In response to determining that the serialization process description file does not include the selected structured object, determining that the serialization process types corresponding to all types of structured objects are the N serialization process types; In response to determining that the serialization process description file includes a selected structured object, valid structured objects and independent type structured objects determined by the selected structured object are determined to be the N serialization process types, and the independent type structured object is a structured object independent of the selected structured object.
4. 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: Acquire a preset data transmission strategy, and determine 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 is determined based on the adjusted data transmission strategy.
5. The method according to claim 4, 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.
6. The method according to claim 1, characterized in that The compressed first vehicle data is encrypted to obtain the encrypted first vehicle data, including: Obtaining encrypted information, where the encrypted information is determined based on a security certificate issued by a 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 service quality 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.
7. The method according to any one of claims 1 to 6, 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.
8. A vehicle data transmission device, characterized in that: include: An acquisition module is configured to acquire first vehicle data and acquire N serialization processing types of the first vehicle data, where N is a positive integer; a serialization processing module, configured to perform variable-length serialization processing on the first vehicle data respectively according to the N serialization processing types to obtain N compressed first vehicle data; an encryption module, configured to determine target data in 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.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium 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 7 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
Drive-by-wire function test method of vehicle, electronic equipment, medium and program product
CN115618567A
Vehicle data acquisition method and device, electronic equipment and readable storage medium
CN117956005A
A system and method for image-based campus vehicle management
IN201911026586A
Cited By
Data communication method, terminal, electronic equipment, storage medium, product and vehicle
CN120200852A