CN114281385B - Upgrading method and upgrading device of electronic equipment - Google Patents
Upgrading method and upgrading device of electronic equipment Download PDFInfo
- Publication number
- CN114281385B CN114281385B CN202111617857.4A CN202111617857A CN114281385B CN 114281385 B CN114281385 B CN 114281385B CN 202111617857 A CN202111617857 A CN 202111617857A CN 114281385 B CN114281385 B CN 114281385B
- Authority
- CN
- China
- Prior art keywords
- storage area
- upgrade
- upgraded
- upgrading
- data
- 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.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 81
- 230000009191 jumping Effects 0.000 claims description 17
- 230000008569 process Effects 0.000 description 10
- 230000006870 function Effects 0.000 description 8
- 230000004044 response Effects 0.000 description 7
- 230000003287 optical effect Effects 0.000 description 6
- 230000009286 beneficial effect Effects 0.000 description 5
- 230000008901 benefit Effects 0.000 description 5
- 238000010586 diagram Methods 0.000 description 5
- 230000002093 peripheral effect Effects 0.000 description 3
- 238000003491 array Methods 0.000 description 2
- 238000006243 chemical reaction Methods 0.000 description 2
- 238000004590 computer program Methods 0.000 description 2
- 239000013307 optical fiber Substances 0.000 description 2
- 230000000644 propagated effect Effects 0.000 description 2
- 238000013500 data storage Methods 0.000 description 1
- 230000008707 rearrangement Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Landscapes
- Stored Programmes (AREA)
Abstract
The embodiment of the invention discloses an upgrading method and an upgrading device of electronic equipment. The electronic equipment is provided with a micro control unit, the upgrading method of the electronic equipment is suitable for upgrading a program to be upgraded in the micro control unit, a memory area of the micro control unit comprises a first storage area, a second storage area and a storage area to be upgraded, the upgrading method of the electronic equipment comprises the steps of judging whether the first storage area is provided with a space for storing upgrading data, receiving an upgrading instruction through the storage area to be upgraded or the second storage area when the first storage area is provided with the space for storing the upgrading data so as to store the upgrading data in the upgrading instruction into the storage area to be upgraded when the first storage area is not provided with the space for storing the upgrading data, and accordingly, the upgrading mode is adaptively adjusted according to the memory space required by the upgrading data.
Description
Technical Field
The embodiment of the invention relates to the technical field of program upgrading, in particular to an upgrading method and an upgrading device of electronic equipment.
Background
After the electronic devices, such as converters, electronic switches, and electronic ac power controllers, which use power electronics as main functional elements, are manufactured and assembled, it is generally difficult to write software into the micro control unit (Micro Controller Unit, MCU) through the writing interface. Therefore, in the prior art, the program software inside the MCU is updated by means of online software update, that is, the update data is transmitted to the MCU in the electronic device in a communication manner, without depending on the programming interface for programming. However, in the prior art, only one upgrade mode is generally adopted to upgrade the program in the MCU, and the upgrade mode cannot be flexibly switched according to the upgrade data and the size of the memory space of the electronic device, so that the reliability of program upgrade is lower.
Disclosure of Invention
The embodiment of the invention provides an upgrading method and an upgrading device for electronic equipment, which are used for adaptively adjusting the receiving mode of upgrading data according to the memory space required by the upgrading data, so that the receiving requirements of the to-be-upgraded program on the upgrading data in different stages are met, and the reliability of program upgrading is improved.
In a first aspect, an embodiment of the present invention provides an upgrade method for an electronic device, where the electronic device is configured with a micro control unit, where the upgrade method for the electronic device is adapted to upgrade a program to be upgraded in the micro control unit, and a memory area of the micro control unit includes a first storage area, a second storage area, and a storage area to be upgraded;
the upgrading method of the electronic equipment comprises the following steps:
Judging whether the first storage area has a space for storing upgrade data or not;
When the first storage area is provided with a space for storing upgrade data, receiving an upgrade instruction through the storage area to be upgraded or the second storage area so as to store the upgrade data in the upgrade instruction into the first storage area;
and when the first storage area does not have a space for storing upgrade data, receiving an upgrade instruction through the second storage area so as to store the upgrade data in the upgrade instruction into the storage area to be upgraded.
Optionally, the first storage area is used for storing upgrade data of the program to be upgraded, and the program to be upgraded includes an application program and a bootstrap program;
When the program to be upgraded is an application program, the storage area to be upgraded is used for storing application program data, the second storage area is a guide area, and when the program to be upgraded is a guide program, the storage area to be upgraded is used for storing guide program data, and the second storage area is an application area.
Optionally, determining whether the first storage area has a space for storing upgrade data includes:
Acquiring length information of upgrade data, total memory of the first storage area and currently used memory;
Calculating the current residual available memory of the first storage area according to the difference between the total memory and the current used memory;
if the current residual available memory of the first storage area is greater than or equal to the length of the upgrade data, determining that the first storage area has a space for storing the upgrade data;
and if the current residual available memory of the first storage area is smaller than the length of the upgrade data, determining that the first storage area does not have a space for storing the upgrade data.
Optionally, when the first storage area has a space for storing upgrade data, receiving an upgrade instruction through the storage area to be upgraded or the second storage area, so as to store the upgrade data in the upgrade instruction into the first storage area, and then the upgrade method of the electronic device further includes:
Judging whether the upgrade data stored in the first storage area is correct and complete;
If the upgrade data stored in the first storage area is correct and complete, the upgrade data stored in the first storage area is used for replacing the to-be-upgraded program data in the to-be-upgraded storage area through the second storage area, so that the upgrade of the to-be-upgraded program is completed.
Optionally, when the first storage area does not have a space for storing upgrade data, receiving an upgrade instruction through the second storage area, so as to store the upgrade data in the upgrade instruction into the storage area to be upgraded, including:
Jumping to the second storage area;
receiving the upgrade instruction through the second storage area so as to store the upgrade data in the upgrade instruction into the storage area to be upgraded;
And if the upgrade data stored in the storage area to be upgraded is correct and complete, finishing the upgrade of the program to be upgraded.
Optionally, the memory area of the micro control unit further includes an upgrade flag storage area, where the upgrade flag storage area is used to store an upgrade flag, the upgrade flag includes an upgrade completion flag, and the upgrade completion flag is used to characterize that the first storage area has stored correct and complete upgrade data;
After judging whether the upgrade data stored in the first storage area is correct and complete, the upgrade method of the electronic device further includes:
If the upgrade data stored in the first storage area is correct and complete, writing an upgrade completion mark into the upgrade mark storage area;
If the upgrade data stored in the first storage area is incorrect and/or incomplete, not writing an upgrade completion mark into the upgrade mark storage area;
If the upgrade completion flag is written into the upgrade flag storage area, replacing the program data to be upgraded in the storage area to be upgraded with the upgrade data stored in the first storage area through the second storage area, and after the program data to be upgraded in the storage area to be upgraded is replaced with the upgrade data of the first storage area, clearing the upgrade completion flag to complete the upgrade of the program to be upgraded.
Optionally, the upgrade flag further includes an upgrade-in flag, where the upgrade-in flag is used to characterize that the first storage area has no space for storing upgrade data, and the upgrade instruction needs to be received through the second storage area;
after determining that the first storage area does not have a space to store upgrade data, and before jumping to the second storage area, the upgrade method of the electronic device further includes:
Writing the upgrading mark into the upgrading mark storage area;
If the upgrading mark is written into the upgrading mark storage area, receiving the upgrading instruction through the second storage area, and storing the upgrading data in the upgrading instruction into the storage area to be upgraded;
And after the upgrade data is correctly and completely stored in the storage area to be upgraded, clearing the upgrading mark to finish the upgrading of the program, and if the upgrade data is incorrectly and/or incompletely stored in the storage area to be upgraded, not clearing the upgrading mark.
Optionally, before determining whether the first storage area has a space for storing upgrade data, the upgrade method of the electronic device further includes:
receiving an upgrade scheduling instruction, wherein the upgrade scheduling instruction at least comprises an instruction for entering an upgrade mode;
And after receiving the upgrade scheduling instruction, completing upgrade preparation.
Optionally, the upgrade flag further includes a storage area skip flag, where the storage area skip flag is used to characterize that the electronic device has received an upgrade scheduling instruction and complete upgrade preparation;
after writing the upgrade-in flag to the upgrade flag storage area, and before jumping to the second storage area, the upgrade method of the electronic device further includes:
writing the memory area jump mark into the upgrading mark memory area.
Optionally, after jumping to the second storage area, the method for upgrading the electronic device further includes:
If the upgrading mark and the storage area skip mark are written into the upgrading mark storage area, the storage area skip mark is cleared;
after jumping to the second storage area, if the upgrading flag is written into the upgrading flag storage area, but the storage area jumping flag is cleared, receiving the upgrading scheduling instruction again, and finishing upgrading preparation.
In a second aspect, the embodiment of the invention also provides an upgrade device of an electronic device, wherein a micro control unit is configured in the electronic device, the upgrade method of the electronic device is suitable for upgrading a program to be upgraded in the micro control unit, and a memory area of the micro control unit comprises a first memory area, a second memory area and a memory area to be upgraded;
the upgrading device of the electronic equipment comprises:
The storage space judging module is used for judging whether the first storage area has a space for storing upgrade data or not;
The first upgrading module is used for receiving an upgrading instruction through the storage area to be upgraded or the second storage area when the first storage area is provided with a space for storing upgrading data, so that the upgrading data in the upgrading instruction is stored in the first storage area;
and the second upgrading module is used for receiving an upgrading instruction through the second storage area when the first storage area does not have a space for storing upgrading data, so that the upgrading data in the upgrading instruction is stored in the storage area to be upgraded.
The upgrading method and the upgrading device for the electronic equipment are suitable for upgrading the program to be upgraded in the MCU of the electronic equipment, and the program to be upgraded can be an application program or a guide program. When the first storage area has a space for storing upgrade data, an upgrade instruction is received through the storage area to be upgraded or the second storage area, so that the upgrade data in the upgrade instruction is stored in the first storage area, and the upgrade program to be upgraded is upgraded, when the first storage area does not have the space for storing the upgrade data, the upgrade instruction is received through the second storage area, so that the upgrade data in the upgrade instruction is stored in the storage area to be upgraded, and the self-adaptive adjustment of the receiving mode of the upgrade data according to the memory space required by the upgrade data is realized. For the electronic equipment, the memory space occupied by the programs to be upgraded at different stages is different, the scheme is beneficial to meeting the upgrade data receiving requirements of the programs to be upgraded at different stages in the electronic equipment, the memory cost of the system is not required to be increased, the reliability of the programs to be upgraded is improved, and the influence of the upgrading process on the normal operation of the equipment is reduced.
Drawings
Fig. 1 is a flow chart of an upgrade method of an electronic device according to an embodiment of the present invention;
fig. 2 is a flow chart of another method for upgrading electronic equipment according to an embodiment of the present invention;
fig. 3 is a flowchart of another method for upgrading electronic equipment according to an embodiment of the present invention;
fig. 4 is a flowchart of another method for upgrading electronic equipment according to an embodiment of the present invention;
fig. 5 is a schematic block diagram of an upgrade apparatus of an electronic device according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a terminal according to an embodiment of the present invention.
Detailed Description
The invention is described in further detail below with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting thereof. It should be further noted that, for convenience of description, only some, but not all of the structures related to the present invention are shown in the drawings.
At present, the upgrade data receiving of the program to be upgraded generally has two schemes, namely, firstly, receiving the upgrade data through a backup area, and after the upgrade data is received, if the upgrade data is complete, copying the upgrade data of the backup area to the program area to be upgraded to realize the program upgrade, and secondly, firstly, erasing the program area to be upgraded and then directly storing the upgrade data into the program area to be upgraded. The first scheme has the advantages that when the upgrade data is received incompletely, the system can continue to operate based on the original program, the disadvantage is that the device must have enough memory space to store the upgrade data, the second scheme has the advantage that no additional backup area is needed to store the upgrade data, and the disadvantage is that if the upgrade data is received incompletely, the system cannot continue to operate. For electronic devices, there may be differences in memory space occupied by software at different stages. For example, during early debugging, the function is simpler, the memory occupied by the software is smaller, the storage space of the backup area is enough for storing the upgrade data, and along with the perfection of the program function, the memory occupied by the software is larger, and the storage space of the backup area is difficult to store the upgrade data. As described in the background art, in the prior art, only one upgrading mode is generally adopted to upgrade the program in the MCU, so that the upgrading mode cannot be flexibly switched, and the method is difficult to adapt to the upgrading data storage requirements of different stages, so that the reliability of program upgrading is lower.
Aiming at the problems, the embodiment of the invention provides an upgrading method of electronic equipment. Fig. 1 is a flow chart of an upgrade method of an electronic device according to an embodiment of the present invention. The method may be performed by an upgrade apparatus of an electronic device, which may be implemented in software and/or hardware, where the apparatus may be configured in an electronic device, for example, a power electronic device, a server, or a terminal device, where typical terminal devices include a mobile terminal, and specifically include a mobile phone, a computer, or a tablet computer. The electronic device in this embodiment is configured with a micro control unit, and this embodiment is applicable to a case of upgrading a program to be upgraded in an MCU of the micro control unit, where a memory area of the micro control unit includes a first memory area, a second memory area, and a memory area to be upgraded, and accordingly, referring to fig. 1, an upgrading method of the electronic device includes the following steps:
S110, judging whether the first storage area has a space for storing upgrade data.
Specifically, the electronic device in the embodiment of the present invention includes a power electronic device, which may be an electric energy conversion device in a photovoltaic system, such as an inverter or the like. The first storage area, the second storage area and the storage area to be upgraded are all independent storage areas. The program to be upgraded in the micro control unit MCU can be an application program or a bootstrap program. Optionally, when the program to be upgraded is an application program, the storage area to be upgraded is used for storing application program data, the second storage area is a guide area, and when the program to be upgraded is a guide program, the storage area to be upgraded is used for storing guide program data, and the second storage area is an application area. The Boot area (i.e., boot area) stores a system Boot file for booting. The application area is the APP area. The first storage area may be used to store upgrade data of the program to be upgraded, for example, the memory area of the micro control unit further includes a remaining memory area, and the first storage area may be one of the remaining memory areas, where an area other than the first storage area in the remaining memory area may be either empty or used to store other data, for example, operation state data of the photovoltaic system, and the like. The size of the first memory area may vary with the use of areas other than the first memory area in the remaining memory areas.
Before upgrading the program to be upgraded, whether the first storage area has a space for storing upgrade data is judged. When the current available memory space of the first memory area is insufficient to store the upgrade data, it may be determined that the first memory area has a space to store the upgrade data, and when the current available memory space of the first memory area is insufficient to store the upgrade data, it may be determined that the first memory area does not have a space to store the upgrade data.
S120, when the first storage area is provided with a space for storing upgrade data, receiving an upgrade instruction through the storage area to be upgraded or the second storage area to store the upgrade data in the upgrade instruction into the first storage area, and when the first storage area is not provided with a space for storing the upgrade data, receiving the upgrade instruction through the second storage area to store the upgrade data in the upgrade instruction into the storage area to be upgraded.
In one embodiment, the to-be-upgraded memory area is used for storing application program data, that is, the to-be-upgraded memory area is an APP area, and the second memory area is a boot area. When the application program is upgraded, if the first storage area has a space for storing upgrade data, an upgrade instruction is received through the storage area to be upgraded or the second storage area, so that the upgrade data corresponding to the upgrade instruction is stored in the first storage area in response to the upgrade instruction in the storage area to be upgraded or the second storage area. After the first storage area receives all the upgrade data completely, the upgrade data in the first storage area can be used for replacing the application program data currently stored in the storage area to be upgraded, and the data stored in the storage area to be upgraded is the upgraded application program data at the moment, so that the upgrade of the application program is realized. The advantage of this is that during the upgrade process, the storage area to be upgraded still stores the application data before the upgrade, and even if the upgrade data received by the first storage area is incomplete, the device can continue to operate based on the application data before the upgrade stored in the storage area to be upgraded.
When the application program is upgraded, if the first storage area does not have a space for storing upgrade data, the second storage area, namely the guide area, can respond to an upgrade instruction during the upgrade, firstly erase the current application program data stored in the storage area to be upgraded, and then store the upgrade data into the storage area to be upgraded, and at the moment, the data stored in the storage area to be upgraded is already the upgraded application program data, thereby realizing the upgrade of the application program. The advantage of this is that an upgrade of the application program is still enabled in case the memory of the first storage area is insufficient to store upgrade data.
In another embodiment, the to-be-upgraded program is a boot program, the to-be-upgraded storage area is used for storing boot program data, and the second storage area is an application area (APP area). When the boot program is upgraded, if the first storage area has a space for storing upgrade data, an upgrade instruction is received through the storage area to be upgraded or the second storage area, so that the upgrade data corresponding to the upgrade instruction is stored in the first storage area in response to the upgrade instruction in the storage area to be upgraded or the second storage area. After the first storage area receives all the upgrade data completely, the upgrade data in the first storage area can be used for replacing the currently stored bootstrap data of the storage area to be upgraded, and the data stored in the storage area to be upgraded is already the upgraded bootstrap data at the moment, so that the upgrade of the bootstrap is realized. If the first storage area does not have a space for storing upgrade data, the second storage area, namely the application area, can respond to the upgrade instruction, firstly erase the currently stored bootstrap program data of the storage area to be upgraded, and then store the upgrade data into the storage area to be upgraded, and at the moment, the data stored in the storage area to be upgraded is already the upgraded bootstrap program data, thereby realizing the upgrade of the bootstrap program.
The technical scheme of the embodiment of the invention is suitable for upgrading the program to be upgraded in the MCU of the electronic equipment, and the program to be upgraded can be an application program or a guide program. When the first storage area has a space for storing upgrade data, an upgrade instruction is received through the storage area to be upgraded or the second storage area, so that the upgrade data in the upgrade instruction is stored in the first storage area, and the upgrade program to be upgraded is upgraded, when the first storage area does not have the space for storing the upgrade data, the upgrade instruction is received through the second storage area, so that the upgrade data in the upgrade instruction is stored in the storage area to be upgraded, and the self-adaptive adjustment of the receiving mode of the upgrade data according to the memory space required by the upgrade data is realized. For the electronic equipment, the memory space occupied by the programs to be upgraded at different stages is different, the scheme is beneficial to meeting the upgrade data receiving requirements of the programs to be upgraded at different stages in the electronic equipment, the memory cost of the system is not required to be increased, the reliability of the programs to be upgraded is improved, and the influence of the upgrading process on the normal operation of the equipment is reduced.
Fig. 2 is a flowchart of another method for upgrading electronic equipment according to an embodiment of the present invention. On the basis of the above embodiment, the present embodiment optimizes an upgrade method of an electronic device. Optionally, in this embodiment and the following embodiments, when the program to be upgraded is an application program, the storage area to be upgraded is used to store application program data, the second storage area is a boot area, and when the program to be upgraded is a boot program, the storage area to be upgraded is used to store boot program data, and the second storage area is an application area for illustration. Correspondingly, referring to fig. 2, the method of the present embodiment specifically includes the following steps:
S210, receiving an instruction for entering an upgrade mode.
The instruction of entering the upgrade mode is different from the upgrade instruction in that the upgrade instruction includes upgrade data required for upgrading a program to be upgraded, and the instruction of entering the upgrade mode includes attribute information of the upgrade data, for example, the instruction of entering the upgrade mode includes length information of the upgrade data, and the like. The instruction for entering the upgrade mode is an instruction converted by a communication protocol according to the upgrade file, and the length information of the upgrade data may be directly extracted from the instruction for entering the upgrade mode, or the length information of the upgrade data may be extracted from the upgrade file.
S220, acquiring length information of the upgrade data, total memory of the first storage area and currently used memory.
S230, calculating the current residual available memory of the first storage area according to the difference between the total memory and the current used memory.
S240, judging whether the first storage area has a space for storing upgrade data according to the relation between the current residual available memory of the first storage area and the length of the upgrade data.
If the current remaining available memory of the first storage area is greater than or equal to the length of the upgrade data, it is determined that the first storage area has a space for storing the upgrade data, and step S250 is performed, and if the current remaining available memory of the first storage area is less than the length of the upgrade data, it is determined that the first storage area does not have a space for storing the upgrade data, and step S260 is performed.
For example, the length information of the upgrade data may represent the amount of memory that the upgrade data needs to occupy. The current residual available memory of the first storage area is equal to the difference between the total memory of the first storage area and the current used memory, if the residual available memory is larger than or equal to the length of the upgrade data, the current residual memory of the first storage area can store the upgrade data, and if the residual available memory is smaller than the length of the upgrade data, the current residual memory of the first storage area cannot store the upgrade data. When the first storage area is one storage area in the remaining memory areas, the size of the first storage area changes along with the use condition of the areas except the first storage area in the remaining memory areas, so that the total memory of the first storage area can be determined according to the total memory of the remaining memory areas and the use condition of the areas except the first storage area in the remaining memory areas, and then the current remaining available memory of the first storage area is calculated.
When the program to be upgraded in the MCU is upgraded, communication can be established between the MCU and the upper computer, and an instruction for entering an upgrade mode and an upgrade instruction are issued to the MCU through the upper computer, or the MCU can also be established between the MCU and the upper computer through the upper communication unit, namely, the upper computer issues the instruction for entering the upgrade mode and the upgrade instruction to the MCU through the upper communication unit. The step of determining whether the first storage area can store the upgrade data may be performed by an upper computer or by the MCU. The step of the MCU subsequently receiving the upgrade data in response to the upgrade instruction to upgrade the program to be upgraded can be executed under the dispatching of the upper computer or the upper communication unit or can be executed autonomously by the MCU.
S250, receiving an upgrade instruction through the storage area to be upgraded or the second storage area so as to store upgrade data in the upgrade instruction into the first storage area.
S260, receiving the upgrade instruction through the second storage area so as to store the upgrade data in the upgrade instruction into the storage area to be upgraded.
Fig. 3 is a flowchart of another method for upgrading electronic equipment according to an embodiment of the present invention. The embodiment optimizes the upgrading method of the electronic equipment. Referring to fig. 3, the method of this embodiment specifically includes the following steps:
S301, receiving an instruction for entering an upgrade mode.
S302, judging whether the first storage area has a space for storing upgrade data.
If the first storage area has a space for storing upgrade data, step S303 is performed, and if the first storage area does not have a space for storing upgrade data, step S308 is performed.
S303, receiving an upgrade instruction through the storage area to be upgraded or the second storage area so as to store upgrade data in the upgrade instruction into the first storage area.
S304, judging whether the upgrade data stored in the first storage area is correct and complete.
Specifically, after the upgrade data is stored in the first storage area, whether the upgrade data stored in the first storage area is correct and complete is judged. If the upgrade data stored in the first storage area is correct and complete, S305 is performed, and if the upgrade data stored in the first storage area is incorrect and/or incomplete, S307 is performed.
When the first storage area is provided with a space for storing upgrade data, the upgrade instruction is received through the storage area to be upgraded or the second storage area, so that the upgrade data in the upgrade instruction is stored in the first storage area, and the program to be upgraded is upgraded. If the upgrade data received by the first storage area is correct and complete, the subsequent upgrade steps can be normally performed.
S305, replacing the program data to be upgraded in the storage area to be upgraded with the upgrade data stored in the first storage area through the second storage area.
When the first storage area has a space for storing upgrade data, if the upgrade instruction is received through the storage area to be upgraded, the storage area to be upgraded needs to jump to the second storage area to execute step S305, and if the upgrade instruction is received through the second storage area, the jump is not needed, and step S305 can be directly executed.
S306, finishing the upgrading of the program to be upgraded.
Specifically, the upgrade data stored in the first storage area is copied to the to-be-upgraded storage area through the second storage area, so that the upgrade data stored in the first storage area is used for replacing the to-be-upgraded program data in the to-be-upgraded storage area, after the data in the to-be-upgraded storage area is replaced with the upgrade data, the second storage area jumps back to the to-be-upgraded storage area, and at the moment, the data in the to-be-upgraded storage area is updated to the upgraded data, so that the upgrade of the to-be-upgraded program is completed. Optionally, after step S306, the upgrade data temporarily stored in the first storage area may be cleared.
S307, the upgrade data in the first storage area is emptied.
Optionally, in an embodiment, if the upgrade data received by the first storage area is incorrect and/or incomplete, the second storage area or the to-be-upgraded storage area may be selected to empty the upgrade data currently stored in the first storage area, so that the system can be prevented from replacing the to-be-upgraded program data based on the incorrect and/or incomplete upgrade data, so that the system can still operate normally based on the to-be-upgraded program data in the to-be-upgraded storage area.
Alternatively, in another embodiment, if the upgrade data received by the first storage area is incorrect and/or incomplete, no other operation may be performed.
S308, jumping to the second storage area.
S309, receiving the upgrade instruction through the second storage area, so as to store the upgrade data in the upgrade instruction into the storage area to be upgraded.
Specifically, when the first storage area does not have a space for storing the upgrade data, the second storage area may be skipped to receive the upgrade instruction through the second storage area, thereby storing the upgrade data in the storage area to be upgraded in response to the upgrade instruction. Optionally, the second storage area responds to the upgrade instruction, original program data to be upgraded in the storage area to be upgraded is firstly erased, and then the upgrade data is stored in the storage area to be upgraded.
S310, judging whether the upgrade data stored in the storage area to be upgraded is correct and complete.
If the upgrade data stored in the storage area to be upgraded is correct and complete, step S311 is executed, and if the upgrade data stored in the storage area to be upgraded is incorrect and/or incomplete, step S312 is executed.
S311, finishing the upgrading of the program to be upgraded.
Specifically, after the storage area to be upgraded completely and correctly receives the upgrade data, the second storage area jumps back to the storage area to be upgraded, and at this time, the data in the storage area to be upgraded is updated into the upgraded data, thereby completing the upgrade of the program to be upgraded.
S312, waiting for upgrading again.
On the basis of the above embodiment, optionally, the memory area of the MCU further includes an upgrade flag storage area, where the upgrade flag storage area is used to store an upgrade flag, and the upgrade flag includes an upgrade completion flag, where the upgrade completion flag is used to characterize that the first storage area has stored correct and complete upgrade data. For example, the memory area of the micro control unit MCU may be divided into a boot area, an APP area, an upgrade flag storage area, and a remaining memory area. The first storage area is a storage area in the residual memory area, one of the second storage area and the storage area to be upgraded is a guide area, the other is an APP area, and the upgrading mark storage area is used for storing upgrading marks representing different upgrading states. Accordingly, after step S304, the method for upgrading an electronic device further includes:
If the upgrade data stored in the first storage area is correct and complete, the upgrade completion flag is written into the upgrade flag storage area, and if the upgrade data stored in the first storage area is incorrect and/or incomplete, the upgrade completion flag is not written into the upgrade flag storage area.
If the upgrade completion flag is written into the upgrade flag storage area, replacing the program data to be upgraded in the storage area to be upgraded with the upgrade data stored in the first storage area through the second storage area, and after the program data to be upgraded in the storage area to be upgraded is replaced with the upgrade data of the first storage area, clearing the upgrade completion flag to complete the upgrade of the program to be upgraded.
Specifically, when the first storage area has a space for storing upgrade data, the upgrade instruction is received through the storage area to be upgraded or the second storage area, so that the upgrade data in the upgrade instruction is stored in the first storage area, and the program to be upgraded is upgraded. After the upgrade data is stored by the first storage area, whether the upgrade data stored by the first storage area is correct and complete is judged. If the upgrade data received by the first storage area is correct and complete, an upgrade completion flag may be written into the upgrade flag storage area to indicate that the upgrade data has been received correctly and completely. If the upgrade data received by the first storage area is incorrect and/or incomplete, the upgrade completion flag is not written into the upgrade flag storage area.
If the upgrade completion flag is written into the upgrade flag storage area, the upgrade completion flag is indicated to be valid currently, and if the upgrade completion flag is not written into the upgrade flag storage area, the upgrade completion flag is indicated to be invalid currently. After determining whether to write the "upgrade completion flag" into the upgrade flag storage area, and before performing step S305, the upgrade flag in the upgrade flag storage area is read to determine the upgrade status. If the "upgrade completion flag" is valid, step S305 is performed to replace the program data to be upgraded in the storage area to be upgraded with the upgrade data stored in the first storage area through the second storage area. After the data in the storage area to be upgraded is replaced by the upgrade data, the upgrade completion flag is cleared, and at the moment, the data in the storage area to be upgraded is updated into the upgraded data, so that the upgrade of the program to be upgraded is completed.
On the basis of the above embodiment, optionally, the upgrade flag further comprises an upgrade flag, the upgrade flag being used for characterizing that the first storage area has no space for storing upgrade data, and the upgrade instruction needs to be received through the second storage area, and accordingly, after determining that the first storage area has no space for storing upgrade data, and before executing step S308, the upgrade method of the electronic device further comprises writing the upgrade flag into the upgrade flag storage area.
The method comprises the steps of writing an upgrading mark into an upgrading mark storage area, receiving an upgrading instruction through a second storage area if the upgrading mark is written into the upgrading mark storage area, storing upgrading data in the upgrading instruction into a storage area to be upgraded, clearing the upgrading mark after the upgrading data is correctly and completely stored into the storage area to be upgraded, and finishing upgrading of a program, wherein if the upgrading data is incorrectly and/or incompletely stored into the storage area to be upgraded, the upgrading mark is not cleared.
If the upgrading flag is written into the upgrading flag storage area, the upgrading flag is valid, and if the upgrading flag is not written into the upgrading flag storage area, the upgrading flag is invalid. After it is determined that the first storage area does not have a space to store the upgrade data, the upgrade flag being updated is written into the upgrade flag storage area, and then step S308 is performed to jump to the second storage area and read the upgrade flag in the upgrade flag storage area to determine the upgrade status. If the "upgrading flag" is valid, step S309 is executed, in which the upgrade instruction is received through the second storage area, so as to store the upgrade data in the upgrade instruction into the storage area to be upgraded. After the fact that the upgrade data stored in the storage area to be upgraded is correct and complete is judged, the 'upgrading sign' in the upgrade sign storage area is cleared, and at the moment, the data in the storage area to be upgraded is updated into upgraded data, so that the upgrade of the program to be upgraded is completed. If the upgrade data is not correctly and/or incompletely stored in the memory area to be upgraded, the "being upgraded flag" is not cleared, and step S312 is performed to wait for the upgrade again.
On the basis of the above embodiment, optionally, before step S301, the method for upgrading an electronic device further includes:
Receiving an upgrade scheduling instruction, wherein the upgrade scheduling instruction at least comprises an instruction for entering an upgrade mode;
after receiving the upgrade scheduling instruction, upgrade preparation is completed.
The upgrade preparation may include switching from the normal operation mode to the upgrade mode, switching to the upgrade protocol, sending length information of upgrade data, total memory of the first storage area, currently used memory, and the like after receiving the upgrade scheduling instruction. It should be noted that, the upgrade preparation work is not limited to the above steps, and the upgrade preparation work may also include other steps, or at least some of the above steps, and the specific content of the upgrade preparation work is not limited in this embodiment.
The upgrade scheduling instruction is issued to the micro control unit MCU of the electronic device through the upper computer, or issued to the upper communication unit of the electronic device through the upper computer, and issued to the micro control unit MCU through the upper communication unit. .
After the micro control unit MCU receives the upgrade scheduling instruction and finishes upgrade preparation, upgrade ready information can be generated, so that the upper computer can inquire (or inquire through the upper communication unit) the upgrade ready information of the micro control unit MCU, and then the upgrade instruction is issued to the micro control unit MCU according to the inquired upgrade ready information. For example, when other control units are further connected to the communication bus between the upper computer and the MCU, the MCU and the other control units may complete the upgrade preparation after receiving the upgrade scheduling instruction, generate upgrade ready information, and after the MCU and the other control units can be queried by the upper computer, the upper computer may issue an upgrade instruction to the MCU and the other control units, so that the MCU and the other control units execute steps S302 to S312 in the above embodiment, to implement the upgrade of the program to be upgraded.
In an exemplary embodiment, when the instruction for entering the upgrade mode is received and it is determined that the first storage area does not have a space for storing upgrade data according to the length information of the upgrade data in the instruction for entering the upgrade mode and the current remaining available memory of the first storage area, the upgrade instruction needs to be received through the second storage area, that is, step S308 in the above embodiment needs to be executed, and the operation jumps to the second storage area. If the interruption or failure of the upgrade process of the program to be upgraded occurs after the jump to the second storage area, for example, in the process of executing step S309, the interruption or failure of the upgrade process of the program to be upgraded occurs, and the electronic device is powered down and restarted to be upgraded again, the upgrade scheduling instruction can be received again through the second storage area to complete the upgrade preparation, so that the upgrade data can be stored in the to-be-upgraded storage area through the second storage area in response to the upgrade instruction again, thereby completing the upgrade of the program to be upgraded.
According to the technical scheme, when the electronic equipment is upgraded again after the upgrade failure, the upgrade scheduling instruction can be received again, and upgrade preparation is completed, so that the program to be upgraded is upgraded. The scheme is applicable to a system for communicating with a plurality of electronic devices, if a plurality of electronic devices are upgraded at the same time, and the upgrade of one electronic device is interrupted or failed, the electronic device can receive the upgrade scheduling instruction again, upgrade preparation is completed, upgrade ready information is generated and sent to an upper computer or an upper communication unit, and accordingly the upgrade process is continued.
On the basis of the embodiment, the upgrading mark optionally further comprises a storage area jump mark, wherein the storage area jump mark is used for representing that the electronic device has received an upgrading scheduling instruction and completes upgrading preparation, and correspondingly, after the upgrading mark is written into the upgrading mark storage area and before jumping to the second storage area, the upgrading method of the electronic device further comprises the step of writing the storage area jump mark into the upgrading mark storage area.
Illustratively, a "memory region jump flag" may be used to inform the second memory region whether it is necessary to cooperate with the system to receive upgrade scheduling instructions to complete the upgrade preparation. After it is determined that the first memory area does not have a space to store the upgrade data, the "being-upgraded flag" is written to the upgrade flag memory area, and the "memory area jump flag" is written to the upgrade flag memory area (the "being-upgraded flag" may be written before the "memory area jump flag" or both may be written at the same time), step S308 is executed again after the "being-upgraded flag" and the "memory area jump flag" are both written to the upgrade flag memory area, and the jump to the second memory area is performed. Since it has been determined that the first memory area does not have a space to store the upgrade data at this time, it is necessary to receive an upgrade instruction through the second memory area, thereby storing the upgrade data in the memory area to be upgraded in response to the upgrade instruction, and the electronic device has received the upgrade scheduling instruction and completed the upgrade preparation, the "memory area jump flag" may be written into the upgrade flag memory area before step S308 is performed.
On the basis of the above embodiment, optionally, after step S308, the method for upgrading an electronic device further includes:
if the upgrading mark and the storage area skip mark are written into the upgrading mark storage area, the storage area skip mark is cleared;
if the upgrading mark is written into the upgrading mark storage area, but the storage area jump mark is cleared, the upgrading scheduling instruction is received again, and the upgrading preparation is completed.
Illustratively, if the "memory area skip flag" has been written to the upgrade flag memory area, it indicates that the "memory area skip flag" is valid, and if the "memory area skip flag" has not been written to the upgrade flag memory area, it indicates that the "memory area skip flag" is not valid. After determining that the first storage area does not have a space to store the upgrade data, step S308 in the above embodiment is performed, jumping to the second storage area, and reading the upgrade flag in the upgrade flag storage area to determine the upgrade status. If the "update flag" is valid, if the "storage area skip flag" is valid, it indicates that the electronic device has received the update scheduling instruction and completed the update preparation, and the "storage area skip flag" in the update flag storage area may be cleared, and steps S309 to S311 are continuously performed, so as to complete the update of the program to be updated.
In the case of interruption or failure of the upgrade process of the program to be upgraded, for example, after the electronic device is powered down and restarted after the last upgrade failure, whether various upgrade marks in the upgrade mark storage area are valid is detected, if the upgrade mark is valid and the storage area skip mark is invalid, the storage area skip mark is cleared, the interruption or failure of the last upgrade occurs after the first storage area is judged to have no space for storing upgrade data, an upgrade instruction is required to be received through the second storage area, and the second storage area is skipped. Therefore, the upgrade scheduling instruction can be received again through the second storage area and upgrade preparation is completed, so that upgrade data can be stored into the storage area to be upgraded through the second storage area in response to the upgrade instruction again, and upgrade of the program to be upgraded is completed.
On the basis of the above embodiments, optionally, the upgrade flag storage area includes a first sub-storage area, a second sub-storage area, and a third sub-storage area, where the first sub-storage area is used for storing an upgrade completion flag, the second sub-storage area is used for storing an upgrade-in flag, and the third sub-storage area is used for storing a storage area jump flag. The present solution stores different types of upgrade flags by setting different sub-storage areas, so that the value interval that can be stored in each sub-storage area is larger, and thus the probability of erroneous judgment of the upgrade status can be reduced, for example, if one upgrade flag is represented by a value of 0, and another upgrade flag is represented by a value of 1, then the corresponding space in the memory is changed from one upgrade flag to another upgrade flag whenever one bit is changed, and if one upgrade flag is represented by a value of 0xAA, and another upgrade flag is represented by a value of 0x55, then the probability of erroneous judgment of the upgrade status will be reduced. Alternatively, in other embodiments of the present invention, different values may be used in the upgrade flag storage area to characterize different upgrade flags. For example, different upgrade flags such as "upgrade complete flag", "in-upgrade flag", and "memory area jump flag" are characterized by different four-bit binary values, and by reading the values stored in the upgrade flag memory area, it can be determined whether each upgrade flag is valid, thereby determining the current upgrade status of the program to be upgraded.
On the basis of the above embodiments, optionally, the upgrade flag storage area may further include a fourth sub-storage area, and before jumping to the second storage area, other upgrade data attribute information related to the upgrade of the program to be upgraded, such as length information, check information, and data packet information of the upgrade data, may be stored in the fourth sub-storage area, so that the second storage area is facilitated to acquire more upgrade data attribute information.
On the basis of the above embodiments, optionally, when each upgrade flag in the upgrade flag storage area is invalid, or when any upgrade flag is not stored in the upgrade flag storage area, the storage area to be upgraded is skipped, so as to realize a secondary boot function, so that the program to be upgraded cannot normally run.
On the basis of the above embodiments, optionally, the boot area (when the program to be upgraded is an application program, the second storage area is the boot area, and when the program to be upgraded is the boot program, the storage area to be upgraded is the boot area) may also support more control functions, for example, the APP area has a function of controlling a corresponding electronic device, and the boot area may be set to have the same function as the APP area, that is, the corresponding electronic device may be controlled by the boot area. The advantage of setting like this is that under the condition such as upgrade failure, can directly control electronic equipment through the guide area to avoid waiting to upgrade program data in the APP district to be cleared up the unable operation of system that causes, thereby reduce the influence of upgrade failure to system normal operating, when electronic equipment is the electric energy conversion equipment in the photovoltaic system, this scheme helps reducing photovoltaic system's generated energy loss.
Fig. 4 is a flowchart of another method for upgrading electronic equipment according to an embodiment of the present invention. Based on the above embodiments, the present embodiment optimizes an upgrade method of an electronic device. Referring to fig. 4, the method of this embodiment specifically includes the following steps:
S401, receiving an upgrade scheduling instruction.
The upgrade scheduling instruction at least comprises an instruction for entering an upgrade mode.
S402, after receiving the upgrade scheduling instruction, completing upgrade preparation.
S403, judging whether the first storage area has a space for storing the upgrade data according to the length information of the upgrade data and the residual available memory of the first storage area.
When the program to be upgraded is an application program, the storage area to be upgraded is used for storing application program data, the second storage area is a guide area, and when the program to be upgraded is a guide program, the storage area to be upgraded is used for storing guide program data, and the second storage area is an application area.
If the first storage area has a space for storing upgrade data, step S404 is performed, and if the first storage area does not have a space for storing upgrade data, step S411 is performed.
S404, receiving an upgrade instruction through the storage area to be upgraded or the second storage area so as to store upgrade data in the upgrade instruction into the first storage area.
S405, judging whether the upgrade data received by the first storage area is correct and complete.
Specifically, after the first storage area finishes receiving the upgrade data, whether the upgrade data received by the first storage area is correct and complete is judged. If the upgrade data received by the first storage area is incorrect and/or incomplete, step S406 is performed, and if the upgrade data received by the first storage area is correct and complete, step S407 is performed.
S406, the upgrade completion flag is not written into the upgrade flag storage area, and upgrade data in the first storage area is emptied.
S407, writing the upgrade completion flag into the upgrade flag storage area.
S408, judging whether the upgrading completion flag is valid.
If the upgrade completion flag is valid, step S409 is executed, and if the upgrade completion flag is invalid, step S413 or step S415 is executed (only the case of executing step S413 is shown in the figure). If the upgrade completion flag is written into the upgrade completion flag storage area, the upgrade completion flag is valid, and if the upgrade completion flag is not written into the upgrade completion flag storage area, or the upgrade completion flag is cleared, the upgrade completion flag is invalid.
S409, replacing the program data to be upgraded in the storage area to be upgraded by the upgrade data stored in the first storage area through the second storage area, and clearing the upgrade completion mark after the data in the storage area to be upgraded has been replaced with the upgrade data stored in the first storage area.
S410, jumping back to the storage area to be upgraded from the second storage area to finish upgrading of the program to be upgraded.
S411, writing the upgrading mark and the memory area jump mark into the upgrading mark memory area.
S412, jumping to the second storage area.
S413, judging whether the upgrading mark is valid.
If the upgrade flag is valid, step S414 is performed, and if the upgrade flag is invalid, step S415 is performed. Wherein, if the upgrade flag storage area is written with the upgrade flag, the upgrade flag is valid, and if the upgrade flag storage area is not written with the upgrade flag, or the upgrade flag is cleared, the upgrade flag is invalid.
S414, responding to the upgrade instruction through the second storage area, firstly erasing the data in the storage area to be upgraded, then storing the upgrade data into the storage area to be upgraded, and after the storage area to be upgraded stores the upgrade data, clearing the upgrading mark.
S415, jumping to the storage area to be upgraded.
The method for upgrading the electronic equipment when the upgrading mark is valid further comprises the following steps:
s416, judging whether the storage area jump mark is valid.
If the memory area jump flag is valid, step S417 is performed, and if the memory area jump flag is invalid, step S418 is performed. If the upgrade mark storage area is written with the storage area skip mark, the storage area skip mark is valid, and if the upgrade mark storage area is not written with the storage area skip mark or the storage area skip mark is cleared, the storage area skip mark is invalid.
S417, clearing the storage area jump mark.
S418, re-receiving the upgrade scheduling instruction through the second storage area to finish upgrade preparation.
For example, in the case where the "upgrade flag" is valid, if the "memory area skip flag" is valid, it indicates that the electronic device has received the upgrade scheduling instruction and completed the upgrade preparation, the "memory area skip flag" in the upgrade flag memory area may be cleared, that is, after the completion of step S417 is performed, step S414 and step S410 are continuously performed, thereby completing the upgrade of the program to be upgraded.
Under the conditions of interruption or failure of the upgrading process of the program to be upgraded, for example, after the electronic equipment is powered down and restarted after the last upgrading failure, whether various upgrading marks in the upgrading mark storage area are valid or not is detected, if the upgrading mark is valid and the storage area skip mark is invalid, the storage area skip mark is cleared, the interruption or failure of the last upgrading occurs after the first storage area is judged to have no space for storing upgrading data, an upgrading instruction is needed to be received through the second storage area, and the program to be upgraded is jumped to the second storage area. Therefore, the upgrade scheduling instruction can be received again through the second storage area to complete upgrade preparation, so that the upgrade of the program to be upgraded is completed. For example, after the execution of the completion step S418, the execution of step S414 and step S410 is continued, thereby completing the upgrade of the program to be upgraded.
The technical scheme of the embodiment of the invention is suitable for upgrading the program to be upgraded in the MCU of the electronic equipment, and the program to be upgraded can be an application program or a guide program. When the first storage area has a space for storing upgrade data, an upgrade instruction is received through the storage area to be upgraded or the second storage area, so that the upgrade data in the upgrade instruction is stored in the first storage area, and the upgrade program to be upgraded is upgraded, when the first storage area does not have the space for storing the upgrade data, the upgrade instruction is received through the second storage area, so that the upgrade data in the upgrade instruction is stored in the storage area to be upgraded, and the self-adaptive adjustment of the receiving mode of the upgrade data according to the memory space required by the upgrade data is realized. For the electronic equipment, the memory space occupied by the programs to be upgraded at different stages is different, the scheme is beneficial to meeting the upgrade data receiving requirements of the programs to be upgraded at different stages in the electronic equipment, the memory cost of the system is not required to be increased, the reliability of the programs to be upgraded is improved, and the influence of the upgrading process on the normal operation of the equipment is reduced.
The embodiment of the invention also provides an upgrading device of the electronic equipment. Fig. 5 is a schematic block diagram of an upgrade apparatus for an electronic device according to an embodiment of the present invention, where the embodiment is applicable to a situation of upgrading a program to be upgraded in a MCU. The upgrade device of the electronic equipment provided by the embodiment of the invention can execute the upgrade method of the electronic equipment provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method. Referring to fig. 5, the apparatus specifically includes a storage space determining module 510, a first upgrade module 520, and a second upgrade module 530, wherein:
the storage space determining module 510 is configured to determine whether the first storage area has a space for storing upgrade data;
The first upgrade module 520 is configured to receive an upgrade instruction through the storage area to be upgraded or the second storage area when the first storage area has a space for storing upgrade data, so as to store the upgrade data in the upgrade instruction into the first storage area;
The second upgrade module 530 is configured to receive an upgrade instruction through the second storage area when the first storage area does not have a space for storing upgrade data, so as to store the upgrade data in the upgrade instruction into the storage area to be upgraded.
The upgrade device of the electronic equipment provided by the embodiment of the invention can execute the upgrade method of the electronic equipment provided by any embodiment of the invention, has corresponding functional modules and beneficial effects of the execution method, and is not repeated.
Fig. 6 is a schematic structural diagram of a terminal according to an embodiment of the present invention. Fig. 6 shows a block diagram of an exemplary device 610 suitable for use in implementing embodiments of the invention. The device 610 shown in fig. 6 is only an example and should not be construed as limiting the functionality and scope of use of embodiments of the invention.
As shown in fig. 6, the device 610 is in the form of a general purpose device. Components of device 610 may include, but are not limited to, one or more processors 614, a storage 626, and a bus 616 that connects the various system components, including the storage 626 and the processors 614.
Bus 616 represents one or more of several types of bus structures, including a memory device bus or memory device controller, a peripheral bus, an accelerated graphics port, a processor, or a local bus using any of a variety of bus architectures. By way of example, and not limitation, such architectures include industry standard architecture (Industry Subversive Alliance, ISA) bus, micro channel architecture (Micro Channel Architecture, MAC) bus, enhanced ISA bus, video electronics standards association (Video Electronics Standards Association, VESA) local bus, and peripheral component interconnect (PERIPHERAL COMPONENT INTERCONNECT, PCI) bus.
Device 610 typically includes a variety of computer system readable media. Such media can be any available media that is accessible by device 610 and includes both volatile and nonvolatile media, removable and non-removable media.
The storage 626 may include computer system readable media in the form of volatile memory, such as random access memory (Random Access Memory, RAM) 630 and/or cache memory 632. The device 610 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 634 can be used to read from or write to non-removable, nonvolatile magnetic media (not shown in FIG. 6, commonly referred to as a "hard drive"). Although not shown in fig. 6, a magnetic disk drive for reading from and writing to a removable nonvolatile magnetic disk (e.g., a "floppy disk"), and an optical disk drive for reading from or writing to a removable nonvolatile optical disk such as a compact disk-Only (CD-ROM), digital video disk (Digital Video Disc-Read Only Memory, DVD-ROM), or other optical media may be provided. In such cases, each drive may be coupled to bus 616 via one or more data media interfaces. Storage 626 may include at least one program product having a set (e.g., at least one) of program modules configured to carry out the functions of embodiments of the invention.
A program/utility 660 having a set (at least one) of program modules 662 may be stored, for example, in storage 626, such program modules 662 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each or some combination of which may include an implementation of a network environment. Program modules 662 generally perform the functions and/or methods in the embodiments described herein.
The device 610 may also communicate with one or more external devices 612 (e.g., keyboard, pointing terminal, display 624, etc.), one or more terminals that enable a user to interact with the device 610, and/or any terminals (e.g., network card, modem, etc.) that enable the device 610 to communicate with one or more other computing terminals. Such communication may occur through an input/output (I/O) interface 622. Also, the device 610 may communicate with one or more networks such as a local area network (Local Area Network, LAN), a wide area network (Wide Area Network, WAN), and/or a public network such as the internet through the network adapter 620. As shown in fig. 6, the network adapter 620 communicates with other modules of the device 610 over the bus 616. It should be appreciated that although not shown, other hardware and/or software modules may be used in connection with device 610, including, but not limited to, microcode, terminal drives, redundant processors, external disk drive arrays, disk array (Redundant Arrays of INDEPENDENT DISKS, RAID) systems, tape drives, and data backup storage systems, among others.
The processor 614 executes various functional applications and data processing by running a program stored in the storage device 626, for example, to implement an upgrade method of an electronic device provided by an embodiment of the present invention, the method includes:
judging whether the first storage area has a space for storing upgrade data;
When the first storage area is provided with a space for storing upgrade data, receiving an upgrade instruction through the storage area to be upgraded or the second storage area so as to store the upgrade data in the upgrade instruction into the first storage area;
And when the first storage area does not have a space for storing the upgrade data, receiving an upgrade instruction through the second storage area so as to store the upgrade data in the upgrade instruction into the storage area to be upgraded.
The embodiment of the invention also provides a computer readable storage medium, on which a computer program is stored, which when executed by a processor, implements the method for upgrading an electronic device as provided by the embodiment of the invention, the method comprising:
judging whether the first storage area has a space for storing upgrade data;
When the first storage area is provided with a space for storing upgrade data, receiving an upgrade instruction through the storage area to be upgraded or the second storage area so as to store the upgrade data in the upgrade instruction into the first storage area;
And when the first storage area does not have a space for storing the upgrade data, receiving an upgrade instruction through the second storage area so as to store the upgrade data in the upgrade instruction into the storage area to be upgraded.
The computer storage media of embodiments of the invention may take the form of any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. The computer readable storage medium can be, for example, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the computer-readable storage medium include 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 this document, 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.
The 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 any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. 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 wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations of the present invention may be written in one or more programming languages, including an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or terminal. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
Note that the above is only a preferred embodiment of the present invention and the technical principle applied. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, while the invention has been described in connection with the above embodiments, the invention is not limited to the embodiments, but may be embodied in many other equivalent forms without departing from the spirit or scope of the invention, which is set forth in the following claims.
Claims (11)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111617857.4A CN114281385B (en) | 2021-12-27 | 2021-12-27 | Upgrading method and upgrading device of electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111617857.4A CN114281385B (en) | 2021-12-27 | 2021-12-27 | Upgrading method and upgrading device of electronic equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114281385A CN114281385A (en) | 2022-04-05 |
CN114281385B true CN114281385B (en) | 2025-01-28 |
Family
ID=80876523
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111617857.4A Active CN114281385B (en) | 2021-12-27 | 2021-12-27 | Upgrading method and upgrading device of electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114281385B (en) |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108376077A (en) * | 2018-02-11 | 2018-08-07 | 广东美的厨房电器制造有限公司 | The upgrade method and device of control unit |
CN112527365A (en) * | 2020-11-03 | 2021-03-19 | 珠海格力电器股份有限公司 | Application program updating method, nonvolatile memory, storage medium and household appliance |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106293797A (en) * | 2015-06-11 | 2017-01-04 | 中兴通讯股份有限公司 | A kind of method and system of online updating Single Chip Microcomputer (SCM) program |
CN107992312A (en) * | 2016-10-25 | 2018-05-04 | 中兴通讯股份有限公司 | A kind of upgrade package delivery method and device |
-
2021
- 2021-12-27 CN CN202111617857.4A patent/CN114281385B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108376077A (en) * | 2018-02-11 | 2018-08-07 | 广东美的厨房电器制造有限公司 | The upgrade method and device of control unit |
CN112527365A (en) * | 2020-11-03 | 2021-03-19 | 珠海格力电器股份有限公司 | Application program updating method, nonvolatile memory, storage medium and household appliance |
Also Published As
Publication number | Publication date |
---|---|
CN114281385A (en) | 2022-04-05 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109240730B (en) | Singlechip online upgrading method and system | |
CN108958787B (en) | Block chain system upgrading method, device, equipment and storage medium | |
CN112198820B (en) | Interrupt service implementation method, device, equipment and storage medium | |
CN113377392B (en) | Systems that can upgrade firmware in the background and methods for upgrading firmware in the background | |
US20110283274A1 (en) | Firmware image update and management | |
CN106293824A (en) | A kind of from the method and device processing chip upgrade | |
CN108304282A (en) | A kind of control method and relevant apparatus of double BIOS | |
CN113760332A (en) | Software upgrade method and electronic device | |
CN112068896A (en) | DTS modification method, device and computer readable storage medium | |
CN110851384B (en) | Interrupt processing method, system and computer readable storage medium | |
CN107817962B (en) | Remote control method, device, control server and storage medium | |
WO2024138588A1 (en) | Dual-system secure mobile phone resetting method and apparatus, terminal, and storage medium | |
CN105630530A (en) | Multilevel boot method and system of digital signal processor | |
CN114281385B (en) | Upgrading method and upgrading device of electronic equipment | |
CN110502267A (en) | Update method, device, equipment and the storage medium of appliance applications | |
CN111078255A (en) | Software upgrading method and software upgrading system | |
CN111124455B (en) | Battery management system upgrading method, device, server and storage medium | |
CN110457058A (en) | Control node online upgrade method, device, host computer, system and electronic equipment | |
US7680909B2 (en) | Method for configuration of a processing unit | |
US9400758B2 (en) | Reset method and network device | |
CN112015452B (en) | Firmware upgrading method and device for gate system and gate system | |
CN114443582A (en) | File system mounting method, device, equipment and medium on operating system | |
CN218332578U (en) | Firmware management device for FPGA chip, FPGA accelerator card and electronic equipment | |
CN112199103A (en) | Device upgrade method and terminal device | |
CN105988804B (en) | Software transfer method and terminal |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |