CN106990982A - Method for updating program and device - Google Patents

Method for updating program and device Download PDF

Info

Publication number
CN106990982A
CN106990982A CN201710166980.6A CN201710166980A CN106990982A CN 106990982 A CN106990982 A CN 106990982A CN 201710166980 A CN201710166980 A CN 201710166980A CN 106990982 A CN106990982 A CN 106990982A
Authority
CN
China
Prior art keywords
bootstrap
program
application program
memory
target program
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.)
Granted
Application number
CN201710166980.6A
Other languages
Chinese (zh)
Other versions
CN106990982B (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.)
Beijing Electric Vehicle Co Ltd
Original Assignee
Beijing Electric Vehicle 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 Beijing Electric Vehicle Co Ltd filed Critical Beijing Electric Vehicle Co Ltd
Priority to CN201710166980.6A priority Critical patent/CN106990982B/en
Publication of CN106990982A publication Critical patent/CN106990982A/en
Application granted granted Critical
Publication of CN106990982B publication Critical patent/CN106990982B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates

Abstract

The present invention proposes a kind of method for updating program and device, wherein, method includes:After target program updates failure, the first bootstrap of restarting is returned to, wherein the solidification of the first bootstrap is in memory;Target program is application program or the second bootstrap, performs the first bootstrap, according to the more new logic in the first bootstrap, target program is updated again.By the way that bootstrap is separated into two parts, the first bootstrap including more new logic is cured in memory, then can be when returning to restarting after target program, which updates, to fail, the position of the first bootstrap is repositioned onto, starts first bootstrap guiding and performs more new logic.Especially for BootLoader renewal, it also can continue to be updated the second bootstrap after failure is updated, so as to solve in the prior art, presence can not start and then cause the problem of ECU can not be used normally after BootLoader, which updates, to fail.

Description

Method for updating program and device
Technical field
The present invention relates to field of computer technology, more particularly to a kind of method for updating program and device.
Background technology
Electronic control unit (Electronic Control Unit, abbreviation ECU) is also known as " car running computer ", " vehicle mounted electric Brain " etc..The ECU of current main-stream has following two ways to support online upgrading:
The first:It will be responsible for the bootstrap (BootLoader) and application program to application program updating (Application) merge, updated while upgrading.Once interrupting in escalation process, system will be unable to open again It is dynamic, in such cases great the risk and cost can be brought to the ECU upgradings of automobile.
Second:BootLoader is opened with separate, flash memory (Flash) separate space is respectively stored in In, after the upper electricity of ECU in advanced BootLoader, judge whether application program is effective, so that it is to rest on guiding (boot) to determine State still enters application program.Because BootLoader and application program are in independent Flash regions, when application program more BootLoader is had no effect on after new failure, it is possible to continue through BootLoader more new applications again.But, when When BootLoader is also required to update, if unsuccessfully may result in whole system during BootLoader renewals can not start.
The content of the invention
Therefore, the present invention proposes a kind of method for updating program and device, for solving existing program update mode, exist Cause the problem of system can not start after BootLoader updates failure.
Second object of the present invention is to propose a kind of program renewing device.
For up to above-mentioned purpose, first aspect present invention embodiment proposes a kind of method for updating program, including:
After target program updates failure, the first bootstrap of restarting is returned;Wherein, first bootstrap is consolidated Change in memory;The target program is application program or the second bootstrap;
Perform first bootstrap;
According to the more new logic in first bootstrap, the target program is updated again.
The method for updating program of the embodiment of the present invention, by the way that bootstrap is separated into two parts, will include more new logic The first bootstrap be cured in memory, when target program update fail after, then can return restarting when, again The position of the first bootstrap is navigated to, starts first bootstrap guiding and performs more new logic.Especially for BootLoader renewal, also can continue to be updated the second bootstrap after failure is updated, existing so as to solve Have in technology that presence can not start and then cause the problem of ECU can not be used normally after BootLoader, which updates, to fail.
For up to above-mentioned purpose, second aspect of the present invention embodiment proposes a kind of program renewing device, including:
Memory, processor and storage are on a memory and the first bootstrap that can run on a processor, the place Manage method for updating program of the device execution as described in first aspect present invention embodiment.
The program renewing device of the embodiment of the present invention, by the way that bootstrap is separated into two parts, will include more new logic The first bootstrap be cured in memory, when target program update fail after, then can return restarting when, again The position of the first bootstrap is navigated to, starts first bootstrap guiding and performs more new logic.Especially for BootLoader renewal, also can continue to be updated the second bootstrap after failure is updated, existing so as to solve Have in technology that presence can not start and then cause the problem of ECU can not be used normally after BootLoader, which updates, to fail.
The additional aspect of the present invention and advantage will be set forth in part in the description, and will partly become from the following description Obtain substantially, or recognized by the practice of the present invention.
Brief description of the drawings
Of the invention above-mentioned and/or additional aspect and advantage will become from the following description of the accompanying drawings of embodiments Substantially and be readily appreciated that, wherein:
Fig. 1 is a kind of schematic flow sheet of method for updating program provided in an embodiment of the present invention;
Fig. 2 is the schematic flow sheet of another method for updating program provided in an embodiment of the present invention;
Fig. 3 is the schematic flow sheet of another method for updating program provided in an embodiment of the present invention;
The schematic diagram that Fig. 4 divides for a kind of memory provided in an embodiment of the present invention;
Fig. 5 is a kind of structural representation of program renewing device provided in an embodiment of the present invention.
Embodiment
Embodiments of the invention are described below in detail, the example of the embodiment is shown in the drawings, wherein from beginning to end Same or similar label represents same or similar element or the element with same or like function.Below with reference to attached The embodiment of figure description is exemplary, it is intended to for explaining the present invention, and be not considered as limiting the invention.
Below with reference to the accompanying drawings the method for updating program and device of the embodiment of the present invention described.
Fig. 1 is a kind of schematic flow sheet of method for updating program provided in an embodiment of the present invention.As shown in figure 1, the program Update method comprises the following steps:
S101, last time target program update failure after, return restarting the first bootstrap;Wherein, the first guiding Program Solidification is in memory;Target program is application program or the second bootstrap.
In the present embodiment, in order to realize after target program updates failure, it can continue to carry out more target program Newly, two parts will be divided into for the bootstrap (BootLoader) being updated to application program, a part is for mesh In the more new logic that beacon course sequence is updated, the present embodiment, the part is turned into the first bootstrap.Another part be for pair In the code block that application program is updated, the present embodiment, the part is turned into the second bootstrap.Based on the first bootstrap The renewal of target program can be finally completed with the second bootstrap.
In the present embodiment, in order to avoid BootLoader update failure after can not activation system risk, first is drawn Helical pitch sequence is cured in memory.The memory can be flash storage.First bootstrap includes entering target program The more new logic that row updates, when being updated to target program, the first bootstrap can guide system according to the renewal journey Sequence is updated.And due to the solidification of the first bootstrap in memory, can't draw when system update is upgraded to first Helical pitch sequence is updated upgrading.
Need to start from startup position in practical application, when system starts, in the present embodiment, by the first bootstrap It is cured to the startup position in memory.Specifically, the memory space of memory is divided in advance, can be by one of them Memory space is set as the startup position that system starts, and first bootstrap is solidificated in into corresponding first storage in startup position In space.
Target program can be application program, or the second bootstrap isolated from BootLoader.In mesh Beacon course sequence is updated after failure, can restart to attempt to update target program again.In the present embodiment, due to the first guiding journey Sequence solidify in memory, return restarting when, the position of the first bootstrap can be repositioned onto, start this first Bootstrap.When especially target program is the second bootstrap, in the prior art due to bootstrap is not separated into two parts, After bootstrap, which updates, to fail, it will be absorbed in the risk that system can not restart.And in the present embodiment, by bootstrap more New logic, which is separately separated, to be cured in memory, is updated after failure, can also be guided in system reboot even in another part According to more new logic, the second bootstrap is updated again.
S102, the first bootstrap of execution.
S103, according to the more new logic in the first bootstrap, target program is updated again.
After the first bootstrap has been restarted, it is possible to perform first bootstrap.Further, when performing the After one bootstrap, it is possible to according to the more new logic included by the first bootstrap, target program is updated again.
The method for updating program that the present embodiment is provided, after target program updates failure, returns to restarting first and guides Program, wherein the solidification of the first bootstrap is in memory;Target program is application program or the second bootstrap, and is held The bootstrap of row first, according to the more new logic in the first bootstrap, updates target program again.In the present embodiment, it will draw Helical pitch sequence is separated into two parts, and the first bootstrap including more new logic is cured in memory, when target program updates After failure, then it can be repositioned onto the position of the first bootstrap when returning restarting, start first bootstrap Guiding performs more new logic.Especially for BootLoader renewal, also it can continue to after failure is updated to the second guiding journey Sequence is updated, and so as to solve in the prior art, presence can not start and then cause after BootLoader, which updates, to fail The problem of ECU can not be used normally.
Fig. 2 is the schematic flow sheet of another method for updating program provided in an embodiment of the present invention.As shown in Fig. 2 the journey Sequence update method comprises the following steps:
S201, target program are updated after failure, return to the first bootstrap of restarting;Wherein, the first bootstrap is consolidated Change in memory.
Introduction on S201 can be found in the related record in S101 in above-described embodiment, and here is omitted.
S202, the first bootstrap of execution.
The first bootstrap is performed, first bootstrap includes more new logic, can be according to the first bootstrap institute Including more new logic, more new application again.In the present embodiment, the more new logic set is that application program and second guide Program mutually updates.For example, when target program is application program, then completing application program more by the second bootstrap Newly, and when target program is the second bootstrap, then the renewal of the second bootstrap is completed by application program.
In practical application, the renewal of application program needs to complete in the second bootstrap effective status, and second The renewal of bootstrap needs to complete in the case of application program is effective.In the present embodiment, according to application program and the At least one in two bootstrap is in effective status, forms above-mentioned more new logic.
In the present embodiment, if target program is application program, after application program update failure, returns to first and guide journey When being guided after sequence according to more new logic, then it can determine that the second bootstrap is in effective status, so as to continue to update Application program.After application program update success, application program may be in effective status.When needing to the second bootstrap When being updated, it is possible to the second bootstrap is updated by application program.
Similarly, if target program is the second bootstrap, after the second bootstrap, which updates, to fail, return to first and draw When being guided after helical pitch sequence according to more new logic, then it can determine that application program is in effective status, so as to continue to update Application program.After the second bootstrap is updated successfully, the second bootstrap may be in effective status.When needs are to application When program is updated, it is possible to application program is updated by the second bootstrap.
S203, by the first bootstrap judge whether need more new application.
Specifically, when needing more new application or during the second bootstrap, host computer can be by bus to system The indication signal for indicating to need to update is sent, the first bootstrap can be according to indication signal, to judge whether to need more New application.If it is judged that needing more new application, then S204 is performed.
S204, if necessary to more new application and when the second bootstrap is effective, more new application.
Because the renewal of application program needs to complete in the case of the second bootstrap is effective, needs are being judged After more new application, then need to judge whether the second bootstrap is effective, determining the effective feelings of the second bootstrap Under condition, it is possible to enter in the second bootstrap, application program is updated by the second bootstrap.
In the present embodiment, it can judge whether the second bootstrap is effective according to the effective marker position of the second bootstrap. One default value is set for effective marker position in advance, for example, can be " 1 ", when the numerical value of effective marker position is " 1 ", then may be used To judge that the second bootstrap is in effective status.
S205, if necessary to not more new application, in application program effectively and when the second bootstrap needs to update, more New second bootstrap.
Specifically, when the first bootstrap judges not needing more new application according to the indication signal of transmission, then Continue to may determine that whether application program is effective, if application program is effectively, into application program.Further, when second When bootstrap needs to update, then the second bootstrap can be updated.If the second bootstrap need not update, Application program can be performed.
In the present embodiment, it can judge whether application program is effective according to the effective marker position of application program.It is to have in advance Valid flag position sets a default value, for example, can be " 1 ", when the numerical value of effective marker position is " 1 ", then may determine that Application program is in effective status.
In the present embodiment, the more new logic write-in first that application program and the second bootstrap mutually update is guided in advance Program, then the first bootstrap be cured in memory, when target program update fail after, then can return restarting When, the position of the first bootstrap is repositioned onto, starts first bootstrap guiding and performs more new logic.Especially for BootLoader renewal, also can continue to be updated the second bootstrap after failure is updated, existing so as to solve Have in technology that presence can not start and then cause the problem of ECU can not be used normally after BootLoader, which updates, to fail.
Fig. 3 is the schematic flow sheet of another method for updating program provided in an embodiment of the present invention.Destination application can Think application program, or the second bootstrap.Both of which is updated according to the flow shown in Fig. 3.The present embodiment is carried The method for updating program of confession, can be applied in the various control systems such as ECU, MUC.As shown in figure 3, the method for updating program bag Include following steps:
S301, system start the first bootstrap.
In the present embodiment, due to the first bootstrap to be cured to the startup position of memory in advance.When target program more After new failure, then system may return to the startup position of memory, restart the first bootstrap.First bootstrap is just Target program can be updated again according to default more new logic.Destination application can be application program, also may be used Think the second bootstrap.Both updates according to the flow shown in Fig. 3.
In the present embodiment, the more new logic set is that application program and the second bootstrap mutually update.For example, working as target When program is application program, then the renewal of application program is completed by the second bootstrap, and when target program is the second guiding During program, then the renewal of the second bootstrap is completed by application program.In practical application, the renewal of application program is needed the Two bootstrap effective statuses can be completed, and the renewal of the second bootstrap needs the ability in the case of application program is effective It is enough to complete.In the present embodiment, effective status is in according at least one in application program and the second bootstrap, is formed above-mentioned More new logic.
In the present embodiment, the memory space of memory is divided in advance, specifically, the first bootstrap be cured to Start in corresponding first memory space in position.Further, one is chosen from remaining memory space as the second storage Space, the second memory space is used for the configuration parameter for depositing memory, wherein, the distribution that the configuration parameter includes memory is believed Breath, i.e., address information, the content deposited, size of memory space of each memory space etc..Further, configuration parameter is also The effective marker position of effective flag including target program, i.e. application program and the effective marker position of the second bootstrap. When can also include the version number of information, the i.e. application programs such as version number, the renewal time of target program in configuration parameter, update Between and the second bootstrap version number, renewal time.
In the present embodiment, in the residual memory space in addition to the first memory space and the second memory space, to deposit Second bootstrap and application program.Further, application program is operationally, in addition it is also necessary to the key parameter related to system These key parameter values, can be stored separately in an other memory space by value.When performing application program, system can To read nominal data from the memory space for having nominal data is deposited.
For example, 5 memory spaces can be divided the memory into, 5 memory space distributions can be stored:First guiding journey Sequence, configuration parameter, the second bootstrap, the nominal data of application program and application program.Wherein, nominal data is to apply journey Sequence key parameter related to system when performing, as shown in Figure 4.Fig. 4 deposits for a kind of memory provided in an embodiment of the present invention Store up the schematic diagram that space is divided.
S302, system judge whether to need more new application.
In practical application, in burning program in systems first, it is necessary to the bootstrap of burning first, configuration parameter and Second bootstrap, further uses application program to realize, can also together be burnt to application program in systems In memory.Burning can be carried out to program according to above-mentioned memory dividing mode.System can just be entered online after the completion of burning Row upgrading.
When system runs the program of burning first, the first bootstrap is directly entered after startup, then by the first guiding journey Sequence judges whether to need to be updated application program.Specifically, host computer can by bus to system send be used for refer to Show the first signal of needs more new application, the first signal that system is sent based on the first bootstrap according to host computer is sentenced It is disconnected whether to need more new application.S303 is then performed if necessary to update.If need not update, S304 is performed.
Generally, after burning application program in system, when performing the first bootstrap first, system is often not The first signal that host computer is sent by bus can be received, i.e., and need not correspond to and be updated with program.
S303, system judge whether the second bootstrap is effective according to the effective marker position of the second bootstrap.
Specifically, can be from the second memory space where configuration parameter, read the second bootstrap has criterion Will position, if the target program currently to be updated is application program, the effective marker of the second bootstrap is default value, then It may determine that the second bootstrap is in effective status, then perform S305.If the effective marker position of the second bootstrap is non- Default value, then may determine that the second bootstrap is in failure state, illustrates that the second guiding needs to update, then needs to perform S306 continues through application program to update the second bootstrap.
In the present embodiment, renewal for one version of target program, it is necessary to before to the version update for the first time, The default value of the effective marker position of target program is purged, after the once renewal failure to the target program version, Then determine that target program is in failure state according to the effective marker of target program position during next update.
I.e. when target program is the second bootstrap, if last time updates the failure of the second bootstrap, the second guiding journey The default value of the effective marker of sequence can be eliminated when updating last time, according to the effective marker position after removing, it may be determined that go out Second bootstrap is in disarmed state.Disarmed state is in if there is the second bootstrap, then performs S306.
S305, system enter the second bootstrap.
S307, system update application program.
Second bootstrap is used to be updated application program, and after system enters the second bootstrap, system is just Application program can be updated using the code block during second guides into.After the completion of to application program update, system is just It can be resetted.
S304, system judge whether application program is effective according to the effective marker position of application program.
Judge should program need not update when, it is possible to continuing to be judged according to the effective marker of application program position should It is whether effective with program.Specifically, system is stored with configuration parameter in the second memory space of memory, wherein, configuration ginseng Number includes the effective marker of application program and the second bootstrap.System can read application from the second memory space The effective marker position of program.System can judge whether application program is effective according to the numerical value of effective marker position.Generally, If application program need not update, there be the effective marker position of application program for default value, i.e. application program in configuration parameter Effect then performs S306.
When target program is application program, if last time more new application fails, the effective marker of application program Default value can be eliminated when updating last time, according to the effective marker position after removing, it may be determined that go out application program and be in nothing Effect state.Generally, application program is invalid illustrates that the application program needs to update, then needs to perform S307.
In practical application, when application program updated last time after renewal failure and when system is not connected with host computer, Although needing to be updated application program, but the indication signal of host computer transmission can not be received, in such cases, by In the indication signal for not receiving renewal, step S303 judges and need not corresponded to be updated with program, but actually Fail because application program last time updates, it is still desirable to which application program is updated.And due to every time to application program Version enters when updating, it is necessary to before to the version update for the first time, by the default value of the effective marker of application program position It is purged.At no point in the update process, if application program update fails, next time can be according to application program when updating again Effective marker position determines that application program is invalid, in such cases, then needs to perform S307.
S306, system enter application program.
S308, system judge whether to need to update the second bootstrap.
When the second bootstrap needs to update, host computer can be sent by bus to system to be needed to update for instruction The secondary signal of second bootstrap.Further, if receiving secondary signal, system can determine to need to guide second Program is updated, then performs S310.If not receiving secondary signal, system can be determined need not be to the second guiding journey Sequence is updated, then performs S312.
S310, the bootstrap of system update second.
System according to secondary signal when judging to need to be updated the second bootstrap, and system can just update Two bootstrap, specifically, can receive the more new content of the second bootstrap by bus from host computer.Updating After two bootstrap, system reset.
S312, system perform application program.
When application program judges that the second bootstrap need not update according to secondary signal, system directly performs application Program, the normal service provided using application program or function.System has been performed after application program, and system can following electricity.
Further, after target program has been updated, system can adjust target journey according to the actual size of target program The shared memory space of sequence.Specifically, system can be according to the actual size of target program, shared by adjustment target program Memory space size and/or position.In the present embodiment, in the storage in addition to the first memory space and the second memory space Stored target program in space.System can update after target program actual size, removed neatly to adjust in memory Residual memory space between first memory space and the second memory space.For example, the position of target program storage can be adjusted, The original shared space size of target program can be adjusted.
In practical application, the configuration parameter that target program is generally resulted in after being updated successfully in memory changes, then After the completion of target program renewal, system also needs to be updated the configuration parameter in the second memory space in memory.Example Such as, after target program is updated successfully, the effective marker position of target program needs to revert to default value, could so cause more Target program after new is used by system.For another example can be by the version number after the renewal of target program and renewal time etc. Information, updates into configuration parameter.
For another example after the completion of target program updates, it is necessary to adjust the position of memory space the problems such as may be due to actual size Put or size, system is needed the position shared by target program after renewal and the space size of occupancy after the completion of adjustment, more Newly in the distribution information of the memory into configuration parameter.
In order to understand program provided in an embodiment of the present invention more new technological process, enter so that target program is the second bootstrap as an example Row is illustrated.When performing the first bootstrap for the first time, the second bootstrap and application program are in effective status, not Need to be updated.When detecting the second bootstrap and needing renewal, it is necessary to be clear by the effective marker of the second bootstrap Remove.Now, application program is in effective status, so that after the second bootstrap updates failure, system returns to restarting the After one bootstrap, when application program need not update, entered to the whether effective step of application program is judged, due to this When application program be in effective status, system can then enter application program, come more so as to continue through application program New second bootstrap.
And when application program needs to update, effective judgment step of the second bootstrap is entered, due to the second guiding Program last time updates failed, and system, which can only enter, to be jumped in application program, and the second guiding journey is updated by application program Sequence, after being updated successfully in the second bootstrap, could start more new application.And when the second bootstrap is updated to After work(, the effective marker bit recovery of the second bootstrap to default value.
Because the second bootstrap is now effective, it is possible to enter the second bootstrap, application program is updated. Or, it is not updated successfully when application program updated last time, and because system and host computer are not connected with so that system does not connect The signal of the instruction more new application of host computer transmission is received, system enters the step for judging whether application program is effective, Because now application program is invalid, then it can enter the second bootstrap, application program is carried out more by the second bootstrap Newly, could be by the effective marker bit recovery of application program to default value until application program update completion.
The more new logic that the present embodiment is provided, it is ensured that application program in the second bootstrap with having at least one to be in Effective status, when in target program being one of them, because another is effective status, and the first bootstrap is solidificated in In memory, then it can return the first bootstrap after target program updates failure, target program be updated again, Completed until the target program updates, target program is effective after the completion of renewal.The present embodiment, it is possible to achieve application program with Second bootstrap mutually updates upgrading, especially for BootLoader renewal, also can continue to after failure is updated to the Two bootstrap are updated, so as to solve in the prior art when BootLoader update fail after presence can not start into And cause the problem of ECU can not be used normally.
Fig. 5 is a kind of structural representation of program renewing device provided in an embodiment of the present invention.As shown in figure 5, the program Updating device includes:Processor 11 and memory 12.
Processor 11, for after target program updates failure, returning to the first bootstrap of restarting;Wherein, it is described First bootstrap solidifies in memory 12;The target program is application program or the second bootstrap, is performed described First bootstrap, according to the more new logic in first bootstrap, updates the target program again.
Further, processor 11, specifically for mutually being updated based on the application program and second bootstrap More new logic, the target program is updated again.
Processor 11, has specifically for being according to the application program with least one in second bootstrap Effect state forms the more new logic.
Processor 11, specifically for being judged whether to need to update the application program by first bootstrap, if Need to update the application program and when second bootstrap is effective, update the application program.
Processor 11, the effective marker position specifically for reading second bootstrap from the memory 12, root According to the effective marker position of second bootstrap, judge whether second bootstrap is effective.
Processor 11, if specifically for the application program need not be updated, it is effective and described in the application program When second bootstrap needs to update, second bootstrap is updated.
Processor 11, the effective marker position specifically for reading the application program from the memory 12, according to institute The effective marker position of application program is stated, judges whether the application program is effective.
Processor 11, specifically for the renewal for one version of target program, it is necessary to be carried out just to the version Before secondary renewal, the default value of the effective marker position of the target program is purged, to the target program version After this once renewal failure, then the target program is determined according to the effective marker of the target program position during next update In failure state.
Processor 11, specifically for carrying out storage region division to the memory 12 in advance, forms multiple memory spaces, First bootstrap is solidificated in the first memory space;First memory space is the startup position that system starts, The second memory space is chosen from remaining memory space, wherein, second memory space is used for storage configuration parameter;It is described Configuration parameter includes the distribution information of the memory 12 and the effective marker position of the target program, except the described first storage The target program is deposited in memory space outside space and the second memory space.
Processor 11, specifically for after the completion of renewal, the target is adjusted according to the actual size of the target program The shared memory space of program.
Processor 11, after being updated successfully specifically for the target program, renewal is stored in second memory space The configuration parameter.
Processor 11, specifically for when the target program is the application program, the target program is updated successfully Afterwards, update and be stored in nominal data in the memory 12, wherein, the nominal data be when the application program is performed with The related key parameter values of system.
Processor 11 and memory 12 can be connected with each other by bus and complete mutual communication.The bus can be with It is industry standard architecture (Industry Standard Architecture, referred to as ISA) bus, external equipment interconnection (Peripheral Component, referred to as PCI) bus or extended industry-standard architecture (Extended Industry Standard Architecture, referred to as EISA) bus etc..The bus can be divided into address bus, data/address bus, control Bus processed etc..For ease of representing, only represented in Fig. 5 with a thick line, it is not intended that only one bus or a type of Bus.
Processor 11 is probably a central processing unit (Central Processing Unit, referred to as CPU), or Specific integrated circuit (Application Specific Integrated Circuit, referred to as ASIC), or by with It is set to the one or more integrated circuits for implementing the embodiment of the present invention.
In the description of this specification, reference term " one embodiment ", " some embodiments ", " example ", " specifically show The description of example " or " some examples " etc. means to combine specific features, structure, material or the spy that the embodiment or example are described Point is contained at least one embodiment of the present invention or example.In this manual, to the schematic representation of above-mentioned term not Identical embodiment or example must be directed to.Moreover, specific features, structure, material or the feature of description can be with office Combined in an appropriate manner in one or more embodiments or example.In addition, in the case of not conflicting, the skill of this area Art personnel can be tied the not be the same as Example or the feature of example and non-be the same as Example or example described in this specification Close and combine.
In addition, term " first ", " second " are only used for describing purpose, and it is not intended that indicating or implying relative importance Or the implicit quantity for indicating indicated technical characteristic.Thus, define " first ", the feature of " second " can express or Implicitly include at least one this feature.In the description of the invention, " multiple " are meant that at least two, such as two, three It is individual etc., unless otherwise specifically defined.
Any process described otherwise above or method description are construed as in flow chart or herein, represent to include Module, fragment or the portion of the code of one or more executable instructions for the step of realizing custom logic function or process Point, and the scope of the preferred embodiment of the present invention includes other realization, wherein can not be by shown or discussion suitable Sequence, including according to involved function by it is basic simultaneously in the way of or in the opposite order, carry out perform function, this should be of the invention Embodiment person of ordinary skill in the field understood.
Represent in flow charts or logic and/or step described otherwise above herein, for example, being considered use In the order list for the executable instruction for realizing logic function, it may be embodied in any computer-readable medium, for Instruction execution system, device or equipment (such as computer based system including the system of processor or other can be held from instruction The system of row system, device or equipment instruction fetch and execute instruction) use, or combine these instruction execution systems, device or set It is standby and use.For the purpose of this specification, " computer-readable medium " can any can be included, store, communicate, propagate or pass Defeated program is for instruction execution system, device or equipment or the dress for combining these instruction execution systems, device or equipment and using Put.The more specifically example (non-exhaustive list) of computer-readable medium includes following:Electricity with one or more wirings Connecting portion (electronic installation), portable computer diskette box (magnetic device), random access memory (RAM), read-only storage (ROM), erasable edit read-only storage (EPROM or flash memory), fiber device, and portable optic disk is read-only deposits Reservoir (CDROM).In addition, can even is that can be in the paper of printing described program thereon or other are suitable for computer-readable medium Medium, because can then enter edlin, interpretation or if necessary with it for example by carrying out optical scanner to paper or other media His suitable method is handled electronically to obtain described program, is then stored in computer storage.
It should be appreciated that each several part of the present invention can be realized with hardware, software, firmware or combinations thereof.Above-mentioned In embodiment, the software that multiple steps or method can in memory and by suitable instruction execution system be performed with storage Or firmware is realized.Such as, if realized with hardware with another embodiment, following skill well known in the art can be used Any one of art or their combination are realized:With the logic gates for realizing logic function to data-signal from Scattered logic circuit, the application specific integrated circuit with suitable combinational logic gate circuit, programmable gate array (PGA), scene can be compiled Journey gate array (FPGA) etc..
Those skilled in the art are appreciated that to realize all or part of step that above-described embodiment method is carried Rapid to can be by program to instruct the hardware of correlation to complete, described program can be stored in a kind of computer-readable storage medium In matter, the program upon execution, including one or a combination set of the step of embodiment of the method.
In addition, each functional unit in each embodiment of the invention can be integrated in a processing module, can also That unit is individually physically present, can also two or more units be integrated in a module.Above-mentioned integrated mould Block can both be realized in the form of hardware, it would however also be possible to employ the form of software function module is realized.The integrated module is such as Fruit is realized using in the form of software function module and as independent production marketing or in use, can also be stored in a computer In read/write memory medium.
Storage medium mentioned above can be read-only storage, disk or CD etc..Although having been shown and retouching above Embodiments of the invention are stated, it is to be understood that above-described embodiment is exemplary, it is impossible to be interpreted as the limit to the present invention System, one of ordinary skill in the art can be changed to above-described embodiment, change, replace and become within the scope of the invention Type.

Claims (13)

1. a kind of method for updating program, it is characterised in that including:
After target program updates failure, the first bootstrap of restarting is returned;Wherein, first bootstrap is solidificated in In memory;The target program is application program or the second bootstrap;
Perform first bootstrap;
According to the more new logic in first bootstrap, the target program is updated again.
2. according to the method described in claim 1, it is characterised in that the renewal according in first bootstrap is patrolled Volume, the target program is updated again, including:
The more new logic mutually updated based on the application program and second bootstrap, updates the target journey again Sequence.
3. method according to claim 2, it is characterised in that also include:
The renewal is formed according to the application program in effective status with least one in second bootstrap to patrol Volume.
4. method according to claim 3, it is characterised in that described according to the application program and the second guiding journey The more new logic that sequence mutually updates, updates the target program again, including:
Judged whether to need to update the application program by first bootstrap;
The application program is updated if desired and when second bootstrap is effective, update the application program.
5. method according to claim 4, it is characterised in that also include:
The effective marker position of second bootstrap is read from the memory;
According to the effective marker of second bootstrap position, judge whether second bootstrap is effective.
6. method according to claim 4, it is characterised in that also include:
It is effective and second bootstrap needs to update in the application program if the application program need not be updated When, update second bootstrap.
7. method according to claim 6, it is characterised in that also include:
The effective marker position of the application program is read from the memory;
According to the effective marker of application program position, judge whether the application program is effective.
8. the method according to claim 4 or 5, it is characterised in that also include:
Renewal for one version of target program is, it is necessary to before to the version update for the first time, by the target The default value of the effective marker position of program is purged;
After to the once renewal of target program version failure, then according to the effective of the target program during next update Flag bit determines that the target program is in failure state.
9. the method according to claim any one of 1-6, it is characterised in that also include:
Storage region division is carried out to the memory in advance, multiple memory spaces are formed;
First bootstrap is solidificated in the first memory space;First memory space is the start bit that system starts Put;
The second memory space is chosen from remaining memory space, wherein, second memory space is used for storage configuration parameter; The configuration parameter includes the distribution information of the memory and the effective marker position of the target program;
The target program is deposited in the memory space in addition to first memory space and the second memory space.
10. method according to claim 9, it is characterised in that also include:
After the completion of renewal, the storage according to shared by the actual size of the target program adjusts the target program is empty Between.
11. method according to claim 8, it is characterised in that also include:
After the target program is updated successfully, the configuration parameter for being stored in second memory space is updated.
12. method according to claim 8, it is characterised in that also include:
When the target program is the application program, after the target program is updated successfully, renewal is stored in the storage Nominal data in device, wherein, the nominal data is key parameter values related to system when the application program is performed.
13. a kind of program renewing device, it is characterised in that including:
Memory, processor and storage are on a memory and the first bootstrap that can run on a processor, the processor Perform the method for updating program as described in any in claim 1-12.
CN201710166980.6A 2017-03-20 2017-03-20 Program updating method and device Active CN106990982B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710166980.6A CN106990982B (en) 2017-03-20 2017-03-20 Program updating method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710166980.6A CN106990982B (en) 2017-03-20 2017-03-20 Program updating method and device

Publications (2)

Publication Number Publication Date
CN106990982A true CN106990982A (en) 2017-07-28
CN106990982B CN106990982B (en) 2021-07-02

Family

ID=59412071

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710166980.6A Active CN106990982B (en) 2017-03-20 2017-03-20 Program updating method and device

Country Status (1)

Country Link
CN (1) CN106990982B (en)

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107608702A (en) * 2017-10-25 2018-01-19 迈普通信技术股份有限公司 Bootloader program modules update method and device
CN108055583A (en) * 2017-12-28 2018-05-18 深圳市九洲电器有限公司 set-top box automatic recovery method and system
CN108920196A (en) * 2018-06-28 2018-11-30 国机智骏(北京)汽车科技有限公司 Entire car controller bootload upgrade method, device, entire car controller and vehicle
DE102017119068A1 (en) * 2017-08-21 2019-02-21 Infineon Technologies Ag Update a memory
DE102017119065A1 (en) * 2017-08-21 2019-02-21 Infineon Technologies Ag Update a memory
CN109992312A (en) * 2019-03-26 2019-07-09 联想(北京)有限公司 The starting method, apparatus and system of electronic equipment
CN110096300A (en) * 2019-04-08 2019-08-06 上海赛治信息技术有限公司 A kind of fpga program file backup management system, operation method and upgrade method
CN110134411A (en) * 2019-05-20 2019-08-16 江苏华鹏智能仪表科技股份有限公司 A kind of self-identifying method for burn-recording suitable for ammeter RN8318 chip
CN110362327A (en) * 2019-07-12 2019-10-22 北京经纬恒润科技有限公司 Application program update method, apparatus and system
CN111443953A (en) * 2020-03-24 2020-07-24 烟台艾睿光电科技有限公司 Starting method, device and medium of infrared imaging system based on FPGA
CN112015456A (en) * 2019-05-31 2020-12-01 河南森源电动汽车有限公司 BootLoader program updating method
WO2023141832A1 (en) * 2022-01-26 2023-08-03 宁德时代新能源科技股份有限公司 Program updating method and program updating apparatus

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1567195A (en) * 2003-06-20 2005-01-19 华为技术有限公司 Method for implementing hot-update of bootstrap program in flush bonding system
US7313682B2 (en) * 2004-04-29 2007-12-25 Alcatel Lucent Method and system for updating boot memory that stores a fail-safe reset code and is configured to store boot code and boot updater code
US7376943B2 (en) * 2003-12-18 2008-05-20 Lsi Corporation Safe method for upgrading firmware of optical disk product
CN101895671A (en) * 2010-07-21 2010-11-24 深圳创维数字技术股份有限公司 Set top box Loader module updating method and set top box thereof
CN102486733A (en) * 2010-12-03 2012-06-06 中兴通讯股份有限公司 Method and device for upgrading boot program
CN104090796A (en) * 2014-07-08 2014-10-08 成都万维图新信息技术有限公司 Embedded device program updating method and system
CN104360877A (en) * 2014-10-24 2015-02-18 同济大学 ECU (electronic control unit) firmware updating method based on Bootloader self update
CN104572141A (en) * 2013-10-10 2015-04-29 上海信耀电子有限公司 Online updating method for guide program of vehicle electric control unit (ECU)
CN106250196A (en) * 2016-08-12 2016-12-21 上海金脉电子科技有限公司 The method updating vehicle-mounted boot loader by CAN communication

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1567195A (en) * 2003-06-20 2005-01-19 华为技术有限公司 Method for implementing hot-update of bootstrap program in flush bonding system
US7376943B2 (en) * 2003-12-18 2008-05-20 Lsi Corporation Safe method for upgrading firmware of optical disk product
US7313682B2 (en) * 2004-04-29 2007-12-25 Alcatel Lucent Method and system for updating boot memory that stores a fail-safe reset code and is configured to store boot code and boot updater code
CN101895671A (en) * 2010-07-21 2010-11-24 深圳创维数字技术股份有限公司 Set top box Loader module updating method and set top box thereof
CN102486733A (en) * 2010-12-03 2012-06-06 中兴通讯股份有限公司 Method and device for upgrading boot program
CN104572141A (en) * 2013-10-10 2015-04-29 上海信耀电子有限公司 Online updating method for guide program of vehicle electric control unit (ECU)
CN104090796A (en) * 2014-07-08 2014-10-08 成都万维图新信息技术有限公司 Embedded device program updating method and system
CN104360877A (en) * 2014-10-24 2015-02-18 同济大学 ECU (electronic control unit) firmware updating method based on Bootloader self update
CN106250196A (en) * 2016-08-12 2016-12-21 上海金脉电子科技有限公司 The method updating vehicle-mounted boot loader by CAN communication

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
李涛: "基于CAN总线的车载ECU刷新方法设计", 《安徽省机械工程学会第八次会员代表大会暨学会成立50周年庆典》 *

Cited By (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE102017119068B4 (en) * 2017-08-21 2020-12-10 Infineon Technologies Ag Update a store
US11314642B2 (en) 2017-08-21 2022-04-26 Infineon Technologies Ag Updating a memory
DE102017119068A1 (en) * 2017-08-21 2019-02-21 Infineon Technologies Ag Update a memory
DE102017119065A1 (en) * 2017-08-21 2019-02-21 Infineon Technologies Ag Update a memory
DE102017119065B4 (en) * 2017-08-21 2020-12-10 Infineon Technologies Ag Update a store
CN107608702A (en) * 2017-10-25 2018-01-19 迈普通信技术股份有限公司 Bootloader program modules update method and device
CN108055583B (en) * 2017-12-28 2020-08-07 深圳市九洲电器有限公司 Automatic recovery method and system for set top box
CN108055583A (en) * 2017-12-28 2018-05-18 深圳市九洲电器有限公司 set-top box automatic recovery method and system
CN108920196A (en) * 2018-06-28 2018-11-30 国机智骏(北京)汽车科技有限公司 Entire car controller bootload upgrade method, device, entire car controller and vehicle
CN109992312A (en) * 2019-03-26 2019-07-09 联想(北京)有限公司 The starting method, apparatus and system of electronic equipment
CN110096300A (en) * 2019-04-08 2019-08-06 上海赛治信息技术有限公司 A kind of fpga program file backup management system, operation method and upgrade method
CN110096300B (en) * 2019-04-08 2023-03-14 上海赛治信息技术有限公司 FPGA program file backup management system, operation method and upgrading method
CN110134411A (en) * 2019-05-20 2019-08-16 江苏华鹏智能仪表科技股份有限公司 A kind of self-identifying method for burn-recording suitable for ammeter RN8318 chip
CN112015456A (en) * 2019-05-31 2020-12-01 河南森源电动汽车有限公司 BootLoader program updating method
CN110362327A (en) * 2019-07-12 2019-10-22 北京经纬恒润科技有限公司 Application program update method, apparatus and system
CN110362327B (en) * 2019-07-12 2023-05-16 北京经纬恒润科技股份有限公司 Application program updating method, device and system
CN111443953B (en) * 2020-03-24 2023-08-01 烟台艾睿光电科技有限公司 Method, device and medium for starting infrared imaging system based on FPGA
CN111443953A (en) * 2020-03-24 2020-07-24 烟台艾睿光电科技有限公司 Starting method, device and medium of infrared imaging system based on FPGA
WO2023141832A1 (en) * 2022-01-26 2023-08-03 宁德时代新能源科技股份有限公司 Program updating method and program updating apparatus

Also Published As

Publication number Publication date
CN106990982B (en) 2021-07-02

Similar Documents

Publication Publication Date Title
CN106990982A (en) Method for updating program and device
US20190324858A1 (en) Rollback recovery from partial failure in multiple electronic control unit over-the-air updates
CN107402847A (en) A kind of remote upgrade method and system of entire car controller software
US20110029726A1 (en) Data updating method, memory system and memory device
CN107122133B (en) Data storage method and device
KR19990030334A (en) External storage and data processing methods
CN104951308B (en) The management optimization mode and device of Docker Registry
EP2704369B1 (en) Communication system in motor vehicle
CN104915226A (en) Network device software starting method, device and network device
CN103186390A (en) Home gateway and software upgrading method thereof
CN107678762A (en) A kind of system version upgrade method and device
CN111104148A (en) Upgrading method and system for chip platform integrated with Linux system and android system and readable storage medium
CN110457114B (en) Application cluster deployment method and device
CN107493190A (en) Node upgrade method and device
JP2013136358A (en) Vehicle control device and software part
US20220171611A1 (en) Electronic control unit, software update method, software update program product and electronic control system
CN109375953B (en) Operating system starting method and device
CN101178660A (en) Memory data automatic update method
CN114084202B (en) Train tail screening method, device and storage medium
CN108920196A (en) Entire car controller bootload upgrade method, device, entire car controller and vehicle
CN112306519A (en) Differential upgrading method and storage medium for HMI of instrument
JP5034866B2 (en) In-vehicle control device
JP6899978B2 (en) Alternative control device, alternative control method, alternative control program and fail operational system
CN109992449A (en) Backup image management system, method, equipment and medium
CN106547589A (en) A kind of upgrade-system and upgrade method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant