Software update method, device and digital signature system for vehicle controller
By managing key pairs online, the problem of low efficiency in digital signatures during vehicle controller software upgrades was solved, enabling an efficient and secure software upgrade process and ensuring that vehicle development progress was not affected.
Patent Information
- Application Number
- CN202410893881.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-04
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2044-07-04
AI Technical Summary
In existing technologies, digital signatures are inefficient during vehicle controller software upgrades, offline management of key pairs leads to frequent upgrades that affect development progress, and there is a risk of key leakage.
By adopting an online key pair management approach, key pairs for different controllers and digital signature algorithms are stored in a first database. The private key is then located using the target controller and algorithm identifier to generate a signature file, thereby improving the efficiency of signature file generation.
It improved the efficiency of signature file generation, reduced the impact on vehicle development progress, enhanced the security of software upgrades, and avoided the risk of unauthorized tampering.
Smart Images

Figure CN118885190B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of vehicle technology, and in particular to a software update method, apparatus and digital signature system for a vehicle controller. Background Technology
[0002] As demands for vehicle power, economy, and comfort continue to increase, the integrated electronic and electrical systems within vehicles are becoming increasingly complex, including engine systems, transformer systems, and instrument systems. Each of these electronic and electrical systems includes a controller and the software installed within it. In some cases, this software may be illegally modified or maliciously attacked during upgrades. Therefore, it is necessary to employ reasonable methods for software updates to ensure the security of software upgrades.
[0003] In related technologies, digital signatures are used to verify the authenticity and integrity of software packages. However, since the key pairs used for digital signatures are generated and managed offline, the software may be frequently upgraded during the vehicle development process. Managing the key pairs offline often leads to low efficiency of digital signatures, which affects the vehicle development progress. Summary of the Invention
[0004] This application provides a software update method, apparatus, and digital signature system for a vehicle controller, which can improve the efficiency of generating signature files. Even with frequent software upgrades, the efficiency of digital signatures can still be improved, without affecting the vehicle's development progress. The technical solution is as follows:
[0005] On one hand, a software update method for a vehicle controller is provided, the method comprising:
[0006] Obtain the identifier of the target controller, the identifier of the target digital signature algorithm, and the digest of the software update package of the target software, wherein the target controller refers to the controller used to install the target software;
[0007] Based on the identifier of the target controller and the identifier of the target digital signature algorithm, the private key in the first key pair is retrieved from the first database. The first database is used to store the private keys in the key pairs applied for for different controllers and different digital signature algorithms. The first key pair is the key pair applied for for the target controller and the target digital signature algorithm.
[0008] A first signature file is generated based on the digest of the software update package of the target software and the private key in the first key pair. The first signature file is used to verify the authenticity and integrity of the software update package before the target controller updates the target software.
[0009] Optionally, obtaining the identifier of the target controller, the identifier of the target digital signature algorithm, and the digest of the software update package of the target software includes:
[0010] The digital signature interface is used to obtain the digest of the update package of the software to be signed, the identifier of the controller used to install the software to be signed, and the identifier of the digital signature algorithm used.
[0011] Obtain the identifier of the target controller, the identifier of the target digital signature algorithm, and the summary of the software update package of the target software from the digital signature interface.
[0012] Optionally, before obtaining the identifier of the target controller, the identifier of the target digital signature algorithm, and the digest of the software update package of the target software, the method further includes:
[0013] Obtain a key request request, the key request request carrying the identifier of the target controller and the identifier of the target digital signature algorithm;
[0014] Based on the identifier of the target controller and the identifier of the target digital signature algorithm, check whether the private key of the first key pair is stored in the first database;
[0015] If the private key of the first key pair is not stored in the first database, the first key pair is generated by calling a hardware encryption machine, and the private key of the first key pair is stored in the first database according to the identifier of the target controller and the identifier of the target digital signature algorithm.
[0016] Optionally, after generating the first key pair by calling the hardware encryption machine, the method further includes: encrypting the private key in the first key pair by calling the hardware encryption machine, and obtaining the encryption algorithm of the private key in the first key pair;
[0017] The step of storing the private key in the first key pair into the first database according to the identifier of the target controller and the identifier of the target digital signature algorithm includes: storing the encrypted private key in the first key pair into the first database according to the identifier of the target controller and the identifier of the target digital signature algorithm;
[0018] The step of generating a first signature file based on the digest of the software update package of the target software and the private key in the first key pair includes: decrypting the encrypted private key based on the encryption algorithm of the private key in the first key pair; and generating the first signature file based on the digest of the software update package of the target software and the decrypted private key.
[0019] Optionally, the method further includes:
[0020] Receive a data compressed package sent by the after-sales upgrade system, the data compressed package carrying the software update package of the target software and the first signature file;
[0021] A second key pair corresponding to the data compressed package is generated, and a second signature file is generated based on the data compressed package and the private key in the second key pair. The second signature file is used to verify the authenticity and integrity of the data compressed package.
[0022] The system sends the second signature file and the public key from the second key pair to the after-sales upgrade system, so that the after-sales upgrade system sends the public key from the second key pair, the second signature file, and the data compressed package to the diagnostic device. After the diagnostic device verifies the data compressed package, it instructs the target controller to update the target software.
[0023] On the other hand, a software update method for a vehicle controller is provided, the method comprising:
[0024] Obtain a software update task, wherein the software update task carries the identifier of the target controller and the updated version of the target software, wherein the target controller refers to the controller used to install the target software;
[0025] Based on the identifier of the target controller and the updated version of the target software, the software update package and the first signature file of the target software are obtained. The first signature file is used to verify the authenticity and integrity of the software update package of the target software before the target controller updates the target software.
[0026] The diagnostic device sends the software update package of the target software and the first signature file to the target controller, so that the target controller can update the target software according to the software update package after verifying the software update package based on the first signature file.
[0027] Optionally, before sending the software update package of the target software and the first signature file to the target controller via the diagnostic device, the method further includes:
[0028] The software update package and the first signature file are compressed to obtain a compressed data package;
[0029] The data compressed package is sent to the digital signature system so that the data signature system generates a second key pair corresponding to the data compressed package and generates a second signature file based on the private key in the data compressed package and the second key pair. The second signature file is used to verify the authenticity and integrity of the data compressed package.
[0030] Receive the second signature file and the public key from the second key pair sent by the digital signature system;
[0031] The step of sending the software update package of the target software and the first signature file to the target controller via the diagnostic device includes:
[0032] The data compressed package, the second signature file, and the public key from the second key pair are sent to the diagnostic device, so that the diagnostic device can verify the data compressed package using the public key from the second key pair and the second signature file, and then send the software update package of the target software and the first signature file to the target controller.
[0033] On the other hand, a software update device for a vehicle controller is provided, the device comprising:
[0034] The first acquisition module is used to acquire the identifier of the target controller, the identifier of the target digital signature algorithm, and the digest of the software update package of the target software, wherein the target controller refers to the controller used to install the target software;
[0035] The first lookup module is used to look up the private key in the first key pair from the first database based on the identifier of the target controller and the identifier of the target digital signature algorithm. The first database is used to store the private keys in the key pairs applied for for different controllers and different digital signature algorithms. The first key pair is the key pair applied for for the target controller and the target digital signature algorithm.
[0036] A first generation module is used to generate a first signature file based on the digest of the software update package of the target software and the private key in the first key pair. The first signature file is used to verify the authenticity and integrity of the software update package before the target controller updates the target software.
[0037] Optionally, the first acquisition module includes:
[0038] The display submodule is used to display the digital signature interface, which is used to obtain the digest of the update package of the software to be signed, the identifier of the controller used to install the software to be signed, and the identifier of the digital signature algorithm used.
[0039] The acquisition submodule is used to acquire the identifier of the target controller, the identifier of the target digital signature algorithm, and the summary of the software update package of the target software from the digital signature interface.
[0040] Optionally, the device further includes:
[0041] The second acquisition module is used to acquire a key application request, wherein the key application request carries the identifier of the target controller and the identifier of the target digital signature algorithm;
[0042] The second search module is used to search whether the private key in the first key pair is stored in the first database based on the identifier of the target controller and the identifier of the target digital signature algorithm.
[0043] The second generation module is used to generate the first key pair by calling a hardware encryption machine if the private key in the first key pair is not stored in the first database, and to store the private key in the first key pair in the first database according to the identifier of the target controller and the identifier of the target digital signature algorithm.
[0044] Optionally, the device further includes:
[0045] The encryption module is used to encrypt the private key in the first key pair by calling the hardware encryption machine, and to obtain the encryption algorithm of the private key in the first key pair.
[0046] The second generation module includes:
[0047] The storage submodule is used to store the encrypted private key from the first key pair into the first database according to the identifier of the target controller and the identifier of the target digital signature algorithm;
[0048] The first generation module includes:
[0049] The decryption submodule is used to decrypt the encrypted private key based on the encryption algorithm of the private key in the first key pair; and to generate the first signature file based on the digest of the software update package of the target software and the decrypted private key.
[0050] Optionally, the device further includes:
[0051] The receiving module is used to receive a data compressed package sent by the after-sales upgrade system. The data compressed package carries the software update package of the target software and the first signature file.
[0052] The third generation module is used to generate a second key pair corresponding to the data compressed package, and generate a second signature file based on the data compressed package and the private key in the second key pair. The second signature file is used to verify the authenticity and integrity of the data compressed package.
[0053] The sending module is used to send the second signature file and the public key in the second key pair to the after-sales upgrade system, so that the after-sales upgrade system sends the public key in the second key pair, the second signature file and the data compressed package to the diagnostic device, so that after the diagnostic device verifies the data compressed package, it instructs the target controller to update the target software.
[0054] On the other hand, a software update device for a vehicle controller is provided, the device comprising:
[0055] The first acquisition module is used to acquire a software update task, wherein the software update task carries the identifier of the target controller and the updated version of the target software, and the target controller refers to the controller used to install the target software;
[0056] The second acquisition module is used to acquire the software update package and the first signature file of the target software based on the identifier of the target controller and the updated version of the target software. The first signature file is used to verify the authenticity and integrity of the software update package of the target software before the target controller updates the target software.
[0057] The first sending module is used to send the software update package of the target software and the first signature file to the target controller through a diagnostic device, so that the target controller can update the target software according to the software update package after verifying the software update package based on the first signature file.
[0058] Optionally, the device further includes:
[0059] A compression module is used to compress the software update package and the first signature file to obtain a compressed data package;
[0060] The second sending module is used to send the data compressed package to the digital signature system so that the data signature system generates a second key pair corresponding to the data compressed package, and generates a second signature file based on the private key in the data compressed package and the second key pair. The second signature file is used to verify the authenticity and integrity of the data compressed package.
[0061] The receiving module is used to receive the second signature file and the public key in the second key pair sent by the digital signature system;
[0062] The first sending module includes:
[0063] The sending submodule is used to send the data compressed package, the second signature file, and the public key in the second key pair to the diagnostic device, so that the diagnostic device can verify the data compressed package using the public key in the second key pair and the second signature file, and then send the software update package of the target software and the first signature file to the target controller.
[0064] On the other hand, a digital signature system is provided, the digital signature system including a memory and a processor, the memory for storing computer programs, and the processor for executing the computer programs stored in the memory to implement the steps of the software update method for the vehicle controller described above.
[0065] On the other hand, an after-sales upgrade system is provided, which includes a memory and a processor. The memory is used to store computer programs, and the processor is used to execute the computer programs stored in the memory to implement the steps of the above-described software update method for the vehicle controller.
[0066] On the other hand, a computer-readable storage medium is provided, wherein a computer program is stored therein, and when the computer program is executed by a processor, it implements the steps of the software update method for the vehicle controller described above.
[0067] On the other hand, a computer program product containing instructions is provided that, when the instructions are run on a computer, causes the computer to perform the steps of the software update method for the vehicle controller described above.
[0068] The technical solution provided in this application can bring at least the following beneficial effects:
[0069] The first database stores the private keys of key pairs applied for for different controllers and different digital signature algorithms. Thus, when the digital signature system needs to generate a signature file for a software update package of the target software, it can retrieve the private key from the first key pair in the first database based on the identifier of the target controller and the identifier of the target digital signature algorithm. Then, it generates the first signature file using the digest of the target software update package and the private key in the first key pair. In other words, by uniformly managing key pairs online, the private key in the key pair can be queried online when generating a signature file. Compared to offline management and querying of private keys, this improves the efficiency of key pair retrieval, thereby improving the efficiency of signature file generation. Even with frequent software upgrades, the efficiency of digital signatures remains improved, without affecting the vehicle's development schedule. Attached Figure Description
[0070] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0071] Figure 1 This is a schematic diagram of the structure of an implementation environment provided in an embodiment of this application;
[0072] Figure 2 This is a schematic diagram of another implementation environment provided in this application embodiment;
[0073] Figure 3 This is a flowchart of a software update method for a vehicle controller provided in an embodiment of this application;
[0074] Figure 4 This is a flowchart of a software update method for a vehicle controller provided in an embodiment of this application;
[0075] Figure 5 This is a flowchart of a software update method for a vehicle controller provided in an embodiment of this application;
[0076] Figure 6 This is a flowchart of a software update method for a vehicle controller provided in an embodiment of this application;
[0077] Figure 7 This is a schematic diagram of the structure of a software update device for a vehicle controller provided in an embodiment of this application;
[0078] Figure 8 This is a schematic diagram of the structure of a software update device for a vehicle controller provided in an embodiment of this application;
[0079] Figure 9 This is a schematic diagram of the structure of a server provided in an embodiment of this application. Detailed Implementation
[0080] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the implementation methods of this application will be further described in detail below with reference to the accompanying drawings.
[0081] Before providing a detailed explanation of the software update method for the vehicle controller provided in the embodiments of this application, the application scenarios and implementation environment involved in the embodiments of this application will be introduced first.
[0082] As demands for vehicle power, economy, and comfort continue to increase, the integrated electronic and electrical systems in vehicles are becoming increasingly complex, including engine systems, transformer systems, and instrument systems. Each of these systems includes a controller and the software installed within it. Furthermore, various third-party devices have emerged, including some capable of acquiring critical vehicle information, such as in-vehicle devices or devices from vehicle repair shops. These third-party devices may illegally tamper with or maliciously attack software during upgrades. Therefore, to avoid security risks posed by third-party devices during software upgrades, it is necessary to employ reasonable methods for software updates to ensure their security.
[0083] In related technologies, digital signatures are used to verify the authenticity and integrity of software packages. However, since the key pairs used for digital signatures are generated and managed offline, there is a risk of key pair leakage. Moreover, during the development of vehicles, software may be frequently upgraded. Managing keys offline often leads to low efficiency of digital signatures, which affects the development progress of vehicles.
[0084] Based on this, embodiments of this application provide a software update method for a vehicle controller, which enables the digital signature system to generate and manage key pairs online while improving the efficiency of digital signatures.
[0085] Please refer to Figure 1 , Figure 1 This is a schematic diagram illustrating an implementation environment according to an exemplary embodiment. The implementation environment includes a digital signature system 101 and a first database 102. The digital signature system 101 can communicate with the first database 102 via a wired or wireless connection. Alternatively, the digital signature system 101 may include the first database 102; this embodiment does not limit the scope of the application.
[0086] The digital signature system 101 is used to obtain the identifier of the target controller, the identifier of the target digital signature algorithm, and the digest of the software update package of the target software. Based on the identifier of the target controller and the identifier of the target digital signature algorithm, it searches for the private key in the first key pair from the private keys of the key pairs applied for by different controllers and different digital signature algorithms stored in the first database 102. Then, it generates a first signature file based on the digest of the software update package of the target software and the private key in the first key pair.
[0087] In some embodiments, please refer to Figure 2The implementation environment may also include an after-sales upgrade system 103, a diagnostic device 104, and a target controller 105. The after-sales upgrade system 103 may be connected to the digital signature system 101 and the diagnostic device 104 respectively. The diagnostic device 104 may be connected to the target controller 105. The communication connection may be wired or wireless, and this application embodiment does not limit it.
[0088] The after-sales upgrade system 103 is used to obtain software update tasks and, based on the identifier of the target controller 105 and the updated version of the target software, obtains the software update package and the first signature file of the target software, and sends the update package and the first signature file of the target software to the diagnostic device 104. The diagnostic device 104 is used to send the software update package and the first signature file of the target software to the target controller 105. The target controller 105 is used to verify the software update package based on the first signature file, and updates the target software according to the software update package after successful verification.
[0089] The digital signature system 101 and the after-sales upgrade system 103 can be a standalone server, a server cluster or a 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 communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms, or a cloud computing service center.
[0090] The diagnostic device 104 can be a vehicle diagnostic tool, a host computer, or any external device that can instruct the controller to perform software updates.
[0091] The target controller 105 can be any type of controller with software installed, such as a vehicle's engine controller, body controller, chassis controller, etc.
[0092] Those skilled in the art should understand that the above-described digital signature system 101, after-sales upgrade system 103, diagnostic device 104, and target controller 105 are merely examples. Other existing or future digital signature systems, after-sales upgrade systems, diagnostic devices, and target controllers that are applicable to the embodiments of this application should also be included within the scope of protection of the embodiments of this application, and are hereby incorporated by reference.
[0093] It should be noted that the application scenarios and implementation environments described in the embodiments of this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided in the embodiments of this application. As those skilled in the art will know, with the emergence of new application scenarios and the evolution of implementation environments, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.
[0094] The following is a detailed explanation of a software update method for a vehicle controller provided in the embodiments of this application.
[0095] Figure 3 This is a flowchart illustrating a software update method for a vehicle controller according to an embodiment of this application. This method is applied to a digital signature system. Please refer to... Figure 3 The method includes the following steps.
[0096] Step 301: The digital signature system obtains the identifier of the target controller, the identifier of the target digital signature algorithm, and the digest of the software update package of the target software. The target controller refers to the controller used to install the target software.
[0097] The implementation method of step 301 can be found in the following sections. Figure 5 Step 501 in the embodiment will not be described in detail here.
[0098] Step 302: The digital signature system searches for the private key in the first key pair from the first database based on the identifier of the target controller and the identifier of the target digital signature algorithm. The first database is used to store the private keys in the key pairs applied for for different controllers and different digital signature algorithms. The first key pair is the key pair applied for for the target controller and the target digital signature algorithm.
[0099] Additionally, the implementation method for step 302 can be found in the following sections. Figure 5 Step 502 in the embodiment will not be described in detail here.
[0100] Step 303: The digital signature system generates a first signature file based on the digest of the software update package of the target software and the private key in the first key pair. The first signature file is used to verify the authenticity and integrity of the software update package before the target controller updates the target software.
[0101] The implementation method of step 303 can be found in the following sections. Figure 5 Step 503 in the embodiment will not be described in detail here.
[0102] In this embodiment, the first database stores private keys from key pairs applied for for different controllers and different digital signature algorithms. Thus, when the digital signature system needs to generate a signature file for a software update package of the target software, it can retrieve the private key from the first key pair in the first database based on the identifier of the target controller and the identifier of the target digital signature algorithm. Then, it generates the first signature file using the digest of the software update package of the target software and the private key from the first key pair. In other words, by uniformly managing the key pairs online, the private key in the key pair can be queried online when generating the signature file. Compared to offline management and querying of private keys, this improves the efficiency of key pair retrieval, thereby improving the efficiency of signature file generation. Even with frequent software upgrades, the efficiency of digital signatures remains high, without affecting the vehicle's development progress.
[0103] Figure 4 This is a flowchart illustrating a software update method for a vehicle controller according to an embodiment of this application. This method is applied to an aftermarket upgrade system. Please refer to... Figure 4 The method includes the following steps.
[0104] Step 401: The after-sales upgrade system obtains the software update task. The software update task carries the identifier of the target controller and the updated version of the target software. The target controller refers to the controller used to install the target software.
[0105] The implementation method of step 401 can be found in the following sections. Figure 5 Step 504 in the embodiment will not be described in detail here.
[0106] Step 402: The after-sales upgrade system obtains the software update package and the first signature file of the target software based on the identifier of the target controller and the updated version of the target software. The first signature file is used to verify the authenticity and integrity of the software update package of the target software before the target controller updates the target software.
[0107] Additionally, the implementation method for step 402 can be found in the following sections. Figure 5 Step 505 in the embodiment will not be described in detail here.
[0108] Step 403: The after-sales upgrade system sends the software update package and the first signature file of the target software to the target controller through the diagnostic device, so that the target controller can verify the software update package of the target software based on the first signature file and update the target software according to the software update package.
[0109] The implementation method of step 403 can be found in the following sections. Figure 5 Step 506 in the embodiment will not be described in detail here.
[0110] In this embodiment, the after-sales upgrade system sends a software update package and a first signature file of the target software to the target controller via a diagnostic device. The target controller then verifies the software update package using the first signature file and updates the software accordingly. Since the first signature file is generated by querying the private key in a key pair online, compared to offline management and querying of the private key, the efficiency of finding the key pair is improved, thereby improving the efficiency of generating the signature file. Even with frequent software upgrades, the efficiency of digital signatures remains high, without affecting the vehicle's development progress. Furthermore, verifying the software update package using the first signature file avoids security risks during software upgrades due to unauthorized tampering of the software update package.
[0111] Figure 5 This is a flowchart illustrating a software update method for a vehicle controller provided in an embodiment of this application. Please refer to... Figure 5 The method includes the following steps.
[0112] Step 501: The digital signature system obtains the identifier of the target controller, the identifier of the target digital signature algorithm, and the digest of the software update package of the target software. The target controller refers to the controller used to install the target software.
[0113] In some embodiments, when a new version of the software in the controller is available, to prevent the software update package from being illegally tampered with, the digital signature system can first digitally sign the software update package. Since the digital signature system needs to identify the controller to which the new version of the software belongs, it can obtain the identifier of the target controller; moreover, the digital signature system also needs to identify the algorithm used when performing the digital signature, so it can also obtain the identifier of the target digital signature algorithm; in addition, the digital signature system also needs to obtain the digest of the target software update package.
[0114] The target controller identifier is used to uniquely identify the target controller, and can be the name, number, etc. of the target controller, such as engine controller, body controller, chassis controller, etc.; the target digital signature algorithm identifier is used to uniquely identify the target digital signature algorithm, and can be the name of the target digital signature algorithm, such as RSA (Rivest-Shamir-Adleman, named after the three inventors Ron Rivest, Adi Shamir and Leonard Adleman)256, RSA512, RSA1024, etc. The numbers in the RSA algorithm are used to represent the key length. The longer the key length, the better the security; the software update package digest of the target software is used to indicate the main information of the software update package.
[0115] A target controller is a controller used to install target software; in other words, it is the controller that requires a software update. For example, suppose a vehicle has an engine controller, a body controller, and a chassis controller. Currently, the engine controller's software needs an update, while the body controller and chassis controller's software do not require an update. In this case, the target controller is the engine controller.
[0116] In some embodiments, the process of the digital signature system obtaining the identifier of the target controller, the identifier of the target digital signature algorithm, and the summary of the software update package of the target software is as follows: displaying a digital signature interface, which is used to obtain the summary of the update package of the software to be signed, the identifier of the controller used to install the software to be signed, and the identifier of the digital signature algorithm used; and obtaining the identifier of the target controller, the identifier of the target digital signature algorithm, and the summary of the software update package of the target software from the digital signature interface.
[0117] For example, the digital signature interface may include a software update package summary input box, a controller identifier input box, a digital signature algorithm identifier input box, and an "OK" option. The software update package summary input box is used to obtain the summary of the update package of the software to be signed; that is, the user can enter or upload the summary of the update package of the software to be signed in this box. The controller identifier input box is used to obtain the identifier of the controller used to install the software to be signed; that is, the user can enter the identifier of the controller used to install the software to be signed in this box. The digital signature algorithm identifier input box is used to obtain the identifier of the digital signature algorithm used; that is, the user can enter the identifier of the digital signature algorithm used in this box. Therefore, after the user enters the summary of the update package of the software to be signed, the identifier of the controller of the software to be signed, and the identifier of the digital signature algorithm used in the corresponding input boxes and clicks the "OK" option, the digital signature system can obtain the identifier of the target controller, the identifier of the target digital signature algorithm, and the summary of the software update package of the target software from the digital signature interface. Of course, the digital signature interface may not include the "OK" option. In this way, after the user enters the digest of the software update package to be signed, the identifier of the controller of the software to be signed, and the identifier of the digital signature algorithm used into the corresponding input boxes in the digital signature interface, the digital signature system can automatically obtain the identifier of the target controller, the identifier of the target digital signature algorithm, and the digest of the software update package of the target software from the digital signature interface within X seconds.
[0118] In some embodiments, if the size of the update package of the software to be signed does not exceed a threshold, it means that the size of the update package of the software to be signed has not exceeded the upper limit requirement of the digital signature system. In this way, the digital signature system can directly obtain the digest of the update package of the software to be signed. Thus, the user does not need to obtain the digest of the update package of the software to be signed in advance. The user only needs to package the update package of the software to be signed, the identifier of the controller of the software to be signed, and the identifier of the digital signature algorithm used into a data analysis package and upload the data analysis package to the digital signature interface, thereby saving the user's time. Moreover, the header of the data analysis package carries the identifier of the controller of the software to be signed and the identifier of the digital signature algorithm used, which enables the digital signature system to obtain the identifier of the target controller, the identifier of the target digital signature algorithm, and the software update package of the target software based on the data analysis package. Then, the system can obtain the digest of the software update package of the target software based on the software update package of the target software.
[0119] For example, a digital signature system can obtain a digest of the software update package of the target software using a hash algorithm based on the update package of the software to be signed. In other words, a hash operation can be performed on the software update package to obtain its digest. Since hash functions are collision-resistant, the digest of the software update package obtained through the hash algorithm can detect whether the software update package has been tampered with. Of course, in practical applications, other methods can also be used to obtain the digest of the target software update package, and this application embodiment does not limit this method.
[0120] In some embodiments, if the size of the software update package to be signed exceeds a threshold, directly uploading the data analysis package to the digital signature system may cause malfunctions in the digital signature interface or the digital signature system itself because the size of the software update package exceeds the system's upper limit. Therefore, when the size of the software update package to be signed exceeds the threshold, the method of directly inputting the summary of the target software's software update package in the digital signature interface can be used. Alternatively, when the size of the software update package to be signed exceeds the threshold, the method of directly inputting the summary of the target software's software update package in the digital signature interface can also be used.
[0121] It should be noted that the above description assumes that the user inputs the digest of the software update package to be signed, the identifier of the controller used to install the software, and the identifier of the digital signature algorithm used in the digital signature interface, thereby enabling the digital signature system to obtain the identifier of the target controller, the identifier of the target digital signature algorithm, and the digest of the software update package. In other words, the above describes how the digital signature system provides a web interface to obtain the identifier of the target controller, the identifier of the target digital signature algorithm, and the digest of the software update package. Of course, the digital signature system can also obtain the identifier of the target controller, the identifier of the target digital signature algorithm, and the digest of the software update package through other methods. For example, the vehicle may also include a business system, which can directly send the identifier of the target controller, the identifier of the target digital signature algorithm, and the digest of the software update package to the digital signature system. This embodiment does not limit this approach.
[0122] Step 502: The digital signature system searches for the private key in the first key pair from the first database based on the identifier of the target controller and the identifier of the target digital signature algorithm. The first database is used to store the private keys in the key pairs applied for for different controllers and different digital signature algorithms. The first key pair is the key pair applied for for the target controller and the target digital signature algorithm.
[0123] Since the first database stores the private keys of key pairs applied for for different controllers and different digital signature algorithms, the private key of the first key pair can be found in the first database based on the identifier of the target controller and the identifier of the target digital signature algorithm.
[0124] In some embodiments, before obtaining the identifier of the target controller, the identifier of the target digital signature algorithm, and the digest of the software update package of the target software, the digital signature system may also obtain a key request request, which carries the identifier of the target controller and the identifier of the target digital signature algorithm; based on the identifier of the target controller and the identifier of the target digital signature algorithm, the system checks whether the private key of the first key pair is stored in the first database; if the private key of the first key pair is not stored in the first database, the system generates the first key pair by calling a hardware encryption machine, and stores the private key of the first key pair in the first database according to the identifier of the target controller and the identifier of the target digital signature algorithm.
[0125] Since the key request carries the identifier of the target controller and the identifier of the target digital signature algorithm, and the first database stores the private keys of key pairs requested for different controllers and different digital signature algorithms, after the digital signature system obtains the key request, it can first search the first database based on the key request to see if there is a private key corresponding to the identifier of the target controller and the identifier of the target digital signature algorithm carried in the key request.
[0126] If the corresponding private key is found in the first database based on the identifier of the target controller and the identifier of the target digital signature algorithm carried in the key application request, it means that the key pair corresponding to the target controller and the target digital signature algorithm has been applied for before, and there is no need to apply again. It can be seen that as long as the controller and the digital signature algorithm are the same, the key pair used will be the same when digitally signing the digest of the software update package of different software of the controller in the subsequent process.
[0127] If the target controller identifier and target digital signature algorithm identifier carried in the key application request are not found in the first database, it means that the key pair corresponding to the target controller and target digital signature algorithm has not yet been applied for. At this time, the digital signature system can call the hardware encryption machine to generate the first key pair corresponding to the target controller and target digital signature algorithm, and store the private key in the first key pair in the first database according to the identifier of the target controller and the identifier of the target digital signature algorithm. In this way, in subsequent processes, the private key in the first key pair can be found in the first database according to the identifier of the target controller and the identifier of the target digital signature algorithm.
[0128] In some embodiments, the first database may also store the public key of the first key pair, and any person or device may directly obtain the public key of the first key pair from the first database based on the identifier of the target controller and the identifier of the target signature algorithm. That is, the public key of the first key pair is public.
[0129] In addition, in some embodiments, since the hardware encryption machine implements the encryption algorithm in hardware, and the hardware-level algorithm is not easily affected by software attacks, generating key pairs through the hardware encryption machine can generate high-quality random key pairs in a secure environment, thereby ensuring the strength of the key pairs.
[0130] In some embodiments, after the digital signature system generates a first key pair by calling a hardware encryption machine, it can also encrypt the private key in the first key pair by calling the hardware encryption machine and obtain the encryption algorithm of the private key in the first key pair; then, according to the identifier of the target controller and the identifier of the target digital signature algorithm, the encrypted private key in the first key pair is stored in the first database.
[0131] In other words, in order to improve the security of the stored private key, after the digital signature system calls the hardware encryption machine to generate the first key pair, it can call the hardware encryption machine again to encrypt the private key in the first key pair, and store the encrypted private key in the first database according to the identifier of the target controller and the identifier of the target digital signature algorithm.
[0132] Furthermore, in order for the digital signature system to decrypt the encrypted private key after obtaining it from the first key pair based on the identifier of the target controller and the identifier of the target digital signature algorithm in the subsequent process, the hardware encryption machine can also send the encryption algorithm of the private key to the digital signature system after encrypting the private key in the first key pair, so that the digital signature system can know the encryption algorithm.
[0133] It should be noted that the algorithm used by the hardware encryption machine to encrypt the private key in the first key pair can be DES (Data Encryption Standard), MD5 (Message-Digest Algorithm 5), or other encryption algorithms. This application embodiment does not limit this.
[0134] The above description illustrates how a digital signature system generates key pairs and encrypts the private key in a key pair by calling a hardware encryption machine. Of course, in practical applications, a digital signature system can also generate key pairs or encrypt the private key in a key pair in other ways, and this application does not limit this.
[0135] In some embodiments, the digital signature system may display a key request interface, through which users can trigger a key request.
[0136] For example, the key request interface may include an input field for the controller's identifier and an input field for the digital signature algorithm's identifier, as well as a confirmation option for submitting the key request. The user can enter the identifier of the target controller in the controller's identifier input field, such as the name of the target controller; the user can enter the identifier of the digital signature algorithm in the digital signature algorithm's identifier input field, such as the name of the target digital signature algorithm. After completing the input, the user can click the "Confirm Key Request" option, in which case the digital signature system can obtain a key request carrying the identifiers of the target controller and the target signature algorithm.
[0137] It should be noted that the above explanation uses the key application request carrying the identifier of the target controller and the identifier of the target digital signature algorithm. Of course, in practical applications, in order for the digital signature system to record more detailed information about the key application request, the key application request can also carry the identifier of the target controller supplier, the vehicle model with the target controller installed, the applicant, the flashing process, the application time, and remarks, etc., and store these features together with the private key in the first key pair in the first database. In this way, after the user submits the key application request, if it is determined through the key application request that the private key of the first key pair has been stored in the first database, then the key application interface can display the identifier of the target controller supplier, the vehicle model with the target controller installed, the applicant, the flashing process, the application time, and remarks, etc., corresponding to the private key in the first key pair, so that the user can understand the application information of the first key pair in more detail.
[0138] Step 503: The digital signature system generates a first signature file based on the digest of the software update package of the target software and the private key in the first key pair. The first signature file is used to verify the authenticity and integrity of the software update package before the target controller updates the target software.
[0139] In some embodiments, the digital signature system may use the private key in the first key pair to encrypt the digest of the target software update package to obtain a first signature file.
[0140] As described above, the digital signature system can also call a hardware encryption machine to encrypt the private key in the first key pair and store the encrypted private key in the first database. The digital signature system can also know the encryption algorithm used by the hardware encryption machine to encrypt the private key. Thus, the process of generating the first signature file based on the digest of the software update package of the target software and the private key in the first key pair includes: decrypting the encrypted private key based on the encryption algorithm of the private key in the first key pair; and generating the first signature file based on the digest of the software update package of the target software and the decrypted private key.
[0141] In other words, since the first database stores the encrypted private key of the first key pair, the digital signature system needs to first decrypt the private key in the first key pair according to the known encryption algorithm, and then use the decrypted private key to encrypt the digest of the software update package of the target software to generate the first signature file.
[0142] In some embodiments, after the digital signature system generates a first signature file, a technician can download the first signature file and store the first signature file and the software update package in a second database according to the identifier of the target controller and the software update package version of the target software. Alternatively, when the digital signature system and the second database are connected, after the digital signature system generates the first signature file, the first signature file can also be sent to the second database so that the second database stores the first signature file according to the identifier of the target controller and the software update package version of the target software.
[0143] Step 504: The after-sales upgrade system obtains the software update task, which carries the identifier of the target controller and the updated version of the target software.
[0144] In some embodiments, when an update to the target software version in the target controller is required, after-sales personnel can configure a software update task based on the required update version of the target software and send the configured software update task to the after-sales upgrade system, thereby enabling the after-sales upgrade system to obtain the software update task. To identify the target controller from multiple controllers, the software update task may carry the identifier of the target controller; and since the target software may include multiple update versions, the software update task may also carry the update version of the target software, thereby determining the version of the target software that the target controller needs to update, and thus obtaining the corresponding software update package in subsequent processes.
[0145] Step 505: The after-sales upgrade system obtains the software update package and the first signature file of the target software based on the identifier of the target controller and the updated version of the target software.
[0146] As described above, the software update package and the first signature file of the target software are stored in the second database according to the identifier of the target controller and the version of the software update package of the target software. Therefore, after the after-sales upgrade system obtains the software update task, it can obtain the first signature file and the software update package of the target software from the second database based on the identifier of the target controller and the update version of the target software.
[0147] Step 506: The after-sales upgrade system sends the software update package and the first signature file of the target software to the target controller through the diagnostic device, so that the target controller can verify the software update package of the target software based on the first signature file and update the target software according to the software update package.
[0148] In some embodiments, the diagnostic device can be externally connected to the vehicle. This allows the aftermarket upgrade system to send the target software update package and first signature file to the target controller via the diagnostic device. Furthermore, since the diagnostic device is externally connected to the vehicle, technicians can monitor the software update progress of the target controller in real time through the diagnostic device's display interface during the update process, and can also determine whether the target controller will malfunction during the software update. In addition, if the target controller malfunctions, technicians can promptly determine the cause of the malfunction through the diagnostic device.
[0149] As described above, the public key in the first key pair is public. Therefore, after the target controller receives the first signature file, the user can directly obtain the public key in the first key pair through the query module in the digital signature interface, based on the identifier of the target controller and the identifier of the target digital signature algorithm. This allows the target controller to use the public key in the first key pair to decrypt the software update package of the target software and verify the authenticity and integrity of the software update package.
[0150] In some embodiments, in order to further ensure the security of the target controller during the process of updating the target software, the method may further include the following steps (1)-(7);
[0151] (1) The after-sales upgrade system compresses the software update package and the first signature file to obtain a data compressed package.
[0152] In some embodiments, after obtaining the update package and the first signature file of the target software, the after-sales upgrade system compresses the update package and the first signature file of the target software to obtain a data compressed package, and sends the data compressed package to the digital signature system so that the digital signature system can receive the data compressed package.
[0153] (2) The after-sales upgrade system sends the data compressed package to the digital signature system.
[0154] (3) The digital signature system receives a data compressed package sent by the after-sales upgrade system. The data compressed package carries the software update package of the target software and the first signature file.
[0155] Since the data package is obtained by compressing the target software's update package and first signature file by the after-sales upgrade system, the data package contains the target software's software update package and first signature file.
[0156] (4) The digital signature system generates a second key pair corresponding to the data compressed package, and generates a second signature file based on the private key in the data compressed package and the second key pair. The second signature file is used to verify the authenticity and integrity of the data compressed package.
[0157] After receiving the data compressed package, the digital signature system can directly generate the corresponding second key pair based on the data compressed package, or the digital signature system can call a hardware cryptographic machine to generate the second key pair.
[0158] In some embodiments, the digital signature system may also obtain a digest of the data compressed package based on the data compressed package, and encrypt the digest of the data compressed package using the private key in the second key pair to generate a second signature file.
[0159] In addition, in some embodiments, since the second key pair is generated in real time based on different data compression packages, and the digital signature system will send the public key in the second key pair to the after-sales upgrade system in the subsequent process, the digital signature system does not need to store the second key pair.
[0160] (5) The digital signature system sends the second signature file and the public key in the second key pair to the after-sales upgrade system.
[0161] (6) The after-sales upgrade system receives the public key from the second signature file and the second key pair sent by the digital signature system.
[0162] (7) The after-sales upgrade system sends the data compressed package, the second signature file, and the public key in the second key pair to the diagnostic device, so that the diagnostic device can verify the data compressed package through the public key in the second key pair and the second signature file, and then send the software update package of the target software and the first signature file to the target controller.
[0163] As described above, after generating the second signature file, the digital signature system can send the second signature file and the public key from the second key pair to the after-sales upgrade system. Thus, when the target controller needs to update the target software using a diagnostic device, the after-sales upgrade system can send the public key from the second key pair, the second signature file, and the data compressed package to the diagnostic device. The diagnostic device can then use the public key from the second key pair to decrypt the second signature file, obtaining a first digest of the data compressed package. This first digest is the digest of the data compressed package carried in the second signature file. Then, the diagnostic device can generate a second digest of the received data compressed package based on the received data compressed package and compare the first and second digests to verify the received data compressed package.
[0164] In other words, if the first digest of the data package matches the second digest, the data package has passed verification; if the first digest and the second digest do not match, the data package has failed verification.
[0165] After the data compressed package is verified, the diagnostic device can decompress it to obtain the target software update package and the first signature file, and then send them to the target controller. The target controller can then use the public key from the first key pair to decrypt the first signature file, obtaining a digest of the target software update package. Furthermore, the target controller can obtain a digest of the target software update package based on the update package, and compare the decrypted digest with its own obtained digest to verify the authenticity and integrity of the received target software update package.
[0166] In other words, if the digest of the software update package of the target software obtained by the target controller after decryption matches the digest of the software update package of the target software it obtained, it means that the authenticity and integrity of the received software update package of the target software has been verified. In this case, the target controller can update the target software based on the received software update package of the target software. If the digest of the software update package of the target software obtained by the target controller after decryption does not match the digest of the software update package of the target software it obtained, it means that the software update package of the target software received by the target controller may have been illegally tampered with. In this case, the target controller will not upgrade the target software based on the received software update package of the target software.
[0167] As described above, the second signature file can be generated by directly interfacing the digital signature system with the after-sales upgrade system. Therefore, after successful two-way authentication between the digital signature system and the after-sales upgrade system, the first signature file can also be obtained directly through this interfacing. In other words, the identifier of the target controller, the identifier of the target digital signature algorithm, and the digest of the target software update package obtained by the digital signature system are derived from parsing the data packets sent by the after-sales upgrade system. Thus, the digital signature system can use the private key from the first key pair to encrypt the digest of the target software update package sent by the after-sales upgrade system, thereby generating the first signature file.
[0168] The software update method for the vehicle controller provided in the embodiments of this application will be described in general below.
[0169] Please refer to Figure 6 , Figure 6This is a flowchart illustrating a software update method for a vehicle controller provided in this application embodiment. As shown in the diagram, after-sales personnel can first send the configured software update task to the after-sales upgrade system. The after-sales upgrade system will send a data acquisition request to a second database based on the identifier of the target controller and the update version of the target software carried in the software update task, in order to obtain a first signature file and the software update package of the target software. After the after-sales upgrade system obtains the first signature file and the software update package of the target software, it will compress the software update package and the first signature file to obtain a data compressed package, and send the data compressed package to a digital signature system. The digital signature system will generate a second key pair corresponding to the data compressed package, and based on this... The private key in the data compressed package and the second key pair generates a second signature file, which is then sent to the after-sales upgrade system along with the public key from the second key pair. The after-sales upgrade system then sends the data compressed package, the second signature file, and the public key from the second key pair to the diagnostic device. The diagnostic device verifies the data compressed package; if successful, it decompresses the package to obtain the target software's software update package and the first signature file, and sends these to the target controller. The target controller then verifies the target software's software update package; if successful, it updates the target software according to the updated package.
[0170] In this embodiment, the first database stores private keys from key pairs applied for for different controllers and different digital signature algorithms. Thus, when the digital signature system needs to generate a signature file for a software update package of the target software, it can retrieve the private key from the first key pair in the first database based on the identifier of the target controller and the identifier of the target digital signature algorithm. Then, it generates a first signature file using the digest of the software update package of the target software and the private key in the first key pair. In other words, the method provided in this embodiment improves the efficiency of key pair retrieval by uniformly managing key pairs online, enabling online querying of private keys when generating signature files. Compared to offline management and querying, this improves the efficiency of key pair retrieval, thereby improving the efficiency of signature file generation. Even with frequent software upgrades, the efficiency of digital signatures remains high, without affecting the vehicle's development progress. Furthermore, the digital signature system can encrypt the private key in the first key pair, further ensuring the security of digital signatures. In addition, the after-sales upgrade system can compress the software update and the first signature file to obtain a data compressed package, and send the data compressed package to the digital signature system so that the digital signature system can generate a second signature file based on the private key in the second key pair. This can further ensure the security of the target controller during the process of updating the target software and avoid security risks to the target controller due to illegal tampering of the target software update package.
[0171] Figure 7 This is a schematic diagram of the structure of a software update device for a vehicle controller provided in an embodiment of this application. The software update device for the vehicle controller can be implemented as part or all of a digital signature system, which can be software, hardware, or a combination of both. Figure 9 The server shown is shown. Please refer to it. Figure 7 The device includes: a first acquisition module 701, a first search module 702, and a first generation module 703.
[0172] The first acquisition module 701 is used to acquire the identifier of the target controller, the identifier of the target digital signature algorithm, and the digest of the software update package of the target software. The target controller refers to the controller used to install the target software.
[0173] The first lookup module 702 is used to look up the private key in the first key pair from the first database based on the identifier of the target controller and the identifier of the target digital signature algorithm. The first database is used to store the private keys in the key pairs applied for for different controllers and different digital signature algorithms. The first key pair is the key pair applied for for the target controller and the target digital signature algorithm.
[0174] The first generation module 703 is used to generate a first signature file based on the digest of the software update package of the target software and the private key in the first key pair. The first signature file is used to verify the authenticity and integrity of the software update package before the target controller updates the target software.
[0175] Optionally, the first acquisition module 701 includes:
[0176] The display submodule is used to display the digital signature interface, which is used to obtain the digest of the update package of the software to be signed, the identifier of the controller used to install the software to be signed, and the identifier of the digital signature algorithm used.
[0177] The acquisition submodule is used to obtain the identifier of the target controller, the identifier of the target digital signature algorithm, and the summary of the software update package of the target software from the digital signature interface.
[0178] Optionally, the device further includes:
[0179] The second acquisition module is used to acquire a key request request, which carries the identifier of the target controller and the identifier of the target digital signature algorithm;
[0180] The second search module is used to search whether the private key of the first key pair is stored in the first database based on the identifier of the target controller and the identifier of the target digital signature algorithm.
[0181] The second generation module is used to generate the first key pair by calling a hardware encryption machine if the private key of the first key pair is not stored in the first database, and to store the private key of the first key pair in the first database according to the identifier of the target controller and the identifier of the target digital signature algorithm.
[0182] Optionally, the device may also include:
[0183] The encryption module is used to encrypt the private key in the first key pair by calling the hardware encryption machine, and to obtain the encryption algorithm of the private key in the first key pair.
[0184] The second generation module includes:
[0185] The storage submodule is used to store the encrypted private key from the first key pair into the first database according to the identifier of the target controller and the identifier of the target digital signature algorithm;
[0186] The first generation module includes:
[0187] The decryption submodule is used to decrypt the encrypted private key based on the encryption algorithm of the private key in the first key pair; and to generate a first signature file based on the digest of the software update package of the target software and the decrypted private key.
[0188] Optionally, the device further includes:
[0189] The receiving module is used to receive the data compressed package sent by the after-sales upgrade system. The data compressed package carries the software update package of the target software and the first signature file.
[0190] The third generation module is used to generate a second key pair corresponding to the data compressed package, and to generate a second signature file based on the private key in the data compressed package and the second key pair. The second signature file is used to verify the authenticity and integrity of the data compressed package.
[0191] The sending module is used to send the second signature file and the public key in the second key pair to the after-sales upgrade system, so that the after-sales upgrade system sends the public key in the second key pair, the second signature file and the data compressed package to the diagnostic device, so that after the diagnostic device verifies the data compressed package, it instructs the target controller to update the target software.
[0192] In this embodiment, the first database stores private keys from key pairs applied for for different controllers and different digital signature algorithms. Thus, when the digital signature system needs to generate a signature file for a software update package of the target software, it can retrieve the private key from the first key pair in the first database based on the identifier of the target controller and the identifier of the target digital signature algorithm. Then, it generates the first signature file using the digest of the software update package of the target software and the private key from the first key pair. In other words, by uniformly managing the key pairs online, the private key in the key pair can be queried online when generating the signature file. Compared to offline management and querying of private keys, this improves the efficiency of key pair retrieval, thereby improving the efficiency of signature file generation. Even with frequent software upgrades, the efficiency of digital signatures remains high, without affecting the vehicle's development progress.
[0193] It should be noted that the software update device for the vehicle controller provided in the above embodiments is only illustrated by the division of the above functional modules when updating the controller's software. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the software update device for the vehicle controller provided in the above embodiments and the software update method embodiments for the vehicle controller belong to the same concept, and the specific implementation process is detailed in the method embodiments, which will not be repeated here.
[0194] Figure 8 This is a schematic diagram of the structure of a software update device for a vehicle controller provided in an embodiment of this application. The software update device for the vehicle controller can be implemented by software, hardware, or a combination of both, forming part or all of an after-sales upgrade system. The after-sales upgrade system can be... Figure 9 The server shown is shown. Please refer to it. Figure 8 The device includes: a first acquisition module 801, a second acquisition module 802, and a first transmission module 803.
[0195] The first acquisition module 801 is used to acquire a software update task, which carries the identifier of the target controller and the updated version of the target software. The target controller refers to the controller used to install the target software.
[0196] The second acquisition module 802 is used to acquire the software update package of the target software and the first signature file based on the identifier of the target controller and the updated version of the target software. The first signature file is used to verify the authenticity and integrity of the software update package of the target software before the target controller updates the target software.
[0197] The first sending module 803 is used to send a software update package and a first signature file of the target software to the target controller through a diagnostic device, so that the target controller can update the target software according to the software update package after verifying the software update package based on the first signature file.
[0198] Optionally, the device further includes:
[0199] The compression module is used to compress the software update package and the first signature file to obtain a compressed data package;
[0200] The second sending module is used to send the data compressed package to the digital signature system so that the data signature system generates a second key pair corresponding to the data compressed package and generates a second signature file based on the private key in the data compressed package and the second key pair. The second signature file is used to verify the authenticity and integrity of the data compressed package.
[0201] The receiving module is used to receive the public key from the second signature file and the second key pair sent by the digital signature system.
[0202] The first transmitting module 803 includes:
[0203] The sending submodule is used to send the data compressed package, the second signature file, and the public key in the second key pair to the diagnostic device, so that the diagnostic device can verify the data compressed package through the public key in the second key pair and the second signature file, and then send the software update package of the target software and the first signature file to the target controller.
[0204] In this embodiment, the after-sales upgrade system sends a software update package and a first signature file of the target software to the target controller via a diagnostic device. The target controller then verifies the software update package using the first signature file and updates the software accordingly. Since the first signature file is generated by querying the private key in a key pair online, compared to offline management and querying of the private key, the efficiency of finding the key pair is improved, thereby improving the efficiency of generating the signature file. Even with frequent software upgrades, the efficiency of digital signatures remains high, without affecting the vehicle's development progress. Furthermore, verifying the software update package using the first signature file avoids security risks during software upgrades due to unauthorized tampering of the software update package.
[0205] It should be noted that the software update device for the vehicle controller provided in the above embodiments is only illustrated by the division of the above functional modules when updating the controller's software. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the software update device for the vehicle controller provided in the above embodiments and the software update method embodiments for the vehicle controller belong to the same concept, and the specific implementation process is detailed in the method embodiments, which will not be repeated here.
[0206] Figure 9 This is a schematic diagram of a server structure provided in an embodiment of this application. The server 900 includes a central processing unit (CPU) 901, a system memory 904 including random access memory (RAM) 902 and read-only memory (ROM) 903, and a system bus 905 connecting the system memory 904 and the CPU 901. The server 900 also includes a basic input / output system (I / O system) 906 that facilitates information transfer between various devices within the computer, and a mass storage device 907 for storing the operating system 913, application programs 914, and other program modules 915.
[0207] The basic input / output system 906 includes a display 908 for displaying information and an input device 909 for user input, such as a mouse or keyboard. Both the display 908 and the input device 909 are connected to the central processing unit 901 via an input / output controller 910 connected to the system bus 905. The basic input / output system 906 may also include the input / output controller 910 for receiving and processing input from multiple other devices such as a keyboard, mouse, or electronic stylus. Similarly, the input / output controller 910 also provides output to a display screen, printer, or other types of output devices.
[0208] Mass storage device 907 is connected to central processing unit 901 via a mass storage controller (not shown) connected to system bus 905. Mass storage device 907 and its associated computer-readable media provide non-volatile storage for server 900. That is, mass storage device 907 may include computer-readable media (not shown) such as hard disk or CD-ROM drive.
[0209] Without loss of generality, computer-readable media can include computer storage media and communication media. Computer storage media include volatile and non-volatile, removable and non-removable media implemented using any method or technology for storing information such as computer-readable instructions, data structures, program modules, or other data. Computer storage media include RAM, ROM, EPROM, EEPROM, flash memory or other solid-state storage technologies, CD-ROM, DVD or other optical storage, magnetic tape cassettes, magnetic tape, disk storage, or other magnetic storage devices. Of course, those skilled in the art will recognize that computer storage media are not limited to the above-mentioned types. The system memory 904 and mass storage device 907 described above can be collectively referred to as memory.
[0210] According to various embodiments of this application, server 900 can also be connected to a remote computer on a network, such as the Internet. That is, server 900 can be connected to network 912 via network interface unit 911 connected to system bus 905, or it can also use network interface unit 911 to connect to other types of networks or remote computer systems (not shown).
[0211] The aforementioned memory also includes one or more programs, which are stored in the memory and configured to be executed by the CPU.
[0212] In some embodiments, a computer-readable storage medium is also provided, which stores a computer program that, when executed by a processor, implements the steps of the software update method for the vehicle controller in the above embodiments. For example, the computer-readable storage medium may be a ROM, RAM, CD-ROM, magnetic tape, floppy disk, or optical data storage device.
[0213] It is worth noting that the computer-readable storage medium mentioned in the embodiments of this application can be a non-volatile storage medium, in other words, it can be a non-transient storage medium.
[0214] It should be understood that all or part of the steps of the above embodiments can be implemented by software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented wholly or partially in the form of a computer program product. The computer program product includes one or more computer instructions. The computer instructions can be stored in the above-described computer-readable storage medium.
[0215] That is, in some embodiments, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to perform the steps of the software update method for the vehicle controller described above.
[0216] It should be understood that "at least one" as mentioned herein refers to one or more, and "multiple" refers to two or more. In the description of the embodiments of this application, unless otherwise stated, " / " means "or," for example, A / B can mean A or B; "and / or" in this document is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. In addition, in order to clearly describe the technical solutions of the embodiments of this application, the terms "first," "second," etc., are used in the embodiments of this application to distinguish identical or similar items with substantially the same function and effect. Those skilled in the art will understand that the terms "first," "second," etc., do not limit the quantity or execution order, and the terms "first," "second," etc., are not necessarily different.
[0217] It should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, data stored, data displayed, etc.) and signals involved in the embodiments of this application are all authorized by the user or fully authorized by all parties, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0218] The above descriptions are embodiments provided in this application and are not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A software update method for a vehicle controller, characterized in that, Applied to a digital signature system, the method includes: Obtain the identifier of the target controller, the identifier of the target digital signature algorithm, and the digest of the software update package of the target software, wherein the target controller refers to the controller used to install the target software; Based on the identifier of the target controller and the identifier of the target digital signature algorithm, the private key in the first key pair is retrieved from the first database. The first database is used to store the private keys in the key pairs applied for for different controllers and different digital signature algorithms. The first key pair is the key pair applied for for the target controller and the target digital signature algorithm. A first signature file is generated based on the digest of the software update package of the target software and the private key in the first key pair. The first signature file is used to verify the authenticity and integrity of the software update package before the target controller updates the target software. Receive a data compressed package sent by the after-sales upgrade system, the data compressed package carrying the software update package of the target software and the first signature file; A second key pair corresponding to the data compressed package is generated, and a second signature file is generated based on the data compressed package and the private key in the second key pair. The second signature file is used to verify the authenticity and integrity of the data compressed package. The system sends the second signature file and the public key from the second key pair to the after-sales upgrade system, so that the after-sales upgrade system sends the public key from the second key pair, the second signature file, and the data compressed package to the diagnostic device. After the diagnostic device verifies the data compressed package, it instructs the target controller to update the target software.
2. The method as described in claim 1, characterized in that, The acquisition of the target controller's identifier, the target digital signature algorithm's identifier, and the digest of the target software's software update package includes: The digital signature interface is used to obtain the digest of the update package of the software to be signed, the identifier of the controller used to install the software to be signed, and the identifier of the digital signature algorithm used. Obtain the identifier of the target controller, the identifier of the target digital signature algorithm, and the summary of the software update package of the target software from the digital signature interface.
3. The method as described in claim 1, characterized in that, Before obtaining the identifier of the target controller, the identifier of the target digital signature algorithm, and the digest of the software update package of the target software, the method further includes: Obtain a key request request, the key request request carrying the identifier of the target controller and the identifier of the target digital signature algorithm; Based on the identifier of the target controller and the identifier of the target digital signature algorithm, check whether the private key of the first key pair is stored in the first database; If the private key of the first key pair is not stored in the first database, the first key pair is generated by calling a hardware encryption machine, and the private key of the first key pair is stored in the first database according to the identifier of the target controller and the identifier of the target digital signature algorithm.
4. The method as described in claim 3, characterized in that, After generating the first key pair by calling the hardware encryption machine, the method further includes: encrypting the private key in the first key pair by calling the hardware encryption machine, and obtaining the encryption algorithm of the private key in the first key pair. The step of storing the private key in the first key pair into the first database according to the identifier of the target controller and the identifier of the target digital signature algorithm includes: storing the encrypted private key in the first key pair into the first database according to the identifier of the target controller and the identifier of the target digital signature algorithm; The step of generating a first signature file based on the digest of the software update package of the target software and the private key in the first key pair includes: decrypting the encrypted private key based on the encryption algorithm of the private key in the first key pair; and generating the first signature file based on the digest of the software update package of the target software and the decrypted private key.
5. A software update method for a vehicle controller, characterized in that, The method, applied to an after-sales upgrade system, includes: Obtain a software update task, wherein the software update task carries the identifier of the target controller and the updated version of the target software, wherein the target controller refers to the controller used to install the target software; Based on the identifier of the target controller and the updated version of the target software, the software update package and the first signature file of the target software are obtained. The first signature file is used to verify the authenticity and integrity of the software update package of the target software before the target controller updates the target software. The software update package and the first signature file are compressed to obtain a data compressed package; the data compressed package is sent to a digital signature system so that the digital signature system generates a second key pair corresponding to the data compressed package, and generates a second signature file based on the private key in the data compressed package and the second key pair, the second signature file being used to verify the authenticity and integrity of the data compressed package; the second signature file and the public key in the second key pair sent by the digital signature system are received. The data compressed package, the second signature file, and the public key from the second key pair are sent to the diagnostic device. After the diagnostic device verifies the data compressed package using the public key from the second key pair and the second signature file, it sends the software update package of the target software and the first signature file to the target controller. After the target controller verifies the software update package based on the first signature file, it updates the target software according to the software update package.
6. A software update device for a vehicle controller, characterized in that, The device includes: The first acquisition module is used to acquire the identifier of the target controller, the identifier of the target digital signature algorithm, and the digest of the software update package of the target software, wherein the target controller refers to the controller used to install the target software; The first lookup module is used to look up the private key in the first key pair from the first database based on the identifier of the target controller and the identifier of the target digital signature algorithm. The first database is used to store the private keys in the key pairs applied for for different controllers and different digital signature algorithms. The first key pair is the key pair applied for for the target controller and the target digital signature algorithm. The first generation module is used to generate a first signature file based on the digest of the software update package of the target software and the private key in the first key pair. The first signature file is used to verify the authenticity and integrity of the software update package before the target controller updates the target software. The device further includes: The receiving module is used to receive a data compressed package sent by the after-sales upgrade system. The data compressed package carries the software update package of the target software and the first signature file. The third generation module is used to generate a second key pair corresponding to the data compressed package, and generate a second signature file based on the data compressed package and the private key in the second key pair. The second signature file is used to verify the authenticity and integrity of the data compressed package. The sending module is used to send the second signature file and the public key in the second key pair to the after-sales upgrade system, so that the after-sales upgrade system sends the public key in the second key pair, the second signature file and the data compressed package to the diagnostic device, so that after the diagnostic device verifies the data compressed package, it instructs the target controller to update the target software.
7. A software update device for a vehicle controller, characterized in that, The device includes: The first acquisition module is used to acquire a software update task, wherein the software update task carries the identifier of the target controller and the updated version of the target software, and the target controller refers to the controller used to install the target software; The second acquisition module is used to acquire the software update package and the first signature file of the target software based on the identifier of the target controller and the updated version of the target software. The first signature file is used to verify the authenticity and integrity of the software update package of the target software before the target controller updates the target software. A compression module is used to compress the software update package and the first signature file to obtain a compressed data package; The second sending module is used to send the data compressed package to the digital signature system so that the digital signature system generates a second key pair corresponding to the data compressed package and generates a second signature file based on the private key in the data compressed package and the second key pair. The second signature file is used to verify the authenticity and integrity of the data compressed package. The receiving module is used to receive the second signature file and the public key in the second key pair sent by the digital signature system; The first sending submodule is used to send the data compressed package, the second signature file, and the public key in the second key pair to the diagnostic device, so that the diagnostic device can verify the data compressed package using the public key in the second key pair and the second signature file, and then send the software update package of the target software and the first signature file to the target controller, so that the target controller can verify the software update package based on the first signature file and then update the target software according to the software update package.
8. A digital signature system, characterized in that, The digital signature system includes a memory and a processor. The memory is used to store computer programs, and the processor is used to execute the computer programs stored in the memory to implement the steps of the method according to any one of claims 1-4.
Citation Information
Patent Citations
OTA upgrade security verification method for vehicle EUC and readable storage medium
CN115242397A
Digital signature function extension method, device and equipment
CN116132179A