CN113467797A - Program updating method, device and system and computer readable storage medium - Google Patents

Program updating method, device and system and computer readable storage medium Download PDF

Info

Publication number
CN113467797A
CN113467797A CN202010238693.3A CN202010238693A CN113467797A CN 113467797 A CN113467797 A CN 113467797A CN 202010238693 A CN202010238693 A CN 202010238693A CN 113467797 A CN113467797 A CN 113467797A
Authority
CN
China
Prior art keywords
program
address
storage area
target
current
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.)
Granted
Application number
CN202010238693.3A
Other languages
Chinese (zh)
Other versions
CN113467797B (en
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.)
Xian Novastar Electronic Technology Co Ltd
Original Assignee
Xian Novastar Electronic 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 Xian Novastar Electronic Technology Co Ltd filed Critical Xian Novastar Electronic Technology Co Ltd
Priority to CN202010238693.3A priority Critical patent/CN113467797B/en
Publication of CN113467797A publication Critical patent/CN113467797A/en
Application granted granted Critical
Publication of CN113467797B publication Critical patent/CN113467797B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1415Saving, restoring, recovering or retrying at system level
    • G06F11/1433Saving, restoring, recovering or retrying at system level during software upgrading
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1415Saving, restoring, recovering or retrying at system level
    • G06F11/1441Resetting or repowering
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Quality & Reliability (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)

Abstract

The present invention relates to a program updating method, a program updating apparatus and a program updating system, and a computer-readable storage medium; the program updating method includes, for example: receiving a program updating instruction, and acquiring a current operating address according to the program updating instruction; determining a current storage area corresponding to the current running program based on the current running address; receiving a target updating program, and solidifying the target updating program into a target storage area corresponding to a target operation address; replacing the current operation address corresponding to the current storage area with the target operation address; and responding to a first reset instruction, and loading and operating the target updating program from the target storage area according to the target operation address. The invention can solve the problems that the time consumption for program power-on loading is long, and a large amount of time is consumed for executing the program copying, erasing and writing processes when the program is updated.

Description

Program updating method, device and system and computer readable storage medium
Technical Field
The present invention relates to the field of program upgrading technologies, and in particular, to a program updating method, a program updating apparatus, a program updating system, and a computer-readable storage medium.
Background
At present, a mainstream embedded program upgrading method mainly adopts a method of loading a boot loader, such as a BootLoader program, and then loading an application area program, and the program application area includes a program running area and a program storage area, that is, when the program needs to be updated, the boot loader program is loaded first, then data in the program storage area is deleted, the upgrade program is saved again, after the verification is completed, the upgrade program in the program storage area is copied to the program running area, and then the program is loaded and run, so that the program upgrading is completed.
However, although the above method can complete the program update, because the BootLoader program is loaded and executed first each time the program is powered on, and a lot of time is consumed for erasing and writing the program data during program upgrade, the existing program update method is time-consuming, low in program update efficiency, and not suitable for application scenarios with larger program files.
Disclosure of Invention
Therefore, embodiments of the present invention provide a program updating method, a program updating apparatus, a program updating system, and a computer-readable storage medium, which can solve the problems that a power-on loading of a program is time-consuming, and a large amount of time is required to perform program copying, erasing, and writing processes during program updating due to a distinction between a program running area and a program storage area.
Specifically, an embodiment of the present invention provides a program updating method, where the program updating method includes: receiving a program updating instruction, and acquiring a current operating address according to the program updating instruction; determining a current storage area corresponding to the current running program based on the current running address; receiving a target updating program, and solidifying the target updating program into a target storage area corresponding to a target operation address, wherein the target storage area is different from the current storage area; replacing the current operation address corresponding to the current storage area with the target operation address; and responding to a first reset instruction, and loading and operating the target updating program from the target storage area according to the target operation address.
In the prior art, a program application area comprises a program running area and a program storage area, when a program needs to be updated, a boot loader is loaded first, data in the program storage area is deleted, an upgrade program is saved again, the upgrade program in the program storage area is copied to the program running area after verification is completed, then the program is loaded and run, and program upgrade is completed, wherein a large amount of time is consumed for erasing and writing program data during program upgrade, and the method is not suitable for application scenes with larger program files. The embodiment of the invention determines the current storage area of the current running program by reading the current running address, receives the updating program and stores the updating program to the target storage area different from the current storage area, modifies the current running address corresponding to the current storage area as the target running address so as to load and run the target updating program in the target running area, can not distinguish the program running area and the program storage area, the current storage area and the target storage area are both the program storage area and the program updating area, does not need to erase and write program data for many times when updating the program, can realize the program updating only by modifying the current running address corresponding to the current storage area as the target running address corresponding to the target storage area, can improve the efficiency of the program updating, and is suitable for application scenes of larger program files.
In an embodiment of the present invention, before the receiving and responding to a program update instruction and obtaining a current operating address according to the program update instruction, the method further includes: loading a boot entry of the backup program based on the starting address; jumping to a first running address specified by an address memory according to the loaded boot entry to load a first program from a first storage area corresponding to the first running address; and responding to the successful loading of the first program, and running the first program.
In an embodiment of the present invention, before the receiving a program update instruction and obtaining a current operating address according to the program update instruction, the method further includes: loading a boot entry of the backup program based on the starting address; jumping to a first operation address specified by an address register according to the loaded boot entry to load a first program from a first storage area corresponding to the first operation address; and responding to the loading failure of the first program, jumping to the starting address to load and run the backup program from a storage area corresponding to the starting address.
In an embodiment of the present invention, before the receiving a program update instruction and obtaining a current operating address according to the program update instruction, the method further includes: loading a boot entry of the backup program based on the starting address; jumping to a first operation address specified by an address register according to the loaded boot entry to load a first program from a first storage area corresponding to the first operation address; in response to the first program loading being successful, running the first program; replacing the first operating address stored in the address register with a second operating address; and responding to a second reset instruction, reading and operating a second program from a second storage area corresponding to the second operating address.
In an embodiment of the present invention, after the loading and executing the target update program from the target storage area according to the target execution address in response to the first reset instruction and completing the program update, the method further includes: receiving and responding to a program backspacing instruction, and modifying the target operation address into the first operation address; and responding to the second reset instruction, and loading and operating the first program from the first storage area corresponding to the first operating address.
In addition, an embodiment of the present invention provides a program updating apparatus, including: the current operating address reading module is used for receiving a program updating instruction and acquiring a current operating address according to the program updating instruction; a current storage area determining module, configured to determine, based on the current operating address, a current storage area corresponding to the current operating program; a target updating program receiving module, configured to receive a target updating program, and solidify the target updating program into a target storage area corresponding to a target operating address, where the target storage area is different from the current storage area; the address replacing module is used for replacing the current running address corresponding to the current storage area with the target running address; and the target updating program loading module is used for responding to a first reset instruction, and loading and operating the target updating program from the target storage area according to the target operation address.
In one embodiment of the present application, the program updating apparatus further includes: the current running program loading module is used for loading the guide item of the backup program based on the initial address; jumping to a first running address specified by an address memory according to the loaded boot entry to load a first program from a first storage area corresponding to the first running address; and responding to the successful loading of the first program, and running the first program.
In one embodiment of the present application, the program updating apparatus further includes: the current running program loading module is used for loading the guide item of the backup program based on the initial address; jumping to a first operation address specified by an address register according to the loaded boot entry to load a first program from a first storage area corresponding to the first operation address; and responding to the loading failure of the first program, jumping to the starting address to load and run the backup program from a storage area corresponding to the starting address.
In one embodiment of the present application, the program updating apparatus further includes: a currently running program loading module, configured to: loading a boot entry of the backup program based on the starting address; jumping to a first operation address specified by an address register according to the loaded boot entry to load a first program from a first storage area corresponding to the first operation address; in response to the first program loading being successful, running the first program; replacing the first operating address stored in the address register with a second operating address; and responding to a second reset instruction, reading and operating a second program from a second storage area corresponding to the second operating address.
In one embodiment of the present application, the program updating apparatus further includes: the program backspacing module is used for receiving and responding to a program backspacing instruction and modifying the target operation address into the first operation address; and responding to the second reset instruction, and loading and operating the first program from the first storage area corresponding to the first operating address.
Furthermore, an embodiment of the present invention provides a program updating system, including: a processor and a memory; wherein the memory stores instructions for execution by the processor, and the instructions cause the processor to perform operations to perform the program update method as described in any of the above embodiments.
Furthermore, an embodiment of the present invention provides a computer-readable storage medium, which is a non-volatile memory and stores computer-readable instructions, and the computer-readable instructions are executed by one or more processors to implement the program updating method in any one of the above embodiments.
As can be seen from the above, the above technical solution of the present invention may have one or more of the following advantages: a) the method comprises the steps of determining a current storage area of a current running program by reading a current running address, receiving an updating program and storing the updating program to a target storage area different from the current storage area, modifying the current running address as the target running address to load and run the target updating program in the target running area, and not distinguishing the program running area from the program storage area, wherein the current storage area and the target storage area are both the program storage area and the program updating area, and the program updating can be realized by modifying the current running address corresponding to the current storage area as the target running address of the target updating program without carrying out program erasing and writing for many times during program updating, so that the efficiency of program updating can be improved, and the method is suitable for application scenes of larger program files; b) the storage area corresponding to the initial address stores the backup program, the backup program is loaded before program updating and then jumps to the specified address, a boot loader is not required to be loaded after each power-on, the loading efficiency is improved, the initial address is returned when loading fails, and the backup program with complete loading is loaded, so that the normal starting of the hardware system is ensured; c) after the program is updated, if the first program needs to be returned, the target running address can be modified into the first running address, the first program is loaded by responding to the reset instruction and jumping to the first running address, the storage space of the backup program of the previous version does not need to be increased, and the hardware cost is saved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description serve to explain the invention and not to limit the invention. In the drawings:
FIG. 1 is a flowchart illustrating a program updating method according to a first embodiment of the present invention;
fig. 2 is a schematic flowchart of the power-on loading of the initially running program according to the specific implementation of the program updating method in the first embodiment of the present invention;
FIG. 3 is a diagram illustrating a program updating apparatus according to a second embodiment of the present invention;
FIG. 4 is a diagram illustrating a program update system according to a third embodiment of the present invention;
fig. 5 is a schematic structural diagram of a computer-readable storage medium according to a fourth embodiment of the present invention.
Description of the reference numerals
S11-S19: steps of program updating method
30: a program updating means; 301: a current operation address reading module; 303: a current storage area determination module; 305: a target update program receiving module; 307: an address replacement module; 309: a target update program loading module;
40: a program update system; 41: a processor; 42: a memory;
50: a computer readable storage medium.
Detailed Description
It should be noted that the embodiments and features of the embodiments may be combined with each other without conflict. The invention will be described in connection with embodiments with reference to the drawings.
In order to make those skilled in the art better understand the technical solution of the present invention, the technical solution in the embodiment of the present invention will be clearly and completely described below with reference to the drawings in the embodiment of the present invention, and it is obvious that the described embodiment is only a part of the embodiment of the present invention, and not all embodiments should fall into the protection scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the terms so used are interchangeable under appropriate circumstances such that the embodiments of the invention described herein are, for example, capable of operation in sequences other than those illustrated or otherwise described herein. Furthermore, the method is simple. The terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
It should be noted that the division of the embodiments of the present invention is only for convenience of description and should not be construed as a limitation, and features of various embodiments may be combined and referred to each other without contradiction.
[ first embodiment ] A method for manufacturing a semiconductor device
As shown in fig. 1, a first embodiment of the present invention provides a program updating method, for example, including steps S11 to S19.
Step S11: receiving a program updating instruction, and acquiring a current operating address according to the program updating instruction;
step S13: determining a current storage area corresponding to the current running program based on the current running address;
step S15: receiving a target updating program, and solidifying the target updating program into a target storage area corresponding to a target operation address, wherein the target storage area is different from the current storage area;
step S17: replacing the current operation address corresponding to the current storage area with the target operation address; and
step S19: and responding to a first reset instruction, and loading and operating the target updating program from the target storage area according to the target operation address.
In step S11, for example, the receiving card receives a program update instruction issued by the upper computer, and reads the current operating address from the address register. The address register mentioned is, for example, WBSTAR (warm boot address register), and the current operating address mentioned is, for example, an operating address corresponding to a currently operating program, and the current operating address is specified by the address register.
In step S13, the current storage area is, for example, a storage area in which the currently running program is stored, for example, a plurality of program storage areas are provided in a Flash memory connected to the FPGA, and the current storage area in which the currently running program is stored can be determined based on the read current running address.
In step S15, for example, the receiving card receives the target update program issued by the upper computer, and stores the target update program in a target storage area corresponding to the target operation address, where the target storage area is different from the current storage area in which the current operation program is stored.
In step S17, the current operating address specified by the address register is modified to the target operating address corresponding to the target storage area, for example.
In step S19, for example, in response to the first reset instruction, the FPGA of the receiving card jumps to the target storage area to load the target update program according to the target operation address specified by the address register by reading the data in the address register after restarting. The first reset instruction is, for example, an IPROG instruction, the FPGA resets the logic except the reconfiguration function after responding to the IPROG instruction, loads a target update program into a target storage area according to a target operation address specified by an address register, and operates the target update program after the loading is completed, thereby updating the program.
Therefore, a program operation area and a program storage area are not distinguished, the current storage area and the target storage area are both a program storage area and a program updating area, when the program is updated, program data do not need to be erased and written for many times, and the program updating can be realized only by modifying the current operation address into a target operation address corresponding to the target updating program, for example, modifying the address stored in an address register into the target operation address corresponding to the target updating program, so that the efficiency of the program updating can be improved, and the method is suitable for application scenarios of larger program files.
The aforementioned receiving card is, for example, a scanning card for carrying an LED display screen in an LED display screen control system.
Further, step S11, for example, further includes: loading a boot entry of the backup program based on the starting address; jumping to a first operation address specified by an address register according to the loaded boot entry to load a first program from a first storage area corresponding to the first operation address; and responding to the successful loading of the first program, and running the first program. It is to be understood here that the first operating address is referred to as the aforementioned current operating address, the first program is referred to as the aforementioned current operating program, and the first memory area is referred to as the aforementioned current memory area. Or,
step S11 is preceded by, for example: loading a boot entry of the backup program based on the starting address; jumping to a first operation address specified by an address register according to the loaded boot entry to load a first program from a first storage area corresponding to the first operation address; and responding to the loading failure of the first program, jumping to the starting address to load and run the backup program from a storage area corresponding to the starting address. It is to be understood that the aforementioned starting address is used as the aforementioned current operating address, and the aforementioned backup program is used as the aforementioned current operating program and the memory area corresponding to the aforementioned starting address is used as the aforementioned current memory area. Or,
step S11 is preceded by, for example: loading a boot entry of the backup program based on the starting address; jumping to a first operation address specified by an address register according to the loaded boot entry to load a first program from a first storage area corresponding to the first operation address; in response to the first program loading being successful, running the first program; replacing the first operating address stored in the address register with a second operating address; and responding to a second reset instruction, reading and operating a second program from a second storage area corresponding to the second operating address. It is to be understood here that the second operating address is referred to as the aforementioned current operating address, the second program is referred to as the aforementioned current operating program, and the second memory area is referred to as the aforementioned current memory area.
Specifically, as shown in fig. 2, for example, the FPGA may be powered up to load a program before performing a program update. The FPGA is connected with an external memory, for example, a Flash memory, the external memory stores a backup program, in the initial power-on stage, for example, a boot entry of the backup program is loaded from a start address, the start address is, for example, an address 0, wherein the boot entry of the backup program occupies, for example, 100 bytes and includes a first operating address specified by an address register. The backup program mentioned is for example the Golden program.
Because the program is loaded for the first time, the Failback command is not satisfied, when the boot entry of the backup program is loaded, jumping to the first running address specified by the address register, and the first storage area corresponding to the first running address stores the first program, and loading the first program.
If the first program is loaded successfully, the first program is executed, where the first program is, for example, a currently-executed program in the program updating method, the mentioned first running address is, for example, a current running address in the program updating method, and the mentioned first storage area is, for example, a current storage area in the program updating method.
If the first program loading fails, for example, a CRC check fails or a Watchdog detects a program error, the FPGA triggers, for example, a Failback command, jumps to a start address, a backup program of the first program is stored in a storage area corresponding to the start address, and the loading and running of the backup program is performed, that is, the Golden program is loaded and run. The starting address is, for example, address 0, at this time, the backup program is, for example, the currently running program described in the program updating method, the mentioned starting address is, for example, the currently running address described in the program updating method, and the mentioned storage area is, for example, the current storage area described in the program updating method.
Therefore, when the FPGA is electrified to load the running program, the boot loader does not need to be loaded firstly, and the jump loading of the running program can be realized only by loading the boot item of the backup program, so that the loading efficiency can be improved, and the starting address can be returned to load the complete backup program when the loading fails, thereby ensuring the normal starting of the hardware system.
The FPGA further comprises a second storage area for storing a second program, for example, when the first program is loaded successfully and the second program needs to be loaded in the second storage area by jumping to, the first running address specified by the address register is modified to be a second running address corresponding to the second storage area, and the FPGA jumps to the second storage area to read and run the second program in response to a second reset instruction. Wherein, the second reset instruction mentioned is an IPROG instruction. In this case, the second program is, for example, the currently running program described in the program updating method, the mentioned second running address is, for example, the currently running address described in the program updating method, and the mentioned second storage area is, for example, the currently storage area described in the program updating method. In short, when a program jump is required, the address stored by the address register is modified, and the program jump is completed in response to the IPROG instruction.
It should be noted that, for example, the FPGA may further include a plurality of program storage areas, and is not limited to the program storage areas listed in the above embodiments, the number of the specific program storage areas may be set according to the needs of the user, and each program storage area may store and load a program of a corresponding version.
Therefore, the mutual skip among the program areas can be realized, only the specified address of the address register needs to be modified and the skip is carried out in response to the reset instruction, the switching among the version program areas is convenient, the program updating efficiency is improved, and meanwhile, a user can set the number of the program storage areas according to the hardware storage space.
Further, after the program update is completed, if it is necessary to return to the previous version program for loading, for example, a program rollback instruction may be issued by the upper computer, the receiving card receives the program rollback instruction, modifies the target running address specified by the address register to an initial running address, such as the aforementioned starting address, the first running address, or the second running address, and in response to the second reset instruction, jumps to a storage area corresponding to the initial running address to load and run the running program before the update.
Specifically, after step S19, for example, the method includes: receiving and responding to a program backspacing instruction, and modifying the target operation address into the first operation address; and responding to the second reset instruction, and loading and operating the first program from the first storage area corresponding to the first operating address. Or,
after step S19, for example, it includes: receiving and responding to a program backspacing instruction, and modifying the target operation address into the second operation address; and responding to the second reset instruction, and loading and operating the second program from the second storage area corresponding to the second operating address. Or,
after step S19, for example, it includes: receiving and responding to a program backspacing instruction, and modifying the target operation address into the aforementioned initial address; and responding to the second reset instruction, and loading and running a backup program from the storage area corresponding to the starting address.
In summary, in the program updating method provided in this embodiment, a current storage area corresponding to a current running program is determined by reading a current running address, the updated program is received and stored in a target storage area different from the current storage area, the current running address is modified to be the target running address, so that the target updated program is loaded and run in the target running area, and the program running area and the program storage area are not distinguished, where the current storage area and the target storage area are both the program storage area and the program update area, and when performing program update, there is no need to perform multiple erasing and writing of program data, and only the current running address corresponding to the current storage area is modified to be the target running address of the target updated program, so as to implement program update, and therefore, the efficiency of program update can be improved, and the method is applicable to an application scenario of a larger program file; the storage area corresponding to the initial address stores the backup program, the backup program is loaded before program updating and then jumps to the specified address, a boot loader is not required to be loaded after each power-on, the loading efficiency is improved, the initial address is returned when loading fails, and the backup program with complete loading is loaded, so that the normal starting of the hardware system is ensured; after the program is updated, if the program needing to be returned to the initial operation is needed, the target operation address can be modified to be the operation address corresponding to the initial operation program, and the reset instruction is responded, the program needing to be returned to the storage area corresponding to the operation address is jumped to load the initially operated program, the storage space of the backup program of the previous version is not needed to be increased, and the hardware cost is saved.
[ second embodiment ]
As shown in fig. 3, a second embodiment of the present invention provides a program updating apparatus. The program updating device 30 includes: a current running address reading module 301, a current storage area determining module 303, a target update program receiving module 305, an address replacing module 307, and a target program updating module 309.
The current operating address reading module 301 is configured to receive a program update instruction, and obtain a current operating address according to the program update instruction. The current storage area determining module 303 is configured to determine a current storage area corresponding to the currently running program based on the current running address. The target update program receiving module 305 is configured to receive a target update program and solidify the target update program into a target storage area corresponding to a target operation address, where the target storage area is different from the current storage area. The address replacing module 307 is configured to replace the current operating address corresponding to the current storage area with the target operating address. The target update program loading module 309 is configured to, in response to the first reset instruction, load and execute the target update program from the target storage area according to the target execution address.
Further, the program updating apparatus 30 further includes, for example, a currently running program loading module (not shown in the figure) for: loading a boot entry of the backup program based on the starting address; jumping to a first running address specified by an address memory according to the loaded boot entry to load a first program from a first storage area corresponding to the first running address; and responding to the successful loading of the first program, and running the first program.
Further, the currently running program loading module is further configured to: and responding to the loading failure of the first program, jumping to the starting address to load and run the backup program from a storage area corresponding to the starting address.
Further, the currently running program loading module is further configured to: replacing the first operating address stored in the address register with a second operating address after the first program is executed in response to the first program loading being successful; and responding to a second reset instruction, reading and operating a second program from a second storage area corresponding to the second operating address.
Further, the program updating apparatus 30 further includes, for example, a program rollback module (not shown in the figure) for: receiving and responding to a program backspacing instruction, and modifying the target operation address into the first operation address; and responding to the second reset instruction, and loading and operating the first program from the first storage area corresponding to the first operating address.
For details of the functions of the currently-operating address reading module 301, the current storage area determining module 303, the target update program receiving module 305, the address replacing module 307 and the target program updating module 309, reference may be made to the descriptions of steps S11, S13, S15, S17 and S19 in the first embodiment, which are not repeated herein. Further, it is noted that the currently running address reading module 301, the current storage area determining module 303, the target updating program receiving module 305, the address replacing module 307 and the target program updating module 309 may be software modules, stored in the non-volatile memory and executed by the processor to perform the relevant operations to perform the steps S11, S13, S15, S17 and S19 in the foregoing first embodiment.
To sum up, in a program updating apparatus provided in the second embodiment of the present invention, a current storage area corresponding to a current running program is determined by reading a current running address, the current running address is received and stored into a target storage area different from the current storage area, the current running address is modified to be a target running address, so as to load and run the target updating program in the target running area, and the program running area and the program storage area are not distinguished, where the current storage area and the target storage area are both a program storage area and a program updating area, and when performing program updating, program erasing and writing are not required to be performed many times, and program updating can be achieved only by modifying the current running address corresponding to the current storage area to be the target running address of the target updating program, so that efficiency of program updating can be improved, and the apparatus is suitable for application scenarios of larger program files; the storage area corresponding to the initial address stores the backup program, the backup program is loaded before program updating and then jumps to the specified address, a boot loader is not required to be loaded after each power-on, the loading efficiency is improved, the initial address is returned when loading fails, and the backup program with complete loading is loaded, so that the normal starting of the hardware system is ensured; after the program is updated, if the program needing to be returned to the initial operation can be the operation address corresponding to the initial operation program through the target operation address, and the program needing to be returned to the storage area corresponding to the operation address is loaded by responding to the reset instruction, so that the storage space of the backup program of the previous version is not required to be increased, and the hardware cost is saved.
[ third embodiment ]
As shown in fig. 4, a program updating system according to a third embodiment of the present invention is provided. The program update system 40 includes: a memory 42 and one or more processors 41 coupled to the memory 42. The memory 42 stores a computer program, and the processor 41 is configured to execute the computer program to implement the program updating method according to the first embodiment, which is not described herein again for brevity, and the beneficial effects of the program updating system 40 provided in this embodiment are the same as those of the program updating method provided in the first embodiment.
[ fourth example ] A
Fig. 5 is a computer-readable storage medium according to a fourth embodiment of the present invention. As shown in fig. 5, the computer-readable storage medium 50 is a non-volatile memory and stores computer-readable instructions which, when executed by one or more processors, for example, cause the one or more processors to execute the program update method described in the foregoing first embodiment. For the sake of brevity, details are not repeated herein, and the beneficial effect of the computer-readable storage medium 50 provided by this embodiment is the same as that of the program updating method provided by the first embodiment.
In addition, it should be understood that the foregoing embodiments are merely exemplary illustrations of the present invention, and the technical solutions of the embodiments can be arbitrarily combined and collocated without conflict between technical features and structural contradictions, which do not violate the purpose of the present invention.
In the embodiments provided in the present invention, it should be understood that the disclosed system, apparatus and/or method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units/modules is only one logical division, and there may be other divisions in actual implementation, for example, multiple units or modules may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units/modules described as separate parts may or may not be physically separate, and parts displayed as units/modules may or may not be physical units, may be located in one place, or may be distributed on multiple network units. Some or all of the units/modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
In addition, each functional unit/module in the embodiments of the present invention may be integrated into one processing unit/module, or each unit/module may exist alone physically, or two or more units/modules may be integrated into one unit/module. The integrated units/modules may be implemented in the form of hardware, or may be implemented in the form of hardware plus software functional units/modules.
The integrated units/modules, which are implemented in the form of software functional units/modules, may be stored in a computer readable storage medium. The software functional unit is stored in a storage medium and includes several instructions for causing one or more processors of a computer device (which may be a personal computer, a server, or a network device) to execute some steps of the methods according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (10)

1. A program update method, comprising:
receiving a program updating instruction, and acquiring a current operating address according to the program updating instruction;
determining a current storage area corresponding to the current running program based on the current running address;
receiving a target updating program, and solidifying the target updating program into a target storage area corresponding to a target operation address, wherein the target storage area is different from the current storage area;
replacing the current operation address corresponding to the current storage area with the target operation address; and
and responding to a first reset instruction, and loading and operating the target updating program from the target storage area according to the target operation address.
2. The program update method according to claim 1, wherein before receiving the program update instruction and obtaining the current operating address according to the program update instruction, the method further comprises:
loading a boot entry of the backup program based on the starting address;
jumping to a first operation address specified by an address register according to the loaded boot entry to load a first program from a first storage area corresponding to the first operation address;
and responding to the successful loading of the first program, and running the first program.
3. The program update method according to claim 1, wherein before receiving the program update instruction and obtaining the current operating address according to the program update instruction, the method further comprises:
loading a boot entry of the backup program based on the starting address;
jumping to a first operation address specified by an address register according to the loaded boot entry to load a first program from a first storage area corresponding to the first operation address;
and responding to the loading failure of the first program, jumping to the starting address to load and run the backup program from a storage area corresponding to the starting address.
4. The program update method according to claim 1, wherein before receiving the program update instruction and obtaining the current operating address according to the program update instruction, the method further comprises:
loading a boot entry of the backup program based on the starting address;
jumping to a first operation address specified by an address register according to the loaded boot entry to load a first program from a first storage area corresponding to the first operation address;
in response to the first program loading being successful, running the first program;
replacing the first operating address stored in the address register with a second operating address;
and responding to a second reset instruction, reading and operating a second program from a second storage area corresponding to the second operating address.
5. The program update method according to claim 2, further comprising, after the loading and executing the target update program from the target storage area according to the target execution address in response to the first reset instruction,:
receiving and responding to a program backspacing instruction, and modifying the target operation address into the first operation address; and
and responding to the second reset instruction, and loading and operating the first program from the first storage area corresponding to the first operating address.
6. A program update apparatus, comprising:
the current operating address reading module is used for receiving a program updating instruction and acquiring a current operating address according to the program updating instruction;
a current storage area determining module, configured to determine, based on the current operating address, a current storage area corresponding to the current operating program;
a target updating program receiving module, configured to receive a target updating program, and solidify the target updating program into a target storage area corresponding to a target operating address, where the target storage area is different from the current storage area;
the address replacing module is used for replacing the current running address corresponding to the current storage area with the target running address; and
and the target updating program loading module is used for responding to a first reset instruction, and loading and operating the target updating program from the target storage area according to the target operating address.
7. The program updating apparatus according to claim 6, further comprising:
a currently running program loading module, configured to:
loading a boot entry of the backup program based on the starting address;
jumping to a first running address specified by an address memory according to the loaded boot entry to load a first program from a first storage area corresponding to the first running address;
and responding to the successful loading of the first program, and running the first program.
8. The program updating apparatus according to claim 6, further comprising:
a currently running program loading module, configured to:
loading a boot entry of the backup program based on the starting address;
jumping to a first operation address specified by an address register according to the loaded boot entry to load a first program from a first storage area corresponding to the first operation address;
and responding to the loading failure of the first program, jumping to the starting address to load and run the backup program from a storage area corresponding to the starting address.
9. A program update system, comprising: a processor and a memory; wherein the memory stores instructions for execution by the processor and the instructions cause the processor to perform operations to perform the program update method of any of claims 1 to 5.
10. A computer-readable storage medium that is a non-volatile memory and stores computer-readable instructions, which are executed by one or more processors to implement the program update method of any one of claims 1 to 5.
CN202010238693.3A 2020-03-30 2020-03-30 Program updating method, device and system and computer readable storage medium Active CN113467797B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010238693.3A CN113467797B (en) 2020-03-30 2020-03-30 Program updating method, device and system and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010238693.3A CN113467797B (en) 2020-03-30 2020-03-30 Program updating method, device and system and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN113467797A true CN113467797A (en) 2021-10-01
CN113467797B CN113467797B (en) 2024-03-15

Family

ID=77866191

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010238693.3A Active CN113467797B (en) 2020-03-30 2020-03-30 Program updating method, device and system and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN113467797B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114880008A (en) * 2022-05-17 2022-08-09 联陆智能交通科技(上海)有限公司 Software upgrading method and system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050015582A1 (en) * 2003-05-26 2005-01-20 Sony Corporation Program and information processing method
CN109634623A (en) * 2018-12-12 2019-04-16 山东管理学院 Operation method is infused in program based on DSP
CN110096300A (en) * 2019-04-08 2019-08-06 上海赛治信息技术有限公司 A kind of fpga program file backup management system, operation method and upgrade method
CN110780910A (en) * 2019-10-29 2020-02-11 苏州长光华医生物医学工程有限公司 Method and system for updating software of lower computer and computer readable storage medium
CN110780908A (en) * 2019-09-27 2020-02-11 科华恒盛股份有限公司 Screen display program upgrading method and system and terminal equipment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050015582A1 (en) * 2003-05-26 2005-01-20 Sony Corporation Program and information processing method
CN109634623A (en) * 2018-12-12 2019-04-16 山东管理学院 Operation method is infused in program based on DSP
CN110096300A (en) * 2019-04-08 2019-08-06 上海赛治信息技术有限公司 A kind of fpga program file backup management system, operation method and upgrade method
CN110780908A (en) * 2019-09-27 2020-02-11 科华恒盛股份有限公司 Screen display program upgrading method and system and terminal equipment
CN110780910A (en) * 2019-10-29 2020-02-11 苏州长光华医生物医学工程有限公司 Method and system for updating software of lower computer and computer readable storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
王泰格;邵玉如;杨翌;: "小内存微控制器适用的无人值守远程更新思路", 软件导刊, no. 07 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114880008A (en) * 2022-05-17 2022-08-09 联陆智能交通科技(上海)有限公司 Software upgrading method and system

Also Published As

Publication number Publication date
CN113467797B (en) 2024-03-15

Similar Documents

Publication Publication Date Title
JP5113700B2 (en) Firmware update apparatus and method
CN110096300B (en) FPGA program file backup management system, operation method and upgrading method
US8423991B2 (en) Embedded network device and firmware upgrading method
KR101427755B1 (en) Device and method for firmware upgrade using usb
CN102200916B (en) Electronic equipment, configurable member and method for storing configuration information of configurable member
CN103970557B (en) The method and storage device of storage device activation system
CN104360877A (en) ECU (electronic control unit) firmware updating method based on Bootloader self update
CN103299276A (en) Software updating process for an embedded device
WO2011000279A1 (en) Patch generation method for dynamic software updating and control and apparatus thereof
KR20070034239A (en) Method and system for updating software and computer readable recording medium recording the method
CN101021797A (en) Repairing and staging method for software of embedded system
CN111562934B (en) Software system upgrading method based on hot patch, terminal and storage medium
WO2012071852A1 (en) Method and apparatus for upgrading bootstrap program
CN108897576A (en) A method of the quick start BOOT based on ARM chip
CN108733517A (en) SSD firmware upgrades guard method and device
CN113806139B (en) Operating system recovery method, operating system recovery device, storage medium and computer program product
CN113467797B (en) Program updating method, device and system and computer readable storage medium
CN117687663A (en) OTA-based partition dynamic adjustment method, device, equipment and storage medium
CN117908916A (en) STM 32-based method for upgrading IAP by improving Bootloader
CN111124294B (en) Sector mapping information management method and device, storage medium and equipment
CN109976958B (en) Method and device for improving firmware test efficiency and storage medium
CN101697129B (en) Logic self-loading method and system for field programmable gate array of embedded system
CN105204896A (en) BootLoader design method of digital storage oscilloscope
CN114510375A (en) Flash chip data area dynamic sharing system and method
CN115390880A (en) Firmware upgrading method and device, storage medium and electronic equipment

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
GR01 Patent grant
GR01 Patent grant