Editable chip upgrading method, system and device, computer equipment, readable storage medium and program product

By using a collaborative upgrade method involving the main control chip and the programmable chip, the problems of complex upgrade operations and equipment damage associated with traditional programmable chip upgrades are solved, enabling a convenient and safe upgrade process and ensuring equipment stability.

CN121900784APending Publication Date: 2026-04-21HUNAN HANBOWEI MICROELECTRONICS TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
HUNAN HANBOWEI MICROELECTRONICS TECH CO LTD
Filing Date
2025-12-17
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

Traditional programmable chip upgrade methods require disassembling the device, increasing operational complexity and the risk of damage, and affecting device stability.

Method used

The upgrade file information is obtained through the main control chip, verified and burned into the configuration file, the chip is restarted and the version is matched to ensure the upgrade is successful. The stable version is stored using an external configuration chip to provide a fault tolerance mechanism.

Benefits of technology

No external programmer is required, simplifying operation, reducing the risk of damage, improving the convenience and accuracy of upgrades, and ensuring device stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121900784A_ABST
    Figure CN121900784A_ABST
Patent Text Reader

Abstract

The invention relates to an editable chip upgrading method, system and device, computer equipment, a readable storage medium and a program product. The method comprises the following steps: acquiring upgrading file information for upgrading the editable chip, and acquiring a current running file version of the editable chip from a configuration file of the editable chip; burning an upgrading file version in the upgrading file information to the configuration file under the condition that the upgrading file information is successfully verified; restarting the editable chip, and obtaining a new current running file version from the configuration file again; and under the condition that the new current running file version is matched with the upgrading file version, determining that the editable chip is successfully upgraded. By adopting the method, the equipment stability can be ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of electronic information technology, and in particular to a programmable chip upgrade method, system, apparatus, computer equipment, readable storage medium, and program product. Background Technology

[0002] With the rapid development of electronic information technology, programmable chips, due to their programmability, can be flexibly defined and modified through software to meet diverse logic control needs in different application scenarios, and have been widely used in many electronic devices. Computers typically use dedicated programmers connected to the dedicated programming interface of the programmable chip, and then use dedicated programming software on the computer to burn the compiled binary file into the programmable chip, thereby updating the program within the chip. This traditional programming method is relatively simple and feasible when the device is in the research and development stage or has not yet been assembled.

[0003] However, after the device is assembled, since the programming interface of the programmable chip is usually not connected to an external device, using a traditional programming interface for programming presents many difficulties. For example, the device casing needs to be disassembled to expose the programming interface, which not only increases the complexity and time cost of operation, but may also cause physical damage to the device due to frequent disassembly, affecting the stability of the device. Summary of the Invention

[0004] Therefore, it is necessary to provide a programmable chip upgrade method, system, device, computer equipment, readable storage medium, and program product that can ensure device stability in response to the above-mentioned technical problems.

[0005] In a first aspect, this application provides an editable chip upgrade method, applied to a main control chip; the main control chip and the editable chip are assembled in the same device; comprising:

[0006] Obtain upgrade file information for upgrading the editable chip, and obtain the current running file version of the editable chip from the configuration file of the editable chip;

[0007] If the upgrade file information is successfully verified, the upgrade file version in the upgrade file information will be burned into the configuration file;

[0008] Restart the editable chip and retrieve the new version of the currently running file from the configuration file;

[0009] If the new current running file version matches the upgrade file version, the editable chip upgrade is determined to be successful.

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

[0011] The new version of the currently running file is stored in the current file storage location of the first external configuration chip;

[0012] Return to the steps of restarting the editable chip and retrieving the new version of the currently running file from the configuration file;

[0013] If the number of consecutive matches between the new current running file version and the upgrade file version meets the matching condition, then the new current running file version is determined as a stable running version;

[0014] The stable running version is stored in the stable file storage location of the first external configuration chip.

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

[0016] During the operation of the editable chip, the currently running program of the editable chip at the current moment, and the current running file version corresponding to the currently running program are read;

[0017] Retrieve the local running program of the currently running file version from the local database;

[0018] If the local running program does not match the currently running program, the programmable chip is reprogrammed based on the stable running version.

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

[0020] If the new current running file version does not match the upgrade file version, the current running file version will be re-burned to the editable chip;

[0021] Upon receiving a re-upgrade instruction, the process returns to the step of burning the upgrade file version from the upgrade file information to the configuration file until the new currently running file version matches the upgrade file version.

[0022] Secondly, this application also provides an editable chip upgrade system, including a main control chip and an editable chip interconnected; the main control chip and the editable chip are assembled in the same device;

[0023] The main control chip is used to obtain upgrade file information for upgrading the editable chip, and to obtain the current running file version of the editable chip from the configuration file of the editable chip;

[0024] If the upgrade file information is successfully verified, the upgrade file version in the upgrade file information will be burned into the configuration file;

[0025] Restart the editable chip and retrieve the new version of the currently running file from the configuration file;

[0026] If the new current running file version matches the upgrade file version, the editable chip upgrade is determined to be successful.

[0027] In one embodiment, the system further includes a reset module and a second external configuration chip; the second external configuration chip is connected to the main control chip and the reset module.

[0028] The main control chip is also used for:

[0029] The new version of the currently running file is stored in the current file storage location of the first external configuration chip;

[0030] Returning to the step of restarting the editable chip, if the number of consecutive matches between the new current running file version and the upgrade file version meets the matching condition, then the new current running file version is determined as the stable running version;

[0031] The stable running version is stored in the stable file storage location of the first external configuration chip and in the second external configuration chip;

[0032] The reset module is used for:

[0033] In the event that the editable chip fails to restart, the editable chip is started using a stable running version in the second external configuration chip.

[0034] Thirdly, this application also provides an editable chip upgrade device, comprising:

[0035] The information acquisition module is used to acquire upgrade file information for upgrading the editable chip, and to acquire the current running file version of the editable chip from the configuration file of the editable chip;

[0036] The file burning module is used to burn the upgrade file version in the upgrade file information to the configuration file if the upgrade file information is successfully verified.

[0037] The chip restart module is used to restart the editable chip and retrieve a new version of the currently running file from the configuration file.

[0038] The version matching module is used to determine that the editable chip upgrade is successful if the new version of the currently running file matches the version of the upgrade file.

[0039] Fourthly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the steps of the method described above.

[0040] Fifthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, implements the steps of the method described above.

[0041] Sixthly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, implements the steps of the method described above.

[0042] The aforementioned programmable chip upgrade method, system, device, computer equipment, readable storage medium, and program product are applied to the main control chip, and the main control chip and programmable chip are assembled in the same device. This design eliminates the need for an external dedicated programmer and programming interface, avoiding the operational complexity, increased costs, and equipment damage risks associated with disassembling the device for programming, effectively improving the convenience of the upgrade and the security of the device. By obtaining the upgrade file information for the programmable chip and retrieving the current running file version from the programmable chip's configuration file, a comprehensive understanding of the key information required for the upgrade and the chip's current operating status can be obtained, laying the foundation for accurate subsequent upgrade operations. If the upgrade file information is successfully verified, the upgrade file version is programmed into the configuration file, ensuring that only verified and legitimate upgrade files can be programmed, improving the accuracy and reliability of the upgrade. Restarting the programmable chip and retrieving the new current running file version from the configuration file promptly reflects the chip's operating status after the upgrade. Finally, if the new current running file version matches the upgrade file version, the programmable chip upgrade is confirmed to be successful. This version matching judgment mechanism ensures the correctness of the upgrade result. In summary, using the above-described method to upgrade the editable chip ensures device stability. Attached Figure Description

[0043] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0044] Figure 1 This is an application environment diagram of an editable chip upgrade method in one embodiment;

[0045] Figure 2 This is a flowchart illustrating an editable chip upgrade method in one embodiment;

[0046] Figure 3 This is a schematic diagram of the structure of an editable chip upgrade system in one embodiment;

[0047] Figure 4 This is a schematic diagram of the structure of an editable chip upgrade system in another embodiment;

[0048] Figure 5 This is a schematic diagram of the structure of the first external configuration chip in one embodiment;

[0049] Figure 6 This is a schematic diagram of the structure of an editable chip upgrade system in yet another embodiment;

[0050] Figure 7 This is a flowchart illustrating an editable chip upgrade method in another embodiment;

[0051] Figure 8 This is a structural block diagram of an editable chip upgrade device in one embodiment;

[0052] Figure 9 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0053] 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.

[0054] The programmable chip upgrade method provided in this application embodiment can be applied to, for example... Figure 1In the application environment shown, the main control chip 102 communicates with the programmable chip 104 via SPI (Serial Peripheral Interface) signals. The main control chip 102 is responsible for coordinating and controlling the operation of all hardware modules, ensuring the device operates according to preset logic. For example, the main control chip 102 can be a System on a Chip (SOC). The programmable chip 104 is programmable and can be flexibly defined and modified through software to meet diverse logic control requirements in different application scenarios. For example, the programmable chip 104 can be a Complex Programmable Logic Device (CPLD). Specifically, the main control chip 102 and the editable chip 104 are assembled in the same device. During the upgrade process of the editable chip 104, the main control chip 102 obtains the upgrade file information for upgrading the editable chip 104 and obtains the current running file version of the editable chip 104 from the configuration file of the editable chip 104. If the upgrade file information is successfully verified, the upgrade file version in the upgrade file information is burned to the configuration file. The editable chip 104 is restarted, and the new current running file version is obtained from the configuration file again. If the new current running file version matches the upgrade file version, the upgrade of the editable chip 104 is determined to be successful.

[0055] In one exemplary embodiment, such as Figure 2 As shown, a programmable chip upgrade method is provided, which can be applied to... Figure 1 Taking the main control chip 102 as an example, the explanation includes the following steps S202 to S208. Wherein:

[0056] Step S202: Obtain upgrade file information for upgrading the editable chip, and obtain the current running file version of the editable chip from the configuration file of the editable chip.

[0057] The upgrade file information contains key information such as the specific contents of the files used to upgrade the editable chip and their corresponding versions. This information is crucial for determining whether the chip can be upgraded and whether the upgrade is successful. The configuration file stores various configuration parameters and runtime file versions of the editable chip. During operation, the chip executes corresponding operations based on the information in the configuration file. The configuration file can be stored in a specific storage area within the editable chip. The current runtime file version is the version number of the runtime file currently being used by the editable chip, reflecting the version of the functions and programs currently running on the chip.

[0058] Specifically, the main control chip first needs to obtain the information contained in the upgrade file used to upgrade the editable chip. This information may be transmitted to other external devices via USB (Universal Serial Bus), serial port, or network port, and then read using appropriate reading tools or interfaces. Simultaneously, it needs to find the version number of the currently used running file from the editable chip's configuration file. For example, the editable chip's configuration file may be stored in a specific memory area inside the chip, and the current running file version information can be read through specific instructions or programs. For instance, in the case of a CPLD, the specific memory area could be a built-in Flash chip.

[0059] Step S204: If the upgrade file information is successfully verified, the upgrade file version in the upgrade file information is burned into the configuration file.

[0060] The upgrade file version is the version number of the file used to upgrade the chip, which is contained in the upgrade file information. This version number represents the new functions and features and is the target version for the chip upgrade.

[0061] Specifically, after obtaining the upgrade file information, it needs to be verified. The purpose of verification is to ensure the integrity and correctness of the upgrade file and prevent upgrade failure due to file corruption or errors. Successful verification means that the upgrade file is correct. At this point, the upgrade file version in the upgrade file information is written to the configuration file of the editable chip through a programming method, updating the version information in the configuration file.

[0062] For example, the verification process can begin by identifying and judging the file name. If the file name does not conform to the specifications, the file is determined not to be the binary file required for the upgrade, and the upgrade process is interrupted. After confirming that the file name conforms, the chip model in the binary file is identified and compared with the chip model of the connected CPLD (this chip model is read from the CPLD via an SPI signal). If the model does not match, the upgrade process is terminated. Finally, the version information and time information in the upgrade file information are read and compared with the pre-stored version information and time information (this version information and time information are read from the CPLD by the main control chip via SPI and then stored in a specific location). If the version information and time information have not been iteratively upgraded (i.e., the version in the received file is lower than the pre-stored version information, and the time information is compared with the pre-stored time information), the upgrade process is terminated.

[0063] Step S206: Restart the editable chip and retrieve the new version of the currently running file from the configuration file.

[0064] Restarting involves stopping the current operating state of the editable chip and then restarting it to allow it to start running in a new state. During the upgrade process, restarting is used to enable the chip to load the updated configuration file.

[0065] Specifically, after the upgrade file version is burned into the configuration file, the editable chip needs to be restarted in order for it to load and use the updated configuration file. After restarting, the editable chip will reread the configuration file to obtain the new currently running file version. If the upgrade is successful, this new currently running file version is the upgrade file version that was just burned in.

[0066] Step S208: If the new version of the currently running file matches the version of the upgrade file, the editable chip upgrade is confirmed to be successful.

[0067] Specifically, the newly acquired version of the currently running file is compared with the previously burned version of the upgrade file. If the key information such as the version number is completely consistent, it means that the editable chip has successfully loaded and run the upgraded file, thus confirming that the upgrade of the editable chip is successful. If the two versions are inconsistent, it means that there may have been a problem during the upgrade process and the upgrade was unsuccessful.

[0068] The aforementioned programmable chip upgrade method is applied to the main control chip, and the main control chip and programmable chip are assembled in the same device. This design eliminates the need for an external dedicated programmer and programming interface, avoiding the complexity, increased cost, and risk of device damage associated with disassembling the device for programming, effectively improving the convenience of the upgrade and the security of the device. By obtaining the upgrade file information for the programmable chip and retrieving the current running file version from the programmable chip's configuration file, a comprehensive understanding of the key information required for the upgrade and the chip's current operating status can be obtained, laying the foundation for accurate subsequent upgrade operations. If the upgrade file information is successfully verified, the upgrade file version is programmed into the configuration file, ensuring that only verified and legitimate upgrade files can be programmed, improving the accuracy and reliability of the upgrade. Restarting the programmable chip and retrieving the new current running file version from the configuration file promptly reflects the chip's operating status after the upgrade. Finally, if the new current running file version matches the upgrade file version, the programmable chip upgrade is confirmed to be successful. This version matching mechanism ensures the correctness of the upgrade result. In summary, using the aforementioned programmable chip upgrade method to upgrade programmable chips ensures device stability.

[0069] In an exemplary embodiment, the editable chip upgrade method further includes: storing a new current running file version in the current file storage location of the first external configuration chip; returning to the steps of restarting the editable chip and retrieving the new current running file version from the configuration file; if the number of consecutive matches between the new current running file version and the upgrade file version meets the matching condition, then determining the new current running file version as a stable running version; and storing the stable running version in the stable file storage location of the first external configuration chip.

[0070] The first external configuration chip is specifically designed to store file version information related to the editable chip. It has a specific storage area division, including a current file storage location and a stable file storage location, used to store file versions in different states. The current file storage location is a dedicated storage area within the first external configuration chip for storing the currently used running file version. When a new running file version is generated for the editable chip, it is first stored in this location for subsequent matching and verification operations. The stable running version is determined after the new current running file version and the upgraded file version have met the matching criteria a certain number of consecutive matches. This version is considered stable and reliable, ensuring the editable chip functions normally under various operating conditions and reducing the probability of malfunctions or anomalies. The matching criteria are pre-set standards used to determine whether a new current running file version is stable. These are typically set based on actual needs and experience, such as 5, 10, or 100 consecutive successful matches. When the number of consecutive matches between the new current running file version and the upgraded file version reaches this set value, the matching criteria are considered met.

[0071] Specifically, during the upgrade process of the editable chip, after completing the upgrade-related operations and obtaining a new currently running file version, in addition to performing subsequent judgments as in the regular process, this new currently running file version is also stored in the current file storage location of the first external configuration chip. Then, the editable chip is restarted, and a new currently running file version is retrieved from the configuration file again. Next, it is checked whether the new currently running file version matches the upgrade file version, and the number of consecutive matches is recorded. If the number of consecutive matches meets a pre-set matching condition (e.g., 100 consecutive successful matches), this new currently running file version is determined as the stable running version, and finally, the stable running version is stored in the stable file storage location of the first external configuration chip.

[0072] In this embodiment, by storing the new current running file version in a specific location on the external configuration chip and verifying it through multiple matching steps to determine the stable running version, misjudgments caused by accidental factors can be avoided, ensuring that the upgraded version is stable and reliable, improving the stability and reliability of the system, and reducing faults and problems caused by version instability.

[0073] In an exemplary embodiment, the editable chip upgrade method further includes: during the operation of the editable chip, reading the currently running program of the editable chip at the current moment and the current running file version corresponding to the current running program; obtaining the local running program of the current running file version from the local database; and, if the local running program does not match the current running program, reprogramming the editable chip based on the stable running version.

[0074] The local database is stored on the local device and contains various program and version information. It can be a file-based database or a dedicated database management system that retrieves the local executable program corresponding to the currently running file version. The local executable program is obtained from the local database and corresponds to the currently running file version. This program is pre-stored locally and compared with the program currently running on the editable chip to determine if the chip is functioning correctly.

[0075] Specifically, during the normal operation of the editable chip, the main control chip reads the program currently running on the chip, as well as the version of the corresponding running file. It then searches the local database for and retrieves the local running program corresponding to the current running file version. The local running program is compared with the currently running program. If a mismatch is found, the chip is reprogrammed based on the previously determined stable running version, restoring the chip to a stable operating state.

[0076] In this embodiment, the program and version status are monitored in real time during the operation of the programmable chip. When a mismatch occurs, it can be repaired in a timely manner based on the stable running version, ensuring that the programmable chip always runs according to the correct program, reducing system failures caused by program errors, improving system stability and availability, and ensuring that the device can continue to work normally.

[0077] In an exemplary embodiment, the editable chip upgrade method further includes: if the new current running file version does not match the upgrade file version, re-burning the current running file version to the editable chip; and if a re-upgrade instruction is received, returning to the step of burning the upgrade file version in the upgrade file information to the upgrade configuration file until the new current running file version matches the upgrade file version.

[0078] The re-upgrade command is used to instruct the programmable chip upgrade operation to be performed again. When an error occurs during the upgrade process or the upgrade result does not meet the requirements, sending this command can trigger a re-upgrade process, attempting to burn the upgrade file version into the chip again.

[0079] Specifically, when the new current running file version does not match the upgrade file version, the current running file version is first re-programmed back into the editable chip. Then, it waits to receive a re-upgrade command. Once the command is received, it returns to the step of programming the upgrade file version from the upgrade file information into the upgrade configuration file and continues the upgrade operation until the new current running file version and the upgrade file version successfully match.

[0080] In this embodiment, a mechanism is provided to retry the upgrade when there is an upgrade mismatch. By re-burning and upgrading again, the probability of successful upgrade is increased, avoiding the termination of the entire upgrade process due to a single upgrade failure. This improves the flexibility and success rate of the upgrade and saves time and effort that would otherwise be required to perform complex operations due to upgrade failure.

[0081] In one exemplary embodiment, such as Figure 1 As shown, an editable chip upgrade system is also provided, including a main control chip 102 and an editable chip 104 interconnected; the main control chip 102 and the editable chip 104 are assembled in the same device; the main control chip 102 is used to obtain upgrade file information for upgrading the editable chip, and to obtain the current running file version of the editable chip 104 from the configuration file of the editable chip 104; if the upgrade file information verification is successful, the upgrade file version in the upgrade file information is burned to the upgrade configuration file; the editable chip 104 is restarted, and a new current running file version is obtained from the configuration file again; if the new current running file version matches the upgrade file version, the upgrade of the editable chip 104 is determined to be successful.

[0082] Specifically, this embodiment provides an editable chip upgrade system, which includes a main control chip 102 and an editable chip 104 interconnected and assembled in the same device. The main control chip 102 is responsible for obtaining upgrade file information for upgrading the editable chip 104 and retrieving the currently running file version from the configuration file of the editable chip 104. After successful verification of the upgrade file information, the upgrade file version is burned to the upgrade configuration file. Then, the editable chip 104 is restarted, and a new currently running file version is retrieved from the configuration file. If the new currently running file version matches the upgrade file version, the upgrade of the editable chip 104 is considered successful.

[0083] In this embodiment, the upgrade process is centrally controlled by the main control chip, which automates and standardizes the upgrade of the programmable chip, simplifies the upgrade operation, and improves the upgrade efficiency and accuracy.

[0084] In one exemplary embodiment, such as Figure 3As shown, the system also includes a reset module 106 and a second external configuration chip 108; the second external configuration chip is connected to the main control chip and the reset module.

[0085] The main control chip is also used to: store the new current running file version in the current file storage location of the first external configuration chip; return to the step of restarting the editable chip, and if the number of consecutive matches between the new current running file version and the upgrade file version meets the matching condition, then determine the new current running file version as the stable running version; store the stable running version in the stable file storage location of the first external configuration chip and in the second external configuration chip;

[0086] The reset module is used to: in the event that the editable chip fails to restart, start the editable chip using a stable running version in a second external configuration chip.

[0087] The reset module is used to reset the chip when an abnormal situation occurs (such as a failed reboot). The reset operation can restore the chip to its initial state or restart it in a specific manner, thereby resolving the problem of the chip malfunctioning due to an abnormality.

[0088] The second external configuration chip, connected to the main control chip and reset module, stores information such as the stable operating version. In emergency situations such as a failed restart of the programmable chip, it can provide the stable operating version, helping the chip to resume normal operation and enhancing the system's fault tolerance.

[0089] Specifically, in addition to the main control chip and the editable chip, the system also includes a reset module and a second external configuration chip, which are connected to the main control chip and the reset module. After storing the new currently running file version in the current file storage location of the first external configuration chip, the main control chip returns to the step of restarting the editable chip. If the number of consecutive matches between the new currently running file version and the upgraded file version meets the matching condition, the new currently running file version is determined as the stable running version and stored in the stable file storage location of the first external configuration chip and in the second external configuration chip. The function of the reset module is to start the editable chip using the stable running version in the second external configuration chip if the editable chip fails to restart. For example, if the editable chip CPLD starts normally, the CPLD will send a specific signal to the reset module to indicate that the CPLD is working normally. If the reset module does not receive the signal indicating normal operation from the CPLD after 1 minute, it will send a restart signal to the CPLD (a low level triggers a related restart signal of the CPLD). At this time, the CPLD will restart and start by loading the code of the stable running version in the external second external configuration chip.

[0090] In this embodiment, a reset module and a second external configuration chip are added, which can provide a backup startup scheme when the editable chip fails to restart, further improving the fault tolerance and stability of the system, ensuring that the editable chip can resume normal operation under various abnormal conditions, reducing the equipment downtime caused by the chip's inability to start, and improving the reliability and availability of the equipment.

[0091] In a specific embodiment, such as Figure 4 As shown in Example 1, an SOC chip 102 is used to upgrade the Anlu CPLD chip 104. The SOC chip mainly includes a CPU (Central Processing Unit) and an MCU (Microcontroller Unit). The SOC chip can then communicate with other external devices via USB, serial port, or Ethernet port. The SOC chip mainly uses the SPI signal to perform online upgrades on the Anlu CPLD. This upgrade method is determined by the online upgrade method of the Anlu CPLD. Since the SOC chip is connected to the built-in FLASH chip of the Anlu CPLD (the location where the Anlu CPLD stores the configuration file, i.e., the binary file to be burned) via the SPI signal, the SOC chip can read the configuration file inside the CPLD via the SPI signal. When compiling the binary file to be updated, version information, time information, and the address where the version information and time information are stored are attached to the file.

[0092] Specifically, the programmable chip upgrade method can be achieved through the following steps:

[0093] Step S101: Accept binary files generated by external devices via the USB interface, including file transfer using a USB flash drive and file transfer directly using USB from external devices;

[0094] Step S102: The external device transmits the binary file via the serial port;

[0095] Step S103: The external device transmits the binary file over the network;

[0096] Step S104: The SOC chip receives the file transmitted by the external device and identifies and judges the file name. If the file name does not conform to the specification, it is determined that the file does not belong to the binary file required for the upgrade, and the upgrade process is interrupted.

[0097] Step S105: After determining that the file name matches in S104, the chip model in the binary file is identified and compared with the chip model of the connected CPLD (this chip model is read from the CPLD via the SPI signal). If the model does not match, the upgrade process is terminated.

[0098] Step S106: Read the version information and time information from the file, and then compare them with the pre-stored version information and time information (this version information and time information are read from the CPLD by the SOC chip via SPI and then stored in a specific location). If the version information and time information have not been iteratively upgraded (i.e., the version in the received file is lower than the pre-stored version information and the time information is compared with the pre-stored time information), then the upgrade process is terminated.

[0099] Step S107: After verifying the file, the SOC chip uses SPI to read the currently running file version in the CPLD, naming this version S1. Then, the received upgrade file version is designated as S0, and version S2 is the stable running version. For example... Figure 5 As shown, the first external configuration chip (FLASH chip) is divided into three parts, and the files of versions S0 and S1 are stored in corresponding locations within the first external configuration chip. Version S2 is the stable operating version. After the device restarts 100 times and runs stably for 1000 hours, the version running on the device at this time is determined to be the stable operating version, and the data in the CPLD is read via the SPI signal and stored in the corresponding location of version S2.

[0100] Step S108: Perform an update operation, which involves burning the received S0 version binary file into the CPLD's built-in FLASH chip via SPI signal. Then jump to S109.

[0101] Step S109: After completing one programming cycle, the new version of the currently running file in the CPLD's built-in FLASH chip is read via SPI and compared with the received upgrade file version. If the two sets of data are completely consistent, the upgrade is considered successful, and the upgrade process ends. If an anomaly is found in the data comparison, the upgrade is considered failed, and the process jumps to step S108 to perform the upgrade again.

[0102] Specifically, regardless of whether it is a file recognition error or a version error, as long as the upgrade process fails to proceed smoothly, the SOC chip will send the corresponding error code, as shown in Table 1, which is the meaning of the error signal.

[0103] Table 1

[0104]

[0105] Example 2: Figure 6As shown, the SOC chip 102 can be used to upgrade the Gowin CPLD 104. Compared to upgrading the Anlu CPLD in Example 2, the SOC chip can upgrade the CPLD in more ways, including common communication signals such as SPI, I2C (Inter-Integrated Circuit), and JTAG (Joint Test Action Group). The SOC chip can also control the startup mode of the Gowin CPLD through configuration signals. The configuration signals include three control signal lines: the default is 000, in which case the CPLD reads the configuration file from the built-in FLASH chip to start, and the SOC chip mainly upgrades the configuration file in the CPLD's built-in FLASH chip directly through the JTAG signal; sending 200 indicates that the external host (here, the SOC chip) configures the CPLD via I2C; sending 002 indicates that the external host (here, the SOC chip) configures the CPLD via the SPI signal; sending 020 indicates that the CPLD starts via the external FLASH chip through the SPI signal. In this example, the SOC chip controls the external FLASH chip of the CPLD through the SPI signal.

[0106] Step S201: Accept binary files generated by external devices via the USB interface, including file transfer using a USB flash drive and file transfer directly using USB from external devices;

[0107] Step S202: The external device transmits the binary file via the serial port;

[0108] Step S203: The external device transmits the binary file over the network;

[0109] Step S204: The SOC chip receives the file transmitted by the external device and identifies and judges the file name. If the file name does not conform to the specification, it is determined that the file does not belong to the binary file required for the upgrade, and the upgrade process is interrupted.

[0110] Step S205: After determining that the file name matches in S204, the chip model in the binary file is identified and compared with the chip model of the connected CPLD. If the models do not match, the upgrade process is terminated.

[0111] Step S206: Read the version information and time information from the file, and then compare them with the pre-stored version information and time information (this version information and time information are read from the CPLD by the SOC chip via SPI and then stored in a specific location). If the version information and time information have not been iteratively upgraded (i.e., the version in the received file is higher than the pre-stored version information, and the time information is compared with the pre-stored time information), then the upgrade process is terminated.

[0112] Step S207: After verifying the file, the SOC chip uses SPI to read the data from the CPLD, naming this version S2. The received binary file version is then designated as S0, and S2 is the stable operating version. The first external configuration chip 110 (FLASH chip) is divided into three parts, storing the S0 and S2 versions of the file in their corresponding locations within the FLASH file. Version S2 is the stable operating version. After 200 device restarts and 2000 hours of stable operation, the version running on the device at this point is determined as the stable operating version, and the data in the CPLD is read via the SPI signal and stored in the corresponding location of version S2.

[0113] Step S208: Prepare for the update by reading the configuration file in the CPLD using the SPI signal, I2C signal, and JTAG signal respectively. If the file can be read successfully, it is determined that the CPLD can be updated using the signal.

[0114] Step S209: The SOC chip controls the control signal to 001; performs an update operation, that is, the received S0 version binary file is burned into the CPLD's built-in FLASH chip via the SPI signal.

[0115] Step S210: The SOC chip sets the control signal to 100; an update operation is performed, that is, the received S0 version binary file is burned into the CPLD's built-in FLASH chip via the I2C signal.

[0116] Step S211: The SOC chip sets the control signal to 000; an update operation is performed, which involves burning the received S0 version binary file into the CPLD's built-in FLASH chip via the JTAG signal.

[0117] Step S212: After completing one programming cycle, the data in the CPLD's built-in FLASH chip is read via SPI and compared with the received binary file. If the two sets of data are completely consistent, the upgrade is considered successful, and the upgrade process ends. If an anomaly is found in the data comparison, the upgrade is considered failed, and the process jumps to step S209 to re-upgrade.

[0118] Step S213: After completing one programming cycle, the data in the CPLD's built-in FLASH chip is read via I2C and compared with the received binary file. If the two sets of data are completely consistent, the upgrade is considered successful, and the upgrade process ends. If an anomaly is found in the data comparison, the upgrade is considered failed, and the process jumps to step S220 to re-upgrade.

[0119] Step S214: After completing one programming cycle, read the data from the CPLD's built-in FLASH chip via JTAG and compare it with the received binary file. If the two sets of data are completely identical, the upgrade is considered successful, and the upgrade process ends. If an anomaly is found in the data comparison, the upgrade is considered failed, and the process jumps to step S212 to re-upgrade.

[0120] Step S215: After completing an upgrade, the file of version S2 is stored on the FLASH chip (i.e., the second external configuration chip) of the CPLD via the SPI signal.

[0121] The reset module 106 primarily addresses the issue of the SOC chip failing to power on properly after a failed upgrade and subsequent restart. Specifically, in step S215, a stable CPLD version is stored in the external configuration chip 108. If the CPLD starts normally, it sends a specific signal to the reset module indicating normal operation. If the reset module does not receive this signal after one minute, it changes the configuration signal from 000 to 010 (at which point the SOC chip is not functioning correctly, and the default configuration signal is 000). Then, it sends a restart signal to the CPLD (a low-level signal triggers a related restart signal), causing the CPLD to restart and load the stable version of the code from the external FLASH chip 2.

[0122] Furthermore, after each programming process is completed, the original program and the programming program are synchronously stored on the on-board FLASH, SOC, and cloud.

[0123] In a specific embodiment, such as Figure 7 As shown, a method for upgrading an editable chip is also provided, applied to a main control chip; the main control chip and the editable chip are assembled in the same device; the method includes:

[0124] Step S701: Obtain upgrade file information for upgrading the editable chip, and obtain the current running file version of the editable chip from the configuration file of the editable chip;

[0125] Step S702: If the upgrade file information is successfully verified, the upgrade file version in the upgrade file information is burned to the configuration file.

[0126] Step S703: Restart the editable chip and retrieve the new version of the currently running file from the configuration file;

[0127] Step S704: Determine whether the new version of the currently running file matches the version of the upgrade file;

[0128] If the new current running file version does not match the upgrade file version, execute step S705 to re-burn the current running file version to the editable chip;

[0129] If a re-upgrade instruction is received, return to step S702 until the new version of the currently running file matches the version of the upgrade file;

[0130] If the new current running file version matches the upgrade file version, step S706 confirms that the editable chip upgrade was successful;

[0131] Step S707: Store the new version of the currently running file in the current file storage location of the first external configuration chip;

[0132] Step S708: Determine whether the number of consecutive matches between the new currently running file version and the upgrade file version meets the matching condition;

[0133] If not satisfied, return to step S703;

[0134] If the conditions are met, proceed to step S709 to determine the new version of the currently running file as the stable running version;

[0135] Step S710: Store the stable running version in the stable file storage location of the first external configuration chip;

[0136] Step S711: During the operation of the editable chip, read the currently running program of the editable chip at the current moment and the version of the currently running file corresponding to the currently running program;

[0137] Step S712: Obtain the local running program of the current running file version from the local database;

[0138] Step S713: If the local running program does not match the currently running program, the editable chip is reprogrammed based on the stable running version.

[0139] 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.

[0140] Based on the same inventive concept, this application also provides an editable chip upgrade apparatus for implementing the editable chip upgrade 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 embodiments of the editable chip upgrade apparatus provided below can be found in the limitations of the editable chip upgrade method described above, and will not be repeated here.

[0141] In one exemplary embodiment, such as Figure 8 As shown, an editable chip upgrade device 800 is provided, including: an information acquisition module 802, a file burning module 804, a chip restart module 806, and a version matching module 808, wherein:

[0142] The information acquisition module 802 is used to acquire upgrade file information for upgrading the editable chip, and to obtain the current running file version of the editable chip from the configuration file of the editable chip;

[0143] The file burning module 804 is used to burn the upgrade file version in the upgrade file information to the configuration file if the upgrade file information is successfully verified.

[0144] The chip restart module 806 is used to restart the editable chip and retrieve the new version of the currently running file from the configuration file.

[0145] Version matching module 808 is used to determine if the editable chip upgrade is successful if the new version of the currently running file matches the version of the upgrade file.

[0146] In one exemplary embodiment, the programmable chip upgrade device 800 further includes a backup module, specifically used for:

[0147] Store the new version of the currently running file in the current file storage location of the first external configuration chip;

[0148] Return to the steps of restarting the editable chip and retrieving the new version of the currently running file from the configuration file;

[0149] If the number of consecutive matches between the new current running file version and the upgrade file version meets the matching condition, then the new current running file version is determined as the stable running version;

[0150] The stable running version is stored in the stable file storage location of the first external configuration chip.

[0151] In one exemplary embodiment, the programmable chip upgrade device 800 further includes a program matching module, specifically used for:

[0152] During the operation of the editable chip, read the currently running program of the editable chip at the current moment, as well as the version of the currently running file corresponding to the currently running program;

[0153] Retrieve the currently running version of the local executable from the local database;

[0154] If the local running program is incompatible with the currently running program, the programmable chip can be reprogrammed based on the stable running version.

[0155] In one exemplary embodiment, the programmable chip upgrade device 800 further includes a reprogramming module, specifically used for:

[0156] If the new version of the current running file does not match the version of the upgrade file, the current running file version will be re-burned to the editable chip;

[0157] Upon receiving a re-upgrade instruction, return to the step of burning the upgrade file version from the upgrade file information to the configuration file until the new current running file version matches the upgrade file version.

[0158] Each module in the aforementioned programmable chip upgrade device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to each module.

[0159] In one exemplary embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 9As shown, the computer device includes a processor, memory, input / output interfaces, a communication interface, a display unit, and an input device. The processor, memory, and input / output interfaces are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interfaces. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The input / output interfaces are used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, Near Field Communication (NFC), or other technologies. When the computer program is executed by the processor, it implements a programmable chip upgrade method. The display unit is used to form a visually visible image and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.

[0160] Those skilled in the art will understand that Figure 9 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 device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0161] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the method described above.

[0162] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps of the above-described method.

[0163] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps of the method described above.

[0164] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.

[0165] 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 above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.

[0166] 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 application.

[0167] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. 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 application should be determined by the appended claims.

Claims

1. A method for upgrading an editable chip, characterized in that, Applied to a main control chip; the main control chip and the programmable chip are assembled in the same device; the method includes: Obtain upgrade file information for upgrading the editable chip, and obtain the current running file version of the editable chip from the configuration file of the editable chip; If the upgrade file information is successfully verified, the upgrade file version in the upgrade file information will be burned into the configuration file; Restart the editable chip and retrieve the new version of the currently running file from the configuration file; If the new current running file version matches the upgrade file version, the editable chip upgrade is determined to be successful.

2. The method according to claim 1, characterized in that, The method further includes: The new version of the currently running file is stored in the current file storage location of the first external configuration chip; Return to the steps of restarting the editable chip and retrieving the new version of the currently running file from the configuration file; If the number of consecutive matches between the new current running file version and the upgrade file version meets the matching condition, then the new current running file version is determined as a stable running version; The stable running version is stored in the stable file storage location of the first external configuration chip.

3. The method according to claim 2, characterized in that, The method further includes: During the operation of the editable chip, the currently running program of the editable chip at the current moment, and the current running file version corresponding to the currently running program are read; Retrieve the local running program of the currently running file version from the local database; If the local running program does not match the currently running program, the programmable chip is reprogrammed based on the stable running version.

4. The method according to claim 1, characterized in that, The method further includes: If the new current running file version does not match the upgrade file version, the current running file version will be re-burned to the editable chip; Upon receiving a re-upgrade instruction, the process returns to the step of burning the upgrade file version from the upgrade file information to the configuration file until the new currently running file version matches the upgrade file version.

5. An editable chip upgrade system, characterized in that, It includes a main control chip and an editable chip that are interconnected; the main control chip and the editable chip are assembled in the same device; The main control chip is used to obtain upgrade file information for upgrading the editable chip, and to obtain the current running file version of the editable chip from the configuration file of the editable chip; If the upgrade file information is successfully verified, the upgrade file version in the upgrade file information will be burned into the configuration file; Restart the editable chip and retrieve the new version of the currently running file from the configuration file; If the new current running file version matches the upgrade file version, the editable chip upgrade is determined to be successful.

6. The system according to claim 5, characterized in that, The system also includes a reset module and a second external configuration chip; the second external configuration chip is connected to the main control chip and the reset module. The main control chip is also used for: The new version of the currently running file is stored in the current file storage location of the first external configuration chip; Returning to the step of restarting the editable chip, if the number of consecutive matches between the new current running file version and the upgrade file version meets the matching condition, then the new current running file version is determined as the stable running version; The stable running version is stored in the stable file storage location of the first external configuration chip and in the second external configuration chip; The reset module is used for: In the event that the editable chip fails to restart, the editable chip is started using a stable running version in the second external configuration chip.

7. An editable chip upgrade device, characterized in that, The device includes: The information acquisition module is used to acquire upgrade file information for upgrading the editable chip, and to acquire the current running file version of the editable chip from the configuration file of the editable chip; The file burning module is used to burn the upgrade file version in the upgrade file information to the configuration file if the upgrade file information is successfully verified. The chip restart module is used to restart the editable chip and retrieve a new version of the currently running file from the configuration file. The version matching module is used to determine that the editable chip upgrade is successful if the new version of the currently running file matches the version of the upgrade file.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 4.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 4.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 4.