CN116126382A - Online upgrade method and device for complex programmable logic device - Google Patents

Online upgrade method and device for complex programmable logic device Download PDF

Info

Publication number
CN116126382A
CN116126382A CN202310142777.0A CN202310142777A CN116126382A CN 116126382 A CN116126382 A CN 116126382A CN 202310142777 A CN202310142777 A CN 202310142777A CN 116126382 A CN116126382 A CN 116126382A
Authority
CN
China
Prior art keywords
programmable logic
logic device
complex programmable
mirror image
register value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310142777.0A
Other languages
Chinese (zh)
Inventor
刘齐
张锡鑫
陈翔
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202310142777.0A priority Critical patent/CN116126382A/en
Publication of CN116126382A publication Critical patent/CN116126382A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • G06F8/654Updates using techniques specially adapted for alterable solid state memories, e.g. for EEPROM or flash memories
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The application relates to an online upgrade method of a complex programmable logic device, wherein the complex programmable logic device comprises a static random access memory, and the method comprises the following steps: in response to an upgrade instruction to a static random access memory, activating a data read operation of an uninterrupted update register of the complex programmable logic device, reading a register value of at least one register in the complex programmable logic device, and writing the register value into a memory; responding to a register value rewriting instruction, and acquiring a physical address of a register value to be rewritten; based on the physical address mapping of the register value to be rewritten, obtaining the physical address of the register value to be rewritten in the memory, and rewriting and storing the register value to be rewritten; and in response to the static random access memory upgrading instruction, activating the data writing operation of the interrupt-free updating register, and writing the register value stored into the memory back to the register.

Description

Online upgrade method and device for complex programmable logic device
Technical Field
The present disclosure relates to the field of data exchange devices, and in particular, to a method and apparatus for online upgrade of a complex programmable logic device.
Background
The data exchange equipment is a common name of technology for transmitting information to corresponding routes meeting the requirements by using a manual or automatic equipment method according to the requirement of information transmission at two ends of communication.
As Complex Programmable Logic Devices (CPLDs) are being applied deep in data switching devices, the role that CPLDs play in the application of data switching devices is becoming more and more important. The reason for this is that: in order to meet the requirements of application scenarios of the data exchange device, the ports of the data exchange device are more and more, and with the more and more complex management of the ports of the data exchange device, in order to reduce the number of data lines in the data exchange device, in the prior art, a CPLD is usually connected between the ports of the data exchange device and the chips of the data exchange device, so as to expand the number of data lines.
In the prior art, because the data exchange equipment iterates and the CPLD is required to be updated online in order to ensure the normal operation of the CPLD, the value of a register of the data exchange equipment is changed in the process of online updating the CPLD, but the value of the register cannot be ensured not to be lost in the process of online updating the CPLD based on the existing CPLD online updating method.
Therefore, there is an urgent need to provide a method and apparatus for online upgrade of a complex programmable logic device to solve the above technical problems.
Disclosure of Invention
Based on this, it is necessary to provide a method and a device for online upgrade of a complex programmable logic device, which can ensure that the register value is not lost in the process of online upgrade of the CPLD, aiming at the technical problems described above.
In one aspect, a method for online upgrade of a complex programmable logic device is provided, the complex programmable logic device includes a static random access memory, the method includes:
in response to an upgrade instruction to a static random access memory, activating a data read operation of an uninterrupted update register of the complex programmable logic device, reading a register value of at least one register in the complex programmable logic device, and writing the register value into a memory;
responding to a register value rewriting instruction, and acquiring a physical address of a register value to be rewritten;
based on the physical address mapping of the register value to be rewritten, obtaining the physical address of the register value to be rewritten in the memory, and rewriting and storing the register value to be rewritten;
and in response to the static random access memory upgrading instruction, activating the data writing operation of the interrupt-free updating register, and writing the register value stored into the memory back to the register.
In one embodiment, the method further comprises: loading a new mirror image of the complex programmable logic device to the mobile storage unit in response to an online upgrade instruction of the complex programmable logic device; and mounting the mobile storage unit to data exchange equipment where the complex programmable logic device is located, copying the new mirror image of the complex programmable logic device to the flash memory of the complex programmable logic device, and executing online upgrading operation on the complex programmable logic device.
In one embodiment, the method further comprises: responding to an online upgrade instruction of a complex programmable logic device, and uploading a new mirror image of the complex programmable logic device to a server; and communicatively connecting the complex programmable logic device to the server, copying the new mirror image of the complex programmable logic device to the flash memory of the complex programmable logic device, and executing online upgrade operation on the complex programmable logic device.
In one embodiment, performing an online upgrade operation on the complex programmable logic device further comprises: locking an output pin of the static random access memory which is running based on the old mirror image of the complex programmable logic device in response to the static random access memory update instruction; after the output pin of the static random access memory is locked, writing a new mirror image of the complex programmable logic device in the flash memory into the static random access memory so as to upgrade the static random access memory; and after the static random access memory is upgraded, unlocking an output pin of the static random access memory running based on the new mirror image of the complex programmable logic device.
In one embodiment, before copying the new mirror image of the complex programmable logic device to the flash memory of the complex programmable logic device, the method further comprises: identifying a mirror image check code pre-packaged in a new mirror image of the complex programmable logic device; comparing the mirror image check code with the firmware check code of the complex programmable logic device; and if the mirror image check code is consistent with the firmware check code of the complex programmable logic device, copying the new mirror image of the complex programmable logic device to the flash memory of the complex programmable logic device.
In one embodiment, before copying the new mirror image of the complex programmable logic device to the flash memory of the complex programmable logic device, the method further comprises: acquiring a private key pre-packaged in a new mirror image of the complex programmable logic device; comparing the private key with a public key pre-stored in a system directory of data exchange equipment where the complex programmable logic device is located; and if the private key is successfully compared with the public key prestored in the system directory of the data exchange equipment where the complex programmable logic device is located, copying the new mirror image of the complex programmable logic device to the flash memory of the complex programmable logic device.
In one embodiment, before copying the new mirror image of the complex programmable logic device to the flash memory of the complex programmable logic device, the method further comprises: obtaining the mirror image type in the new mirror image of the complex programmable logic device; matching the mirror image type of the new mirror image of the complex programmable logic device with the type of the complex programmable logic device; and if the mirror type of the new mirror image of the complex programmable logic device is successfully matched with the type of the complex programmable logic device, copying the new mirror image of the complex programmable logic device to the flash memory of the complex programmable logic device.
In another aspect, an online upgrade apparatus for a complex programmable logic device is provided, the complex programmable logic device including a static random access memory, the apparatus comprising:
a data writing unit, configured to activate a data reading operation of an uninterrupted update register of the complex programmable logic device in response to an upgrade instruction for the static random access memory, read a register value of at least one register in the complex programmable logic device, and write the register value into a memory;
an obtaining unit configured to obtain a physical address of a register value to be rewritten in response to a register value rewriting instruction;
The data writing unit is further configured to obtain a physical address of the register value to be rewritten in the memory based on the physical address mapping of the register value to be rewritten, and rewrite and store the register value to be rewritten; and the data writing operation of the interrupt-free update register is activated in response to the static random access memory upgrading instruction, and the register value stored in the memory is written back to the register.
In yet another aspect, a computer device is provided comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the steps of:
in response to an upgrade instruction to a static random access memory, activating a data read operation of an uninterrupted update register of the complex programmable logic device, reading a register value of at least one register in the complex programmable logic device, and writing the register value into a memory;
responding to a register value rewriting instruction, and acquiring a physical address of a register value to be rewritten;
based on the physical address mapping of the register value to be rewritten, obtaining the physical address of the register value to be rewritten in the memory, and rewriting and storing the register value to be rewritten;
And in response to the static random access memory upgrading instruction, activating the data writing operation of the interrupt-free updating register, and writing the register value stored into the memory back to the register.
In yet another aspect, a computer readable storage medium is provided, having stored thereon a computer program which when executed by a processor performs the steps of:
in response to an upgrade instruction to a static random access memory, activating a data read operation of an uninterrupted update register of the complex programmable logic device, reading a register value of at least one register in the complex programmable logic device, and writing the register value into a memory;
responding to a register value rewriting instruction, and acquiring a physical address of a register value to be rewritten;
based on the physical address mapping of the register value to be rewritten, obtaining the physical address of the register value to be rewritten in the memory, and rewriting and storing the register value to be rewritten;
and in response to the static random access memory upgrading instruction, activating the data writing operation of the interrupt-free updating register, and writing the register value stored into the memory back to the register.
The method and the device for online upgrading the complex programmable logic device comprise the following steps: in response to an upgrade instruction to a static random access memory, activating a data read operation of an uninterrupted update register of the complex programmable logic device, reading a register value of at least one register in the complex programmable logic device, and writing the register value into a memory; responding to a register value rewriting instruction, and acquiring a physical address of a register value to be rewritten; based on the physical address mapping of the register value to be rewritten, obtaining the physical address of the register value to be rewritten in the memory, and rewriting and storing the register value to be rewritten; and in response to the static random access memory upgrading instruction, activating the data writing operation of the interrupt-free updating register, and writing the register value stored into the memory back to the register. In the process of online upgrading of the complex programmable logic device, the stability of the whole complex programmable logic device is relatively poor, register values of registers in the complex programmable logic device are extremely easy to lose, and once the register values of the registers are lost, the whole complex programmable logic device is down; based on the method, the register value of the register can be effectively ensured not to be lost by reading and latching the register value of the complex programmable logic device into the memory, and the integrity and the safety of data are improved; after receiving the instruction of finishing the upgrade of the static random access memory, writing the register value pre-stored into the memory back into the corresponding register, thereby effectively ensuring that the complex programmable logic device can operate based on the original data after the upgrade without resetting the register value of the register in the complex programmable logic device, and further improving the working efficiency of the complex programmable logic device; the method comprises the steps of carrying out a first treatment on the surface of the
Further, performing an online upgrade operation on the complex programmable logic device, further comprising: locking an output pin of the static random access memory which is running based on the old mirror image of the complex programmable logic device in response to the static random access memory update instruction; after the output pin of the static random access memory is locked, writing a new mirror image of the complex programmable logic device in the flash memory into the static random access memory so as to upgrade the static random access memory; and after the static random access memory is upgraded, unlocking an output pin of the static random access memory running based on the new mirror image of the complex programmable logic device. On the basis of the technical scheme, on-line upgrading operation is performed on the complex programmable logic device, on-line upgrading and real-time operation of the complex programmable logic device are realized under the conditions that no extra hardware cost is generated and the complex programmable logic device is not powered off or restarted, and the working efficiency of the data exchange equipment of the complex programmable logic device is improved.
Drawings
FIG. 1 is a flow chart of an online upgrade method of a complex programmable logic device in one embodiment;
FIG. 2 is a flow chart of an online upgrade method of a complex programmable logic device in one embodiment;
FIG. 3 is a block diagram of an apparatus for online upgrade of a complex programmable logic device in one embodiment;
fig. 4 is an internal structural diagram of a computer device in one embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present application.
The online upgrade method for the complex programmable logic device provided by the application, wherein the complex programmable logic device comprises a static random access memory, as shown in fig. 1, comprises the following steps:
s1, copying a new mirror image of a complex programmable logic device to a switch where the complex programmable logic device is located;
s2, checking the integrity of the new mirror image of the complex programmable logic device, performing platform checking on the new mirror image of the complex programmable logic device, and performing type matching on the complex programmable logic device and the new mirror image of the complex programmable logic device;
And step S3, based on the new mirror image of the complex programmable logic device, performing online upgrade operation on the complex programmable logic device.
In one embodiment, copying a new mirror image of a complex programmable logic device to a switch in which the complex programmable logic device resides includes: loading a new mirror image of the complex programmable logic device to the mobile storage unit; mounting the mobile storage unit to a switch where the complex programmable logic device is located; and copying the new mirror image of the complex programmable logic device to the complex programmable logic device after the mobile storage unit is mounted to the switch.
In some practical application scenarios, the data center does not allow the switch to be externally connected with the mobile storage unit; the mobile storage unit is externally connected to the switch, so that on one hand, the risk of data leakage exists, and on the other hand, viruses possibly carried in the mobile storage unit can influence the normal operation of the switch; in view of this, in one embodiment, copying a new mirror of a complex programmable logic device to a switch where the complex programmable logic device resides includes: uploading the new mirror image of the complex programmable logic device to a server; and communicatively connecting the complex programmable logic device to the server, and downloading a new mirror image of the complex programmable logic device to the complex programmable logic device from the server.
To ensure that the new image of the complex programmable logic device copied to the switch is not corrupted, one embodiment of verifying the integrity of the new image of the complex programmable logic device includes: identifying a mirror image check code pre-packaged in a new mirror image of the complex programmable logic device; comparing the mirror image check code with the firmware check code of the complex programmable logic device; and if the mirror image check code is consistent with the firmware check code of the complex programmable logic device, copying the new mirror image of the complex programmable logic device to the flash memory of the complex programmable logic device. The check codes comprise sha256sum check codes and md5sum check codes.
In an actual application scene, the number of the switches is relatively large, so that platform verification is required to be performed on the new mirror image of the complex programmable logic device in order to avoid abnormal working state of the switches caused by the fact that the switches are not matched with the new mirror image of the complex programmable logic device. In one embodiment, performing platform verification on a new image of a complex programmable logic device includes: acquiring a private key pre-packaged in a new mirror image of the complex programmable logic device; comparing the private key with a public key pre-stored in a system directory of a switch where the complex programmable logic device is located; and if the private key is successfully compared with the public key prestored in the system directory of the switch where the complex programmable logic device is located, copying the new mirror image of the complex programmable logic device to the flash memory of the complex programmable logic device. Specifically, the public key is typically present in some system directory under the switch. The public key and the private key are generated by using an opensl tool, the private key is stored in the head of the new mirror image of the complex programmable logic device, and the public key is stored under a specific directory of the switch. And extracting a private key in a new mirror image of the complex programmable logic device in the online upgrading process of the complex programmable logic device, checking the private key and the private key again by using an opensl tool, and performing the next operation after the public key and the private key are successfully compared.
In an actual application scenario, multiple types of complex programmable logic devices, such as port_cpld, cpu_cpld, smb_cpld, psu_cpld, etc., exist in the same switch, and these CPLD images belong to the same switch platform, but if an online upgrade is performed on the complex programmable logic device by using an image that is not adapted to the complex programmable logic device, the switch function will be abnormal. Therefore, there is a need for type matching complex programmable logic devices with new images of complex programmable logic devices. Specifically, performing type matching on the complex programmable logic device and the new mirror image of the complex programmable logic device includes: in the process of performing online upgrade on a complex programmable logic device, firstly, the type of the complex programmable logic device to be upgraded is sent to an upgrade script, the upgrade script is matched with a key in a new mirror image of the complex programmable logic device based on the type of the complex programmable logic device, and if the mirror image type of the new mirror image of the complex programmable logic device is successfully matched with the type of the complex programmable logic device, the new mirror image of the complex programmable logic device is copied to a flash memory of the complex programmable logic device. It should be appreciated that the keys in the new mirror of the complex programmable logic device are used to represent the type of new mirror of the complex programmable logic device.
In one embodiment, performing an online upgrade operation on the complex programmable logic device based on the new mirror image of the complex programmable logic device includes: and performing an online upgrade operation on the flash memory of the complex programmable logic device, and performing an online upgrade operation on the static random access memory of the complex programmable logic device. It should be understood that the complex programmable logic device includes a flash memory and a static random access memory, wherein the flash memory is a nonvolatile memory, and is characterized in that the power failure does not lose the mirror image, but the operation speed is slow; static random access memory operates at a fast speed, but loses data when powered down. Thus, the image of the complex programmable logic device is typically stored in flash memory, and is loaded into sram when the switching device is running. That is, when the switching device with the complex programmable logic device is in the standby state, the mirror image is stored in the flash memory of the complex programmable logic device, and when the switching device with the complex programmable logic device needs to operate, the mirror image in the flash memory is loaded into the sram, so that the switching device operates based on the mirror image in the sram.
In one embodiment, performing an online upgrade operation on a flash memory of a complex programmable logic device includes: and pulling up the upgrade register to copy the new mirror image of the complex programmable logic device into the flash memory of the complex programmable logic device.
In one embodiment, performing an online upgrade operation on a static random access memory of a complex programmable logic device includes: locking an output pin of the static random access memory which is running based on the old mirror image of the complex programmable logic device in response to the static random access memory update instruction; after the output pin of the static random access memory is locked, writing a new mirror image of the complex programmable logic device in the flash memory into the static random access memory so as to upgrade the static random access memory; and after the static random access memory is upgraded, unlocking an output pin of the static random access memory running based on the new mirror image of the complex programmable logic device.
In one embodiment, to prevent register data in the switch registers from being lost when performing an online upgrade operation on the static random access memory of the complex programmable logic device, the method further comprises, when performing an online upgrade operation on the static random access memory of the complex programmable logic device: in response to an upgrade instruction to a static random access memory, activating a data read operation of an uninterrupted update register (Hitless register) of the complex programmable logic device, reading a register value of at least one register in the complex programmable logic device, and writing the register value into a memory; responding to a register value rewriting instruction, and acquiring a physical address of a register value to be rewritten; based on the physical address mapping of the register value to be rewritten, obtaining the physical address of the register value to be rewritten in the memory, and rewriting and storing the register value to be rewritten; and in response to the static random access memory upgrading instruction, activating the data writing operation of the interrupt-free updating register, and writing the register value stored into the memory back to the register. It should be appreciated that activating the data read operation of the interrupt-free update register of the complex programmable logic device includes: pulling up the pin level of an uninterrupted update register of the complex programmable logic device, namely setting the pin level of the uninterrupted update register to be high level; activating a data write operation of the interrupt-free update register, comprising: and pulling down the pin level of the uninterrupted update register of the complex programmable logic device, namely setting the pin level of the uninterrupted update register to be low level. It should be understood that, in an actual application scenario, after the data read operation of the Hitless update register (Hitless register) of the complex programmable logic device is activated in response to the upgrade instruction of the sram, the method further includes: and reading a register value of each register in the complex programmable logic device, and writing the register value into a memory.
An online upgrade method for a complex programmable logic device is provided, as shown in fig. 2, wherein the complex programmable logic device comprises a static random access memory, and the method comprises the following steps:
in response to an upgrade instruction to a static random access memory, activating a data read operation of an uninterrupted update register of the complex programmable logic device, reading a register value of at least one register in the complex programmable logic device, and writing the register value into a memory;
responding to a register value rewriting instruction, and acquiring a physical address of a register value to be rewritten;
based on the physical address mapping of the register value to be rewritten, obtaining the physical address of the register value to be rewritten in the memory, and rewriting and storing the register value to be rewritten;
and in response to the static random access memory upgrading instruction, activating the data writing operation of the interrupt-free updating register, and writing the register value stored into the memory back to the register.
In one embodiment, the method further comprises: loading a new mirror image of the complex programmable logic device to the mobile storage unit in response to an online upgrade instruction of the complex programmable logic device; mounting the mobile storage unit to data exchange equipment where the complex programmable logic device is located, copying a new mirror image of the complex programmable logic device to a flash memory of the complex programmable logic device, and executing online upgrade operation on the complex programmable logic device; wherein the data switching device includes, but is not limited to, a switch.
In one embodiment, the method further comprises: responding to an online upgrade instruction of a complex programmable logic device, and uploading a new mirror image of the complex programmable logic device to a server; and communicatively connecting the complex programmable logic device to the server, copying the new mirror image of the complex programmable logic device to the flash memory of the complex programmable logic device, and executing online upgrade operation on the complex programmable logic device.
In one embodiment, performing an online upgrade operation on the complex programmable logic device further comprises: locking an output pin of the static random access memory which is running based on the old mirror image of the complex programmable logic device in response to the static random access memory update instruction; after the output pin of the static random access memory is locked, writing a new mirror image of the complex programmable logic device in the flash memory into the static random access memory so as to upgrade the static random access memory; and after the static random access memory is upgraded, unlocking an output pin of the static random access memory running based on the new mirror image of the complex programmable logic device.
In one embodiment, before copying the new mirror image of the complex programmable logic device to the flash memory of the complex programmable logic device, the method further comprises: identifying a mirror image check code pre-packaged in a new mirror image of the complex programmable logic device; comparing the mirror image check code with the firmware check code of the complex programmable logic device; and if the mirror image check code is consistent with the firmware check code of the complex programmable logic device, copying the new mirror image of the complex programmable logic device to the flash memory of the complex programmable logic device.
In one embodiment, before copying the new mirror image of the complex programmable logic device to the flash memory of the complex programmable logic device, the method further comprises: acquiring a private key pre-packaged in a new mirror image of the complex programmable logic device; comparing the private key with a public key pre-stored in a system directory of data exchange equipment where the complex programmable logic device is located; and if the private key is successfully compared with the public key prestored in the system directory of the data exchange equipment where the complex programmable logic device is located, copying the new mirror image of the complex programmable logic device to the flash memory of the complex programmable logic device.
In one embodiment, before copying the new mirror image of the complex programmable logic device to the flash memory of the complex programmable logic device, the method further comprises: obtaining the mirror image type in the new mirror image of the complex programmable logic device; matching the mirror image type of the new mirror image of the complex programmable logic device with the type of the complex programmable logic device; and if the mirror type of the new mirror image of the complex programmable logic device is successfully matched with the type of the complex programmable logic device, copying the new mirror image of the complex programmable logic device to the flash memory of the complex programmable logic device.
It should be understood that, although the steps in the flowcharts of fig. 1-2 are shown in order as indicated by the arrows, these steps are not necessarily performed in order as indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in fig. 1-2 may include multiple sub-steps or phases that are not necessarily performed at the same time, but may be performed at different times, nor does the order in which the sub-steps or phases are performed necessarily occur sequentially, but may be performed alternately or alternately with at least a portion of the sub-steps or phases of other steps or other steps.
In one embodiment, as shown in fig. 3, there is provided an online upgrade apparatus for a complex programmable logic device, including: a data writing unit and an acquisition unit, wherein:
a data writing unit, configured to activate a data reading operation of an uninterrupted update register of the complex programmable logic device in response to an upgrade instruction for the static random access memory, read a register value of at least one register in the complex programmable logic device, and write the register value into a memory;
an obtaining unit configured to obtain a physical address of a register value to be rewritten in response to a register value rewriting instruction;
the data writing unit is further configured to obtain a physical address of the register value to be rewritten in the memory based on the physical address mapping of the register value to be rewritten, and rewrite and store the register value to be rewritten; and the data writing operation of the interrupt-free update register is activated in response to the static random access memory upgrading instruction, and the register value stored in the memory is written back to the register.
In one embodiment, the apparatus further comprises a loading unit, a mounting unit, and a copying unit; the loading unit is used for responding to the online upgrade instruction of the complex programmable logic device and loading a new mirror image of the complex programmable logic device to the mobile storage unit; the mounting unit is used for mounting the mobile storage unit to the data exchange equipment where the complex programmable logic device is located; and the copying unit is used for copying the new mirror image of the complex programmable logic device to the flash memory of the complex programmable logic device and executing online upgrading operation on the complex programmable logic device.
In one embodiment, the device further includes an uploading unit, configured to upload a new image of the complex programmable logic device to a server in response to an online upgrade instruction of the complex programmable logic device; the copying unit is used for communicatively connecting the complex programmable logic device to the server, copying the new mirror image of the complex programmable logic device to the flash memory of the complex programmable logic device, and executing online upgrading operation on the complex programmable logic device.
In one embodiment, the apparatus further comprises a pin locking unit and a pin unlocking unit, wherein the pin locking unit is used for locking an output pin of the static random access memory which is running based on an old image of the complex programmable logic device in response to the static random access memory updating instruction; the data writing unit is further configured to write a new mirror image of the complex programmable logic device in the flash memory into the sram after the output pin of the sram is locked, so as to upgrade the sram; and the pin unlocking unit is used for unlocking the output pin of the static random access memory running based on the new mirror image of the complex programmable logic device after the static random access memory is upgraded.
In one embodiment, the apparatus further comprises an identification unit and an alignment unit; the identification unit is used for identifying the mirror image check code pre-packaged in the new mirror image of the complex programmable logic device; the comparison unit is also used for comparing the mirror image check code with the firmware check code of the complex programmable logic device; and the copying unit is also used for copying the new mirror image of the complex programmable logic device to the flash memory of the complex programmable logic device if the mirror image check code is consistent with the firmware check code of the complex programmable logic device.
In one embodiment, the obtaining unit is further configured to obtain a private key pre-packaged in the new image of the complex programmable logic device; the comparison unit is also used for comparing the private key with a public key pre-stored in a system directory of the data exchange equipment where the complex programmable logic device is located; and the copying unit is also used for copying the new mirror image of the complex programmable logic device to the flash memory of the complex programmable logic device if the private key is successfully compared with the public key prestored in the system directory of the data exchange equipment where the complex programmable logic device is located.
In one embodiment, the apparatus further comprises a matching unit; the acquisition unit is used for acquiring the image type in the new image of the complex programmable logic device; matching the mirror image type of the new mirror image of the complex programmable logic device with the type of the complex programmable logic device; and if the mirror type of the new mirror image of the complex programmable logic device is successfully matched with the type of the complex programmable logic device, copying the new mirror image of the complex programmable logic device to the flash memory of the complex programmable logic device.
For specific limitation of the online upgrade apparatus of the complex programmable logic device, reference may be made to the above limitation of the online upgrade method of the complex programmable logic device, which is not described herein. The modules in the online upgrade device of the complex programmable logic device can be all or partially realized by software, hardware and a combination thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
Example IV
In one embodiment, a computer device is provided, which may be a terminal, and the internal structure of which may be as shown in fig. 4. The computer device includes a processor, a memory, a network interface, a display screen, and an input device connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program, when executed by the processor, implements a method for online upgrade of a complex programmable logic device. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, can also be keys, a track ball or a touch pad arranged on the shell of the computer equipment, and can also be an external keyboard, a touch pad or a mouse and the like.
Those skilled in the art will appreciate that the structures shown in FIG. 4 are block diagrams only and do not constitute a limitation of the computer device on which the present aspects apply, and that a particular computer device may include more or less components than those shown, or may combine some of the components, or have a different arrangement of components.
In one embodiment, a computer device is provided comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the steps of when executing the computer program:
in response to an upgrade instruction to a static random access memory, activating a data read operation of an uninterrupted update register of the complex programmable logic device, reading a register value of at least one register in the complex programmable logic device, and writing the register value into a memory;
responding to a register value rewriting instruction, and acquiring a physical address of a register value to be rewritten;
based on the physical address mapping of the register value to be rewritten, obtaining the physical address of the register value to be rewritten in the memory, and rewriting and storing the register value to be rewritten;
And in response to the static random access memory upgrading instruction, activating the data writing operation of the interrupt-free updating register, and writing the register value stored into the memory back to the register.
In one embodiment, the processor when executing the computer program further performs the steps of:
loading a new mirror image of the complex programmable logic device to the mobile storage unit in response to an online upgrade instruction of the complex programmable logic device; and mounting the mobile storage unit to data exchange equipment where the complex programmable logic device is located, copying the new mirror image of the complex programmable logic device to the flash memory of the complex programmable logic device, and executing online upgrading operation on the complex programmable logic device.
In one embodiment, the processor when executing the computer program further performs the steps of:
responding to an online upgrade instruction of a complex programmable logic device, and uploading a new mirror image of the complex programmable logic device to a server; and communicatively connecting the complex programmable logic device to the server, copying the new mirror image of the complex programmable logic device to the flash memory of the complex programmable logic device, and executing online upgrade operation on the complex programmable logic device.
In one embodiment, the processor when executing the computer program further performs the steps of:
locking an output pin of the static random access memory which is running based on the old mirror image of the complex programmable logic device in response to the static random access memory update instruction; after the output pin of the static random access memory is locked, writing a new mirror image of the complex programmable logic device in the flash memory into the static random access memory so as to upgrade the static random access memory; and after the static random access memory is upgraded, unlocking an output pin of the static random access memory running based on the new mirror image of the complex programmable logic device.
In one embodiment, the processor when executing the computer program further performs the steps of:
identifying a mirror image check code pre-packaged in a new mirror image of the complex programmable logic device; comparing the mirror image check code with the firmware check code of the complex programmable logic device; and if the mirror image check code is consistent with the firmware check code of the complex programmable logic device, copying the new mirror image of the complex programmable logic device to the flash memory of the complex programmable logic device.
In one embodiment, the processor when executing the computer program further performs the steps of:
acquiring a private key pre-packaged in a new mirror image of the complex programmable logic device; comparing the private key with a public key pre-stored in a system directory of data exchange equipment where the complex programmable logic device is located; and if the private key is successfully compared with the public key prestored in the system directory of the data exchange equipment where the complex programmable logic device is located, copying the new mirror image of the complex programmable logic device to the flash memory of the complex programmable logic device.
In one embodiment, the processor when executing the computer program further performs the steps of:
obtaining the mirror image type in the new mirror image of the complex programmable logic device; matching the mirror image type of the new mirror image of the complex programmable logic device with the type of the complex programmable logic device; and if the mirror type of the new mirror image of the complex programmable logic device is successfully matched with the type of the complex programmable logic device, copying the new mirror image of the complex programmable logic device to the flash memory of the complex programmable logic device. In one embodiment, a computer readable storage medium is provided having a computer program stored thereon, which when executed by a processor, performs the steps of:
In response to an upgrade instruction to a static random access memory, activating a data read operation of an uninterrupted update register of the complex programmable logic device, reading a register value of at least one register in the complex programmable logic device, and writing the register value into a memory;
responding to a register value rewriting instruction, and acquiring a physical address of a register value to be rewritten;
based on the physical address mapping of the register value to be rewritten, obtaining the physical address of the register value to be rewritten in the memory, and rewriting and storing the register value to be rewritten;
and in response to the static random access memory upgrading instruction, activating the data writing operation of the interrupt-free updating register, and writing the register value stored into the memory back to the register.
In one embodiment, the computer program when executed by the processor further performs the steps of:
loading a new mirror image of the complex programmable logic device to the mobile storage unit in response to an online upgrade instruction of the complex programmable logic device; and mounting the mobile storage unit to data exchange equipment where the complex programmable logic device is located, copying the new mirror image of the complex programmable logic device to the flash memory of the complex programmable logic device, and executing online upgrading operation on the complex programmable logic device.
In one embodiment, the computer program when executed by the processor further performs the steps of:
responding to an online upgrade instruction of a complex programmable logic device, and uploading a new mirror image of the complex programmable logic device to a server; and communicatively connecting the complex programmable logic device to the server, copying the new mirror image of the complex programmable logic device to the flash memory of the complex programmable logic device, and executing online upgrade operation on the complex programmable logic device.
In one embodiment, the computer program when executed by the processor further performs the steps of:
locking an output pin of the static random access memory which is running based on the old mirror image of the complex programmable logic device in response to the static random access memory update instruction; after the output pin of the static random access memory is locked, writing a new mirror image of the complex programmable logic device in the flash memory into the static random access memory so as to upgrade the static random access memory; and after the static random access memory is upgraded, unlocking an output pin of the static random access memory running based on the new mirror image of the complex programmable logic device.
In one embodiment, the computer program when executed by the processor further performs the steps of:
identifying a mirror image check code pre-packaged in a new mirror image of the complex programmable logic device; comparing the mirror image check code with the firmware check code of the complex programmable logic device; and if the mirror image check code is consistent with the firmware check code of the complex programmable logic device, copying the new mirror image of the complex programmable logic device to the flash memory of the complex programmable logic device.
In one embodiment, the computer program when executed by the processor further performs the steps of:
acquiring a private key pre-packaged in a new mirror image of the complex programmable logic device; comparing the private key with a public key pre-stored in a system directory of data exchange equipment where the complex programmable logic device is located; and if the private key is successfully compared with the public key prestored in the system directory of the data exchange equipment where the complex programmable logic device is located, copying the new mirror image of the complex programmable logic device to the flash memory of the complex programmable logic device.
In one embodiment, the computer program when executed by the processor further performs the steps of:
Obtaining the mirror image type in the new mirror image of the complex programmable logic device; matching the mirror image type of the new mirror image of the complex programmable logic device with the type of the complex programmable logic device; and if the mirror type of the new mirror image of the complex programmable logic device is successfully matched with the type of the complex programmable logic device, copying the new mirror image of the complex programmable logic device to the flash memory of the complex programmable logic device.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the various embodiments provided herein may include non-volatile and/or volatile memory. The nonvolatile memory can include Read Only Memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), memory bus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), among others.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The above examples merely represent a few embodiments of the present application, which are described in more detail and are not to be construed as limiting the scope of the invention. It should be noted that it would be apparent to those skilled in the art that various modifications and improvements could be made without departing from the spirit of the present application, which would be within the scope of the present application. Accordingly, the scope of protection of the present application is to be determined by the claims appended hereto.

Claims (10)

1. An online upgrade method for a complex programmable logic device, wherein the complex programmable logic device comprises a static random access memory, the method comprising:
in response to an upgrade instruction to a static random access memory, activating a data read operation of an uninterrupted update register of the complex programmable logic device, reading a register value of at least one register in the complex programmable logic device, and writing the register value into a memory;
Responding to a register value rewriting instruction, and acquiring a physical address of a register value to be rewritten;
based on the physical address mapping of the register value to be rewritten, obtaining the physical address of the register value to be rewritten in the memory, and rewriting and storing the register value to be rewritten;
and in response to the static random access memory upgrading instruction, activating the data writing operation of the interrupt-free updating register, and writing the register value stored into the memory back to the register.
2. The method for online upgrade of a complex programmable logic device according to claim 1, further comprising:
loading a new mirror image of the complex programmable logic device to the mobile storage unit in response to an online upgrade instruction of the complex programmable logic device;
and mounting the mobile storage unit to data exchange equipment where the complex programmable logic device is located, copying the new mirror image of the complex programmable logic device to the flash memory of the complex programmable logic device, and executing online upgrading operation on the complex programmable logic device.
3. The method for online upgrade of a complex programmable logic device according to claim 1, further comprising:
Responding to an online upgrade instruction of a complex programmable logic device, and uploading a new mirror image of the complex programmable logic device to a server;
and communicatively connecting the complex programmable logic device to the server, copying the new mirror image of the complex programmable logic device to the flash memory of the complex programmable logic device, and executing online upgrade operation on the complex programmable logic device.
4. The online upgrade method of a complex programmable logic device according to claim 2 or 3, wherein online upgrade operation is performed on the complex programmable logic device, further comprising:
locking an output pin of the static random access memory which is running based on the old mirror image of the complex programmable logic device in response to the static random access memory update instruction;
after the output pin of the static random access memory is locked, writing a new mirror image of the complex programmable logic device in the flash memory into the static random access memory so as to upgrade the static random access memory;
and after the static random access memory is upgraded, unlocking an output pin of the static random access memory running based on the new mirror image of the complex programmable logic device.
5. The method of on-line upgrade of a complex programmable logic device according to claim 4, wherein before copying the new mirror image of the complex programmable logic device to the flash memory of the complex programmable logic device, the method further comprises:
identifying a mirror image check code pre-packaged in a new mirror image of the complex programmable logic device;
comparing the mirror image check code with the firmware check code of the complex programmable logic device;
and if the mirror image check code is consistent with the firmware check code of the complex programmable logic device, copying the new mirror image of the complex programmable logic device to the flash memory of the complex programmable logic device.
6. The method of on-line upgrade of a complex programmable logic device according to claim 5, wherein before copying the new mirror image of the complex programmable logic device to the flash memory of the complex programmable logic device, the method further comprises:
acquiring a private key pre-packaged in a new mirror image of the complex programmable logic device;
comparing the private key with a public key pre-stored in a system directory of data exchange equipment where the complex programmable logic device is located;
and if the private key is successfully compared with the public key prestored in the system directory of the data exchange equipment where the complex programmable logic device is located, copying the new mirror image of the complex programmable logic device to the flash memory of the complex programmable logic device.
7. The method of on-line upgrade of a complex programmable logic device according to claim 6, wherein before copying the new mirror image of the complex programmable logic device to the flash memory of the complex programmable logic device, the method further comprises:
obtaining the mirror image type in the new mirror image of the complex programmable logic device;
matching the mirror image type of the new mirror image of the complex programmable logic device with the type of the complex programmable logic device;
and if the mirror type of the new mirror image of the complex programmable logic device is successfully matched with the type of the complex programmable logic device, copying the new mirror image of the complex programmable logic device to the flash memory of the complex programmable logic device.
8. An on-line upgrade apparatus for a complex programmable logic device, the complex programmable logic device comprising a static random access memory, the apparatus comprising:
a data writing unit, configured to respond to an sram upgrade instruction, activate a data read operation of an uninterruptible update register of the complex programmable logic device, read a register value of at least one register in the complex programmable logic device, and write the register value into a memory;
An obtaining unit configured to obtain a physical address of a register value to be rewritten in response to a register value rewriting instruction;
the data writing unit is further configured to obtain a physical address of the register value to be rewritten in the memory based on the physical address mapping of the register value to be rewritten, and rewrite and store the register value to be rewritten; and the data writing operation of the interrupt-free update register is activated in response to the static random access memory upgrading instruction, and the register value stored in the memory is written back to the register.
9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the steps of the method according to any one of claims 1 to 7 when the computer program is executed by the processor.
10. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method according to any one of claims 1 to 7.
CN202310142777.0A 2023-02-21 2023-02-21 Online upgrade method and device for complex programmable logic device Pending CN116126382A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310142777.0A CN116126382A (en) 2023-02-21 2023-02-21 Online upgrade method and device for complex programmable logic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310142777.0A CN116126382A (en) 2023-02-21 2023-02-21 Online upgrade method and device for complex programmable logic device

Publications (1)

Publication Number Publication Date
CN116126382A true CN116126382A (en) 2023-05-16

Family

ID=86308072

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310142777.0A Pending CN116126382A (en) 2023-02-21 2023-02-21 Online upgrade method and device for complex programmable logic device

Country Status (1)

Country Link
CN (1) CN116126382A (en)

Similar Documents

Publication Publication Date Title
US10642596B2 (en) Embedded device and program updating method
CN108646982B (en) Automatic data restoration method and device based on UBIFS
JP3140906B2 (en) How to update and restore system files
US7313682B2 (en) Method and system for updating boot memory that stores a fail-safe reset code and is configured to store boot code and boot updater code
CN102270144B (en) Embedded network equipment and method for upgrading firmware by using same
CN103365696B (en) BIOS image file acquisition methods and device
US20050085222A1 (en) Software updating process for mobile devices
US20110283274A1 (en) Firmware image update and management
KR100515890B1 (en) Method of efficiently recovering database
US9977706B2 (en) System and method of validating data for incremental format of backup archive
CN107678762B (en) System version upgrading method and device
CN107239411B (en) Memory management method and system for vehicle-mounted controller
CN109086078B (en) Android system upgrading method and device, server and mobile terminal
US20200250313A1 (en) Bios recovery and update
CN111651304B (en) Software recovery method and device based on double-core intelligent ammeter and computer equipment
CN109582332B (en) System upgrading method and device for Internet camera
CN116610498B (en) Data backup and recovery method, system, equipment and medium based on object storage
CN116450244B (en) Chip starting method, device, computer equipment and storage medium
CN116126382A (en) Online upgrade method and device for complex programmable logic device
CN112667444A (en) System upgrading method, storage medium and terminal equipment
CN113360914A (en) BIOS updating method, system, equipment and medium
CN112860595A (en) PCI (peripheral component interconnect express) equipment or PCIE (peripheral component interconnect express) equipment, data access method and related assembly
CN115629811B (en) System stability control method and device
CN110681153B (en) Game archive management system, method, computer device, and medium
CN111158734A (en) Seamless upgrading method, system and equipment for CPLD-FPGA

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination