CN108845819B - Programme upgrade method and device for equipment - Google Patents

Programme upgrade method and device for equipment Download PDF

Info

Publication number
CN108845819B
CN108845819B CN201810909672.2A CN201810909672A CN108845819B CN 108845819 B CN108845819 B CN 108845819B CN 201810909672 A CN201810909672 A CN 201810909672A CN 108845819 B CN108845819 B CN 108845819B
Authority
CN
China
Prior art keywords
upgrade
area
equipment
mentioned
response
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810909672.2A
Other languages
Chinese (zh)
Other versions
CN108845819A (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 Baidu Netcom Science and Technology Co Ltd
Shanghai Xiaodu Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN201810909672.2A priority Critical patent/CN108845819B/en
Publication of CN108845819A publication Critical patent/CN108845819A/en
Application granted granted Critical
Publication of CN108845819B publication Critical patent/CN108845819B/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

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)
  • Stored Programmes (AREA)

Abstract

The embodiment of the present application discloses the programme upgrade method and device for equipment.One specific embodiment of this method includes: to store the upgrade information to data field in response to receiving the upgrade information for upgrading program to be upgraded from the server-side of communication connection, wherein the upgrade information includes the download path information of upgrade package;According to the download path information, upgrade package is downloaded from the server-side, which is written into main program area.The embodiment realizes the program upgrading to equipment.

Description

Programme upgrade method and device for equipment
Technical field
The invention relates to field of computer technology, and in particular to programme upgrade method and device for equipment.
Background technique
With the development of computer technology, the technology of updating apparatus is graduallyd mature, and the equipment for needing to be upgraded is also increasingly More, equipment uses flash memory as storage medium mostly.
Flash memory (flash memory) refers to the now most common semiconductor memory chip for powering off and not losing information, has The advantages of small in size, low in energy consumption, not vulnerable to physical damage is the ideal storage medium of mobile digital product.
Summary of the invention
The embodiment of the present application proposes the programme upgrade method and device for equipment.
In a first aspect, the embodiment of the present application provides a kind of programme upgrade method for equipment, above equipment includes depositing Storage media, above-mentioned storage medium include: for storing the bootstrap area of bootstrap, the main journey for storing program to be upgraded Sequence area, the upgrade procedure area for storing upgrade procedure and the data field for storing upgrade information, this method comprises: ringing Ying Yucong communication connection server-side receive the upgrade information for upgrading program to be upgraded, by above-mentioned upgrade information store to Above-mentioned data field, wherein above-mentioned upgrade information includes the download path information of upgrade package;According to above-mentioned download path information, from Above-mentioned server-side downloads upgrade package, and above-mentioned main program area is written in above-mentioned upgrade package.
In some embodiments, above-mentioned before downloading upgrade package from above-mentioned server-side according to above-mentioned download path information Method further include: set boot partition for above-mentioned upgrade procedure area, execute the operation of restarting above equipment;In response to upper Device power-up operation is stated, the upgrade procedure that above-mentioned upgrade procedure area prestores is executed, reads above-mentioned upgrade information from above-mentioned data field.
In some embodiments, above equipment includes caching;And according to above-mentioned download path information, from above-mentioned server-side Upgrade package is downloaded, above-mentioned main program area is written into above-mentioned upgrade package, comprising: it is preset to determine whether the capacity of above-mentioned caching is greater than Capacity threshold;It is greater than preset capacity threshold in response to the capacity of the above-mentioned caching of determination, according to above-mentioned download path information, from upper Stating the above-mentioned upgrade package of server-side downloading to above-mentioned caching will be above-mentioned slow in response to verifying successfully to the upgrade package in above-mentioned caching Above-mentioned main program area is written in upgrade package in depositing, in response to verifying successfully to the upgrade package in above-mentioned main program area, by above-mentioned master Program area is set as boot partition, executes the operation of restarting above equipment.
In some embodiments, the above method further include: be not more than preset appearance in response to the capacity of the above-mentioned caching of determination Threshold value is measured, according to above-mentioned download path information, above-mentioned main program area is written from above-mentioned server-side by above-mentioned upgrading bound edge downloading side, Upgrade package in above-mentioned main program area is verified, in response to verifying successfully, sets boot partition for above-mentioned main program area, Execute the operation of restarting above equipment.
In some embodiments, it stores by above-mentioned upgrade information to before above-mentioned data field, the above method further include: ring It should be switched on and run in above equipment, verify the program to be upgraded prestored in above-mentioned main program area;In response to it is above-mentioned prestore wait rise Grade program ver-ify success, executes the above-mentioned program to be upgraded prestored.
Second aspect, the embodiment of the present application provide a kind of program upgrade apparatus for equipment, which includes storage Medium, the storage medium include: for storing the bootstrap area of bootstrap, for storing program to be upgraded after subregion Main program area, the upgrade procedure area for storing upgrade procedure and the data field for storing upgrade information, it is above-mentioned to be used for The program upgrade apparatus of equipment includes: storage unit, is configured in response to be received from the server-side of communication connection for rising The upgrade information of grade program to be upgraded, above-mentioned upgrade information is stored to above-mentioned data field, wherein above-mentioned upgrade information includes rising The download path information of grade packet;Upgrade unit is configured to download and upgrade from above-mentioned server-side according to above-mentioned download path information Above-mentioned main program area is written in above-mentioned upgrade package by packet.
In some embodiments, above-mentioned apparatus further include: setting unit is configured to set above-mentioned upgrade procedure area to Boot partition executes the operation of restarting above equipment;Reading unit is configured in response to above equipment booting operation, The upgrade procedure that above-mentioned upgrade procedure area prestores is executed, reads above-mentioned upgrade information from above-mentioned data field.
In some embodiments, above equipment includes caching;And above-mentioned upgrade unit comprises determining that module, is configured Whether the capacity at the above-mentioned caching of determination is greater than preset capacity threshold;Writing module is downloaded, is configured in response to determine The capacity for stating caching is greater than preset capacity threshold, according to above-mentioned download path information, from above-mentioned server-side download upgrade package to In response to verifying successfully to the upgrade package in above-mentioned caching above-mentioned main journey is written in upgrade package in above-mentioned caching by above-mentioned caching Sequence area sets boot partition for above-mentioned main program area, executes in response to verifying successfully to the upgrade package in above-mentioned main program area Restart the operation of above equipment.
In some embodiments, above-mentioned downloading writing module is further configured to: in response to the appearance of the above-mentioned caching of determination Amount is not more than preset capacity threshold, according to above-mentioned download path information, downloads side from above-mentioned server-side by above-mentioned upgrading bound edge Above-mentioned main program area is written, the upgrade package in above-mentioned main program area is verified, in response to verifying successfully, by above-mentioned main program Area is set as boot partition, executes the operation of restarting above equipment.
In some embodiments, above-mentioned apparatus further include: verification unit is configured in response to above equipment booting fortune Row, verifies the program to be upgraded prestored in above-mentioned main program area;Execution unit is configured in response to verify above-mentioned main program area In prestore program to be upgraded success, execute the program to be upgraded that above-mentioned main program area prestores.
The third aspect, the embodiment of the present application provide a kind of equipment, comprising: one or more microcontrollers;Storage device, It is stored thereon with one or more programs;Storage medium, above-mentioned storage medium include: the bootstrap for storing bootstrap Area, the main program area for storing program to be upgraded, the upgrade procedure area for storing upgrade procedure and for store upgrading The data field of information;When one or more programs are executed by one or more microcontrollers, so that one or more microcontrollers It realizes such as the method for any embodiment in the programme upgrade method of equipment.
Fourth aspect, the embodiment of the present application provide a kind of computer-readable medium, are stored thereon with computer program, should It is realized when program is executed by microcontroller such as the method for any embodiment in the programme upgrade method of equipment.
Programme upgrade method and device provided by the embodiments of the present application for equipment, above equipment includes storage medium, Above-mentioned storage medium includes: for storing the bootstrap area of bootstrap, the main program area for storing program to be upgraded, using Upgrade procedure area in storage upgrade procedure and data field for storing upgrade information, this method comprises: in response to from logical The server-side of letter connection receives the upgrade information for upgrading program to be upgraded, and above-mentioned upgrade information is stored to above-mentioned data Area, wherein above-mentioned upgrade information includes the download path information of upgrade package;Then, according to above-mentioned download path information, from above-mentioned Server-side downloads upgrade package, later, above-mentioned main program area is written in above-mentioned upgrade package.So as to complete the program liter of equipment Grade enriches the program upgrading mode of equipment, takes full advantage of the space of storage medium.
Detailed description of the invention
By reading a detailed description of non-restrictive embodiments in the light of the attached drawings below, the application's is other Feature, objects and advantages will become more apparent upon:
Fig. 1 is that one embodiment of the application can be applied to exemplary system architecture figure therein;
Fig. 2 is the flow chart according to one embodiment of the programme upgrade method for equipment of the application;
Fig. 3 is a schematic diagram according to the application scenarios of the programme upgrade method for equipment of the embodiment of the present application;
Fig. 4 is the flow chart according to another embodiment of the programme upgrade method for equipment of the application;
Fig. 5 is the structural schematic diagram according to one embodiment of the program upgrade apparatus for equipment of the application;
Fig. 6 is adapted for the structural schematic diagram for the computer system for realizing the equipment of the embodiment of the present application.
Specific embodiment
The application is described in further detail with reference to the accompanying drawings and examples.It is understood that this place is retouched The specific embodiment stated is used only for explaining related invention, rather than the restriction to the invention.It also should be noted that in order to Convenient for description, part relevant to related invention is illustrated only in attached drawing.
It should be noted that in the absence of conflict, the features in the embodiments and the embodiments of the present application can phase Mutually combination.The application is described in detail below with reference to the accompanying drawings and in conjunction with the embodiments.
Fig. 1 is shown can the programme upgrade method for equipment using the embodiment of the present application or the program for equipment The exemplary system architecture 100 of update device.
As shown in Figure 1, system architecture 100 may include equipment 101,102,103, network 104 and server 105.Network 104 between equipment 101,102,103 and server 105 to provide the medium of communication link.Network 104 may include various Connection type, such as wired, wireless communication link or fiber optic cables etc..
Equipment 101,102,103 can be various electronic equipments, can be various smart home devices, including but not limited to Intelligent sound box, intelligent toy, intelligent refrigerator, smart television, smartwatch etc..
Various applications, such as the application of interactive voice class, intelligent answer class application can be installed in equipment 101,102,103 Deng.
Server 105 can be to provide the server of various services, such as carry out program upgrading to equipment 101,102,103 The background server of equal processing.Background server can send upgrade information and upgrade package to equipment 101,102,103, for setting Standby 101,102,103 program upgrades.
It should be noted that server 105 can be hardware, it is also possible to software.When server is hardware, Ke Yishi The distributed server cluster of ready-made multiple server compositions, also may be implemented into individual server.When server is software, Multiple softwares or software module (such as providing Distributed Services) may be implemented into, single software or soft also may be implemented into Part module.It is not specifically limited herein.
It should be noted that the embodiment of the present application provided by for equipment programme upgrade method generally by equipment 101, 102, it 103 executes, correspondingly, the program upgrade apparatus for equipment is generally positioned in equipment 101,102,103.
It should be understood that the number of equipment, network and server in Fig. 1 is only schematical.It, can according to needs are realized With any number of equipment, network and server.
With continued reference to Fig. 2, the stream of one embodiment of the programme upgrade method for equipment according to the application is shown Journey 200.This is used for the programme upgrade method of equipment, comprising the following steps:
It step 201, will in response to receiving the upgrade information for upgrading program to be upgraded from the server-side of communication connection Upgrade information is stored to data field.
In the present embodiment, the executing subject for the programme upgrade method of equipment includes storage medium, the storage medium After subregion, comprising: for storing the bootstrap area of bootstrap, the main program area for storing program to be upgraded, using Upgrade procedure area in storage upgrade procedure and data field for storing upgrade information.
In the present embodiment, above-mentioned executing subject (such as equipment shown in FIG. 1 101,102,103) can detecte whether It receives for upgrading program upgrade information to be upgraded.It is to be upgraded for upgrading in response to being received from the server-side of communication connection The upgrade information of program can store upgrade information to above-mentioned data field.Wherein, the upgrade information includes under upgrade package Carry routing information, such as URL (Uniform Resource Locator, uniform resource locator) etc..It can be real according to the URL The downloading of existing upgrade package.
In the present embodiment, the server-side of communication connection can be hardware (such as server 105 shown in FIG. 1), can also To be software.When the server-side of communication connection is hardware, the server for communication can be.
In the present embodiment, server-side includes the server for upgrading program to be upgraded, has in the server and is used for Upgrade the upgrade information and upgrade package of program to be upgraded.
It in the present embodiment, include the download path information of upgrade package in the upgrade information for upgrading program to be upgraded. Program to be upgraded is stored in the main program area in storage medium.Performance different function is stored in storage medium in different subregions Program.For example, bootstrap area is stored with the bootstrap with guiding function.It is stored in the main program area of storage medium It can be program to be upgraded.For example, the main program area in intelligent sound box is stored with the voice friendship that can play voice interactive function Mutual program.It include the program to be upgraded of new version in upgrade package.
In the present embodiment, the upgrade information received can be stored the data field into storage medium by executing subject, Due to the characteristic that there are storage medium power-off data not lose, data field is stored with upgrade information, and starting is held after a loss of power When row main body or executing subject under open state by restarting after, executing subject can also be from storage medium In data field read upgrade information.
Step 202, according to download path information, upgrade package is downloaded from server-side.
In the present embodiment, above-mentioned executing subject can be after obtaining download path information, foundation download path information, from Server-side downloads upgrade package.In the present embodiment, above-mentioned download path information can be a URL (Uniform Resource Locator, uniform resource locator) address includes the location information of upgrade package in a network in the above-mentioned address URL.It is above-mentioned to hold Row main body can know upgrade package in the storage location of server-side according to the address URL, then arrive storage location downloading upgrade package. Wherein, upgrade package is to meet the data of special communication protocol format, and above-mentioned special communication protocol can be hypertext transfer protocol (HyperText Transfer Protocol, HTTP), above-mentioned special communication protocol can also be File Transfer Protocol (File Transfer Protocol, FTP).
Step 203, main program area is written into upgrade package.
In the present embodiment, which is the upgrade package for upgrading program to be upgraded, and storage is written in upgrade package and is situated between The main program area of matter is realized and is updated to the program to be upgraded of main program area in storage medium.
With further reference to one that Fig. 3, Fig. 3 are according to the application scenarios of the programme upgrade method for equipment of the present embodiment A schematic diagram.In the application scenarios 300 of Fig. 3, firstly, the intelligent sound box 302 as equipment receives the transmission of server 301 Upgrade information, the upgrade information include the address URL.The address URL is stored the data field into flash memory by intelligent sound box 302.Later, Intelligent sound box downloads the interactive voice program of new edition according to the address URL from server 301.Finally, intelligent sound box 302 should Main program area in the interactive voice program write-in flash memory of new edition.Complete the upgrading to interactive voice program.
The method provided by the above embodiment of the application, in response to from the server-side of communication connection receive for upgrade to The upgrade information of upgrade procedure.Wherein, above-mentioned upgrade information includes the download path information of upgrade package.Above-mentioned upgrade information is deposited It stores up to above-mentioned data field.Then, according to above-mentioned download path information, upgrade package is downloaded from above-mentioned server-side.Later, by above-mentioned liter Above-mentioned main program area is written in grade packet.So as to complete the program upgrading of equipment, the program upgrading mode of equipment is enriched.At this It, can be by the main program subregion original place of the direct programming of program to be upgraded of new version to storage medium in the method that embodiment provides Location.It does not need in addition to occupy other subregions of storage medium to store upgrade package.Therefore program to be upgraded can be given, and there are more Space.The programme upgrade method for equipment in the present embodiment, which is enriched, upgrades mode to the program of equipment, since upgrading is believed It is smaller to cease the data field used, therefore saves the space of storage medium.
With further reference to Fig. 4, it illustrates the processes 400 of another embodiment of the programme upgrade method for equipment. This is used for the process 400 of the programme upgrade method of equipment, comprising the following steps:
Step 401, it is run in response to device power-up, verifies the program to be upgraded prestored in main program area.
In the present embodiment, executing subject can be various equipment (such as equipment shown in FIG. 1 101,102,103), In, which includes storage medium, the storage medium include: for store the bootstrap area of bootstrap, for store to The main program area of upgrade procedure, the upgrade procedure area for storing upgrade procedure and the data field for storing upgrade information.
In the present embodiment, above-mentioned executing subject can verify pre-stored wait rise in the main program area in storage medium Grade program.Include in program to be upgraded MD5 (Message Digest Algorithm MD5, Message Digest Algorithm 5) Code.Above-mentioned executing subject can verify the integrality of program to be upgraded by verifying the MD5 code in program to be upgraded.
Step 402, in response to verifying successfully, the program to be upgraded that main program area prestores is executed.
It step 403, will in response to receiving the upgrade information for upgrading program to be upgraded from the server-side of communication connection Upgrade information is stored to data field.
Step 404, according to download path information, upgrade package is downloaded from server-side.
Step 405, main program area is written into upgrade package.
In the present embodiment, the behaviour of the concrete operations of step 403-405 and step 201-203 in embodiment shown in Fig. 2 Make essentially identical, details are not described herein.
In some optional implementations of the present embodiment, according to above-mentioned download path information, from above-mentioned server-side Before downloading upgrade package, the above method further include: set boot partition for above-mentioned upgrade procedure area, it is above-mentioned to execute restarting The operation of equipment.It is switched on and runs in response to above equipment, execute the upgrade procedure that above-mentioned upgrade procedure area prestores.From above-mentioned data Read above-mentioned upgrade information in area.Wherein above-mentioned setting boot partition refers to setting start-up parameter, after restarting equipment, booting operation When, bootstrap can guide executing subject to enter specified subregion according to start-up parameter, execute and be stored in advance in the subregion Program.For example, setting boot partition for upgrade procedure area.Then, the operation of restarting above equipment is executed.When above-mentioned When device power-up is run, guidance executing subject enters upgrade procedure area, executes the upgrade procedure that upgrade procedure area prestores.
In some optional implementations of the present embodiment, according to above-mentioned download path information, under above-mentioned server-side Carry upgrade package.It include URL in download path information.The downloading of upgrade package may be implemented according to the URL.Above-mentioned upgrade package is written Above-mentioned main program area.Include: the capacity for calculating the caching in above equipment, it is preset to determine whether the capacity of above-mentioned caching is greater than Capacity threshold.It is greater than preset capacity threshold in response to the capacity of the above-mentioned caching of determination, downloads above-mentioned upgrade package to above-mentioned caching. In response to verifying successfully to the upgrade package in above-mentioned caching, above-mentioned main program area is written into the upgrade package in above-mentioned caching.Response It is verified successfully in the upgrade package in above-mentioned main program area, sets boot partition for above-mentioned main program area.Execute restarting The operation of above equipment.Wherein, preset capacity threshold is determined by calculating the size of upgrade package.Include in above-mentioned upgrade package MD5 code, above-mentioned executing subject can verify the integrality of upgrade package by the MD5 code in verification upgrade package.
In some optional implementations of the present embodiment, the above method can also include: above-mentioned slow in response to determination The capacity deposited is not more than preset capacity threshold, above-mentioned main program area is written in above-mentioned upgrading bound edge downloading side, to above-mentioned main journey Upgrade package in sequence area is verified, and in response to verifying successfully, sets boot partition for above-mentioned main program area, execution is opened again The operation of dynamic above equipment.Wherein, it is different from that complete upgrade package is written again after first downloading complete upgrade package to caching and leads Program area, the process being written in downloading refers to that the data packet that will acquire writes direct main program area, until writing entire liter Grade packet.After writing entire upgrade package, the integrality of the upgrade package in main program area is verified.The step of saving by caching, To complete the upgrading of program to be upgraded.
Figure 4, it is seen that the program for equipment in the present embodiment upgrades compared with the corresponding embodiment of Fig. 2 The process 400 of method highlights the verification step for treating upgrade procedure, because to journey to be upgraded before executing program to be upgraded Sequence is verified, and program to be upgraded is just executed when verifying successfully, improves the flexibility that program upgrades in equipment.
With further reference to Fig. 5, as the realization to method shown in above-mentioned each figure, this application provides a kind of for equipment One embodiment of program upgrade apparatus, the Installation practice is corresponding with embodiment of the method shown in Fig. 2, which specifically may be used To be applied in various equipment.
Above equipment includes storage medium, and above-mentioned storage medium includes: for storing the bootstrap area of bootstrap, using In the main program area of storage program to be upgraded, the upgrade procedure area for storing upgrade procedure and for storing upgrade information Data field, above-mentioned apparatus includes:
As shown in figure 5, the program upgrade apparatus 500 for equipment of the present embodiment includes storage medium, above-mentioned storage is situated between Matter includes: for storing the bootstrap area of bootstrap, the main program area for storing program to be upgraded, for storing upgrading The upgrade procedure area of program and data field for storing upgrade information, the above-mentioned program upgrade apparatus 500 for equipment wrap Include: storage unit 501 is configured in response to receive the upgrading for upgrading program to be upgraded from the server-side of communication connection Information stores above-mentioned upgrade information to above-mentioned data field, wherein above-mentioned upgrade information includes the download path letter of upgrade package Breath;Upgrade unit 502, is configured to according to above-mentioned download path information, upgrade package is downloaded from above-mentioned server-side, by above-mentioned upgrading Above-mentioned main program area is written in packet.
In some optional implementations of the present embodiment, above-mentioned apparatus can also include that setting unit (does not show in Fig. 5 Out) and reading unit (being not shown in Fig. 5), wherein setting unit may be configured to be set as opening by above-mentioned upgrade procedure area Dynamic subregion, executes the operation of restarting above equipment;Reading unit may be configured to be switched in response to above equipment and run, The upgrade procedure that above-mentioned upgrade procedure area prestores is executed, reads above-mentioned upgrade information from above-mentioned data field.
In some optional implementations of the present embodiment, above equipment may include caching;Above-mentioned upgrade unit can To include determining module (being not shown in Fig. 5) and downloading writing module (being not shown in Fig. 5), wherein determining module can be matched It is set to and determines whether the capacity of above-mentioned caching is greater than preset capacity threshold, it is preset to determine whether the capacity of above-mentioned caching is greater than Capacity threshold;Downloading writing module may be configured to be greater than preset capacity threshold in response to the capacity of the above-mentioned caching of determination, According to above-mentioned download path information, from above-mentioned server-side downloading upgrade package to above-mentioned caching, in response to the liter in above-mentioned caching Grade packet verifies successfully, above-mentioned main program area is written in the upgrade package in above-mentioned caching, in response to the liter in above-mentioned main program area Grade packet verifies successfully, sets boot partition for above-mentioned main program area, executes the operation of restarting above equipment.Above-mentioned upgrading Include MD5 code in packet, the integrality of upgrade package can be verified by the MD5 code in verification upgrade package.
In some optional implementations of the present embodiment, above-mentioned downloading writing module can be further configured to: It is not more than preset capacity threshold in response to the capacity of the above-mentioned caching of determination, above-mentioned main journey is written into above-mentioned upgrading bound edge downloading side Sequence area verifies the upgrade package in above-mentioned main program area, in response to verifying successfully, above-mentioned main program area is set as starting Subregion executes the operation of restarting above equipment.
In some optional implementations of the present embodiment, above-mentioned apparatus can also include that verification unit (is not shown in Fig. 5 Out) and execution unit (being not shown in Fig. 5), wherein verification unit is configured in response to above equipment booting operation, in verification State the program to be upgraded prestored in main program area;Execution unit be configured in response to verify prestored in above-mentioned main program area to Upgrade procedure success, executes the program to be upgraded that above-mentioned main program area prestores.It include MD5 in the above-mentioned program to be upgraded prestored Code can verify the integrality of the program to be upgraded prestored by verifying the MD5 code in the program to be upgraded prestored.
The device provided by the above embodiment of the application, storage unit 501 are configured in response to the clothes from communication connection Business termination receives the upgrade information for upgrading program to be upgraded, and above-mentioned upgrade information is stored to above-mentioned data field, wherein on State the download path information that upgrade information includes upgrade package;Upgrade unit 502 is configured to according to above-mentioned download path information, Upgrade package is downloaded from above-mentioned server-side, above-mentioned main program area is written into above-mentioned upgrade package.So as to realize the program liter of equipment Grade, takes full advantage of the space of storage medium, improves the flexibility of device upgrade.
Below with reference to Fig. 6, it illustrates the knots of the computer system 600 for the equipment for being suitable for being used to realize the embodiment of the present application Structure schematic diagram.Equipment shown in Fig. 6 is only an example, should not function to the embodiment of the present application and use scope bring and appoint What is limited.
As shown in fig. 6, computer system 600 includes microcontroller (Microcontroller Unit, MCU) 601, it can To be loaded into random access storage device according to the program being stored in read-only memory (ROM) 602 or from storage section 608 (RAM) program in 603 and execute various movements appropriate and processing.In RAM 603, also it is stored with system 600 and operates institute The various programs and data needed.MCU 601, ROM 602 and RAM 603 are connected with each other by bus 604.Input/output (I/ O) interface 605 is also connected to bus 604.
I/O interface 605 is connected to lower component: the storage section 606 including flash memory etc.;And including such as LAN card, tune The communications portion 607 of the network interface card of modulator-demodulator etc..Communications portion 607 executes mailing address via the network of such as internet Reason.Driver 608 is also connected to I/O interface 605 as needed.Detachable media 609, such as semiconductor memory etc., root According to needing to be mounted on driver 608, in order to be mounted into storage section as needed from the computer program read thereon 606。
Particularly, in accordance with an embodiment of the present disclosure, it may be implemented as computer above with reference to the process of flow chart description Software program.For example, embodiment of the disclosure includes a kind of computer program product comprising be carried on computer-readable medium On computer program, which includes the program code for method shown in execution flow chart.In such reality It applies in example, which can be downloaded and installed from network by communications portion 607, and/or from detachable media 609 are mounted.When the computer program is executed by microcontroller (MCU) 601, limited in execution the present processes above-mentioned Function.
It should be noted that the above-mentioned computer-readable medium of the application can be computer-readable signal media or meter Calculation machine readable storage medium storing program for executing either the two any combination.Computer readable storage medium for example can be --- but not Be limited to --- electricity, magnetic, optical, electromagnetic, infrared ray or semiconductor system, device or device, or any above combination.Meter The more specific example of calculation machine readable storage medium storing program for executing can include but is not limited to: have the electrical connection, just of one or more conducting wires Taking formula computer disk, hard disk, random access storage device (RAM), read-only memory (ROM), erasable type may be programmed read-only storage Device (EPROM or storage medium), optical fiber, portable compact disc read-only memory (CD-ROM), light storage device, magnetic memory Part or above-mentioned any appropriate combination.
In this application, computer readable storage medium can be any tangible medium for including or store program, the journey Sequence can be commanded execution system, device or device use or in connection.And in this application, it is computer-readable Signal media may include in a base band or as carrier wave a part propagate data-signal, wherein carrying computer can The program code of reading.The data-signal of this propagation can take various forms, including but not limited to electromagnetic signal, optical signal or Above-mentioned any appropriate combination.Computer-readable signal media can also be any other than computer readable storage medium Computer-readable medium, the computer-readable medium can send, propagate or transmit for by instruction execution system, device or Person's device uses or program in connection.The program code for including on computer-readable medium can be with any appropriate Medium transmission, including but not limited to: wireless, electric wire, optical cable, RF etc. or above-mentioned any appropriate combination.
Flow chart and block diagram in attached drawing are illustrated according to the system of the various embodiments of the application, method and computer journey The architecture, function and operation in the cards of sequence product.In this regard, each box in flowchart or block diagram can generation A part of one module, program segment or code of table, a part of the module, program segment or code include one or more use The executable instruction of the logic function as defined in realizing.It should also be noted that in some implementations as replacements, being marked in box The function of note can also occur in a different order than that indicated in the drawings.For example, two boxes succeedingly indicated are actually It can be basically executed in parallel, they can also be executed in the opposite order sometimes, and this depends on the function involved.Also it to infuse Meaning, the combination of each box in block diagram and or flow chart and the box in block diagram and or flow chart can be with holding The dedicated hardware based system of functions or operations as defined in row is realized, or can use specialized hardware and computer instruction Combination realize.
Being described in unit involved in the embodiment of the present application can be realized by way of software, can also be by hard The mode of part is realized.Described unit also can be set in the microcontroller, for example, can be described as: one kind is for setting Standby program upgrade apparatus includes storage unit and upgrade unit.Wherein, the title of these units not structure under certain conditions The restriction of the pairs of unit itself, for example, storage unit is also described as " storing upgrade information to the list of data field Member ".
As on the other hand, present invention also provides a kind of computer-readable medium, which be can be Included in equipment described in above-described embodiment;It is also possible to individualism, and without in the supplying equipment.Above-mentioned calculating Machine readable medium carries one or more program, when said one or multiple programs are executed by the equipment, so that should Equipment: in response to receiving the upgrade information for upgrading program to be upgraded from the server-side of communication connection, above-mentioned upgrading is believed Breath is stored to above-mentioned data field, wherein above-mentioned upgrade information includes the download path information of upgrade package;According to above-mentioned download path Information, downloads upgrade package from above-mentioned server-side, and above-mentioned main program area is written in above-mentioned upgrade package.
Above description is only the preferred embodiment of the application and the explanation to institute's application technology principle.Those skilled in the art Member is it should be appreciated that invention scope involved in the application, however it is not limited to technology made of the specific combination of above-mentioned technical characteristic Scheme, while should also cover in the case where not departing from foregoing invention design, it is carried out by above-mentioned technical characteristic or its equivalent feature Any combination and the other technical solutions formed.Such as features described above has similar function with (but being not limited to) disclosed herein Can technical characteristic replaced mutually and the technical solution that is formed.

Claims (10)

1. a kind of programme upgrade method for equipment, wherein the equipment includes storage medium, and the storage medium includes: For storing the bootstrap area of bootstrap, the main program area for storing program to be upgraded, for storing upgrade procedure Upgrade procedure area and data field for storing upgrade information, which comprises
In response to receiving the upgrade information for upgrading program to be upgraded from the server-side of communication connection, by the upgrade information It stores to the data field, wherein the upgrade information includes the download path information of upgrade package;
According to the download path information, upgrade package is downloaded from the server-side, the main program area is written into the upgrade package;
Wherein, the equipment includes caching;And
It is described that upgrade package is downloaded from the server-side according to the download path information, the main journey is written into the upgrade package Sequence area, comprising:
Determine whether the capacity of the caching is greater than preset capacity threshold;
It is greater than preset capacity threshold in response to the capacity of the determination caching, according to the download path information, from the clothes Being engaged in the end downloading upgrade package to the caching will be in the caching in response to verifying successfully to the upgrade package in the caching Upgrade package the main program area is written, in response to being verified successfully to the upgrade package in the main program area, by the main program Area is set as boot partition, executes the operation for restarting the equipment.
2. according to the method described in claim 1, wherein, described according to the download path information, under the server-side Before carrying upgrade package, the method also includes:
Boot partition is set by the upgrade procedure area, executes the operation for restarting the equipment;
It is run in response to the device power-up, executes the upgrade procedure that the upgrade procedure area prestores, read from the data field The upgrade information.
3. method described in one of -2 according to claim 1, the method also includes:
It is not more than preset capacity threshold in response to the capacity of the determination caching, according to the download path information, from described The main program area is written in upgrading bound edge downloading side by server-side, is verified to the upgrade package in the main program area, In response to verifying successfully, boot partition is set by the main program area, executes the operation for restarting the equipment.
4. according to the method described in claim 1, wherein, the upgrade information is stored to before the data field described, The method also includes:
It is run in response to the device power-up, verifies the program to be upgraded prestored in the main program area;
Successful, the program to be upgraded prestored described in execution in response to the program ver-ify to be upgraded prestored.
5. a kind of program upgrade apparatus for equipment, wherein the equipment includes storage medium, and the storage medium includes: For storing the bootstrap area of bootstrap, the main program area for storing program to be upgraded, for storing upgrade procedure Upgrade procedure area and data field for storing upgrade information, described device include:
Storage unit is configured in response to receive the upgrading letter for upgrading program to be upgraded from the server-side of communication connection Breath, the upgrade information is stored to the data field, wherein the upgrade information includes the download path information of upgrade package;
Upgrade unit, is configured to according to the download path information, upgrade package is downloaded from the server-side, by the upgrade package The main program area is written;
Wherein, the equipment includes caching;And
The upgrade unit includes:
Whether determining module, the capacity for being configured to determine the caching are greater than preset capacity threshold;
Writing module is downloaded, is configured in response to determine that the capacity of the caching is greater than preset capacity threshold, according to described Download path information downloads upgrade package to the caching, in response to verifying to the upgrade package in the caching from the server-side The main program area is written in upgrade package in the caching by success, in response to verifying to the upgrade package in the main program area Success sets boot partition for the main program area, executes the operation for restarting the equipment.
6. device according to claim 5, wherein described device further include:
Setting unit is configured to set the upgrade procedure area to boot partition, executes the behaviour for restarting the equipment Make;
Reading unit is configured in response to the device power-up operation, executes the upgrade procedure that the upgrade procedure area prestores, The upgrade information is read from the data field.
7. the device according to one of claim 5-6, wherein the downloading writing module is further configured to:
It is not more than preset capacity threshold in response to the capacity of the determination caching, according to the download path information, from described The main program area is written in upgrading bound edge downloading side by server-side, is verified to the upgrade package in the main program area, In response to verifying successfully, boot partition is set by the main program area, executes the operation for restarting the equipment.
8. device according to claim 5, wherein described device further include:
Verification unit is configured in response to the device power-up operation, verifies the journey to be upgraded prestored in the main program area Sequence;
Execution unit is configured in response to verify the program to be upgraded success prestored in the main program area, executes the master The program to be upgraded that program area prestores.
9. a kind of electronic equipment, comprising:
One or more microcontrollers;
Storage device is stored thereon with one or more programs;
Storage medium, the storage medium include: for storing the bootstrap area of bootstrap, for storing program to be upgraded Main program area, the upgrade procedure area for storing upgrade procedure and the data field for storing upgrade information;
When one or more of programs are executed by one or more of microcontrollers, so that one or more of microcontrollers Device realizes the method as described in any in claim 1-4.
10. a kind of computer-readable medium, is stored thereon with computer program, wherein real when the program is executed by microcontroller The now method as described in any in claim 1-4.
CN201810909672.2A 2018-08-10 2018-08-10 Programme upgrade method and device for equipment Active CN108845819B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810909672.2A CN108845819B (en) 2018-08-10 2018-08-10 Programme upgrade method and device for equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810909672.2A CN108845819B (en) 2018-08-10 2018-08-10 Programme upgrade method and device for equipment

Publications (2)

Publication Number Publication Date
CN108845819A CN108845819A (en) 2018-11-20
CN108845819B true CN108845819B (en) 2019-10-18

Family

ID=64192906

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810909672.2A Active CN108845819B (en) 2018-08-10 2018-08-10 Programme upgrade method and device for equipment

Country Status (1)

Country Link
CN (1) CN108845819B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111190627A (en) * 2019-12-30 2020-05-22 四川虹美智能科技有限公司 System upgrading method and device
CN113360176B (en) * 2020-03-06 2023-08-25 浙江宇视科技有限公司 Upgrading method and device of software program, storage medium and electronic equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104915234A (en) * 2015-06-10 2015-09-16 Tcl集团股份有限公司 Android mobile terminal upgrade reported method and system
CN105260205A (en) * 2015-09-30 2016-01-20 中山市天启电子科技有限公司 Method for implementing startup of double operating systems on embedded board
CN106293782A (en) * 2015-05-15 2017-01-04 中兴通讯股份有限公司 A kind of method for upgrading system and terminal
CN107239302A (en) * 2017-05-10 2017-10-10 努比亚技术有限公司 A kind of firmware upgrade method, terminal and server
CN108196870A (en) * 2017-12-29 2018-06-22 北京臻迪科技股份有限公司 Upgrade method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106293782A (en) * 2015-05-15 2017-01-04 中兴通讯股份有限公司 A kind of method for upgrading system and terminal
CN104915234A (en) * 2015-06-10 2015-09-16 Tcl集团股份有限公司 Android mobile terminal upgrade reported method and system
CN105260205A (en) * 2015-09-30 2016-01-20 中山市天启电子科技有限公司 Method for implementing startup of double operating systems on embedded board
CN107239302A (en) * 2017-05-10 2017-10-10 努比亚技术有限公司 A kind of firmware upgrade method, terminal and server
CN108196870A (en) * 2017-12-29 2018-06-22 北京臻迪科技股份有限公司 Upgrade method and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
"Android FOTA升级流程";Jason_Wang;《https://blog.csdn.net/jason_wzn/article/details/52239085》;20160818;第1页 *

Also Published As

Publication number Publication date
CN108845819A (en) 2018-11-20

Similar Documents

Publication Publication Date Title
CN108845819B (en) Programme upgrade method and device for equipment
CN106843976B (en) Method and apparatus for generating image file
CN110009362A (en) Block chain intelligence contract amending method, device and computer readable storage medium
CN107547629A (en) Method, apparatus, electronic equipment and the computer-readable recording medium that client static resource is downloaded
CN109800008A (en) Configure update method and Related product
CN109032796A (en) A kind of data processing method and device
CN112328293A (en) Differential upgrading method of embedded equipment and related components
CN102523295B (en) Plug-in registration method and system thereof
CN114124917A (en) Remote upgrading method, equipment, system and medium for ground lock firmware
CN111818194A (en) Domain name based access system and method
CN109408090A (en) Upgrade method, data converter and the readable storage medium storing program for executing of device software
CN104780058A (en) Electronic equipment configuration method and system
CN106502717A (en) application program operation method and device
CN108572848A (en) The bottom firmware on line upgrading method, apparatus and storage medium of interactive system
CN108052377A (en) Input processing method based on cloud, device, server and storage medium
CN108228197A (en) A kind of method and apparatus for installing software in the cluster
CN109918381A (en) Method and apparatus for storing data
CN109683992A (en) Method and apparatus for managing object
CN109298889A (en) A kind of method, startup advertisement update method and terminal device generating bootstrap
CN109617713A (en) The implementation method and server of resource dissemination
CN109358872A (en) Remote firmware updating method, device and computer readable storage medium
CN108334360A (en) Method, apparatus, storage medium and the computer equipment of application program dynamic load
CN109343880A (en) RN packet updating method, RN packet updating device and readable storage medium
CN109918142A (en) A kind of software restarting method, apparatus, terminal and storage medium
CN103581267A (en) Method and device for directionally caching data of mobile terminal system

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
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20210511

Address after: 100085 Baidu Building, 10 Shangdi Tenth Street, Haidian District, Beijing

Patentee after: BEIJING BAIDU NETCOM SCIENCE AND TECHNOLOGY Co.,Ltd.

Patentee after: Shanghai Xiaodu Technology Co.,Ltd.

Address before: 100085 Baidu Building, 10 Shangdi Tenth Street, Haidian District, Beijing

Patentee before: BEIJING BAIDU NETCOM SCIENCE AND TECHNOLOGY Co.,Ltd.