Chip programming methods, host computer, and chip programming system

Through symmetric encryption and key management, the time-consuming problem of data leakage and update process of chip burning equipment is solved, data security and efficient production process are achieved, and it is suitable for a variety of devices and systems.

CN118690377BActive Publication Date: 2024-11-26ZHUHAI TAIWEI ELECTRONICS CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411157040.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-22
Publication Date
2024-11-26
Estimated Expiration
2044-08-22

AI Technical Summary

Technical Problem

The existing chip recording equipment faces data leakage and intellectual property security threats due to lack of encryption measures. At the same time, the process of returning the equipment when software code is updated takes a long time, affecting the flexibility of the production cycle and operational efficiency.

Method used

Using symmetric encryption method, the burned data is divided into multiple segments, random values ​​are inserted and mirror head and tail data are generated, and the keys are used for encryption and decryption, and offline firmware files are generated to ensure the security of data during transmission and storage. and control access rights through key and authentication mechanisms.

Benefits of technology

It realizes the security and encryption speed of data during transmission, reduces implementation costs, is suitable for integration of multiple devices, prevents data leakage and illegal access, and improves the efficiency of intellectual property protection and production processes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118690377B_ABST
    Figure CN118690377B_ABST
Patent Text Reader

Abstract

The embodiment of the present application discloses a chip burning method, a host computer and a chip burning system, and relates to the field of chip burning. The present application encrypts key information such as burning data, device identification, and firmware effective time through a key to ensure the security of data transmission and storage, and prevent unauthorized access and tampering. By generating a self-checking feature code and a mirror hash value, and performing an integrity check before burning, the accuracy and integrity of the burned data are ensured to prevent data from being damaged during transmission or storage. Allowing solution providers to set the firmware effective time and limit the number of burning times to achieve flexible control of the burning process, ensuring that only qualified devices can perform burning operations within a specific time, and preventing illegal copying and abuse.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of chip burning, and in particular to a chip burning method, a host computer and a chip burning system. Background Art

[0002] In the collaborative process of software solution provision and product manufacturing, after completing software development, software solution providers need to deliver the software burning firmware to product manufacturers to support manufacturers in firmware burning and mass production of terminal products based on the obtained authorization licenses. However, the simple burning equipment commonly used in the current market often lacks or only uses basic encryption measures, facing serious security risks, such as the original burning data can be easily stolen or cracked illegally, and the limit on the number of burning times can be easily bypassed, which seriously threatens the core intellectual property security of solution providers.

[0003] To address this challenge, some solution providers have adopted a more cautious strategy, which is to pre-load the firmware into a dedicated, controlled burning device and then deliver such devices to manufacturers for use. This move significantly reduces the risk of data leakage and strengthens the protection of intellectual property rights. However, this model is not perfect, especially when the software code is updated or upgraded, its limitations are obvious: the manufacturer must first return the burning device to the solution provider for code update, and then send it back again after completion. This round-trip process is not only time-consuming, directly affecting the flexibility of the production cycle, but also increases the complexity of logistics operations and reduces overall operational efficiency.

[0004] To sum up, how to ensure the intellectual property security of software solution providers while taking into account the smoothness and efficiency of the production process has become a key issue that needs to be solved urgently. Summary of the invention

[0005] The embodiment of the present application provides a chip burning method, device, storage medium and terminal device, which can solve the problem of protecting burning resources. The technical solution is as follows:

[0006] In a first aspect, an embodiment of the present application provides a method for programming a chip, the method comprising:

[0007] The solution provider's host computer records the device identification of the burning device, and sets the key of the burning device and the burning effective time;

[0008] The upper computer of the solution provider obtains the key, firmware effective time and limited number of burning times input by the user, divides the data to be burned including program code and metadata information into multiple data segments, encrypts each data segment using the key to obtain valid data segments, inserts a random value into each valid data segment, uses each valid data segment with the inserted random value as the mirror tail data, generates a self-checking feature code and a mirror hash value of the mirror tail data, and uses the key to encrypt the self-checking feature code, the mirror hash value, the firmware effective time and the device identification to generate the mirror header data, and the mirror header data and the mirror tail data constitute the mirror data;

[0009] The solution provider host computer uses the key to encrypt the address information of each data segment, chip related information, the firmware effective time, the image hash value, the size of the image header data and the image tail data, the characteristic value of the image header data and the image tail data, and the unique ID of the dedicated memory to generate index data;

[0010] Combining the image data and the index data into an offline firmware file;

[0011] The solution provider's host computer sends the offline firmware file to the burning device;

[0012] The burning device receives and parses the offline firmware file to obtain image data and index data, and parses the image data to obtain image header data and image tail data, uses a pre-stored key to decrypt the parsed image header data to obtain a self-checking feature code, an image hash value, a firmware effective time, a device identifier and a unique ID, and performs integrity verification on the parsed image tail data according to the decrypted self-checking feature code. If the verification is successful, it is determined whether the decrypted image hash value appears for the first time. If yes, it is determined whether the decrypted firmware effective time is after the burning effective time. If yes, it is determined whether the decrypted device identifier is the same as its own device identifier. If yes, it is determined whether the decrypted unique ID is the same as the ID of the built-in dedicated memory. If yes, the parsed image data is stored in the dedicated memory, and the parsed index data is stored in the on-chip memory.

[0013] The burning device extracts the data to be burned from the parsed image data according to the parsed index data, and then burns the extracted data to be burned into the target chip; during the burning process, the number of burning times is recorded, and when the number of burning times is greater than the preset limit number of burning times, an audible and visual alarm is issued to prompt the user that the number of burning times has been used up.

[0014] In a second aspect, an embodiment of the present application provides a solution provider host computer, the device comprising:

[0015] A setting unit, used to record the device identification of the burning device, and to set the key of the burning device and the burning effective time;

[0016] A generating unit, used to obtain the key, firmware effective time and limited number of burning times input by a user, divide the data to be burned including program code and metadata information into multiple data segments, encrypt each data segment using the key to obtain valid data segments, insert a random value into each valid data segment, use each valid data segment with the inserted random value as image tail data, and generate a self-checking feature code and an image hash value of the image tail data, and generate image header data after encrypting the self-checking feature code, the image hash value, the firmware effective time and the device identification using the key, and form the image header data and the image tail data into image data;

[0017] The generating unit is further used to generate index data after encrypting the address information of each data segment, chip related information, the firmware effective time, the image hash value, the size of the image header data and the image tail data, the characteristic value of the image header data and the image tail data, and the unique ID of the dedicated memory using the key;

[0018] A combining unit, used for combining the image data and the index data into an offline firmware file;

[0019] The sending unit is used to send the offline firmware file to the burning device.

[0020] In a third aspect, an embodiment of the present application provides a computer storage medium, wherein the computer storage medium stores a plurality of instructions, wherein the instructions are suitable for being loaded by a processor and executing the above-mentioned method steps.

[0021] In a fourth aspect, an embodiment of the present application provides a solution provider host computer, which may include: a processor and a memory; wherein the memory stores a computer program, and the computer program is suitable for being loaded by the processor and executing the above-mentioned method steps.

[0022] In a fifth aspect, an embodiment of the present application provides a burning system, including a solution provider's host computer and a burning device.

[0023] The beneficial effects brought about by the technical solutions provided by some embodiments of the present application include at least:

[0024] Symmetric encryption can provide faster encryption and decryption speeds while ensuring data security, which is suitable for rapid processing of large amounts of data. This encryption method does not rely on specific hardware, such as dedicated encryption chips, which reduces implementation costs and enables more types of devices and systems to easily integrate this security mechanism. The firmware file remains encrypted during offline transmission. Even if the data is intercepted in the transmission link, the original content cannot be directly parsed, effectively preventing data leakage. This design is particularly suitable for scenarios that have extremely high data security requirements but may face physical connection or wireless transmission risks. Storing the original version of all sensitive data in a trusted terminal (such as a server or a local device with a high security level) can effectively prevent the data from being illegally copied or disseminated. Combined with the permission management mechanism, it is possible to accurately control which users or devices have access to these original materials, further enhancing security. By encrypting transmission and storage, and isolating sensitive data in a trusted terminal, a solid protective wall is formed to effectively resist external eavesdropping and attacks. For enterprises and users, this high level of data protection can significantly enhance their trust in products and services. Even in an environment without network connection, the system can verify access requests through preset authentication mechanisms (such as keys, certificates, etc.) to ensure that only legitimate users or devices can access data. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0026] Figure 1 It is a schematic diagram of the network architecture provided by the embodiment of the present application;

[0027] Figure 2 It is a flowchart of a chip programming method provided in an embodiment of the present application;

[0028] Figure 3 It is a schematic diagram of the data structure of the mirror data and index data provided in the embodiment of the present application;

[0029] Figure 4 It is a structural schematic diagram of a host computer provided by this application;

[0030] Figure 5 It is a structural diagram of a host computer provided in this application. DETAILED DESCRIPTION

[0031] In order to make the objectives, technical solutions and advantages of the present application more clear, the embodiments of the present application will be further described in detail below with reference to the accompanying drawings.

[0032] Figure 1 An exemplary system architecture of a chip burning method or a solution provider host computer that can be applied to the present application is shown.

[0033] like Figure 1 As shown, the system architecture may include: a solution provider host computer 101, a manufacturer host computer 102, and a burning device 103. The solution provider host computer 101 and the manufacturer host computer 102 may communicate remotely, and the manufacturer host computer 102 and the burning device 103 generally communicate locally. The communication link may include various types of wired communication links or wireless communication links, for example: the wired communication link includes optical fiber, twisted pair or coaxial cable, etc., and the wireless communication link includes Bluetooth communication link, wireless fidelity (WIreless-FIdelity, Wi-Fi) communication link or microwave communication link, etc.

[0034] Among them, the solution provider host computer 101 of the present application is used to generate an offline firmware file to be burned, the manufacturer host computer 102 is used to receive the offline firmware file from the solution provider host computer 101, and transmit the offline firmware file to the burning device 103, and the burning device 103 is used to write the data to be burned in the offline firmware file into the target chip.

[0035] The host computer of the present application includes but is not limited to a smart phone, a tablet host computer, a laptop computer, a desktop computer, and the like.

[0036] It should be understood that Figure 1 The number of solution provider host computers, manufacturer host computers and burning devices is only for reference and can be any number according to the implementation requirements.

[0037] The following will be combined with the attached Figure 2 , the chip programming method provided in the embodiment of the present application is described in detail. Among them, the solution provider host computer in the embodiment of the present application can be Figure 1 The terminal device shown.

[0038] See also Figure 2 , which is a flow chart of a chip programming method provided in the embodiment of the present application. Figure 2 As shown, the method of the embodiment of the present application may include the following steps:

[0039] S201, the solution provider's host computer records the device identification of the burning device, and sets the key of the burning device and the burning effective time.

[0040] Among them, the burning device is a trusted device provided by the solution provider to the manufacturer, and the solution provider's host computer is also a trusted device. The burning effective time indicates the moment when the burning device is allowed to perform the burning operation on the target chip, and the host computer establishes a communication connection with the burning device. It is usually implemented by wired (such as USB, Ethernet) or wireless (such as Wi-Fi, Bluetooth), depending on the interface type of the burning device. The host computer sends a request to the burning device, requiring the device to send its device identification (such as serial number, MAC address, etc.). The burning device responds to the request and sends the device identification to the host computer. After receiving the device identification, the host computer stores it in the database and establishes a corresponding relationship with the burning device. The host computer generates a strong password as the key K0 for subsequent symmetric encryption operations. The generation of the key K0 should follow security standards to ensure sufficient complexity and randomness. The host computer sends the key K0 to the burning device through a secure channel (such as an encrypted communication protocol). After receiving the key K0, the burning device stores it in a secure storage area (such as an encrypted EEPROM or a security chip) to ensure that the key is not accessed by unauthorized persons. At the same time, the host computer determines a specific burning effective time t', which means that from this moment on, the burning device is allowed to perform the burning operation on the target chip. The host computer stores the burning effective time t' and the relevant device identification in the database for subsequent verification and management. The host computer sends the burning effective time t' to the burning device through a secure channel so that the device can also verify it locally. However, this step is not necessary because all verification operations ultimately need to be performed on the burning device.

[0041] S202, the upper computer of the solution provider obtains the key K0, the firmware effective time t and the limited number of burning times N input by the user, divides the data to be burned including the program code and metadata information into multiple data segments, encrypts each data segment with the key to obtain a valid data segment, inserts a random value into each valid data segment, uses each valid data segment with the inserted random value as the mirror tail data, and generates a self-checking feature code and a mirror hash value of the mirror tail data, and uses the key K0 to encrypt the self-checking feature code, the mirror hash value, the firmware effective time t, and the device identification to generate the mirror header data, and the mirror header data and the mirror tail data constitute the mirror data.

[0042] Among them, the solution provider's host computer receives the key K0, the firmware effective time t (assuming it is in timestamp format), and the limited number of burning times N input by the user. These inputs will be used in the subsequent data encryption and verification process. Prepare the data to be burned, which includes program code and metadata information. The metadata information may contain various information about the firmware version, device compatibility, burning instructions, etc. Divide the data to be burned into multiple data segments. The size of the data segment can be determined based on the limitations of the storage device, the efficiency of the encryption algorithm, and the convenience of data transmission. Use the key K0 and the selected symmetric encryption algorithm (such as AES) to encrypt each data segment to generate a valid data segment. Ensure that the selection of the encryption algorithm and the management of the key meet security requirements. Insert random values ​​into each valid data segment. These random values ​​are used to increase the complexity of the data and prevent simple pattern analysis to improve security. The valid data segments after the random values ​​are inserted are used as the mirror tail data. These data segments will be burned into the target device. Calculate the self-checking feature code (such as CRC check code) of the mirror tail data. The self-checking feature code is used to check the integrity of the data during the burning and verification process. Calculate the image hash value (such as SHA-256) of the entire image tail data. The image hash value is used to verify the integrity and authenticity of the data after the burning is completed. Combine the self-checking feature code, image hash value, firmware effective time t, device identification and other key information calculated above into a data block. Use the key K0 and the same symmetric encryption algorithm (such as AES) to encrypt the above data block to generate the image header data. The image header data contains all the necessary information to verify the integrity and validity of the image. Combine the encrypted image header data and image tail data into a complete image data according to the predetermined format and structure.

[0043] In this application, the format and structure of the image data should be clearly defined so that the burning device can correctly parse and burn it. For example: see Figure 3 The data structure diagram of the image data shown in FIG. 1 includes: a self-checking feature code, an image hash value, a firmware effective time t, a burner serial number SN (i.e., a device identification of the burning device), and other necessary information (for expansion). The data to be burned is divided into n data segments, and the key K0 is used to symmetrically encrypt the data segments 1 to n to obtain the corresponding valid data segments 1 to n. Then, a random number of random values ​​are inserted into each valid data segment, and finally, each valid data segment with the inserted random values ​​is combined into the image tail data.

[0044] S203, the solution provider's host computer uses the key K0 to encrypt the address information of each data segment, chip related information, firmware effective time, image hash value, size of image header data and image tail data, characteristic values ​​of image header data and image tail data, and unique ID of the dedicated memory to generate index data.

[0045] Among them, the solution provider's host computer collects the address information of each data segment, and the address information specifies the location of the data segment in the storage medium. Collect chip-related information, including but not limited to chip model, manufacturer, serial number, etc., which are used to identify the target chip. The solution provider's host computer obtains the previously determined firmware effective time t and image hash value. Measure or determine the size of the image header data and the image tail data, and the size information is used to perform subsequent indexing and verification processes. Calculate the characteristic values ​​of the image header data and the image tail data. The characteristic value can be a content-based hash value or checksum to verify the integrity and authenticity of the data. The dedicated memory is a non-volatile memory located outside the chip set in the burning device. The solution provider's host computer obtains the unique ID of the dedicated memory (such as the unique serial number of EEPROM, Flash and other devices), which is used to uniquely identify the storage device. The solution provider's host computer combines all the collected information (address information of each data segment, chip-related information, firmware effective time t, image hash value, size of image header data and image tail data, characteristic value, and unique ID of dedicated memory) into a data block to be encrypted, and then encrypts the data block using key K0 and the selected symmetric encryption algorithm (such as AES). The encryption process should ensure the security and integrity of the data and prevent unauthorized access and tampering. The encrypted data block is the index data. The index data contains all the key information required to verify and access the image data, but it exists in encrypted form to ensure security.

[0046] For example, see Figure 3 The data structure diagram of the index data shown in the figure, the index data includes the unique ID of the off-chip dedicated memory (i.e., the dedicated memory mentioned above) encrypted with the key K0, the characteristic value and size of the subsequent data, the size and characteristic value of the image header data and the image tail data, the image hash value (Image hash), the firmware effective time t, the limited number of burning times N, chip related information, other necessary information (for expansion), and the information index of data segment 0 ~ data segment 1 (i.e., address information).

[0047] S204, the solution provider's host computer combines the image data and the index data into an offline firmware file.

[0048] Among them, the solution provider's host computer combines the image data and index data generated above to generate an offline firmware file.

[0049] S205: The solution provider's host computer sends the offline firmware file to the burning device through the manufacturer's host computer.

[0050] Among them, the solution provider's host computer prepares the offline firmware file (including image data and index data). Select a suitable remote transmission method, such as FTP, SCP, HTTP, HTTPS, etc., according to the network environment and security requirements. Set the parameters required for remote transmission, such as the target IP address, port number, user name, password (or key), etc. Use the selected remote transmission protocol and configured parameters to send the offline firmware file from the solution provider's host computer to the manufacturer's host computer. Monitor the transmission progress and status to ensure that the file is transmitted to the manufacturer's host computer intact and without error. Wait for and receive the transmission completion confirmation information from the manufacturer's host computer. After successfully receiving the offline firmware file, the manufacturer's host computer sends the offline firmware file to the burning device through local transmission.

[0051] S206, receiving and parsing the offline firmware file to obtain image data and index data, and parsing the image data to obtain image header data and image tail data, using a pre-stored key to decrypt the parsed image header data to obtain a self-checking feature code, an image hash value, a firmware effective time, a device identifier and a unique ID, and performing integrity verification on the parsed image tail data according to the decrypted self-checking feature code. If the verification is successful, determine whether the decrypted image hash value appears for the first time, if yes, determine whether the decrypted firmware effective time is after the burning effective time, if yes, determine whether the decrypted device identifier is the same as its own device identifier, if yes, determine whether the decrypted unique ID is the same as the ID of the built-in dedicated memory, if yes, store the parsed image data in the dedicated memory, and store the parsed index data in the on-chip memory.

[0052] Among them, the burning device first reads and loads the offline firmware file into its internal buffer through the USB interface. According to the predefined format of the offline firmware file, the burning device parses the file content and separates the image data and index data, which usually involves reading the identification information in the file header to determine the starting position and length of each part of the data. Separation of image header and image tail: Inside the image data, the burning device further parses the image header data and image tail data. Usually, the image header is read by reading the data of a specific length at the beginning of the image data, and the image tail is located at the end of the image data or according to the instructions in the image header. The image header data is decrypted using the key K0 pre-stored in the burning device. The decryption process involves a symmetric encryption algorithm, such as AES. From the decrypted image header data, the burning device extracts key information such as the self-checking feature code, image hash value, firmware effective time and device identification.

[0053] Use the decrypted self-check signature to perform integrity check on the image tail data. This usually involves calculating the check code (such as CRC, hash value, etc.) of the image tail data and comparing it with the self-check signature. If the two match, the verification is successful; otherwise, the verification fails and the burning process is terminated.

[0054] The flashing device checks whether the decrypted image hash value is the first time it has encountered it. This is usually done by querying an internal database or record that stores the hash values ​​of previously flashed firmware. If it is the first time, it continues; otherwise, it may mean that the firmware already exists, and decides whether to overwrite or terminate the flashing based on specific needs.

[0055] If the image hash value is unique, the burning device then verifies whether the decrypted firmware effective time is after the current burning effective time. This ensures that only updated firmware is burned. If the firmware effective time does not meet the requirements, the burning process is terminated.

[0056] Finally, the burning device compares the decrypted device ID with its own device ID to see if it matches. This is to ensure that the firmware is customized for the current device and avoid accidentally burning it to other incompatible or unauthorized devices. If the device ID does not match, the burning process is terminated.

[0057] If all the above verifications are passed, the burning device will store the parsed image data (which is now in a decrypted or undecrypted format, depending on whether the image content needs to be decrypted in real time) into a dedicated storage device, such as internal flash memory or external SD card.

[0058] S207, the burning device extracts the data to be burned from the parsed image data according to the parsed index data, and then burns the extracted data to be burned into the target chip; during the burning process, the number of burning times is recorded, and when the number of burning times is greater than the preset limit number of burning times N, an audible and visual alarm is issued to prompt the user that the number of burning times of the target chip has been used up.

[0059] The burning device or host computer needs to parse the index data. The index data is a data set encrypted with the key K0, which contains the address information of each data segment, chip related information, firmware effective time, image hash value, image header data and image tail data size, characteristic value, and the unique ID of the dedicated memory.

[0060] The steps to parse index data are as follows:

[0061] The index data is decrypted using the key K0 to obtain the decrypted index information.

[0062] Parse the decrypted index information and extract the key information of each data segment, such as the starting address (position in the image data), size, target burning address (position in the target chip), etc. of the data segment. When parsing the index data, you also need to pay special attention to the location information of the image header data and the image tail data. The image header data usually contains important information such as the encrypted self-checking feature code, image hash value, firmware effective time and device identification, while the image tail data is a valid data segment that has been encrypted and processed with random value insertion. According to the size and feature values ​​of the image header data and image tail data provided in the index data, locate and extract these two parts in the image data.

[0063] After extracting the image header data, verification is required to ensure its integrity and correctness: Use the key K0 to decrypt the image header data to obtain the original information such as the self-checking feature code, image hash value, firmware effective time and device identification. Use the decrypted self-checking feature code to perform integrity verification on the image tail data to ensure that the image tail data has not been tampered with during transmission or storage. Compare the decrypted firmware effective time and device identification with the index data or user input information to ensure their consistency.

[0064] After confirming that the image header data is correct, you can extract the data segments to be burned from the image tail data according to the data segment information provided in the index data:

[0065] Traverse the records of each data segment in the index data.

[0066] According to the starting address and size of the data segment, locate and extract the corresponding data segment in the mirror tail data.

[0067] If the index material specifies verification information of the data segment (such as a hash value or a checksum), it is possible to further verify whether the extracted data segment is correct.

[0068] Once all the data segments to be burned have been successfully extracted and verified, the burning device can prepare to burn these data into the specified address of the target chip. Before burning, some additional preparations may be required, such as configuring the burning environment of the target chip and setting the burning parameters.

[0069] According to the target burning address specified in the index data, the burning device will burn the extracted data segments to be burned into the target chip one by one. During the burning process, the burning device will record detailed burning logs, including the burning address, burning time, success or failure of each data segment, etc., for subsequent tracking and auditing.

[0070] After each successful programming, the programming device will update and record the number of programming attempts. This number is usually stored in the internal storage of the programming device, and can also be recorded in a specific area of ​​the target chip (if the target chip supports it). Before or after each programming, the programming device will check whether the current number of programming attempts has reached the preset limit number of programming attempts N. If the number of programming attempts is greater than N, the programming device will trigger an audible and visual alarm mechanism. This usually includes beeps, flashing indicators, etc. to attract the user's attention. At the same time, the programming device may also display an alarm message on the display to clearly inform the user that the number of programming attempts for the target chip has been used up. At the same time as the alarm, the programming device will stop the current programming operation and may prevent further programming attempts to protect the target chip from being illegally or excessively used. After receiving the audible and visual alarm, the user needs to check the display screen or related logs of the programming device to understand the specific reason for the alarm.

[0071] In this application, when the solution provider's host computer generates an offline firmware file, it should fill in the actual limit on the number of burning times N. The generated offline file will carry a unique image hash value Image hash. When the final burning device receives the offline firmware file, it will save the image hash value Image hash in an independent space of the on-chip memory of the main control chip (for example: on-chip Flash), and compare whether the file with the same image hash value Image hash has been downloaded before. If so, the file will be refused to download. When the solution provider generates an offline firmware file, the firmware effective time t must be filled in, and the firmware effective time t must be later than the burning effective time t', otherwise the burning device will refuse to download this file. When the solution provider's host computer generates an offline firmware file, it must fill in the SN serial number of the burning device, indicating that the file can only be downloaded to the current burning device, and other burning devices will refuse to download. Multiple SN serial numbers can be filled in at a time, that is, one offline firmware file can correspond to multiple different burning devices. If multiple SNs are filled in, the limit on the number of burning times N is equal to the sum of the actual times of each burning device. This allows offline firmware files to be downloaded only to a specific burning device and only once.

[0072] Then, when the manufacturer uses the burning device to burn the target chip, the burning device will record the number of successful burnings and save the number in the processor's on-chip memory. Since the capacity of the on-chip memory is generally not large, the number of image hash values ​​it stores is limited. If the remaining space of the on-chip memory is insufficient and the image hash value cannot be written, the burning device will also refuse to download the offline burning file. The manufacturer's host computer will request the solution provider's host computer to generate a special reset key file. The reset key file also takes the form of sampling self-verification, uses the old key K0 to encrypt the new key K1, the new effective time T1, the SN of the burning device, the random value and other information, and then packages it to the burning device. The burning device will update the key K1 and the firmware effective time T1 after verification, and clear all Image hashes in the on-chip memory. Generally speaking, the new key K1 is inconsistent with the old K0, and the firmware effective time T1 is set to the current actual time, which ensures that the old burning files held by the manufacturer cannot be downloaded and used again.

[0073] For example, the main control MCU of the burning device uses our company's chip TAE32F5300. In addition to the conventional read protection, this MCU also has a hardware real-time encryption and decryption module. All data written into the on-chip Flash are encrypted, so even if the on-chip Flash data is opened and read out, it is garbled, and it cannot be used if written into another chip, so this chip can be used as a trusted terminal device. Other chips that can provide real-time encryption and decryption functions can be used as trusted terminals.

[0074] The dedicated memory of the burning device can use the common W25Q64, an 8MB SPI Flash, which can provide sufficient storage space for saving the encrypted offline firmware file F. The burning device uses the offline burning device developed by our company. The serial number SN of the burning device is the factory UID of the chip to ensure uniqueness. The upper computer software is the offline burning device configuration software developed by our company. The target chip is the chip TAE32F5600 of our company.

[0075] The solution provider first sets the key K0 of the burning device W, then sets the burning effective time T0 to 10:0:00 on May 20, 2024, and mails the set burning device W to the manufacturer. The configuration information of the burning device W includes the key K0 and the burning effective time T0.

[0076] Then, the solution provider loads the solution code designed by it into the host computer software, enters the key K0, enters the firmware effective time T1 as 11:0:00 on May 20, 2024, enters the burning limit number N=1000 times, and the serial number SN of the burning device W is A50F0001. The host computer software automatically cuts and encrypts the segments to generate the offline firmware file F. The solution provider sends the offline firmware file F to the manufacturer.

[0077] After the manufacturer receives the offline firmware file F, it is opened, and the burning device W is connected to the manufacturer's host computer through the USB interface to download the file to the burning device W. The main control MCU of the burning device first decrypts the received Image head, extracts the firmware effective time T1, Image hash, burner serial number SN and other information, and after comparison, the firmware effective time T1 is later than the burner effective time T0, the Image hash is the first download, the serial number SN matches, the verification is passed, and then the burning device saves the Image data of the offline firmware file F in the dedicated memory outside the chip, and the Index data is saved in the Flash inside the chip.

[0078] The manufacturer then handed over the burning device W to the production staff. After burning 1,000 chips, the authorized number of burning times for the offline firmware file F was used up, and the burning device issued an audible and visual warning. The production staff connected the burning device W to the solution provider's host computer again and tried to re-download the offline firmware file F, but at this time the burning device's main control MCU recognized that the Image hash already existed and refused to download. The solution provider tried to connect another burning device to the host computer and tried to download the file, but at this time the burning device recognized that the serial number SN did not match and refused to burn. The solution provider replaced the off-chip dedicated memory that was backed up in advance, but the burning device recognized that the unique ID of the dedicated memory did not match and refused to perform the burning action. Then at this time, the manufacturer can only purchase the number of burning times again, and the solution provider generates a new offline firmware file and sends it to the manufacturer.

[0079] After downloading firmware files multiple times, the dedicated storage space in the burning device is full and new offline firmware files cannot be downloaded. At this time, the solution provider's host computer inputs the old key K0, new key K1, new burning effective time T1, and burning device serial number SN based on the host computer software, and generates a special offline file for the manufacturer. The manufacturer downloads it to the burning device. The key and time of the burning device are updated, the Image hash is cleared, and more new offline firmware files are allowed to be downloaded.

[0080] The embodiments of the present application have the following beneficial effects when performing chip programming:

[0081] Symmetric encryption can provide faster encryption and decryption speeds while ensuring data security, which is suitable for rapid processing of large amounts of data. This encryption method does not rely on specific hardware, such as dedicated encryption chips, which reduces implementation costs and enables more types of devices and systems to easily integrate this security mechanism. The firmware file remains encrypted during offline transmission. Even if the data is intercepted in the transmission link, the original content cannot be directly parsed, effectively preventing data leakage. This design is particularly suitable for scenarios that have extremely high data security requirements but may face physical connection or wireless transmission risks. Storing the original version of all sensitive data in a trusted terminal (such as a server or a local device with a high security level) can effectively prevent the data from being illegally copied or disseminated. Combined with the permission management mechanism, it is possible to accurately control which users or devices have access to these original materials, further enhancing security. By encrypting transmission and storage, and isolating sensitive data in a trusted terminal, a solid protective wall is formed to effectively resist external eavesdropping and attacks. For enterprises and users, this high level of data protection can significantly enhance their trust in products and services. Even in an environment without network connection, the system can verify access requests through preset authentication mechanisms (such as keys, certificates, etc.) to ensure that only legitimate users or devices can access data.

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

[0083] See also Figure 4 , which shows a schematic diagram of the structure of a solution provider host computer provided by an exemplary embodiment of the present application, hereinafter referred to as host computer 4. Host computer 4 includes: a setting unit 401, a generating unit 402, a combining unit 403, and a sending unit 404.

[0084] The setting unit 401 is used to record the device identification of the burning device, and to set the key and burning validity time of the burning device;

[0085] The generating unit 402 is used to obtain the key, firmware effective time and limited number of burning times input by the user, divide the data to be burned including the program code and metadata information into multiple data segments, encrypt each data segment with the key to obtain a valid data segment, insert a random value into each valid data segment, use each valid data segment with the inserted random value as the image tail data, and generate a self-checking feature code and an image hash value of the image tail data, and encrypt the self-checking feature code, the image hash value, the firmware effective time and the device identification with the key to generate image header data, and form the image header data and the image tail data into image data;

[0086] The generating unit 402 is further used to generate index data by encrypting the address information of each data segment, chip related information, the firmware effective time, the image hash value, the size of the image header data and the image tail data, the characteristic value of the image header data and the image tail data, and the unique ID of the dedicated memory using the key;

[0087] A combining unit 403, configured to combine the image data and the index data into an offline firmware file;

[0088] The sending unit 404 is used to send the offline firmware file to the burning device.

[0089] In one or more possible embodiments, sending the offline firmware file to the burning device includes:

[0090] The offline firmware file is sent to the manufacturer's host computer in a remote manner, and the manufacturer's host computer sends the offline firmware file to the burning device through a USB interface.

[0091] It should be noted that, when the host computer 4 provided in the above embodiment executes the chip burning method, only the division of the above functional modules is used as an example. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the above functions. In addition, the solution provider host computer provided in the above embodiment and the chip burning method embodiment belong to the same concept, and the embodiment of the implementation process is detailed in the method embodiment, which will not be repeated here.

[0092] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0093] The present application also provides a computer storage medium, which can store multiple instructions, and the instructions are suitable for being loaded and executed by a processor as described above. Figure 2 The method steps of the embodiment shown in the figure can be found in the specific implementation process. Figure 2 The specific description of the illustrated embodiment will not be repeated here.

[0094] The present application also provides a computer program product, which stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement the chip burning method described in the above embodiments.

[0095] See also Figure 5 , which is a schematic diagram of the structure of a host computer according to an embodiment of the present application. Figure 5As shown, the host computer 500 may include: at least one processor 501 , at least one network interface 504 , a user interface 503 , a memory 505 , and at least one communication bus 502 .

[0096] The communication bus 502 is used to realize the connection and communication between these components.

[0097] The user interface 503 may include a display screen (Display) and a camera (Camera). Optionally, the user interface 503 may also include a standard wired interface and a wireless interface.

[0098] The network interface 504 may optionally include a standard wired interface or a wireless interface (such as a WI-FI interface).

[0099] Among them, the processor 501 may include one or more processing cores. The processor 501 uses various interfaces and lines to connect various parts of the entire host computer 500, and executes various functions and processes data of the host computer 500 by running or executing instructions, programs, code sets or instruction sets stored in the memory 505, and calling data stored in the memory 505. Optionally, the processor 501 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor 501 can integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing the content to be displayed on the display screen; the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 501, and it can be implemented separately through a chip.

[0100] Among them, the memory 505 may include a random access memory (Random Access Memory, RAM) and may also include a read-only memory (Read-Only Memory). Optionally, the memory 505 includes a non-transitory computer-readable storage medium. The memory 505 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 505 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned method embodiments, etc.; the data storage area may store data involved in the above-mentioned method embodiments, etc. The memory 505 may also be optionally at least one storage device located away from the aforementioned processor 501. As Figure 5 As shown, the memory 505 as a computer storage medium may include an operating system, a network communication module, a user interface module and an application program.

[0101] exist Figure 5 In the upper computer 500 shown in the figure, the user interface 503 is mainly used to provide an input interface for the user and obtain the data input by the user; and the processor 501 can be used to call the application stored in the memory 505 and specifically execute the following Figure 2 The specific process can be referred to Figure 2 As shown, no further description is given here.

[0102] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing related hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a read-only storage memory, or a random access memory, etc.

[0103] The above disclosure is only the preferred embodiment of the present application, which certainly cannot be used to limit the scope of rights of the present application. Therefore, equivalent changes made according to the claims of the present application are still within the scope covered by the present application.

Claims

1. A chip burning method, It is characterized in that include: The solution provider's host computer records the device identification of the burning device, and sets the key of the burning device and the burning effective time; The upper computer of the solution provider obtains the key, firmware effective time and limited number of burning times input by the user, divides the data to be burned including program code and metadata information into multiple data segments, encrypts each data segment using the key to obtain valid data segments, inserts a random value into each valid data segment, uses each valid data segment with the inserted random value as the mirror tail data, generates a self-checking feature code and a mirror hash value of the mirror tail data, and uses the key to encrypt the self-checking feature code, the mirror hash value, the firmware effective time and the device identification to generate the mirror header data, and the mirror header data and the mirror tail data constitute the mirror data; The solution provider host computer uses the key to encrypt the address information of each data segment, chip related information, the firmware effective time, the image hash value, the size of the image header data and the image tail data, the characteristic value of the image header data and the image tail data, and the unique ID of the dedicated memory to generate index data; Combining the image data and the index data into an offline firmware file; The solution provider's host computer sends the offline firmware file to the burning device; The burning device receives and parses the offline firmware file to obtain image data and index data, and parses the image data to obtain image header data and image tail data, uses a pre-stored key to decrypt the parsed image header data to obtain a self-checking feature code, an image hash value, a firmware effective time, a device identifier and a unique ID, and performs integrity verification on the parsed image tail data according to the decrypted self-checking feature code. If the verification is successful, it is determined whether the decrypted image hash value appears for the first time. If yes, it is determined whether the decrypted firmware effective time is after the burning effective time. If yes, it is determined whether the decrypted device identifier is the same as its own device identifier. If yes, it is determined whether the decrypted unique ID is the same as the ID of the built-in dedicated memory. If yes, the parsed image data is stored in the dedicated memory, and the parsed index data is stored in the on-chip memory. The burning device extracts the data to be burned from the parsed image data according to the parsed index data, and then burns the extracted data to be burned into the target chip; during the burning process, the number of burning times is recorded, and when the number of burning times is greater than the preset limit number of burning times, an audible and visual alarm is issued to prompt the user that the number of burning times has been used up.

2. The method according to claim 1, It is characterized in that Also includes: The burning device detects that the remaining capacity of the dedicated memory is less than the capacity threshold, and requests a new offline firmware file from the solution provider's host computer through the manufacturer's host computer.

3. The method according to claim 1 or 2, It is characterized in that Also includes: If the integrity check fails, the burning device refuses to download the offline firmware file; or If the decrypted image hash value does not appear for the first time, the burning device refuses to download the offline firmware file; or If the decrypted firmware effective time is after the burning effective time, the burning device refuses to download the offline firmware file; or If the decrypted device ID is different from its own device ID, the burning device refuses to download the offline firmware file; or If the decrypted unique ID is different from the ID of the built-in dedicated memory, the burning device refuses to download the offline firmware file.

4. The method according to claim 1, It is characterized in that The number of device identifications of the burning devices input by the user is multiple, and the sum of the allowed burning times of the various burning devices is equal to the limited burning times.

5. The method according to claim 1, It is characterized in that The sizes of the data segments are not equal, and the lengths of the random values ​​inserted into the valid data segments are not equal.

6. The method according to claim 1, It is characterized in that The solution provider's host computer sends the offline firmware file to the burning device, including: The solution provider's host computer sends the offline firmware file to the manufacturer's host computer in a remote manner, and the manufacturer's host computer sends the offline firmware file to the burning device through a USB interface.

7. The method according to claim 1, It is characterized in that The self-checking characteristic code is calculated by using the CRC algorithm, encrypted by using the key using AES, and the mirror image hash value is calculated by using the SHA-256 algorithm.

8. A host computer, It is characterized in that The burning method applied to any one of claims 1 to 7, wherein the host computer comprises: A setting unit, used to record the device identification of the burning device, and to set the key of the burning device and the burning effective time; A generating unit, used to obtain the key, firmware effective time and limited number of burning times input by a user, divide the data to be burned including program code and metadata information into multiple data segments, encrypt each data segment using the key to obtain valid data segments, insert a random value into each valid data segment, use each valid data segment with the inserted random value as image tail data, and generate a self-checking feature code and an image hash value of the image tail data, and generate image header data after encrypting the self-checking feature code, the image hash value, the firmware effective time and the device identification using the key, and form the image header data and the image tail data into image data; The generating unit is further used to generate index data after encrypting the address information of each data segment, chip related information, the firmware effective time, the image hash value, the size of the image header data and the image tail data, the characteristic value of the image header data and the image tail data, and the unique ID of the dedicated memory using the key; A combining unit, used for combining the image data and the index data into an offline firmware file; The sending unit is used to send the offline firmware file to the burning device.

9. A chip burning system, It is characterized in that include: Solution provider's host computer and burning equipment; The solution provider's host computer is used to record the device identification of the burning device, and to set the key of the burning device and the burning effective time; The key, firmware effective time and limited number of burning times input by the user are obtained, the data to be burned including program code and metadata information are divided into multiple data segments, each data segment is encrypted by using the key to obtain valid data segments, a random value is inserted into each valid data segment, each valid data segment with the inserted random value is used as the mirror tail data, and a self-checking feature code and a mirror hash value of the mirror tail data are generated, and the self-checking feature code, the mirror hash value, the firmware effective time and the device identification are encrypted by using the key to generate the mirror header data, and the mirror header data and the mirror tail data are composed of the mirror data; The key is used to encrypt the address information of each data segment, chip related information, the firmware effective time, the image hash value, the size of the image header data and the image tail data, the characteristic value of the image header data and the image tail data, and the unique ID of the dedicated memory to generate index data; Combining the image data and the index data into an offline firmware file; Sending the offline firmware file to the burning device; The burning device is used to receive and parse the offline firmware file to obtain image data and index data, and parse the image data to obtain image header data and image tail data, use the pre-stored key to decrypt the parsed image header data to obtain a self-checking feature code, an image hash value, a firmware effective time, a device identifier and a unique ID, and perform integrity verification on the parsed image tail data according to the decrypted self-checking feature code. If the verification is successful, determine whether the decrypted image hash value appears for the first time, if yes, determine whether the decrypted firmware effective time is after the burning effective time, if yes, determine whether the decrypted device identifier is the same as its own device identifier, if yes, determine whether the decrypted unique ID is the same as the ID of the built-in dedicated memory, if yes, store the parsed image data in the dedicated memory, and store the parsed index data in the on-chip memory; The data to be burned is extracted from the parsed image data according to the parsed index data, and then the extracted data to be burned is burned into the target chip; during the burning process, the number of burning times is recorded, and when the number of burning times is greater than the preset limit number of burning times, an audible and visual alarm is issued to prompt the user that the number of burning times has been used up.

10. A host computer, It is characterized in that include: A processor and a memory; wherein the memory stores a computer program, and the computer program is suitable for being loaded by the processor and executing the method steps as claimed in any one of claims 1 to 7.

Citation Information

Cited By

  • MCU burning method and system based on authorization protection

    CN120010869A