CN116506848A - Secret transmission method and device for upgrading data packet, electronic equipment and storage medium - Google Patents

Secret transmission method and device for upgrading data packet, electronic equipment and storage medium Download PDF

Info

Publication number
CN116506848A
CN116506848A CN202310465514.3A CN202310465514A CN116506848A CN 116506848 A CN116506848 A CN 116506848A CN 202310465514 A CN202310465514 A CN 202310465514A CN 116506848 A CN116506848 A CN 116506848A
Authority
CN
China
Prior art keywords
data packet
data
encryption
transmission
segment
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310465514.3A
Other languages
Chinese (zh)
Inventor
邓凌天
韩波
范例
陈建伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chongqing Selis Phoenix Intelligent Innovation Technology Co ltd
Original Assignee
Chengdu Seres Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Chengdu Seres Technology Co Ltd filed Critical Chengdu Seres Technology Co Ltd
Priority to CN202310465514.3A priority Critical patent/CN116506848A/en
Publication of CN116506848A publication Critical patent/CN116506848A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/03Protecting confidentiality, e.g. by encryption
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/30Services specially adapted for particular environments, situations or purposes
    • H04W4/40Services specially adapted for particular environments, situations or purposes for vehicles, e.g. vehicle-to-pedestrians [V2P]
    • H04W4/44Services specially adapted for particular environments, situations or purposes for vehicles, e.g. vehicle-to-pedestrians [V2P] for communication between vehicles and infrastructures, e.g. vehicle-to-cloud [V2C] or vehicle-to-home [V2H]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W8/00Network data management
    • H04W8/22Processing or transfer of terminal data, e.g. status or physical capabilities
    • H04W8/24Transfer of terminal data
    • H04W8/245Transfer of terminal data from a network towards a terminal
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/50Reducing energy consumption in communication networks in wire-line communication networks, e.g. low power modes or reduced link rate

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Databases & Information Systems (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The application relates to the technical field of information security, and provides a secret transmission method and device of an upgrade data packet, electronic equipment and a storage medium. The method comprises the following steps: acquiring an upgrade data packet corresponding to a target ECU; acquiring secret transmission configuration information corresponding to a target ECU; according to the secret transmission configuration information, global encryption is carried out on the upgrading data packet in a global encryption mode, so that an overall encryption data packet is obtained, and the overall encryption data packet is transmitted to the target ECU according to a first segmentation transmission mode; or splitting the upgrading data packet into a plurality of sub-data packets, encrypting each sub-data packet by adopting a local encryption mode to obtain a segmented encryption data packet corresponding to each sub-data packet, and transmitting each segmented encryption data packet to the target ECU according to a second segmented transmission mode. The method and the device can realize secret transmission of the upgrade data packet, and greatly reduce risks of software data leakage and malicious tampering.

Description

Secret transmission method and device for upgrading data packet, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of information security technologies, and in particular, to a secure transmission method, apparatus, electronic device, and storage medium for an upgrade data packet.
Background
In order to meet the increasing various functional demands of people on intelligent vehicles, higher demands are also put on the update iteration speed and quality of firmware and software of the vehicles. Because OTA (Over the Air Technology, over-the-air technology) has the characteristics of high speed, low cost, etc., it has been widely used for upgrading firmware and software of intelligent vehicles.
Currently, in the OTA upgrading process, a data transmission end generally transmits a plaintext upgrading data packet to an ECU (Electronic Control Unit ) needing to perform a swipe upgrade directly through a CAN (Controller Area Network ) bus of a target vehicle. In the process, some external devices (such as other vehicles and the like) CAN easily intercept the upgrade data packet transmitted by the data transmission end by monitoring the communication message on the CAN bus of the target vehicle, and easily restore the software data in the upgrade data packet by 100%, thereby causing software data leakage and easily infringement of the intellectual property of a software developer. In addition, in the process, if the upgrade data packet is intercepted by some illegal external equipment and the software data in the upgrade data packet is maliciously tampered, the upgrade of the ECU is easy to be abnormal, so that the functional integrity of the whole vehicle and the safety of the vehicle are affected.
Disclosure of Invention
In view of this, the embodiments of the present application provide a secure transmission method, apparatus, electronic device, and storage medium for an upgrade data packet, so as to solve the problem in the prior art that the upgrade data packet is easily intercepted and restored by an external device or maliciously tampered, so that software data is easily leaked, or an ECU upgrade is easily caused to be abnormal, thereby affecting the functional integrity of the whole vehicle and the safety of the vehicle.
In a first aspect of an embodiment of the present application, a secure transmission method for an upgrade data packet is provided, including:
determining a target ECU and acquiring an upgrade data packet corresponding to the target ECU;
acquiring secret transmission configuration information corresponding to a target ECU, wherein the secret transmission configuration information comprises a data transmission mode and an encryption mode, the data transmission mode comprises a first segmentation transmission mode and a second segmentation transmission mode, and the encryption mode comprises a global encryption mode and a local encryption mode;
if the data transmission mode in the secret transmission configuration information corresponding to the target ECU is a first segment transmission mode and the encryption mode is a global encryption mode, performing global encryption on the upgrading data packet by adopting the global encryption mode to obtain a whole encryption data packet, and transmitting the whole encryption data packet to the target ECU according to the first segment transmission mode;
If the data transmission mode in the secret transmission configuration information corresponding to the target ECU is a second segmented transmission mode and the encryption mode is a local encryption mode, dividing the upgrading data packet into a plurality of sub-data packets, encrypting each sub-data packet by adopting the local encryption mode to obtain a segmented encryption data packet corresponding to each sub-data packet, and transmitting each segmented encryption data packet to the target ECU according to the second segmented transmission mode.
In a second aspect of the embodiments of the present application, a secure transmission device for an upgrade data packet is provided, including:
the determining module is configured to determine a target ECU and acquire an upgrade data packet corresponding to the target ECU;
the acquisition module is configured to acquire secret transmission configuration information corresponding to the target ECU, wherein the secret transmission configuration information comprises a data transmission mode and an encryption mode, the data transmission mode comprises a first segment transmission mode and a second segment transmission mode, and the encryption mode comprises a global encryption mode and a local encryption mode;
the first transmission module is configured to perform global encryption on the upgrade data packet by adopting a global encryption mode if the data transmission mode in the secret transmission configuration information corresponding to the target ECU is a first segment transmission mode and the encryption mode is a global encryption mode, so as to obtain an overall encryption data packet, and transmit the overall encryption data packet to the target ECU according to the first segment transmission mode;
And the second transmission module is configured to split the upgrade data packet into a plurality of sub-data packets if the data transmission mode in the secret transmission configuration information corresponding to the target ECU is segmented transmission and the encryption mode is a local encryption mode, encrypt each sub-data packet by adopting the local encryption mode to obtain a segmented encryption data packet corresponding to each sub-data packet, and transmit each segmented encryption data packet to the target ECU according to the second segmented transmission mode.
In a third aspect of the embodiments of the present application, there is provided an electronic device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the steps of the above method when executing the computer program.
In a fourth aspect of the embodiments of the present application, there is provided a computer readable storage medium storing a computer program which, when executed by a processor, implements the steps of the above method.
Compared with the prior art, the embodiment of the application has the beneficial effects that: the method comprises the steps of firstly determining a target ECU and obtaining an upgrade data packet corresponding to the target ECU; then, acquiring secret transmission configuration information corresponding to the target ECU; then, according to the data transmission mode and encryption mode in the secret transmission configuration information, global encryption is carried out on the upgrading data packet by adopting a global encryption mode to obtain a whole encrypted data packet, and the whole encrypted data packet is transmitted to the target ECU according to the first segmentation transmission mode; or, split the upgrade data packet into a plurality of sub data packets, encrypt each sub data packet by adopting a local encryption mode to obtain a segmented encryption data packet corresponding to each sub data packet, and transmit each segmented encryption data packet to the target ECU according to a second segmented transmission mode, thereby not only enhancing the confidentiality of the upgrade data packet transmitted to the target ECU by the data transmission end in the OTA upgrade process and increasing the cracking difficulty of the upgrade data packet by external equipment, so that the upgrade data packet is difficult to crack and restore all software data even if the upgrade data packet is intercepted by the external equipment, avoiding the leakage of the software data, but also effectively preventing the malicious tampering of the upgrade data by the external equipment, being beneficial to ensuring the normal upgrade of the ECU and ensuring the functional integrity and the vehicle safety of the whole vehicle.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following description will briefly introduce the drawings that are needed in the embodiments or the description of the prior art, it is obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic view of an application scenario according to an embodiment of the present application;
fig. 2 is a flow chart of a secure transmission method of an upgrade data packet according to an embodiment of the present application;
fig. 3 is a schematic diagram of a basic flow of a data transmission end transmitting upgrade data to an ECU according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of a secure transmission device for an upgrade data packet according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system configurations, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
A secure transmission method and apparatus for an upgrade data packet according to embodiments of the present application will be described in detail with reference to the accompanying drawings.
Fig. 1 is a schematic view of an application scenario according to an embodiment of the present application. The application scenario may include a data transmission side 101 and a target ECU 102. The data transmission terminal 101 and the target ECU 102 may be connected via a gateway. The data transmission end 101 and the gateway CAN be connected through an ethernet bus, and the gateway and the target ECU 102 CAN be connected through a CAN bus, a CANFD bus or an ethernet bus. The communication protocol between the data transmission side 101 and the target ECU 102 may employ a UDS (Unified Diagnostic Services, unified diagnostic service) communication protocol.
The data transmission side 101 may be a TBOX (remote information processor) for acquiring an upgrade data packet provided by a software developer and forwarding the upgrade data packet to the target ECU 102 via a gateway.
The target ECU 102 generally refers to an ECU that needs to be updated by a brush, and may be, for example, an ECU in a vehicle that is related to vehicle power control (e.g., an engine, etc.), or an ECU in a vehicle that is related to an entertainment system (e.g., car music, etc.).
In this embodiment of the present application, the data transmission end 101 may be connected to a server of a software developer via a network (may be a wired network using a coaxial cable, a twisted pair cable, and an optical fiber, or may be a wireless network that can implement interconnection of various communication devices without wiring, for example, bluetooth (Bluetooth), near field communication (Near Field Communication, NFC), infrared (Infrared), etc.), and is connected to each ECU of the vehicle via a gateway. After determining a target ECU, acquiring an upgrade data packet corresponding to the target ECU provided by a software developer; then, acquiring secret transmission configuration information corresponding to the target ECU; then, according to the data transmission mode and encryption mode in the secret transmission configuration information, global encryption is carried out on the upgrading data packet by adopting a global encryption mode, so that a whole encrypted data packet is obtained, and the whole encrypted data packet is transmitted to the target ECU through the gateway according to the first segmentation transmission mode; or splitting the upgrade data packet into a plurality of sub data packets, and encrypting each sub data packet by adopting a local encryption mode to obtain a segmented encryption data packet corresponding to each sub data packet, and transmitting each segmented encryption data packet to the target ECU through the gateway according to a second segmented transmission mode. By the method, confidentiality of the data transmission end for transmitting the upgrading data packet to the target ECU in the OTA upgrading process is enhanced, cracking difficulty of external equipment on the upgrading data packet is increased, the upgrading data packet is difficult to crack and restore all software data even if intercepted by the external equipment, leakage of the software data is avoided, malicious tampering of the upgrading data by the external equipment can be effectively prevented, normal upgrading of the ECU is guaranteed, and functional integrity and vehicle safety of the whole vehicle are guaranteed.
Fig. 2 is a flow chart of a secure transmission method of an upgrade data packet according to an embodiment of the present application. The secure transmission method of the upgrade data packet of fig. 2 may be performed by the data transmission terminal 101 of fig. 1. As shown in fig. 2, the secure transmission method of the upgrade data packet includes:
step S201, determining a target ECU and acquiring an upgrade data packet corresponding to the target ECU.
In an embodiment, the data transmission end 101 may determine the target ECU based on the acquired ECU update data packet issued by the software developer for a certain ECU(s) at the vehicle end. For example, the software developer may issue an updated ECU update data packet periodically or aperiodically, and the data transmission terminal 101 may monitor and download, in real time, the ECU update data packet issued by the software developer, where the ECU update data packet carries unique identification information (such as a unique ID) of the ECU, and the ECU corresponding to the unique identification information is the target ECU.
In another embodiment, the data transmission end 101 may further determine the target ECU based on an ECU upgrade request initiated by a client (such as a vehicle owner handset end), where the ECU upgrade request carries unique identification information (such as a unique ID) of the ECU. After determining the target ECU, the data transmission terminal 101 may propose a request for acquiring an upgrade data packet corresponding to the target ECU to the server of the software developer, and receive an upgrade data packet returned by the server for the request.
Step S202, secret transmission configuration information corresponding to the target ECU is obtained, the secret transmission configuration information comprises a data transmission mode and an encryption mode, the data transmission mode comprises a first segment transmission mode and a second segment transmission mode, and the encryption mode comprises a global encryption mode and a local encryption mode.
In practical application, the data transmission end 101 may first negotiate with the vehicle end about a secret transmission requirement adopted for OTA upgrade of different ECUs, and then set secret transmission configuration information corresponding to each ECU according to the secret transmission requirement.
In step S203, if the data transmission mode in the secret transmission configuration information corresponding to the target ECU is the first segment transmission mode and the encryption mode is the global encryption mode, the global encryption mode is adopted to globally encrypt the upgrade data packet, so as to obtain an integrally encrypted data packet, and the globally encrypted data packet is transmitted to the target ECU according to the first segment transmission mode.
In step S204, if the data transmission mode in the secret transmission configuration information corresponding to the target ECU is the second segment transmission mode and the encryption mode is the local encryption mode, splitting the upgrade data packet into a plurality of sub data packets, and encrypting each sub data packet by adopting the local encryption mode to obtain a segment encrypted data packet corresponding to each sub data packet, and transmitting each segment encrypted data packet to the target ECU according to the second segment transmission mode.
According to the technical scheme provided by the embodiment of the application, the target ECU is determined firstly, and the upgrade data packet corresponding to the target ECU is obtained; then, acquiring secret transmission configuration information corresponding to the target ECU; then, according to the data transmission mode and encryption mode in the secret transmission configuration information, global encryption is carried out on the upgrading data packet by adopting a global encryption mode to obtain a whole encrypted data packet, and the whole encrypted data packet is transmitted to the target ECU according to the first segmentation transmission mode; or, split the upgrade data packet into a plurality of sub data packets, encrypt each sub data packet by adopting a local encryption mode to obtain a segmented encryption data packet corresponding to each sub data packet, and transmit each segmented encryption data packet to the target ECU according to a second segmented transmission mode, thereby not only enhancing the confidentiality of the upgrade data packet transmitted to the target ECU by the data transmission end in the OTA upgrade process and increasing the cracking difficulty of the upgrade data packet by external equipment, so that the upgrade data packet is difficult to crack and restore all software data even if the upgrade data packet is intercepted by the external equipment, avoiding the leakage of the software data, but also effectively preventing the malicious tampering of the upgrade data by the external equipment, being beneficial to ensuring the normal upgrade of the ECU and ensuring the functional integrity and the vehicle safety of the whole vehicle.
In some embodiments, in the step S203, the global encryption method is used to globally encrypt the upgrade data packet to obtain an integrally encrypted data packet, which specifically includes:
determining a target symmetric encryption algorithm and a target key length;
extracting a first dimension parameter, a second dimension parameter and a third dimension parameter from the upgrade data packet, wherein the first dimension parameter comprises abstract information for finishing the OTA upgrade, the second dimension parameter comprises a starting address and a data length of a data segment for finishing the secure transmission, and the third dimension parameter comprises transmission data information for finishing the secure transmission;
generating a symmetric key according to at least one dimension parameter of the first dimension parameter, the second dimension parameter and the third dimension parameter, wherein the key length of the symmetric key is consistent with the target key length;
and carrying out global encryption on the upgrade data packet by using a symmetric key based on a target symmetric encryption algorithm to obtain a whole encrypted data packet.
The target symmetric encryption algorithm may be any one of DES (Data Encryption Standard) algorithm, AES (Advanced Encryption Standard) algorithm, RC4 algorithm, CAST algorithm, blowfish algorithm, etc.
The key length of each target symmetric encryption algorithm is different, for example, the key length of the AES algorithm may be 16 bits, 24 bits, or 32 bits. The target key length may be any key length selected therefrom, for example, 16 bits.
In practical application, the target symmetric encryption algorithm and the target key length can be flexibly selected according to practical situations, and are not particularly limited in the application.
In the OTA upgrading process, the data transmission end uses the UDS protocol to transmit an upgrading data packet to the ECU, wherein the upgrading data packet mainly uses 4 services, namely #2E writing service, #34 requests downloading service, #36 downloading service and #37 ends downloading service. The basic flow is shown in fig. 3.
As shown in fig. 3, the basic flow includes the following steps:
step S301, #2e write service: writing abstract information;
step S302, #34 requests a download service.
Step S303, #36 download service: and (5) data transmission.
Step S304, judging whether the downloading is completed.
In step S305, if the download is completed, #37 ends the download service.
If the downloading is not completed in step S306, the process returns to step S302.
In the #2E writing service, summary information for finishing the OTA upgrade is mainly written, and the summary information comprises an upgrade mode, upgrade time, an operation serial number and the like. The message format is shown in table 1 below.
TABLE 1
Wherein DID represents the diagnostic ID.
The #34 request download service mainly includes the start address and the data length of the data segment that completes the secure transmission. The message format is shown in table 2 below.
TABLE 2
Data bytes Parameter name Numerical value (Hex)
#1 Requesting download of a service ID 34
#2 Data format xx
#3 Address length format xx
#4 Memory address (MSB) xx
#5 Memory address xx
#6 Memory address xx
#7 Memory address (LSB) xx
#8 Data length (MSB) xx
#9 Data length xx
#10 Data length xx
#11 Data Length (LSB) xx
In #36 download service, the transmission data information for completing the secure transmission is mainly included. The message format is shown in table 3 below. Wherein the data portion may be 4095 data at maximum.
TABLE 3 Table 3
For example, the block sequence count may be 0x00 to 0xFF.
The #37 end download service mainly includes information related to ending the transmission of the current data segment. The message format is shown in table 4 below.
TABLE 4 Table 4
Data bytes Parameter name Numerical value (Hex)
#1 End of Transmission service ID 37
#2 Check code (MSB) xx
#3 Check code xx
#4 Check code xx
#5 Check code LSB xx
In some embodiments, the first dimension parameter may be a parameter corresponding to a row in which the data bytes in table 1 are "#4- #13" in combination with tables 1-4 above. The second dimension parameter may be a parameter corresponding to a row in which the data bytes in table 2 are "#4- # 11". The second dimension parameter may be a parameter corresponding to a row in which the data bytes in table 3 are "#1- # 2".
Then, a symmetric key is generated according to at least one dimension parameter of the first dimension parameter, the second dimension parameter and the third dimension parameter. The symmetric key may be specifically generated according to the first dimension parameter, the second dimension parameter and the third dimension parameter.
As an example, assume that the target symmetric encryption algorithm is CTR mode (calculator mode) in ASE algorithm, and the target key length is 16 bits. Then, the first dimension parameter (the parameter corresponding to the row "#4- #13" in table 1), the second dimension parameter (the parameter corresponding to the row "#4- #11" in table 2) and the third dimension parameter (the parameter corresponding to the row "#1- #2" in table 3) may be combined (for example, the first dimension parameter, the second dimension parameter and the third dimension parameter are spliced together) to obtain a combined parameter; the combined parameters are then subjected to an MD5 (Message-Digest Algorithm) operation to obtain a symmetric key with a key length of 16 bits (i.e., the MD5 operation result). And then, scrambling or bit-wise operating certain bytes in the MD5 operation result to obtain the self-increasing factor. And finally, based on a CTR mode in an ASE algorithm, performing global encryption on the upgrading data packet by using the symmetric key and the self-increasing factor obtained in the steps to obtain an integral encryption data packet.
For example, it is assumed that the parameters corresponding to the rows 4# to 13# in the first dimension parameter are "02", "17", "02", "03", "4F", "54", "41", "20", respectively; the parameters corresponding to the rows #4- #11 in the second dimension parameters are respectively 60, 01, 20, 00, 90 and 00; the parameters corresponding to the rows #1- #2 in the third dimension parameter are "36", "01, 02, 03, and 04", respectively. Then, "02", "17", "02", "03", "4F", "54", "41", "20", "60", "01", "20", "00", "90", "00", "36", "01, 02, 03, 04" may be combined to obtain a combined parameter "02 17 02 03 4F 54 41 20 20 20 60 01 20 0000 00 09 00 36 01 02 03 04", and then the combined parameter is subjected to MD5 operation to obtain a symmetric key with a key length of 16 bits.
As another example, in combination with the above example, a part of parameters may be further selected from the first dimension parameter, the second dimension parameter, and the third dimension parameter, and the combined parameters may be subjected to MD5 operation to obtain a symmetric key with a key length of 16 bits. For example, the parameters corresponding to the row "#4- #8" in the first dimension parameter (i.e., "02", "17", "02", "03", "4F"), the parameters corresponding to the row "#4- #7" in the second dimension parameter (i.e., "60", "01", "20", "00") and the parameters corresponding to the row "#2" in the third dimension parameter (i.e., "01, 02, 03, 04") may be selected to be combined, and then the MD5 operation is performed on the combined parameters.
It can be understood that in the step of generating the symmetric key, all or part of the first dimension parameters, all or part of the second dimension parameters and all or part of the third dimension parameters can be flexibly selected according to actual needs to be combined, and then MD5 operation is performed to obtain the symmetric key with the target key length.
As yet another example, MD5 operations may be performed on all or some of the first, second, and third three-dimensional parameters, respectively, to obtain three primary operation results, then the three primary operation results are combined to obtain a combined result, and then MD5 operations are performed on the combined result to obtain a secondary operation result, so as to obtain the symmetric key.
In the embodiment of the application, the first dimension parameter, the second dimension parameter and the third dimension parameter in the upgrade data packet are extracted, then the symmetric key is generated according to at least one of the dimension parameter, the second dimension parameter and the third dimension parameter, and then the upgrade data packet is globally encrypted (namely the whole upgrade data packet is encrypted) by using the symmetric key to obtain the whole encryption data packet, so that the confidentiality of the upgrade data packet can be well improved, the risk that the upgrade data packet is intercepted and restored or maliciously tampered in the transmission process is reduced, the normal upgrade of the ECU is favorably ensured, and the functional integrity and the vehicle safety of the whole vehicle are ensured.
In some embodiments, in the above step S203, transmitting the globally encrypted data packet to the target ECU in the first segment transmission mode includes:
acquiring unique identification information of a target ECU;
a function calling interface corresponding to the unique identification information is configured in the decryption function library;
the decryption process aiming at the whole encrypted data packet is converted into a decryption library function, the decryption library function is put into a decryption function library, and a corresponding relation between the decryption library function and a function call interface is established;
And transmitting the global encryption data packet to the target ECU according to the first segment transmission mode.
The unique identification information may be a number, letter, or other character string for uniquely identifying the ECU. For example, the ECU1, the ECU2, and the like may be mentioned. The ECU1 and the ECU2 represent different ECUs in the same vehicle, respectively.
A decryption function library is understood to be a database for storing decryption library functions that are available for the ECU to call. The database can be arranged in a data transmission end, a cloud server and a vehicle end where the target ECU is located.
The decryption library function comprises algorithm logic for decrypting the whole encrypted data packet transmitted by the data transmission end, namely the reverse process of encrypting the upgrade data packet by the data transmission end.
The first segment transmission mode may be to split the global encrypted data packet into a plurality of sub-encrypted data packets, and then transmit each sub-encrypted data packet to the target ECU in multiple times.
And the target ECU performs global decryption after receiving all the sub-encrypted data packets.
As an example, the target ECU is the ECU1, the unique identification information of the ECU1 is "ECU1", and one function call interface corresponding to "ECU1" is configured in the decryption function library. Then, the decryption process for the whole encrypted data packet is converted into a decryption library function, and then the decryption library function is put into a decryption function library, and a corresponding relation between the decryption library function and the ECU1 is established. After receiving the integral encryption data packet, the ECU1 can call a decryption library function corresponding to a function call interface of the identification "ECU1" carried in a decryption function library, and execute the decryption library function to decrypt the integral encryption data packet, thereby obtaining a decrypted upgrade data packet, and then using the decrypted upgrade data packet to carry out updating by brushing.
In the embodiment of the application, the data transmission end logically converts the decryption algorithm of the integral encrypted data packet into the decryption library function and then puts the decryption library function into the decryption function library, and provides the function call interface for the target ECU, so that the target ECU can quickly complete decryption of the integral encrypted data packet on the premise of not additionally increasing the key interaction step between the data transmission end and the target ECU, thereby simplifying the decryption flow of the target ECU and being beneficial to improving the updating and updating efficiency of the ECU.
In some embodiments, in the step S204, the upgrade data packet is split into a plurality of sub data packets, and each sub data packet is encrypted by a local encryption method to obtain a segmented encrypted data packet corresponding to each sub data packet, which specifically includes:
determining the number of segments transmitted in a segmented manner and the data interception start and end positions of the data segments corresponding to each segment;
splitting the upgrading data packet into a plurality of sub-data packets according to the number of the segments and the data interception start and end positions of the data segments corresponding to each segment;
determining a local encryption mode for encrypting each sub-data packet, wherein the local encryption modes corresponding to the sub-data packets are the same or different;
And encrypting each sub-data packet according to a corresponding local encryption mode to obtain a corresponding segmented encryption data packet.
The number of segments generally refers to how many data segments the swiped upgrade data in one upgrade data packet is divided into. Swiping upgrade data generally refers to diagnostic data (e.g., UDS data, DOIP data).
The number of segments may be determined by negotiating between the data transmission end and the vehicle end, or may be set by the data transmission end according to the size of the data to be transmitted, the transmission network environment, or the like, which is not limited in the present application. In addition, different numbers of segments may be set for different ECUs.
The data interception start and end positions refer to the start position and the end position of data interception.
As an example, assuming that the data size of the swipe upgrade data in the upgrade data packet 1 is 100MB, the swipe upgrade data may be divided into 2 data segments, each of which has a size of 50MB. The first data segment is intercepted from the first bit of the updating data (namely, the starting position of the data interception of the first data segment) to the back until the interception is stopped until the data bit with the data size of 50MB (namely, the ending position of the data interception of the first data segment) to obtain the first data segment. The start position of the data interception of the second data segment is the next data bit at the end position of the data interception of the first data segment, and the end position is the last bit of the swipe upgrade data. According to the number of the segments and the data interception start and end positions of the data segment corresponding to each segment, the updating data can be split into 2 sub-data packets, and the sub-data packets are recorded as sub-data packet A and sub-data packet B. Next, the partial encryption scheme 1 for the sub-packet a and the partial encryption scheme 2 for the sub-packet B are determined. The partial encryption schemes 1 and 2 may be the same encryption scheme or may be different encryption schemes. The local encryption modes of different data segments can be determined by negotiation between the data transmission end and the vehicle end, and can also be customized by the data transmission end.
The partial encryption schemes 1 and 2 are assumed to be the same, and are each as follows. The partial encryption scheme 1 will be described as an example. Firstly, extracting primary parameters, secondary parameters and tertiary parameters in a sub-data packet A, wherein the primary parameters mainly comprise parameters corresponding to rows #4- #13 in table 1, wherein abstract information for finishing the OTA upgrade is written in the primary parameters; the secondary parameters mainly comprise the initial address and the data length of the updating data of the sub-data packet A for completing the secret transmission; the three-level parameters mainly comprise transmission data information for completing the secret transmission, such as a request identifier and a block sequence count for writing update data of the sub-data packet A. Then, generating a symmetric key according to at least one level of parameters of the primary parameters, the secondary parameters and the tertiary parameters, wherein the key length of the symmetric key is consistent with the preset target key length; and encrypting the sub-data packet A by using a symmetric key based on a preselected target symmetric encryption algorithm (such as an ASE algorithm and the like) to obtain the segmented encrypted data packet A.
Similarly, the sub-packet B may be encrypted by the partial encryption method 2 with reference to the encryption method of the above-mentioned segment encrypted packet a, to obtain the segment encrypted packet B. And will not be described in detail herein.
In some embodiments, splitting the upgrade data packet into a plurality of sub data packets according to the number of segments and the data interception start and end positions of the data segment corresponding to each segment specifically includes:
creating a plurality of data encapsulation structures, wherein the number of the plurality of data encapsulation structures is the same as the number of the segments;
distributing a unique segment identification information for each data encapsulation structure;
intercepting corresponding segmented data segments from the upgrading data packet according to the data interception start and end positions of the data segments corresponding to each segment;
and filling the segmented data segment into a data encapsulation structure with the same unique segment identification information to obtain a corresponding sub-data packet.
The unique segment identification information may be a number, letter, or other string that is used to uniquely identify the data encapsulation structure. For example, F1, F2, and the like are possible.
The plurality of data encapsulation structures includes a data encapsulation structure for encapsulating a non-last data segment and a data encapsulation structure for encapsulating a last data segment. The data encapsulation structure for encapsulating the non-last data segment mainly comprises a first data frame, a second data frame, a third data frame and a fourth data frame which are connected in sequence, wherein the first data frame is mainly used for storing primary parameters, the second data frame is mainly used for storing secondary parameters, the third data frame is mainly used for storing tertiary parameters, and the fourth data frame is mainly used for storing data segments for refreshing upgrade data. The data encapsulation structure for encapsulating the last data segment further comprises a fifth data frame, which is mainly used for storing related information (including transmission exit request identification and the like) for ending the data transmission of the data segment.
In combination with the above example, assuming that the number of segments is 2, 2 data packages are created, and each data package is assigned a unique segment identification information, such as "F1, F2". According to the above-described data interception start and end positions with respect to the first data segment and the second data segment, the first data segment and the second data segment can be intercepted from the update data of the update package 1. Then, the first data segment is filled into a fourth data frame of the data encapsulation structure carrying the identifier "F1", and the second data segment is filled into a fourth data frame of the data encapsulation structure carrying the identifier "F2". And filling the primary parameter, the secondary parameter and the tertiary parameter corresponding to the first data segment into a first data frame, a second data frame and a third data frame of a data packaging structure carrying an identifier F1 respectively to obtain a sub-data packet A. And filling the primary parameter, the secondary parameter and the tertiary parameter corresponding to the second data segment into a first data frame, a second data frame and a third data frame of a data encapsulation structure carrying an identifier F2, and filling related information (including a transmission exit request identifier and the like) for ending the data transmission of the data segment into a fifth data frame to obtain a sub-data packet B.
In the embodiment of the application, the upgrade data packet is split first, and then each sub data packet is locally encrypted in the same or different local encryption mode, so that the confidentiality of the upgrade data packet can be further improved, and meanwhile, the cracking difficulty of external equipment on the upgrade data packet is greatly increased, and the transmission safety of the upgrade data packet is further improved.
In some embodiments, in the above step S204, transmitting each segment encrypted data packet to the target ECU in the second segment transmission mode includes:
determining the transmission time sequence of each segmented encryption data packet;
and sequentially transmitting each segment encrypted data packet to the target ECU according to the transmission time sequence.
Transmission timing refers to the time of transmission and the transmission order.
In some embodiments, the timing of transmission of each of the segmented encrypted data packets may be determined as follows. Specifically, the required transmission resources and the data segment assembly order of each segment encrypted data packet, and the currently available transmission resources can be determined first; then, the transmission timing of each segmented encrypted data packet is determined based on the required transmission resources, the data segment assembly order, and the currently available transmission resources.
The required transmission resources mainly refer to that the target ECU expects the data transmission end to completely transmit the segmented encryption data packet with a certain data size to the target ECU in unit time. I.e. the amount of data actually transmitted between the target ECU and the data transmitting side per unit time, i.e. the data throughput, typically in bits/second. For example, the data size of a certain segment encrypted data packet is 1024 bits, and the target ECU expects that the data transmitting end can transmit the segment encrypted data packet to it completely within 1 second, and then the required transmission resource of the segment encrypted data packet is 1024 bits/second.
The currently available transmission resources mainly refer to the maximum available throughput, typically in bits/second, that the data transmission end can currently use to transmit data to the target ECU.
The data segment assembly order is the same as the data interception order for the update data to be written in the process of splitting the update data packet into a plurality of sub data packets. That is, when splitting the upgrade data packet into a plurality of sub data packets, the first data segment is obtained by intercepting from the first bit of the update data after the first bit of the update data is written. For example, the data interception order for the swiping upgrade data is first data segment→nth data segment, and the data segment assembly order is also first data segment.
As an example, assuming that there are currently 4 packets to be transmitted, denoted as packets 1, 2, 3, and 4, the required transmission resources corresponding to packets 1, 2, 3, and 4 may be determined. If the required transmission resources of the segmented encryption packets 1, 2, 3, 4 are 1024 bits/second, 2048 bits/second, 3072 bits/second, respectively. The currently available transmission resources at the data transmission end are 1024 mbits/sec. As can be seen from the comparison, the currently available transmission resources of the data transmission end are larger than the sum of the required transmission resources of the segment encrypted data packets 1, 2, 3, 4. If the data assembly order of the segment encrypted data packets 1, 2, 3, 4 is determined to be the segment encrypted data packets 1→2→3→4, the transmission timing of the segment encrypted data packets 1, 2, 3, 4 can be determined to be the segment encrypted data packets 1 (corresponding to the transmission time 1) →2 (corresponding to the transmission time 2) →3 (corresponding to the transmission time 3) →4 (corresponding to the transmission time 4).
Of course, the segmented encryption packets 1, 2, 3, 4 may also be transmitted to the target ECU in parallel by parallel transmission.
In order to increase the difficulty of restoring and cracking the upgrade data packet by the external device, the transmission time sequence of the segmented encryption data packet can be disturbed, for example, the correct data assembly sequence is disturbed to be segmented encryption data packets 1-4-2-3, so that a new transmission time sequence is obtained. The data transmission end can sequentially transmit the segmented encryption data packets 1, 4, 2 and 3 to the target ECU according to the new transmission time sequence segmented encryption data packets 1, 4, 2 and 3.
After receiving each segment encryption data packet, the target ECU decrypts each segment encryption data packet, combines the decrypted data into complete upgrade refreshing data, and uses the complete upgrade refreshing data to carry out upgrade refreshing.
Any combination of the above optional solutions may be adopted to form an optional embodiment of the present application, which is not described herein in detail.
The following are device embodiments of the present application, which may be used to perform method embodiments of the present application. For details not disclosed in the device embodiments of the present application, please refer to the method embodiments of the present application.
Fig. 4 is a schematic diagram of a secure transmission device for an upgrade data packet according to an embodiment of the present application. As shown in fig. 4, the secure transmission device of the upgrade data packet includes:
a determining module 401 configured to determine a target ECU and acquire an upgrade data packet corresponding to the target ECU;
an obtaining module 402, configured to obtain secret transmission configuration information corresponding to the target ECU, where the secret transmission configuration information includes a data transmission mode and an encryption mode, the data transmission mode includes a first segment transmission mode and a second segment transmission mode, and the encryption mode includes a global encryption mode and a local encryption mode;
The first transmission module 403 is configured to, if the data transmission mode in the secret transmission configuration information corresponding to the target ECU is the first segment transmission mode and the encryption mode is the global encryption mode, globally encrypt the upgrade data packet by using the global encryption mode to obtain an integrally encrypted data packet, and transmit the globally encrypted data packet to the target ECU according to the first segment transmission mode;
the second transmission module 404 is configured to split the upgrade data packet into a plurality of sub-data packets if the data transmission mode in the secure transmission configuration information corresponding to the target ECU is the second segment transmission mode and the encryption mode is the partial encryption mode, and encrypt each sub-data packet by adopting the partial encryption mode to obtain a segment encrypted data packet corresponding to each sub-data packet, and transmit each segment encrypted data packet to the target ECU according to the second segment transmission mode.
According to the technical scheme provided by the embodiment of the application, the target ECU is determined through the determining module 401, and the upgrade data packet corresponding to the target ECU is obtained; then, the acquisition module 402 acquires secret transmission configuration information corresponding to the target ECU; then, the first transmission module 403 performs global encryption on the upgrade data packet by adopting a global encryption mode according to the data transmission mode and the encryption mode in the secret transmission configuration information to obtain a global encryption data packet, and transmits the global encryption data packet to the target ECU according to the first segment transmission mode; or, the second transmission module 404 splits the upgrade data packet into a plurality of sub data packets, and encrypts each sub data packet by adopting a local encryption mode to obtain a segmented encrypted data packet corresponding to each sub data packet, and transmits each segmented encrypted data packet to the target ECU according to the second segmented transmission mode, so that the confidentiality of the upgrade data packet transmitted to the target ECU by the data transmission end in the OTA upgrade process is enhanced, the cracking difficulty of the upgrade data packet by external equipment is increased, the upgrade data packet is difficult to crack and restore all software data even if the upgrade data packet is intercepted by the external equipment, the leakage of the software data is avoided, the malicious tampering of the upgrade data by the external equipment can be effectively prevented, the normal upgrade of the ECU is facilitated, and the functional integrity and the vehicle safety of the whole vehicle are ensured.
In some embodiments, the first transmission module 403 includes:
a determining unit configured to determine a target symmetric encryption algorithm and a target key length;
the extraction unit is configured to extract a first dimension parameter, a second dimension parameter and a third dimension parameter from the upgrade data packet, wherein the first dimension parameter comprises abstract information for completing the current OTA upgrade, the second dimension parameter comprises a starting address and a data length of a data segment for completing the current secret transmission, and the third dimension parameter comprises transmission data information for completing the current secret transmission;
a generation unit configured to generate a symmetric key according to at least one of the first dimension parameter, the second dimension parameter, and the third dimension parameter, the key length of the symmetric key being identical to the target key length;
and the global encryption unit is configured to perform global encryption on the upgrade data packet by using a symmetric key based on a target symmetric encryption algorithm to obtain an overall encrypted data packet.
In the embodiment of the application, the first dimension parameter, the second dimension parameter and the third dimension parameter in the upgrade data packet are extracted, then the symmetric key is generated according to at least one of the dimension parameter, the second dimension parameter and the third dimension parameter, and then the upgrade data packet is globally encrypted (namely the whole upgrade data packet is encrypted) by using the symmetric key to obtain the whole encryption data packet, so that the confidentiality of the upgrade data packet can be well improved, the risk that the upgrade data packet is intercepted and restored or maliciously tampered in the transmission process is reduced, the normal upgrade of the ECU is favorably ensured, and the functional integrity and the vehicle safety of the whole vehicle are ensured.
In some embodiments, the first transmission module 403 further includes:
an information acquisition unit configured to acquire unique identification information of the target ECU;
the configuration unit is configured to configure a function call interface corresponding to the unique identification information in the decryption function library;
the establishing unit is configured to convert the decryption process aiming at the whole encrypted data packet into a decryption library function, put the decryption library function into a decryption function library and establish a corresponding relation between the decryption library function and a function call interface;
and a transmission unit configured to transmit the globally encrypted data packet to the target ECU in the first segment transmission mode.
In the embodiment of the application, the data transmission end logically converts the decryption algorithm of the integral encrypted data packet into the decryption library function and then puts the decryption library function into the decryption function library, and provides the function call interface for the target ECU, so that the target ECU can quickly complete decryption of the integral encrypted data packet on the premise of not additionally increasing the key interaction step between the data transmission end and the target ECU, thereby simplifying the decryption flow of the target ECU and being beneficial to improving the updating and updating efficiency of the ECU.
In some embodiments, the second transmission module 404 includes:
The segmentation determining unit is configured to determine the number of segments transmitted in a segmentation mode and the data interception start and end positions of the data segments corresponding to each segment;
the splitting unit is configured to split the upgrading data packet into a plurality of sub-data packets according to the number of the segments and the data interception start and end positions of the data segments corresponding to each segment;
an encryption scheme determining unit configured to determine a partial encryption scheme for encrypting each sub-packet, the partial encryption schemes corresponding to the respective sub-packets being the same or different;
the local encryption unit is configured to encrypt each sub-data packet according to a local encryption mode corresponding to the sub-data packet to obtain a corresponding segmented encryption data packet.
In the embodiment of the application, the upgrade data packet is split first, and then each sub data packet is locally encrypted in the same or different local encryption mode, so that the confidentiality of the upgrade data packet can be further improved, and meanwhile, the cracking difficulty of external equipment on the upgrade data packet is greatly increased, and the transmission safety of the upgrade data packet is further improved.
In some embodiments, the splitting unit specifically includes:
A creation component configured to create a plurality of data encapsulation structures, the number of the plurality of data encapsulation structures being the same as the number of segments;
an allocation component configured to allocate a unique segment identification information for each data encapsulation structure;
the intercepting component is configured to intercept corresponding segmented data segments from the upgrading data packet according to the data intercepting start and end positions of the data segments corresponding to each segment;
and the filling component is configured to fill the segmented data segment into a data packaging structure with the same unique segment identification information, so as to obtain a corresponding sub-data packet.
In some embodiments, the second transmission module 404 further includes:
a timing determining unit configured to determine a transmission timing of each of the segmented encrypted data packets;
and a segment transmission unit configured to sequentially transmit each segment encrypted data packet to the target ECU in accordance with a transmission timing.
In some embodiments, the timing determining unit specifically includes:
a determining component configured to determine required transmission resources and data segment assembly order for each segmented encrypted data packet, and currently available transmission resources;
a timing determination component configured to determine a transmission timing of each of the segmented encrypted data packets based on the required transmission resources, the data segment assembly order, and the currently available transmission resources.
It should be understood that the sequence number of each step in the foregoing embodiment does not mean that the execution sequence of each process should be determined by the function and the internal logic of each process, and should not limit the implementation process of the embodiment of the present application in any way.
Fig. 5 is a schematic diagram of an electronic device 5 provided in an embodiment of the present application. As shown in fig. 5, the electronic apparatus 5 of this embodiment includes: a processor 501, a memory 502 and a computer program 503 stored in the memory 502 and executable on the processor 501. The steps of the various method embodiments described above are implemented by processor 501 when executing computer program 503. Alternatively, the processor 501, when executing the computer program 503, performs the functions of the modules/units in the above-described apparatus embodiments.
The electronic device 5 may be a desktop computer, a notebook computer, a palm computer, a cloud server, or the like. The electronic device 5 may include, but is not limited to, a processor 501 and a memory 502. It will be appreciated by those skilled in the art that fig. 5 is merely an example of the electronic device 5 and is not limiting of the electronic device 5 and may include more or fewer components than shown, or different components.
The processor 501 may be a central processing unit (Central Processing Unit, CPU) or other general purpose processor, digital signal processor (Digital Signal Processor, DSP), application specific integrated circuit (Application Specific Integrated Circuit, ASIC), field programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, or the like.
The memory 502 may be an internal storage unit of the electronic device 5, for example, a hard disk or a memory of the electronic device 5. The memory 502 may also be an external storage device of the electronic device 5, for example, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash Card (Flash Card) or the like, which are provided on the electronic device 5. Memory 502 may also include both internal storage units and external storage devices of electronic device 5. The memory 502 is used to store computer programs and other programs and data required by the electronic device.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-described division of the functional units and modules is illustrated, and in practical application, the above-described functional distribution may be performed by different functional units and modules according to needs, i.e. the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-described functions. The functional units and modules in the embodiment may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit, where the integrated units may be implemented in a form of hardware or a form of a software functional unit.
The integrated modules/units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the present application implements all or part of the flow in the methods of the above embodiments, or may be implemented by a computer program to instruct related hardware, and the computer program may be stored in a computer readable storage medium, where the computer program may implement the steps of the respective method embodiments described above when executed by a processor. The computer program may comprise computer program code, which may be in source code form, object code form, executable file or in some intermediate form, etc. The computer readable medium may include: any entity or device capable of carrying computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), an electrical carrier signal, a telecommunications signal, a software distribution medium, and so forth. It should be noted that the content of the computer readable medium can be appropriately increased or decreased according to the requirements of the jurisdiction's jurisdiction and the patent practice, for example, in some jurisdictions, the computer readable medium does not include electrical carrier signals and telecommunication signals according to the jurisdiction and the patent practice.
The above embodiments are only for illustrating the technical solution of the present application, and are not limiting thereof; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present application, and are intended to be included in the scope of the present application.

Claims (10)

1. A secure transmission method of an upgrade data packet, comprising:
determining a target ECU and acquiring an upgrade data packet corresponding to the target ECU;
acquiring secret transmission configuration information corresponding to the target ECU, wherein the secret transmission configuration information comprises a data transmission mode and an encryption mode, the data transmission mode comprises a first segmentation transmission mode and a second segmentation transmission mode, and the encryption mode comprises a global encryption mode and a local encryption mode;
if the data transmission mode in the secret transmission configuration information corresponding to the target ECU is a first segment transmission mode and the encryption mode is a global encryption mode, performing global encryption on the upgrading data packet by adopting the global encryption mode to obtain an overall encryption data packet, and transmitting the overall encryption data packet to the target ECU according to the first segment transmission mode;
If the data transmission mode in the secret transmission configuration information corresponding to the target ECU is a second segmented transmission mode and the encryption mode is a local encryption mode, dividing the upgrading data packet into a plurality of sub-data packets, encrypting each sub-data packet by adopting the local encryption mode to obtain a segmented encryption data packet corresponding to each sub-data packet, and transmitting each segmented encryption data packet to the target ECU according to the second segmented transmission mode.
2. The method of claim 1, wherein globally encrypting the upgrade data packet by global encryption to obtain an integrally encrypted data packet comprises:
determining a target symmetric encryption algorithm and a target key length;
extracting a first dimension parameter, a second dimension parameter and a third dimension parameter from the upgrade data packet, wherein the first dimension parameter comprises abstract information for completing the OTA upgrade, the second dimension parameter comprises a starting address and a data length of a data segment for completing the secure transmission, and the third dimension parameter comprises transmission data information for completing the secure transmission;
generating a symmetric key according to at least one dimension parameter of the first dimension parameter, the second dimension parameter and the third dimension parameter, wherein the key length of the symmetric key is consistent with the target key length;
And carrying out global encryption on the upgrading data packet by using the symmetric key based on the target symmetric encryption algorithm to obtain an overall encrypted data packet.
3. The method of claim 2, wherein transmitting the globally encrypted data packet to the target ECU in a first segment transmission mode comprises:
acquiring unique identification information of the target ECU;
a function calling interface corresponding to the unique identification information is configured in a decryption function library;
converting a decryption process aiming at the integral encrypted data packet into a decryption library function, putting the decryption library function into the decryption function library, and establishing a corresponding relation between the decryption library function and the function call interface;
and transmitting the global encryption data packet to the target ECU according to a first segment transmission mode.
4. The method of claim 1, wherein splitting the upgrade data packet into a plurality of sub data packets, and encrypting each of the sub data packets by using a local encryption manner to obtain a segmented encrypted data packet corresponding to each of the sub data packets, includes:
determining the number of segments transmitted in a segmented manner and the data interception start and end positions of the data segments corresponding to each segment;
Splitting the upgrading data packet into a plurality of sub-data packets according to the number of the segments and the data interception start and end positions of the data segments corresponding to each segment;
determining a local encryption mode for encrypting each sub-data packet, wherein the local encryption modes corresponding to the sub-data packets are the same or different;
and encrypting each sub data packet according to a corresponding local encryption mode to obtain a corresponding segmented encryption data packet.
5. The method of claim 4, wherein splitting the upgrade data packet into a plurality of sub-data packets according to the number of segments and the data interception start and end positions of the data segment corresponding to each segment, comprises:
creating a plurality of data encapsulation structures, wherein the number of the plurality of data encapsulation structures is the same as the number of the segments;
distributing a unique segment identification information for each data encapsulation structure;
intercepting corresponding segmented data segments from the upgrading data packet according to the data interception start and end positions of the data segments corresponding to each segment;
and filling the segmented data segment into a data packaging structure with the same unique segment identification information to obtain a corresponding sub-data packet.
6. The method of claim 1, wherein transmitting each of the segment encrypted data packets to the target ECU in a second segment transmission mode comprises:
determining the transmission time sequence of each segmented encryption data packet;
and transmitting each segment encryption data packet to the target ECU in turn according to the transmission time sequence.
7. The method of claim 6, wherein determining a transmission timing of each of the segmented encrypted data packets comprises:
determining required transmission resources and data segment assembly order of each segmented encryption data packet and currently available transmission resources;
and determining the transmission time sequence of each segmented encryption data packet according to the required transmission resources, the data segment assembly order and the currently available transmission resources.
8. A secure transmission device for an upgrade data packet, comprising:
the determining module is configured to determine a target ECU and acquire an upgrade data packet corresponding to the target ECU;
the acquisition module is configured to acquire secret transmission configuration information corresponding to the target ECU, wherein the secret transmission configuration information comprises a data transmission mode and an encryption mode, the data transmission mode comprises a first segment transmission mode and a second segment transmission mode, and the encryption mode comprises a global encryption mode and a local encryption mode;
The first transmission module is configured to perform global encryption on the upgrade data packet by adopting a global encryption mode if the data transmission mode in the secret transmission configuration information corresponding to the target ECU is a first segment transmission mode and the encryption mode is a global encryption mode, so as to obtain an overall encryption data packet, and transmit the overall encryption data packet to the target ECU according to the first segment transmission mode;
and the second transmission module is configured to split the upgrading data packet into a plurality of sub-data packets if the data transmission mode in the secret transmission configuration information corresponding to the target ECU is a second segment transmission mode and the encryption mode is a local encryption mode, encrypt each sub-data packet by adopting the local encryption mode to obtain a segment encryption data packet corresponding to each sub-data packet, and transmit each segment encryption data packet to the target ECU according to the second segment transmission mode.
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 the processor implements the steps of the method according to any of claims 1 to 7 when the computer program is executed.
10. A computer readable storage medium storing a computer program, characterized in that the computer program when executed by a processor implements the steps of the method according to any one of claims 1 to 7.
CN202310465514.3A 2023-04-26 2023-04-26 Secret transmission method and device for upgrading data packet, electronic equipment and storage medium Pending CN116506848A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310465514.3A CN116506848A (en) 2023-04-26 2023-04-26 Secret transmission method and device for upgrading data packet, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310465514.3A CN116506848A (en) 2023-04-26 2023-04-26 Secret transmission method and device for upgrading data packet, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116506848A true CN116506848A (en) 2023-07-28

Family

ID=87322504

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310465514.3A Pending CN116506848A (en) 2023-04-26 2023-04-26 Secret transmission method and device for upgrading data packet, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116506848A (en)

Similar Documents

Publication Publication Date Title
CN107770182B (en) Data storage method of home gateway and home gateway
US9032208B2 (en) Communication terminal, communication system, communication method and communication program
CN109104279B (en) Encryption method and system for electric power data and terminal equipment
CN110912690A (en) Data encryption and decryption method, vehicle and storage medium
CN110535641B (en) Key management method and apparatus, computer device, and storage medium
EP4258593A1 (en) Ota update method and apparatus
CN110598429B (en) Data encryption storage and reading method, terminal equipment and storage medium
CN111274611A (en) Data desensitization method, device and computer readable storage medium
CN110855616B (en) Digital key generation system
CN115150821A (en) Offline package transmission and storage method and device
CN110266653B (en) Authentication method, system and terminal equipment
CN114500064B (en) Communication security verification method and device, storage medium and electronic equipment
WO2021170049A1 (en) Method and apparatus for recording access behavior
CN116155491B (en) Symmetric key synchronization method of security chip and security chip device
CN117240625A (en) Tamper-resistant data processing method and device and electronic equipment
CN113141333A (en) Communication method, device, server, system and storage medium for network access device
CN115909560A (en) Data encryption method, data decryption method and door lock system
CN113672955B (en) Data processing method, system and device
CN116506848A (en) Secret transmission method and device for upgrading data packet, electronic equipment and storage medium
CN114611129A (en) Data privacy protection method and system
CN114401148A (en) Communication data encryption and decryption optimization method
CN111431846B (en) Data transmission method, device and system
CN111859351A (en) Method, system, server and storage medium for writing information into chip
CN112333699A (en) Internet of things communication protocol encryption method, equipment and storage medium
CN108958771A (en) Update method, device, server and the storage medium of application program

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20240117

Address after: No. 13 Xingxiang Road, Zengjia Town, High tech Zone, Shapingba District, Chongqing, 400039

Applicant after: Chongqing Selis Phoenix Intelligent Innovation Technology Co.,Ltd.

Address before: 610095 No. 2901, floor 29, unit 1, building 1, No. 151, Tianfu Second Street, high tech Zone, China (Sichuan) pilot Free Trade Zone, Chengdu, Sichuan Province

Applicant before: Chengdu Thalys Technology Co.,Ltd.