WO2020107469A1 - Procédé et appareil de traitement d'application, et support de stockage - Google Patents

Procédé et appareil de traitement d'application, et support de stockage Download PDF

Info

Publication number
WO2020107469A1
WO2020107469A1 PCT/CN2018/118733 CN2018118733W WO2020107469A1 WO 2020107469 A1 WO2020107469 A1 WO 2020107469A1 CN 2018118733 W CN2018118733 W CN 2018118733W WO 2020107469 A1 WO2020107469 A1 WO 2020107469A1
Authority
WO
WIPO (PCT)
Prior art keywords
boot program
program
area
application
address
Prior art date
Application number
PCT/CN2018/118733
Other languages
English (en)
Chinese (zh)
Inventor
杨小渊
薛冰
邹旭
Original Assignee
深圳市大疆创新科技有限公司
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 深圳市大疆创新科技有限公司 filed Critical 深圳市大疆创新科技有限公司
Priority to PCT/CN2018/118733 priority Critical patent/WO2020107469A1/fr
Priority to CN201880073390.1A priority patent/CN111356982A/zh
Publication of WO2020107469A1 publication Critical patent/WO2020107469A1/fr

Links

Images

Classifications

    • 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/4401Bootstrapping
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates

Definitions

  • the embodiments of the present invention relate to the field of computers, and in particular, to a program processing method, device, and storage medium.
  • the boot programs and application programs in embedded systems are usually stored in a readable and writable storage device.
  • the size of the current boot program for embedded systems is fixed.
  • the original The boot program of the software can no longer meet the demand, and the original boot program needs to be expanded.
  • the application program is usually stored after the boot program.
  • the size of the new boot program exceeds the size of the original boot program, it will cause the new boot program to overwrite part of the storage area or all the storage occupied by the application program. Area, which causes the application to fail to run properly, and ultimately the embedded device to fail to run normally.
  • Embodiments of the present invention provide a program processing method, device, and storage medium to implement normal upgrade of an application program and a boot program in an embedded device, so as to prevent the boot program from covering the effective execution code of the application program, so that the upgraded application program can be normal Run, so that the upgraded embedded device can run normally.
  • a first aspect of an embodiment of the present invention is to provide a program processing method, which is applied to an embedded device, and a memory of the embedded device stores a first boot program and a first application program; the method includes:
  • firmware to be upgraded where the firmware to be upgraded includes a second application program and a second boot program;
  • the first boot program is replaced with the second boot program, and the sizes of the first boot program and the head region are greater than or equal to the size of the second boot program.
  • a second aspect of an embodiment of the present invention is to provide a program processing method, which is applied to an embedded device, and a memory of the embedded device stores a first boot program and a first application program; the method includes:
  • firmware to be upgraded where the firmware to be upgraded includes a second application program and a second boot program;
  • a third aspect of the embodiments of the present invention is to provide an embedded device, including: a memory and a processor;
  • the memory stores a first boot program and a first application program
  • the processor is used to perform the following operations:
  • firmware to be upgraded where the firmware to be upgraded includes a second application program and a second boot program;
  • the first boot program is replaced with the second boot program, and the sizes of the first boot program and the head region are greater than or equal to the size of the second boot program.
  • a fourth aspect of the embodiments of the present invention is to provide an embedded device, including: a memory and a processor;
  • the memory stores a first boot program and a first application program
  • the processor is used to perform the following operations:
  • firmware to be upgraded where the firmware to be upgraded includes a second application program and a second boot program;
  • a fifth aspect of the embodiments of the present invention is to provide a computer-readable storage medium on which a computer program is stored, which is executed by a processor to implement the method according to the first aspect.
  • the second application program stores There is a start address of the second boot program, according to the start address of the second boot program, the second boot program is obtained, and the first boot program in the memory is replaced with the second boot program to implement the application program And bootloader upgrade.
  • the second application program includes a head area. When the size of the second boot program is larger than the size of the first boot program, the second boot program may occupy the head area of the second application program to prevent the second boot program from being overwritten.
  • the effective execution code of the second application program makes the upgraded second application program run normally, so that the upgraded embedded device can run normally.
  • FIG. 1 is a schematic diagram of an embedded device and a controller provided by an embodiment of the present invention
  • FIG. 2 is a flowchart of a program processing method provided by an embodiment of the present invention.
  • FIG. 3 is a schematic diagram of a memory of an embedded device provided by an embodiment of the present invention.
  • FIG. 4 is a schematic diagram of a memory of an embedded device provided by an embodiment of the present invention.
  • FIG. 5 is a schematic diagram of a memory of an embedded device provided by an embodiment of the present invention.
  • FIG. 6 is a schematic diagram of a memory of an embedded device provided by an embodiment of the present invention.
  • FIG. 7 is a schematic diagram of a memory of an embedded device provided by an embodiment of the present invention.
  • FIG. 8 is a flowchart of a program processing method according to another embodiment of the present invention.
  • FIG. 9 is a flowchart of a program processing method according to another embodiment of the present invention.
  • FIG. 10 is a schematic diagram of a memory of an embedded device provided by an embodiment of the present invention.
  • FIG. 11 is a schematic diagram of a memory of an embedded device provided by an embodiment of the present invention.
  • FIG. 12 is a structural diagram of an embedded device provided by an embodiment of the present invention.
  • 21 Embedded device; 22: Controller; 31: Firmware to be upgraded;
  • a component when a component is said to be “fixed” to another component, it can be directly on another component or it can also exist in a centered component. When a component is considered to be “connected” to another component, it can be directly connected to another component or there can be centered components at the same time.
  • An embodiment of the present invention provides a program processing method.
  • the program processing method is applied to embedded devices.
  • the embedded device 21 includes a processor, a memory, and a transceiver.
  • the controller 22 includes a processor, a transceiver, and a network adapter.
  • the controller 22 may specifically be a computer, a tablet computer, or the like.
  • FIG. 2 is a flowchart of a program processing method provided by an embodiment of the present invention. As shown in FIG. 2, the method in this embodiment may include:
  • Step S201 Obtain firmware to be upgraded, where the firmware to be upgraded includes a second application program and a second boot program.
  • the memory of the embedded device stores a first boot program and a first application program.
  • the first boot program is recorded as the old boot program of the embedded device
  • the first application program is recorded as the old application program of the embedded device.
  • the embedded device obtains firmware to be upgraded, and the firmware to be upgraded may include a new application program and a new boot program, or, The firmware to be upgraded may include only a new application program.
  • the new application program is recorded as the second application program, and the new boot program is recorded as the second boot program.
  • the acquiring firmware to be upgraded includes receiving the firmware to be upgraded sent by a controller.
  • the controller 22 can communicate with a server through a network adapter, and the server sends the firmware to be upgraded to the controller 22, and the processor of the controller 22 sends the firmware to be upgraded to the embedded through the transceiver of the controller 22 Device 21, the processor of the embedded device 21 receives the firmware to be upgraded through the transceiver of the embedded device 21, and the firmware to be upgraded may specifically be a composite file of a new application program and a new boot program, or, the to-be-upgraded The firmware may specifically be a new application program.
  • the controller 22 may not include a network adapter, that is, the controller 22 may generate the firmware to be upgraded, and send the generated firmware to be upgraded to the embedded device 21 through the transceiver.
  • the embedded device 21 may include a network adapter through which the embedded device 21 obtains the firmware to be upgraded from the server without receiving the firmware to be upgraded sent by the controller 22.
  • Step S202 Replace the first application program in the memory with the second application program and the second boot program, where the second application program stores a start address of the second boot program, The start address of the second boot program is at a first preset position after the second application program, and the second application program includes a header area.
  • FIG. 3 or FIG. 4 shows the memory of the embedded device 21.
  • the memory of the embedded device 21 currently stores the boot program 1 and the application program 1.
  • Boot program 1 is denoted as the first boot program
  • application program 1 is denoted as the first application program
  • the start address of boot program 1 is address A
  • application program 1 is after boot program 1
  • the start address of application program 1 is address B
  • the program tail of the boot program 1 includes a jump execution code area, and the role of the jump execution code area is to directly jump to the fixed running address of the application program 1, that is, the start address of the application program 1.
  • 31 represents the firmware to be upgraded received by the embedded device 21 from the controller 22, and the firmware to be upgraded 31 includes an application program 2 and a boot program 2, where the application program 2 is recorded as the second application Program, boot program 2 is denoted as the second boot program.
  • the firmware to be upgraded is written into the memory of the embedded device 21.
  • the processor of the embedded device 21 transfers the embedded device 21
  • the application program 1 stored in the memory of is replaced with the firmware to be upgraded, that is, the application program 1 stored in the memory of the embedded device 21 is replaced with the application program 2 and the boot program 2.
  • the processor of the embedded device 21 starts to execute from the start address of the boot program 1, that is, address A, and when it reaches the jump execution code area of the boot program 1, jumps to the application program 2
  • the starting address is the address B.
  • the start address of the boot program 2 is the address E
  • the start address of the boot program 2 is a preset position after the tail address of the application 2, and the preset position is recorded as the first preset position.
  • the start address of application 2 and application 1 are the same, both are address B.
  • the start address of the boot program 2, ie, the length of address E relative to address B is y.
  • the difference between application 2 and application 1 is that application 2 includes a header area, and the running address of application 2 is address D, that is, the effective execution code of application 2 starts from address D and starts from application 2
  • the part from the start address B of the application to the running address D of the application 2 is the header area of the application 2.
  • the application program 2 stores the start address of the boot program 2, that is, the address E.
  • Step S203 Acquire the start address of the second boot program from the second application program, and acquire the second boot program from the start address of the second boot program.
  • the start address of the boot program 2 is obtained from the application program 2 as the address E, and from the boot program 2 That is, the address E starts to acquire the boot program 2.
  • obtaining the start address of the second boot program from the second application program includes the following feasible implementation manners:
  • a feasible implementation manner is that: the second application program includes a first area; and the first area stores a start address of the second boot program.
  • the acquiring the start address of the second boot program from the second application includes: acquiring the start address of the second boot program from the first area of the second application.
  • the application program 2 includes a first area, which is referred to as a copy boot program area, and an address E, which is a start address of the boot program 2, is stored in the copy boot program area.
  • an address E which is a start address of the boot program 2
  • the processor of the embedded device 21 executes from the boot program 1 to the application program 2, it reads the address E, which is the start address of the boot program 2, from the copy boot program area of the application program 2.
  • the second application further includes a second area
  • the second area stores the running address of the second application
  • the tail address of the second area is the first The starting address of an area.
  • the acquiring the start address of the second boot program from the second application includes: determining the start address of the first area according to the second area; and according to the start of the first area Start address, the start address of the second boot program is obtained from the first area of the second application program.
  • the application program 2 may further include a second area, which is referred to as a running address storage area, and the starting address of the running address storage area is address C.
  • the distance between address C and address B is x.
  • the running address storage area stores an address D which is the running address of the application 2.
  • the copy boot program area is behind the run address storage area.
  • the tail address of the run address storage area is the start address of the copy boot program area.
  • the second application further includes a third area, the third area stores a start address of the second area, and the third area is in the second application Within the head area.
  • the acquiring the start address of the second boot program from the second application includes: acquiring the start address of the second area from the third area; starting from the second area Start address, determine the start address of the first area; according to the start address of the first area, obtain the start address of the second boot program from the first area of the second application .
  • the application 2 may further include a third area, which is referred to as a jump execution code area, a jump execution code area in the application 2 and a jump execution code in the boot program 1 described above
  • a jump execution code area in the above boot program 1 is for jumping to the start address of the application 2, namely the address B
  • the jump execution code area in the application 2 is for jumping to Application program 2 running address storage area or copy boot program area.
  • the jump execution code area in the application program 2 stores the start address of the running address storage area of the application program 2.
  • the jump execution code area in the application 2 is in the head area of the application 2.
  • the processor of the embedded device 21 executes from the boot program 1 to the application program 2, it jumps from the jump execution code area in the application program 2 to the run address storage area, and determines the run address storage area according to the run address storage area Copy the boot program area, and read the start address of the boot program 2, namely the address E, from the copy boot program area according to the start address of the copy boot program area.
  • the second application program further includes a third area, the third area stores a start address of the first area, and the third area is in the second Within the head area of the application.
  • the acquiring the start address of the second boot program from the second application includes: acquiring the start address of the first area from the third area; according to the start of the first area Start address, the start address of the second boot program is obtained from the first area of the second application program.
  • the jump execution code area in the application 2 stores the start address of the copy boot area of the application 2.
  • the jump execution code area in the application program 2 jumps to the start address of the copy boot program area, and according to the start of the copy boot program area Address, read the address E, which is the start address of the boot program 2, from the copy boot program area.
  • the starting address of the third area is the starting address of the head area of the second application.
  • the start address of the jump execution code area in the application 2 is the address B which is the start address of the head area of the application 2.
  • the boot program 2 is acquired from the start address of the boot program 2 as the address E .
  • the first area further includes the length of the second boot program; the acquiring the second boot program from the start address of the second boot program includes: according to the The length of the second boot program is obtained from the start address of the second boot program.
  • the copy boot program area of the embedded device 21 may store both the start address of the boot program 2 and the length of the boot program 2, when the processor of the embedded device 21 reads the boot program 2 according to any of the above methods
  • the boot program 2 is obtained from the boot address 2 starting address E according to the length of the boot program 2.
  • the starting address is the address E and the length of the boot program 2, and the tail address of the boot program 2 can be determined.
  • the tail address is the position where the processor of the embedded device 21 stops acquiring the boot program 2.
  • Step S204 Replace the first boot program with the second boot program, and the sizes of the first boot program and the head area are greater than or equal to the size of the second boot program.
  • the processor of the embedded device 21 obtains the boot program 2
  • the original boot program 1 in the memory of the embedded device 21 is replaced with the boot program 2, that is, the boot program 1 is overwritten with the boot program 2.
  • the size of the boot program 2 and the boot program 1 may be different, and the size of the boot program 2 may be larger than the boot program 1 or may be smaller than the boot program 1. In this embodiment, the size of the boot program 2 is larger than that of the boot program 1 as an example.
  • the boot program 2 Since the size of the boot program 2 is larger than the size of the boot program 1, when the processor of the embedded device 21 overwrites the boot program 1 with the boot program 2, the boot program 2 will occupy the head area of the application 2, in In this embodiment, the sum of the size of the boot program 1 and the size of the head area of the application 2 is greater than or equal to the size of the boot program 2. As shown in FIG. 5, assuming that the size of the boot program 2 is larger than the size of the boot program 1 by x, after the boot program 2 is overwritten by the boot program 1, the boot program 2 will occupy the size of the head area of the app 2 as x Area.
  • x is less than or equal to the size of the head area of the application 2, so that the boot program 2 will not overwrite the effective execution code of the application 2, thereby affecting the normal operation of the application 2. For example, if x is smaller than the size of the head area of the application 2, after the boot program 2 is overwritten, the head area of the application 2 becomes smaller, for example, the area from address B to address D becomes It is the area from address C to address D. This embodiment does not limit the relationship between the size of the area from address B to address C and the size of the area from address C to address D.
  • the starting address of the first area is the running address of the second application program.
  • the second area is within the head area of the second application.
  • the size of the storage space between the start address of the first boot program and the start address of the second area is greater than or equal to the size of the second boot program.
  • the start address of the copy boot program area of the application 2 is the address D which is the running address of the application 2.
  • the running address storage area of the application 2 is in the header area of the application 2. In this case, if the size of the boot program 2 is larger than the size of the boot program 1, the boot program 2 may occupy part of the head area or the entire head area of the application program 2, specifically, the boot program 2 may not occupy the The running address storage area in the header area can also occupy the running address storage area. As shown in FIG.
  • the size of the storage space must be greater than or equal to the size of the boot program 2. As shown in FIG. 6, when the boot program 2 can occupy the running address storage area in the header area, the storage space from the boot address of the boot program 1 to the address A to the boot address of the boot program 2 is the storage space The size must be greater than or equal to the size of bootloader 2.
  • the starting address of the first area is at a second preset position after the running address of the second application program.
  • the second area is not within the head area of the second application.
  • the size of the storage space between the start address of the first boot program and the running address of the second application program is greater than or equal to the size of the second boot program.
  • the start address of the copy boot program area of the application 2 is a preset position after the address D, which is the running address of the application 2, and the preset position is recorded as the second preset position. Limit the distance from address D to the start address of the copy boot program area.
  • the running address storage area of the application 2 is not in the header area of the application 2. In this case, the size of the storage space from the start address of the boot program 1 (address A) to the running address of the application program 2 (address D) must be greater than or equal to the size of the boot program 2, that is, the boot program 2
  • the head area of the application 2 can be occupied at most.
  • the maximum value of the size of the boot program 2 is the sum of the size of the boot program 1 and the size of the head area of the application 2.
  • the processor replacing the first boot program with the second boot program includes: comparing the first boot program and the second boot program; if the first boot program Unlike the second boot program, the first boot program is replaced with the second boot program. If the first boot program and the second boot program are the same, delete the second boot program after the second application program.
  • the processor of the embedded device 21 obtains the start address of the boot program 2 as the address E
  • the boot program 2 is acquired from the start address of the boot program 2 as the address E
  • the boot program 2 and the embedded program are compared.
  • the method further includes: deleting the second boot program after the second application program.
  • boot program 1 and boot program 2 are different. After the processor of embedded device 21 replaces boot program 1 with boot program 2, boot program 2 after application program 2 may be further deleted.
  • the size of the head area of the application 2 can be determined according to the sizes of the boot program 1 and the boot program 2, for example, when generating firmware to be upgraded, the application can be determined according to the sizes of the boot program 1 and the boot program 2 The size of the header area of program 2.
  • this embodiment is also applicable to the scenario of shrinking the boot program, not just expanding the boot program.
  • the second application program stores the starting address of the second boot program, according to The starting address of the second boot program is obtained, and the first boot program in the memory is replaced with the second boot program, thereby realizing the upgrade of the application program and the boot program.
  • the second application program includes a head area. When the size of the second boot program is larger than the size of the first boot program, the second boot program may occupy the head area of the second application program to prevent the second boot program from being overwritten.
  • the effective execution code of the second application program makes the upgraded second application program run normally, so that the upgraded embedded device can run normally.
  • An embodiment of the present invention provides a program processing method.
  • 8 is a flowchart of a program processing method according to another embodiment of the present invention. As shown in FIG. 8, based on the embodiment shown in FIG. 2, after the first boot program is replaced with the second boot program, the method may further include:
  • Step S701 Starting from the start address of the second boot program, execute the second boot program.
  • the processor of the embedded device 21 replaces the original boot program 1 in the memory of the embedded device 21 with the boot program 2, if the embedded device 21 does not restart, the processor of the embedded device 21 will Start running application 2. If the embedded device 21 restarts, the processor of the embedded device 21 will execute the boot program 2 from the address A, which is the start address of the boot program 2.
  • Step S702 When executing the second boot program, obtain the running address of the second application program.
  • the tail of the boot program 2 includes a get run address area and a jump execution code area, where the get run address area is used to get the run address of the application 2 (address D), and the jump execution code of the boot program 2
  • the area is used to jump directly to address D to start execution.
  • the jump execution code area is mainly assembly code, which directly changes the running address of the program.
  • the second boot program stores the start address of the second area; the acquiring the running address of the second application program when executing the second boot program includes: When the second boot program is executed, the running address of the second application program is obtained from the second area according to the start address of the second area.
  • the acquisition run address area at the end of the boot program 2 stores the start address of the second area described in the above embodiment, that is, the start address of the run address storage area, since the run address storage area stores the run address of the application 2 Address D, when the processor of the embedded device 21 executes the acquisition operation address area at the end of the boot program 2, it reads the start address of the operation address storage area from the acquisition operation address area, and according to the operation address storage area
  • the starting address is the address D which is the running address of the application 2 is read from the running address storage area.
  • Step S703 Jump from the second boot program to the running address of the second application program, and execute the second application program.
  • the processor of the embedded device 21 executes the jump execution code area at the end of the boot program 2, it jumps directly to the address D of the application program 2 to start execution of the application program 2.
  • the acquisition run address area at the end of the boot program 2 only needs to acquire the run address of the application program 2 before the processor of the embedded device 21 executes the jump execution code area at the tail of the boot program 2.
  • the jumping from the second boot program to the running address of the second application program, and executing the second application program includes: jumping from the second boot program to the running of the second application program Address, execute the second application program, and delete the second boot program after the second application program.
  • the application program 2 stores the start address of the boot program 2 as the address E
  • the processor of the embedded device 21 may also delete the address according to the address E Bootloader 2 after application 2.
  • the first boot program is replaced with a second boot program with a larger capacity, so that the boot program is repaired, replaced, and expanded.
  • the second boot program Starting from the start address of the second boot program, execute the second boot program, and when executing the second boot program, directly obtain the running address of the second application program, and jump directly from the second boot program to the
  • the running address of the second application program is the starting address of the effective execution code, and executing the second application program improves the execution efficiency of the upgraded second application program.
  • An embodiment of the present invention provides a program processing method.
  • the method is applied to an embedded device, and a memory of the embedded device stores a first boot program and a first application program.
  • 9 is a flowchart of a program processing method according to another embodiment of the present invention. As shown in FIG. 9, the method may include:
  • Step S801 Obtain firmware to be upgraded, where the firmware to be upgraded includes a second application program and a second boot program.
  • the memory of the embedded device 21 stores a first boot program and a first application program
  • the first boot program is specifically the boot program 2 in the above embodiment
  • the first application program is specifically in the above embodiment ⁇ 2 ⁇ Application 2.
  • the address D represents the running address of the application program 2, that is, the starting address of the effective execution code of the application program 2.
  • the storage space between the address C and the address D may be a partial header area remaining after the boot program 2 occupies a partial header area of the application 2.
  • Step S802 Replace the first application program in the memory with the second application program and the second boot program, where the second application program stores a start address of the second boot program, The start address of the second boot program is at a preset position after the second application program.
  • the firmware to be upgraded received by the embedded device 21 from the controller 22 includes the application program 3 and the boot program 2 shown in FIG. 10.
  • the processor of the embedded device 21 After receiving the firmware to be upgraded sent by the controller 22, the processor of the embedded device 21 writes the firmware to be upgraded into the memory of the embedded device 21. Specifically, the processor of the embedded device 21 The application program 2 stored in the memory is replaced with the application program 3 and the boot program 2. After the embedded device 21 is powered on again, the processor of the embedded device 21 executes from the start address of the boot program 2 that is the address A, and the run address of the boot program 2 is obtained to obtain the run address of the application program 3 and the code is effectively executed The starting address of is the address D, and jump to the address D of the application 3 to start execution.
  • the application program 3 stores the start address of the boot program 2, the start address of the boot program 2 is the address E, the start address of the boot program 2 is a preset position after the tail address of the application program 3, optionally, the boot program
  • the starting address of 2 is the length of address E relative to address C is y.
  • Step S803 Acquire the start address of the second boot program from the second application program, and acquire the second boot program from the start address of the second boot program.
  • the processor of the embedded device 21 acquires the address E, which is the start address of the boot program 2, from the application 3, and acquires the boot program 2 from the address E.
  • Step S804 Compare the first boot program and the second boot program.
  • the processor of the embedded device 21 After acquiring the boot program 2 from the address E, the processor of the embedded device 21 compares the boot program currently stored in the memory of the embedded device 21 with the boot program 2.
  • Step S805 If the first boot program and the second boot program are the same, delete the second boot program after the second application program.
  • the processor of the embedded device 21 deletes the boot program 2 after the application program 3.
  • Step S806 If the first boot program and the second boot program are different, replace the first boot program with the second boot program.
  • the processor of the embedded device 21 may replace the boot program currently stored in the memory of the embedded device 21 For bootloader 2.
  • the memory of the embedded device 21 currently stores the boot program 1 and the application program 1.
  • the processor of the embedded device 21 receives the firmware to be upgraded sent by the controller 22 includes the application program 3 and the boot program 2, and the processor of the embedded device 21 writes the application program 3 and the boot program 2 to the memory of the embedded device 21 Specifically, the processor of the embedded device 21 replaces the application program 1 with the application program 3 and the boot program 2.
  • the processor of the embedded device 21 starts to execute from the start address of the boot program 1, that is, address A, and when it reaches the jump execution code area of the boot program 1, jumps to the application 2 The starting address is the address B.
  • the address B may be the starting address of the jump execution code area in the head area of the application 3, the jump execution code area in the head area of the application 3 stores the address C, and the processor slave address of the embedded device 21 B jumps directly to address C to start running.
  • the address C may be the starting address of the running address storage area in the head area of the application 3, the running address storage area stores the running address of the application 3, that is, the address D, and the processor of the embedded device 21 starts from the running address
  • the storage area obtains the address D of the running address of the application 3.
  • the address D may specifically be the start address of the copy boot program area in the application 3, and the copy boot program area stores the address E, which is the start address of the boot program 2.
  • the processor of the embedded device 21 obtains the boot program 2 from the address E, and replaces the boot program 1 in the memory of the embedded device 21 with the boot program 2.
  • the processor of the embedded device 21 starts to execute from the start address of the boot program 2 which is the address A.
  • the boot program 2 can obtain the running address of the application 3 which is the address D.
  • the embedded device 21 The processor jumps directly from boot program 2 to address D and executes application program 3.
  • the processor of the embedded device 21 may delete the boot program 2 after the application program 3 during the execution of the application program 3, or may delete the boot program 2 after the application program 3 after replacing the boot program 1 with the boot program 2.
  • the first application currently stored in the memory of the embedded device is replaced with the second application and the second boot program in the firmware to be upgraded, and the second The start address of the second boot program is obtained from the application program.
  • the second boot program is obtained from the start address of the second boot program, the first boot program currently stored in the memory of the embedded device and the The second boot program, if the first boot program and the second boot program are the same, delete the second boot program after the second application program, to avoid that the processor of the embedded device runs the second application program every time, The second boot program after the second application program needs to be verified to improve the running speed of the embedded device.
  • FIG. 12 is a structural diagram of an embedded device provided by an embodiment of the present invention.
  • the embedded device 110 includes: a memory 111 and a processor 112.
  • the memory 111 stores a first boot program and a first application program;
  • the processor 112 is used to perform the following operations: obtain firmware to be upgraded, the firmware to be upgraded includes a second application program and a second boot program;
  • the processor 112 stores the memory 111
  • the first application program in is replaced with the second application program and the second boot program, the second application program stores a start address of the second boot program, the second boot program
  • the start address is at a first preset position after the second application program, and the second application program includes a header area;
  • the processor 112 obtains the start of the second boot program from the second application program Address and obtain the second boot program from the start address of the second boot program;
  • the processor 112 replaces the first boot program with the second boot program, the first boot program and all
  • the size of the header area is greater than or equal to the size
  • the second application program includes a first area; the first area stores a start address of the second boot program.
  • processor 112 obtains the start address of the second boot program from the second application program, it is specifically used to: obtain the first address from the first area of the second application program. The starting address of the bootloader.
  • the second application program further includes a second area, the second area stores the running address of the second application program, and the tail address of the second area is the start of the first area address.
  • the processor 112 when the processor 112 obtains the start address of the second boot program from the second application program, it is specifically used to: determine the start address of the first area according to the second area; Acquire the start address of the second boot program from the first area of the second application according to the start address of the first area.
  • the second application further includes a third area, where the third area stores a start address of the second area, and the third area is in the head of the second application within the area.
  • the processor 112 when the processor 112 obtains the start address of the second boot program from the second application program, it is specifically used to: obtain the start address of the second area from the third area; According to the start address of the second area, determine the start address of the first area; according to the start address of the first area, obtain the first address from the first area of the second application The starting address of the second bootloader.
  • the starting address of the third area is the starting address of the head area of the second application.
  • the starting address of the first area is the running address of the second application program.
  • the second area is within the head area of the second application.
  • the size of the storage space between the start address of the first boot program and the start address of the second area is greater than or equal to the size of the second boot program.
  • the starting address of the first area is at a second preset position after the running address of the second application program.
  • the second area is not within the head area of the second application.
  • the size of the storage space between the start address of the first boot program and the running address of the second application program is greater than or equal to the size of the second boot program.
  • the first area further includes the length of the second boot program; when the processor 112 acquires the second boot program from the start address of the second boot program, it is specifically used to: The length of the second boot program is obtained from the start address of the second boot program.
  • the processor 112 replaces the first boot program with the second boot program, it is also used to: execute the second boot program starting from the start address of the second boot program; When executing the second boot program, obtain the running address of the second application program; jump from the second boot program to the running address of the second application program, and execute the second application program.
  • the second boot program stores the start address of the second area; when the processor 112 executes the second boot program, when acquiring the running address of the second application program, it is specifically used : When executing the second boot program, obtain the running address of the second application program from the second area according to the start address of the second area.
  • the processor 112 jumps from the second boot program to the running address of the second application program, and when the second application program is executed, it is specifically used to: jump from the second boot program to Running address of the second application program, executing the second application program, and deleting the second boot program after the second application program.
  • processor 112 replaces the first boot program with the second boot program, it is also used to: delete the second boot program after the second application program.
  • the processor 112 when the processor 112 replaces the first boot program with the second boot program, it is specifically used to: compare the first boot program and the second boot program; if the first boot program Unlike the second boot program, the first boot program is replaced with the second boot program.
  • the processor 112 is further configured to: if the first boot program and the second boot program are the same, delete the second boot program after the second application program.
  • the embedded device 110 further includes: a communication interface 113; when the processor 112 acquires firmware to be upgraded, it is specifically used to: receive the firmware to be upgraded sent by the controller through the communication interface 113.
  • the second application program stores the starting address of the second boot program, according to The starting address of the second boot program is obtained, and the first boot program in the memory is replaced with the second boot program, thereby realizing the upgrade of the application program and the boot program.
  • the second application program includes a head area. When the size of the second boot program is larger than the size of the first boot program, the second boot program may occupy the head area of the second application program to prevent the second boot program from covering The effective execution code of the second application program makes the upgraded second application program run normally, so that the upgraded embedded device can run normally.
  • the embedded device 110 includes: a memory 111 and a processor 112; the memory 111 stores a first boot program and a first application program; the processor 112 is used to perform the following operations: obtain firmware to be upgraded, and the The firmware upgrade includes a second application program and a second boot program; replacing the first application program in the memory 111 with the second application program and the second boot program, the second application program storing the The start address of the second boot program, the start address of the second boot program is at a preset position after the second application program; the start of the second boot program is obtained from the second application program Address, and obtain the second boot program from the start address of the second boot program; compare the first boot program and the second boot program; when the first boot program and the second When the boot programs are the same, delete the second boot program after the second application program.
  • the processor 112 is further configured to: when the first boot program and the second boot program are different, replace the first boot program with the second boot program.
  • the first application currently stored in the memory of the embedded device is replaced with the second application and the second boot program in the firmware to be upgraded, and the second The start address of the second boot program is obtained from the application program.
  • the second boot program is obtained from the start address of the second boot program, the first boot program currently stored in the memory of the embedded device and the The second boot program, if the first boot program and the second boot program are the same, delete the second boot program after the second application program, to avoid that the processor of the embedded device runs the second application program every time, The second boot program after the second application program needs to be verified to improve the running speed of the embedded device.
  • this embodiment also provides a computer-readable storage medium on which a computer program is stored, which is executed by a processor to implement the program processing method described in the above embodiment.
  • the disclosed device and method may be implemented in other ways.
  • the device embodiments described above are only schematic.
  • the division of the units is only a division of logical functions.
  • there may be other divisions for example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored, or not implemented.
  • the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
  • each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
  • the above integrated unit can be implemented in the form of hardware, or in the form of hardware plus software functional units.
  • the above integrated unit implemented in the form of a software functional unit may be stored in a computer-readable storage medium.
  • the above software functional units are stored in a storage medium, and include several instructions to enable a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute the method described in each embodiment of the present invention Partial steps.
  • the aforementioned storage media include: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk and other media that can store program code .

Abstract

Des modes de réalisation de la présente invention concernent un procédé et un appareil de traitement d'application et un support de stockage. Dans le mode de réalisation de la présente invention, une première application dans un dispositif de stockage d'un appareil intégré est remplacée par une seconde application et un second chargeur d'amorçage dans un micrologiciel de mise à niveau. La seconde application stocke une adresse de début du second chargeur d'amorçage. Le second chargeur d'amorçage est acquis en fonction de l'adresse de début du second chargeur d'amorçage, et un premier chargeur d'amorçage dans le dispositif de stockage est remplacé par le second chargeur d'amorçage, réalisant ainsi une mise à niveau d'une application et d'un chargeur d'amorçage. La seconde application comprend une région d'en-tête. Si la taille du second chargeur d'amorçage est supérieure à la taille du premier chargeur d'amorçage, le second chargeur d'amorçage peut occuper la région d'en-tête de la seconde application, de telle sorte que le second chargeur d'amorçage n'écrase pas un code exécutable effectif de la seconde application, permettant ainsi un fonctionnement normal de la seconde application mise à niveau, et permettant ainsi un fonctionnement normal de l'appareil intégré mis à niveau.
PCT/CN2018/118733 2018-11-30 2018-11-30 Procédé et appareil de traitement d'application, et support de stockage WO2020107469A1 (fr)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2018/118733 WO2020107469A1 (fr) 2018-11-30 2018-11-30 Procédé et appareil de traitement d'application, et support de stockage
CN201880073390.1A CN111356982A (zh) 2018-11-30 2018-11-30 程序处理方法、设备及存储介质

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2018/118733 WO2020107469A1 (fr) 2018-11-30 2018-11-30 Procédé et appareil de traitement d'application, et support de stockage

Publications (1)

Publication Number Publication Date
WO2020107469A1 true WO2020107469A1 (fr) 2020-06-04

Family

ID=70852505

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/118733 WO2020107469A1 (fr) 2018-11-30 2018-11-30 Procédé et appareil de traitement d'application, et support de stockage

Country Status (2)

Country Link
CN (1) CN111356982A (fr)
WO (1) WO2020107469A1 (fr)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113094067A (zh) * 2021-03-30 2021-07-09 国核自仪系统工程有限公司 Io模块的固件更新方法及io模块
CN113238789B (zh) * 2021-05-27 2023-06-27 闻泰通讯股份有限公司 电子设备及其固件升级方法、装置和计算机可读存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030229752A1 (en) * 2002-04-01 2003-12-11 Sreekrishnan Venkiteswaran Updating flash memory
CN104077167A (zh) * 2014-07-11 2014-10-01 杭州华三通信技术有限公司 基于nand flash的启动加载方法和装置
CN104360877A (zh) * 2014-10-24 2015-02-18 同济大学 基于Bootloader自更新的ECU固件更新方法
CN105893090A (zh) * 2016-03-31 2016-08-24 武汉光迅科技股份有限公司 一种嵌入式系统bootrom和应用程序升级方法

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103365676B (zh) * 2012-04-01 2016-08-03 中兴通讯股份有限公司 通信设备的软件升级方法及装置
CN107861745A (zh) * 2017-11-30 2018-03-30 厦门科华恒盛股份有限公司 一种应用程序在线升级方法、装置、设备及存储介质

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030229752A1 (en) * 2002-04-01 2003-12-11 Sreekrishnan Venkiteswaran Updating flash memory
CN104077167A (zh) * 2014-07-11 2014-10-01 杭州华三通信技术有限公司 基于nand flash的启动加载方法和装置
CN104360877A (zh) * 2014-10-24 2015-02-18 同济大学 基于Bootloader自更新的ECU固件更新方法
CN105893090A (zh) * 2016-03-31 2016-08-24 武汉光迅科技股份有限公司 一种嵌入式系统bootrom和应用程序升级方法

Also Published As

Publication number Publication date
CN111356982A (zh) 2020-06-30

Similar Documents

Publication Publication Date Title
US20170322796A1 (en) Device and method for updating firmware and firmware update system
JP5342302B2 (ja) ファームウェア更新システム、ファームウェア配信サーバ、及びプログラム
CN107870968B (zh) 对文件系统卷执行实时更新
CN105739961B (zh) 一种嵌入式系统的启动方法和装置
CN110704335A (zh) 一种基于异步环形缓冲区的数据读取、写入方法及装置
CN112416406B (zh) 终端设备升级方法、装置、终端设备和介质
CN102521289B (zh) 一种文件同步方法、装置及系统
US20120101996A1 (en) Apparatus and method for snapshot image segmentation
CN104081329A (zh) 对数据进行备份的备份存储系统、备份存储装置以及方法
US20160162278A1 (en) System and method for applying an update to a device system via a system snapshot
US20170052779A1 (en) Method and Device for Running Version File
EP2329368B1 (fr) Mise à jour de contenu sans utiliser de mini-système d'exploitation
WO2020107469A1 (fr) Procédé et appareil de traitement d'application, et support de stockage
CN111258666A (zh) 计算机文件的读取方法、装置、计算机系统及存储介质
CN110209420A (zh) 一种更新引导加载程序的方法及装置
CN111045712A (zh) 一种具有备份功能的单系统升级方法及系统
CN114661322B (zh) 操作系统的升级方法、电子设备及存储介质
CN107291507B (zh) 一种虚拟机虚拟硬盘的升级方法及电子设备
CN114443081A (zh) 终端升级的方法及终端
US20160321057A1 (en) Electronic apparatus
US20150269029A1 (en) Immediate Recovery of an Application from File Based Backups
CN111026417A (zh) 一种嵌入式设备的升级方法及嵌入式设备
US10001921B2 (en) Data migration method and data migration device
US11176089B2 (en) Systems and methods for implementing dynamic file systems
KR101143909B1 (ko) 클라우드 컴퓨팅을 기반으로 하는 듀얼 백업 시스템

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18941153

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18941153

Country of ref document: EP

Kind code of ref document: A1