CN105005492B - A kind of embedded device and a kind of method for upgrading software - Google Patents

A kind of embedded device and a kind of method for upgrading software Download PDF

Info

Publication number
CN105005492B
CN105005492B CN201510504303.1A CN201510504303A CN105005492B CN 105005492 B CN105005492 B CN 105005492B CN 201510504303 A CN201510504303 A CN 201510504303A CN 105005492 B CN105005492 B CN 105005492B
Authority
CN
China
Prior art keywords
subregion
inactive
version
software
activation
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
Application number
CN201510504303.1A
Other languages
Chinese (zh)
Other versions
CN105005492A (en
Inventor
李铭梁
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Jingzhou Mingzhi Industrial Automation Control Co.,Ltd.
Original Assignee
Shanghai Feixun Data Communication Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Feixun Data Communication Technology Co Ltd filed Critical Shanghai Feixun Data Communication Technology Co Ltd
Priority to CN201510504303.1A priority Critical patent/CN105005492B/en
Publication of CN105005492A publication Critical patent/CN105005492A/en
Application granted granted Critical
Publication of CN105005492B publication Critical patent/CN105005492B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The present invention provides a kind of embedded device and a kind of method for upgrading software, the activation subregion version identifier obtained according to the software version of the activation subregion of detection and the inactive subregion version identifier obtained according to the software version of the inactive subregion of detection, determine a state machine state in which;According to the state of the state machine of detection or the external control command of reception, the version updating or rollback operation of the software of the activation subregion or the inactive subregion are performed.Various states in the controllable escalation process of the present invention, make it become controllable from uncontrollable.Make escalation process become it is more flexible, can in the state of various needs free switching.And make escalation process more reliable, system can be made to be switched to stable controllable state from various mistakes or unstable state.

Description

A kind of embedded device and a kind of method for upgrading software
Technical field
The present invention relates to embedded development field, more particularly to a kind of embedded device and a kind of software upgrading side Method.
Background technology
In embedded device, system software is generally all stored in erasable middle storage, not high in availability requirement In equipment, system software is generally only a, when there is artificial maloperation, storage device damage, all can not generally Restore.In the higher equipment of availability requirement, for example telecommunication apparatus, usual system software have two parts, and can be backup, But the escalation policy of system, it is relatively simple and direct, can not all situations encountered of adaptive system, and cannot be to software Escalation process preferably controlled.
Invention content
In view of the foregoing deficiencies of prior art, the purpose of the present invention is to provide a kind of embedded device and one kind Method for upgrading software, deficiency state control simple for solving escalation process in the prior art, and can not be according to a variety of of user The problem of upgrade requirement preferably controls software upgrading.
In order to achieve the above objects and other related objects, the present invention provides a kind of embedded device, including:State machine is used With the activation subregion version identifier of the software version acquisition of the activation subregion according to detection and inactive point according to detection The inactive subregion version identifier that the software version in area obtains, determines its state in which;Webmaster module, to according to detection The state of the state machine or the external control command of reception, perform it is described activation subregion or the inactive subregion software Version updating or rollback operation.
Optionally, when the activation subregion version identifier is 0, the software version of the activation subregion is identified as just Normal version, when the activation subregion version indications are 1, the software version for identifying the activation subregion is new version;When When the inactive subregion version identifier is 0, the software version for identifying the inactive subregion is normal version, works as institute When to state inactive subregion version identifier be 1, the software version for identifying the inactive subregion is new version, when described non- When activation subregion version identifier is -1, the inactive subregion for identifying the inactive subregion does not have related software.
Optionally, the state machine includes at least one or more in following state:1) when the activation subregion version When identifier is 0 and the inactive subregion version identifier is 0, the state machine is in normal condition;2) when the activation Subregion version identifier be 0, and the inactive subregion version identifier be 1 when, the state machine be in need reset state;3) When the activation subregion version identifier is 1, and the inactive subregion version identifier is 0, the state machine, which is in, to be needed Synchronous regime;4) when the activation subregion version identifier is 1, and the inactive subregion version identifier is 1, the shape State machine is in state to be committed;5) when the activation subregion version identifier is 0, and the inactive subregion version identifier When being -1 or when the activation subregion version identifier is 1, and the inactive subregion version identifier is -1, the shape State machine is in abnormality.
Optionally, the webmaster module enables described inactive when detecting that the state machine is in the abnormality The software of the subregion in the activation subregion performs update operation.
Optionally, it when the state machine is in the normal condition, when receiving external upgrade command, enables described non-sharp Subregion living obtains newer software according to default channel, and reset state is needed so that the state machine to be enabled to be in described;The webmaster mould Block when detect the state machine be in it is described need reset state when, restart the embedded device, enable it is described activation subregion root Update operation is performed according to the software of the inactive subregion, synchronous regime is needed so that the state machine to be enabled to be in described;The webmaster Module when detect the state machine be in it is described need synchronous regime when, enable the inactive subregion according to the activation subregion Software performs update operation, is detected in the activation subregion so that the state machine is enabled to be in the state to be committed, and is worked as During running software exception, the activation subregion is enabled to perform rollback operation according to the software of the inactive subregion, and enable the shape State machine, which is in, needs reset state;The webmaster module confirms institute when detecting that the state machine is in the state to be committed The software upgrading for stating activation subregion and the inactive subregion is completed, and it is 0 and institute to enable the activation subregion version identifier It is 0 to state inactive subregion version identifier, and the state machine is in normal condition.
In order to achieve the above objects and other related objects, it is embedding applied to one the present invention also provides a kind of method for upgrading software Enter in formula equipment, include the following steps:The activation subregion version identifier obtained according to the software version of the activation subregion of detection And the inactive subregion version identifier obtained according to the software version of the inactive subregion of detection, it determines residing for a state machine State;According to the state of the state machine of detection or the external control command of reception, the activation subregion or described is performed The version updating or rollback operation of the software of inactive subregion.
Optionally, when the activation subregion version identifier is 0, the software version of the activation subregion is identified as just Normal version, when the activation subregion version indications are 1, the software version for identifying the activation subregion is new version;When When the inactive subregion version identifier is 0, the software version for identifying the inactive subregion is normal version, works as institute When to state inactive subregion version identifier be 1, the software version for identifying the inactive subregion is new version, when described non- When activation subregion version identifier is -1, the inactive subregion for identifying the inactive subregion does not have related software.
Optionally, the state machine includes at least one or more in following state:1) when the activation subregion version When identifier is 0 and the inactive subregion version identifier is 0, the state machine is in normal condition;2) when the activation Subregion version identifier be 0, and the inactive subregion version identifier be 1 when, the state machine be in need reset state;3) When the activation subregion version identifier is 1, and the inactive subregion version identifier is 0, the state machine, which is in, to be needed Synchronous regime;4) when the activation subregion version identifier is 1, and the inactive subregion version identifier is 1, the shape State machine is in state to be committed;5) when the activation subregion version identifier is 0, and the inactive subregion version identifier When being -1 or when the activation subregion version identifier is 1, and the inactive subregion version identifier is -1, the shape State machine is in abnormality.
Optionally, when detecting that the state machine is in the abnormality, the inactive subregion is enabled according to The software in subregion is activated to perform update operation.
Optionally, it when the state machine is in the normal condition, when receiving external upgrade command, enables described non-sharp Subregion living obtains newer software according to default channel, and reset state is needed so that the state machine to be enabled to be in described;The webmaster mould Block when detect the state machine be in it is described need reset state when, restart the embedded device, enable it is described activation subregion root Update operation is performed according to the software of the inactive subregion, synchronous regime is needed so that the state machine to be enabled to be in described;The webmaster Module when detect the state machine be in it is described need synchronous regime when, enable the inactive subregion according to the activation subregion Software performs update operation, is detected in the activation subregion so that the state machine is enabled to be in the state to be committed, and is worked as During running software exception, the activation subregion is enabled to perform rollback operation according to the software of the inactive subregion, and enable the shape State machine, which is in, needs reset state;The webmaster module confirms institute when detecting that the state machine is in the state to be committed The software upgrading for stating activation subregion and the inactive subregion is completed, and it is 0 and institute to enable the activation subregion version identifier It is 0 to state inactive subregion version identifier, and the state machine is in normal condition.
As described above, a kind of embedded device and a kind of method for upgrading software of the present invention, according to the activation of detection point It activation subregion version identifier that the software version in area obtains and is obtained according to the software version of the inactive subregion of detection Inactive subregion version identifier determines a state machine state in which;According to the state of the state machine of detection or reception External control command, perform it is described activation subregion or the inactive subregion software version updating or rollback operation.This Various states in the controllable escalation process of invention, make it become controllable from uncontrollable.More flexible, the Ke Yi for becoming escalation process Free switching in the state of various needs.And make escalation process more reliable, system can be made from various mistakes or unstable state It is switched to stable controllable state.
Description of the drawings
Fig. 1 is shown as a kind of module diagram of embedded device of the present invention in one embodiment.
Two parts of system softwares that Fig. 2 is shown as embedded device in the prior art deposit in signal in same storage device Figure.
Two parts of system softwares that Fig. 3 is shown as embedded device in the prior art deposit in showing in different storage devices It is intended to.
Fig. 4 is shown as the principle schematic of method for upgrading software of the invention in a specific embodiment.
Fig. 5 is shown as a kind of flow diagram of method for upgrading software of the present invention in one embodiment.
Component label instructions
1 embedded device
11 state machines
12 Network Management Equipments
S11, S12 step
Specific embodiment
Illustrate embodiments of the present invention below by way of specific specific example, those skilled in the art can be by this specification Disclosed content understands other advantages and effect of the present invention easily.The present invention can also pass through in addition different specific realities The mode of applying is embodied or practiced, the various details in this specification can also be based on different viewpoints with application, without departing from Various modifications or alterations are carried out under the spirit of the present invention.It should be noted that in the absence of conflict, following embodiment and implementation Feature in example can be combined with each other.
It should be noted that the diagram provided in following embodiment only illustrates the basic structure of the present invention in a schematic way Think, component count, shape and size when only display is with related component in the present invention rather than according to actual implementation in illustrating then It draws, kenel, quantity and the ratio of each component can be a kind of random change during actual implementation, and its assembly layout kenel It is likely more complexity.
Referring to Fig. 1, it is shown as a kind of module diagram of embedded device of the present invention in one embodiment.Institute It states embedded device 1 and includes state machine 11 and webmaster module 12.Common embedded device is all soft by preserving two parts of systems Part realizes that they are stored in the physical storage device that on two different storage equipment partitions or two panels is different respectively.Its As shown in Figures 2 and 3, such as Fig. 2 is shown as two parts of system softwares of embedded device in the prior art for system architecture and principle The schematic diagram in same storage device is deposited in, wherein the system software 1 is stored in the currently active subregion, the system software 2 are stored in inactive subregion, the i.e. usually described backup subregion.And as shown in figure 3, it is shown as embedded device in the prior art Two parts of system softwares deposit in schematic diagram in different storage devices, wherein the system software 1 is stored in storage device 1 (the currently active subregion), the system software 2 are stored in storage device 2 (inactive subregion), i.e., usually said backup subregion.
The activation subregion version identifier that the state machine 11 obtains to the software version of the activation subregion according to detection And the inactive subregion version identifier obtained according to the software version of the inactive subregion of detection, determine the shape residing for it State.
For example, activation subregion version identifier and the inactive subregion version identifier include 0 and 1 two states, When the activation subregion version identifier is 0, the software version that identifies the activation subregion is normal version, the activation When subregion version indications are 1, the software version for identifying the activation subregion is new version;When the inactive subregion version When this identifier is 0, the software version for identifying the inactive subregion is normal version, when the inactive subregion version When identifier is 1, the software version for identifying the inactive subregion is new version, when the inactive subregion version identifier It accords with when being -1, the inactive subregion for identifying the inactive subregion does not have related software.
And the state of the state machine 11 is including at least one or more in following state:
1) when the activation subregion version identifier is 0 and the inactive subregion version identifier is 0, the state Machine 11 is in normal condition;
2) when the activation subregion version identifier is 0, and the inactive subregion version identifier is 1, the shape State machine 11, which is in, needs reset state;
3) when the activation subregion version identifier is 1, and the inactive subregion version identifier is 0, the shape State machine 11, which is in, needs synchronous regime;
4) when the activation subregion version identifier is 1, and the inactive subregion version identifier is 1, the shape State machine 11 is in state to be committed;
5) when the activation subregion version identifier is 0, and the inactive subregion version identifier is -1 or work as institute It is 1 to state activation subregion version identifier, and when the inactive subregion version identifier is -1, and the state machine 11 is in abnormal State.
The webmaster module 12 is held to the state of the state machine 11 according to detection or the external control command of reception The version updating or rollback operation of the software of the row activation subregion or the inactive subregion.The external control command includes The embedded device 1 is enabled to carry out the order of software upgrading, and when the state machine 11 is in the normal condition, is received During external upgrade command, the inactive subregion is enabled to obtain newer software according to default channel, to enable at the state machine 11 Reset state is needed in described, wherein, the default channel is, for example, ftp channels;The webmaster module 12, which is worked as, detects the shape State machine 11 is in described and restarts the embedded device 1 when needing reset state, enables the activation subregion according to described inactive point The software in area performs update operation, and synchronous regime is needed so that the state machine 11 to be enabled to be in described;The webmaster module 12 is when detection To the state machine 11 be in it is described need synchronous regime when, enable the inactive subregion according to it is described activation subregion software perform Update operation, the state machine 11 to be enabled to be in the state to be committed, and is worked as the software fortune detected in the activation subregion When row is abnormal, the activation subregion is enabled to perform rollback operation according to the software of the inactive subregion, and enable the state machine 11 In needing reset state;The webmaster module 12 confirms institute when detecting that the state machine 11 is in the state to be committed The software upgrading for stating activation subregion and the inactive subregion is completed, and it is 0 and institute to enable the activation subregion version identifier It is 0 to state inactive subregion version identifier, and the state machine 11 is in normal condition.And work as when the webmaster module 12 and detect When the state machine 11 is in the abnormality, the software of the inactive subregion in the activation subregion is enabled to hold Row update operation.
The application principle of the present invention is further illustrated in conjunction with Fig. 4, cur is enabled to represent activation subregion version identifier Symbol, backup represent inactive subregion version identifier, and the state of the state machine is respectively normal condition (Normal), need Reset state (need reset), needs synchronous regime (need sync), state (need commit) to be committed and when described It is 0 to activate subregion version identifier, and the abnormality (Lost backup) when the inactive subregion version identifier is -1 And the abnormality when the activation subregion version identifier is 1, and the inactive subregion version identifier is -1 (Lost backward), under Normal states, cur=backup=0;Under need reset states, cur=0, backup= 1;Under need sync states, cur=1, backup=0;Under need commit states, cur=backup=1;Lost Under backup states, cur=0, backup=-1, under Lost backward states, cur=1, backup=-1.
And webmaster module represents, and for Update such as Fig. 4 institutes according to the operation that software upgrading command commands software is updated Show, before Update, cur=backup=0, and after Update:Cur=0, backup=1;The webmaster module is when inspection It measures the state machine and is in described and according to reset orders, restart the embedded device when needing reset state, enable and described swashing Subregion living performs update operation according to the software of the inactive subregion, and synchronous regime is needed so that the state machine to be enabled to be in described, That is cur=1, backup=0.The simultaneously operating of the software represents with Sync, even the software synchronization in activation subregion is to non- It activates in subregion, before the Sync orders perform:Cru=0, backup=1, after order performs:Cur=0, backup=0;Or Person, before Sync orders perform:Cru=1, backup=0;After order performs:Cur=1, backup=1.Alternatively, Sync orders Before execution:Cru=0, backup=-1, after order performs:Cur=0, backup=0.Alternatively, before Sync orders perform:cru =1, backup=-1, after order performs:Cur=1, backup=1.And work as cru=1, during backup=1, i.e., in waiting to carry Friendship state, at this time when receiving price raising order commit, the state of the state machine is Normal, i.e. cru=0, backup =0.And in the case where needing synchronous regime, if it find that new software version is defective or is unsatisfactory for demand, then webmaster module can To send Backward orders, activation stores the backup subregion of old software version, i.e., former inactive subregion, and restarting equipment.From And equipment is made to return to need reset states, equipment operation at this time is old software version.Again by sync orders, can make Device replied is to original state.
Referring to Fig. 5, it is shown as a kind of flow diagram of method for upgrading software of the present invention in one embodiment. Common embedded device is realized by preserving two parts of system softwares, they are stored in two different storages and set respectively In back-up area or physical storage device that two panels is different.As shown in Figures 2 and 3, such as Fig. 2 is shown for its system architecture and principle Two parts of system softwares for being shown as embedded device in the prior art deposit in schematic diagram in same storage device, wherein the system System software 1 is stored in the currently active subregion, and the system software 2 is stored in inactive subregion, the i.e. usually described backup subregion. And as shown in figure 3, two parts of system softwares for being shown as embedded device in the prior art are deposited in different storage devices Schematic diagram, wherein the system software 1 is stored in storage device 1 (the currently active subregion), the system software 2 is stored in storage Equipment 2 (inactive subregion), i.e., usually said backup subregion.
The method for upgrading software applied in an embedded device, includes the following steps:
S11:According to the activation subregion version identifier of the software version acquisition of the activation subregion of detection and according to detection Inactive subregion software version obtain inactive subregion version identifier, determine a state machine state in which.
For example, activation subregion version identifier and the inactive subregion version identifier include 0 and 1 two states, When the activation subregion version identifier is 0, the software version that identifies the activation subregion is normal version, the activation When subregion version indications are 1, the software version for identifying the activation subregion is new version;When the inactive subregion version When this identifier is 0, the software version for identifying the inactive subregion is normal version, when the inactive subregion version When identifier is 1, the software version for identifying the inactive subregion is new version, when the inactive subregion version identifier It accords with when being -1, the inactive subregion for identifying the inactive subregion does not have related software.
And the state of the state machine is including at least one or more in following state:
1) when the activation subregion version identifier is 0 and the inactive subregion version identifier is 0, the state Machine is in normal condition;
2) when the activation subregion version identifier is 0, and the inactive subregion version identifier is 1, the shape State machine, which is in, needs reset state;
3) when the activation subregion version identifier is 1, and the inactive subregion version identifier is 0, the shape State machine, which is in, needs synchronous regime;
4) when the activation subregion version identifier is 1, and the inactive subregion version identifier is 1, the shape State machine is in state to be committed;
5) when the activation subregion version identifier is 0, and the inactive subregion version identifier is -1 or work as institute It is 1 to state activation subregion version identifier, and when the inactive subregion version identifier is -1, and the state machine is in abnormal shape State.
S12:According to the state of the state machine of detection or the external control command of reception, perform the activation subregion or The version updating or rollback operation of the software of the inactive subregion.The external control command includes enabling the embedded device The order of software upgrading is carried out, and when the state machine is in the normal condition, when receiving external upgrade command, enables institute It states inactive subregion and newer software is obtained according to default channel, reset state is needed so that the state machine to be enabled to be in described, wherein, The default channel is, for example, ftp channels;When detect the state machine be in it is described need reset state when, restart the insertion Formula equipment enables the activation subregion perform update operation according to the software of the inactive subregion, the state machine to be enabled to be in It is described to need synchronous regime;When detect the state machine be in it is described need synchronous regime when, enable the inactive subregion according to institute The software for stating activation subregion performs update operation, the state machine to be enabled to be in the state to be committed, and it is described when detecting When activating the running software exception in subregion, the activation subregion is enabled to perform the behaviour that retracts according to the software of the inactive subregion Make, and the state machine is enabled to be in need reset state;It is described when detecting that the state machine is in the state to be committed, really The software upgrading for recognizing the activation subregion and the inactive subregion is completed, and it is 0 to enable the activation subregion version identifier And the inactive subregion version identifier is 0, the state machine is in normal condition.And work as described in and detect the state When machine is in the abnormality, the software of the inactive subregion in the activation subregion is enabled to perform update behaviour Make.
The application principle of the present invention is further illustrated in conjunction with Fig. 4, cur is enabled to represent activation subregion version identifier Symbol, backup represent inactive subregion version identifier, and the state of the state machine is respectively normal condition (Normal), need Reset state (need reset), needs synchronous regime (need sync), state (need commit) to be committed and when described It is 0 to activate subregion version identifier, and the abnormality (Lost backup) when the inactive subregion version identifier is -1 And the abnormality when the activation subregion version identifier is 1, and the inactive subregion version identifier is -1 (Lost backward), under Normal states, cur=backup=0;Under need reset states, cur=0, backup= 1;Under need sync states, cur=1, backup=0;Under need commit states, cur=backup=1;Lost Under backup states, cur=0, backup=-1, under Lost backward states, cur=1, backup=-1.
And webmaster module represents, and for Update such as Fig. 4 institutes according to the operation that software upgrading command commands software is updated Show, before Update, cur=backup=0, and after Update:Cur=0, backup=1;The webmaster module is when inspection It measures the state machine and is in described and according to reset orders, restart the embedded device when needing reset state, enable and described swashing Subregion living performs update operation according to the software of the inactive subregion, and synchronous regime is needed so that the state machine to be enabled to be in described, That is cur=1, backup=0.The simultaneously operating of the software represents with Sync, even the software synchronization in activation subregion is to non- It activates in subregion, before the Sync orders perform:Cru=0, backup=1, after order performs:Cur=0, backup=0;Or Person, before Sync orders perform:Cru=1, backup=0;After order performs:Cur=1, backup=1.Alternatively, Sync orders Before execution:Cru=0, backup=-1, after order performs:Cur=0, backup=0.Alternatively, before Sync orders perform:cru =1, backup=-1, after order performs:Cur=1, backup=1.And work as cru=1, during backup=1, i.e., in waiting to carry Friendship state, at this time when receiving price raising order commit, the state of the state machine is Normal, i.e. cru=0, backup =0.And in the case where needing synchronous regime, if it find that new software version is defective or is unsatisfactory for demand, then webmaster module can To send Backward orders, activation stores the backup subregion of old software version, i.e., former inactive subregion, and restarting equipment.From And equipment is made to return to need reset states, equipment operation at this time is old software version.Again by sync orders, can make Device replied is to original state.
In conclusion a kind of embedded device and a kind of method for upgrading software of the present invention, according to the activation of detection point It activation subregion version identifier that the software version in area obtains and is obtained according to the software version of the inactive subregion of detection Inactive subregion version identifier determines a state machine state in which;According to the state of the state machine of detection or reception External control command, perform it is described activation subregion or the inactive subregion software version updating or rollback operation.This Various states in the controllable escalation process of invention, make it become controllable from uncontrollable.More flexible, the Ke Yi for becoming escalation process Free switching in the state of various needs.And make escalation process more reliable, system can be made from various mistakes or unstable state It is switched to stable controllable state.So the present invention effectively overcomes various shortcoming of the prior art and has high industrial Utility value.
The above-described embodiments merely illustrate the principles and effects of the present invention, and is not intended to limit the present invention.It is any ripe The personage for knowing this technology all can carry out modifications and changes under the spirit and scope without prejudice to the present invention to above-described embodiment.Cause This, those of ordinary skill in the art is complete without departing from disclosed spirit and institute under technological thought such as Into all equivalent modifications or change, should by the present invention claim be covered.

Claims (4)

1. a kind of embedded device, which is characterized in that including:
State machine, to the activation subregion version identifier of the software version acquisition of the activation subregion according to detection and according to inspection The inactive subregion version identifier that the software version for the inactive subregion surveyed obtains, determines its state in which;
Webmaster module to the state of the state machine according to detection or the external control command of reception, performs the activation The version updating or rollback operation of the software of subregion or the inactive subregion;
When the activation subregion version identifier is 0, the software version for identifying the activation subregion is normal version, described When activation subregion version indications are 1, the software version for identifying the activation subregion is new version;When described inactive point When area's version identifier is 0, the software version for identifying the inactive subregion is normal version, when the inactive subregion When version identifier is 1, the software version for identifying the inactive subregion is new version, when the inactive subregion version When identifier is -1, the inactive subregion for identifying the inactive subregion does not have related software;
The state machine includes at least one or more in following state:
1) when the activation subregion version identifier is 0 and the inactive subregion version identifier is 0, at the state machine In normal condition;
2) when the activation subregion version identifier is 0, and the inactive subregion version identifier is 1, the state machine In needing reset state;
3) when the activation subregion version identifier is 1, and the inactive subregion version identifier is 0, the state machine In needing synchronous regime;
4) when the activation subregion version identifier is 1, and the inactive subregion version identifier is 1, the state machine In state to be committed;
5) swash when the activation subregion version identifier is 0, and the inactive subregion version identifier is -1 or when described Subregion version identifier living is 1, and when the inactive subregion version identifier is -1, and the state machine is in abnormality;
The webmaster module enables the inactive subregion according to when detecting that the state machine is in the abnormality The software in subregion is activated to perform update operation;
The webmaster module when detect the state machine be in it is described need synchronous regime when, enable the inactive subregion according to institute The software for stating activation subregion performs update operation, the state machine to be enabled to be in the state to be committed, and it is described when detecting When activating the running software exception in subregion, the activation subregion is enabled to perform the behaviour that retracts according to the software of the inactive subregion Make, and the state machine is enabled to be in need reset state;
And in the case where needing synchronous regime, if it find that new software version is defective or is unsatisfactory for demand, then webmaster module is sent out It loses one's life order, the former inactive subregion of activation makes equipment run old software version, returns to original state.
2. embedded device according to claim 1, it is characterised in that:When the state machine is in the normal condition When, when receiving external upgrade command, the inactive subregion is enabled to obtain newer software according to default channel, to enable the shape State machine, which is in described, needs reset state;The webmaster module when detect the state machine be in it is described need reset state when, weight The embedded device is opened, the activation subregion is enabled to perform update operation according to the software of the inactive subregion, with described in order State machine, which is in described, needs synchronous regime;The webmaster module when detecting that the state machine is in the state to be committed, Confirm it is described activation subregion and the inactive subregion software upgrading complete, and enable it is described activation subregion version identifier be 0 and the inactive subregion version identifier be 0, the state machine is in normal condition.
3. a kind of method for upgrading software, which is characterized in that applied in an embedded device, include the following steps:
Subregion version identifier is activated according to what the software version of the activation subregion of detection obtained and according to the inactive of detection The inactive subregion version identifier that the software version of subregion obtains, determines a state machine state in which;
According to the state of the state machine of detection or the external control command of reception, the activation subregion or described non-sharp is performed The version updating or rollback operation of the software of subregion living;
When the activation subregion version identifier is 0, the software version for identifying the activation subregion is normal version, described When activation subregion version indications are 1, the software version for identifying the activation subregion is new version;When described inactive point When area's version identifier is 0, the software version for identifying the inactive subregion is normal version, when the inactive subregion When version identifier is 1, the software version for identifying the inactive subregion is new version, when the inactive subregion version When identifier is -1, the inactive subregion for identifying the inactive subregion does not have related software;
The state machine includes at least one or more in following state:
1) when the activation subregion version identifier is 0 and the inactive subregion version identifier is 0, at the state machine In normal condition;
2) when the activation subregion version identifier is 0, and the inactive subregion version identifier is 1, the state machine In needing reset state;
3) when the activation subregion version identifier is 1, and the inactive subregion version identifier is 0, the state machine In needing synchronous regime;
4) when the activation subregion version identifier is 1, and the inactive subregion version identifier is 1, the state machine In state to be committed;
5) swash when the activation subregion version identifier is 0, and the inactive subregion version identifier is -1 or when described Subregion version identifier living is 1, and when the inactive subregion version identifier is -1, and the state machine is in abnormality;
When detecting that the state machine is in the abnormality, the inactive subregion is enabled according in the activation subregion The software performs update operation;
When detect the state machine be in it is described need synchronous regime when, enable the inactive subregion according to the activation subregion Software performs update operation, is detected in the activation subregion so that the state machine is enabled to be in the state to be committed, and is worked as During running software exception, the activation subregion is enabled to perform rollback operation according to the software of the inactive subregion, and enable the shape State machine, which is in, needs reset state;
And in the case where needing synchronous regime, if it find that new software version is defective or is unsatisfactory for demand, then webmaster module is sent out It loses one's life order, the former inactive subregion of activation makes equipment run old software version, returns to original state.
4. method for upgrading software according to claim 3, it is characterised in that:When the state machine is in the normal condition When, when receiving external upgrade command, the inactive subregion is enabled to obtain newer software according to default channel, to enable the shape State machine, which is in described, needs reset state;The webmaster module when detect the state machine be in it is described need reset state when, weight The embedded device is opened, the activation subregion is enabled to perform update operation according to the software of the inactive subregion, with described in order State machine, which is in described, needs synchronous regime;The webmaster module when detecting that the state machine is in the state to be committed, Confirm it is described activation subregion and the inactive subregion software upgrading complete, and enable it is described activation subregion version identifier be 0 and the inactive subregion version identifier be 0, the state machine is in normal condition.
CN201510504303.1A 2015-08-17 2015-08-17 A kind of embedded device and a kind of method for upgrading software Active CN105005492B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510504303.1A CN105005492B (en) 2015-08-17 2015-08-17 A kind of embedded device and a kind of method for upgrading software

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510504303.1A CN105005492B (en) 2015-08-17 2015-08-17 A kind of embedded device and a kind of method for upgrading software

Publications (2)

Publication Number Publication Date
CN105005492A CN105005492A (en) 2015-10-28
CN105005492B true CN105005492B (en) 2018-06-19

Family

ID=54378172

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510504303.1A Active CN105005492B (en) 2015-08-17 2015-08-17 A kind of embedded device and a kind of method for upgrading software

Country Status (1)

Country Link
CN (1) CN105005492B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112256311B (en) * 2020-09-27 2023-06-06 北京控制工程研究所 Mars master-slave software automatic updating method based on finite state machine
CN113238772B (en) * 2021-04-29 2024-02-23 联合汽车电子有限公司 Program updating method, domain controller, and storage medium
CN113296819B (en) * 2021-06-10 2023-12-08 南京创通微新通信有限公司 Centralized management upgrading system and method for network bridge equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102520979A (en) * 2011-11-22 2012-06-27 大唐移动通信设备有限公司 Boot program backup method and Boot program backup device
CN103425510A (en) * 2013-08-08 2013-12-04 天脉聚源(北京)传媒科技有限公司 Method and device for interactive upgrade
CN104375863A (en) * 2014-11-17 2015-02-25 张毓 Program online upgrading method in embedded system
CN104391729A (en) * 2014-12-19 2015-03-04 北京奇虎科技有限公司 Root privilege based procedure upgrading method and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102520979A (en) * 2011-11-22 2012-06-27 大唐移动通信设备有限公司 Boot program backup method and Boot program backup device
CN103425510A (en) * 2013-08-08 2013-12-04 天脉聚源(北京)传媒科技有限公司 Method and device for interactive upgrade
CN104375863A (en) * 2014-11-17 2015-02-25 张毓 Program online upgrading method in embedded system
CN104391729A (en) * 2014-12-19 2015-03-04 北京奇虎科技有限公司 Root privilege based procedure upgrading method and device

Also Published As

Publication number Publication date
CN105005492A (en) 2015-10-28

Similar Documents

Publication Publication Date Title
US9110843B2 (en) Rack and method thereof for simultaneously updating basic input output systems
CN105005492B (en) A kind of embedded device and a kind of method for upgrading software
CN104571041B (en) Based on 1:The method of data synchronization of 1 controller redundancy
KR102639949B1 (en) Method and subsystem for installing a software update in a vehicle
CN104156279B (en) A kind of backup method of router configuration data
CN104951308B (en) The management optimization mode and device of Docker Registry
CN103514038B (en) A kind of smooth method for closing and system of virtual system
CN103324495A (en) Method and system for data center server boot management
CN105550004B (en) A kind of update device and method of multisystem
CN108123851A (en) The lifetime detection method and device of main and subordinate node synchronization link in distributed system
CN107480014A (en) A kind of High Availabitity equipment switching method and device
CN103713925A (en) Method and device for avoiding service interruption of storage array in upgrading process
CN108881372A (en) The transparent upgrading of system service or application
WO2016033941A1 (en) Boot on-line upgrading apparatus and method
CN105550056A (en) System reconfiguration based fault self-recovery system and realization method therefor
CN110515773A (en) Update method and device, the system of configuration file
CN110502173A (en) A kind of interface content processing method, device and computer readable storage medium
CN106094738B (en) For running the method and automation equipment of automation equipment
CN105849699B (en) Method for controlling data center architecture equipment
CN102073523B (en) Realize the method and device of software version synchronization
CN110083504A (en) The running state monitoring method and device of distributed task scheduling
CN104780068B (en) A kind of method for switching network, the apparatus and system of computer room migration
CN107147698B (en) Remote control system, method and device of intelligent switch
CN109165181A (en) A kind of more boards are from configuration and task from compartment system and method
CN101557307B (en) Dispatch automation system application state management method

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20201202

Address after: Room 10242, No. 260, Jiangshu Road, Xixing street, Binjiang District, Hangzhou City, Zhejiang Province

Patentee after: Hangzhou Jiji Intellectual Property Operation Co.,Ltd.

Address before: 201616 Shanghai city Songjiang District Sixian Road No. 3666

Patentee before: Phicomm (Shanghai) Co.,Ltd.

TR01 Transfer of patent right
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20201221

Address after: 8319 Yanshan Road, Bengbu City, Anhui Province

Patentee after: Bengbu Lichao Information Technology Co.,Ltd.

Address before: Room 10242, No. 260, Jiangshu Road, Xixing street, Binjiang District, Hangzhou City, Zhejiang Province

Patentee before: Hangzhou Jiji Intellectual Property Operation Co.,Ltd.

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20210311

Address after: 313000 room 1019, Xintiandi commercial office, Yishan street, Wuxing District, Huzhou, Zhejiang, China

Patentee after: Huzhou YingLie Intellectual Property Operation Co.,Ltd.

Address before: 8319 Yanshan Road, Bengbu City, Anhui Province

Patentee before: Bengbu Lichao Information Technology Co.,Ltd.

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20221122

Address after: No. 238, West Ring Road, Jingzhou District, Jingzhou City, Hubei Province, 434022 (No. 3, 2nd floor, Hubei Jiaye Petroleum Machinery Co., Ltd.)

Patentee after: Jingzhou Mingzhi Industrial Automation Control Co.,Ltd.

Address before: 313000 room 1019, Xintiandi commercial office, Yishan street, Wuxing District, Huzhou, Zhejiang, China

Patentee before: Huzhou YingLie Intellectual Property Operation Co.,Ltd.