Embedded equipment upgrading method and device, equipment and storage medium

By partitioning and extending the embedded devices, the problems of large resource consumption and poor security of OTA upgrades for embedded devices are solved, and an efficient and secure upgrade process and continuous good equipment performance are achieved.

CN119004478APending Publication Date: 2024-11-22HONGHU WANLIAN (JIANGSU) TECH DEV CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411075861.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-06
Publication Date
2024-11-22

AI Technical Summary

Technical Problem

The OTA upgrade technology of existing embedded devices adopts a full-scale upgrade method, which consumes a lot of resources and is poor in security, and the traditional software upgrade method is inefficient, which affects the normal use of the equipment.

Method used

By partitioning the embedded devices, dynamic adjustment areas, solidified areas, low update frequency areas and high update frequency areas are generated, and trust chains are built through trusted password modules, trust chain expansion and trustworthiness measurements are performed, and upgrade packages are obtained. , ensure the security of the upgrade process and resource management efficiency.

Benefits of technology

It realizes efficient management of device resources, ensures the credibility of the initial environment and subsequent operations of the device, reduces the risks of malicious attacks and tampering, rolls back when upgrades fail, and maintains device performance and security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119004478A_ABST
    Figure CN119004478A_ABST
Patent Text Reader

Abstract

The invention discloses an embedded equipment upgrading method and device, equipment and a storage medium. Comprising the steps that partition division is conducted on the embedded device to generate partition modules, and each partition module comprises a dynamic adjustment area, a curable area, a low update frequency area and a high update frequency area; constructing a trust chain according to each partition module through the trusted cryptographic module, and expanding the trust chain to generate an expanded trust chain; and performing trusted measurement on the extended trust chain to obtain an upgrade package, and performing trusted measurement on the upgrade package to upgrade the embedded device. According to the embodiment of the invention, regions with different functions and update requirements can be defined through partition division, the management efficiency of equipment resources is improved, and each partition can be optimized and maintained in a more targeted manner. Through the extension of the trust chain, the security coverage range of the whole system is enhanced, the risk of hostile attack and tampering is reduced, and rollback is carried out when upgrading fails, so that the equipment can continuously keep good performance and security.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of embedded devices, and in particular to an embedded device upgrading method, device, equipment and storage medium. Background Art

[0002] In today's technological era, embedded devices are widely used in various fields. With the continuous development of technology and the continuous changes in user needs, efficient and secure software upgrades for embedded devices have become a vital requirement.

[0003] Traditional device software upgrade methods often have many inconveniences, such as requiring users to operate manually, relying on specific hardware interfaces, or sending the device back to the manufacturer for processing. These methods are not only inefficient, but may also affect the normal use of the device. The embedded device OTA upgrade technology came into being, which provides a convenient, efficient and secure way to update software. However, the existing technology uses the OTA full upgrade method, which requires all images to be updated each time, consumes a lot of resources, and only performs integrity verification on the upgrade package, which has poor security. Summary of the invention

[0004] The present invention provides an embedded device upgrading method, device, equipment and storage medium, so as to partition the device storage area, save the occupied space and ensure the safety of the device upgrading.

[0005] According to one aspect of the present invention, there is provided an embedded device upgrading method, the method comprising:

[0006] Partitioning the embedded device to generate partition modules, wherein the partition modules include a dynamic adjustment area, a solidifiable area, a low update frequency area, and a high update frequency area;

[0007] Building a trust chain according to each partition module through a trusted cryptographic module, and extending the trust chain to generate an extended trust chain;

[0008] The extended trust chain is trusted to obtain the upgrade package, and the upgrade package is trusted to upgrade the embedded device.

[0009] Optionally, the embedded device is partitioned to generate partition modules, including: taking a designated area of ​​the embedded device as a dynamic adjustment area, and determining the solidification of each functional component of the embedded device; dividing the functional components with solidification into solidifiable areas, and taking the functional components with non-solidification as components to be divided; determining the update frequency of each component to be divided; judging whether the update frequency is greater than a preset frequency, and if so, dividing the component to be divided into a high update frequency area; otherwise, dividing the component to be divided into a low update frequency area.

[0010] Optionally, a trust chain is constructed according to each partition module through a trusted cryptographic module, and the trust chain is extended to generate an extended trust chain, including: constructing a trust chain according to each component of the solidifiable area through a trusted cryptographic module; obtaining the application service components to be extended, and performing business process extension on the trust chain based on each application service component to generate an extended trust chain.

[0011] Optionally, after extending the trust chain to generate an extended trust chain, the method further includes: determining a trust measurement value corresponding to each component in the extended trust chain, and storing the trust measurement value in an encrypted storage area of ​​the trusted cryptographic module.

[0012] Optionally, a trusted measurement is performed on the extended trust chain to obtain an upgrade package, including: taking each component of the extended trust chain as a target component in turn; obtaining a target trusted measurement value corresponding to the target component from an encrypted storage area, and calculating a calculated measurement value corresponding to the target component; when the calculated measurement value is consistent with the target trusted measurement value, determining that the trusted verification status of the target component is trusted; when the trusted verification status of each component of the extended trust chain is all trusted, obtaining the upgrade package.

[0013] Optionally, the upgrade package is trusted to upgrade the embedded device, including: determining the verification device identifier contained in the upgrade package and obtaining the target device identifier corresponding to the embedded device; when the verification device identifier is consistent with the target device identifier, upgrading the embedded device based on the upgrade package.

[0014] Optionally, upgrading the embedded device based on the upgrade package includes: determining a target checksum value corresponding to the upgrade package; taking the partitions to be upgraded in the upgrade package as target upgrade partitions in turn, and generating a backup image partition based on the target upgrade partitions; copying the upgrade package to the target upgrade partition, and calculating a calculated checksum value of the target upgrade partition; determining whether the target checksum value is consistent with the calculated checksum value, and if so, restarting the device and running the target upgrade partition; otherwise, running the backup image partition.

[0015] According to another aspect of the present invention, there is provided an embedded device upgrading device, the device comprising:

[0016] A partition division module, used for partitioning the embedded device to generate partition modules, wherein the partition module includes a dynamic adjustment area, a solidifiable area, a low update frequency area and a high update frequency area;

[0017] A trust chain construction and extension module, used to construct a trust chain according to each partition module through a trusted cryptographic module, and to extend the trust chain to generate an extended trust chain;

[0018] The device upgrade module is used to perform a trust measurement on the extended trust chain to obtain an upgrade package, and perform a trust measurement on the upgrade package to upgrade the embedded device.

[0019] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0020] at least one processor;

[0021] and a memory communicatively coupled to the at least one processor;

[0022] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute an embedded device upgrade method described in any embodiment of the present invention.

[0023] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement an embedded device upgrade method described in any embodiment of the present invention when executed.

[0024] The technical solution of the embodiment of the present invention can clarify the areas with different functions and update requirements through partition division, improve the management efficiency of device resources, and enable each partition to be optimized and maintained more targeted. A complete trust path is established from device startup to each partition module, ensuring the credibility of the initial environment of device operation and subsequent operations. The security coverage of the entire system is enhanced by expanding the trust chain, reducing the risk of malicious attacks and tampering, and rolling back when the upgrade fails, so that the device can continue to maintain good performance and security.

[0025] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0027] Figure 1 is a flow chart of an embedded device upgrade method provided according to Embodiment 1 of the present invention;

[0028] Figure 2is a structural diagram of an embedded device partition module provided according to Embodiment 1 of the present invention;

[0029] Figure 3 is a flowchart of another embedded device upgrade method provided according to Embodiment 2 of the present invention;

[0030] Figure 4 is a schematic diagram of a dynamic partition adjustment and upgrade process provided according to Embodiment 2 of the present invention;

[0031] Figure 5 is a schematic diagram of a componentized upgrade process provided according to Embodiment 2 of the present invention;

[0032] Figure 6 is a structural schematic diagram of an embedded device upgrading device provided according to Embodiment 3 of the present invention;

[0033] Figure 7 It is a structural schematic diagram of an electronic device for implementing an embedded device upgrading method according to an embodiment of the present invention. DETAILED DESCRIPTION

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

[0035] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0036] Embodiment 1

[0037] Figure 1A flowchart of an embedded device upgrade method is provided for the first embodiment of the present invention. This embodiment is applicable to the case of OTA upgrade of embedded devices. The method can be executed by an embedded device upgrade device. The embedded device upgrade device can be implemented in the form of hardware and / or software. The embedded device upgrade device can be configured in a computer controller. Figure 1 As shown, the method includes:

[0038] S110, partitioning the embedded device to generate partition modules, wherein the partition modules include a dynamic adjustment area, a solidifiable area, a low update frequency area, and a high update frequency area.

[0039] Among them, the partition module refers to an independent area with specific functions and characteristics formed after partition division. The partition module includes a solidified area, a low update frequency area, and a high update frequency area. The solidified area refers to the area of ​​programs and data stored in the device that are solidified or rarely changed, such as the boot code of the device. The low update frequency area is used to store programs, configurations or data with relatively low update frequency. The high update frequency area refers to an area that often needs to be updated and stores programs or data that are updated more frequently. Partitioning in embedded devices is to more effectively manage and protect the different functions and data of the device.

[0040] Optionally, the embedded device is partitioned to generate partition modules, including: taking a designated area of ​​the embedded device as a dynamic adjustment area, and determining the solidification of each functional component of the embedded device; dividing the functional components with solidification into solidifiable areas, and taking the functional components with non-solidification as components to be divided; determining the update frequency of each component to be divided; judging whether the update frequency is greater than a preset frequency, and if so, dividing the component to be divided into a high update frequency area; otherwise, dividing the component to be divided into a low update frequency area.

[0041] Specifically, when partitioning embedded devices, it is necessary to first determine the solidification of each functional component. For example, the functions and logic of some basic hardware drivers or boot programs are fixed and unchanged, so they are considered to have solidification characteristics. For functional components with solidification, they can be divided into solidification areas, while for functional components with non-solidification, their update frequency needs to be further determined. This can be achieved by monitoring and counting the number of updates of each component to be divided within a certain period of time or estimating it based on its functional characteristics and usage scenarios.

[0042] Furthermore, when it is determined that the update frequency of a component to be divided is greater than the preset frequency, it is divided into a high update frequency area. The preset frequency is a threshold value set based on factors such as device performance, storage resources, and system requirements for real-time performance and flexibility. For example, if an application needs to frequently receive new data and process and update it, and its update frequency exceeds the preset frequency, it will be divided into a high update frequency area. If the update frequency of the component to be divided is less than or equal to the preset frequency, it will be divided into a low update frequency area.

[0043] In a specific implementation, the partition module may also include an SD card external storage area. The flash dynamically adjusts the partition and the SD card external storage area will dynamically download and adjust the upgrade package according to different upgrade strategies. The flash dynamic adjustment area is set to 30M. When the update component is larger than 30M, the SD card external storage area will be used to support the update space adjustment.

[0044] In a specific embodiment, Figure 2 A schematic diagram of the structure of an embedded device partition module is provided for the first embodiment of the present invention. Figure 2 Specifically, it includes:

[0045] 1. Solidifiable area: For the images, files, libraries and other contents in the partition, whether they are frequently changed during user use, the partitions are divided. Among them, the system startup partition will not be changed after adding the trust measurement, so it is defined as a solidifiable area. The content of this area partition will not be upgraded or modified during the OTA upgrade. BL1: It is the root of all trust. It is generally a boot loader code solidified in ROM, used to boot BL2, and verify the signature of BL2 to ensure trusted execution. BL2: It is generally a trusted secure boot code in flash. Its trust is based on the verification of BL1. It mainly completes some platform-related initialization, such as DDR initialization, and looks for BL31 or BL33 for execution after initialization. If BL31 is found, BL33 will not be called. If there is no BL31, BL33 must be there. BL31: BL31 is not a one-time operation like BL1 and BL2. It exists as the last trusted firmware. When the system is running, it triggers the system management controller in the hardware in software through the smc instruction, so as to realize the management and control of the system, call the system security service of EL3 or switch between Secure World and Non-Secure World. After completing the initialization of BL31, it will look for BL32 or BL33 for signature verification and loading and execution. BL32: OPTee OS+security app, it is a trusted and secure OS running in EL1 and starting the trusted APP (the above-mentioned fingerprint verification app, etc.) in EL0, and after the Trust OS is finished running, it returns to BL31 through the smc instruction, and BL31 switches to the Non-Seucre World to continue executing BL33; BL33: non-secure firmware, starting the Linux kernel; it should be noted that the above partitions are all related to system startup, and will be verified by the trusted cryptographic module for startup measurement. This is not within the scope of the claims of the present invention, and will not be described in detail. It will be implemented according to the trusted computing standard startup measurement process. Since the boot partition has been trusted, any change in the content will result in a startup failure. Therefore, the above partitions can be solidified and will not be upgraded during the OTA upgrade.

[0046] 2. Low update frequency area: Except for the system boot partition, the system basic services, operating environment, public third-party libraries and other related partitions are not included in the trusted boot process. They are updated under special conditions, such as system updates, vulnerability upgrades, license authorization, etc., with a low frequency. Kernel partition: The kernel partition is used to store the Linux kernel image and related startup files. This partition will also perform partition verification when BL33 starts the kernel, but the kernel will also be upgraded due to system upgrades and vulnerability updates. The frequency is low, less than 30M. Env partition: Stores the boot environment image emmc.image, less than 30M. Rootfs partition: The partition of the root file system, which contains a complete operating system and basic system services. It usually contains directories such as / bin, / sbin, / lib, / etc, / usr, etc., and the public part is included in this partition. Since most libraries and public dependencies are stored in this partition, the size may be greater than 30M. It will be dynamically adjusted during OTA upgrades and use external storage SD for upgrades. OEM partition: Mainly contains license, customized manufacturer information, serial number and other information, less than 1M.

[0047] 3. High update frequency area: Business applications will change frequently due to functional changes and upgrades, and are used as high update frequency areas. APP partition: storage partition for functional modules of all applications. Video application partition: video application component module, less than 30M. Audio application partition: audio application component module, less than 30M. Recording application partition: recording application component module, less than 30M. PTZ application partition: PTZ application component module, less than 30M. Network application partition: network application component module, less than 30M. If it is larger than 30M, the dependent library and dependent service components are split to ensure that it is less than 30M, and A / B backup upgrades can be performed in the flash dynamic adjustment area. If it cannot be split larger than 30M, the SD card external storage area is used for upgrade. Data partition: storage partition for configuration files, application data, and log data of the corresponding application. Video data partition: contains configuration information such as bit rate, frame rate, encoding, image quality, and abnormal log information. Audio data partition: contains configuration information such as bit rate, channel, volume, and abnormal log information. Video data partition: contains configuration information such as bit rate, frame rate, encoding, image quality, video storage time, and abnormal log information. PTZ data partition: contains configuration information such as rotation speed, favorite points, cruise, and abnormal log information. Network data partition: contains network configuration information and abnormal log information.

[0048] 4. Flash dynamic adjustment area: allocate 512 bytes + 30M space size: the first 512 bytes are used to write the error flags and upgrade process stage information misc.info file during the OTA upgrade process; the last 30M is used to store the A / B backup during the OTA process. When upgrading the entire amount or upgrading the module components exceeding 30M, it is necessary to borrow the external storage area of ​​128M of the SD card for upgrading.

[0049] In a specific implementation, the misc.info file may include multiple parameters, for example, SN: device unique code, corresponding to the task of the OTA upgrade package this time, during the upgrade process, it is necessary to first check whether the SN unique code in the package is consistent with the current device. For the specific process, see Figure 5Module componentized OTA upgrade process. ProductKey: The production key is the production verification key for this upgrade, which is used to generate the SM3_HMAC or SM2 signature value of the msic.info file. The key scheme can be selected by yourself: asymmetric key generates and verifies the SM2 signature value, and symmetric key generates and verifies the SM3_HMAC. Hardware verification is performed based on the algorithm capabilities provided by the trusted cryptographic module. deviceName: The device name and SN are used together for matching detection of this upgrade. deviceSecret: The device key is the encryption key for the content of the module list of this upgrade, using the SM4 symmetric encryption algorithm. subModulesList: Module component dependency list, one module can be upgraded at a time, or multiple modules can be upgraded at the same time according to the package size. Parse according to a single module, and upgrade another after one is upgraded. Mmodule1: Module 1 included in this upgrade. HWVersion: Hardware version, the hardware version applicable to this upgrade package, needs to be compared with the push device for compatibility. SWVersion: Software version, used to verify the version of the target upgrade device and the current upgrade package version size, used to determine whether to upgrade. DataVersion: data version, used to assist in confirming the versions of related data, configurations, internal structures, and internal databases to determine whether the data-related components need to be stopped. ModuleName: the name of the module for this upgrade. Taking the gimbal service as an example, it belongs to the swanlink subsystem module, the gimbal component peripheral_lite, the service name is peripheralsvr, and the file path is / storage / app / bin / peripheralsvr. APDU_Start: module service start instruction, the corresponding service needs to be started and the component function starts. APDU_Stop module service stop instruction, the corresponding component function needs to be stopped and the service ends. isNeedRestart: whether a restart flag is required, whether the corresponding module needs to be restarted to complete the overall upgrade. There are currently few modules of this type, and the associated services and dependencies have been stopped and suspended during the upgrade. This item is a reserved item. OTAStepFlag: upgrade progress flag, Figure 2 The flag will be written in this file during the process to mark the current upgrade stage. The last 64 bytes do not have a tag in order to reduce space consumption. If ProductKey is 64 bytes, this position is the SM2 signature value (size 64 bytes); if ProductKey is 16 bytes, the first 32 bytes of this position are the SM3_HMAC value. It is used to verify the integrity of msic.info.

[0050] 5. SD card external storage area: This partition will be used for upgrades when the flash dynamic adjustment area is not enough.

[0051] S120: construct a trust chain according to each partition module through a trusted cryptographic module, and extend the trust chain to generate an extended trust chain.

[0052] Among them, the trusted cryptographic module is a security chip integrated in the device, which is used to provide security functions such as cryptographic operations and key management to ensure the credibility and security of the device. The trust chain refers to a trust path formed by verifying and transferring trust relationships step by step starting from the initial trust point of the device. Extending the trust chain means further expanding the scope of trust coverage on the basis of the original trust chain.

[0053] Specifically, the trusted cryptographic module can build a trust chain for each partition module based on cryptographic principles. The construction of the trust chain starts from the lowest trusted part of the device, and then gradually expands upward to ensure the trustworthiness of each link. The reliability of each link in the trust chain depends on the trustworthiness of the previous link, thus forming a complete trust transfer path. The purpose of expanding the trust chain is to cover more partition modules and functions and increase the trust scope of the entire system. Through expansion, new partition modules can be included in the trust system to ensure the security and reliability of the entire system.

[0054] Optionally, a trust chain is constructed according to each partition module through a trusted cryptographic module, and the trust chain is extended to generate an extended trust chain, including: constructing a trust chain according to each component of the solidifiable area through a trusted cryptographic module; obtaining the application service components to be extended, and performing business process extension on the trust chain based on each application service component to generate an extended trust chain.

[0055] Specifically, the trusted cryptographic module will create a starting point of trust based on each component in the solidified area, starting from highly trusted components and gradually building a chain of trust relationships. With the continuous enrichment of device functions and the expansion of application scenarios, the trust chain needs to be expanded to cover more application service components.

[0056] In a specific implementation, the extended partition measurement trust chain can be measured from the kernel backward to the env partition, the rootfs partition, and the OEM partition. The env partition usually stores the system's environment configuration information, the rootfs partition contains the system's core files and directory structure, and the OEM partition may contain the device manufacturer's specific configuration and data. Measuring these partitions can ensure the security and integrity of the system's key data and prevent the data in the partition from being tampered with or damaged.

[0057] In a specific implementation, extending the partition metric trust chain can extend the application service trust chain, covering the init component, upgrade detection service, updater.img, powerctrl service, downloadProgress download upgrade package service, upgrade upgrade service, upgrade package verification, upgrade erase partition service and partition upgrade completion detection service.

[0058] Among them, the Init component is mainly responsible for misc.info configuration detection. It will read the boot_updater information to distinguish whether it is a full upgrade or a component upgrade, and obtain the information of the upgrade component to prepare for the upgrade. The upgrade detection service performs trust measurement on the upgrade subsystem image updater.img, the power control service powertrl, and the download upgrade installation package service. And the module information of this upgrade, the CRC (cyclic redundancy check code) of the upgrade package, and the upgrade process flag will be written into misc.info. The download upgrade installation package service is responsible for starting the download of the upgrade package. During the download process, the upgrade service will also perform trust measurement to ensure the smooth progress of the subsequent upgrade process. The Upgrade service will perform trust measurement on the upgrade package verification service. Then, prepare to start the componentized A / B partition flash dynamic adjustment upgrade. Through dynamic adjustment, the impact on the normal operation of the system can be minimized during the upgrade process. The upgrade package verification service performs trusted identity authentication on the upgrade package, and can verify the signature and digest value of the upgrade package through the trusted root, thereby ensuring the authenticity, integrity, and security of the upgrade package. According to the upgrade module, the stop function and stop service instructions are parsed, and the upgrade erase partition service is trusted. At the same time, the instructions, erase offsets, and data packets are passed to subsequent services. The upgrade erase partition service performs a trust measurement on the partition upgrade completion verification service. According to the incoming module control instructions, erase offsets, and data packets, the module control instructions are first executed to stop the functions and services of the corresponding modules and components, and then the upgrade data packet is written according to the erase offset to ensure accurate data writing. The partition upgrade completion verification service will compare and verify the upgrade package CRC stored in misc.info with the CRC of the upgraded partition. Only after the verification is successful, the OTA upgrade content detection completion mark will be written in the corresponding area, indicating that the upgrade is successful and the data is complete and reliable.

[0059] Optionally, after extending the trust chain to generate an extended trust chain, the method further includes: determining a trust measurement value corresponding to each component in the extended trust chain, and storing the trust measurement value in an encrypted storage area of ​​the trusted cryptographic module.

[0060] Specifically, the device will also determine the trust metric values ​​corresponding to each component in the extended trust chain. For example, for software components, factors such as code integrity, source reliability, and whether authorized signature authentication may be considered; for hardware components, the reputation of the manufacturer and whether it has passed relevant quality inspection standards may be evaluated. Through the evaluation, a value that reflects the degree of trustworthiness can be generated for each component, namely the trust metric value. These trust metric values ​​are then stored in the encrypted storage area of ​​the trusted cryptographic module. The trusted cryptographic module has a high degree of security and encryption protection mechanism, which can ensure that these important data are not accessed or tampered with without authorization.

[0061] S130: Perform a trust measurement on the extended trust chain to obtain an upgrade package, and perform a trust measurement on the upgrade package to upgrade the embedded device.

[0062] Trust measurement refers to the process of evaluating and measuring the extended trust chain through a preset method to determine whether it is trustworthy. Upgrade refers to the use of Over-the-Air Technology (OTA), that is, upgrading the firmware or software of embedded devices through wireless communication. Upgrade package refers to a data package containing relevant programs and data for updating and improving embedded device software, systems, etc.

[0063] Specifically, the trusted measurement is to determine whether there is anomaly or tampering by comparing the known trusted benchmark with the actual state or data. If the trusted measurement result is as expected, the obtained upgrade package can be used to upgrade the embedded device, thereby improving and optimizing the device function while ensuring the security and reliability of the upgrade process.

[0064] Optionally, a trusted measurement is performed on the extended trust chain to obtain an upgrade package, including: taking each component of the extended trust chain as a target component in turn; obtaining a target trusted measurement value corresponding to the target component from an encrypted storage area, and calculating a calculated measurement value corresponding to the target component; when the calculated measurement value is consistent with the target trusted measurement value, determining that the trusted verification status of the target component is trusted; when the trusted verification status of each component of the extended trust chain is all trusted, obtaining the upgrade package.

[0065] Specifically, the device will conduct a credibility assessment on each component in the extended trust chain one by one, and take each component of the extended trust chain as the target component in turn, and then obtain the target credibility measurement value corresponding to the current target component from the encrypted storage area of ​​the trusted cryptographic module. At the same time, the target component is analyzed and calculated through specific algorithms and tools to obtain its corresponding calculated measurement value. When the calculated measurement value is consistent with the target credibility measurement value obtained from the encrypted storage area, it can be determined that the trusted verification of the target component is trusted. The device will perform the above credibility verification on each component in the extended trust chain. Only when the trusted verification of all components in the extended trust chain is determined to be trusted, the upgrade package will be obtained. Only by ensuring that all components in the entire extended trust chain are in a trusted state can it be ensured that the device will not introduce potential risks and security threats when upgrading, and can maximize the security and reliability of the upgrade process, and avoid system failures, data leakage or other security issues caused by an untrusted component. As a result, after obtaining the upgrade package and upgrading, the embedded device can continue to run stably and securely, and provide accurate and reliable services.

[0066] The technical solution of the embodiment of the present invention can clarify the areas with different functions and update requirements through partition division, improve the management efficiency of device resources, and enable each partition to be optimized and maintained more targeted. A complete trust path is established from device startup to each partition module, ensuring the credibility of the initial environment of device operation and subsequent operations. The security coverage of the entire system is enhanced by expanding the trust chain, reducing the risk of malicious attacks and tampering, and rolling back when the upgrade fails, so that the device can continue to maintain good performance and security.

[0067] Embodiment 2

[0068] Figure 3 This is a flowchart of an embedded device upgrade method provided in the second embodiment of the present invention. This embodiment adds a trust measurement of the upgrade package on the basis of the above-mentioned first embodiment to upgrade the specific process of the embedded device. Among them, the specific content of steps S250-S260 is roughly the same as steps S120-S130 in the first embodiment, so they will not be repeated in this embodiment. Figure 3 As shown, the method includes:

[0069] S210, partitioning the embedded device to generate partition modules, wherein the partition modules include a dynamic adjustment area, a solidifiable area, a low update frequency area, and a high update frequency area.

[0070] Optionally, the embedded device is partitioned to generate partition modules, including: taking a designated area of ​​the embedded device as a dynamic adjustment area, and determining the solidification of each functional component of the embedded device; dividing the functional components with solidification into solidifiable areas, and taking the functional components with non-solidification as components to be divided; determining the update frequency of each component to be divided; judging whether the update frequency is greater than a preset frequency, and if so, dividing the component to be divided into a high update frequency area; otherwise, dividing the component to be divided into a low update frequency area.

[0071] S220: construct a trust chain according to each partition module through a trusted cryptographic module, and extend the trust chain to generate an extended trust chain.

[0072] Optionally, a trust chain is constructed according to each partition module through a trusted cryptographic module, and the trust chain is extended to generate an extended trust chain, including: constructing a trust chain according to each component of the solidifiable area through a trusted cryptographic module; obtaining the application service components to be extended, and performing business process extension on the trust chain based on each application service component to generate an extended trust chain.

[0073] Optionally, after extending the trust chain to generate an extended trust chain, the method further includes: determining a trust measurement value corresponding to each component in the extended trust chain, and storing the trust measurement value in an encrypted storage area of ​​the trusted cryptographic module.

[0074] S230: Perform a trust measurement on the extended trust chain to obtain an upgrade package.

[0075] Optionally, a trusted measurement is performed on the extended trust chain to obtain an upgrade package, including: taking each component of the extended trust chain as a target component in turn; obtaining a target trusted measurement value corresponding to the target component from an encrypted storage area, and calculating a calculated measurement value corresponding to the target component; when the calculated measurement value is consistent with the target trusted measurement value, determining that the trusted verification status of the target component is trusted; when the trusted verification status of each component of the extended trust chain is all trusted, obtaining the upgrade package.

[0076] S240: Determine the verification device identifier included in the upgrade package, and obtain the target device identifier corresponding to the embedded device.

[0077] S250: When the verification device identifier is consistent with the target device identifier, determine a target verification value corresponding to the upgrade package.

[0078] Specifically, in the process of upgrading an embedded device, the upgrade package must first be trusted. This can be done by determining the verification device identifier contained in the upgrade package. At the same time, it is also necessary to obtain the target device identifier corresponding to the embedded device. The target device identifier is a unique identifier of the embedded device itself, which is used to compare with the verification device identifier in the upgrade package. When the verification device identifier is consistent with the target device identifier, it indicates that the obtained upgrade package corresponds to the embedded device. By verifying the upgrade package, it is possible to prevent the wrong upgrade package from being applied to an unmatched device, thereby ensuring the accuracy and security of the embedded device upgrade and minimizing the risks and losses that may be caused by upgrade errors.

[0079] S260: sequentially use the partitions to be upgraded in the upgrade package as target upgrade partitions, and generate backup image partitions according to the target upgrade partitions.

[0080] S270: Copy the upgrade package to the target upgrade partition, and calculate the calculation check value of the target upgrade partition.

[0081] S280, determine whether the target check value is consistent with the calculated check value, if so, execute S290, otherwise, execute S300.

[0082] S290, restart the device and run the target upgrade partition.

[0083] S300, run the backup image partition.

[0084] Specifically, the target checksum corresponding to the upgrade package must be determined first. The target checksum is used to verify the accuracy and integrity of the upgrade process. Then, the partitions to be upgraded in the upgrade package are used as target upgrade partitions in turn. For each selected target upgrade partition, a backup image partition needs to be generated in the dynamic adjustment area according to its specific parameters and characteristics, so that there is a guarantee of fallback when there is a problem with the upgrade. After the backup is completed, the upgrade package can be copied to the target upgrade partition, and the calculated checksum of the target upgrade partition is calculated. Then the previously determined target checksum is compared with the calculated checksum. If they are consistent, it means that the upgrade process is smooth and accurate. At this time, the device can be restarted and the upgraded target upgrade partition can be run to update and optimize the device. However, if the target checksum is inconsistent with the calculated checksum, it indicates that an abnormality may have occurred during the upgrade process. At this time, in order to ensure the normal operation of the device and the security of the data, the previously generated backup image partition will be selected to run, so that the device can be restored to the stable state before the upgrade, avoiding the device from being unable to be used normally due to an incorrect upgrade.

[0085] In a specific embodiment, Figure 4 A schematic diagram of a dynamic partition adjustment and upgrade process provided in Embodiment 2 of the present invention, Figure 4The upgrade service is used as an example to describe the upgrade process in detail. The pre-requisite trusted basic environment guarantee and upgrade package download have been completed.

[0086] Specifically, Figure 4 The following steps are performed: 1. Parse and verify the upgrade package: parse the upgrade package header, upgrade package content, signature value, and CRC checksum. Use a trusted cryptographic module to verify the identity signature to ensure the authenticity of the upgrade package source. CRC check to ensure the integrity of the upgrade package. Parse the upgrade package header to obtain whether the upgrade method is a full upgrade or a differential upgrade, obtain the upgrade module component name, and parse the component module control instructions. 2. Write misc.info information to the first 512 bytes of the flash dynamic adjustment area: component name, upgrade package CRC, upgrade mode, upgrade control instruction set, and write upgrade progress flag: upgrade preparation stage. 3. Send the parsed component control instructions: (1) Function stop (2) Service stop. 4. Write the upgrade progress flag in misc.info: upgrade starts. 5. Start A / B backup upgrade, use the flash dynamic adjustment area as the backup partition, and misc.info marks the storage area of ​​the upgrade package for dynamic adjustment. If it is less than 30M, it will be backed up in the flash dynamic adjustment area. If it is greater than 30M, it will borrow the external storage area of ​​the SD card, and update the storage offset, storage size, and CRC into misc.info. 6. Back up the target partition to be upgraded to the flash dynamic adjustment partition. According to the dynamic adjustment rules in misc.info, select, store offset, write size, and update CRC from the backup partition. 7. After the backup copy of the target partition to be upgraded is completed, the upgrade package copy process can be entered. In order to prevent power failure during the upgrade process, if the power failure causes the function module to fail, it can be restored through the backup image in the flash dynamic adjustment partition. 8. Write the upgrade progress flag in misc.info: the upgrade partition backup is completed. 9. Start the formal upgrade package copy process and write the upgrade package binary to the target upgrade partition. 10. The target partition is written. At this time, the service and function cannot be restarted to prevent the copy integrity from being problematic and causing the function module to fail. 11. Write the upgrade progress flag in misc.info: the upgrade content is written. 12. The upgrade partition integrity check begins, and the CRC value of the partition to be upgraded is calculated. 13. Read the upgrade partition CRC value in misc.info and compare it with the CRC value of the partition to be upgraded. 14. After the CRC comparison is successful, write the upgrade progress flag in misc.info: upgrade partition detection is completed. 15. If an abnormal error such as power failure occurs during the process, it is necessary to re-upgrade according to the upgrade progress flag in misc.info.

[0087] In a specific embodiment, Figure 5This is a schematic diagram of a componentized upgrade process provided by the second embodiment of the present invention. The componentized upgrade will write the relevant content of this upgrade package into the misc.info file. During the upgrade, integrity verification, matching verification, module service dependency suspension, and CRC integrity verification are performed.

[0088] Specifically, Figure 5 The following steps are performed: 1. First verify the authenticity of the upgrade package identity, integrity signature or digest value. The upgrade package is generated by the server. The differential upgrade package generation and upgrade package integrity verification scheme are not within the scope of this claim, so they are not described here. The standard method can be used. 2. Parse and verify the upgrade related information, such as the various parameters in the misc.info file. 3. Use the trusted password module to verify the upgrade information: verify whether the SN and deviceName in misc.info are consistent with the terminal to be upgraded. HWVersion: Whether the hardware version is compatible with the current upgrade package. Use deviceSecret (device key) to perform SM4 symmetric decryption on each item of subModulesList. Use the last 64 bytes of integrity verification value and productKey (production key) to verify the integrity of the plain text after misc.info is decrypted. SWVersion: Whether the software version is greater than the software version of the current device. DataVersion: Whether the data version is compatible with the upgrade package. 4. After all verifications are passed, write the upgrade related information in the misc.info file. 5. Parse the upgrade package module and start upgrading module 1. Here, according to the number of modules packaged, the upgrade is performed in batches one by one in the parsing order. 6. The individual upgrade process will still perform a consistency verification. Get the device SN and device name to see if they are consistent with the current upgrade package. If they are consistent, continue the upgrade, otherwise exit. 7. Parse the control instructions related to module 1, mainly including the instructions for pausing and starting the module service. Before upgrading, suspend the module-related dependent services, and restart them after the upgrade is completed. 8. Issue the service dependency suspension instructions related to module 1. 9. Start the upgrade service process. 10. For the upgrade service process, see Figure 4 The A / B backup upgrade process in the figure is followed by each component in this way. 11. After the corresponding module is upgraded, the trusted password module is used to verify whether the CRC of the upgraded module is consistent and whether the upgrade is complete. 12. If they are consistent, continue to parse module 2 and repeat steps 5 to 11. The upgrade is completed until all the modules to be upgraded are upgraded. 13.errorFinal: This is an upgrade exception and the error needs to be reported. 14. If you want to restart the upgrade, refer to the ErrorTreat processing method to re-upgrade.

[0089] Among them, ErrorTreat processing includes the following steps: Upgrade process management: When the flag is that the upgrade has started and the upgrade partition backup is completed, you need to re-download the upgrade package and then proceed with the upgrade process. Download the upgrade package module name and parse it from misc.info. Restart strategy: When the flag is that the upgrade content has been written, restart from step 12. Automatic detection and upgrade: When the flag is that the upgrade partition detection is completed, the last OTA upgrade is completed. It is necessary to check whether there is a next component module that needs to be upgraded, and re-download the module and upgrade process.

[0090] The technical solution of the embodiment of the present invention ensures the integrity and security of the acquired upgrade package, and prevents malicious or erroneous upgrade packages from causing damage to the device. The trusted measurement upgrade package can ensure the accuracy and reliability of the upgrade process, and reduce device failures and functional abnormalities caused by the upgrade. It helps to timely discover and eliminate potential safety hazards, so that the device can continue to maintain good performance and security. It provides security for the continuous optimization and improvement of embedded devices, and can better adapt to the ever-changing application requirements and security environment. When the upgrade fails, only the component needs to be re-upgraded, and there is no need to re-upgrade the entire system image.

[0091] Embodiment 3

[0092] Figure 6 This is a schematic diagram of the structure of an embedded device upgrade device provided by Embodiment 3 of the present invention. Figure 6 As shown, the device comprises:

[0093] A partition division module 310 is used to partition the embedded device to generate partition modules, wherein the partition modules include a dynamic adjustment area, a solidifiable area, a low update frequency area, and a high update frequency area;

[0094] A trust chain construction and extension module 320, for constructing a trust chain according to each partition module through a trusted cryptographic module, and extending the trust chain to generate an extended trust chain;

[0095] The device upgrade module 330 is used to perform a trust measurement on the extended trust chain to obtain an upgrade package, and perform a trust measurement on the upgrade package to upgrade the embedded device.

[0096] Optionally, the partition division module 310 is specifically used to: use the designated area of ​​the embedded device as a dynamic adjustment area, and determine the solidification of each functional component of the embedded device; divide the functional components with solidification into solidifiable areas, and use the functional components with non-solidification as components to be divided; determine the update frequency of each component to be divided; determine whether the update frequency is greater than the preset frequency, and if so, divide the component to be divided into a high update frequency area; otherwise, divide the component to be divided into a low update frequency area.

[0097] Optionally, the trust chain construction and extension module 320 is specifically used to: construct a trust chain according to the components of the solidifiable area through a trusted cryptographic module; obtain the application service components to be extended, and perform business process extension on the trust chain based on each application service component to generate an extended trust chain.

[0098] Optionally, the device also includes: a trusted metric value storage module, which is used to determine the trusted metric value corresponding to each component in the extended trust chain after extending the trust chain to generate an extended trust chain, and store the trusted metric value in an encrypted storage area of ​​the trusted cryptographic module.

[0099] Optionally, the device upgrade module 330 specifically includes: an upgrade package acquisition unit, which is used to: sequentially take each component of the extended trust chain as a target component; obtain a target trusted metric value corresponding to the target component from the encrypted storage area, and calculate a calculated metric value corresponding to the target component; when the calculated metric value is consistent with the target trusted metric value, determine that the trusted verification status of the target component is trusted; when the trusted verification status of each component of the extended trust chain is trusted, obtain the upgrade package.

[0100] Optionally, the device upgrade module 330 specifically includes: a device identification acquisition unit, used to: determine the verification device identification contained in the upgrade package and obtain the target device identification corresponding to the embedded device; a device upgrade unit, used to: when the verification device identification is consistent with the target device identification, upgrade the embedded device based on the upgrade package.

[0101] Optionally, the device upgrade unit is specifically used to: determine a target check value corresponding to the upgrade package; use the partitions to be upgraded in the upgrade package as target upgrade partitions in turn, and generate a backup image partition based on the target upgrade partition; copy the upgrade package to the target upgrade partition, and calculate the calculated check value of the target upgrade partition; determine whether the target check value is consistent with the calculated check value, and if so, restart the device and run the target upgrade partition; otherwise, run the backup image partition.

[0102] The technical solution of the embodiment of the present invention can clarify the areas with different functions and update requirements through partition division, improve the management efficiency of device resources, and enable each partition to be optimized and maintained more targeted. A complete trust path is established from device startup to each partition module, ensuring the credibility of the initial environment of device operation and subsequent operations. The security coverage of the entire system is enhanced by expanding the trust chain, reducing the risk of malicious attacks and tampering, and rolling back when the upgrade fails, so that the device can continue to maintain good performance and security.

[0103] An embedded device upgrade apparatus provided by an embodiment of the present invention can execute an embedded device upgrade method provided by any embodiment of the present invention, and has functional modules and beneficial effects corresponding to the execution method.

[0104] Embodiment 4

[0105] Figure 7 A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0106] like Figure 7 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0107] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0108] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as an embedded device upgrade method.

[0109] In some embodiments, an embedded device upgrade method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the embedded device upgrade method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform an embedded device upgrade method in any other appropriate manner (e.g., by means of firmware).

[0110] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0111] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0112] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0113] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0114] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0115] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of traditional physical hosts and VPS servers, which are difficult to manage and have weak business scalability.

[0116] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0117] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for upgrading an embedded device, characterized in that: include: Partitioning the embedded device to generate partition modules, wherein the partition modules include a dynamic adjustment area, a solidifiable area, a low update frequency area, and a high update frequency area; Building a trust chain according to each of the partition modules through a trusted cryptographic module, and extending the trust chain to generate an extended trust chain; The extended trust chain is trusted to obtain an upgrade package, and the upgrade package is trusted to upgrade the embedded device.

2. The method according to claim 1, characterized in that The embedded device is partitioned to generate partition modules, including: The designated area of ​​the embedded device is used as a dynamic adjustment area, and the solidification of each functional component of the embedded device is determined; Divide the functional components with curability into curable areas, and use the functional components with non-curability as components to be divided; Determining the update frequency of each of the components to be divided; Determine whether the update frequency is greater than a preset frequency, and if so, divide the component to be divided into a high update frequency area; Otherwise, the component to be divided is divided into a low update frequency area.

3. The method according to claim 1, characterized in that The step of constructing a trust chain according to each of the partition modules through a trusted cryptographic module and extending the trust chain to generate an extended trust chain includes: Building a trust chain according to the components of the curable area through a trusted cryptographic module; The application service components to be extended are obtained, and the business process of the trust chain is extended based on each of the application service components to generate an extended trust chain.

4. The method according to claim 3, characterized in that After the trust chain is extended to generate an extended trust chain, the method further includes: Determine a trust metric value corresponding to each component in the extended trust chain, and store the trust metric value in an encrypted storage area of ​​the trusted cryptographic module.

5. The method according to claim 4, characterized in that The step of performing a trustworthy measurement on the extended trust chain to obtain an upgrade package includes: Taking each component of the extended trust chain as a target component in turn; Acquire a target trusted metric value corresponding to the target component from the encrypted storage area, and calculate a calculated metric value corresponding to the target component; When the calculated metric value is consistent with the target trust metric value, determining that the trust verification status of the target component is trustworthy; When the trusted verification conditions of each component of the extended trust chain are all trusted, the upgrade package is obtained.

6. The method according to claim 1, characterized in that The performing a trust measurement on the upgrade package to upgrade the embedded device includes: Determine the verification device identifier contained in the upgrade package, and obtain the target device identifier corresponding to the embedded device; When the verification device identifier is consistent with the target device identifier, the embedded device is upgraded based on the upgrade package.

7. The method according to claim 6, characterized in that The step of upgrading the embedded device based on the upgrade package includes: Determine a target checksum corresponding to the upgrade package; The partitions to be upgraded in the upgrade package are sequentially used as target upgrade partitions, and a backup image partition is generated according to the target upgrade partitions; Copying the upgrade package to the target upgrade partition, and calculating a calculation check value of the target upgrade partition; Determine whether the target checksum value is consistent with the calculated checksum value, and if so, restart the device and run the target upgrade partition; Otherwise, the backup image partition is run.

8. An embedded device upgrade device, characterized in that: include: A partition division module, used for partitioning the embedded device to generate various partition modules, wherein the partition modules include a dynamic adjustment area, a solidifiable area, a low update frequency area and a high update frequency area; A trust chain construction and extension module, used to construct a trust chain according to each of the partition modules through a trusted cryptographic module, and to extend the trust chain to generate an extended trust chain; The device upgrade module is used to perform a trust measurement on the extended trust chain to obtain an upgrade package, and perform a trust measurement on the upgrade package to upgrade the embedded device.

9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively coupled to the at least one processor; The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the method according to any one of claims 1 to 7.

10. A computer storage medium, characterized in that: The computer storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the method according to any one of claims 1 to 7 when executed.

Citation Information

Cited By

  • Energy storage terminal remote security upgrading method and system based on end-to-end encryption

    CN120342744A

  • Energy storage terminal remote security upgrade method and system based on end-to-end encryption

    CN120342744B