Firmware loading method and device, computer system, storage medium and product

By running plaintext firmware in a computer system and decrypting key firmware ciphertext, the problem of slow firmware loading speed is solved, and a fast and accurate firmware loading process is achieved.

CN121635975APending Publication Date: 2026-03-10DAWNING INFORMATION IND (BEIJING) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-06
Publication Date
2026-03-10

AI Technical Summary

Technical Problem

The problem of slow firmware loading speed in existing technologies.

Method used

By responding to the loading command of the target firmware, the plaintext firmware is run and the key firmware ciphertext is obtained. After decryption, it is loaded, avoiding the process of moving the entire target firmware. The decrypted key firmware and plaintext firmware are then merged.

Benefits of technology

It improves firmware loading speed and efficiency, enhances loading accuracy and reliability, reduces decryption time and information volume, and ensures the accuracy of the loading process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121635975A_ABST
    Figure CN121635975A_ABST
Patent Text Reader

Abstract

The invention relates to a firmware loading method and device, a computer system, a storage medium and a product. The method comprises the following steps: in response to a loading instruction of target firmware, running plaintext firmware of the target firmware, obtaining at least one key firmware ciphertext, decrypting each key firmware ciphertext to obtain each decrypted key firmware, and loading the target firmware according to each decrypted key firmware and the plaintext firmware. Under the condition that the target firmware needs to be loaded, loading of the whole target firmware can be completed only by operating the plaintext firmware corresponding to the non-key firmware in the target firmware to load the key firmware ciphertext, and compared with loading of the whole target firmware in a traditional technology, the loading amount of information in the process is large, and the loading efficiency is high. Namely, the information amount of the key firmware ciphertext is small, so that the loading speed and efficiency of the whole target firmware can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a firmware loading method, apparatus, computer system, storage medium, and product. Background Technology

[0002] With the development of technology, computer systems are widely used in various fields. Among them, firmware plays an important role in computer systems, and is a key factor in ensuring the normal operation of computer systems, providing specific functions, and ensuring system performance and compatibility.

[0003] In related technologies, the target firmware is mainly started by loading and running the firmware to ensure the normal operation of the computer system.

[0004] However, the related technologies suffer from slow firmware loading speeds. Summary of the Invention

[0005] Therefore, it is necessary to provide a firmware loading method, apparatus, computer system, storage medium, and product to address the aforementioned technical problems, thereby improving the firmware loading speed.

[0006] In a first aspect, embodiments of this application provide a firmware loading method, the method comprising:

[0007] In response to the loading command of the target firmware, the plaintext firmware of the target firmware is run, and at least one key firmware ciphertext is obtained;

[0008] The encrypted text of each key firmware is decrypted to obtain the decrypted key firmware.

[0009] Load the target firmware based on the decrypted key firmware and plaintext firmware.

[0010] The technical solution in this application embodiment, in response to the loading command of the target firmware, runs the plaintext firmware of the target firmware and obtains at least one key firmware ciphertext. Each key firmware ciphertext is decrypted to obtain each decrypted key firmware, and the target firmware is loaded based on each decrypted key firmware and the plaintext firmware. When loading the target firmware is required, the above method only needs to load the key firmware ciphertext by running the plaintext firmware corresponding to the non-key firmware in the target firmware to complete the loading of the entire target firmware. Compared with the traditional technology of loading the entire target firmware, the amount of information loaded in this process, i.e., the amount of information in the key firmware ciphertext, is smaller, thereby improving the loading speed of the entire target firmware. Efficiency; Furthermore, the above method can decrypt only the critical firmware ciphertext. Since the amount of information in the critical firmware ciphertext is relatively small compared to the total amount of information in the target firmware, the amount of information to be decrypted can be reduced, shortening the decryption time. This can greatly improve the loading speed and efficiency of the overall target firmware. In addition, the above method loads and decrypts only the relatively small amount of information in the critical firmware ciphertext, thereby improving the accuracy of encryption and decryption, further enhancing the accuracy of the loaded target firmware. Moreover, the above method does not require moving the target firmware from one location to another when loading the target firmware, which also greatly improves the loading speed of the target firmware.

[0011] In one embodiment, obtaining at least one key firmware ciphertext includes:

[0012] For any critical firmware ciphertext, obtain the ciphertext storage address of the critical firmware ciphertext;

[0013] Based on the key firmware ciphertext identifier, extract the target storage address of the key firmware ciphertext from the ciphertext storage address;

[0014] Obtain the critical firmware ciphertext based on the target storage address of the critical firmware ciphertext.

[0015] The technical solution in this application embodiment, for any key firmware ciphertext, obtains the ciphertext storage address of the key firmware ciphertext, extracts the target storage address of the key firmware ciphertext from the ciphertext storage address based on the key firmware ciphertext identifier, and obtains the key firmware ciphertext based on the target storage address. This method can extract the target storage address of the key firmware ciphertext corresponding to the target firmware from the ciphertext storage address, thereby accurately obtaining the key firmware ciphertext corresponding to the target firmware based on the target storage address. Furthermore, the key firmware ciphertext can be read directly and quickly based on the target storage address, greatly reducing the complexity of obtaining the key firmware ciphertext. Simultaneously, this method does not require manual intervention, thus reducing errors from manual intervention and significantly improving the accuracy of the obtained key firmware ciphertext.

[0016] In one embodiment, the plaintext firmware includes key firmware invocation instructions, and obtaining at least one key firmware ciphertext includes:

[0017] For any critical firmware call instruction, if the critical firmware call instruction is detected, the corresponding critical firmware ciphertext is obtained.

[0018] In the technical solution of this application embodiment, for any critical firmware call instruction, the corresponding critical firmware ciphertext can be obtained when the critical firmware call instruction is detected. This ensures that the critical firmware call instruction can be successfully responded to and the corresponding decrypted critical firmware can be successfully loaded, thereby improving the success rate of firmware loading.

[0019] In one embodiment, loading the target firmware based on each decrypted key firmware and plaintext firmware includes:

[0020] The decrypted key firmware and plaintext firmware are merged to complete the loading of the target firmware.

[0021] The technical solution in this application embodiment can merge the decrypted key firmware and plaintext firmware to complete the loading of the target firmware. This process ensures that the firmware loading speed is improved, and the final merged firmware is the same as the original target firmware, maintaining the function of the target firmware, thereby improving the reliability and effectiveness of the merged firmware.

[0022] In one embodiment, the decrypted key firmware and plaintext firmware are merged, including:

[0023] Obtain the reserved locations of key firmware elements in the plaintext firmware;

[0024] Each decrypted key firmware is copied to the corresponding key firmware reserved location in the plaintext firmware, and the decrypted key firmware and plaintext firmware are merged.

[0025] The technical solution in this application embodiment obtains the reserved positions of each key firmware in the plaintext firmware, and copies each decrypted key firmware to the corresponding reserved position in the plaintext firmware to perform fusion between the decrypted key firmware and the plaintext firmware. The above method can quickly fuse each decrypted key firmware with the plaintext firmware by obtaining the reserved positions of each key firmware, thereby accelerating the loading speed and efficiency of the firmware. Furthermore, based on the reserved positions of each key firmware, it can copy each decrypted key firmware to the corresponding position in the plaintext firmware, thereby improving the accuracy of the firmware fusion result.

[0026] In one embodiment, obtaining the reserved locations of key firmware in the plaintext firmware includes:

[0027] Obtain the plaintext firmware configuration file of the target firmware;

[0028] Parse the plaintext firmware configuration file to obtain the code location information within it;

[0029] Based on the code location information, determine the reserved locations for each key firmware component.

[0030] The technical solution in this application embodiment obtains the plaintext firmware configuration file of the target firmware, parses the plaintext firmware configuration file, obtains the code location information in the plaintext firmware configuration file, and determines the reserved positions of each key firmware based on the code location information. The above method can obtain the reserved positions of each key firmware in the plaintext firmware based on the plaintext firmware configuration file of the target firmware, so as to provide reference information for accelerating firmware fusion in the future.

[0031] In one embodiment, the code location information includes at least one key code identifier; based on the code location information, determining the reserved locations for each key firmware component includes:

[0032] Based on at least one key code identifier of the target firmware, search for matching key code identifiers in the code location information;

[0033] The locations corresponding to the key code identifiers that match the found will be designated as the reserved locations for each key firmware.

[0034] The technical solution in this application embodiment searches for matching key code identifiers in the code location information based on at least one key code identifier of the target firmware, and searches for matching key code identifiers in the code location information based on at least one key code identifier of the target firmware. The above method can obtain the reserved positions of each key firmware by searching, thereby improving the speed and efficiency of obtaining the reserved positions of key firmware. At the same time, the above method does not require manual intervention, thereby reducing the error of manual intervention, improving the accuracy of the obtained reserved positions of key firmware, and also providing reference information for subsequent accurate fusion.

[0035] In one embodiment, before decrypting the ciphertext of each key firmware to obtain the decrypted key firmware, the method further includes:

[0036] For any critical firmware ciphertext, perform security identification on the critical firmware ciphertext;

[0037] If the security of the critical firmware ciphertext meets the standards, proceed with the step of decrypting the critical firmware ciphertext.

[0038] The technical solution in this application embodiment can perform security identification on any key firmware ciphertext. If the security of the key firmware ciphertext meets the standard, the step of decrypting the key firmware ciphertext is performed. This can ensure the correctness of the decrypted key firmware ciphertext and improve the correctness of subsequent firmware loading results.

[0039] In one embodiment, security identification of critical firmware ciphertext includes:

[0040] Digitally sign the encrypted key firmware;

[0041] If the digital signature of the critical firmware ciphertext passes, then the security of the critical firmware ciphertext is deemed to meet the standards.

[0042] If the digital signature of the critical firmware ciphertext fails, the security of the critical firmware ciphertext is deemed substandard.

[0043] The technical solution in this application embodiment performs digital signature processing on the key firmware ciphertext. If the digital signature of the key firmware ciphertext passes, it is determined that the security of the key firmware ciphertext meets the standard; if the digital signature of the key firmware ciphertext fails, it is determined that the security of the key firmware ciphertext does not meet the standard. The above method can use digital signature processing to identify the security of key firmware ciphertext. This process does not require the participation of complex algorithms, which can reduce the complexity of security identification and thus improve the speed and efficiency of security identification.

[0044] In one embodiment, the method further includes, before running the plaintext firmware of the target firmware:

[0045] Obtain at least one critical firmware and one non-critical firmware from the target firmware;

[0046] Each critical firmware element is encrypted to obtain its ciphertext, and non-critical firmware elements are compiled to obtain its plaintext firmware.

[0047] Each key firmware ciphertext and plaintext firmware is stored in a different storage address.

[0048] The technical solution in this application embodiment obtains at least one key firmware and non-key firmware from the target firmware, encrypts each key firmware to obtain its ciphertext, and compiles the non-key firmware to obtain plaintext firmware. The ciphertext and plaintext firmware are then stored in different storage addresses. This method allows for independent processing of each key firmware and non-key firmware in the target firmware. This not only ensures that subsequent loading of the target firmware can be completed by independently running the plaintext firmware corresponding to the non-key firmware, thus loading only the ciphertext of the key firmware with a smaller amount of information, improving the speed and efficiency of firmware loading, but also avoids confusion between the two by storing the ciphertext and plaintext firmware separately. Furthermore, based on obtaining each key firmware and non-key firmware in the target firmware, this method can encrypt and store only the key firmware, avoiding the slow encryption speed caused by the large amount of information when encrypting the entire target firmware. Moreover, compared to the entire target firmware, the encryption object in this method is the key firmware with a smaller amount of information, thereby improving not only the encryption speed and efficiency but also the accuracy of the encryption during the target firmware encryption process.

[0049] In one embodiment, obtaining at least one critical firmware and non-critical firmware from the target firmware includes:

[0050] The target firmware code is compiled to generate the target firmware and the location information of each type of code in the target firmware;

[0051] Based on the location information of each type of code, the critical and non-critical firmware in the target firmware are separated to obtain the critical and non-critical firmware.

[0052] The technical solution in this application embodiment compiles the target firmware code to generate the target firmware and the location information of each type of code in the target firmware. Based on the location information of each type of code, the key firmware and non-key firmware in the target firmware are separated to obtain the key firmware and non-key firmware. The above method can separate the target firmware to prepare for obtaining the ciphertext and plaintext firmware of the key firmware in the future. Moreover, the firmware separation based on the location information of each type of code in the above process can reduce the complexity of firmware separation and improve the separation speed and efficiency of key firmware and non-key firmware. At the same time, the above method can obtain the corresponding key firmware ciphertext and plaintext firmware based on the firmware separation results of the target firmware. So that when loading the target firmware in the future, the decrypted key firmware corresponding to the key firmware can be loaded indirectly by directly running the plaintext firmware, thereby improving the loading speed of the target firmware.

[0053] In one embodiment, based on the location information of each type of code, the critical and non-critical firmware in the target firmware are separated to obtain the critical and non-critical firmware, including:

[0054] Based on the location information of each type of code, obtain the location of each key firmware;

[0055] Extract the code at each key firmware location from the target firmware as each key firmware;

[0056] Remove the critical firmware from the target firmware to obtain the non-critical firmware.

[0057] The technical solution in this application embodiment obtains the location of each key firmware based on the location information of each type of code, extracts the code at each key firmware location from the target firmware as each key firmware, and deletes each key firmware from the target firmware to obtain non-key firmware. The above method can achieve firmware separation without the participation of any algorithm, thereby reducing the complexity of firmware separation, improving the speed and efficiency of firmware separation, and also improving the accuracy of firmware separation.

[0058] In one embodiment, the method further includes:

[0059] Once the locations of each critical firmware element are determined, these locations are stored in the initial configuration file to generate the plaintext firmware configuration file for the target firmware.

[0060] The technical solution in this application embodiment, after determining the location of each key firmware, can store each key firmware location in the initial configuration file to generate a plaintext firmware configuration file of the target firmware, so as to provide reference information for subsequent firmware fusion that can be quickly achieved based on the plaintext firmware configuration file. The processing is relatively simple, thereby improving the generation speed and efficiency of the plaintext firmware configuration file.

[0061] In one embodiment, the method further includes:

[0062] For any critical firmware ciphertext, if there is a need for version upgrade or fault repair, the critical firmware ciphertext is obtained and updated.

[0063] In one embodiment, updating the critical firmware ciphertext includes:

[0064] The key firmware ciphertext is decrypted to obtain the decrypted key firmware;

[0065] Modify the decrypted critical firmware to obtain the updated critical firmware;

[0066] The updated critical firmware is encrypted to obtain the new firmware ciphertext.

[0067] The technical solution in this application embodiment decrypts the key firmware ciphertext to obtain the decrypted key firmware, modifies the decrypted key firmware to obtain the updated key firmware, and encrypts the updated key firmware to obtain the new firmware ciphertext. When there is a need to upgrade or repair the key firmware ciphertext, the above method can update the key firmware ciphertext to prepare for loading a more secure corresponding key firmware group, thereby improving the security of the corresponding key firmware in subsequent applications. Simultaneously, when there is a need to update key firmware, the above method does not require updating the complete target firmware; it only needs to process the key firmware ciphertext corresponding to the key firmware to achieve the update. This results in a smaller amount of information being processed during the key firmware update process, greatly improving the loading speed of the target firmware.

[0068] In one embodiment, the critical firmware call instruction includes at least one function interface call instruction, the function interface call instruction carrying the absolute address of the corresponding function interface; the method further includes:

[0069] For any decrypted critical firmware, after the decrypted critical firmware and plaintext firmware are merged, the system jumps sequentially to the starting position of each function interface according to each absolute address and runs each function in the decrypted critical firmware to start the target firmware.

[0070] In the technical solution of this application embodiment, for any decrypted critical firmware, after the fusion of the decrypted critical firmware and the plaintext firmware is completed, the system jumps sequentially to the starting position of each function interface according to each absolute address and runs each function in the decrypted critical firmware to start the target firmware. The above method can start and run each function in the decrypted critical firmware according to actual application requirements to ensure the correctness of the functions implemented by the decrypted critical firmware and the reliability of the decrypted critical firmware. At the same time, the above method can directly call each function according to the absolute address of the function interface of each function in the decrypted critical firmware, which can speed up the startup speed of the target firmware.

[0071] Secondly, embodiments of this application also provide a firmware loading device, the device comprising:

[0072] The acquisition module is used to respond to the loading command of the target firmware, run the plaintext firmware of the target firmware, and acquire at least one key firmware ciphertext.

[0073] The decryption module is used to decrypt the ciphertext of each key firmware to obtain the decrypted key firmware.

[0074] The loading module is used to load the target firmware based on the decrypted key firmware and plaintext firmware.

[0075] Thirdly, embodiments of this application also provide a computer system, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the steps of the method in any of the embodiments of the first aspect described above.

[0076] Fourthly, embodiments of this application also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the method in any of the embodiments of the first aspect described above.

[0077] Fifthly, embodiments of this application also provide a computer program product, which includes a computer program that, when executed by a processor, implements the steps of the method in any of the embodiments of the first aspect described above.

[0078] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this application more obvious and understandable, the following are specific embodiments of this application. Attached Figure Description

[0079] Figure 1 This is a flowchart illustrating a firmware loading method in one embodiment;

[0080] Figure 2 This is a flowchart illustrating the firmware loading method in another embodiment;

[0081] Figure 3 This is a flowchart illustrating the firmware loading method in another embodiment;

[0082] Figure 4 This is a flowchart illustrating the firmware loading method in another embodiment;

[0083] Figure 5 This is a flowchart illustrating the firmware loading method in another embodiment;

[0084] Figure 6 This is a flowchart illustrating the firmware loading method in another embodiment;

[0085] Figure 7 This is a flowchart illustrating the firmware loading method in another embodiment;

[0086] Figure 8 This is a flowchart illustrating the firmware loading method in another embodiment;

[0087] Figure 9 This is a flowchart illustrating the firmware loading method in another embodiment;

[0088] Figure 10This is a flowchart illustrating the firmware loading method in another embodiment;

[0089] Figure 11 This is a flowchart illustrating the firmware loading method in another embodiment;

[0090] Figure 12 This is a structural block diagram of a firmware loading device in one embodiment;

[0091] Figure 13 This is an internal structure diagram of a computer system in one embodiment. Detailed Implementation

[0092] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0093] In the field of computer technology, computer systems (such as computer systems or embedded devices) typically store multiple firmware files, each implementing its own functions. In related technologies, during the power-on startup process of a computer system, each firmware file needs to be started, and each firmware file must first be loaded before running to complete its startup. However, related technologies suffer from slow firmware loading speeds. Therefore, this application provides a firmware loading method that improves the firmware loading speed.

[0094] The firmware loading method provided in this application embodiment can be applied to computer systems. Optionally, the computer system can be, but is not limited to, an embedded device or a computer device; the embedded device can be, but is not limited to, a field-programmable gate array, a router, a digital signal processor, a microcontroller, or a system-on-a-chip, etc.; the computer device can be a television, a smartphone, a smartwatch, a smart bracelet, a personal computer, a laptop, a desktop computer, or a tablet computer. This embodiment does not limit the specific form of the computer system. The following embodiment of this application uses a computer system as the execution subject of the firmware loading method to describe the specific process of the firmware loading method.

[0095] like Figure 1 The diagram shown is a flowchart of the firmware loading method provided in this application embodiment. This method can be implemented through the following steps:

[0096] S100: In response to the loading command of the target firmware, run the plaintext firmware of the target firmware and obtain at least one key firmware ciphertext.

[0097] In practical applications, the computer system can receive and respond to the loading command for the target firmware, and then obtain the target firmware from locations such as the cloud, local storage, disk, or hard drive. Optionally, the encryption command for the target firmware can be indirectly input via voice, buttons, knobs, keyboard, gestures, etc., or it can be automatically triggered.

[0098] It should be noted that the target firmware mentioned above may include, but is not limited to, router firmware, printer firmware, mobile phone firmware, TV firmware, computer firmware, Basic Input Output System (BIOS), Unified Extensible Firmware Interface (UEFI), and Board Management Controller (BMC). Optionally, the target firmware mentioned above may include at least one critical firmware and one non-critical firmware.

[0099] It should be noted that non-critical firmware is placed first in the target firmware or in the order of execution, while critical firmware is placed later in the target firmware or in the order of execution; alternatively, critical firmware can be interspersed among non-critical firmware. Optionally, the aforementioned critical firmware can be firmware containing sensitive information (such as keys, functional algorithms, key configuration parameters, etc.).

[0100] In practical applications, after a computer system powers on, it can either directly and automatically respond to the target firmware loading command, or indirectly and automatically respond to it. Furthermore, after responding to the target firmware loading command, it can obtain the corresponding plaintext firmware and run it.

[0101] It should be noted that the plaintext firmware corresponding to the target firmware is not the non-critical firmware within the target firmware, but rather the undecrypted corresponding firmware obtained from the non-critical firmware, i.e., the plaintext firmware. It should also be noted that the aforementioned plaintext firmware can be pre-loaded into the computer system's memory or other storage devices.

[0102] In addition, the aforementioned plaintext firmware may be generated by compiling, modifying, configuring, and / or adding non-critical firmware in the target firmware; the plaintext firmware may include critical firmware calling instructions corresponding to each critical firmware in the target firmware.

[0103] Specifically, during the execution of plaintext firmware, the computer system can obtain the ciphertext of key firmware corresponding to each key firmware in the target firmware. Optionally, the aforementioned ciphertext of key firmware can be generated after compiling, modifying, configuring, encrypting, and / or adding to the key firmware; in this embodiment, the ciphertext of key firmware is obtained by encrypting key firmware that has been pre-separated from the target firmware. Since the key firmware is only a part of the target firmware, the amount of information in the key firmware is less than the amount of information in the target firmware.

[0104] S200: Decrypt the ciphertext of each key firmware to obtain the decrypted key firmware.

[0105] Specifically, for any given critical firmware ciphertext, the computer system can use a firmware decryption tool to decrypt the obtained ciphertext and obtain the decrypted critical firmware. Alternatively, the computer system can also use asymmetric or symmetric decryption algorithms to decrypt the obtained critical firmware ciphertext and obtain the decrypted critical firmware.

[0106] Optionally, the aforementioned asymmetric decryption algorithm can be elliptic curve cryptography, digital signature algorithms, key exchange protocol algorithms, and / or knapsack algorithms, etc.; the aforementioned symmetric decryption algorithm can be block cipher decryption algorithms, variable key length-based decryption algorithms, and / or symmetric block decryption algorithms, etc. Furthermore, the decrypted critical firmware corresponding to the aforementioned critical firmware ciphertext can be the same as or slightly different from the critical firmware, but functionally identical.

[0107] S300: Load the target firmware based on the decrypted key firmware and plaintext firmware.

[0108] Specifically, the computer system can pre-train an algorithm model, and then input both the decrypted key firmware and the plaintext firmware into the algorithm model. The algorithm model outputs the dependency information for firmware loading, and the target firmware is loaded according to the dependency information. Optionally, the aforementioned dependency information can be the running order or running time of each decrypted key firmware.

[0109] The technical solution in this application embodiment, in response to the loading command of the target firmware, runs the plaintext firmware of the target firmware and obtains at least one key firmware ciphertext. Each key firmware ciphertext is decrypted to obtain each decrypted key firmware, and the target firmware is loaded based on each decrypted key firmware and the plaintext firmware. When loading the target firmware is required, the above method only needs to load the key firmware ciphertext by running the plaintext firmware corresponding to the non-key firmware in the target firmware to complete the loading of the entire target firmware. Compared with the traditional technology of loading the entire target firmware, the amount of information loaded in this process, i.e., the amount of information in the key firmware ciphertext, is smaller, thereby improving the loading speed of the entire target firmware. Efficiency; Furthermore, the above method can decrypt only the critical firmware ciphertext. Since the amount of information in the critical firmware ciphertext is relatively small compared to the total amount of information in the target firmware, the amount of information to be decrypted can be reduced, shortening the decryption time. This can greatly improve the loading speed and efficiency of the overall target firmware. In addition, the above method loads and decrypts only the relatively small amount of information in the critical firmware ciphertext, thereby improving the accuracy of encryption and decryption, further enhancing the accuracy of the loaded target firmware. Moreover, the above method does not require moving the target firmware from one location to another when loading the target firmware, which also greatly improves the loading speed of the target firmware.

[0110] The process of obtaining at least one key firmware ciphertext described above is explained below. In one embodiment, as... Figure 2 As shown, the step of obtaining at least one key firmware ciphertext in S100 above can be implemented in the following way:

[0111] S110. For any critical firmware ciphertext, obtain the ciphertext storage address of the critical firmware ciphertext.

[0112] Specifically, for any critical firmware ciphertext, the computer system can obtain the ciphertext storage address of the critical firmware ciphertext from locations such as the cloud, local, disk, or hard drive.

[0113] In practical applications, computer systems can employ information extraction algorithms to extract information from the plaintext firmware configuration file of the target firmware, obtain the storage addresses of each key firmware element within the plaintext firmware configuration file, and determine the storage address of each key firmware element as the ciphertext storage address of the corresponding key firmware ciphertext. Optionally, the aforementioned information extraction algorithm can be a regular expression method, a word segmentation algorithm, a statistical method, an information extraction template matching method, etc.

[0114] Alternatively, the computer system can pre-train an information acquisition model, then input the plaintext firmware configuration file into the model. The model outputs the storage addresses corresponding to each key firmware element within the plaintext firmware configuration file, and determines the storage address of each key firmware element as the ciphertext storage address of the corresponding key firmware ciphertext. Optionally, the aforementioned information acquisition model can be at least one of the following: a convolutional neural network model, a fully connected neural network model, a long short-term memory neural network model, a residual neural network model, and a recurrent recurrent neural network model.

[0115] S120. Based on the key firmware ciphertext identifier, extract the target storage address of the key firmware ciphertext from the ciphertext storage address.

[0116] In practical applications, the plaintext firmware configuration file can store the storage addresses of the ciphertext of multiple critical firmware components corresponding to key firmware components in the target firmware. In this case, the ciphertext storage address of the obtained ciphertext of the critical firmware can be determined as the target storage address of that critical firmware ciphertext.

[0117] The aforementioned plaintext firmware configuration file can store the storage addresses of ciphertext for multiple key firmware components across different firmware versions. In this case, for any key firmware component, the ciphertext identifier of the key firmware component in the target firmware can be found within the ciphertext identifier carried in the ciphertext storage address. The storage address corresponding to the matched key firmware ciphertext identifier in the ciphertext storage address is then determined as the target storage address for the key firmware ciphertext. Optionally, the aforementioned ciphertext storage address may include a correspondence between different ciphertext identifiers and different storage addresses.

[0118] In this embodiment of the application, an information extraction algorithm can be used to extract information from the encrypted storage address, obtain the key firmware encrypted identifier from the encrypted storage address, and determine the storage address in the encrypted storage address that matches the key firmware encrypted identifier as the target storage address of the key firmware encrypted text, so as to complete the extraction of the target storage address of the key firmware encrypted text from the encrypted storage address.

[0119] S130. Obtain the key firmware ciphertext based on the target storage address of the key firmware ciphertext.

[0120] Furthermore, based on the target storage address of the key firmware ciphertext obtained in the previous steps, the key firmware ciphertext can be read from the target storage address.

[0121] The technical solution in this application embodiment, for any key firmware ciphertext, obtains the ciphertext storage address of the key firmware ciphertext, extracts the target storage address of the key firmware ciphertext from the ciphertext storage address based on the key firmware ciphertext identifier, and obtains the key firmware ciphertext based on the target storage address. This method can extract the target storage address of the key firmware ciphertext corresponding to the target firmware from the ciphertext storage address, thereby accurately obtaining the key firmware ciphertext corresponding to the target firmware based on the target storage address. Furthermore, the key firmware ciphertext can be read directly and quickly based on the target storage address, greatly reducing the complexity of obtaining the key firmware ciphertext. Simultaneously, this method does not require manual intervention, thus reducing errors from manual intervention and significantly improving the accuracy of the obtained key firmware ciphertext.

[0122] In one embodiment, the plaintext firmware includes key firmware calling instructions. Obtaining at least one key firmware ciphertext may include: for any key firmware calling instruction, if the key firmware calling instruction is detected, obtaining the corresponding key firmware ciphertext.

[0123] It should be noted that the plaintext firmware may include the calling instructions corresponding to each critical firmware in the target firmware, i.e., the critical firmware calling instructions. In practical applications, different critical firmwares may be located at intervals in the target firmware, and correspondingly, the critical firmware calling instructions may be located at different, non-contiguous positions in the plaintext firmware.

[0124] Specifically, during the execution of the plaintext firmware of the target firmware, the corresponding ciphertext of the key firmware can be obtained whenever a key firmware call instruction is detected.

[0125] Specifically, for any critical firmware call instruction, if the critical firmware call instruction corresponding to the critical firmware is detected, that is, if the previous line of instruction in the plaintext firmware is executed.

[0126] In the technical solution of this application embodiment, for any critical firmware call instruction, the corresponding critical firmware ciphertext can be obtained when the critical firmware call instruction is detected. This ensures that the critical firmware call instruction can be successfully responded to and the corresponding decrypted critical firmware can be successfully loaded, thereby improving the success rate of firmware loading.

[0127] The process of loading the target firmware based on the decrypted key firmware and plaintext firmware described above will be explained below. In one embodiment, the steps in S300 above may include: merging the decrypted key firmware and plaintext firmware to complete the loading of the target firmware.

[0128] In practical applications, once a decrypted key firmware is obtained, the computer system can merge the decrypted key firmware and the plaintext firmware until the instructions in the plaintext firmware are executed, thus completing the fusion of all decrypted key firmware and plaintext firmware (i.e., loading the target firmware).

[0129] In this embodiment, during the plaintext firmware operation, after the final decryption and fusion of the critical firmware and the plaintext firmware, the fused firmware can be referred to as the target firmware. In this embodiment, the fusion is termed seamless fusion, meaning that multiple seamless fusions during the plaintext firmware operation yield the complete target firmware. Specifically, this embodiment uses seamless fusion technology to ensure that after fusion, the positions of each critical and non-critical firmware component in the fused firmware are identical to their corresponding positions in the original target firmware.

[0130] The technical solution in this application embodiment can merge the decrypted key firmware and plaintext firmware to complete the loading of the target firmware. This process ensures that the firmware loading speed is improved, and the final merged firmware is the same as the original target firmware, maintaining the function of the target firmware, thereby improving the reliability and effectiveness of the merged firmware.

[0131] In one embodiment, such as Figure 3 As shown, the steps described above for merging the decrypted key firmware and plaintext firmware can be implemented in the following way:

[0132] S310: Obtain the reserved locations of each key firmware in the plaintext firmware.

[0133] Specifically, the computer system can obtain the location of each decrypted key firmware in the plaintext firmware from the cloud, local, disk, hardware, etc., that is, the reserved location of each key firmware.

[0134] S320. Copy each decrypted key firmware to the corresponding key firmware reserved position in the plaintext firmware, and perform fusion between each decrypted key firmware and the plaintext firmware.

[0135] For any decrypted critical firmware, based on the critical firmware reserved location obtained in the previous steps, the decrypted critical firmware can be copied (i.e. moved or stored) to the corresponding critical firmware reserved location in the plaintext firmware to complete the fusion between the decrypted critical firmware and the plaintext firmware, i.e. seamless fusion.

[0136] The technical solution in this application embodiment obtains the reserved positions of each key firmware in the plaintext firmware, and copies each decrypted key firmware to the corresponding reserved position in the plaintext firmware to perform fusion between the decrypted key firmware and the plaintext firmware. The above method can quickly fuse each decrypted key firmware with the plaintext firmware by obtaining the reserved positions of each key firmware, thereby accelerating the loading speed and efficiency of the firmware. Furthermore, based on the reserved positions of each key firmware, it can copy each decrypted key firmware to the corresponding position in the plaintext firmware, thereby improving the accuracy of the firmware fusion result.

[0137] The process of obtaining the reserved locations of each key firmware element in the plaintext firmware is described below. In one embodiment, as... Figure 4 As shown, the steps in S310 above can be implemented in the following ways:

[0138] S311. Obtain the plaintext firmware configuration file of the target firmware.

[0139] The computer system can obtain the plaintext firmware configuration file of the target firmware from locations such as the cloud, local storage, disk, or hard drive. Optionally, the aforementioned plaintext firmware configuration file is generated based on the location information of various types of code obtained during the firmware separation process.

[0140] In one embodiment, the above method may further include: after determining the location of each key firmware, storing each key firmware location in an initial configuration file to generate a plaintext firmware configuration file for the target firmware.

[0141] In this embodiment, once the locations of each key firmware element are determined, these locations can be stored in the initial configuration file to generate a plaintext firmware configuration file for the target firmware. This provides reference information for subsequent firmware fusion based on the plaintext firmware configuration file. The process is relatively simple, which can also improve the generation speed and efficiency of the plaintext firmware configuration file.

[0142] S312. Parse the plaintext firmware configuration file to obtain the code location information in the plaintext firmware configuration file.

[0143] Specifically, the computer system can parse the plaintext firmware configuration file to obtain the code location information in the plaintext firmware configuration file.

[0144] In one embodiment, the plaintext firmware configuration file can be parsed by using a document parsing algorithm to obtain the code location information in the plaintext firmware configuration file.

[0145] In another embodiment, parsing the plaintext firmware configuration file can also be achieved by using a keyword extraction algorithm to extract keywords from the plaintext firmware configuration file, thereby obtaining the code location information within the plaintext firmware configuration file. Optionally, the aforementioned keyword extraction algorithm can be a statistical algorithm, a machine learning algorithm, or a graph-based algorithm, etc.

[0146] S313. Determine the reserved locations for each key firmware based on the code location information.

[0147] The code location information mentioned above can include different types of locations. Specifically, the computer system can obtain the reserved locations of each critical firmware from the code location information according to the type of reserved location of the critical firmware.

[0148] The technical solution in this application embodiment obtains the plaintext firmware configuration file of the target firmware, parses the plaintext firmware configuration file, obtains the code location information in the plaintext firmware configuration file, and determines the reserved positions of each key firmware based on the code location information. The above method can obtain the reserved positions of each key firmware in the plaintext firmware based on the plaintext firmware configuration file of the target firmware, so as to provide reference information for accelerating firmware fusion in the future.

[0149] In one embodiment, the code location information includes at least one key code identifier; such as Figure 5 As shown, the step in S313 above, which determines the reserved locations of each key firmware based on the code location information, can be implemented in the following way:

[0150] S3131. Based on at least one key code identifier of the target firmware, search for matching key code identifiers in the code location information.

[0151] In practical applications, the aforementioned code location information can include a one-to-one correspondence between different key code identifiers and their locations. The computer system can search for matching key code identifiers in the code location information based on the corresponding key code identifier of at least one key firmware component in the target firmware.

[0152] S3132. The positions corresponding to the key code identifiers that are found to match are determined as the reserved positions for each key firmware.

[0153] Furthermore, the locations corresponding to the key code identifiers that match the found code location information can be determined as the reserved locations for each key firmware.

[0154] The technical solution in this application embodiment searches for matching key code identifiers in the code location information based on at least one key code identifier of the target firmware, and searches for matching key code identifiers in the code location information based on at least one key code identifier of the target firmware. The above method can obtain the reserved positions of each key firmware by searching, thereby improving the speed and efficiency of obtaining the reserved positions of key firmware. At the same time, the above method does not require manual intervention, thereby reducing the error of manual intervention, improving the accuracy of the obtained reserved positions of key firmware, and also providing reference information for subsequent accurate fusion.

[0155] In practical applications, after obtaining the key firmware ciphertext, it can be verified first to ensure that the subsequently decrypted key firmware ciphertext is the encrypted key firmware that has not been tampered with, thereby improving the correctness of the obtained key firmware ciphertext. The following embodiment describes the process of verifying the key firmware ciphertext. In one embodiment, before performing the steps in S200 above, as follows: Figure 6 As shown, the above method may further include the following steps:

[0156] S210. For any critical firmware ciphertext, perform security identification on the critical firmware ciphertext.

[0157] In this embodiment of the application, after each acquisition of a key firmware ciphertext, the security of the key firmware ciphertext can be identified first.

[0158] In one embodiment, the method for security identification of critical firmware ciphertext can be to pre-train a firmware security identification model, then input the critical firmware ciphertext into the firmware security identification model, and the firmware security identification model outputs a security compliance result of the critical firmware ciphertext after performing security identification. Optionally, the security compliance result of the critical firmware ciphertext can include whether the critical firmware ciphertext meets the security standards or not.

[0159] Optionally, the aforementioned firmware security identification model may be composed of at least one of the following: convolutional neural network model, fully connected neural network model, recurrent recurrent neural network model, long short-term memory neural network model, residual neural network model, etc.

[0160] In another embodiment, the security identification of critical firmware ciphertext can also be achieved by detecting key characters in the critical firmware ciphertext. If key characters are present in the critical firmware ciphertext, the security of the critical firmware ciphertext is determined to be up to standard; otherwise, the security of the critical firmware ciphertext is not up to standard.

[0161] S220. If the security of the critical firmware ciphertext meets the standards, perform the step of decrypting the critical firmware ciphertext.

[0162] In practical applications, if the security of critical firmware ciphertext meets the standards, the step of decrypting the critical firmware ciphertext can be performed.

[0163] The technical solution in this application embodiment can perform security identification on any key firmware ciphertext. If the security of the key firmware ciphertext meets the standard, the step of decrypting the key firmware ciphertext is performed. This can ensure the correctness of the decrypted key firmware ciphertext and improve the correctness of subsequent firmware loading results.

[0164] In one embodiment, such as Figure 7 As shown, the step of performing security identification on critical firmware ciphertext in S210 above can be implemented in the following way:

[0165] S211. Perform digital signature processing on the key firmware ciphertext.

[0166] Specifically, a computer system can pre-train an algorithm model, and then input the key firmware ciphertext into the algorithm model, which will then perform digital signature processing on the key firmware ciphertext.

[0167] In addition, the computer system can also employ digital signature algorithms to digitally sign critical firmware ciphertext. Optionally, the aforementioned digital signature algorithm can be an asymmetric signature algorithm, an elliptic curve digital signature algorithm, etc.

[0168] S212. If the digital signature of the key firmware ciphertext passes, the security of the key firmware ciphertext is deemed to meet the standards; if the digital signature of the key firmware ciphertext fails, the security of the key firmware ciphertext is deemed to fail.

[0169] The technical solution in this application embodiment performs digital signature processing on the key firmware ciphertext. If the digital signature of the key firmware ciphertext passes, it is determined that the security of the key firmware ciphertext meets the standard; if the digital signature of the key firmware ciphertext fails, it is determined that the security of the key firmware ciphertext does not meet the standard. The above method can use digital signature processing to identify the security of key firmware ciphertext. This process does not require the participation of complex algorithms, which can reduce the complexity of security identification and thus improve the speed and efficiency of security identification.

[0170] The following describes the generation process of the encrypted and plaintext firmware for each key component of the target firmware. In one embodiment, before running the plaintext firmware of the target firmware, as follows... Figure 8 As shown, the above method may further include:

[0171] S140: Obtain at least one critical firmware and non-critical firmware from the target firmware.

[0172] Specifically, the computer system can perform code extraction processing on the target firmware to obtain at least one critical and non-critical firmware from the target firmware. Simultaneously, the computer system can also retrieve at least one critical and non-critical firmware from the target firmware from locations such as the cloud, local storage, disk, or hard drive.

[0173] S150. Encrypt each critical firmware to obtain the ciphertext of each critical firmware, and compile the non-critical firmware to obtain the plaintext firmware.

[0174] In practical applications, computer systems can use encryption algorithms to encrypt key firmware components to obtain their ciphertext. Optionally, the encryption algorithm can be a symmetric encryption algorithm or an asymmetric encryption algorithm; the asymmetric encryption algorithm can be elliptic curve cryptography, digital signature algorithms, or cryptographic exchange protocol algorithms; the symmetric encryption algorithm can be a symmetric key algorithm, data encryption algorithm, triple data encryption algorithm, advanced encryption algorithm, etc.

[0175] Simultaneously, the computer system can also invoke encryption tools to encrypt each critical firmware segment, obtaining its ciphertext. Alternatively, the computer system can input critical firmware into an encryption model, which will encrypt the critical firmware and output its ciphertext. Optionally, the aforementioned encryption model can be implemented using at least one of the following: a recurrent neural network model, a feedforward neural network model, a ciphertext convolutional neural network model, or a long short-term memory neural network model. Furthermore, the computer system can compile non-critical firmware to obtain plaintext firmware.

[0176] S160. Store the encrypted and plaintext firmware of each key firmware to different storage addresses.

[0177] Specifically, the computer system can store each key firmware ciphertext in the same storage address in its own storage space (memory or other storage), and store the plaintext firmware in another storage address in its own storage space, ensuring that each key firmware ciphertext and plaintext firmware are stored independently, and avoiding the problem of key firmware ciphertext and plaintext firmware being mixed up.

[0178] In addition, the computer system can store the encrypted and plaintext firmware of each key firmware separately on different devices to ensure that the encrypted firmware of each key firmware is stored in the same storage address and the plaintext firmware is stored in another storage address.

[0179] The technical solution in this application embodiment obtains at least one key firmware and non-key firmware from the target firmware, encrypts each key firmware to obtain its ciphertext, and compiles the non-key firmware to obtain plaintext firmware. The ciphertext and plaintext firmware are then stored in different storage addresses. This method allows for independent processing of each key firmware and non-key firmware in the target firmware. This not only ensures that subsequent loading of the target firmware can be completed by independently running the plaintext firmware corresponding to the non-key firmware, thus loading only the ciphertext of the key firmware with a smaller amount of information, improving the speed and efficiency of firmware loading, but also avoids confusion between the two by storing the ciphertext and plaintext firmware separately. Furthermore, based on obtaining each key firmware and non-key firmware in the target firmware, this method can encrypt and store only the key firmware, avoiding the slow encryption speed caused by the large amount of information when encrypting the entire target firmware. Moreover, compared to the entire target firmware, the encryption object in this method is the key firmware with a smaller amount of information, thereby improving not only the encryption speed and efficiency but also the accuracy of the encryption during the target firmware encryption process.

[0180] The process of obtaining at least one critical firmware and non-critical firmware from the target firmware is described below. In one embodiment, as... Figure 9 As shown, the steps in S140 above can be implemented in the following ways:

[0181] S141. Compile the target firmware code to generate the target firmware and the location information of each type of code in the target firmware.

[0182] It should be noted that the target firmware code mentioned above can be the original code of a pre-written target firmware. Optionally, the file link table mentioned above may include information such as the location, scope, and identifier of each critical and non-critical firmware in the target firmware, as well as the name and type of each function interface in each critical firmware.

[0183] Among them, the non-critical firmware can be obtained by compiling the non-critical code in the target firmware code; the critical firmware can be understood as obtained by compiling each critical code in the target firmware code.

[0184] Specifically, the computer system can compile the acquired target firmware code to generate the target firmware (i.e., executable code) and a file link table. Optionally, the above compilation process may include stages such as lexical analysis, syntax analysis, semantic analysis, intermediate code generation, code optimization, and target code generation.

[0185] Optionally, the file link table mentioned above may include the location information of each type of code in the target firmware; each type of code may include executable code corresponding to non-critical code (i.e., non-critical firmware) and executable code corresponding to each critical code (i.e., critical firmware).

[0186] The target firmware code can be the original firmware code, in which case it may include multiple segments of critical and non-critical code. Alternatively, the target firmware code can be firmware code obtained by optimizing the original firmware code, in which case the multiple segments of critical code in the target firmware code are grouped together. In this embodiment, the non-critical code in the target firmware code is stored first, and the critical code is stored after the non-critical code.

[0187] S142. Based on the location information of each type of code, perform firmware separation on each critical firmware and non-critical firmware in the target firmware to obtain each critical firmware and non-critical firmware.

[0188] In the embodiments of this application, the above-mentioned firmware separation can be understood as firmware stripping, firmware extraction, firmware splitting, etc.

[0189] In one implementation, the computer system can pre-train an algorithm model, and then input the location information of each type of code and the target firmware into the algorithm model. The algorithm model separates the key firmware and non-key firmware in the target firmware and outputs the key firmware and non-key firmware in sequence.

[0190] In another implementation, the computer system can perform comparison, filtering, matching and / or analysis on the target firmware based on the location information of each type of code, so as to complete the firmware separation and obtain the key and non-key firmware in the target firmware.

[0191] In the embodiments of this application, the computer system can separate each critical firmware and non-critical firmware in the target firmware from their corresponding positions in the target firmware according to the location information of each type of code, so as to complete the firmware separation and obtain each critical firmware and non-critical firmware in the target firmware.

[0192] The technical solution in this application embodiment compiles the target firmware code to generate the target firmware and the location information of each type of code in the target firmware. Based on the location information of each type of code, the key firmware and non-key firmware in the target firmware are separated to obtain the key firmware and non-key firmware. The above method can separate the target firmware to prepare for obtaining the ciphertext and plaintext firmware of the key firmware in the future. Moreover, the firmware separation based on the location information of each type of code in the above process can reduce the complexity of firmware separation and improve the separation speed and efficiency of key firmware and non-key firmware. At the same time, the above method can obtain the corresponding key firmware ciphertext and plaintext firmware based on the firmware separation results of the target firmware. So that when loading the target firmware in the future, the decrypted key firmware corresponding to the key firmware can be loaded indirectly by directly running the plaintext firmware, thereby improving the loading speed of the target firmware.

[0193] The following describes the process of separating critical and non-critical firmware in the target firmware based on the location information of each type of code, thereby obtaining the critical and non-critical firmware. In one embodiment, as... Figure 10 As shown, the steps in S142 above can be implemented in the following ways:

[0194] S1421. Obtain the location of each key firmware based on the location information of each type of code.

[0195] In practical applications, computer systems can determine the location of critical firmware based on the location information of each critical firmware in the location information of each type of code, and can also determine the location of non-critical firmware based on the location information of non-critical firmware in the location information of each type of code.

[0196] S1422. Extract the code at each key firmware location from the target firmware as each key firmware.

[0197] Specifically, the computer system can extract the code at each critical firmware location from the target firmware and use them as the respective critical firmware.

[0198] S1423. Delete each critical firmware from the target firmware to obtain non-critical firmware.

[0199] The computer system can delete the code at each critical firmware location in the target firmware, that is, delete each critical firmware to obtain non-critical firmware.

[0200] The technical solution in this application embodiment obtains the location of each key firmware based on the location information of each type of code, extracts the code at each key firmware location from the target firmware as each key firmware, and deletes each key firmware from the target firmware to obtain non-key firmware. The above method can achieve firmware separation without the participation of any algorithm, thereby reducing the complexity of firmware separation, improving the speed and efficiency of firmware separation, and also improving the accuracy of firmware separation.

[0201] In some scenarios, critical firmware may need to be updated to improve the security of the target firmware when it is run subsequently. The process of updating critical firmware is described below. In one embodiment, the above method may further include: for any critical firmware ciphertext, if there is a need for version upgrade or fault repair of the critical firmware ciphertext, then the critical firmware ciphertext is obtained and updated.

[0202] It's important to clarify that a critical firmware update can be understood as the process of updating the corresponding critical firmware ciphertext. In practical applications, for any critical firmware ciphertext, if there is a need for version upgrades or fault repair, the critical firmware ciphertext is retrieved from its target storage address and then updated.

[0203] In one embodiment, updating the key firmware ciphertext can be achieved by pre-training an update model, then inputting the key firmware ciphertext into the update model, which outputs the new firmware ciphertext corresponding to the key firmware ciphertext. Optionally, the update model can be a combination of at least one of the following: convolutional neural network model, long short-term memory neural network model, recurrent recurrent neural network model, residual neural network model, etc.

[0204] In another embodiment, the key firmware ciphertext can also be updated using a preset update method based on update parameters.

[0205] In one embodiment, such as Figure 11 As shown, the steps for updating the critical firmware ciphertext described above can be implemented in the following ways:

[0206] S400: Decrypt the key firmware ciphertext to obtain the decrypted key firmware.

[0207] Specifically, the computer system can use a firmware decryption tool to decrypt the ciphertext of critical firmware to obtain the decrypted critical firmware. Alternatively, the computer system can also use asymmetric or symmetric decryption algorithms to decrypt the ciphertext of critical firmware to obtain the decrypted critical firmware.

[0208] S500 modifies the decrypted key firmware to obtain the updated key firmware.

[0209] In practical applications, computer systems can modify specific parameters, instructions, and other information in the decrypted critical firmware to obtain updated critical firmware.

[0210] S600 encrypts the updated key firmware to obtain the new firmware ciphertext.

[0211] In practical applications, computer systems can use encryption algorithms to encrypt updated critical firmware to obtain new firmware ciphertext. Alternatively, the computer system can invoke encryption tools to encrypt the updated critical firmware to obtain new firmware ciphertext. Furthermore, the computer system can input the updated critical firmware into an encryption model, which will encrypt the updated critical firmware and output new firmware ciphertext.

[0212] Furthermore, the key firmware ciphertext at the corresponding storage address can be replaced with new firmware ciphertext for use in the subsequent target firmware loading process.

[0213] The technical solution in this application embodiment decrypts the key firmware ciphertext to obtain the decrypted key firmware, modifies the decrypted key firmware to obtain the updated key firmware, and encrypts the updated key firmware to obtain the new firmware ciphertext. When there is a need to upgrade or repair the key firmware ciphertext, the above method can update the key firmware ciphertext to prepare for loading a more secure corresponding key firmware group, thereby improving the security of the corresponding key firmware in subsequent applications. Simultaneously, when there is a need to update key firmware, the above method does not require updating the complete target firmware; it only needs to process the key firmware ciphertext corresponding to the key firmware to achieve the update. This results in a smaller amount of information being processed during the key firmware update process, greatly improving the loading speed of the target firmware.

[0214] In practical scenarios, the purpose of fusing and decrypting the critical firmware is to run and start the target firmware. The following describes the process of starting the target firmware after fusing and decrypting the critical firmware. In one embodiment, the critical firmware calling instruction includes at least one function interface calling instruction, which carries the absolute address of the corresponding function interface. After executing the steps in S300 above, the method may further include: for any decrypted critical firmware, after the fusion of the decrypted critical firmware and the plaintext firmware is completed, jumping sequentially to the starting position of each function interface according to each absolute address and running each function in the decrypted critical firmware to start the target firmware.

[0215] It should be noted that the decrypted critical firmware may include multiple functions and function interface call instructions for each function. Optionally, when the decrypted critical firmware is run, the functions can be executed sequentially according to their positional order. In this embodiment, the plaintext firmware is configured with different function interface call methods, i.e., the absolute addresses of each function interface.

[0216] In the embodiments of this application, when the decrypted critical firmware is run, the functions in the decrypted critical firmware can also be run in the target order to complete the operation of the decrypted critical firmware.

[0217] Specifically, for any decrypted critical firmware, after the fusion of the decrypted critical firmware and the plaintext firmware is completed, the computer system can trigger a decrypted critical firmware invocation instruction. Then, according to the absolute addresses sequentially carried in the critical firmware invocation instruction, the system jumps to the starting positions of the corresponding function interfaces in the decrypted critical firmware, and executes the functions in the decrypted critical firmware in the order of jumps, thus completing the execution of the decrypted critical firmware and starting the target firmware. Optionally, the absolute addresses sequentially carried in the above critical firmware invocation instruction can be arranged according to actual application requirements.

[0218] In the technical solution of this application embodiment, for any decrypted critical firmware, after the fusion of the decrypted critical firmware and the plaintext firmware is completed, the system jumps sequentially to the starting position of each function interface according to each absolute address and runs each function in the decrypted critical firmware to start the target firmware. The above method can start and run each function in the decrypted critical firmware according to actual application requirements to ensure the correctness of the functions implemented by the decrypted critical firmware and the reliability of the decrypted critical firmware. At the same time, the above method can directly call each function according to the absolute address of the function interface of each function in the decrypted critical firmware, which can speed up the startup speed of the target firmware.

[0219] In one embodiment, this application also provides a firmware loading method applied to a computer system, the method comprising the following steps:

[0220] (1) In response to the loading instruction of the target firmware, run the plaintext firmware of the target firmware, and for any critical firmware call instruction, obtain the corresponding critical firmware ciphertext when the critical firmware call instruction is detected.

[0221] The above method may further include the following steps before running the plaintext firmware of the target firmware:

[0222] (11) Compile the target firmware code to generate the target firmware and the location information of each type of code in the target firmware;

[0223] (12) Obtain the location of each key firmware based on the location information of each type of code;

[0224] (13) Extract the code at each critical firmware location from the target firmware as each critical firmware, and delete each critical firmware from the target firmware to obtain non-critical firmware.

[0225] (14) Encrypt each key firmware to obtain the ciphertext of each key firmware, and compile the non-key firmware to obtain the plaintext firmware.

[0226] (15) Store the ciphertext and plaintext firmware of each key firmware to different storage addresses;

[0227] (2) For any critical firmware ciphertext, obtain the ciphertext storage address of the critical firmware ciphertext;

[0228] (3) Extract the target storage address of the key firmware ciphertext from the ciphertext storage address based on the key firmware ciphertext identifier;

[0229] (4) Obtain the key firmware ciphertext based on the target storage address of the key firmware ciphertext;

[0230] (5) For any critical firmware ciphertext, perform digital signature processing on the critical firmware ciphertext;

[0231] (6) If the digital signature of the key firmware ciphertext passes, the security of the key firmware ciphertext is deemed to meet the standards; if the digital signature of the key firmware ciphertext fails, the security of the key firmware ciphertext is deemed to fail.

[0232] (7) If the security of the key firmware ciphertext meets the standard, the key firmware ciphertext is decrypted to obtain the decrypted key firmware.

[0233] (8) Obtain the plaintext firmware configuration file of the target firmware;

[0234] (9) Parse the plaintext firmware configuration file to obtain the code location information in the plaintext firmware configuration file; the code location information includes at least one key code identifier;

[0235] (10) Based on at least one key code identifier of the target firmware, find the matching key code identifier in the code location information;

[0236] (11) The positions corresponding to the key code identifiers that match the found are determined as the reserved positions for each key firmware;

[0237] (12) Copy each decrypted key firmware to the corresponding key firmware reserved position in the plaintext firmware, and merge each decrypted key firmware with the plaintext firmware to complete the loading of the target firmware.

[0238] (13) For any decrypted critical firmware, after the decrypted critical firmware and plaintext firmware are merged, jump to the starting position of each function interface according to each absolute address and run each function in the decrypted critical firmware to start the target firmware.

[0239] (14) For any critical firmware ciphertext, if there is a need for version upgrade or fault repair of the critical firmware ciphertext, then obtain the critical firmware ciphertext.

[0240] (15) Decrypt the key firmware ciphertext to obtain the decrypted key firmware;

[0241] (16) Modify the decrypted key firmware to obtain the updated key firmware;

[0242] (17) Encrypt the updated key firmware to obtain the new firmware ciphertext.

[0243] The specific execution process of (1) to (17) above can be found in the description of the above embodiments. The implementation principle and technical effect are similar, and will not be repeated here.

[0244] It should be understood that although the steps in the flowcharts of the above embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0245] Based on the same inventive concept, this application also provides a firmware loading apparatus for implementing the firmware loading method described above. The solution provided by this apparatus is similar to the implementation described in the above method; therefore, the specific limitations in one or more firmware loading apparatus embodiments provided below can be found in the limitations of the firmware loading method described above, and will not be repeated here.

[0246] In one embodiment, Figure 12 This is a schematic diagram of the firmware loading device in one embodiment of this application. The firmware loading device provided in this embodiment can be applied to a computer system. Figure 12 As shown, the firmware loading device of this application embodiment may include: an acquisition module 11, a decryption module 12, and a loading module 13, wherein:

[0247] The acquisition module 11 is used to respond to the loading command of the target firmware, run the plaintext firmware of the target firmware, and acquire at least one key firmware ciphertext.

[0248] The decryption module 12 is used to decrypt the ciphertext of each key firmware to obtain the decrypted key firmware.

[0249] Loading module 13 is used to load the target firmware based on each decrypted key firmware and plaintext firmware.

[0250] The firmware loading device provided in this application embodiment can be used to execute the technical solutions in the firmware loading method embodiments of this application above. Its implementation principle and technical effect are similar, and will not be repeated here.

[0251] In one embodiment, the acquisition module 11 is specifically used for:

[0252] For any critical firmware ciphertext, obtain the ciphertext storage address of the critical firmware ciphertext;

[0253] Based on the key firmware ciphertext identifier, extract the target storage address of the key firmware ciphertext from the ciphertext storage address;

[0254] Obtain the critical firmware ciphertext based on the target storage address of the critical firmware ciphertext.

[0255] The firmware loading device provided in this application embodiment can be used to execute the technical solutions in the firmware loading method embodiments of this application above. Its implementation principle and technical effect are similar, and will not be repeated here.

[0256] In one embodiment, the firmware loading device further includes a detection module, wherein:

[0257] The detection module is used to obtain the corresponding key firmware ciphertext when any key firmware call instruction is detected.

[0258] The firmware loading device provided in this application embodiment can be used to execute the technical solutions in the firmware loading method embodiments of this application above. Its implementation principle and technical effect are similar, and will not be repeated here.

[0259] In one embodiment, the loading module 13 includes: a fusion unit, wherein:

[0260] The fusion unit is used to fuse the decrypted key firmware and plaintext firmware to complete the loading of the target firmware.

[0261] The firmware loading device provided in this application embodiment can be used to execute the technical solutions in the firmware loading method embodiments of this application above. Its implementation principle and technical effect are similar, and will not be repeated here.

[0262] In one embodiment, the fusion unit includes: a location acquisition subunit and a copying subunit, wherein:

[0263] The location acquisition subunit is used to acquire the reserved locations of each key firmware element in the plaintext firmware.

[0264] The copy subunit is used to copy each decrypted key firmware to the corresponding key firmware reserved position in the plaintext firmware, and to perform fusion between each decrypted key firmware and the plaintext firmware.

[0265] The firmware loading device provided in this application embodiment can be used to execute the technical solutions in the firmware loading method embodiments of this application above. Its implementation principle and technical effect are similar, and will not be repeated here.

[0266] In one embodiment, the location acquisition subunit includes: a file acquisition subunit, an information acquisition subunit, and a location determination subunit, wherein:

[0267] The file acquisition subunit is used to acquire the plaintext firmware configuration file of the target firmware.

[0268] The information acquisition subunit is used to parse the plaintext firmware configuration file and obtain the code location information in the plaintext firmware configuration file;

[0269] The location determination subunit is used to determine the reserved locations of each key firmware based on the code location information.

[0270] The firmware loading device provided in this application embodiment can be used to execute the technical solutions in the firmware loading method embodiments of this application above. Its implementation principle and technical effect are similar, and will not be repeated here.

[0271] In one embodiment, the code location information includes at least one key code identifier; the location determination subunit is specifically used for:

[0272] Based on at least one key code identifier of the target firmware, search for matching key code identifiers in the code location information;

[0273] The locations corresponding to the key code identifiers that match the found will be designated as the reserved locations for each key firmware.

[0274] The firmware loading device provided in this application embodiment can be used to execute the technical solutions in the firmware loading method embodiments of this application above. Its implementation principle and technical effect are similar, and will not be repeated here.

[0275] In one embodiment, the firmware loading device further includes: an identification module and an execution determination module, wherein:

[0276] The identification module is used to perform security identification on any critical firmware ciphertext.

[0277] The execution module is determined to perform the decryption step of the critical firmware ciphertext if the security of the critical firmware ciphertext meets the standards.

[0278] The firmware loading device provided in this application embodiment can be used to execute the technical solutions in the firmware loading method embodiments of this application above. Its implementation principle and technical effect are similar, and will not be repeated here.

[0279] In one embodiment, the identification module is specifically used for:

[0280] Digitally sign the encrypted key firmware;

[0281] If the digital signature of the critical firmware ciphertext passes, then the security of the critical firmware ciphertext is deemed to meet the standards.

[0282] If the digital signature of the critical firmware ciphertext fails, the security of the critical firmware ciphertext is deemed substandard.

[0283] The firmware loading device provided in this application embodiment can be used to execute the technical solutions in the firmware loading method embodiments of this application above. Its implementation principle and technical effect are similar, and will not be repeated here.

[0284] In one embodiment, the firmware loading device further includes: a firmware acquisition module, a firmware processing module, and a storage module, wherein:

[0285] The firmware acquisition module is used to acquire at least one critical firmware and non-critical firmware from the target firmware.

[0286] The firmware processing module is used to encrypt each critical firmware to obtain the ciphertext of each critical firmware, and to compile non-critical firmware to obtain plaintext firmware.

[0287] The storage module is used to store the encrypted and plaintext firmware of each key firmware to different storage addresses.

[0288] The firmware loading device provided in this application embodiment can be used to execute the technical solutions in the firmware loading method embodiments of this application above. Its implementation principle and technical effect are similar, and will not be repeated here.

[0289] In one embodiment, the firmware acquisition module includes: a compilation unit and a firmware separation unit, wherein:

[0290] The compilation unit is used to compile the target firmware code, generating the target firmware and the location information of various types of code in the target firmware;

[0291] The firmware separation unit is used to separate the critical and non-critical firmware in the target firmware according to the location information of each type of code, so as to obtain the critical and non-critical firmware.

[0292] The firmware loading device provided in this application embodiment can be used to execute the technical solutions in the firmware loading method embodiments of this application above. Its implementation principle and technical effect are similar, and will not be repeated here.

[0293] In one embodiment, the firmware separation unit includes: a location acquisition subunit, an extraction subunit, and a deletion subunit, wherein:

[0294] The location acquisition subunit is used to obtain the location of each key firmware based on the location information of each type of code;

[0295] Extraction subunits are used to extract the code at each key firmware location from the target firmware as each key firmware.

[0296] The delete subunit is used to remove critical firmware from the target firmware to obtain non-critical firmware.

[0297] The firmware loading device provided in this application embodiment can be used to execute the technical solutions in the firmware loading method embodiments of this application above. Its implementation principle and technical effect are similar, and will not be repeated here.

[0298] In one embodiment, the firmware loading apparatus further includes a configuration file generation module, wherein:

[0299] The configuration file generation module is used to store the locations of each key firmware in the initial configuration file after determining the location of each key firmware, and generate the plaintext firmware configuration file of the target firmware.

[0300] The firmware loading device provided in this application embodiment can be used to execute the technical solutions in the firmware loading method embodiments of this application above. Its implementation principle and technical effect are similar, and will not be repeated here.

[0301] In one embodiment, the firmware loading device further includes a firmware update module, wherein:

[0302] The firmware update module is used to obtain and update any critical firmware ciphertext if there is a need for version upgrade or fault repair.

[0303] The firmware loading device provided in this application embodiment can be used to execute the technical solutions in the firmware loading method embodiments of this application above. Its implementation principle and technical effect are similar, and will not be repeated here.

[0304] In one embodiment, the firmware update module is specifically used for:

[0305] The key firmware ciphertext is decrypted to obtain the decrypted key firmware;

[0306] Modify the decrypted critical firmware to obtain the updated critical firmware;

[0307] The updated critical firmware is encrypted to obtain the new firmware ciphertext.

[0308] The firmware loading device provided in this application embodiment can be used to execute the technical solutions in the firmware loading method embodiments of this application above. Its implementation principle and technical effect are similar, and will not be repeated here.

[0309] In one embodiment, the key firmware call instruction includes at least one function interface call instruction, the function interface call instruction carrying the absolute address of the corresponding function interface; the firmware loading device further includes: a running module, wherein:

[0310] The execution module is used to, for any decrypted critical firmware, after the decrypted critical firmware and plaintext firmware have been merged, jump sequentially to the starting position of each function interface according to each absolute address and run each function in the decrypted critical firmware to start the target firmware.

[0311] The firmware loading device provided in this application embodiment can be used to execute the technical solutions in the firmware loading method embodiments of this application above. Its implementation principle and technical effect are similar, and will not be repeated here.

[0312] Specific limitations regarding the firmware loading device can be found in the limitations of the firmware loading method above, and will not be repeated here. Each module in the aforementioned firmware loading device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in the computer system in hardware form, or stored in the computer system's memory in software form, so that the processor can call and execute the operations corresponding to each module.

[0313] In one embodiment, a computer system is provided, which may be a server, and its internal structure diagram may be as follows: Figure 13As shown, the computer system includes a processor, memory, and a network interface connected via a system bus. The processor provides processing power. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The system's database stores target firmware, encryption critical programs, and non-critical programs. The network interface communicates with external endpoints via a network connection. When the computer program is executed by the processor, it implements a firmware loading method.

[0314] Those skilled in the art will understand that Figure 13 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer system to which the present application is applied. A specific computer system may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0315] In one embodiment, a computer system is also provided, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the technical solution in the firmware loading method embodiment described above. The implementation principle and technical effect are similar, and will not be repeated here.

[0316] In one embodiment, a computer-readable storage medium is also provided, on which a computer program is stored. When the computer program is executed by a processor, it implements the technical solution of the firmware loading method described above in this application. Its implementation principle and technical effect are similar, and will not be repeated here.

[0317] In one embodiment, a computer program product is also provided, including a computer program that, when executed by a processor, implements the technical solution of the firmware loading method described above in this application. The implementation principle and technical effects are similar and will not be repeated here.

[0318] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the methods described above. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, or optical storage, etc. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc.

[0319] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0320] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.

Claims

1. A firmware loading method characterized by comprising: The method comprises: in response to a loading instruction of a target firmware, running plaintext firmware of the target firmware, and obtaining at least one key firmware ciphertext; decrypting each of the key firmware ciphertexts to obtain each decrypted key firmware; loading the target firmware according to each of the decrypted key firmware and the plaintext firmware.

2. The method of claim 1, wherein, The obtaining of the at least one key firmware ciphertext comprises: for any key firmware ciphertext, obtaining a ciphertext storage address of the key firmware ciphertext; according to a key firmware ciphertext identifier, extracting a target storage address of the key firmware ciphertext from the ciphertext storage address; obtaining the key firmware ciphertext according to the target storage address of the key firmware ciphertext.

3. The method of claim 1, wherein, The plaintext firmware comprises key firmware calling instructions, and the obtaining of the at least one key firmware ciphertext comprises: for any key firmware calling instruction, obtaining the corresponding key firmware ciphertext when the key firmware calling instruction is detected.

4. The method according to any one of claims 1 to 3, characterized in that, The loading of the target firmware according to each of the decrypted key firmware and the plaintext firmware comprises: fusing each of the decrypted key firmware and the plaintext firmware to complete the loading of the target firmware.

5. The method of claim 4, wherein, The fusing of each of the decrypted key firmware and the plaintext firmware comprises: obtaining each key firmware reserved position in the plaintext firmware; copying each of the decrypted key firmware to the corresponding key firmware reserved position in the plaintext firmware to fuse each of the decrypted key firmware and the plaintext firmware.

6. The method of claim 5, wherein, The obtaining of each key firmware reserved position in the plaintext firmware comprises: obtaining a plaintext firmware configuration file of the target firmware; parsing the plaintext firmware configuration file to obtain code position information in the plaintext firmware configuration file; determining each of the key firmware reserved positions according to the code position information.

7. The method of claim 6, wherein, The code position information comprises at least one key code identifier. The determining of each of the key firmware reserved positions according to the code position information comprises: according to at least one key code identifier of the target firmware, searching for each key code identifier matched in the code position information; determining a position corresponding to each of the key code identifiers matched as found as each of the key firmware reserved positions.

8. The method of any one of claims 1-3, wherein, Before the decrypting of each of the key firmware ciphertexts to obtain each decrypted key firmware, the method further comprises: for any key firmware ciphertext, performing security identification on the key firmware ciphertext; in a case where the security of the key firmware ciphertext is up to standard, performing the step of decrypting the key firmware ciphertext.

9. The method of claim 8, wherein, The security identification on the key firmware ciphertext comprises: performing digital signature processing on the key firmware ciphertext; if the digital signature of the key firmware ciphertext is passed, determining that the security of the key firmware ciphertext is up to standard; if the digital signature of the key firmware ciphertext is not passed, determining that the security of the key firmware ciphertext is not up to standard.

10. The method of any one of claims 1-3, wherein, Before the running of the plaintext firmware of the target firmware, the method further comprises: obtaining at least one key firmware and non-key firmware in the target firmware; The key firmware is encrypted to obtain the key firmware ciphertext, and the non-key firmware is compiled to obtain the plaintext firmware; The key firmware ciphertext and the plaintext firmware are stored in different storage addresses respectively.

11. The method of claim 10, wherein, The method further comprises: Compiling the target firmware code to generate the target firmware and position information of each type of code in the target firmware; According to the position information of each type of code, the key firmware and the non-key firmware in the target firmware are separated to obtain the key firmware and the non-key firmware.

12. The method of claim 11, wherein, According to the position information of each type of code, the key firmware and the non-key firmware in the target firmware are separated to obtain the key firmware and the non-key firmware, comprising: According to the position information of each type of code, the position of each key firmware is obtained; The code at the position of each key firmware is extracted from the target firmware as each key firmware; The key firmware is deleted from the target firmware to obtain the non-key firmware.

13. The method of claim 12, wherein, The method further comprises: In the case of determining the position of each key firmware, the position of each key firmware is stored in an initial configuration file to generate a plaintext firmware configuration file of the target firmware.

14. The method of any one of claims 1-3, wherein, The method further comprises: For any key firmware ciphertext, if there is a version upgrade or fault repair requirement for the key firmware ciphertext, the key firmware ciphertext is obtained and updated.

15. The method of claim 14, wherein, The key firmware ciphertext is updated, comprising: The key firmware ciphertext is decrypted to obtain the decrypted key firmware; The decrypted key firmware is modified to obtain the updated key firmware; The updated key firmware is encrypted to obtain new firmware ciphertext.

16. The method of any one of claims 1-3, wherein, The key firmware calling instruction includes at least one function interface calling instruction, and the function interface calling instruction carries the absolute address of the corresponding function interface; the method further comprises: For any decrypted key firmware, after the decrypted key firmware and the plaintext firmware are fused, according to each absolute address, the starting position of each function interface is jumped to and each function in the decrypted key firmware is run to start the target firmware.

17. A firmware loading apparatus, characterized by comprising: The device comprises: An acquisition module is configured to, in response to a loading instruction of a target firmware, run a plaintext firmware of the target firmware, and acquire at least one key firmware ciphertext; A decryption module is configured to decrypt each key firmware ciphertext to obtain each decrypted key firmware; A loading module is configured to load the target firmware according to each decrypted key firmware and the plaintext firmware.

18. A computer system comprising a memory and a processor, said memory storing a computer program, characterized in that, The processor executes the computer program to implement the steps of the method of any one of claims 1-16.

19. A readable storage medium, having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method of any one of claims 1-16.

20. A computer program product comprising a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method of any one of claims 1-16.