Vehicle encryption upgrading method and device, computer equipment and storage medium

Through the splitting and partial encryption methods, the problem of decryption verification time in the software package upgrade process of the automotive industry is solved, and the upgrade efficiency and encryption efficiency are improved.

CN119917140APending Publication Date: 2025-05-02GUANGZHOU AUTOMOBILE GROUP CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510009063.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-02
Publication Date
2025-05-02

AI Technical Summary

Technical Problem

During the software package upgrade process, the automotive industry has caused the software package decryption verification time to be too long due to the whole package symmetric encryption signature, which reduces the efficiency of software package upgrade.

Method used

A method for encrypting an upgrade of a vehicle is proposed. By splitting the upgrade software package to be encrypted into a first data packet and a second data packet, only the first data packet is encrypted, and the encrypted data packets are merged and sent to the vehicle for firmware upgrade.

Benefits of technology

It improves the decryption efficiency of the upgrade software package and the firmware upgrade efficiency. At the same time, since only part of the data is sent for encryption, the data transmission time and the encryption time of the server are shortened, which improves the encryption efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119917140A_ABST
    Figure CN119917140A_ABST
Patent Text Reader

Abstract

The invention discloses a vehicle encryption upgrading method and device, computer equipment and a storage medium, and relates to the technical field of data encryption. The method comprises the following steps: if the data volume in a to-be-encrypted upgrade software package is greater than a first data volume threshold value, a client splits the upgrade software package into a first data package and a second data package, and sends the first data package to a server for encryption; receiving an encrypted first data packet fed back by the server; combining the second data packet and the encrypted first data packet to generate an encrypted upgrade packet; and sending the encrypted upgrade package to the vehicle to enable the vehicle to decrypt the encrypted upgrade package and then upgrade firmware of the vehicle. In other words, when the upgrade software package is too large, only part of data in the upgrade software package is encrypted, so that the security of the upgrade software package is ensured, the decryption efficiency of the vehicle on the encrypted upgrade software package can be improved, and the firmware upgrade efficiency of the vehicle based on the decrypted upgrade software package is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data encryption technology, and in particular to a vehicle encryption upgrade method, device, computer equipment and storage medium. Background Art

[0002] The current automobile industry is moving towards the new four trends: electrification, networking, intelligence, and sharing. As a smart terminal, smart connected vehicles have become one of the targets of malicious attacks by hackers. Malicious flashing of software packages can cause controller failure, or important information fragments of the vehicle can be obtained through means such as reverse software packages to achieve the purpose of the attack.

[0003] At present, the automotive industry generally adopts the method of symmetric encryption signature of the whole package to encrypt the software package for upgrade. This leads to the problem that the electronic control unit (ECU) of the car takes too long to decrypt and verify the signature of the software package before upgrading the software, thereby reducing the efficiency of software package upgrade. Summary of the invention

[0004] The present application proposes a vehicle encryption upgrade method, device, computer equipment and storage medium to improve the security of the upgrade software package, while also improving the vehicle's decryption efficiency of the upgrade software package.

[0005] In a first aspect, an embodiment of the present application provides an encryption upgrade method for a vehicle, which is applied to a client, and the method includes: if the amount of data in the upgrade software package to be encrypted is greater than a first data amount threshold, splitting the upgrade software package into a first data packet and a second data packet, and sending the first data packet to a server for encryption; receiving the encrypted first data packet fed back by the server; merging the second data packet and the encrypted first data packet to generate an encrypted upgrade package; and sending the encrypted upgrade package to the vehicle so that the vehicle decrypts the encrypted upgrade package and then upgrades the vehicle's firmware.

[0006] In a second aspect, an embodiment of the present application provides an encryption upgrade method for a vehicle, which is applied to a server, and the method includes: receiving a first data packet sent by a client, wherein the first data packet is obtained by splitting the upgrade software package by the client when the amount of data in the upgrade software package to be encrypted is greater than a first data amount threshold; encrypting the first data packet; feeding back the encrypted first data packet to the client, so that the client merges the second data packet obtained based on the split and the encrypted first data packet to generate an encrypted upgrade package, and sending the encrypted upgrade package to the vehicle for firmware upgrade.

[0007] In a third aspect, an embodiment of the present application provides an encryption upgrade device for a vehicle, which is applied to a client, and the device includes: a data splitting module, which is used to split the upgrade software package into a first data packet and a second data packet if the amount of data in the upgrade software package to be encrypted is greater than a first data amount threshold, and send the first data packet to a server for encryption; a data receiving module, which is used to receive the encrypted first data packet fed back by the server; an encrypted packet generating module, which is used to merge the second data packet and the encrypted first data packet to generate an encrypted upgrade package; and a sending module, which is used to send the encrypted upgrade package to the vehicle, so that the vehicle can upgrade its own firmware after decrypting the encrypted upgrade package.

[0008] In a fourth aspect, an embodiment of the present application provides an encryption upgrade device for a vehicle, which is applied to a server, and the device includes: a data receiving module, used to receive a first data packet sent by a client, wherein the first data packet is obtained by splitting the upgrade software package by the client when the amount of data in the upgrade software package to be encrypted is greater than a first data amount threshold; an encryption module, used to encrypt the first data packet; and a data sending module, used to feed back the encrypted first data packet to the client, so that the client merges the second data packet obtained based on the split and the encrypted first data packet to generate an encrypted upgrade package, and sends the encrypted upgrade package to the vehicle for firmware upgrade.

[0009] In a fifth aspect, an embodiment of the present application provides a computer device, comprising: one or more processors; a memory; one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs are configured to execute the above-mentioned method.

[0010] In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium, in which a program code is stored. The program code can be called by a processor to execute the above method.

[0011] In the solution provided by the present application, if the amount of data in the upgrade software package to be encrypted is greater than the first data amount threshold, the client splits the upgrade software package into a first data packet and a second data packet, and sends the first data packet to the server for encryption; receives the encrypted first data packet fed back by the server; merges the second data packet and the encrypted first data packet to generate an encrypted upgrade package; and sends the encrypted upgrade package to the vehicle so that the vehicle decrypts the encrypted upgrade package and then upgrades the firmware of the vehicle. That is to say, when the upgrade software package is too large, only part of the data in the upgrade software package is encrypted, thereby ensuring the security of the upgrade software package and improving the decryption efficiency of the encrypted upgrade software package by the vehicle, thereby improving the efficiency of the vehicle in performing firmware upgrades based on the decrypted upgrade software package. In addition, since only part of the data in the upgrade software package is sent to the server for encryption, the data transmission time and the server encryption time are relatively shorter, which greatly improves the encryption efficiency of the upgrade software package. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0013] Figure 1 A schematic flow chart of a method for upgrading vehicle encryption provided in accordance with an embodiment of the present application is shown.

[0014] Figure 2 A schematic flow chart of a vehicle encryption upgrade method provided in another embodiment of the present application is shown.

[0015] Figure 3 A schematic flow chart of a vehicle encryption upgrade method provided in yet another embodiment of the present application is shown.

[0016] Figure 4 Shows Figure 3 A flowchart of the sub-steps of step S302 in one implementation manner.

[0017] Figure 5 A schematic diagram of the process of firmware upgrade of a vehicle provided in an embodiment of the present application is shown.

[0018] Figure 6 A schematic diagram of the multi-terminal interaction process of the vehicle encryption upgrade method provided in the first embodiment of the present application is shown.

[0019] Figure 7 It is a block diagram of an encryption upgrade device for a vehicle provided according to an embodiment of the present application.

[0020] Figure 8 It is a block diagram of an encryption upgrade device for a vehicle provided according to another embodiment of the present application.

[0021] Fig. 9 It is a block diagram of a computer device according to an embodiment of the present application for executing the encryption upgrade method of a vehicle according to an embodiment of the present application.

[0022] Fig.10 It is a storage unit of an embodiment of the present application for storing or carrying program codes for implementing the encryption upgrade method of the vehicle according to an embodiment of the present application. DETAILED DESCRIPTION

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

[0024] It should be noted that in some processes described in the specification, claims and the above-mentioned drawings of the present application, multiple operations that appear in a specific order are included, and these operations may not be executed or executed in parallel in the order in which they appear in this article. The sequence numbers of operations such as S110, S120, etc. are only used to distinguish different operations, and the sequence numbers themselves do not represent any execution order. In addition, these processes may include more or less operations, and these operations may be executed in sequence or in parallel. And, the terms "first", "second", etc. in the specification, claims and the above-mentioned drawings of the present application are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described here can be implemented in an order other than those illustrated or described here. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or server that includes a series of steps or sub-modules is not necessarily limited to those steps or sub-modules explicitly listed, but may include other steps or sub-modules that are not explicitly listed or that are inherent to these processes, methods, products, or devices.

[0025] The inventor proposes a vehicle encryption upgrade method, device, computer equipment and storage medium. The vehicle encryption upgrade method provided by the embodiment of the present application is described in detail below.

[0026] Please refer to Figure 1, Figure 1 A schematic diagram of a vehicle encryption upgrade method provided in an embodiment of the present application is applied to a client. Figure 1 The encryption upgrade method of the vehicle provided in the embodiment of the present application is described in detail. The encryption upgrade method of the vehicle may include the following steps:

[0027] Step S101: if the amount of data in the upgrade software package to be encrypted is greater than a first data amount threshold, the upgrade software package is split into a first data packet and a second data packet, and the first data packet is sent to a server for encryption.

[0028] In this embodiment, the client is an electronic terminal with data processing function, which includes but is not limited to a laptop, a desktop computer, a tablet computer and a smart phone. The upgrade software package can be uploaded to the client by the upgrade personnel of the software package. The client generally stores multiple upgrade software packages, which include upgrade software packages for different firmware in the vehicle, and can also include upgrade software packages for different versions of the same firmware in the vehicle, for example, upgrade software package version 1.0, upgrade software package version 2.0 and upgrade software package version 3.0 for firmware A; the client is generally an electronic terminal of the after-sales maintenance center of the vehicle, so that when the owner needs to upgrade some firmware of the vehicle, he comes to the after-sales maintenance center of the vehicle, and the relevant staff selects the upgrade software package corresponding to the firmware that the owner needs to upgrade from the multiple upgrade software packages stored in the client to upgrade the firmware in the vehicle of the owner. Specifically, the client determines the selected upgrade software package as the upgrade software package to be encrypted in response to the input selection operation.

[0029] Furthermore, since the upgrade software packages required for different firmwares of the vehicle vary greatly, for example, the upgrade software packages of some controllers are about 4G, while the upgrade software packages of some controllers are only about 100KB, and even the upgrade software packages of some firmware are only a few KB in size. Considering that if all the data in the upgrade software package is still encrypted when the amount of data contained in the upgrade software package is large, the encryption time, the subsequent decryption time of the vehicle, and the upgrade time will all be longer. Therefore, after determining the upgrade software package to be encrypted, the client can further determine whether the amount of data in the upgrade software package to be encrypted is greater than the first data volume threshold. If the amount of data in the upgrade software package to be encrypted is greater than the first data volume threshold, it is determined that the upgrade software package is too large, and then the upgrade software package can be split to obtain a first data packet and a second data packet, and then the first data packet is sent to the server for encryption. In other words, when the data contained in the upgrade software package to be encrypted is large, only part of the data in the upgrade software package is encrypted, thereby shortening the encryption time and the subsequent decryption time of the vehicle, so as to improve the firmware upgrade efficiency of the vehicle. Furthermore, when the amount of data in the upgrade software package is large, only part of the data is sent to the server for encryption, which greatly improves the data transmission efficiency compared to sending the entire package.

[0030] Optionally, the upgrade software package to be encrypted may be an ECU firmware, a transmission control unit (TCU) firmware, an electronic brake control unit (EBCU) firmware, an infotainment system firmware, an advanced driving assistance system (ADAS) firmware, a battery management system (BMS) firmware, a body control module (BCM) firmware, a telematics control unit (TCU) firmware, an airbag control unit (ACU) firmware, or an upgrade software package of an instrument panel and display firmware, etc., which is not limited in this embodiment.

[0031] Step S102: receiving the encrypted first data packet fed back by the server.

[0032] Step S103: synthesize the second data packet and the encrypted first data packet to generate an encrypted upgrade package.

[0033] Correspondingly, after receiving the first data packet, the server will encrypt the first data packet using the corresponding target encryption algorithm and target encryption key, and feedback the encrypted first data packet to the client. After receiving the encrypted first data packet fed back by the server, the client will merge the second data packet and the encrypted first data packet to obtain the above-mentioned encrypted upgrade package.

[0034] Step S104: Send the encrypted upgrade package to the vehicle, so that the vehicle decrypts the encrypted upgrade package and then upgrades the firmware of the vehicle.

[0035] Furthermore, the client may send the encrypted upgrade package to the vehicle via a wired connection or a wireless connection. For example, the client and the vehicle are connected via a USB cable, and the client transmits the encrypted upgrade package to the vehicle based on the USB cable.

[0036] Optionally, if the amount of data in the upgrade software package to be encrypted is less than or equal to the first data amount threshold, the upgrade software package can be directly sent to the server for encryption; the encrypted upgrade software package fed back by the server is received, and the encrypted upgrade software package is sent to the vehicle as an encrypted upgrade package, so that the vehicle decrypts the encrypted upgrade package and then upgrades the firmware of the vehicle. In other words, when the upgrade software package to be encrypted contains less data, the entire upgrade software package to be encrypted can be directly encrypted; in this way, the security of the upgrade software package can be further improved, and at the same time, the encrypted upgrade package containing less data can also be efficiently decrypted.

[0037] In this embodiment, different encryption strategies are adopted according to the size of the upgrade software package to be encrypted; if the upgrade software package to be encrypted contains a large amount of data, the upgrade software package is divided into packets, and only the first data packet (i.e., part of the data) obtained by the division is encrypted, thereby improving the decryption efficiency of the subsequent vehicle and the speed of firmware upgrade. If the upgrade software package to be encrypted contains a small amount of data, the entire upgrade software package is encrypted, thereby further improving the security of the upgrade software package on the basis of ensuring the decryption efficiency of the vehicle.

[0038] Please refer to Figure 2 , Figure 2 A schematic diagram of a vehicle encryption upgrade method provided in another embodiment of the present application is applied to a client. Figure 2 The encryption upgrade method of the vehicle provided in the embodiment of the present application is described in detail. The encryption upgrade method of the vehicle may include the following steps:

[0039] Step S201: If the amount of data in the upgrade software package is greater than a first data amount threshold and less than a second data amount threshold, the data of the first data amount threshold is split as the first data packet with the header file data of the upgrade software package as the starting position, and the other data in the upgrade software package except the first data packet is split into the second data packet, and the second data amount threshold is greater than the first data amount threshold.

[0040] In this embodiment, if the amount of data in the upgrade software package is greater than the first data amount threshold and less than the second data amount threshold, it can be determined that the upgrade software package is large. At this time, if the upgrade software package is still encrypted as a whole, in addition to the long encryption time, the subsequent vehicle will also have a long decryption time for the encrypted upgrade software package, which will result in low decryption efficiency of the vehicle for the upgrade software package and firmware upgrade efficiency. Therefore, in the case where the upgrade software package is determined to be large, only part of the data in the upgrade software package can be encrypted; specifically, considering that the header file data often records the metadata in the upgrade software package, and the metadata is very sensitive and important. Therefore, the header file data of the upgrade software package can be used as the starting position to split the data of the first data amount threshold as the first data packet, wherein the first data packet is a continuous data segment; and the other data in the upgrade software package other than the first data packet is split into a second data packet, wherein the second data packet is also a continuous data segment. In this way, encrypting the first data packet containing the header file data can more effectively ensure the security of the core data (such as metadata) in the upgrade software package.

[0041] Exemplarily, the first quantity threshold is 10M, and the second quantity threshold is 50M. If the amount of data in the upgrade software package is 30M, the upgrade software package will be split into a first data packet and a second data packet. The size of the first data packet is 10M, and the size of the second data packet is 40M.

[0042] Step S202: If the data volume in the upgrade software package is greater than the second data volume threshold, a target data volume is determined based on the data volume of the upgrade software package, and data of the target data volume is split as the first data packet with the header file data of the upgrade software package as the starting position, and other data in the upgrade software package except the first data packet is split into the second data packet, wherein the target data volume is smaller than the data volume of the upgrade software package and is positively correlated with the data volume of the upgrade software package.

[0043] Optionally, if the amount of data in the upgrade software package is greater than the second data amount threshold, it can be determined that the upgrade software package is very large. Obviously, at this time, the entire upgrade software package is encrypted, and both the encryption time and the subsequent vehicle decryption time and firmware upgrade time are long; and, even if the first data package is split and encrypted after splitting using the header file data of the upgrade software package as the starting position in step S210 and the data of the first data amount threshold is split as the first data package, since the amount of data in the upgrade software package is large and the first data amount threshold is small, the encryption strength of the upgrade software package will be insufficient, thereby reducing the security of the upgrade software package.

[0044] Therefore, when it is determined that the upgrade package is very large, the target data volume is determined based on the data volume of the upgrade package. Specifically, the product of the data volume of the upgrade package and the preset proportional coefficient is obtained as the target data volume. The preset proportional coefficient is a positive number less than 1; for example, 0.3. Further, the header file data of the upgrade package is used as the starting position, and the data of the target data volume is split as the first data packet, and the other data in the upgrade package except the first data packet is split into the second data packet. It should be noted that the first data packet and the second data packet are both continuous data segments.

[0045] Exemplarily, the first quantity threshold is 10M, the second quantity threshold is 50M, if the data volume in the upgrade software package is 1000M, and the preset proportional coefficient is 0.3. At this time, the product of the data volume of the upgrade software package 1000M and the preset proportional coefficient 0.3 is obtained as the target data volume 300M. Then, the header file data of the upgrade software package is used as the starting position, the split data is used as the first data packet, and the other data in the upgrade software package except the first data packet is split into the second data packet. At this time, the data volume in the first data packet is 300M, and the data volume in the second data packet is 700M.

[0046] In this way, the first data packet containing an appropriate amount of data can be dynamically split out for encryption according to the amount of data in the upgrade software package, while taking into account the simplicity of encryption and the adaptability of encryption strength.

[0047] In some embodiments, the preset proportional coefficient can also be dynamically adjusted according to the performance parameters of the vehicle. Specifically, the upgrader can also input the vehicle model identification of the vehicle, and correspondingly, the client can determine the performance parameter value of the vehicle based on the vehicle model identification, for example, the processing speed or computing power value of the domain controller (such as how many floating-point operations can be performed per second). Further, from a plurality of preset performance parameter ranges, a preset performance parameter range in which the performance parameter value of the vehicle is located is determined as a target parameter range, wherein a plurality of preset performance parameter ranges correspond to a plurality of preset numerical values; then a preset numerical value corresponding to the target parameter range is obtained as the coefficient value of the preset proportional coefficient. It should be noted that different preset performance parameter ranges correspond to different preset numerical values, and the larger the range maximum value of the preset performance parameter range, the larger the preset numerical value corresponding to the preset performance parameter range.

[0048] In a possible implementation, if the amount of data in the upgrade software package is greater than a first data volume threshold, and the ratio of the amount of data in the upgrade software package to the first data volume threshold is greater than a first value and less than a second value, the header file data of the upgrade software package is used as the starting position, the data of the first data volume threshold is split as the first data packet, and the other data in the upgrade software package except the first data packet is split into the second data packet, wherein the second value is greater than the first value. Optionally, if the amount of data in the upgrade software package is greater than the first data volume threshold, and the ratio of the amount of data in the upgrade software package to the first data volume threshold is greater than the aforementioned second value, the target data volume is determined based on the data volume of the upgrade software package, and the header file data of the upgrade software package is used as the starting position, the data of the target data volume is split as the first data packet, and the other data in the upgrade software package except the first data packet is split into the second data packet, and the target data volume is less than the data volume of the upgrade software package and is positively correlated with the data volume of the upgrade software package. Wherein, the method for determining the target data volume can refer to the content in the aforementioned embodiment, which will not be repeated here.

[0049] Step S203: Send the first data packet to the server for encryption.

[0050] Step S204: receiving the encrypted first data packet fed back by the server.

[0051] Step S205: merging the second data packet and the encrypted first data packet to generate an encrypted upgrade package.

[0052] In this embodiment, the specific implementation of steps S203 to S205 can refer to the content of the above embodiments, which will not be repeated here.

[0053] Step S206: Obtain hash data corresponding to the encrypted upgrade package through a first digest algorithm.

[0054] Among them, the digest algorithm, which can also be called a hash algorithm or a hash algorithm, is an algorithm that maps input data of arbitrary length to output data of fixed length. The main features of this algorithm include that the encryption process does not require a key, and the encrypted data cannot be decrypted. Only by inputting the same plaintext data and passing through the same message digest algorithm can the same ciphertext be obtained. In other words, using the first digest algorithm, the encrypted upgrade package is mapped to data of a fixed length as the hash data corresponding to the encrypted upgrade package. That is, if any data in the encrypted upgrade package is tampered with, the hash data corresponding to the tampered encrypted upgrade package obtained by using the first digest algorithm will change. In this way, the integrity of the encrypted upgrade package can be verified based on the hash data later.

[0055] Step S207: Send the hash data to the server for encryption.

[0056] Step S208: receiving the encrypted hash data fed back by the server, and generating a signature file based on the hash data.

[0057] Step S209: Sending the signature file and the encrypted upgrade package to the vehicle, so that the vehicle verifies the encrypted upgrade package based on the signature file before decrypting the encrypted upgrade package.

[0058] Furthermore, to ensure the security of the hash data, the hash data is sent to the server for encryption, and the encrypted hash data is used as a signature file. The signature file is then added to the encrypted upgrade package. In this way, the subsequent vehicle will first verify the encrypted upgrade package based on the signature file before decrypting the encrypted upgrade package. Specifically, the vehicle can obtain the current hash data corresponding to the encrypted upgrade package through the first digest algorithm; and decrypt the signature file to obtain the hash data corresponding to the encrypted upgrade package obtained in the client. If the current hash data obtained by the vehicle is the same as the hash data corresponding to the encrypted upgrade package obtained in the client, it is determined that the signature verification of the encrypted upgrade package has passed, that is, it is determined that the encrypted upgrade package has not been tampered with; otherwise, it is determined that the signature verification of the encrypted upgrade package has not passed, that is, it is determined that the data in the encrypted upgrade package has been tampered with. Then, after the vehicle passes the signature verification of the encrypted upgrade package, it will decrypt the encrypted upgrade package to use the decrypted software upgrade package to upgrade the firmware of the vehicle.

[0059] In this embodiment, different data splitting strategies and encryption strategies are adopted according to the size of the upgrade software package to be encrypted; if the upgrade software package to be encrypted contains less data, the entire upgrade software package is encrypted, thereby further improving the security of the upgrade software package on the basis of ensuring the decryption efficiency of the vehicle. If the upgrade software package to be encrypted contains more data, the data of the first data volume threshold is fixedly split from the upgrade software as the first data packet, and the split first data packet (i.e., part of the data) is encrypted, thereby improving the subsequent vehicle decryption efficiency and the speed of firmware upgrade. And, if the upgrade software package to be encrypted contains a lot of data, based on a preset proportional coefficient, the data of a more appropriate data volume is flexibly split from the upgrade software as the first data packet, and the split first data packet (i.e., part of the data) is encrypted, thereby taking into account the simplicity of encryption and the adaptability of encryption strength.

[0060] Please refer to Figure 3 , Figure 3 A schematic diagram of a vehicle encryption upgrade method provided in another embodiment of the present application is applied to a server. Figure 3 The encryption upgrade method of the vehicle provided in the embodiment of the present application is described in detail. The encryption upgrade method of the vehicle may include the following steps:

[0061] Step S301: receiving a first data packet sent by a client, where the first data packet is obtained by splitting the upgrade software package by the client when the amount of data in the upgrade software package to be encrypted is greater than a first data amount threshold.

[0062] In this embodiment, the specific implementation of splitting the upgrade software package to be encrypted in step S310 can refer to the content of the above embodiments, which will not be repeated here.

[0063] Step S302: encrypt the first data packet.

[0064] In some embodiments, see Figure 4 , step S302 may include the contents of step S3021 to step S3023:

[0065] Step S3021: Obtain a signature certificate.

[0066] Step S3022: Generate a target encryption key using a preset key generation algorithm and based on the signature certificate.

[0067] It is understandable that the public key certificate for signature verification of the upgrade package will be pre-installed and securely stored in the vehicle. Each vehicle can have a different public key certificate. Different public key certificates correspond to different certificate identifiers. The certificate identifier can be a subject Subject tag or a certificate serial number. Based on this, the server generally stores multiple preset certificates, and multiple preset certificates correspond to multiple certificate identifiers one by one. In addition to sending the first data packet to the server, the client will also send an encryption request instruction. The encryption request instruction generally carries a target certificate identifier, and then the server can query the preset certificate corresponding to the target certificate identifier from multiple preset certificates as the above-mentioned signature certificate.

[0068] Further, the target encryption key is dynamically generated based on the signature certificate using a preset key generation algorithm. Specifically, based on the second digest algorithm, the hash data corresponding to the signature certificate is obtained, wherein the second digest algorithm can be an SM3 algorithm; the hash data is converted into a hexadecimal uppercase string to obtain a first string; a setting string is added to the header of the first string to obtain a second string, wherein the setting string can be regarded as a fixed key header and is also an uppercase string; based on the third digest algorithm, the hash data corresponding to the second string is obtained as the target encryption key, and the third digest algorithm can be a Message-Digest Algorithm 5 (MD5) algorithm; wherein the length of the target encryption key is 128 bits (i.e., 16 bytes). In this way, a plurality of hash algorithms (SM3 and MD5) are combined, and a fixed-length encryption key is dynamically generated by processing the fixed key header and the certificate content. In other words, the target encryption key generated will be different if the certificate content in the signature certificate is different, that is, when encrypting the upgrade package for different vehicles, different target encryption keys can be dynamically generated, which greatly improves the security of the key.

[0069] It should be noted that the server of this embodiment can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, network acceleration services (Content Delivery Network, CDN), and big data and artificial intelligence platforms. This embodiment does not impose any restrictions on this.

[0070] Step S3023: Encrypt the first data packet according to the target encryption key and the target encryption algorithm.

[0071] In order to improve the encryption speed of the server and the decryption speed of subsequent vehicles, the target encryption algorithm may be a symmetric encryption algorithm, such as the Data Encryption Standard (DES) algorithm, the 3DES algorithm, and the Advanced Encryption Standard (AES) algorithm.

[0072] In a possible implementation, if the amount of data in the first data packet is less than the first set data amount, any one of the multiple preset encryption algorithms is called, and the first data packet is encrypted using the target encryption key. Optionally, if the amount of data in the first data packet is greater than or equal to the first set data amount, at least two of the multiple preset encryption algorithms are called, and the first data packet is encrypted multiple times using the target encryption key to improve the security of the upgrade software package. At the same time, since the amount of data in the first data packet is small, subsequent multiple decryption of the vehicle will not take too much time.

[0073] In some embodiments, the first data packet carries the software type identifier of the upgrade software package. Before step S3023, the encryption level of the first data packet can be determined according to the software type identifier; from a plurality of preset encryption algorithms, a preset encryption algorithm matching the encryption level is determined as the target encryption algorithm. Optionally, the aforementioned encryption request instruction may also carry a plurality of preset encryption algorithms whose encryption strengths may be different. The encryption strength of the target encryption algorithm is positively correlated with the encryption level, that is, the higher the encryption level, the higher the encryption strength of the preset encryption algorithm will be called as the target encryption algorithm. Specifically, a target mapping relationship can be pre-set, in which each encryption level corresponds to at least one preset encryption algorithm. In other words, a preset encryption algorithm matching the encryption level can be determined as the target encryption algorithm according to the software type identifier and the target mapping relationship.

[0074] Step S303: Feedback the encrypted first data packet to the client, so that the client merges the second data packet obtained based on the splitting and the encrypted first data packet to generate an encrypted upgrade package, and sends the encrypted upgrade package to the vehicle for firmware upgrade.

[0075] Specifically, after the server feeds back the encrypted first data packet to the client, it will also send back to the client the hash data and signature certificate corresponding to the encrypted upgrade package in the above embodiment. Correspondingly, the client will compress the partially encrypted encrypted upgrade package, signature file and signature certificate to obtain a compressed upgrade file; and send the compressed upgrade file to the vehicle. After the vehicle obtains the compressed upgrade file, please refer to Figure 5, the compressed upgrade file can be decompressed to obtain three files: the encrypted upgrade package, the signature file .sign and the signature certificate .cer; further, the vehicle can obtain the hash data HashData corresponding to the encrypted upgrade package based on the first digest algorithm; first, based on the signature certificate CA pre-stored in the vehicle, verify whether the decompressed signature certificate is legal. If the verification is legal, further use the private key in the signature certificate to decrypt the signature file to obtain the decrypted hash data. Then determine whether the hash data HashData obtained by the vehicle is the same as the decrypted hash data. If they are the same, the signature verification is successful; if they are not the same or the signature certificate is illegal, the signature verification fails. Further, if the signature verification is successful, the encrypted upgrade package can be further read to obtain the unencrypted second data packet and the encrypted first data packet, and the target decryption key for the encrypted upgrade package can be calculated using the preset key generation algorithm and based on the signature certificate. Then use the target decryption key to decrypt the first data packet in the encrypted upgrade package, and merge the second data packet and the decrypted first data packet to obtain the upgrade package; finally, the vehicle uses the upgrade package to upgrade the firmware in the vehicle.

[0076] In this embodiment, the server dynamically generates a target encryption key to ensure the security of the first data packet; and because only part of the data in the upgrade software package is sent to the server for encryption, the encryption efficiency of the server is greatly improved.

[0077] Please refer to Figure 6 , Figure 6 A schematic diagram of a multi-terminal interaction process of a vehicle encryption upgrade method provided in an embodiment of the present application. Figure 6 The encryption upgrade method of the vehicle provided in the embodiment of the present application is described in detail. The encryption upgrade method of the vehicle may include the following contents:

[0078] In this embodiment, first, after developing the upgrade software package, the upgrade personnel can send the upgrade software package to the client, and set the data packet splitting strategy and the encryption signature strategy on the client. The client, in response to the input selection operation, determines the selected upgrade software package as the upgrade software package to be encrypted, and determines whether the amount of data in the upgrade software package is greater than the first data amount threshold. If the amount of data in the upgrade software package to be encrypted is greater than the first data amount threshold, the upgrade software package is split into a first data packet and a second data packet, and the first data packet is sent to the server for encryption. The server receives the first data packet sent by the client, obtains the signature certificate, generates a target encryption key using a preset key generation algorithm and based on the signature certificate, and encrypts the first data packet according to the target encryption key and the target encryption algorithm; and then feeds the encrypted first data packet back to the client.

[0079] Further, the client merges the second data packet and the encrypted first data packet to generate an encrypted upgrade package, obtains the hash data corresponding to the encrypted upgrade package through the first digest algorithm, and then sends the hash data to the server for encryption. The server receives the hash data, and uses the private key in the signature certificate to sign and encrypt the hash data, and then feeds back the signature certificate and the encrypted hash data to the client. The client receives the encrypted hash data fed back by the server, and generates a signature file based on the hash data. The client compresses the partially encrypted encrypted upgrade package, the signature file, and the signature certificate to obtain a compressed upgrade file; and sends the compressed upgrade file to the vehicle. Correspondingly, the vehicle decompresses the compressed upgrade file to obtain three files, namely, the encrypted upgrade package, the signature file, and the signature certificate, and verifies the signature of the encrypted upgrade package. After the signature verification is passed, the first data packet in the encrypted upgrade package is decrypted, and the second data packet and the decrypted first data packet are merged to obtain the upgrade software package. Finally, the vehicle uses the upgrade software package to upgrade the firmware in the vehicle.

[0080] In this way, the server uses a dynamic key method to ensure the security of the key, thereby improving the security of the installation package; and, when the upgrade package contains a large amount of data, only part of the data is sent to the server for encryption through sub-packaging, which greatly reduces the data transmission time and the server encryption time. This makes the subsequent vehicle decryption efficiency higher, thereby improving the vehicle installation package upgrade speed.

[0081] Please refer to Figure 7 , which shows a structural block diagram of a vehicle encryption upgrade device 400 provided by an embodiment of the present application, which is applied to a client. The device 400 may include: a data splitting module 410, a data receiving module 420, an encryption package generating module 430 and a sending module 440.

[0082] The data splitting module 410 is used to split the upgrade software package into a first data packet and a second data packet if the amount of data in the upgrade software package to be encrypted is greater than a first data amount threshold, and send the first data packet to the server for encryption.

[0083] The data receiving module 420 is used to receive the encrypted first data packet fed back by the server.

[0084] The encrypted package generation module 430 is used to merge the second data packet and the encrypted first data packet to generate an encrypted upgrade package.

[0085] The sending module 440 is used to send the encrypted upgrade package to the vehicle, so that the vehicle decrypts the encrypted upgrade package and then upgrades the firmware of the vehicle.

[0086] In some embodiments, the data splitting module 410 can be specifically used to: if the amount of data in the upgrade software package is greater than a first data amount threshold and less than a second data amount threshold, split the data of the first data amount threshold as the first data packet with the header file data of the upgrade software package as the starting position, and split the other data in the upgrade software package except the first data packet into the second data packet, and the second data amount threshold is greater than the first data amount threshold; if the amount of data in the upgrade software package is greater than the second data amount threshold, determine the target data amount based on the data amount of the upgrade software package, and split the data of the target data amount as the first data packet with the header file data of the upgrade software package as the starting position, and split the other data in the upgrade software package except the first data packet into the second data packet, and the target data amount is less than the data amount of the upgrade software package and is positively correlated with the data amount of the upgrade software package.

[0087] In this manner, the data splitting module 410 may include: a data volume acquisition unit, wherein the data volume acquisition unit is used to acquire the product of the data volume of the upgrade software package and a preset proportional coefficient as the target data volume, and the preset proportional coefficient is a positive number less than 1.

[0088] In some embodiments, the encryption upgrade device 400 of the vehicle may further include: a hash data acquisition module, a first sending module, a signature file generation module, and an adding module. Among them, the hash data acquisition module can be used to obtain the hash data corresponding to the encryption upgrade package through a first digest algorithm before sending the encryption upgrade package to the vehicle. The first sending module can be used to send the hash data to the server for encryption. The signature file generation module is used to receive the encrypted hash data fed back by the server and generate a signature file based on the hash data. The adding module is used to add the signature file to the encryption upgrade package so that the vehicle can verify the signature of the encryption upgrade package based on the signature file before decrypting the encryption upgrade package.

[0089] Please refer to Figure 8 , which shows a structural block diagram of a vehicle encryption upgrade device 500 provided in an embodiment of the present application, which is applied to a server. The device 500 may include: a data receiving module 510, an encryption module 520 and a data sending module 530.

[0090] The data receiving module 510 is used to receive a first data packet sent by a client, where the first data packet is obtained by splitting the upgrade software package when the amount of data in the upgrade software package to be encrypted is greater than a first data amount threshold.

[0091] The encryption module 520 is used to encrypt the first data packet.

[0092] The data sending module 530 is used to feed back the encrypted first data packet to the client, so that the client merges the second data packet obtained based on the splitting and the encrypted first data packet to generate an encrypted upgrade package, and sends the encrypted upgrade package to the vehicle for firmware upgrade.

[0093] In some embodiments, the encryption module 520 may include: a certificate acquisition unit, a key generation unit, and an encryption unit. The certificate acquisition unit may be used to acquire a signature certificate. The key generation unit may be used to generate a target encryption key based on the signature certificate using a preset key generation algorithm. The encryption unit may be used to encrypt the first data packet according to the target encryption key and the target encryption algorithm.

[0094] In this manner, the key generation unit can be specifically used to obtain hash data corresponding to the signature certificate based on a second digest algorithm; convert the hash data into a hexadecimal string to obtain a first string; add a set string to the header of the first string to obtain a second string; and based on a third digest algorithm, obtain hash data corresponding to the second string as the target encryption key.

[0095] In some embodiments, the first data packet carries a software type identifier of the upgrade software package, and the vehicle encryption upgrade device 500 may further include: an encryption level determination module and an encryption algorithm determination module. The encryption level determination module may be used to determine the encryption level of the first data packet according to the software type identifier. The encryption algorithm determination module may be used to determine a preset encryption algorithm that matches the encryption level from a plurality of preset encryption algorithms as the target encryption algorithm.

[0096] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices and modules can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here.

[0097] In several embodiments provided in the present application, the coupling between modules may be electrical, mechanical or other forms of coupling.

[0098] In addition, each functional module in each embodiment of the present application can be integrated into a processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The above integrated modules can be implemented in the form of hardware or software functional modules.

[0099] In summary, the server uses a dynamic key method to ensure the security of the key, thereby improving the security of the installation package; and, when the upgrade package contains a large amount of data, only part of the data is sent to the server for encryption through sub-packaging, which greatly reduces the data transmission time and the server encryption time. This makes the subsequent vehicle decryption efficiency higher, thereby improving the vehicle installation package upgrade speed.

[0100] The following will be combined Fig. 9 A computer device provided by the present application is described.

[0101] Reference Fig. 9 , Fig. 9 The structural block diagram of a computer device 600 provided in an embodiment of the present application is shown, and the above method provided in an embodiment of the present application can be executed by the computer device 600. The computer device can be an electronic terminal with a data processing function, and the electronic terminal includes but is not limited to a smart phone, a tablet computer, a laptop computer, and a desktop computer; of course, the computer device can also be a server, and the server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, network acceleration services (Content Delivery Network, CDN), and big data and artificial intelligence platforms.

[0102] The computer device 600 in the embodiment of the present application may include one or more of the following components: a processor 601, a memory 602, and one or more applications, wherein the one or more applications may be stored in the memory 602 and configured to be executed by one or more processors 601, and the one or more programs are configured to execute the method as described in the aforementioned method embodiment.

[0103] The processor 601 may include one or more processing cores. The processor 601 uses various interfaces and lines to connect the various parts of the entire computer device 600, and executes various functions and processes data of the computer device 600 by running or executing instructions, programs, code sets or instruction sets stored in the memory 602, and calling data stored in the memory 602. Optionally, the processor 601 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor 701 can integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing display content; and the modem is used to process wireless communications. It can be understood that the above-mentioned modem can also be integrated into the processor 601 and implemented separately through a communication chip.

[0104] The memory 602 may include a random access memory (RAM) or a read-only memory (ROM). The memory 602 may be used to store instructions, programs, codes, code sets or instruction sets. The memory 602 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the following various method embodiments, etc. The data storage area may also store data (such as the various corresponding relationships described above) created by the computer device 600 during use.

[0105] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices and modules can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here.

[0106] In several embodiments provided in the present application, the coupling or direct coupling or communication connection between the modules shown or discussed may be an indirect coupling or communication connection through some interfaces, devices or modules, which may be electrical, mechanical or other forms.

[0107] In addition, each functional module in each embodiment of the present application can be integrated into a processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The above integrated modules can be implemented in the form of hardware or software functional modules.

[0108] Please refer to Fig.10 , which shows a structural block diagram of a computer-readable storage medium provided in an embodiment of the present application. The computer-readable medium 700 stores program codes, which can be called by a processor to execute the method described in the above method embodiment.

[0109] The computer readable storage medium 700 may be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read-only memory), an EPROM, a hard disk, or a ROM. Optionally, the computer readable storage medium 700 includes a non-transitory computer-readable storage medium. The computer readable storage medium 700 has storage space for program code 710 that performs any method step of the above method. These program codes can be read from or written to one or more computer program products. The program code 710 can be compressed, for example, in an appropriate form.

[0110] In some embodiments, a computer program product or computer program is provided, the computer program product or computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. A processor of an electronic device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the electronic device performs the steps in the above-mentioned method embodiments.

[0111] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. 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. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for upgrading encryption of a vehicle, characterized in that: Applied to a client, the method comprises: If the amount of data in the upgrade software package to be encrypted is greater than a first data amount threshold, splitting the upgrade software package into a first data packet and a second data packet, and sending the first data packet to the server for encryption; Receiving the encrypted first data packet fed back by the server; Merging the second data packet and the encrypted first data packet to generate an encrypted upgrade package; The encrypted upgrade package is sent to the vehicle, so that the vehicle decrypts the encrypted upgrade package and then upgrades the firmware of the vehicle.

2. The method according to claim 1, characterized in that If the amount of data in the upgrade software package to be encrypted is greater than a first data amount threshold, splitting the upgrade software package into a first data package and a second data package includes: If the amount of data in the upgrade software package is greater than a first data amount threshold and less than a second data amount threshold, splitting the data of the first data amount threshold as the first data packet with the header file data of the upgrade software package as the starting position, and splitting the other data in the upgrade software package except the first data packet into the second data packet, where the second data amount threshold is greater than the first data amount threshold; If the data volume in the upgrade software package is greater than the second data volume threshold, a target data volume is determined based on the data volume of the upgrade software package, and data of the target data volume is split into the first data packet with header file data of the upgrade software package as a starting position, and other data in the upgrade software package except the first data packet is split into the second data packet, and the target data volume is smaller than the data volume of the upgrade software package and is positively correlated with the data volume of the upgrade software package.

3. The method according to claim 2, characterized in that The determining the target data volume based on the data volume of the upgrade software package includes: The product of the data volume of the upgrade software package and a preset proportionality coefficient is obtained as the target data volume, and the preset proportionality coefficient is a positive number less than 1.

4. The method according to claim 1, characterized in that: Before sending the encrypted upgrade package to the vehicle, the method further includes: Obtaining hash data corresponding to the encrypted upgrade package through a first digest algorithm; Sending the hash data to the server for encryption; Receive the encrypted hash data fed back by the server, and generate a signature file based on the hash data; The step of sending the encrypted upgrade package to the vehicle comprises: The signature file and the encrypted upgrade package are sent to the vehicle, so that the vehicle verifies the encrypted upgrade package based on the signature file before decrypting the encrypted upgrade package.

5. A method for upgrading encryption of a vehicle, characterized in that: Applied to a server, the method comprises: receiving a first data packet sent by a client, where the first data packet is obtained by splitting the upgrade software package by the client when the amount of data in the upgrade software package to be encrypted is greater than a first data amount threshold; encrypting the first data packet; The encrypted first data packet is fed back to the client, so that the client combines the second data packet obtained based on the splitting and the encrypted first data packet to generate an encrypted upgrade package, and sends the encrypted upgrade package to the vehicle for firmware upgrade.

6. The method according to claim 5, characterized in that The encrypting the first data packet comprises: Get a signed certificate; Generate a target encryption key using a preset key generation algorithm and based on the signature certificate; The first data packet is encrypted according to the target encryption key and the target encryption algorithm.

7. The method according to claim 6, characterized in that The method of generating a target encryption key by using a preset key generation algorithm and based on the signature certificate includes: Based on the second digest algorithm, obtaining hash data corresponding to the signature certificate; Convert the hash data into a hexadecimal string to obtain a first string; Adding a setting string to the head of the first string to obtain a second string; Based on a third digest algorithm, hash data corresponding to the second character string is obtained as the target encryption key.

8. The method according to claim 6, characterized in that The first data packet carries a software type identifier of the upgrade software package. Before encrypting the first data packet according to the target encryption key and the target encryption algorithm, the method further includes: Determining an encryption level of the first data packet according to the software type identifier; From a plurality of preset encryption algorithms, a preset encryption algorithm matching the encryption level is determined as the target encryption algorithm.

9. A vehicle encryption upgrade device, characterized in that: Applied to a client, the device comprises: a data splitting module, configured to split the upgrade software package into a first data packet and a second data packet if the amount of data in the upgrade software package to be encrypted is greater than a first data amount threshold, and send the first data packet to the server for encryption; A data receiving module, used for receiving the encrypted first data packet fed back by the server; An encrypted package generation module, used for merging the second data packet and the encrypted first data packet to generate an encrypted upgrade package; The sending module is used to send the encrypted upgrade package to the vehicle, so that the vehicle can upgrade its own firmware after decrypting the encrypted upgrade package.

10. A vehicle encryption upgrade device, characterized in that: Applied to a server, the device comprises: a data receiving module, configured to receive a first data packet sent by a client, wherein the first data packet is obtained by splitting the upgrade software package by the client when the amount of data in the upgrade software package to be encrypted is greater than a first data amount threshold; An encryption module, used for encrypting the first data packet; The data sending module is used to feed back the encrypted first data packet to the client, so that the client combines the second data packet obtained based on the splitting and the encrypted first data packet to generate an encrypted upgrade package, and sends the encrypted upgrade package to the vehicle for firmware upgrade.

11. A computer device, characterized in that: include: one or more processors; Memory; One or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs are configured to execute the method according to any one of claims 1 to 8.

12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores program code, which can be called by a processor to execute the method according to any one of claims 1 to 8.

13. A computer program product, characterized in that The computer program product comprises computer instructions, and when the computer instructions are executed by a processor, the method according to any one of claims 1 to 8 is implemented.

Citation Information

Cited By

  • Software upgrade package automatic pushing method and device and computer equipment

    CN121070407A