CN113467813A - Controller online upgrading method and device, electronic equipment and storage medium - Google Patents
Controller online upgrading method and device, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN113467813A CN113467813A CN202110546014.3A CN202110546014A CN113467813A CN 113467813 A CN113467813 A CN 113467813A CN 202110546014 A CN202110546014 A CN 202110546014A CN 113467813 A CN113467813 A CN 113467813A
- Authority
- CN
- China
- Prior art keywords
- partition
- controller
- application program
- program
- identification
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 73
- 238000005192 partition Methods 0.000 claims abstract description 135
- 238000012795 verification Methods 0.000 claims description 27
- 238000004891 communication Methods 0.000 claims description 26
- 238000004590 computer program Methods 0.000 claims description 16
- 238000007781 pre-processing Methods 0.000 claims description 12
- 230000009191 jumping Effects 0.000 claims description 7
- 238000012545 processing Methods 0.000 claims description 7
- 238000012544 monitoring process Methods 0.000 claims description 3
- 230000003287 optical effect Effects 0.000 description 4
- 230000000694 effects Effects 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000000644 propagated effect Effects 0.000 description 2
- 238000012356 Product development Methods 0.000 description 1
- 230000002159 abnormal effect Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 238000000638 solvent extraction Methods 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/65—Updates
- G06F8/656—Updates while running
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/08—Error detection or correction by redundancy in data representation, e.g. by using checking codes
- G06F11/10—Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's
- G06F11/1008—Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's in individual solid state devices
- G06F11/1012—Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's in individual solid state devices using codes or arrangements adapted for a specific type of error
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/44—Arrangements for executing specific programs
- G06F9/4401—Bootstrapping
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computer Security & Cryptography (AREA)
- Quality & Reliability (AREA)
- Stored Programmes (AREA)
Abstract
The invention relates to a method and a device for upgrading a controller on line, electronic equipment and a storage medium, wherein the method comprises the following steps: acquiring a program storage area of a controller, setting an identification area for setting an identification bit and a first partition, a second partition and a third partition for storing a program corresponding to the controller based on the program storage area, receiving an upgrading trigger instruction, modifying the identification bit of the identification area, and guiding the controller to jump to the first partition; receiving software to be upgraded; updating the second partition to obtain an updated first application; checking the updated first application program to determine whether the updating is successful, and modifying the identification bit of the identification area to be a second preset value if the updating is successful so as to guide the controller to jump to a second partition and end the upgrading process; otherwise, the identification position of the identification area is modified to be a third preset value so as to guide the controller to jump to a third partition, and the upgrading process is ended. The invention can conveniently realize software upgrading and improve the user experience of products.
Description
Technical Field
The present invention relates to the field of upgrading technologies, and in particular, to a method and an apparatus for upgrading a controller online, an electronic device, and a storage medium.
Background
In the process of product development and use, due to the superposition of new functions or new requirements put forward by customers according to actual conditions, the upgrading of product software is essential. However, for products already in online use, the complexity of the upgrade process and the influence of the software upgrade process on the use of the products directly affect the use of the products by users, and also seriously affect the user experience of the products. Therefore, how to realize the product upgrade with low cost and without affecting the user experience of the user is a key that must be considered in the product upgrade processing procedure.
Disclosure of Invention
The present invention provides a method, an apparatus, an electronic device and a storage medium for upgrading a controller online, aiming at some technical defects in the prior art.
The technical scheme adopted by the invention for solving the technical problems is as follows: the method for upgrading the controller on line is constructed and comprises the following steps:
s1, acquiring a program storage area of the controller, and setting an identification area for setting an identification bit and a first partition, a second partition and a third partition for storing a program corresponding to the controller based on the program storage area, wherein the first partition is used for storing a boot program, the second partition is used for storing a first application program, and the third partition is used for storing a second application program;
s2, receiving an upgrading trigger instruction, modifying the identification bit of the identification area to be a first preset value, and guiding the controller to jump to the first partition according to the first preset value to execute the guiding program;
s3, receiving the software to be upgraded through a communication interface;
s4, updating the second partition according to the software to be upgraded to obtain an updated first application program;
s5, checking the updated first application program to confirm whether the first application program is updated successfully, if so, executing S6, and if not, executing S7;
s6, modifying the identification bit of the identification area to be a second preset value, guiding the controller to jump to the second partition according to the second preset value to execute the first application program, and executing the step S8;
s7, modifying the identification bit of the identification area to be a third preset value, so as to guide the controller to jump to the third partition to execute the second application program according to the third preset value, and executing the step S8;
and S8, ending the upgrading process.
Preferably, the online upgrading method for the controller further includes:
and S11, setting the default value of the identification bit of the identification area as the second preset value.
Preferably, the online upgrading method for the controller further includes:
s0, preprocessing the software to be upgraded to add an identification code and a first check code;
in step S5, the verifying the updated first application to determine whether the first application is updated successfully includes:
and S51, traversing the second partition to determine whether the identification code can be identified, and if not, judging that the first application program is not updated successfully.
Preferably, the step S51 further includes: if yes, go to step S52;
s52, acquiring program data of the first application program in the second partition to generate a second check code according to a preset check algorithm;
s53, confirming whether the first check code and the second check code are the same, if yes, judging that the first application program is updated successfully, and if not, judging that the first application program is updated unsuccessfully.
Preferably, in the step S0, the software to be upgraded is preprocessed to add an identification code and a first check code; the method comprises the following steps:
and processing the software to be upgraded to generate a BIN file, and sequentially adding the identification code and the first check code at the tail of the BIN file.
Preferably, the online upgrading method for the controller further includes: and pre-storing the preset check algorithm in the first partition.
Preferably, the online upgrading method for the controller further includes: and in the software to be upgraded preprocessing process, acquiring the preset verification algorithm to obtain the first verification code according to the preset verification algorithm and the software to be upgraded.
Preferably, the identification region is disposed between the first partition and the second partition.
Preferably, the online upgrading method for the controller further includes:
s31, monitoring communication data of the communication interface when the software to be upgraded is received, and confirming whether an end mark corresponding to the software to be upgraded is received when the communication data stops; if so, the step S4 is executed, otherwise, the step S7 is executed.
In addition, the invention also constructs a controller online upgrading device, which comprises:
the partition unit is used for acquiring a program storage area of the controller, and setting an identification area for setting an identification bit and a first partition, a second partition and a third partition for storing a program corresponding to the controller based on the program storage area, wherein the first partition is used for storing a bootstrap program, the second partition is used for storing a first application program, and the third partition is used for storing a second application program;
the upgrading triggering unit is used for receiving an upgrading triggering instruction, modifying the identification bit of the identification area to be a first preset value, and guiding the controller to jump to the first partition according to the first preset value so as to execute the guiding program;
the software receiving unit is used for receiving the software to be upgraded through the communication interface;
the software updating unit is used for updating the second partition according to the software to be upgraded to obtain an updated first application program;
the verification unit is used for verifying the updated first application program to confirm whether the first application program is updated successfully or not, and outputting a positive result when the updating is successful, or else outputting a negative result;
the first execution unit is used for modifying the identification bit of the identification area to be a second preset value when the verification unit outputs a positive result, so as to guide the controller to jump to a second partition according to the second preset value to execute the first application program;
a second execution unit, configured to modify the identification bit of the identification area to a third preset value when the check unit outputs a negative result, so as to direct the controller to jump to the third partition according to the third preset value to execute the second application program;
and the third execution unit is used for finishing the upgrading process after the execution of the first execution unit or the second execution unit is finished.
In addition, the present invention also provides a computer storage medium having a computer program stored thereon, wherein the computer program is used for implementing the online upgrading method of the controller when being executed by a processor.
In addition, the invention also constructs an electronic device, comprising a memory and a processor;
the memory is used for storing a computer program;
the processor is used for executing the computer program to realize the online upgrading method of the controller.
The implementation of the controller online upgrading method, the controller online upgrading device, the electronic equipment and the storage medium has the following beneficial effects: software upgrading can be conveniently realized, and the user experience of products is improved.
Drawings
The invention will be further described with reference to the accompanying drawings and examples, in which:
FIG. 1 is a flowchart illustrating an embodiment of a method for upgrading a controller on-line according to the present invention;
FIG. 2 is a flowchart of a controller online upgrade method according to another embodiment of the present invention;
fig. 3 is a logic block diagram of an embodiment of an online upgrading apparatus for a controller according to the present invention.
Detailed Description
For a more clear understanding of the technical features, objects and effects of the present invention, embodiments of the present invention will now be described in detail with reference to the accompanying drawings.
As shown in fig. 1, in a first embodiment of the online upgrading method for a controller of the present invention, the method includes the following steps: s1, acquiring a program storage area of the controller, and setting an identification area for setting an identification bit and a first partition, a second partition and a third partition for storing programs corresponding to the controller based on the program storage area, wherein the first partition is used for storing a bootstrap program, the second partition is used for storing a first application program, and the third partition is used for storing a second application program; specifically, a program storage area of the controller is partitioned, wherein the identification area is used for setting an identification bit, the first partition is used for storing a boot program, the boot program is used for driving the controller to execute software upgrading operation, the second partition is used for storing a first application program, namely a main application program, and the controller executes the main application program under normal conditions. The third partition is used for storing a second application program, namely a backup application program, and the controller can execute the backup application program in a special state, such as when the main application program cannot be normally executed. Wherein the backup application may be a factory default setting that may be distinguished from the primary application by a version number.
S2, receiving an upgrading trigger instruction, modifying the identification bit of the identification area to be a first preset value, and guiding the controller to jump to the first partition to execute a guiding program according to the first preset value; when the controller needs to be upgraded, the upgrading can be triggered according to the upgrading triggering instruction. When an upgrade trigger instruction is received, firstly, the identification bit of the identification area is modified to be a first preset value according to the upgrade trigger instruction, and after the controller recognizes that the identification bit is the first preset value, the controller is guided to execute a guiding program of a first partition according to the first preset value, and the upgrading state is entered.
S3, receiving the software to be upgraded through a communication interface; that is, after entering the upgrade state, the trigger controller receives the software package for updating through the communication interface.
S4, updating the second partition according to the software to be upgraded to obtain an updated first application program; specifically, under normal conditions, after receiving a software package, that is, software to be upgraded, the first application program of the second partition may be updated according to the software package, so as to obtain the updated first application program.
S5, checking the updated first application program to confirm whether the first application program is updated successfully, if so, executing S6, and if not, executing S7; s6, modifying the identification bit of the identification area to be a second preset value, guiding the controller to jump to a second partition according to the second preset value to execute the first application program, and executing the step S8; s7, modifying the identification bit of the identification area to be a third preset value, guiding the controller to jump to a third partition according to the third preset value to execute a second application program, and executing the step S8; and S8, ending the upgrading process. Specifically, the updated first application program of the second partition is checked to determine whether the updating process is successful, that is, whether the first application program of the second partition is accurate or can be normally used is determined. Namely, the updating result is judged according to the checking result, and if the checking result does not pass, the updating is considered to be unsuccessful. When the first application program is unsuccessfully updated, the controller modifies the identification bit of the identification area to be a third preset value, and when the identification bit of the identification area is the third preset value, the controller jumps to execute a second application program of a third partition. When the verification result is passed, the updating can be considered to be successful. And when the identification bit of the identification area is the second preset value, the controller jumps to execute the first application program of the second partition. When the main application program is successfully updated, the updated main application program is guided to be executed according to the identification bit, and the whole upgrading process is ended, or the whole response process to the upgrading trigger instruction is completed.
In an embodiment, the method for upgrading a controller online further includes: and S11, setting the default value of the identification bit of the identification area as a second preset value. Namely, the identification position of the identification area corresponding to the controller is set as a second preset value corresponding to the second partition by default, and when the controller works normally, the controller directly jumps to the second partition according to the identification area to execute the main application program.
In an embodiment, the method for upgrading a controller online further includes: s0, preprocessing software to be upgraded to add an identification code and a first check code; in step S5, the verifying the updated first application to determine whether the first application is updated successfully includes: and S51, traversing the second partition to determine whether the identification code can be identified, and if not, judging that the first application program is not updated successfully. In particular, the software to be upgraded may be pre-processed, which may be performed before or after receiving the software through the communication port. And in the preprocessing process of the software to be upgraded, adding an identification code and a first check code in the software to be upgraded. The process of checking the updated first application program may be that, after receiving the software to be upgraded, the second partition is traversed to determine whether the identification code can be identified, and when the identification code is not identified, the first application program in the second partition is considered not to correspond to the software to be upgraded, and the update process is considered to be abnormal, and the first application program is not updated successfully.
On the basis of the above embodiment, step S51 further includes: if yes, go to step S52; s52, acquiring program data of the first application program in the second partition to generate a second check code according to a preset check algorithm; and S53, confirming whether the first check code and the second check code are the same, if so, judging that the first application program is updated successfully, and if not, judging that the first application program is updated unsuccessfully. That is, when the identification code can be identified by traversing the second partition, it cannot directly determine that the first application program of the second partition has been successfully updated, and it is also necessary to check the program data of the first application degree updated in the second partition by a preset check algorithm to obtain the second check code, and obtain the first check code to determine whether the first check code is the same as the second check code. And if the first application program is the same as the software to be upgraded, judging that the updated first application program corresponds to the software to be upgraded, and judging that the first application program of the second partition is successfully updated. If not, the updated first application program does not correspond to the software to be upgraded, and the first application program of the second partition is judged to be unsuccessfully updated.
Further, in step S0, preprocessing the software to be upgraded to add an identification code and a first check code; the method comprises the following steps: and processing the software to be upgraded to generate a BIN file, and sequentially adding an identification code and a first check code at the tail of the BIN file. Specifically, the software to be upgraded may be preprocessed by processing the software to be upgraded into a BIN file, and sequentially adding an identification code and a first check code at the end of the BIN file. The identification code can be customized according to the product. Its length is also set to mean as desired, for example, in one embodiment, 12 bytes in length. It may also set the identification code to correspond to the product characteristics.
In an embodiment, the online upgrading method for the controller further includes pre-storing a preset verification algorithm in the first partition. Specifically, a preset check algorithm may be pre-stored in the first partition, or the preset check algorithm may be invoked to calculate a second check code corresponding to the first application program of the second partition when the first application program of the second partition is checked.
In an embodiment, the method for upgrading a controller online further includes: in the software to be upgraded preprocessing process, a preset verification algorithm is obtained so as to obtain a first verification code according to the preset verification algorithm and the software to be upgraded. That is, it may generate the first check code according to the preset check algorithm in the preprocessing process of the software to be upgraded.
In an embodiment, the identification region is disposed between the first partition and the second partition. That is, the identification area is between the first partition and the second partition, the address is not modified by the update of the first application program, and the address does not affect the operation of other programs. The second partition is used as a storage interval of the first application program and is possibly influenced by program updating, the third partition is used for storing the second application program, namely a backup program, the occupied interval of the third partition can be modified along with the updating of the program, the programs are different, the occupied interval can also be changed, and if the address of the identification area is covered by the enlarged first application program or the enlarged second application program, the guiding effect of the third partition cannot be achieved. In some embodiments, the identification area may also set the end of the third partition, which reserves enough addresses for the third partition to prevent the identification area from being occupied by the contents of the third partition.
As shown in fig. 2, in an embodiment, the method for upgrading a controller online further includes: s31, monitoring communication data of the communication interface when receiving the software to be upgraded, and confirming whether an end mark corresponding to the software to be upgraded is received when the communication data stops; if so, go to step S4, otherwise, go to step S7. Specifically, when the software to be upgraded is received through the communication interface, the communication data of the communication interface is monitored in real time, and when the communication data of the communication interface stops, whether the end mark corresponding to the software to be upgraded is received or not is confirmed. That is, normally, when the communication data of the communication interface stops, the software to be upgraded should be completely received, that is, the corresponding end flag is received. If the communication data is not received within a period of time, but the end mark corresponding to the software to be upgraded is not received at the moment, the software to be upgraded can be judged to be not completely received, and the third partition can be entered to execute the second application program directly according to the processing of the update failure of the first application program. The processing procedure can prevent the controller card from being dead in the boot program and being unable to jump out, namely being crashed, caused by accidents such as power failure, communication line disconnection and the like in the updating process.
In one embodiment of the cook machine, the product circuit board includes a main control board and a motor control board, and the motor control board and the main control board communicate with each other via a serial port to receive and transmit data. The method comprises the steps of firstly partitioning a Flash for storing programs of a motor control board to obtain three partitions A, B, C and a specific address, wherein the partition A corresponds to a first partition and is used for storing a bootstrap program, the partition B corresponds to a second partition and is used for storing a main application program, the partition C corresponds to a third partition and is used for storing a backup application program, the specific address corresponds to an identification area and is used for storing state data, namely an identification bit, when the identification bit is 1 and corresponds to a first preset value, program upgrading is carried out, when the identification bit is 2 and corresponds to a second preset value, jumping to the main application program area (the partition B) is corresponded, when the identification bit corresponds to 3 and corresponds to a third preset value, jumping to the backup application program area (the partition C) is corresponded, and when the specific address is delivered from a factory, the specific address storage value is 2, namely, jumping to the partition B by default. When the control board is powered on and reset, reading the data stored in the designated address in the flash, when the stored data is 2, directly jumping to the area B, when the main control board sends an upgrading instruction to the motor control board, after the motor control board receives the upgrading instruction, modifying the data stored in the specific address of the flash into 1, and then jumping to the bootstrap program area (A partition) to enter an upgrading state. After entering the upgrade state, the main control board sends an upgrade package to the motor control board through the serial port, the upgrade package can be received by the main control board from the server, and the motor control board writes the received data into the main application program area (B partition). After data reception, normally, the main application area (partition B) has been updated to a new program, and in order to verify that the program is error-free, the program needs to be verified, and the update process is confirmed according to the verification result. In the checking process, the program upgrade package is preprocessed, a BIN file is generated by a new program, a 12-byte identification code (such as TOPBANDDKSRD) and a check code are added at the tail of the BIN file, the check code is a checking result of all data of the new program, and a generating mode such as CRC32 can be used; when the program is upgraded, after the receiving of the program upgrading packet data is finished, traversing operation is carried out on a main application program area (B partition) until a 12-bit identification code is identified, and if the 12-bit identification code cannot be identified by traversing the whole part B, verification fails; after the 12-bit identification code is identified, recording a check code behind the identification code as a check code 1, and generating the check code by using a check mode during preprocessing of data before the identification code as a check code 2; comparing the check code 1 with the check code 2, if the check codes are the same, judging that the check is successful, and if the check codes are different, judging that the check is failed; after the verification is finished, if the verification is successful, modifying the data stored in the flash designated address into 2 and jumping to a main application program area (B partition); if the verification fails, the data stored in the flash designated address is modified to be 3, the data is jumped to a backup program area (C partition), and finally the upgrading process of the motor control panel is finished.
As shown in fig. 3, an online controller upgrade apparatus according to the present invention includes: a partition unit 110, configured to obtain a program storage area of a controller, and set, based on the program storage area, an identification area for setting an identification bit and a first partition, a second partition, and a third partition for storing a program corresponding to the controller, where the first partition is used to store a boot program, the second partition is used to store a first application program, and the third partition is used to store a second application program; the upgrade trigger unit 120 is configured to receive an upgrade trigger instruction, modify the identifier bit of the identifier area to be a first preset value, and guide the controller to jump to the first partition according to the first preset value to execute a boot program; a software receiving unit 130, configured to receive software to be upgraded through a communication interface; a software updating unit 140, configured to update the second partition according to the software to be upgraded to obtain an updated first application; a checking unit 150, configured to check the updated first application to determine whether the first application is successfully updated, and output a positive result when the updating is successful, or output a negative result otherwise; a first executing unit 161, configured to modify the identifier bit of the identifier area to be a second preset value when the verifying unit 150 outputs a positive result, so as to direct the controller to jump to a second partition to execute the first application program according to the second preset value; a second execution unit 162, configured to modify the flag bit of the flag area to be a third preset value when the checking unit 150 outputs a negative result, so as to direct the controller to jump to a third partition to execute a second application program according to the third preset value; the third executing unit 163 is configured to end the upgrading process after the execution of the first executing unit 161 or the second executing unit 162 is completed.
In an embodiment, the controller online upgrade device further includes a preprocessing unit, configured to preprocess software to be upgraded to add an identification code and a first check code.
In an embodiment, the verification unit is further configured to obtain program data of the first application program in the second partition to generate a second verification code according to a preset verification algorithm; and outputting a checking result according to whether the first checking code and the second checking code are the same.
In an embodiment of the present invention, in the controller online upgrade apparatus, the partition unit is further configured to pre-store a preset verification algorithm into the first partition.
In an embodiment, the preprocessing unit is further configured to, during the preprocessing, obtain the preset verification algorithm to verify the software to be upgraded according to the preset verification algorithm to obtain the first verification code.
Specifically, for a specific coordination operation process among units of the controller online upgrade device, reference may be made to the above-mentioned controller online upgrade method, which is not described herein again.
In addition, an electronic device of the present invention includes a memory and a processor; the memory is used for storing a computer program; the processor is used for executing the computer program to realize the controller online upgrading method. In particular, according to an embodiment of the present invention, the processes described above with reference to the flowcharts may be implemented as a computer software program. For example, embodiments of the invention include a computer program product comprising a computer program embodied on a computer-readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such embodiments, the computer program may be downloaded and installed by an electronic device and executed to perform the above-described functions defined in the methods of embodiments of the present invention. The electronic equipment can be a terminal such as a notebook, a desktop, a tablet computer, a smart phone and the like, and can also be a server.
In addition, a computer storage medium of the present invention has a computer program stored thereon, and the computer program realizes an online upgrade method of a controller of any one of the above when executed by a processor. In particular, it should be noted that the computer readable medium of the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device.
It is to be understood that the foregoing examples, while indicating the preferred embodiments of the invention, are given by way of illustration and description, and are not to be construed as limiting the scope of the invention; it should be noted that, for those skilled in the art, the above technical features can be freely combined, and several changes and modifications can be made without departing from the concept of the present invention, which all belong to the protection scope of the present invention; therefore, all equivalent changes and modifications made within the scope of the claims of the present invention should be covered by the claims of the present invention.
Claims (12)
1. A controller online upgrading method is characterized by comprising the following steps:
s1, acquiring a program storage area of the controller, and setting an identification area for setting an identification bit and a first partition, a second partition and a third partition for storing a program corresponding to the controller based on the program storage area, wherein the first partition is used for storing a boot program, the second partition is used for storing a first application program, and the third partition is used for storing a second application program;
s2, receiving an upgrading trigger instruction, modifying the identification bit of the identification area to be a first preset value, and guiding the controller to jump to the first partition according to the first preset value to execute the guiding program;
s3, receiving the software to be upgraded through a communication interface;
s4, updating the second partition according to the software to be upgraded to obtain an updated first application program;
s5, checking the updated first application program to confirm whether the first application program is updated successfully, if so, executing S6, and if not, executing S7;
s6, modifying the identification bit of the identification area to be a second preset value, guiding the controller to jump to the second partition according to the second preset value to execute the first application program, and executing the step S8;
s7, modifying the identification bit of the identification area to be a third preset value, so as to guide the controller to jump to the third partition to execute the second application program according to the third preset value, and executing the step S8;
and S8, ending the upgrading process.
2. The online controller upgrade method according to claim 1, further comprising:
and S11, setting the default value of the identification bit of the identification area as the second preset value.
3. The online controller upgrade method according to claim 1, further comprising:
s0, preprocessing the software to be upgraded to add an identification code and a first check code;
in step S5, the verifying the updated first application to determine whether the first application is updated successfully includes:
and S51, traversing the second partition to determine whether the identification code can be identified, and if not, judging that the first application program is not updated successfully.
4. The online upgrading method for controller according to claim 3, wherein the step S51 further includes: if yes, go to step S52;
s52, acquiring program data of the first application program in the second partition to generate a second check code according to a preset check algorithm;
s53, confirming whether the first check code and the second check code are the same, if yes, judging that the first application program is updated successfully, and if not, judging that the first application program is updated unsuccessfully.
5. The online upgrading method for controller according to claim 3, wherein in step S0, the software to be upgraded is preprocessed to add an identification code and a first check code; the method comprises the following steps:
and processing the software to be upgraded to generate a BIN file, and sequentially adding the identification code and the first check code at the tail of the BIN file.
6. The online controller upgrade method according to claim 4, further comprising: and pre-storing the preset check algorithm in the first partition.
7. The online controller upgrade method according to claim 6, further comprising: and in the software to be upgraded preprocessing process, acquiring the preset verification algorithm to obtain the first verification code according to the preset verification algorithm and the software to be upgraded.
8. The online upgrade method for a controller according to claim 1, wherein the identification area is disposed between the first partition and the second partition.
9. The online controller upgrade method according to claim 1, further comprising:
s31, monitoring communication data of the communication interface when the software to be upgraded is received, and confirming whether an end mark corresponding to the software to be upgraded is received when the communication data stops; if so, the step S4 is executed, otherwise, the step S7 is executed.
10. A controller online upgrading device is characterized by comprising:
the partition unit is used for acquiring a program storage area of the controller, and setting an identification area for setting an identification bit and a first partition, a second partition and a third partition for storing a program corresponding to the controller based on the program storage area, wherein the first partition is used for storing a bootstrap program, the second partition is used for storing a first application program, and the third partition is used for storing a second application program;
the upgrading triggering unit is used for receiving an upgrading triggering instruction, modifying the identification bit of the identification area to be a first preset value, and guiding the controller to jump to the first partition according to the first preset value so as to execute the guiding program;
the software receiving unit is used for receiving the software to be upgraded through the communication interface;
the software updating unit is used for updating the second partition according to the software to be upgraded to obtain an updated first application program;
the verification unit is used for verifying the updated first application program to confirm whether the first application program is updated successfully or not, and outputting a positive result when the updating is successful, or else outputting a negative result;
the first execution unit is used for modifying the identification bit of the identification area to be a second preset value when the verification unit outputs a positive result, and jumping to a second partition according to the second preset value to execute the first application program;
a second execution unit, configured to modify the identification bit of the identification area to a third preset value when the check unit outputs a negative result, so as to direct the controller to jump to the third partition according to the third preset value to execute the second application program;
and the third execution unit is used for finishing the upgrading process after the execution of the first execution unit or the second execution unit is finished.
11. A computer storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the controller online upgrade method according to any one of claims 1 to 9.
12. An electronic device comprising a memory and a processor;
the memory is used for storing a computer program;
the processor is used for executing the computer program to realize the online upgrading method of the controller according to any one of claims 1-9.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110546014.3A CN113467813A (en) | 2021-05-19 | 2021-05-19 | Controller online upgrading method and device, electronic equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110546014.3A CN113467813A (en) | 2021-05-19 | 2021-05-19 | Controller online upgrading method and device, electronic equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN113467813A true CN113467813A (en) | 2021-10-01 |
Family
ID=77870928
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110546014.3A Pending CN113467813A (en) | 2021-05-19 | 2021-05-19 | Controller online upgrading method and device, electronic equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113467813A (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114189440A (en) * | 2021-11-01 | 2022-03-15 | 深圳拓邦股份有限公司 | Remote upgrading method and device for multiple control boards of Internet of things equipment and storage medium |
CN114296819A (en) * | 2021-12-23 | 2022-04-08 | 上海易咖智车科技有限公司 | Program flashing method and device of vehicle body controller, computer equipment and medium |
CN115421756A (en) * | 2022-09-16 | 2022-12-02 | 杭州云动智能汽车技术有限公司 | Service type gateway upgrading method |
CN116360831A (en) * | 2023-05-31 | 2023-06-30 | 中国第一汽车股份有限公司 | Application program upgrading method and device, electronic equipment and storage medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102984572A (en) * | 2012-12-10 | 2013-03-20 | 四川九洲电器集团有限责任公司 | Double backup method for system software upgrade of set top box |
US20170308369A1 (en) * | 2016-04-25 | 2017-10-26 | Hisense Electric Co., Ltd. | Data processing method and device of preset application after upgrading |
CN110737449A (en) * | 2019-08-23 | 2020-01-31 | 上海商米科技集团股份有限公司 | Method, apparatus, and machine-readable storage medium for processing device firmware |
CN112333278A (en) * | 2020-11-10 | 2021-02-05 | 珠海格力电器股份有限公司 | Intelligent equipment upgrading method and system and intelligent equipment |
-
2021
- 2021-05-19 CN CN202110546014.3A patent/CN113467813A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102984572A (en) * | 2012-12-10 | 2013-03-20 | 四川九洲电器集团有限责任公司 | Double backup method for system software upgrade of set top box |
US20170308369A1 (en) * | 2016-04-25 | 2017-10-26 | Hisense Electric Co., Ltd. | Data processing method and device of preset application after upgrading |
CN110737449A (en) * | 2019-08-23 | 2020-01-31 | 上海商米科技集团股份有限公司 | Method, apparatus, and machine-readable storage medium for processing device firmware |
CN112333278A (en) * | 2020-11-10 | 2021-02-05 | 珠海格力电器股份有限公司 | Intelligent equipment upgrading method and system and intelligent equipment |
Non-Patent Citations (1)
Title |
---|
叶子健;王健;: "一种新的程序在线升级的实现", 电子器件, no. 01, 20 February 2011 (2011-02-20) * |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114189440A (en) * | 2021-11-01 | 2022-03-15 | 深圳拓邦股份有限公司 | Remote upgrading method and device for multiple control boards of Internet of things equipment and storage medium |
CN114296819A (en) * | 2021-12-23 | 2022-04-08 | 上海易咖智车科技有限公司 | Program flashing method and device of vehicle body controller, computer equipment and medium |
CN115421756A (en) * | 2022-09-16 | 2022-12-02 | 杭州云动智能汽车技术有限公司 | Service type gateway upgrading method |
CN115421756B (en) * | 2022-09-16 | 2023-07-18 | 杭州云动智能汽车技术有限公司 | Service type gateway upgrading method |
CN116360831A (en) * | 2023-05-31 | 2023-06-30 | 中国第一汽车股份有限公司 | Application program upgrading method and device, electronic equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN113467813A (en) | Controller online upgrading method and device, electronic equipment and storage medium | |
CN106569847B (en) | Method for vehicle-mounted system to realize IAP remote upgrade based on mobile network | |
CN110134415A (en) | A kind of controller and its method for upgrading software and device | |
CN109358887B (en) | On-line upgrading method, device and system for single chip microcomputer program | |
CN110597542B (en) | Software automatic OTA (over the air) upgrading method and device and electronic equipment | |
CN109947449B (en) | System upgrading method and device, storage medium and electronic equipment | |
CN111813428A (en) | Method and device for upgrading terminal firmware, electronic equipment and storage medium | |
CN105389177A (en) | Software version confirmation method, device and system | |
CN104850427B (en) | A kind of code upgrade method and device | |
CN110442473B (en) | Nonvolatile data storage method and device, electronic equipment and medium | |
CN111190629B (en) | Embedded terminal upgrading software package and analysis method thereof | |
CN111930406B (en) | Vehicle-mounted terminal micro control unit software upgrading method, electronic equipment and storage medium | |
CN112650518A (en) | DSP program on-line upgrading method | |
CN115357434A (en) | Complete machine testing method, device to be tested, computer device and storage medium | |
CN108845823B (en) | Software online upgrading method based on F2812 chip | |
CN105243042A (en) | Data burning method and data burning device | |
CN105045671A (en) | Method and device for upgrading systems of intelligent terminals | |
CN114489732A (en) | Method and device for updating FPGA (field programmable Gate array) firmware of equipment and electronic equipment | |
CN107479924B (en) | Software upgrading verification method based on Android system | |
CN113268262A (en) | FPGA remote updating configuration method, system, electronic equipment and storage medium | |
CN107515757A (en) | Software program upgrading method and system and terminal | |
CN105653412A (en) | Fingerprint device compatibility detection method and terminal | |
CN109344096A (en) | A kind of method, apparatus, equipment and storage medium connecting external equipment | |
CN112925546A (en) | Multi-stage verification method and system for preventing vehicle-mounted ECU (electronic control Unit) from refreshing errors | |
CN111857664B (en) | Application development method, device, equipment and storage medium |
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 |