CN109885331A - Method for upgrading software, control method, system, storage medium and electronic equipment - Google Patents
Method for upgrading software, control method, system, storage medium and electronic equipment Download PDFInfo
- Publication number
- CN109885331A CN109885331A CN201910154947.0A CN201910154947A CN109885331A CN 109885331 A CN109885331 A CN 109885331A CN 201910154947 A CN201910154947 A CN 201910154947A CN 109885331 A CN109885331 A CN 109885331A
- Authority
- CN
- China
- Prior art keywords
- equipment
- mode
- upgrading
- instruction
- parking space
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 76
- 238000003860 storage Methods 0.000 title claims abstract description 13
- 230000004044 response Effects 0.000 claims abstract description 25
- 238000004590 computer program Methods 0.000 claims description 15
- 230000006870 function Effects 0.000 description 25
- 238000010586 diagram Methods 0.000 description 15
- 230000005540 biological transmission Effects 0.000 description 4
- 238000001514 detection method Methods 0.000 description 4
- 230000008569 process Effects 0.000 description 4
- 238000012795 verification Methods 0.000 description 3
- 241001465382 Physalis alkekengi Species 0.000 description 2
- 238000012937 correction Methods 0.000 description 2
- 238000013461 design Methods 0.000 description 2
- 238000009826 distribution Methods 0.000 description 2
- 238000012360 testing method Methods 0.000 description 2
- 238000012356 Product development Methods 0.000 description 1
- 230000001174 ascending effect Effects 0.000 description 1
- 238000010923 batch production Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 230000002708 enhancing effect Effects 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000002360 preparation method Methods 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
- 230000000630 rising effect Effects 0.000 description 1
- 230000011218 segmentation Effects 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 230000001360 synchronised effect Effects 0.000 description 1
Landscapes
- Stored Programmes (AREA)
Abstract
This application involves a kind of method for upgrading software, control method, system, storage medium and electronic equipments, it include: when receiving pattern switching instruction, mode will be currently up based on pattern switching instruction and is switched to upgrade mode, and the sender instructed to pattern switching returns to pattern switching response;When receiving program erasing instruction, the content in application program parking space is wiped;Upgrading data are obtained, application program parking space is written into upgrading data;When receiving reset instruction, the mode of being currently up is switched to application model.The above method can be to multiple equipment sending mode switching command by a control equipment, that is, can control software upgrading of the equipment realization to multiple equipment with one, therefore at low cost.
Description
Technical field
This application involves field of computer technology, more particularly to a kind of method for upgrading software, software updating control method,
Software update system, storage medium and electronic equipment.
Background technique
Due to will appear some differences in product development and production, tend to cause product occur in batch production with
Parameter has differences in design, needs to modify in software design or actual application, finds product design existing defects,
These require the upgrading for carrying out software, to correct the loophole of these early periods.
Existing upgrading mode usually carries out software upgrading to the equipment that needs upgrade one by one by upgrading tool, but
It is equipment lower for attachment value, such as sign light, is upgraded one by one using tool, at high cost, cost is big.
Summary of the invention
Based on this, it is necessary in view of the above technical problems, provide a kind of method for upgrading software, control method, system, storage
Medium and electronic equipment.
A kind of method for upgrading software, which comprises
When receiving pattern switching instruction, mode will be currently up based on pattern switching instruction and be switched to upgrading mould
Formula, and the sender instructed to the pattern switching returns to pattern switching response;
When receiving program erasing instruction, the content in application program parking space is wiped;
Upgrading data are obtained, the application program parking space is written into the upgrading data;
When receiving reset instruction, the mode of being currently up is switched to application model.
It, will be current based on pattern switching instruction in one of the embodiments, when receiving pattern switching instruction
Starting mode is switched to upgrade mode, comprising:
Comprising upgrading password in detecting pattern switching instruction, and when the upgrading password is correct, be based on described in
Pattern switching instruction will be currently up mode and be switched to upgrade mode.
In one of the embodiments, when receiving program erasing instruction, wipe interior in application program parking space
Before appearance, further includes:
When receiving upgrade command within a preset time, closes and interrupt master switch, enable the application program parking space
Programming function.
In one of the embodiments, when receiving program erasing instruction, if not receiving liter within a preset period of time
Grade instruction, and detect in the application program parking space and upgrade successfully mark, the mode of being currently up is switched to application
Mode.
The upgrading data are written after the application program parking space in one of the embodiments, further includes:
Proofread the upgrading data in the application program parking space.
A kind of software updating control method of equipment, which comprises
To equipment sending mode switching command, the pattern switching instruction switches to upgrading mould for controlling the equipment
Formula;
When receiving the pattern switching response that the equipment returns, Xiang Suoshu equipment transmission program erasing instruction, and to
The equipment sends upgrading data;Described program erasing instruction is for controlling in the application program parking space for wiping the equipment
Content;
After detecting the upgrading data programming, Xiang Suoshu equipment sends reset instruction.
In one of the embodiments, before sending program erasing instruction to the equipment, further includes:
Upgrade command is sent to the equipment;The upgrade command closes interruption master switch for controlling the equipment, makes
The programming function of the energy application program parking space.
When in one of the embodiments, to equipment sending mode switching command, further includes:
Upgrading password is sent to the equipment;The upgrading password is detecting the upgrading password just for the equipment
Upgrade mode is switched to when really.
A kind of electronic equipment, comprising: the electronic equipment includes application program parking space and upgrade procedure parking space;
Start-up mode is switched to upgrade mode when receiving pattern switching instruction by the electronic equipment, is run
The program stored in the upgrade procedure parking space;And the sender instructed to the pattern switching returns to pattern switching and rings
It answers;Described program erasing instruction is being received, the content of the application program parking space, and the ascending series that will be received are wiped
According to the write-in application program parking space;When receiving the reset instruction, start-up mode is switched to application model, is transported
The program stored in the row application program parking space.
A kind of software update system, comprising: controller and above-mentioned electronic equipment;
The controller is receiving what the electronic equipment returned to the electronic equipment sending mode switching command
When pattern switching responds, Xiang Suoshu electronic equipment sends program erasing instruction;It is sent to the electronic equipment and upgrades data, and
When detecting that the upgrading data programming finishes, Xiang Suoshu electronic equipment sends reset instruction.
A kind of computer readable storage medium, is stored thereon with computer program, and the computer program is held by processor
The step of above method is realized when row.
Above-mentioned method for upgrading software, control method, system, storage medium and electronic equipment, equipment are cut in the mode of receiving
When changing instruction, upgrade mode operation will be switched to, and wipes application program in the program erasing instruction for receiving controller and deposits
Content between emptying, and in the application program parking space after the upgrading data write-in erasing that will acquire;It is multiple receiving
When bit instruction, then by pattern switching be application model.The above method can send mould to multiple equipment by a control equipment
Formula switching command, that is, software upgrading of the equipment realization to multiple equipment can be controlled with one, it is at low cost.
Detailed description of the invention
Fig. 1 is the structural schematic diagram of software update system in one embodiment;
Fig. 2 is the flow diagram of method for upgrading software in one embodiment;
Fig. 3 is the flow diagram of software updating control method in one embodiment;
Fig. 4 is the flow diagram of method for upgrading software in another embodiment;
Fig. 5 is the flow diagram of method for upgrading software in another embodiment;
Fig. 6 is the flow diagram of method for upgrading software in another embodiment;
Fig. 7 is the flow diagram of software updating control method in another embodiment;
Fig. 8 is the memory space distribution schematic diagram of electronic equipment in one embodiment;
Fig. 9 is the structural schematic diagram of software update system in a specific embodiment.
Specific embodiment
It is with reference to the accompanying drawings and embodiments, right in order to which the objects, technical solutions and advantages of the application are more clearly understood
The application is further elaborated.It should be appreciated that specific embodiment described herein is only used to explain the application, not
For limiting the application.
The application provides a kind of software update system, as shown is the structural schematic diagram of software update system, including control
Device 110 processed and the multiple electronic equipments 120 being connect with controller 110.Wherein, controller 110 and electronic equipment 120 communicate, control
To electronic equipment sending mode switching command, controlling electronic devices 120 enters upgrade mode and runs device 110 processed, is then receiving
Program erasing instruction is sent to electronic equipment 120 to when pattern switching response, it is empty that controlling electronic devices wipes application program storage
Between in content;Upgrading data are sent to electronic equipment 120 again, controlling electronic devices 120 will upgrade data write-in and be wiped free of
Application program parking space afterwards, to complete the software upgrading to electronic equipment.Wherein, controller 110 can be, but not limited to
It is various personal computers, laptop, smart phone, tablet computer and portable wearable device.The present processes
It can be used for the software upgrading of equipment, such as specifically can be the sign light of fire-fighting.
In one embodiment, as shown in Fig. 2, providing a kind of method for upgrading software, it is applied in Fig. 1 in this way
It is illustrated for electronic equipment 120, includes the following steps S210 to step S240.
Step S210 will be currently up mode based on pattern switching instruction and be switched to when receiving pattern switching instruction
Upgrade mode, and the sender instructed to pattern switching returns to pattern switching response.
Wherein, pattern switching instruction is the instruction for carrying out the controller of software upgrading by control equipment and issuing, and is used to indicate
Equipment switches current start-up mode.In embodiments herein, the start-up mode of equipment includes: application model and upgrading mould
Formula.Equipment is in application model under the operating status without upgrading, that is, being currently up mode is application model;Into
It is in upgrade mode under the operating status of row software upgrading, that is, being currently up mode is upgrade mode;Equipment is needing to rise
When grade, controller controls equipment from application model and is switched to upgrade mode to equipment sending mode switching command, at this time equipment into
The step of entering software upgrading.In one embodiment, the memory space of equipment is divided into upgrade procedure parking space and application program
Parking space, when to be currently up mode be application model, what is run after equipment starting is application in application program parking space
Program;When to be currently up mode be upgrade mode, what is run after equipment starting is upgrade procedure in upgrade procedure parking space.
In the present embodiment, equipment is instructed according to pattern switching by current starting when receiving pattern switching instruction
Mode is switched to upgrade mode, and after the completion of switching, returns to pattern switching response to the sender of sending mode switching command.
It wherein, in the present embodiment, is the controller of Fig. 1 to the sender of sending mode switching command.
Wherein, pattern switching response is equipment after it will be currently up pattern switching and be upgrade mode, is referred to pattern switching
The response that the sender of order returns, the sender for all announcement mode switching command are currently up mode and have switched completion.
It further, in one embodiment, will be current based on pattern switching instruction when receiving pattern switching instruction
Starting mode is switched to upgrade mode, comprising: comprising upgrading password in detecting pattern switching instruction, and it is correct to upgrade password
When, mode will be currently up based on pattern switching instruction and be switched to upgrade mode.
In the present embodiment, controller can also send upgrading password when to equipment sending mode switching command to equipment,
The pattern switching instruction received for equipment interconnection is verified.In a specific embodiment, controller upgrading password and mould
Formula switching command is sent to equipment together.Therefore equipment is detected whether when receiving pattern switching instruction comprising upgrading password,
And the correctness of upgrading password is detected, if detecting correctly upgrading password in the pattern switching instruction received, will just work as
Preceding start-up mode is switched to upgrade mode.It is to be appreciated that if upgrading password, Huo Zhejian is not detected in pattern switching instruction
When measuring upgrading password of the upgrading password in pattern switching instruction for mistake, switching of the equipment without being currently up mode.
Wherein, in one embodiment, the upgrading password that controller is sent to equipment is by UID (User
Identification, user identity prove) encrypted upgrading password, UID is the unique mark for the equipment that this needs upgrades
Know, in the present embodiment, the correctness of equipment detection upgrading password to include, when receiving pattern switching instruction, to control
Device processed sends request checking command, and request controller sends the upgrading password for verifying, then by verification for verifying
Whether the upgrading password in upgrading password and pattern switching instruction unanimously correctly upgrades password to determine whether;If consistent,
Then it is judged to correctly upgrading password, and then switching the mode that is currently up is upgrade mode, and is switched to controller sending mode
Response;If inconsistent, the upgrading password that carries in determinating mode switching command is incorrect upgrade command, at this time without
The switching of start-up mode.Wherein, encryption upgrading password and decryption password encrypting and decrypting method, can be it is existing any one
Method.
In above-mentioned method for upgrading software, controller is when to equipment sending mode switching command, it is also necessary to send upgrading
Password, upgrading password can be used for addressing the equipment for this time needing to upgrade;Equipment be can be also used for sending mode switching command
Sender's (i.e. controller) test, it is determined whether for correctly, the controller that has authorized, so as to improve equipment
The safety of software upgrading.
Step S220 wipes the content in application program parking space when receiving program erasing instruction.
In the present embodiment, application program parking space is a part of the memory space of equipment, for storage equipment
Application program.Program erasing instruction be pattern switching instruction sender after the pattern switching response for receiving equipment to equipment
The instruction of transmission, the content for being stored in device erasing application program parking space, the as application program of equipment.To equipment
Software upgrading is carried out, purpose is exactly the application program in more new equipment, therefore in step S220, equipment is according to the journey received
Sequence erasing instruction wipes the content in application program parking space, so that new application program is written.
Step S230 obtains upgrading data, and application program parking space is written in upgrading data.
In the present embodiment, upgrading data are the application program that equipment needs to update, and therefore, journey are applied in erasing in equipment
After sequence parking space, application program parking space is written in the upgrading data that will acquire.
In one embodiment, it obtains upgrading data packet to include: obtaining upgrading data from two lines bus driving.Upgrading data is
It is obtained at the sender of equipment slave pattern switching command.
In addition, in one embodiment, when upgrading data write-in is completed, application program parking space can be generated and be upgraded successfully
Mark is used to indicate Current software upgrading and completes.
It further, in one embodiment, will be after upgrading data write-in application program parking space, further includes: school
To the upgrading data in application program parking space.
In the present embodiment, after application program parking space is written in upgrade procedure by equipment, it is also necessary to the upgrading to write-in
Data are proofreaded.In one embodiment, equipment is segmentation write-in when that will upgrade data write-in application program parking space
, such as can be each fetching portion upgrading data of equipment, application program parking space is written into this part upgrading data, and
After part upgrading data are written, the upgrading data read in application program parking space are proofreaded;In the part
After the completion of upgrading data check and correction, then obtain the upgrading data of next part;In the present embodiment, it is all write in all upgrading data
When entering to complete, equipment will not get new upgrading data again, upgrade data write-in at this time and complete.In another embodiment
In, equipment can also carry out the write-in of upgrading data otherwise, such as all upgrading data can be all written
After application program parking space, then the content progress read in application program parking space is more right.
In above-mentioned method for upgrading software, it is more right that the upgrading data for application program parking space is newly written carry out, can be with
Ensure to be written the correctness of the upgrading data of application program parking space.
The mode of being currently up is switched to application model when receiving reset instruction by step S240.
Wherein, reset instruction is used to indicate equipment and will be currently up mode after upgrading data programming is switched to again
Application model.Similarly, in one embodiment, reset instruction is also that the sender of equipment slave pattern switching command obtains.
Above-mentioned method for upgrading software, equipment will switch to upgrade mode and run when receiving pattern switching instruction, and
Content when receiving the program erasing instruction of controller in erasing application program parking space, and the upgrading data that will acquire
In application program parking space after write-in erasing;It is application model when receiving reset instruction, then by pattern switching.It is above-mentioned
Method, can be to multiple equipment sending mode switching command by a control equipment, that is, can be realized with a control equipment
Software upgrading to multiple equipment, it is at low cost.
In one embodiment, when receiving program erasing instruction, wipe application program parking space in content it
Before, further includes: it when receiving upgrade command within a preset time, closes and interrupts master switch, enable application program parking space
Programming function.
Upgrade command be pattern switching instruction sending direction equipment send, equipment program erasing instruction it is default when
In when receiving upgrade command, the interruption master switch of pass hull closure, and the programming function of enabled application program parking space
Energy.
The programming function (IAP function, In Application Programming) of equipment includes that application program is deposited
The programming function of programming function and upgrade procedure parking space between emptying.It is to need in embodiments herein
Software upgrading is carried out to the content that application program parking space is stored, therefore before upgrading, when receiving upgrade command, first
The programming function of enabled application program parking space.
In another embodiment, when receiving program erasing instruction, if not receiving upgrading within a preset period of time
Instruction, and detect and upgrade successfully mark in application program parking space, the mode of being currently up is switched to application model.
Wherein, preset time can be configured according to the actual situation, such as in a specific embodiment, when will be default
Between be set as 1 second, i.e., after receiving program erasing instruction in 1 second, when receiving upgrade command, the interruption of pass hull closure is always opened
It closes, and the programming function of enabled application program parking space;If not connect receiving in 1 after program erasing instruction second
When receiving upgrade command, whether detection application program parking space upgrades successfully mark.
If detecting that application program parking space exists upgrades successfully mark, indicate that the equipment has completed software upgrading,
Therefore, it is application model that equipment, which will be currently up pattern switching,.If not received receiving in 1 after program erasing instruction second
When to upgrade command, and application program parking space does not upgrade successfully mark, then returns to detection upgrade command, continues waiting for rising
Grade instruction.
In one embodiment, before receiving reset instruction, after the mode of being currently up is switched to application model,
Further include: when receiving END instruction, stop the programming of upgrading data.In the present embodiment, equipment is write will upgrade data
When entering application program parking space, the END instruction of controller transmission is received, that is, may know that upgrading data programming at this time finishes,
Therefore, when receiving END instruction, stop the programming of upgrading data.
In one embodiment, the application also provides a kind of software updating control method of equipment, is used for the present embodiment
It is described in detail in controller shown in FIG. 1.As shown in figure 3, the above method includes step S310 to step S330.
Step S310, to equipment sending mode switching command, wherein pattern switching instruction switches to liter for controlling equipment
Grade mode.
In the present embodiment, the start-up mode of equipment includes: application model and upgrade mode.Equipment is in the operation not upgraded
It is in application model under state, that is, being currently up mode is application model;It is under the operating status for carrying out software upgrading
In upgrade mode, that is, being currently up mode is upgrade mode;For equipment when needing to upgrade, controller is to equipment sending mode
Switching command controls equipment from application model and is switched to upgrade mode, and equipment enters software upgrading at this time.The mode of being currently up is
When application model, what is run after equipment starting is the application program in application program parking space;Mode is currently up as upgrading
When mode, what is run after equipment starting is the upgrade procedure in upgrade procedure parking space.
Step S320, in the pattern switching response for receiving equipment return, to equipment transmission program erasing instruction, and to
Equipment sends upgrading data.
Wherein, program erasing instruction is used to control the content in the application program parking space of erasing apparatus.In this implementation
In example, the memory space of equipment includes application program parking space and upgrade procedure parking space, and application program parking space is used
In the application program of storage equipment.
Upgrading data are the application program that equipment needs to update;In one embodiment, upgrading data are controller from text
It is obtained in part, and equipment is sent to by two lines bus.
Step S330 when detecting that upgrading data programming finishes, sends reset instruction to equipment.
Wherein, reset instruction will be currently up mode after upgrading data programming for controlling equipment and be switched to again
Application model.
In one embodiment, above-mentioned software updating control method is run on WINDOWS platform, and it is total to turn two by serial ports
The modes such as line or CAN bus send control command, and upgrading data wait until equipment.
Above-mentioned software updating control method, when controller is to equipment sending mode switching command, control equipment will be opened currently
Dynamic model formula switch to upgrade mode operation, and receive pattern switching response when to equipment send program erasing instruction when, control
Control equipment wipes the content in application program parking space, and upgrading data are sent to equipment, and control equipment will upgrade data
In application program parking space after write-in erasing;Reset instruction is sent to equipment after upgrading data write-in is completed, control is set
The standby pattern switching that will be currently up is application model.The above method can send mould to multiple equipment by a control equipment
Formula switching command, that is, software upgrading of the equipment realization to multiple equipment can be controlled with one, it is at low cost.
In one embodiment, before sending program erasing instruction to equipment, further includes: send upgrading to equipment and refer to
It enables.
Wherein, upgrade command closes interruption master switch for controlling equipment, and the program for enabling application program parking space is compiled
Write function.In the present embodiment, programming function (IAP function, the In Application Programming) packet of equipment
Include the programming function of application program parking space and the programming function of upgrade procedure parking space.In the reality of the application
It applies in example, is to need to carry out software upgrading to the content that application program parking space is stored, therefore before upgrading, need to setting
Preparation send upgrade command, to be that equipment closes terminal master switch, and the programming function of enabled application program parking space.
In one embodiment, upgrade command is sent to equipment at predetermined time intervals.It should be understood that the predetermined time can be with
It is arranged according to the actual situation, but detects whether that the preset time for receiving upgrade command is short than equipment.For example, controller is every
300ms (millisecond) sends a upgrade command to equipment, and equipment detected whether to receive after running upgrade mode every 1 second
To upgrade command.
When in one embodiment, to equipment sending mode switching command, further includes: send upgrading password to equipment.
Wherein, upgrading password will be currently up pattern switching to upgrading mould when detecting that upgrading password is correct for equipment
Formula.In one embodiment, the upgrading password that controller is sent to equipment is that (User Identification is used by UID
Family proof of identification) encrypted upgrading password, UID is the unique identification for the equipment that this needs upgrades, in the present embodiment
In, the correctness of equipment detection upgrading password includes, and when receiving pattern switching instruction, sends request verification to controller and refers to
It enables, request controller sends the upgrading password for verifying, then the upgrading password and pattern switching by verification for verifying
Whether the upgrading password in instruction unanimously correctly upgrades password to determine whether;If consistent, it is judged to correctly upgrading
Password, and then switching the mode that is currently up is upgrade mode, and to controller sending mode handoff response;If inconsistent, sentence
The upgrading password carried in mould-fixed switching command is incorrect upgrade command, at this time without the switching of start-up mode.Its
In, the encrypting and decrypting method of encryption upgrading password and decryption password can be any one existing method.
Above-mentioned software updating control method, controller is when to equipment sending mode switching command, it is also necessary to send upgrading
Password, upgrading password can be used for addressing the equipment for this time needing to upgrade;Equipment be can be also used for sending mode switching command
Sender's (i.e. controller) test, it is determined whether for correctly, the controller that has authorized, so as to improve equipment
The safety of software upgrading.
In a specific embodiment, as shown in Figure 4, Figure 5 and Figure 6, the method for upgrading software respectively in the present embodiment
Part flow diagram.
As shown in figure 4, the flow diagram of software in the application mode, comprising the following steps:
After software starting, two lines bus and serial ports are initialized, starts timer, software carries out the processing of normal use function.
In the pattern switching instruction for receiving controller, whether comprising upgrading password in checking mode switching command, and upgrading is detected
Whether password format is correct, if then modifying start-up mode is LDROM mode (upgrade mode), and resets;If otherwise not switching
Start-up mode, software still carry out normal use function treatment, even detect without upgrading password in pattern switching instruction, or
When upgrading password in the instruction of person's pattern switching is incorrect, do not switch start-up mode.
After switching start-up mode is LDROM mode, when being again started up, step as shown in Figure 5 is executed, is initialized first
Serial ports and two lines bus start timer;It waits 1 second, detects whether to receive upgrade command, always opened if then closing interruption
It closes, next refers to the step flow diagram of Fig. 6.If otherwise inquire APROM in specify address whether have software upgrading at
Starting mode is switched to APROM mode and reset chip if there is software upgrade success mark by function mark;When being again started up
The step of will be returned to Fig. 4;If identifying without software upgrade success, the step for judging upgrade command whether is received in 1 second is returned
Suddenly.
Referring to Fig. 6, being LDROM mode in start-up mode, and upgrading is had received within the predetermined time (1 second) and is referred to
It enables, equipment, which will close, interrupts master switch, and enabled IAP function (programming function), then, enables the IAP function of APROM.
When receiving program erasing instruction, the content in APROM is wiped, and obtain upgrading data from two lines bus driving, will upgraded
APROM memory space is written in data;After the completion of write-in, data are read from APROM and are proofreaded, and judging that programming finishes
When, start-up mode is switched to APROM mode, software reset, software upgrading is completed.
In a specific embodiment, as shown in fig. 7, the process for software updating control method in the present embodiment is illustrated
Figure, comprising steps of
To equipment sending mode switching command, control the start-up mode of equipment from APROM pattern switching be LDROM mode,
Equipment (i.e. lamps and lanterns) is sent to by UID encryption upgrading password to be verified;Every 300ms sends a upgrade command, and waiting is set
Standby reply (i.e. above-mentioned pattern switching response).Receive pattern switching response when, from file read upgrading data (two into
System), after sending APROM program erasing instruction to equipment, upgrading data are sent to IAP software (the i.e. IAP of LDROM of equipment
Software), control equipment enters data programming is upgraded in APROM;When programming is completed, END instruction is sent to equipment;Then, it sends out
It send reset instruction to equipment, controls equipment and be switched to APROM mode and restart.The software upgrading of this equipment terminates,
Into next equipment upgrading when, still execute step shown in Fig. 7.
By above-mentioned method for upgrading software, control method, may be implemented to realize by a controller to multiple equipment
Software upgrading, it is at low cost.
It should be understood that although each step in the flow chart of Fig. 2-7 is successively shown according to the instruction of arrow,
These steps are not that the inevitable sequence according to arrow instruction successively executes.Unless expressly stating otherwise herein, these steps
Execution there is no stringent sequences to limit, these steps can execute in other order.Moreover, at least one in Fig. 2-7
Part steps may include that perhaps these sub-steps of multiple stages or stage are not necessarily in synchronization to multiple sub-steps
Completion is executed, but can be executed at different times, the execution sequence in these sub-steps or stage is also not necessarily successively
It carries out, but can be at least part of the sub-step or stage of other steps or other steps in turn or alternately
It executes.
In one embodiment, the application also provides a kind of electronic equipment, is illustrated in figure 8 electronic equipment in the present embodiment
Memory space distribution schematic diagram, comprising: electronic equipment includes that application program parking space (APROM) and upgrade procedure storage are empty
Between (LDROM).
Electronic equipment is switched to upgrade mode when receiving pattern switching instruction, by start-up mode, runs upgrade procedure
The program stored in parking space;And the sender instructed to pattern switching returns to pattern switching response;It is wiped receiving program
Except instruction, the content of application program parking space is wiped, and application program parking space is written into the upgrading data received;?
When receiving reset instruction, start-up mode is switched to application model, runs the program stored in application program parking space.
In a specific embodiment, above-mentioned electronic equipment is a kind of sign light.
Further, in one embodiment, the application also provides a kind of controller, and controller sends mould to electronic equipment
Formula switching command, and in the pattern switching response for receiving electronic equipment return, program erasing instruction is sent to electronic equipment;
Upgrading data are sent to electronic equipment, and when detecting that upgrading data programming finishes, send reset instruction to electronic equipment.
A kind of software update system, comprising: controller and any one above-mentioned reality in any one above-mentioned embodiment
Apply the electronic equipment in example.
In a specific embodiment, above-mentioned method for upgrading software, software updating control method are applied in controller and mark
Know in lamps and lanterns, as shown in figure 9, for the system structure diagram in the present embodiment, including controller, multiple the disappearing with control connection
Anti- power supply, and the multiple sign lights being connect with fire-fighting power supply.
In one embodiment, a kind of software updating apparatus is provided, comprising: mode switch module, application program erasing
Module and program writing module, in which:
Mode switch module, for when receiving pattern switching instruction, being instructed based on pattern switching will the side of being currently up
Formula is switched to upgrade mode, and the sender instructed to pattern switching returns to pattern switching response;
Application program wipes module, for wiping in application program parking space when receiving program erasing instruction
Content;
For obtaining upgrading data application program parking space is written in upgrading data by program writing module;
Mode switch module is also used to when receiving reset instruction, and the mode of being currently up is switched to application model.
The application also provides a kind of software upgrading control device, comprising: pattern switching instruction sending module, erasing instruction hair
Send module and reset instruction sending module, in which:
Pattern switching instruction sending module, for equipment sending mode switching command, pattern switching to be instructed for controlling
Equipment switches to upgrade mode;
Erasing instruction sending module, for sending program to equipment in the pattern switching response for receiving equipment return
Erasing instruction, and upgrading data are sent to equipment;Program erasing instruction is used to control the application program parking space of erasing apparatus
In content;
Reset instruction sending module when for detecting that upgrading data programming finishes, sends reset instruction to equipment.
Specific restriction about software updating apparatus, software upgrading control device may refer to above for software upgrading
The restriction of method, software updating control method, details are not described herein.In above-mentioned software updating apparatus, software upgrading control device
Modules can be realized fully or partially through software, hardware and combinations thereof.Above-mentioned each module can embed in the form of hardware
In processor in computer equipment, the memory that can also be stored in a software form in computer equipment
In, the corresponding operation of the above modules is executed in order to which processor calls.
In one embodiment, a kind of computer readable storage medium is provided, computer program is stored thereon with, is calculated
Machine program performs the steps of when being executed by processor
When receiving pattern switching instruction, mode will be currently up based on pattern switching instruction and be switched to upgrade mode,
And the sender instructed to pattern switching returns to pattern switching response;
When receiving program erasing instruction, the content in application program parking space is wiped;
Upgrading data are obtained, application program parking space is written into upgrading data;
When receiving reset instruction, the mode of being currently up is switched to application model.
In one embodiment, it also performs the steps of when computer program is executed by processor and is cut in the mode of receiving
When changing instruction, mode will be currently up based on pattern switching instruction and be switched to upgrade mode, comprising:
Detecting pattern switching instruction in comprising upgrading password, and upgrade password it is correct when, based on pattern switching instruct
Mode will be currently up and be switched to upgrade mode.
In one embodiment, it is also performed the steps of when computer program is executed by processor and is receiving program wiping
When except instruction, before the content in erasing application program parking space, further includes:
It when receiving upgrade command within a preset time, closes and interrupts master switch, enable the journey of application program parking space
Sequence writes function.
In one embodiment, it is also performed the steps of when computer program is executed by processor and is receiving program wiping
Except instruction when, if do not receive upgrade command within a preset period of time, and detect have in application program parking space upgrading at
Function mark, is switched to application model for the mode of being currently up.
In one embodiment, it is also performed the steps of when computer program is executed by processor by upgrading data write-in
After application program parking space, further includes: the upgrading data in check and correction application program parking space.
In one embodiment, it is also performed the steps of when computer program is executed by processor to equipment sending mode
Switching command, pattern switching instruction switch to upgrade mode for controlling equipment;
In the pattern switching response for receiving equipment return, program erasing instruction is sent to equipment, and send to equipment
Upgrade data;Program erasing instruction is used to control the content in the application program parking space of erasing apparatus;
When detecting that upgrading data programming finishes, reset instruction is sent to equipment.
In one embodiment, it is also performed the steps of when computer program is executed by processor and is sending journey to equipment
Before sequence erasing instruction, further includes:
Upgrade command is sent to equipment;Upgrade command closes interruption master switch for controlling equipment, and enabled application program is deposited
Programming function between emptying.
In one embodiment, it is also performed the steps of when computer program is executed by processor to equipment sending mode
When switching command, further includes:
Upgrading password is sent to equipment;Upgrading password switches to upgrading mould when detecting that upgrading password is correct for equipment
Formula.
Those of ordinary skill in the art will appreciate that realizing all or part of the process in above-described embodiment method, being can be with
Relevant hardware is instructed to complete by computer program, the computer program can be stored in a non-volatile computer
In read/write memory medium, the computer program is when being executed, it may include such as the process of the embodiment of above-mentioned each method.Wherein,
To any reference of memory, storage, database or other media used in each embodiment provided herein,
Including non-volatile and/or volatile memory.Nonvolatile memory may include read-only memory (ROM), programming ROM
(PROM), electrically programmable ROM (EPROM), electrically erasable ROM (EEPROM) or flash memory.Volatile memory may include
Random access memory (RAM) or external cache.By way of illustration and not limitation, RAM is available in many forms,
Such as static state RAM (SRAM), dynamic ram (DRAM), synchronous dram (SDRAM), double data rate sdram (DDRSDRAM), enhancing
Type SDRAM (ESDRAM), synchronization link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM
(RDRAM), direct memory bus dynamic ram (DRDRAM) and memory bus dynamic ram (RDRAM) etc..
Each technical characteristic of above embodiments can be combined arbitrarily, for simplicity of description, not to above-described embodiment
In each technical characteristic it is all possible combination be all described, as long as however, the combination of these technical characteristics be not present lance
Shield all should be considered as described in this specification.
The several embodiments of the application above described embodiment only expresses, the description thereof is more specific and detailed, but simultaneously
It cannot therefore be construed as limiting the scope of the patent.It should be pointed out that coming for those of ordinary skill in the art
It says, without departing from the concept of this application, various modifications and improvements can be made, these belong to the protection of the application
Range.Therefore, the scope of protection shall be subject to the appended claims for the application patent.
Claims (10)
1. a kind of method for upgrading software of equipment, which comprises
When receiving pattern switching instruction, mode will be currently up based on pattern switching instruction and be switched to upgrade mode,
And the sender instructed to the pattern switching returns to pattern switching response;
When receiving program erasing instruction, the content in application program parking space is wiped;
Upgrading data are obtained, the application program parking space is written into the upgrading data;
When receiving reset instruction, the mode of being currently up is switched to application model.
2. the method according to claim 1, wherein being based on the mode when receiving pattern switching instruction
Switching command will be currently up mode and be switched to upgrade mode, comprising:
Comprising upgrading password in detecting pattern switching instruction, and when the upgrading password is correct, based on the mode
Switching command will be currently up mode and be switched to upgrade mode.
3. according to the method described in claim 1, it is characterized by:
When receiving program erasing instruction, before the content in erasing application program parking space, further includes:
When receiving upgrade command within a preset time, closes and interrupt master switch, enable the journey of the application program parking space
Sequence writes function;
Or
When receiving program erasing instruction, if not receiving upgrade command within a preset period of time, and the application is detected
Mark is upgraded successfully in program parking space, and the mode of being currently up is switched to application model.
4. the method according to claim 1, wherein the application program, which is written, in the upgrading data stores sky
Between after, further includes:
Proofread the upgrading data in the application program parking space.
5. a kind of software updating control method, which comprises
To equipment sending mode switching command, the pattern switching instruction will be currently up pattern switching for controlling the equipment
To upgrade mode;
When receiving the pattern switching response that the equipment returns, Xiang Suoshu equipment sends program erasing instruction, and to described
Equipment sends upgrading data;Described program erasing instruction is interior in the application program parking space for wiping the equipment for controlling
Hold;
After detecting the upgrading data programming, Xiang Suoshu equipment sends reset instruction, and the reset instruction is for controlling
The equipment will be currently up pattern switching to application model.
6. according to the method described in claim 5, it is characterized in that, being gone back before sending program erasing instruction to the equipment
Include:
Upgrade command is sent to the equipment;The upgrade command closes interruption master switch for controlling the equipment, enables institute
State the programming function of application program parking space.
7. according to the method described in claim 5, it is characterized in that, when to equipment sending mode switching command, further includes:
Upgrading password is sent to the equipment;The upgrading password is for the equipment when detecting that the upgrading password is correct
Switch to upgrade mode.
8. a kind of electronic equipment, comprising: the electronic equipment includes application program parking space and upgrade procedure parking space;
The electronic equipment is switched to upgrade mode when receiving pattern switching instruction, by start-up mode, described in operation
The program stored in upgrade procedure parking space;And the sender instructed to the pattern switching returns to pattern switching response;?
Described program erasing instruction is received, wipes the content of the application program parking space, and the upgrading data received are write
Enter the application program parking space;When receiving the reset instruction, start-up mode is switched to application model, runs institute
State the program stored in application program parking space.
9. a kind of software update system, comprising: controller and electronic equipment as claimed in claim 8;
The controller is to the electronic equipment sending mode switching command, and in the mode for receiving the electronic equipment and returning
When handoff response, Xiang Suoshu electronic equipment sends program erasing instruction;Upgrading data are sent to the electronic equipment, and are being detected
After the upgrading data programming, Xiang Suoshu electronic equipment sends reset instruction.
10. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that the computer program
The step of method described in any one of claims 1 to 7 is realized when being executed by processor.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910154947.0A CN109885331A (en) | 2019-03-01 | 2019-03-01 | Method for upgrading software, control method, system, storage medium and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910154947.0A CN109885331A (en) | 2019-03-01 | 2019-03-01 | Method for upgrading software, control method, system, storage medium and electronic equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109885331A true CN109885331A (en) | 2019-06-14 |
Family
ID=66930201
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910154947.0A Pending CN109885331A (en) | 2019-03-01 | 2019-03-01 | Method for upgrading software, control method, system, storage medium and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109885331A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110457058A (en) * | 2019-08-09 | 2019-11-15 | 北京万东医疗科技股份有限公司 | Control node online upgrading method, apparatus, host computer, system and electronic equipment |
CN113407212A (en) * | 2021-06-17 | 2021-09-17 | 深圳远征技术有限公司 | Remote upgrading method and device, terminal equipment and storage medium |
CN113568629A (en) * | 2020-04-28 | 2021-10-29 | 中车株洲电力机车研究所有限公司 | Software upgrading method and device based on CAN, computer equipment and storage medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20100318981A1 (en) * | 2009-06-10 | 2010-12-16 | International Business Machines Corporation | Concurrent upgrade of all components in storage subsystems |
CN104407898A (en) * | 2014-12-03 | 2015-03-11 | 深圳晶福源科技股份有限公司 | Software remote upgrade system and method for photovoltaic array smart junction box |
CN105354070A (en) * | 2015-12-11 | 2016-02-24 | 成都广达新网科技股份有限公司 | Method for upgrading equipment firmware through I2C |
CN106227572A (en) * | 2016-08-30 | 2016-12-14 | 深圳市蓝海华腾技术股份有限公司 | A kind of frequency converter control system programme upgrade method |
-
2019
- 2019-03-01 CN CN201910154947.0A patent/CN109885331A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20100318981A1 (en) * | 2009-06-10 | 2010-12-16 | International Business Machines Corporation | Concurrent upgrade of all components in storage subsystems |
CN104407898A (en) * | 2014-12-03 | 2015-03-11 | 深圳晶福源科技股份有限公司 | Software remote upgrade system and method for photovoltaic array smart junction box |
CN105354070A (en) * | 2015-12-11 | 2016-02-24 | 成都广达新网科技股份有限公司 | Method for upgrading equipment firmware through I2C |
CN106227572A (en) * | 2016-08-30 | 2016-12-14 | 深圳市蓝海华腾技术股份有限公司 | A kind of frequency converter control system programme upgrade method |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110457058A (en) * | 2019-08-09 | 2019-11-15 | 北京万东医疗科技股份有限公司 | Control node online upgrading method, apparatus, host computer, system and electronic equipment |
CN113568629A (en) * | 2020-04-28 | 2021-10-29 | 中车株洲电力机车研究所有限公司 | Software upgrading method and device based on CAN, computer equipment and storage medium |
CN113407212A (en) * | 2021-06-17 | 2021-09-17 | 深圳远征技术有限公司 | Remote upgrading method and device, terminal equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109885331A (en) | Method for upgrading software, control method, system, storage medium and electronic equipment | |
KR100988157B1 (en) | Method and apparatus for detecting memory device configuration, and computer readable medium containing instructions for performing method for detecting memory device configuration | |
WO2010017775A1 (en) | Controller area network (can) bus based control method for refreshing codes of vehicle’s electronic controller | |
CN107807624B (en) | Method for refreshing application program in controller | |
JP2002278783A (en) | System for rewriting firmware | |
CN104835537B (en) | SOC self-adaptive starting method and device | |
CN109032612B (en) | Interface calling method and device of hybrid application and computer readable storage medium | |
CN111277476B (en) | Gateway controller function verification method, gateway controller function verification device, computer equipment and storage medium | |
CN111339007B (en) | USB device control method and device, computer device and storage medium | |
EP3895939B1 (en) | Electronic control device and security verification method for electronic control device | |
CN109766140A (en) | A kind of localization method and device that set-top box starting is abnormal | |
US20100191949A1 (en) | Information processing terminal and falsification verification method | |
CN104657685B (en) | Apparatus for protecting program code stored in non-volatile memory | |
CN111596964B (en) | Method and device for realizing batch deployment of Windows systems based on wireless network | |
CN117215656A (en) | Linux system-based self-adaptive vehicle chip method and device, electronic equipment and vehicle | |
CN104503905B (en) | The adjustment method and debugging system of a kind of embedded system | |
CN100363893C (en) | Loading system and method | |
CN116312730A (en) | UFS storage device monomer test driving method and device based on MT6891 platform | |
CN105512032A (en) | Middle database virtual control test method and system | |
CN106444730B (en) | Diagnosis method of electronic control unit for preventing software from being dead | |
CN107229457B (en) | Electronic controller, guide loading method and device thereof and automobile | |
CN111796839B (en) | Controller program management method and device | |
EP2730993B1 (en) | Reset method and network device | |
Ji et al. | Implementation and research of bootloader for automobile ECU remote incremental update | |
CN115658183B (en) | Method and device for controlling MCU, electronic equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20190614 |
|
RJ01 | Rejection of invention patent application after publication |