Component security upgrading method and device and automobile

By encrypting the key parameters and sensitive data in the component upgrade file and writing them to the encryption protection zone, the problem of the upgrade file being attacked or tampered during the component upgrade process is solved, improving the upgrade security of the component and ensuring that User data and enterprise security.

CN119227028AActive Publication Date: 2024-12-31CHONGQING SELIS PHOENIX INTELLIGENT INNOVATION TECH CO LTD
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202411167007.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-23
Publication Date
2024-12-31
Estimated Expiration
2044-08-23

AI Technical Summary

Technical Problem

During component upgrades, upgrade files are easily attacked or tampered with by malicious attackers, resulting in user privacy data leakage, identity theft, corporate business interruption, economic losses and national security threats.

Method used

By obtaining the upgrade file of the component to be upgraded, extracting key parameters and sensitive data for encryption, and writing it to the encryption protection area and application area to form a reorganized upgrade file, and then flashing it to the component to be upgraded, increasing the difficulty of attack. Ensure the security of upgrade files.

Benefits of technology

It effectively prevents malicious attacks or tampering of the upgrade file during the upgrade process, improves the upgrade security of components, and ensures the security and stable functions of components to be upgraded.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119227028A_ABST
    Figure CN119227028A_ABST
Patent Text Reader

Abstract

The invention relates to the field of computers, and provides a component security upgrading method and device and an automobile. The method comprises the steps that if it is determined that a first upgrading file is a safe file, first key parameters and first sensitive data are extracted from the first upgrading file; encrypting the first key parameter and the first sensitive data by using an encryption tool to obtain a first encrypted key parameter and first encrypted sensitive data; removing the first key parameter, the first sensitive data and the first bootstrap program in the first upgrade file to obtain a first desensitized file; writing the first encryption key parameter and the first encryption sensitive data into an encryption protection area, writing the first desensitization file into an application program area, and writing the first bootstrap program into a bootstrap program area to obtain a first recombined upgrading file; and flashing the first recombined upgrading file to the to-be-upgraded component. According to the application, the upgrade file can be effectively prevented from being attacked or tampered by a hostile attacker, and the upgrade flashing security of the component can be ensured.
Need to check novelty before this filing date? Find Prior Art

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 fields, etc.), if the upgrade files are attacked or tampered with by malicious attackers (such as hackers, etc.), it may cause the user's privacy data to be leaked or identity to be stolen, causing business interruption, economic loss, reputation damage, and may even threaten national security or social stability. It may also cause the component upgrade to fail or even be completely unusable.

[0003] Therefore, there is an urgent need 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, including:

[0006] Upgrade the master control:

[0007] Obtain 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 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;

[0009] 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;

[0010] Eliminate the first key parameter, the first sensitive data, and the first boot program in 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 reorganized upgrade file, wherein the first reorganized upgrade file at least includes 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 is 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;

[0017] A removal module is configured to remove the first key parameter, the first sensitive data and the first boot program in the first upgrade file to obtain a first desensitized file;

[0018] The reorganization module 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 to obtain a first reorganized upgrade file, wherein the first reorganized upgrade file at least includes 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, including:

[0021] Upgrade the main control terminal;

[0022] The component to be upgraded is connected to the upgrade master terminal in communication;

[0023] The upgrade master control 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, and 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 embodiments 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 conducive 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 in a 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 to attack 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. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0027] Figure 1 It is a schematic diagram of an application scenario of an embodiment of the present application;

[0028] Figure 2 It is a flowchart of a component security upgrade method provided in an embodiment of the present application;

[0029] Figure 3 is a data structure diagram of a first upgrade file provided in an embodiment of the present application;

[0030] Figure 4 is a schematic diagram of the data structure of another first upgrade file provided in an embodiment of the present application;

[0031] Figure 5 It is a structural diagram of a component security upgrade system provided by an embodiment of the present application;

[0032] Figure 6 It is a schematic diagram of the data structure of a source code file provided in an embodiment of the present application;

[0033] Figure 7 It is a structural diagram of another component security upgrade system provided by an embodiment of the present application;

[0034] Figure 8is a schematic diagram of a component security upgrade device provided in an embodiment of the present application;

[0035] Fig. 9 It is a structural schematic 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, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.

[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 It 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. The server 100 may include an OTA cloud platform 101. The vehicle 200 may be a new energy vehicle. The new energy vehicle of the embodiment of the present application includes but is 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 (Vehicle Domain Controller, referred to as "VDC"), an upgrade master terminal 206, and an upgrade agent terminal 207. Among them, the upgrade master terminal 206 may be the smart cockpit (or cockpit domain controller) (Cockpit Domain Controller, referred to as "CDC") of the vehicle 200, or the vehicle remote communication module (Vehicle BOX, referred to as "VBOX") of the vehicle 200. The upgrade agent terminal 207 may be the smart cockpit (or cockpit domain controller) (Cockpit Domain Controller, referred to as "CDC") of the vehicle 200, or the vehicle remote communication module (Vehicle BOX, referred to as "VBOX") of the vehicle 200. When the upgrade master terminal 206 is CDC, the upgrade agent terminal 207 is VBOX; when the upgrade master terminal 206 is VBOX, the upgrade agent terminal 207 is 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 terminal 206 and the upgrade agent terminal 207 can all be connected to at least one electronic control unit (ECU).

[0040] The upgrade master terminal 206 and the upgrade agent terminal 207 can be connected to the server 100 through a 4G / 5G network or WiFi. The upgrade master terminal 206 and the upgrade agent terminal 207 can be connected through 100M / 1000M Ethernet or CAN bus. The upgrade agent terminal 207 and the vehicle controller 205 can be connected through 100M / 1000M Ethernet or CAN bus. The upgrade master terminal 206 and the third vehicle gateway 203 and the fourth vehicle gateway 204 can be connected through 100M / 1000M Ethernet or CAN bus. The vehicle controller 205 and the first vehicle gateway 201 and the second vehicle gateway 202 can be connected through 100M / 1000M Ethernet or 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 through 100M / 1000M Ethernet or 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 various electronic control units) 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 It 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 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, obtaining 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 mounted under the third vehicle gateway 203 of the vehicle 200.

[0047] In some implementations, 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, and the component to be upgraded can be determined according to the component identifier, and the first upgrade file (such as the latest software version) corresponding to the component to be upgraded can be subscribed to the OTA cloud platform. Afterwards, the OTA cloud platform 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 a function parameter 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 parameter includes but is not limited to the braking angle, braking distance, and the torque of each wheel during braking.

[0050] The first sensitive data refers to the privacy data related to the application permissions of the component to be upgraded, that is, the data related to whether the user has the permission to use the application function of the component to be upgraded. The privacy data may be at least one of the facial information, fingerprint information, contact number, ID number, etc. entered by the owner when logging into the vehicle system of the 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 encryption algorithms such as 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~SM4, etc.

[0053] Step S304, remove the first key parameter, the first sensitive data and the first boot program in the upgrade file to obtain a first desensitized file.

[0054] The first boot program is a utility program. After the upgraded components are started, the system automatically enters a short program to complete the boot process. Booting is a common method used when a computer starts inputting. After the computer is started, the device implements the input of a small amount of instructions and data, and then they input 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, which at least includes the encryption protection area, the application program area and the boot program area.

[0056] Figure 3 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 the first encryption key parameter and the first encryption sensitive data; the application area 402 can be used to store the 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, 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 conducive 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 and 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 in a 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 to attack 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, using 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 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 the repaired key parameter and the repaired sensitive data;

[0062] Obtaining an encryption tool corresponding to the component to be upgraded from the secure and trusted zone; wherein the secure and trusted zone is set on a hardware chip, or is set in an upgrade agent, or is set in an upgrade master control terminal;

[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 Trojan virus, etc.), or the first key parameter and / or the first sensitive data have partial or complete data missing or tampered with, it can be confirmed that the first key parameter and the first sensitive data have abnormal conditions. 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, so as to obtain the repaired key parameters and the repaired sensitive data.

[0065] Figure 4 It 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 similar to Figure 3 The data structures shown are basically 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 the first encrypted key parameters and the 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 to reduce costs; secondly, by storing the encryption tools, first key data and first sensitive data in partitions, it can increase the difficulty for malicious attackers to obtain and tamper with the first key data and the 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, or on a background server, or in other hardware devices. The upgrade control terminal 206 can communicate with the vehicle 200, the background server, or other hardware devices through a network (which can be a wired network or a wireless network), and 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 further difficult 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 further improve the upgrade and flash security of the component.

[0072] Figure 5 This is a schematic diagram of the structure 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 control terminal 206 (such as CDC), an upgrade agent terminal 207 (such as VBOX) and a component to be upgraded (or referred to as a target ECU).

[0073] The OTA cloud platform 101 includes an AI security management module, an AI security communication module, an up-to-date virus database, a software version management module, and a software upgrade management module.

[0074] The upgrade main control terminal 206 (abbreviated as "UMC") includes an AI security management module, an AI security algorithm module, an OTA main control module, an AI security protection module, a known virus library, 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 module 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 master 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 through the AI ​​secure communication module of the upgrade master 206 and the AI ​​secure communication module of the upgrade agent 207, and then the encryption tool corresponding to the component to be upgraded is retrieved from the secure trusted zone of the upgrade agent 207 through the AI ​​secure tunnel.

[0077] By setting a secure and 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, the first key data and the first sensitive data are first scanned and calculated for security, and the first key data and the first sensitive data with abnormal conditions are repaired to remove suspicious information or complete or correct missing data, thereby obtaining repair key parameters and repair sensitive data, thereby ensuring the security and integrity of the first key data and the first sensitive data, which is beneficial to improving the upgrade success rate of the component to be upgraded. Secondly, by setting the secure and trusted area on the hardware chip, or setting it in the upgrade agent or the upgrade master, the difficulty of cracking or tampering with the first key data and the first sensitive data can be increased, which is beneficial 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] Extract 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 reorganized upgrade file, and using 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;

[0084] Flash the second reorganized 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 main 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 area 401 of the first reorganized upgrade file, and at the same time replace the first desensitized file in the application area 402 of the first reorganized upgrade file with the second desensitized file to obtain the second reorganized upgrade file; finally, flash the second reorganized upgrade file 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 reorganization upgrade file to the component to be upgraded.

[0095] Figure 6 It 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 which position of the code in the software source code has been modified, for example, the code from the nth line to the mth line 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 in the software source code modified and adjusted by AI, 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 master control terminal 206 may first perform a security scan on the source code file to confirm whether the source code file carries a malicious virus program. If the source code file is not found to carry a malicious virus program during the scanning process, the source code file is confirmed to be a safe source code file. Then, the shared source code resource library can be used to perform AI calculation on the source code file, and the source code in the source code area of ​​the source code file is optimized and adjusted to obtain an optimized source code file. At the same time, corresponding marks are made in the source code AI marking area and the AI ​​modified code marking area. Then, the optimized source code file is recompiled to generate a second upgrade file. Afterwards, the second key parameter, the second sensitive data, the second vulnerability program and the second boot program in the second upgrade file are removed to obtain a third desensitized file. Afterwards, the first desensitized file in the application area 402 of the first reorganized upgrade file is replaced with the above-mentioned third desensitized file, and the first encrypted sensitive data and the 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 the 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 error 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 generated; then, the optimized source code file is recompiled to obtain a second upgrade file, and then the first desensitized file in the application program 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 parameter, the second sensitive data, and the second vulnerable program in the second upgrade file respectively to obtain the second encrypted key parameter, the second encrypted sensitive data, and the second encrypted vulnerable program; the second encrypted key parameter, the second encrypted sensitive data, and the second encrypted vulnerable program replace the first encrypted key parameter 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 third desensitized file mentioned above; 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 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;

[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 decryption sensitive data into the first desensitized file written in the component upgrade area to complete the upgrade.

[0108] Specifically, the upgrade control terminal 206 writes the first encrypted key parameter and the first encrypted sensitive data, the first desensitized file and the first boot program in the first reorganized upgrade file to the component upgrade area of ​​the component to be upgraded. After the writing is completed, the component to be upgraded is restarted. After the restart, the component to be upgraded retrieves the decryption tool from the component trusted area, and uses the decryption tool to decrypt the first encrypted key parameter and the first encrypted sensitive data to obtain the decrypted key parameter and the decrypted sensitive data. After that, the decrypted key parameter and the decrypted sensitive data are filled into the first desensitized file in the component upgrade area, that is, restored to the first upgrade file, and the first upgrade file is used to update its local old software program to complete 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, code optimization is performed on the upgrade source code file based on the shared source code resource library to obtain an optimized upgrade source code file;

[0112] The optimized upgrade source code file is compiled to obtain a first upgrade file.

[0113] As an example, when the upgrade control terminal 206 detects that the OTA cloud platform 101 releases 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. Then, 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 scanning process, it can be confirmed that the upgrade source code file is a safe source code file. Then, the upgrade control terminal 206 can use the shared source code resource library to optimize the code of 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] Through the above method, redundant codes in the upgrade source code file can be deleted, and low-performance codes or error codes therein can be repaired, so as to obtain an optimized upgrade source code file that occupies the least CPU resources and memory resources and has 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] Receiving 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 control terminal 206 can establish a secure communication channel (such as 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 main control module of the upgrade control terminal 206 sends an instruction to the download management module, so that the download management module executes the download instruction and receives 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 main control module sends a port detection instruction to the AI ​​secure communication module of the upgrade control terminal 206, and the AI ​​secure communication module executes the port detection instruction to perform 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. Afterwards, the OTA main control module sends a security scan instruction to the AI ​​security management module of the upgrade main control terminal 206. After receiving the security scan instruction, 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 confirm whether the first upgrade file carries a malicious virus program. If no malicious virus program is detected in the first upgrade file, the first upgrade file is confirmed to be a safe file.

[0121] Through the above method, the upgrade main 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 the above optional technical solutions can be arbitrarily combined to form optional embodiments of the present application, which will not be described one by one here.

[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), first, the "AI security management module" is started. 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 in the system environment (viruses or Trojans that match known viruses in the known virus library) to ensure the security of the system environment. After the scan is completed, the upgrade main control terminal 206 (UMC) establishes a secure communication channel (or secure communication tunnel) with the "AI security communication module" of the OTA cloud platform 101 through the "AI security communication module", and then the "download management module" of the upgrade main control terminal 206 (UMC) downloads the latest virus file in the latest virus library of the OTA cloud platform 101 through the secure communication channel. The "OTA main control module" passes the latest virus file to the "AI security management module", and the "AI security management module" uses the latest virus file to update the known virus library of the upgrade main control terminal 206 (UMC) to ensure that the known virus library of the upgrade main 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) matching it in the known virus library, and there is no security file information (such as security file suffix) matching 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 security file based on the operating result. 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 security 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 removed 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 of the component to be upgraded to the vehicle 200, it will first start its "AI security management module" and use the latest virus library to check whether there are viruses or Trojans in the system environment through the "AI security management module" to ensure the security of the system environment of the OTA cloud platform 101. When the OTA cloud platform 101 confirms that its own system and the system environment of the vehicle 200 are both safe, it communicates with the "AI security communication module" of the vehicle 200 through the "AI security communication module" and sends the first upgrade file of the component to be upgraded to the "OTA main control module" of the upgrade main control terminal 206 (UMC) through a secure communication channel. The "OTA main control module" sends a file scanning instruction to the "AI security management module", and the "AI security management module" receives and executes the file scanning instruction, and controls the "AI security protection module" to perform a security scan on the first upgrade file. If the "AI security management module" confirms that the first upgrade file does not have a malicious virus program according to the scanning result fed back by the "AI security protection module", that is, after confirming that the first upgrade file is a safe file, it sends a scanning 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 the first key parameter and the first sensitive data with abnormal conditions to obtain the repair key parameter and the repair sensitive data; then, the "AI security algorithm module" retrieves the encryption tool corresponding to the component to be upgraded from the secure and trusted area, uses the encryption tool to encrypt the repair key parameter and the repair sensitive data, and obtains the first encrypted key parameter and the first encrypted sensitive data; then the first encrypted key parameter and the first encrypted sensitive data are 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 area 401, writes the first desensitized file in the first upgrade file that removes the first encrypted key parameter, the first encrypted sensitive data and the first boot program into the application area 402, writes the first boot program into the boot program area 403, obtains the first reorganized upgrade file, and then passes the first reorganized upgrade file to the "upgrade management module". The "OTA main control module" sends an upgrade flashing instruction to the "upgrade management module", and the "upgrade management module" receives and executes the upgrade flashing instruction to flash the first reorganized upgrade file to the target ECU. After the upgrade flashing is completed, the target ECU restarts and runs. If the first sensitive data and the first key parameter need to be used, the decryption tool can be retrieved from its component trusted area, and the first encrypted key parameter and the first encrypted sensitive data can be decrypted using the decryption tool to obtain the decrypted key parameter and the decrypted sensitive data. In this way, the functional safety of the target ECU can be effectively protected.

[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", and then the "OTA main control module" starts the "AI security management module", and the "AI security management module" issues a scan instruction to the "AI security algorithm module", and the "AI security algorithm module" receives and executes the scan instruction, scans and calculates the source code file, and repairs the vulnerability program in the source code file to obtain an optimized source code file, and at the same time, makes corresponding marks in the source code AI mark area and AI modification code area, and writes the repaired source code into 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. At the same time, the "file security reinstallation module" recompiles the optimized source code file to generate a second upgrade file, and updates the first reorganized upgrade file according to the second upgrade file to obtain a third reorganized upgrade file, and passes the third reorganized upgrade file to the "upgrade management module". The "upgrade management module" flashes the third reorganized 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. Only 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 enhanced component and ensuring the functional safety of the component to be upgraded.

[0129] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.

[0130] Figure 8 Schematic diagram of a component security upgrade device provided in an embodiment of the present application. Figure 8 As shown, the component safety 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, if it is determined 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;

[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 elimination module 804 is configured to eliminate the first key parameter, the first sensitive data and the first boot program in the first upgrade file to obtain a first desensitized file;

[0135] The reorganization 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 to obtain a first reorganized upgrade file, wherein the first reorganized upgrade file at least includes 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 it is confirmed that the first key parameter and the first sensitive data are abnormal, so as to obtain 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 set on a hardware chip, or is set in an upgrade agent, or is set in an upgrade master control terminal;

[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 is configured to encrypt the first vulnerable program using an encryption tool to obtain a first encrypted vulnerable program;

[0145] A first removing 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 compiling unit, configured to recompile the optimized source code file to generate a second upgraded file;

[0152] A second elimination unit is configured to eliminate the second key parameter, the second sensitive data, the second vulnerable program, and the second boot program in 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 program 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] A 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, call the decryption tool from the component trusted area, and use the decryption tool to decrypt the first encrypted key parameter and the first encrypted sensitive data written in the component upgrade area to obtain the decrypted key parameter and the decrypted sensitive data;

[0160] The filling module is configured to fill the decryption key parameters and the decryption 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, 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] The scanning unit is 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 determination unit is configured to determine that the first upgrade file is a safe file if it is confirmed after scanning that the first upgrade file does not carry a 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 the present application.

[0171] The embodiment of the present application also provides a car, comprising: an upgrade main control terminal; a component to be upgraded connected to the upgrade main control terminal in communication; the upgrade main control terminal includes: Figure 8 Component safety upgrade device shown.

[0172] Fig. 9 Schematic diagram of an electronic device 9 provided in an embodiment of the present application. Fig. 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 on the processor 901. When the processor 901 executes the computer program 903, the steps in the above-mentioned method embodiments are implemented. Alternatively, when the processor 901 executes the computer program 903, the functions of the modules / units in the above-mentioned device embodiments are implemented.

[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 appreciate that Fig. 9 The electronic device 9 is merely an example and does not limit the electronic device 9 , and may include more or less components than those shown in the figure, or different components.

[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 may be an internal storage unit of the electronic device 9, for example, a hard disk or memory of the electronic device 9. The memory 902 may also be an external storage device of the electronic device 9, for example, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device 9. The memory 902 may also include both an internal storage unit of the electronic device 9 and an external storage device. The memory 902 is used to store computer programs and other programs and data required by the electronic device.

[0176] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units.

[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 (e.g., a computer-readable storage medium). Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. The computer program may include computer program code, which may be in source code form, object code form, executable file or some intermediate form. Computer-readable storage media may include: any entity or device capable of carrying computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc.

[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 embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A component security upgrade method, characterized in that: include: Upgrade the master control: Obtain 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; 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; Eliminate the first key parameter, the first sensitive data and the first boot program in 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 reorganized upgrade file, wherein the first reorganized upgrade file at least includes the encryption protection area, the application area, and the boot program area; Flash the first reorganized upgrade file to the component to be upgraded.

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; Acquire an encryption tool corresponding to the component to be upgraded from a secure and trusted zone; wherein the secure and trusted zone is set on a hardware chip, or is set in an upgrade agent, or is set in the upgrade master control terminal; 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 encryption vulnerability program into the encryption protection zone of the first reorganized upgrade file, and using the second desensitized file to update the first desensitized file in the application zone of the first reorganized upgrade file to obtain a second reorganized 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 a 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, characterized in that 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 encrypted key parameter and the first encrypted 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 area, and using the decryption tool to decrypt the first encrypted key parameter and the first encrypted sensitive data written in the component upgrade area to obtain the decrypted key parameter and the decrypted sensitive data; The decryption key parameters and decryption 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, characterized in that Obtaining the first upgrade file corresponding to the component to be upgraded includes: Obtain the upgrade source code file corresponding to the component to be upgraded; If it is confirmed that the upgrade source code file is 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. The method according to any one of claims 1 to 6, characterized in that: 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. 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 it is determined 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 in the first upgrade file to obtain a first desensitized file; The reorganization module 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 to obtain a first reorganization upgrade file, wherein the first reorganization upgrade file at least includes the encryption protection area, the application area, and the boot program area; The flashing module is configured to flash the first reorganized upgrade file to the component to be upgraded.

9. A car, characterized in that: include: Upgrade the main control terminal; A component to be upgraded that is in communication connection with the upgrade master terminal; The upgrade master control end includes the component security upgrade device as described in claim 8.

10. 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 7 are implemented.

Citation Information

Patent Citations

  • Security upgrade Bootloader design method based on UDS

    CN112764787A

  • Method and system for maintaining sensitive data security of big data

    CN113836578A

  • Trusted program upgrading method and device, equipment and storage medium

    CN115543392A

  • Data security protection method and device, computer equipment and storage medium

    CN117034350A

  • Vehicle system upgrading method, OTA upgrading file cloud processing method and electronic equipment

    CN117041048A