Component safety upgrade method, device and automobile
By encrypting key parameters and sensitive data before component upgrades, forming a reorganized upgrade file and flashing it, the problem of upgrade files being attacked by malicious attacks is solved, and the security and stability of component upgrades are improved.
Patent Information
- Application Number
- CN202411167007.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-23
- Publication Date
- 2025-09-05
- Estimated Expiration
- 2044-08-23
AI Technical Summary
During the component upgrade process, the upgrade files are easily attacked or tampered with by malicious attackers, leading to problems such as user privacy data leakage, identity theft, enterprise business interruption and national security threats.
Before upgrading, the security of the upgrade file is determined. Key parameters and sensitive data are extracted and encrypted, and then written into the encrypted protection zone. Non-essential information is removed, and the reorganized upgrade file is flashed to the component.
It improves the security of component upgrades, prevents the leakage or tampering of key parameters and sensitive data, increases the difficulty of malicious attacks, and ensures the security of the upgrade process.
Smart Images

Figure CN119227028B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computers, and in particular to a component security upgrade method, device, and automobile. Background Art
[0002] During the process of upgrading and flashing components (for example, ECU components of smart cars, enterprise business software components, software components related to government and critical infrastructure, etc.), if the upgrade files are attacked or tampered with by malicious attackers (such as hackers, etc.), it may cause the user's private data to be leaked or identity to be stolen, resulting in business interruption, economic loss, reputation damage, and even threats to national security or social stability. It may also cause the component upgrade to fail or even become completely unusable.
[0003] Therefore, it is urgent to solve the security problem of upgrade files during component upgrade to prevent the upgrade files from being attacked or tampered with by malicious attackers. Summary of the Invention
[0004] In view of this, embodiments of the present application provide a component security upgrade method, device, and automobile to solve the problem of upgrade file security during component upgrade in the prior art.
[0005] A first aspect of an embodiment of the present application provides a component security upgrade method, comprising:
[0006] Upgrade the master control terminal:
[0007] Obtaining a first upgrade file corresponding to the component to be upgraded;
[0008] If it is determined that the first upgrade file is a safe file, extracting a first key parameter related to the application function of the component to be upgraded and first sensitive data related to the application permission of the component to be upgraded from the first upgrade file;
[0009] Encrypting the first key parameter and the first sensitive data using an encryption tool to obtain a first encrypted key parameter and first encrypted sensitive data;
[0010] Eliminating the first key parameter, the first sensitive data, and the first boot program from the first upgrade file to obtain a first desensitized file;
[0011] Writing the first encryption key parameter and the first encryption sensitive data into the encryption protection area, writing the first desensitized file into the application area, and writing the first boot program into the boot program area to obtain a first reassembled upgrade file, the first reassembled upgrade file including at least the encryption protection area, the application area, and the boot program area;
[0012] Flash the first reorganized upgrade file to the component to be upgraded.
[0013] A second aspect of an embodiment of the present application provides a component security upgrade device, including:
[0014] An acquisition module is configured to acquire a first upgrade file corresponding to the component to be upgraded;
[0015] an extraction module configured to extract, if it is determined that the first upgrade file is a safe file, a first key parameter related to an application function of the component to be upgraded and first sensitive data related to an application permission of the component to be upgraded from the first upgrade file;
[0016] an encryption module configured to encrypt the first key parameter and the first sensitive data using an encryption tool to obtain the first encrypted key parameter and the first encrypted sensitive data;
[0017] A removal module is configured to remove the first key parameter, the first sensitive data, and the first boot program from the first upgrade file to obtain a first desensitized file;
[0018] a reassembly module configured to write the first encryption key parameter and the first encryption sensitive data into the encryption protection area, write the first desensitized file into the application area, and write the first boot program into the boot program area, to obtain a first reassembly upgrade file, the first reassembly upgrade file including at least the encryption protection area, the application area, and the boot program area;
[0019] The flashing module is configured to flash the first reorganized upgrade file to the component to be upgraded.
[0020] According to a third aspect of the embodiments of the present application, a vehicle is provided, comprising:
[0021] Upgrade the master control terminal;
[0022] The component to be upgraded is connected to the upgrade master terminal;
[0023] The upgrade master terminal includes the component security upgrade device of the second aspect.
[0024] According to a fourth aspect of an embodiment of the present application, a readable storage medium is provided, which stores a computer program. When the computer program is executed by a processor, the steps of the above method are implemented.
[0025] Compared with the prior art, the beneficial effects of the embodiment of the present application include at least the following: before upgrading and flashing the component to be upgraded, first, determine that the first upgrade file is a safe file before performing subsequent upgrade operations, which is beneficial to ensuring the upgrade security of the component to be upgraded. Secondly, extract the first key parameter and the first sensitive data from the first upgrade file, and encrypt the first key parameter and the first sensitive data, which can effectively prevent the key parameters and sensitive data of the user's component to be upgraded from being leaked or tampered with due to penetration attacks by malicious programs during the upgrade flashing process, thereby improving the upgrade security of the component. In addition, by writing the first encrypted key parameter, the first encrypted sensitive data, the first desensitized file and the first boot program into the partition, a first reorganized upgrade file is obtained, and then the first reorganized upgrade file is flashed to the component to be upgraded, which can greatly increase the difficulty of malicious attackers attacking the first upgrade file, thereby effectively preventing the first upgrade file from being attacked or tampered with by malicious attackers during the upgrade process, which is beneficial to further improve the upgrade security of the component. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the embodiments or descriptions of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0027] Figure 1 This is a schematic diagram of an application scenario of an embodiment of the present application;
[0028] Figure 2 This is a flowchart of a component security upgrade method provided by an embodiment of the present application;
[0029] Figure 3 This is a schematic diagram of the data structure of a first upgrade file provided in an embodiment of the present application;
[0030] Figure 4 This is a schematic diagram of the data structure of another first upgrade file provided in an embodiment of the present application;
[0031] Figure 5 This is a structural diagram of a component security upgrade system provided by an embodiment of the present application;
[0032] Figure 6 This is a schematic diagram of the data structure of a source code file provided in an embodiment of the present application;
[0033] Figure 7 This is a structural diagram of another component security upgrade system provided by an embodiment of the present application;
[0034] Figure 8Schematic diagram of a component security upgrade device provided by an embodiment of the present application;
[0035] Figure 9 This is a structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0036] In the following description, specific details such as specific system structures and techniques are provided for purposes of illustration rather than limitation to facilitate a thorough understanding of the embodiments of the present application. However, it will be apparent to those skilled in the art that the present application may be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to avoid obscuring the description of the present application with unnecessary detail.
[0037] A component security upgrade method and device according to an embodiment of the present application will be described in detail below with reference to the accompanying drawings.
[0038] Figure 1 : is a scenario diagram of an application scenario of an embodiment of the present application. The application scenario may include a server 100 and a vehicle 200. Among them, the server 100 may be a cloud server or a background server, etc. The server 100 may include an OTA cloud platform 101. The vehicle 200 may be a new energy vehicle. The new energy vehicles of the embodiment of the present application include but are not limited to the following types of vehicles: electric vehicles (EV), pure electric vehicles (BEV), fuel cell electric vehicles (FCEV), plug-in hybrid electric vehicles (PHEV) and hybrid electric vehicles (HEV), etc.
[0039] The vehicle 200 may include a first vehicle gateway 201 (VIU1), a second vehicle gateway 202 (VIU2), a third vehicle gateway 203 (VIU3), a fourth vehicle gateway 204 (VIU4), a vehicle controller 205 (VDC), an upgrade master 206, and an upgrade agent 207. The upgrade master 206 may be the intelligent cockpit (or cockpit domain controller) (CDC) of the vehicle 200, or the vehicle remote communication module (VOX) (VBOX) of the vehicle 200. The upgrade agent 207 may be the intelligent cockpit (or cockpit domain controller) (CDC) of the vehicle 200, or the vehicle remote communication module (VOX) (VBOX) of the vehicle 200. When the upgrade master 206 is a CDC, the upgrade agent 207 is a VBOX. When the upgrade master 206 is a VBOX, the upgrade agent 207 is a CDC. The first vehicle gateway 201, the second vehicle gateway 202, the third vehicle gateway 203, the fourth vehicle gateway 204, the vehicle controller 205, the upgrade master 206, and the upgrade agent 207 can each be connected to at least one electronic control unit (ECU).
[0040] Both the upgrade master 206 and the upgrade agent 207 can be connected to the server 100 via a 4G / 5G network or WiFi. The upgrade master 206 and the upgrade agent 207 can be connected via 100M / 1000M Ethernet or a CAN bus. The upgrade agent 207 can be connected to the vehicle controller 205 via 100M / 1000M Ethernet or a CAN bus. The upgrade master 206 can be connected to the third vehicle gateway 203 and the fourth vehicle gateway 204 via 100M / 1000M Ethernet or a CAN bus. The vehicle controller 205 can be connected to the first vehicle gateway 201 and the second vehicle gateway 202 via 100M / 1000M Ethernet or a CAN bus. The first vehicle gateway 201, the second vehicle gateway 202, the third vehicle gateway 203, and the fourth vehicle gateway 204 can be connected to each other via 100M / 1000M Ethernet or a CAN bus. The first vehicle gateway 201, the second vehicle gateway 202, the third vehicle gateway 203, the fourth vehicle gateway 204, the vehicle controller 205, the upgrade master terminal 206 and the upgrade agent terminal 207 can be connected to their subordinate electronic control units through 100M / 1000M Ethernet or CAN bus.
[0041] The upgrade master terminal 206 and the upgrade agent terminal 207 are both provided with a WiFi module and a SIM card. Taking the upgrade master terminal 206 as an example, the upgrade master terminal 206 can establish a WiFi communication connection with the server 100 through its WiFi module, and can also establish a 4G / 5G communication connection with the server 100 through its SIM card.
[0042] In the embodiment of the present application, the electronic and electrical architecture composed of components such as the first vehicle gateway 201, the second vehicle gateway 202, the third vehicle gateway 203, the fourth vehicle gateway 204, the vehicle controller 205, the upgrade master terminal 206 and the upgrade agent terminal 207 is an Ethernet ring network architecture. The Ethernet ring network architecture can support SOA (Service-Oriented Architecture) service-oriented architecture and communication channel protection, support the nearby access of each ECU component according to functional classification, and save wiring harness costs.
[0043] It should be noted that the specific types, quantities and combinations of the OTA cloud platform 101 in the server 100 and the various in-vehicle components of the vehicle 200 (including the first vehicle gateway 201, the second vehicle gateway 202, the third vehicle gateway 203, the fourth vehicle gateway 204, the vehicle controller 205, the upgrade master terminal 206, the upgrade agent terminal 207 and each electronic control unit) can be adjusted according to the actual needs of the application scenario, and the embodiments of the present application do not limit this.
[0044] Figure 2 This is a flowchart of a component security upgrade method provided in an embodiment of the present application. Figure 2 The component security upgrade method can be done by Figure 1 The upgrade master terminal 206 of the vehicle 200 is executed. Figure 2 As shown, the component security upgrade method includes the following steps:
[0045] Step S301: Obtain a first upgrade file corresponding to the component to be upgraded.
[0046] See also Figure 1 The component to be upgraded in the embodiment of the present application may be any one or more in-vehicle components in the vehicle 200. For example, the component to be upgraded may be the ECU 3-1 connected to the third vehicle gateway 203 of the vehicle 200.
[0047] In some embodiments, when the upgrade control terminal 206 detects a software upgrade message issued by the OTA cloud platform 101 in the server 100, the software upgrade message includes at least a component identifier and the latest software version. The upgrade control terminal 206 can determine the component to be upgraded based on the component identifier and subscribe to the first upgrade file (such as the latest software version) corresponding to the component to be upgraded from the OTA cloud platform. The OTA cloud platform then sends the first upgrade file to the upgrade control terminal 206.
[0048] Step S302: If it is determined that the first upgrade file is a safe file, extracting a first key parameter related to the application function of the component to be upgraded and first sensitive data related to the application permission of the component to be upgraded from the first upgrade file.
[0049] The first key parameter refers to the functional parameters related to the application function of the component to be upgraded. For example, if the application function of the component to be upgraded is emergency braking, the first key parameters include but are not limited to braking angle, braking distance, and the torque of each wheel during braking.
[0050] The first sensitive data refers to private data related to the application permissions of the component to be upgraded, that is, data related to whether the user has permission to use the application functions of the component to be upgraded. This private data can be at least one of the following: facial information, fingerprint information, contact number, ID number, etc., entered by the vehicle owner when logging into the vehicle system of vehicle 200.
[0051] Step S303: Use an encryption tool to encrypt the first key parameter and the first sensitive data to obtain the first encrypted key parameter and the first encrypted sensitive data.
[0052] The encryption tool may be at least one of the following encryption algorithms: MD5 (Message Digest Algorithm MD5, Message Digest Algorithm Version 5) encryption algorithm, SHA1 (Secure Hash Algorithm 1, Secure Hash Algorithm 1) encryption algorithm, DES (Data Encryption Standard, Data Encryption Algorithm) encryption algorithm, RSA (RSA algorithm) encryption algorithm, national secret algorithms SM1 to SM4, and the like.
[0053] Step S304: remove the first key parameter, the first sensitive data, and the first boot program from the upgrade file to obtain a first desensitized file.
[0054] The first bootloader is a utility. After the upgraded components are activated, the system automatically enters a short program to complete the boot process. Booting is a common method used by computers to initiate input. After the computer starts, the device inputs a small amount of instructions and data, which then enter other programs. This process is called booting.
[0055] Step S305, write the first encryption key parameter and the first encryption sensitive data into the encryption protection area, write the first desensitized file into the application area, write the first boot program into the boot program area, and obtain the first reorganized upgrade file. The first reorganized upgrade file includes at least the encryption protection area, the application area and the boot program area.
[0056] Figure 3 This is a data structure diagram of a first upgrade file provided in an embodiment of the present application. Figure 3 The first upgrade file of the embodiment of the present application includes an encryption protection area 401, an application area 402, and a boot program area 403. The encryption protection area 401 can be used to store first encryption key parameters and first encryption sensitive data; the application area 402 can be used to store a first desensitized file; and the boot program area 403 can be used to store the first boot program in the first upgrade file of the component to be upgraded.
[0057] Step S306: Flash the first reorganized upgrade file to the component to be upgraded.
[0058] The technical solution provided by the embodiment of the present application is that before upgrading and flashing the component to be upgraded, first, it is determined that the first upgrade file is a safe file and then subsequent upgrade operations are performed, which is conducive to ensuring the upgrade security of the component to be upgraded. Secondly, the first key parameters and the first sensitive data are extracted from the first upgrade file, and the first key parameters and the first sensitive data are encrypted, which can effectively prevent the key parameters and sensitive data of the user's component to be upgraded from being leaked or tampered with due to penetration attacks by malicious programs during the upgrade flashing process, thereby improving the upgrade security of the component. In addition, by writing the first encrypted key parameters, the first encrypted sensitive data, the first desensitized file and the first boot program into the partition, a first reorganized upgrade file is obtained, and then the first reorganized upgrade file is flashed to the component to be upgraded, which can greatly increase the difficulty of malicious attackers attacking the first upgrade file, thereby effectively preventing the first upgrade file from being attacked or tampered with by malicious attackers during the upgrade process, which is conducive to further improving the upgrade security of the component.
[0059] In some embodiments, encrypting the first key parameter and the first sensitive data using an encryption tool to obtain the first encrypted key parameter and the first encrypted sensitive data includes:
[0060] Scanning and calculating the first key parameter and the first sensitive data;
[0061] If it is confirmed that the first key parameter and the first sensitive data are abnormal, the first key parameter and the first sensitive data are repaired to obtain repaired key parameters and repaired sensitive data;
[0062] Obtaining an encryption tool corresponding to the component to be upgraded from a secure and trusted zone; wherein the secure and trusted zone is provided on a hardware chip, or in an upgrade agent, or in an upgrade master;
[0063] An encryption tool is used to encrypt the repair key parameter and the repair sensitive data to obtain a first encrypted key parameter and a first encrypted sensitive data.
[0064] As an example, first, the upgrade main control terminal 206 can perform a security scan and calculation on the first key parameter and the first sensitive data in the first upgrade file. If it is found during the scanning and calculation process that the first key parameter and / or the first sensitive data carry suspicious information (such as a Trojan virus, etc.), or that the first key parameter and / or the first sensitive data are partially or completely missing or tampered with, it can be confirmed that there is an abnormality in the first key parameter and the first sensitive data. At this time, the upgrade main control terminal 206 can repair the first key parameter and the first sensitive data to eliminate the suspicious information in the first key parameter and the first sensitive data. At the same time, the first key parameter and the first sensitive data can be repaired according to the pre-stored standard key parameters and standard sensitive data corresponding to the component to be upgraded, so as to complete the missing part or all of the data and correct the tampered content to obtain repaired key parameters and repaired sensitive data.
[0065] Figure 4 This is a data structure diagram of another first upgrade file provided in an embodiment of the present application.
[0066] In one example, see Figure 4 , the data structure is the same as Figure 3 The data structures shown are essentially the same, except that Figure 4 The data structure shown also includes a secure trusted area 404. The secure trusted area is used to store encryption tools corresponding to the components to be upgraded, and decryption tools (decryption algorithms) matching the encryption tools.
[0067] As an example, the upgrade control terminal 206 retrieves an encryption tool from the secure trusted area 404 of the first upgrade file, and uses the encryption tool to encrypt the above-mentioned repair key parameters and repair sensitive data respectively to obtain first encrypted key parameters and first encrypted sensitive data.
[0068] As another example, the upgrade control terminal 206 may also use an encryption tool to package and encrypt the repair key data and the repair sensitive data to obtain packaged encrypted data.
[0069] By setting up a secure and trusted area for storing encryption tools in the first upgrade file, there is no need to purchase additional encryption hardware devices, which helps reduce costs; secondly, by partitioning and storing the encryption tools, first key data and first sensitive data, it can increase the difficulty for malicious attackers to obtain and tamper with the first key data and first sensitive data of the first upgrade file, which helps to improve the upgrade and flashing security of the component.
[0070] In another example, the secure trusted zone can be set on some common hardware chips, which can be set on the vehicle 200, on a backend server, or in other hardware devices. The upgrade host 206 can communicate with the vehicle 200, the backend server, or other hardware devices via a network (which can be a wired network or a wireless network) to retrieve the encryption tool corresponding to the component to be upgraded from the secure trusted zone.
[0071] By storing the encryption tool in a secure and trusted area on the hardware chip, it is possible to further increase the difficulty for malicious attackers to crack or tamper with the first key data and the first sensitive data in the first upgrade file, which is conducive to further improving the upgrade and flashing security of the component.
[0072] Figure 5 This is a structural diagram of a component security upgrade system provided by an embodiment of the present application. Figure 5 The component security upgrade system includes an OTA cloud platform 101, an upgrade master terminal 206 (such as CDC), an upgrade agent terminal 207 (such as VBOX) and a component to be upgraded (or called a target ECU).
[0073] The OTA cloud platform 101 includes an AI security management module, an AI security communication module, the latest virus database, a software version management module, and a software upgrade management module.
[0074] The upgrade master control terminal 206 (abbreviated as "UMC") includes an AI security management module, an AI security algorithm module, an OTA master control module, an AI security protection module, a known virus database, an AI security communication module, a file security reinstallation module, a download management module and an upgrade management module.
[0075] The upgrade agent 207 (abbreviated as "UA") includes an AI security management module, an AI security algorithm module, an OTA agent module, an AI security communication module, an AI security protection module, a known virus library, an upgrade management module, and a download management module.
[0076] In another example, see Figure 5The secure trusted zone can be set in the upgrade agent 207, specifically in any of the AI security management module, AI security algorithm module, AI security communication module, or AI security protection module of the upgrade agent 207. When the upgrade control terminal 206 needs to encrypt the first key data and the first sensitive data in the first upgrade file, an AI secure tunnel (such as an HTTPS secure tunnel) can be established between the AI secure communication module of the upgrade control terminal 206 and the AI secure communication module of the upgrade agent 207. The encryption tool corresponding to the component to be upgraded can then be retrieved from the secure trusted zone of the upgrade agent 207 through the AI secure tunnel.
[0077] By setting a secure trusted zone in the upgrade agent 207 and transmitting the encryption tool corresponding to the component to be upgraded through the AI secure tunnel established between the upgrade master 206 and the upgrade agent 207, it is possible to increase the difficulty for malicious attackers to crack or tamper with the first key data and the first sensitive data in the first upgrade file, which is beneficial to improving the upgrade and flashing security of the component.
[0078] In the embodiment of the present application, by first performing a security scan and calculation on the first key data and the first sensitive data, and then repairing the first key data and the first sensitive data that have abnormalities, to remove suspicious information or complete or correct missing data, repair key parameters and repair sensitive data are obtained, thereby ensuring the security and integrity of the first key data and the first sensitive data, which is conducive to improving the upgrade success rate of the component to be upgraded. Secondly, by setting the secure trusted zone on the hardware chip, or setting it in the upgrade agent or upgrade master, it is possible to increase the difficulty of cracking or tampering with the first key data and the first sensitive data, which is conducive to improving the upgrade and flashing security of the component.
[0079] In some embodiments, flashing the first reorganized upgrade file to the component to be upgraded includes:
[0080] Extracting the first vulnerable program from the first upgrade file;
[0081] Encrypt the first vulnerable program using an encryption tool to obtain a first encrypted vulnerable program;
[0082] Remove the first vulnerable program from the first desensitized file to obtain a second desensitized file;
[0083] Writing the first encryption vulnerability program into the encryption protection zone of the first reassembled upgrade file, and using the second desensitized file to update the first desensitized file in the application zone of the first reassembled upgrade file to obtain the second reassembled upgrade file;
[0084] Flash the second reassembled file to the component to be upgraded.
[0085] The first vulnerable program refers to a program in the first upgrade file of the component to be upgraded that is easily attacked or exploited by an attacker, or a program with some undiscovered defects or problems hidden in the first upgrade file.
[0086] The upgrade control terminal 206 can first extract the first vulnerability program from the first upgrade file, then call out the encryption tool from the secure and trusted area, and then use the encryption tool to encrypt the first vulnerability program to obtain the first encrypted vulnerability program, and then write the first encrypted vulnerability program into the encryption protection zone 401 of the first reorganized upgrade file, and at the same time replace the first desensitized file in the application zone 402 of the first reorganized upgrade file with the second desensitized file to obtain the second reorganized upgrade file; finally, the second reorganized upgrade file is flashed to the component to be upgraded.
[0087] By extracting the first vulnerability program from the first upgrade file and encrypting it, and then writing the obtained first encrypted vulnerability program into the encryption protection zone, it can increase the difficulty for attackers to use the first vulnerability program to attack or tamper with the first upgrade file, which is conducive to further improving the upgrade and flashing security of the component.
[0088] In some embodiments, flashing the first reorganized upgrade file to the component to be upgraded includes:
[0089] Obtain the source code file corresponding to the first upgrade file;
[0090] If the source code file is confirmed to be a safe source code file, the source code file is optimized based on the shared source code resource library to obtain an optimized source code file;
[0091] Recompile the optimized source code file to generate a second upgrade file;
[0092] Eliminate the second key parameter, the second sensitive data, the second vulnerable program, and the second boot program from the second upgrade file to obtain a third desensitized file;
[0093] Using the third desensitized file to update the first desensitized file in the application area of the first reorganized upgrade file, to obtain the third reorganized upgrade file;
[0094] Flash the third-party upgrade file to the component to be upgraded.
[0095] Figure 6 This is a data structure diagram of a source code file provided in an embodiment of the present application.
[0096] See also Figure 6, the source code file may include a source code AI marking area, an AI modified code marking area and a source code area. Among them, the source code AI marking area is used to mark whether the software source code corresponding to the first upgrade file of the component to be upgraded has been AI calculated and optimized. The AI modified code marking area is used to mark at which position the code in the software source code has been modified, for example, the code from line n to line m has been modified. In this way, it is convenient for users (such as developers) to quickly check the specific location and modification content of the software code modified by AI, so as to further confirm whether there are quality problems with the software source code after AI modification and adjustment, etc., to ensure the quality and stability of the software source code. The source code area is used to store the first encrypted key parameters and the first encrypted sensitive data in the encryption protection area of the first upgrade file, or the first encrypted key parameters, the first encrypted sensitive data and the first encrypted vulnerability program, the first desensitized file or the second desensitized file in the application area, and the source code related to the first boot program in the boot program area.
[0097] As an example, after obtaining the source code file corresponding to the first upgrade file of the component to be upgraded, the upgrade control terminal 206 may first perform a security scan on the source code file to confirm whether it carries any malicious virus programs. If the scan does not find any malicious virus programs in the source code file, the source code file is confirmed to be a safe source code file. Next, the shared source code resource library can be used to perform AI calculations on the source code file, and the source code in the source code area of the source code file can be optimized and adjusted to obtain an optimized source code file. At the same time, corresponding markings are made in the source code AI marking area and the AI modified code marking area. Next, the optimized source code file is recompiled to generate a second upgrade file. The second key parameter, second sensitive data, second vulnerable program, and second boot program in the second upgrade file are then removed to obtain a third desensitized file. The first desensitized file in the application area 402 of the first reorganized upgrade file is then replaced with the third desensitized file described above. The first encrypted sensitive data and first encrypted key data in the encryption protection area 401 are not modified, and the first boot program in the boot program area 403 is not modified, to obtain the third reorganized upgrade file. Finally, the third reorganized file is flashed to the component to be upgraded.
[0098] At the same time, the upgrade main control end 206 can transmit the recompiled third reorganized upgrade file to the OTA cloud platform 101 through the AI secure tunnel, and then the software version management module and software upgrade management module of the OTA cloud platform 101 will perform version update management and file storage management on the third reorganized upgrade file.
[0099] In an embodiment of the present application, by utilizing a shared source code resource library to optimize and adjust the source code file corresponding to the first upgrade file, redundant code can be deleted, low-performance code or erroneous code can be repaired, and an optimized source code file that occupies the least CPU resources and memory resources and has the highest operating efficiency can be obtained; then, the optimized source code file is recompiled to obtain a second upgrade file, and the first desensitized file in the application area of the first upgrade file is updated according to the second upgrade file to obtain a third reorganized upgrade file, which can not only improve the application performance of the component to be upgraded, but also save CPU resources and improve system operating efficiency.
[0100] As another example, an encryption tool is used to encrypt the second key parameters, second sensitive data, and second vulnerability program in the second upgrade file respectively to obtain second encrypted key parameters, second encrypted sensitive data, and second encrypted vulnerability program; the second encrypted key parameters, second encrypted sensitive data, and second encrypted vulnerability program replace the first encrypted key parameters and the first encrypted sensitive data in the encryption protection zone 401 of the first reorganized upgrade group file; the first desensitized file in the application zone 402 of the first reorganized upgrade file is replaced with the above-mentioned third desensitized file; the first boot program in the boot program zone 403 of the first reorganized upgrade file is not modified, or the first boot program in the boot program zone 403 of the first reorganized upgrade file is replaced with the second boot program of the second upgrade file, thereby reorganizing to obtain the second reorganized upgrade file.
[0101] Through the above method, not only the quality and stability of the source code files of the components to be upgraded can be improved, but also the upgrade security of the components can be improved.
[0102] In some embodiments, the component to be upgraded includes a component trusted area and a component upgrade area, and the component trusted area stores a decryption tool corresponding to the encryption tool;
[0103] Flash the first reorganized upgrade file to the component to be upgraded, including:
[0104] Flash the first encryption key parameter and the first encryption sensitive data in the encryption protection zone, the first desensitized file in the application zone, and the first boot program in the boot program zone in the component upgrade zone;
[0105] Components to be upgraded:
[0106] Restart, call the decryption tool from the component trusted area, use the decryption tool to decrypt the first encrypted key parameter and the first encrypted sensitive data written in the component upgrade area, and obtain the decrypted key parameter and the decrypted sensitive data;
[0107] Fill the decryption key parameters and decrypted sensitive data into the first desensitized file written in the component upgrade area to complete the upgrade.
[0108] Specifically, the upgrade control terminal 206 flashes the first encrypted key parameters and first encrypted sensitive data, the first desensitized file, and the first boot program in the first reorganized upgrade file into the component upgrade area of the component to be upgraded. After the flashing is complete, the component to be upgraded restarts. After restarting, the component to be upgraded retrieves a decryption tool from the component trusted area and uses the decryption tool to decrypt the first encrypted key parameters and the first encrypted sensitive data, obtaining decrypted key parameters and decrypted sensitive data. The decrypted key parameters and decrypted sensitive data are then added to the first desensitized file in the component upgrade area, restoring the first upgrade file. This first upgrade file is then used to update the local old software program, completing the upgrade.
[0109] In some embodiments, obtaining a first upgrade file corresponding to the component to be upgraded includes:
[0110] Obtain the upgrade source code file corresponding to the component to be upgraded;
[0111] If the upgrade source code file is confirmed to be a safe source code file, the upgrade source code file is optimized based on the shared source code resource library to obtain an optimized upgrade source code file;
[0112] Compile the optimized upgrade source code file to obtain a first upgrade file.
[0113] As an example, when the upgrade control terminal 206 detects that the OTA cloud platform 101 has released a software upgrade message, it can determine the component to be upgraded based on the software upgrade message and subscribe to the OTA cloud platform 101 for the upgrade source code file corresponding to the component to be upgraded, that is, the software source code corresponding to the latest version of the upgrade file. Next, the upgrade control terminal 206 performs a security scan on the upgrade source code file. If no malicious virus program is found in the upgrade source code file during the scan process, the upgrade source code file can be confirmed to be a safe source code file. Next, the upgrade control terminal 206 can use the shared source code resource library to optimize the upgrade source code file to obtain an optimized upgrade source code file. After that, the optimized upgrade source code file is compiled to obtain the first upgrade file.
[0114] By using the above method, redundant code in the upgrade source code file can be deleted, and low-performance code or error code therein can be repaired, thereby obtaining an optimized upgrade source code file that can generate the minimum CPU and memory resources and the highest operating efficiency.
[0115] In some embodiments, determining that the first upgrade file is a safe file includes:
[0116] Establish a secure communication channel with the server;
[0117] Receive a first upgrade file corresponding to the component to be upgraded sent by the server through a secure communication channel;
[0118] If the source port and the target port corresponding to the first upgrade file are both normal, a security scan is performed on the first upgrade file;
[0119] If it is confirmed after scanning that the first upgrade file does not carry any malicious virus program, the first upgrade file is determined to be a safe file.
[0120] As an example, see Figure 5 , the upgrade master terminal 206 can establish a secure communication channel (such as an HTTPS (Hyper Text Transfer Protocol over Secure Socket Layer) communication channel) with the AI secure communication module of the OTA cloud platform 101 of the server 100 through its AI secure communication module; then, the OTA master control module of the upgrade master terminal 206 sends an instruction to the download management module to enable the download management module to execute the download instruction and receive the first upgrade file corresponding to the component to be upgraded issued by the OTA cloud platform 101 from the secure communication channel. The OTA master control module sends a port detection instruction to the AI secure communication module of the upgrade master terminal 206. The AI secure communication module executes the port detection instruction and performs a port detection on the first upgrade file to confirm whether the source port and target port corresponding to the first upgrade file are normal ports. If the source port and target port corresponding to the first upgrade file are consistent with the pre-stored source port and target port of the component to be upgraded, it can be confirmed that the source port and target port corresponding to the first upgrade file are normal. The OTA main control module then issues a security scan command to the AI security management module of the upgrade main control terminal 206. Upon receiving the security scan command, the AI security management module controls the AI security protection module of the upgrade main control terminal 206 to perform a security scan on the first upgrade file to determine whether it contains any malicious virus programs. If no malicious virus programs are detected in the first upgrade file, the first upgrade file is determined to be a safe file.
[0121] Through the above method, the upgrade master control end can filter out upgrade files with abnormal source ports and / or target ports when receiving the first upgrade file, thereby effectively preventing the abnormal first upgrade file from entering the subsequent upgrade program; thereafter, a security scan is performed on the first upgrade file to further confirm that the first upgrade file is an upgrade file that does not carry malicious virus programs, thereby further ensuring the security of the upgrade file, and then ensuring the upgrade security of subsequent components.
[0122] All of the above optional technical solutions can be combined in any way to form optional embodiments of the present application, and will not be described in detail here.
[0123] Figure 7 It is a structural diagram of another component security upgrade system provided in an embodiment of the present application.
[0124] As an example, see Figure 7 When the "OTA main control module" of the upgrade main control terminal 206 (UMC) of the vehicle 200 is upgrading and flashing the component to be upgraded (target ECU), it first starts the "AI security management module". The "AI security management module" controls the "AI security protection module" to perform a security scan on the CDC and VBOX system environments of the vehicle 200 to remove viruses or Trojans (viruses or Trojans that match known viruses in the known virus library) in the system environment to ensure the security of the system environment. After the scan is complete, the upgrade master control terminal 206 (UMC) establishes a secure communication channel (or secure communication tunnel) with the "AI secure communication module" of the OTA cloud platform 101 through the "AI secure communication module". The "download management module" of the upgrade master control terminal 206 (UMC) then downloads the latest virus file from the latest virus library of the OTA cloud platform 101 through the secure communication channel. The "OTA master control module" passes the latest virus file to the "AI security management module". The "AI security management module" uses the latest virus file to update the known virus library of the upgrade master control terminal 206 (UMC) to ensure that the known virus library of the upgrade master control terminal 206 (UMC) can be synchronized with the latest virus library of the OTA cloud platform 101, thereby ensuring that the UMC can accurately identify viruses or Trojans that may exist in the system environment. After updating the known virus library, the UMC of the vehicle 200 restarts the "AI security management module" to perform AI security protection to protect against external attacks.
[0125] In some embodiments, during the security scan of the system environment of the vehicle 200, if the "AI security protection module" of the UMC detects that there is a file with pending security in the current system (there is no virus file information (such as virus file suffix) that matches it in the known virus library, and there is no safety file information (such as safety file suffix) that matches it). At this time, the UMC can build a virtual operating environment, run the file with pending security in the virtual operating environment, and then determine whether the file with pending security is a virus file or a safety file based on the operating results. If the file with pending security is a virus file, the relevant information of the file with pending security (such as file suffix) is synchronously updated to the latest virus library of the known virus library and the OTA cloud platform, and the file with pending security is prohibited from running in the UMC. If the file with pending security is a safety file, the file with pending security is not prohibited from running in the UMC. In this way, viruses or Trojans in the system environment can be comprehensively and effectively cleared to ensure the security of the system environment, thereby improving the security of component upgrades.
[0126] When the OTA cloud platform 101 sends the first upgrade file for the component to be upgraded to the vehicle 200, it first activates its "AI Security Management Module." Using the latest virus database, the "AI Security Management Module" checks the system environment for viruses and Trojans to ensure the security of the OTA cloud platform 101's system environment. Once the OTA cloud platform 101 confirms that both its own system and the vehicle 200's system environment are secure, it communicates with the vehicle 200's "AI Security Communication Module" via its "AI Security Communication Module." The OTA Master Control Module then sends the first upgrade file for the component to be upgraded to the "OTA Main Control Module" on the Upgrade Master 206 (UMC) via a secure communication channel. The "OTA Main Control Module" issues a file scanning instruction to the "AI Security Management Module." The "AI Security Management Module" receives and executes the file scanning instruction, instructing the "AI Security Protection Module" to perform a security scan on the first upgrade file. If the "AI Security Management Module" confirms the first upgrade file is free of malicious programs based on the scan results from the "AI Security Protection Module," confirming that the first upgrade file is safe, it then issues a scanning and calculation instruction to the "AI Security Algorithm Module." The "AI security algorithm module" receives and executes the scanning and calculation instructions, scans and calculates the first key parameter and the first sensitive data in the first upgrade file, and repairs any anomalies in the first key parameter and the first sensitive data to obtain a repair key parameter and repair sensitive data. The "AI security algorithm module" then retrieves the encryption tool corresponding to the component to be upgraded from the secure trusted zone and uses the encryption tool to encrypt the repair key parameter and the repair sensitive data to obtain a first encrypted key parameter and a first encrypted sensitive data. The first encrypted key parameter and the first encrypted sensitive data are then passed to the "file security reinstallation module." The "file security reinstallation module" writes the first encrypted key parameter and the first encrypted sensitive data into the encryption protection zone 401, writes the first desensitized file of the first upgrade file, which has been stripped of the first encrypted key parameter, the first encrypted sensitive data, and the first boot program, into the application zone 402, and writes the first boot program into the boot program zone 403, to obtain a first reconstructed upgrade file, which is then passed to the "upgrade management module." The OTA master control module issues an upgrade flash command to the upgrade management module. The upgrade management module receives and executes the upgrade flash command, flashing the first reorganized upgrade file to the target ECU. After the upgrade flash is complete, the target ECU restarts. If the first sensitive data and first key parameters are needed, a decryption tool can be retrieved from its component trusted zone. The decryption tool can be used to decrypt the first encrypted key parameters and first encrypted sensitive data, thereby obtaining the decrypted key parameters and decrypted sensitive data. This effectively protects the functional safety of the target ECU.
[0127] As another example, the OTA main control module can download the source code file corresponding to the first upgrade file from the OTA cloud platform 101 through the download management module. The OTA main control module then activates the AI security management module. The AI security management module issues a scan command to the AI security algorithm module. The AI security algorithm module receives and executes the scan command, scans and calculates the source code file, and repairs the vulnerable programs in the source code file to obtain an optimized source code file. It also marks the AI mark area and AI modified code area of the source code, writes the repaired source code to the source code area, and passes the optimized source code file to the file security reinstallation module. The file security reinstallation module packages the optimized source code file and uploads it to the OTA cloud platform for software version management. Simultaneously, the file security reinstallation module recompiles the optimized source code file to generate a second upgrade file. It then updates the first reassembled upgrade file based on the second upgrade file to obtain a third reassembled upgrade file, which it passes to the upgrade management module. The upgrade management module flashes the third reassembled upgrade file to the target ECU.
[0128] In summary, the technical solution provided in the embodiment of the present application can perform a comprehensive security scan of the vehicle and the OTA cloud platform when upgrading and flashing the target ECU. After ensuring that the system environment of both parties is safe, subsequent upgrade and flashing operations can be performed to ensure the upgrade security of the component; further, on the vehicle side, through the mutual coordination and cooperation of the AI security communication module, the AI security protection module, the AI security management module, the AI security algorithm module, etc., timely and comprehensive security detection, repair and encryption processing of the first upgrade file of the upgraded component can be achieved. At the same time, the first upgrade file is reorganized through the file security reinstallation module, which can greatly increase the difficulty for malicious attackers to attack or tamper with the first upgrade file, and ensure that the upgrade file can remain stable and secure in various attack scenarios, thereby ensuring the upgrade security of the improved component and the functional safety of the component to be upgraded.
[0129] The following are device embodiments of the present application, which can be used to implement the method embodiments of the present application. For details not disclosed in the device embodiments of the present application, please refer to the method embodiments of the present application.
[0130] Figure 8 This is a schematic diagram of a component security upgrade device provided by an embodiment of the present application. Figure 8 As shown, the component security upgrade device includes:
[0131] The acquisition module 801 is configured to acquire a first upgrade file corresponding to the component to be upgraded;
[0132] The extraction module 802 is configured to extract, from the first upgrade file, a first key parameter related to the application function of the component to be upgraded and first sensitive data related to the application permission of the component to be upgraded if the first upgrade file is determined to be a safe file;
[0133] The encryption module 803 is configured to encrypt the first key parameter and the first sensitive data using an encryption tool to obtain the first encrypted key parameter and the first encrypted sensitive data;
[0134] The removal module 804 is configured to remove the first key parameter, the first sensitive data, and the first boot program from the first upgrade file to obtain a first desensitized file;
[0135] The reassembly module 805 is configured to write the first encryption key parameter and the first encryption sensitive data into the encryption protection area, write the first desensitized file into the application area, and write the first boot program into the boot program area, thereby obtaining a first reassembled upgrade file, the first reassembled upgrade file including at least the encryption protection area, the application area, and the boot program area;
[0136] The flashing module 806 is configured to flash the first reorganized upgrade file to the component to be upgraded.
[0137] In some embodiments, the encryption module 803 includes:
[0138] a scanning and calculating unit, configured to scan and calculate the first key parameter and the first sensitive data;
[0139] a repair unit configured to repair the first key parameter and the first sensitive data if an abnormality is confirmed in the first key parameter and the first sensitive data, thereby obtaining a repaired key parameter and a repaired sensitive data;
[0140] An acquisition unit is configured to acquire an encryption tool corresponding to the component to be upgraded from a secure and trusted zone; wherein the secure and trusted zone is provided on a hardware chip, or in an upgrade agent, or in an upgrade master;
[0141] The first encryption unit is configured to use an encryption tool to encrypt the repair key parameter and the repair sensitive data to obtain a first encrypted key parameter and a first encrypted sensitive data.
[0142] In some embodiments, the flash module 806 includes:
[0143] An extraction unit is configured to extract a first vulnerable program from a first upgrade file;
[0144] a second encryption unit configured to encrypt the first vulnerable program using an encryption tool to obtain a first encrypted vulnerable program;
[0145] A first removal unit is configured to remove the first vulnerable program from the first desensitized file to obtain a second desensitized file;
[0146] A writing unit is configured to write the first encryption vulnerability program into the encryption protection zone of the first reorganized upgrade file, and use the second desensitized file to update the first desensitized file in the application zone of the first reorganized upgrade file to obtain the second reorganized upgrade file;
[0147] The first flashing unit is configured to flash the second reorganized file to the component to be upgraded.
[0148] In some other embodiments, the flashing module 806 includes:
[0149] a source code acquisition unit, configured to acquire a source code file corresponding to the first upgrade file;
[0150] The optimization unit is configured to optimize the source code file based on the shared source code resource library to obtain an optimized source code file if the source code file is confirmed to be a safe source code file;
[0151] A compilation unit is configured to recompile the optimized source code file to generate a second upgraded file;
[0152] The second elimination unit is configured to eliminate the second key parameter, the second sensitive data, the second vulnerable program, and the second boot program from the second upgrade file to obtain a third desensitized file;
[0153] An updating unit is configured to update the first desensitized file in the application area of the first reorganized upgrade file using the third desensitized file to obtain the third reorganized upgrade file;
[0154] The second flashing unit is configured to flash the third reorganized upgrade file to the component to be upgraded.
[0155] In some further embodiments, the component to be upgraded includes a component trusted area and a component upgrade area, and the component trusted area stores a decryption tool corresponding to the encryption tool.
[0156] The flashing module 806 includes:
[0157] The third flashing unit is configured to flash the first encryption key parameter and the first encryption sensitive data in the encryption protection zone in the first reorganized file, the first desensitized file in the application zone, and the first boot program in the boot program zone to the component upgrade zone;
[0158] Components to be upgraded include:
[0159] The decryption module is configured to restart, retrieve a decryption tool from the component trusted zone, and use the decryption tool to decrypt the first encrypted key parameter and the first encrypted sensitive data written in the component upgrade zone to obtain the decrypted key parameter and the decrypted sensitive data;
[0160] The filling module is configured to fill the decryption key parameters and decrypted sensitive data into the first desensitized file written in the component upgrade area to complete the upgrade.
[0161] In some embodiments, the acquisition module 801 includes:
[0162] A file acquisition unit is configured to acquire an upgrade source code file corresponding to the component to be upgraded;
[0163] The source code optimization unit is configured to optimize the upgrade source code file based on the shared source code resource library to obtain an optimized upgrade source code file if the upgrade source code file is confirmed to be a safe source code file;
[0164] The source code compiling unit is configured to compile the optimized upgraded source code file to obtain a first upgraded file.
[0165] In some embodiments, the extraction module 802 includes:
[0166] an establishing unit, configured to establish a secure communication channel with the server;
[0167] A receiving unit configured to receive a first upgrade file corresponding to the component to be upgraded sent by the server through a secure communication channel;
[0168] a scanning unit configured to perform a security scan on the first upgrade file if the source port and the target port corresponding to the first upgrade file are both normal;
[0169] The determining unit is configured to determine that the first upgrade file is a safe file if it is determined after scanning that the first upgrade file does not carry any malicious virus program.
[0170] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0171] The embodiment of the present application also provides a car, comprising: an upgrade main control terminal; a component to be upgraded that is in communication with the upgrade main control terminal; the upgrade main control terminal includes: Figure 8 Component safety upgrade device shown.
[0172] Figure 9 Schematic diagram of the electronic device 9 provided in the embodiment of the present application. Figure 9As shown, the electronic device 9 of this embodiment includes: a processor 901, a memory 902, and a computer program 903 stored in the memory 902 and executable by the processor 901. When the processor 901 executes the computer program 903, the steps of the above-described method embodiments are implemented. Alternatively, when the processor 901 executes the computer program 903, the functions of the modules / units in the above-described device embodiments are implemented.
[0173] The electronic device 9 may be a desktop computer, a notebook, a PDA, a cloud server or other electronic device. The electronic device 9 may include but is not limited to a processor 901 and a memory 902. Those skilled in the art will understand that Figure 9 This is merely an example of the electronic device 9 and does not limit the electronic device 9 . The electronic device 9 may include more or fewer components than shown in the figure, or different components.
[0174] The processor 901 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
[0175] The memory 902 can be an internal storage unit of the electronic device 9, such as a hard disk or memory of the electronic device 9. The memory 902 can also be an external storage device of the electronic device 9, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash memory card, etc. equipped on the electronic device 9. The memory 902 can also include both an internal storage unit of the electronic device 9 and an external storage device. The memory 902 is used to store computer programs and other programs and data required by the electronic device.
[0176] Those skilled in the art will clearly understand that for the sake of convenience and brevity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.
[0177] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium (such as a computer-readable storage medium). Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. The computer program may include computer program code, which may be in source code form, object code form, executable file or some intermediate form, etc. Computer-readable storage media may include: any entity or device capable of carrying computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc.
[0178] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present application, and should all be included in the scope of protection of the present application.
Claims
1. A component security upgrade method, characterized in that: include: Upgrade the master control terminal: Obtaining a first upgrade file corresponding to the component to be upgraded; If it is determined that the first upgrade file is a safe file, extracting a first key parameter related to the application function of the component to be upgraded and first sensitive data related to the application permission of the component to be upgraded from the first upgrade file; Encrypting the first key parameter and the first sensitive data using an encryption tool to obtain a first encrypted key parameter and a first encrypted sensitive data; Eliminating the first key parameter, the first sensitive data, and the first boot program from the first upgrade file to obtain a first desensitized file; Writing the first encryption key parameter and the first encryption sensitive data into the encryption protection area, writing the first desensitized file into the application area, and writing the first boot program into the boot program area to obtain a first reassembled upgrade file, wherein the first reassembled upgrade file includes at least the encryption protection area, the application area, and the boot program area; Flashing the first reorganized upgrade file to the component to be upgraded; Determining that the first upgrade file is a safe file includes: Establish a secure communication channel with the server; Receiving, through the secure communication channel, a first upgrade file corresponding to the component to be upgraded sent by the server; If the source port and the target port corresponding to the first upgrade file are both normal, performing a security scan on the first upgrade file; If it is confirmed after scanning that the first upgrade file does not carry any malicious virus program, the first upgrade file is determined to be a safe file.
2. The method according to claim 1, characterized in that Encrypting the first key parameter and the first sensitive data using an encryption tool to obtain the first encrypted key parameter and the first encrypted sensitive data includes: Scanning and calculating the first key parameter and the first sensitive data; If it is confirmed that the first key parameter and the first sensitive data are abnormal, the first key parameter and the first sensitive data are repaired to obtain repaired key parameters and repaired sensitive data; Obtaining an encryption tool corresponding to the component to be upgraded from a secure and trusted zone; wherein the secure and trusted zone is provided on a hardware chip, or provided in an upgrade agent, or provided in the upgrade master; The encryption tool is used to encrypt the repair key parameter and the repair sensitive data to obtain a first encrypted key parameter and a first encrypted sensitive data.
3. The method according to claim 1, characterized in that Flashing the first reorganized upgrade file to the component to be upgraded includes: Extracting the first vulnerable program from the first upgrade file; Encrypt the first vulnerable program using the encryption tool to obtain a first encrypted vulnerable program; Remove the first vulnerable program from the first desensitized file to obtain a second desensitized file; Writing the first encrypted vulnerability program into the encryption protection zone of the first reassembled upgrade file, and using the second desensitized file to update the first desensitized file in the application zone of the first reassembled upgrade file to obtain a second reassembled upgrade file; Flash the second reorganized file to the component to be upgraded.
4. The method according to any one of claim 1, characterized in that Flashing the first reorganized upgrade file to the component to be upgraded includes: Obtaining the source code file corresponding to the first upgrade file; If the source code file is confirmed to be a secure source code file, code optimization is performed on the source code file based on a shared source code resource library to obtain an optimized source code file; Recompiling the optimized source code file to generate a second upgrade file; Eliminate the second key parameter, the second sensitive data, the second vulnerable program, and the second boot program from the second upgrade file to obtain a third desensitized file; Using the third desensitized file to update the first desensitized file in the application area of the first reorganized upgrade file, to obtain a third reorganized upgrade file; Flash the third reorganized upgrade file to the component to be upgraded.
5. The method according to claim 1, wherein The component to be upgraded includes a component trusted area and a component upgrade area, and the component trusted area stores a decryption tool corresponding to the encryption tool; Flashing the first reorganized upgrade file to the component to be upgraded includes: Flashing the first encryption key parameter and the first encryption sensitive data in the encryption protection zone in the first reorganized file, the first desensitized file in the application zone, and the first boot program in the boot program zone to the component upgrade zone; The components to be upgraded are: Restarting, calling the decryption tool from the component trusted zone, and using the decryption tool to decrypt the first encrypted key parameter and the first encrypted sensitive data written in the component upgrade zone to obtain the decrypted key parameter and the decrypted sensitive data; The decryption key parameters and decrypted sensitive data are filled into the first desensitized file written into the component upgrade area to complete the upgrade.
6. The method according to claim 1, wherein Obtain the first upgrade file corresponding to the component to be upgraded, including: Obtain the upgrade source code file corresponding to the component to be upgraded; If the upgrade source code file is confirmed to be a safe source code file, code optimization is performed on the upgrade source code file based on a shared source code resource library to obtain an optimized upgrade source code file; The optimized upgraded source code file is compiled to obtain a first upgraded file.
7. A component security upgrade device, characterized in that: include: An acquisition module is configured to acquire a first upgrade file corresponding to the component to be upgraded; an extraction module configured to extract, if determining that the first upgrade file is a safe file, a first key parameter related to the application function of the component to be upgraded and first sensitive data related to the application permission of the component to be upgraded from the first upgrade file; an encryption module configured to encrypt the first key parameter and the first sensitive data using an encryption tool to obtain a first encrypted key parameter and a first encrypted sensitive data; A removal module is configured to remove the first key parameter, the first sensitive data, and the first boot program from the first upgrade file to obtain a first desensitized file; a reassembly module configured to write the first encryption key parameter and the first encryption sensitive data into the encryption protection zone, write the first desensitized file into the application zone, and write the first boot program into the boot program zone, to obtain a first reassembly upgrade file, wherein the first reassembly upgrade file includes at least the encryption protection zone, the application zone, and the boot program zone; a flashing module, configured to flash the first reorganized upgrade file to the component to be upgraded; Determining that the first upgrade file is a safe file includes: Establish a secure communication channel with the server; Receiving, through the secure communication channel, a first upgrade file corresponding to the component to be upgraded sent by the server; If the source port and the target port corresponding to the first upgrade file are both normal, performing a security scan on the first upgrade file; If it is confirmed after scanning that the first upgrade file does not carry any malicious virus program, the first upgrade file is determined to be a safe file.
8. An automobile, characterized in that: include: Upgrade the master control terminal; A component to be upgraded that is in communication with the upgrade master terminal; The upgrade master control terminal includes the component security upgrade device as described in claim 7.
9. A readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Method and system for maintaining sensitive data security of big data
CN113836578A
Vehicle system upgrading method, OTA upgrading file cloud processing method and electronic equipment
CN117041048A