[go: up one dir, main page]

CN109656602A - A kind of code upgrade method and electronic equipment - Google Patents

A kind of code upgrade method and electronic equipment Download PDF

Info

Publication number
CN109656602A
CN109656602A CN201910019454.6A CN201910019454A CN109656602A CN 109656602 A CN109656602 A CN 109656602A CN 201910019454 A CN201910019454 A CN 201910019454A CN 109656602 A CN109656602 A CN 109656602A
Authority
CN
China
Prior art keywords
code
backup region
original
default zone
upgrade
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201910019454.6A
Other languages
Chinese (zh)
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.)
Hefei Lianbao Information Technology Co Ltd
Original Assignee
Hefei Lianbao Information 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 Hefei Lianbao Information Technology Co Ltd filed Critical Hefei Lianbao Information Technology Co Ltd
Priority to CN201910019454.6A priority Critical patent/CN109656602A/en
Publication of CN109656602A publication Critical patent/CN109656602A/en
Pending legal-status Critical Current

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)
  • Stored Programmes (AREA)

Abstract

The embodiment of the present application provides a kind of code upgrade method and electronic equipment, which comprises checks in backup region whether there is code;According to testing result, it determines the mode for reading original code from default zone, reads the original code in a defined manner, wherein the backup region and the default zone are created when constructing basic input output system;The original code of reading is upgraded.By when constructing basic input output system, default zone and backup region are created that in the basic input output system, the upgrading to code can be realized and not upgrading to the basic input output system in turn, save time when upgrading basic input output system, and avoid passing through other problems brought by upgrading basic input output system, meanwhile technical solution disclosed in the present application itself does not need other hardware supporteds, it is easy to operate and there is high safety.

Description

A kind of code upgrade method and electronic equipment
Technical field
This application involves a kind of code upgrade method and electronic equipments.
Background technique
Currently, usually needing when the code in basic input output system (BIOS) needs to upgrade to basic input Output system is upgraded, that is, and code packet is compiled into basic input output system and generates new basic input output system, User needs to download the basic input output system of new version, then is realized by upgrading original basic input output system to original There is the upgrading of code.But adopt when upgrading with the aforedescribed process to code, it needs to have in basic input output system corresponding Original code, and substantially without original code in existing basic input output system, and then just can not realize the liter to code Grade;In addition, when being upgraded using the above method to code, it is also possible to can be produced to other functions of basic input output system It is raw to influence, it needs largely to be tested, and when upgrading above-mentioned code, it is also possible to influence making for corresponding terminal equipment With.
Summary of the invention
In view of the above-mentioned problems in the prior art, the application provides a kind of code upgrade method and electronic equipment.
A kind of code upgrade method provided by the present application, comprising:
Check in backup region whether there is code;
According to testing result, it determines the mode for reading original code from default zone, reads in a defined manner described primary Code, wherein the backup region and the default zone are created when constructing basic input output system;
The original code of reading is upgraded.
In some embodiments of the present application, it is described according to testing result, determine from default zone read original code side Formula reads the original code in a defined manner, comprising:
If detecting the code in the backup region, and it is not detected in the backup region and code liter is completed The mark of grade;
The code is loaded, and reads the original code from the default zone.
In some embodiments of the present application, after the original code that described pair is read upgrades, the method Further include:
Generate the mark that code upgrade is completed.
In some embodiments of the present application, it is described according to testing result, determine from default zone read original code side Formula, comprising:
If detecting the code in the backup region, and it is able to detect that in the backup region and code is completed The mark of upgrading;
By the code copies in the backup region to the default zone, and delete the number in the backup region According to;
The code is read from the default zone.
In some embodiments of the present application, it is described according to testing result, determine from default zone read original code side Formula, further includes:
If the code is not detected in the backup region;
The original code is then read from the default zone.
In some embodiments of the present application, after the original code that described pair is read upgrades, the method Further include:
Delete the mark that code upgrade is completed.
Present invention also provides a kind of electronic equipment, comprising:
It checks module, is used to check in backup region whether have code;
Processing module is used to according to testing result, the mode for reading original code from default zone is determined, with determining side Formula reads the original code, wherein the backup region and the default zone are created when constructing basic input output system It builds;
Upgraded module is used to upgrade the original code of reading.
In some embodiments of the present application, the processing module is specifically used for:
If detecting the code in the backup region, and it is not detected in the backup region and code liter is completed The mark of grade;
The code is loaded, and reads the original code from the default zone.
In some embodiments of the present application, the electronic equipment further include:
Generation module is used to generate the mark that code upgrade is completed.
In some embodiments of the present application, the processing module is specifically used for:
If detecting the code in the backup region, and it is able to detect that in the backup region and code is completed The mark of upgrading;
By the code copies in the backup region to the default zone, and delete the number in the backup region According to;
The code is read from the default zone.
Compared with prior art, the beneficial effects of the present application are as follows: by just existing when constructing basic input output system Be created that in the basic input output system default zone and backup region, and then can by not to it is described input substantially it is defeated System is upgraded and realizes the upgrading to code out, saves time when upgrading basic input output system, and avoid leading to Other problems brought by upgrading basic input output system are crossed, meanwhile, technical solution disclosed in the present application itself does not need it Its hardware supported, it is easy to operate and have high safety.
Detailed description of the invention
Fig. 1 is the flow chart of code upgrade method in the embodiment of the present application;
Fig. 2 is the flow diagram of code upgrade method in the embodiment of the present application;
Fig. 3 is the block diagram of electronic equipment in the embodiment of the present application.
Specific embodiment
To make those skilled in the art better understand the technical solution of the application, with reference to the accompanying drawing and specific embodiment party Formula elaborates to the application.
The various schemes and feature of the application are described herein with reference to attached drawing.
By the description of the preferred form with reference to the accompanying drawings to the embodiment for being given as non-limiting example, the application's These and other characteristic will become apparent.
It is also understood that although the application is described referring to some specific examples, those skilled in the art Member realizes many other equivalents of the application in which can determine, they have feature as claimed in claim and therefore all In the protection scope defined by whereby.
When read in conjunction with the accompanying drawings, in view of following detailed description, above and other aspect, the feature and advantage of the application will become It is more readily apparent.
The specific embodiment of the application is described hereinafter with reference to attached drawing;It will be appreciated, however, that the embodiment invented is only Various ways implementation can be used in the example of the application.Known and/or duplicate function and structure is simultaneously not described in detail with basis True intention is distinguished in the operation of the history of user, and unnecessary or extra details is avoided to make the application smudgy.Cause This, the specific structural and functional details invented herein are not intended to restriction, but as just the base of claim Plinth and representative basis are used to that those skilled in the art to be instructed diversely to use this Shen with substantially any appropriate detailed construction Please.
This specification can be used phrase " in one embodiment ", " in another embodiment ", " in another embodiment In " or " in other embodiments ", it can be referred to one or more of the identical or different embodiment according to the application.
The embodiment of the present application provides a kind of code upgrade method, comprising:
Check in backup region whether there is code;
According to testing result, it determines the mode for reading original code from default zone, reads in a defined manner described primary Code, wherein the backup region and the default zone are created when constructing basic input output system;
The original code of reading is upgraded.
Through the above method it is found that when constructing basic input output system, just in the basic input output system It is created that default zone and backup region, and then can be realized and not upgrading to the basic input output system pair The upgrading of code saves time when upgrading basic input output system, and avoids passing through upgrading basic input output system Brought other problems, meanwhile, technical solution disclosed in the present application itself does not need other hardware supporteds, it is easy to operate and With high safety.
In order to simpler, detailed understanding above-mentioned technical proposal, below with reference to embodiment and attached drawing to above-mentioned Command processing method is described in detail.
As depicted in figs. 1 and 2, Fig. 1 is the flow chart of code upgrade method provided by the embodiments of the present application, and Fig. 2 is this Shen Please embodiment provide code upgrade method flow diagram, above-mentioned code upgrade method, comprising:
Step 101: checking in backup region whether there is code.
Wherein, the code, which can be, can be read into and be able to carry out the generation for further upgrading or directly using Code can be the code being stored in the backup region, be also possible to be formed after upgrading the code in backup region Code or code is being carried out to be forced the code etc. when terminating in escalation process, details are not described herein.
Step 102: according to testing result, determining the mode for reading original code from default zone, read in a defined manner The original code, wherein the backup region and the default zone are created when constructing basic input output system.
Specifically, testing result may include being able to detect that the code in the backup region and having not been able to Detect two kinds of situations of the code.In the present embodiment, the original code can be in the building basic input and output system The code compiled when system is also possible to the code obtained from the backup region, such as by that will back up the code in region It is copied to the code formed in default zone, wherein what is copied from the backup region may include passing through in backup region The code in the new code or escalation process formed after upgrading is crossed (in the backup region when terminating other than such as escalation process In code).
In some embodiments of the present application, it is described according to testing result, determine from default zone read original code side Formula reads the original code in a defined manner, comprising: if detecting the code in the backup region, and described standby The mark that code upgrade is completed is not detected in region in part;The code is loaded, and is read from the default zone The original code.Specifically, after being able to detect that the code in determining the backup region, it is also necessary to judge the backup It whether is able to detect that the mark that code upgrade is completed in region, if being unable to detect that, shows the backup area at this time Code in domain can be due to being forced termination in escalation process and reside in backup region, at this point, to the backup area Code in domain is loaded, and on the one hand can be the concrete condition for determining the code in the backup region, on the other hand Can be understand it is described backup region in code have not been able to complete upgrading the reason of, and then again from the default zone again Original code is read, to complete upgrading to original code, at this point, the original code re-read from the default zone again can be with For the code different from the code in the backup region, wherein re-read from the default zone to described primary After code, the original code in the default zone can be deleted, and in the preferred embodiment of the application, from After re-reading the original code in the default zone, confirmation is also needed to carry out in the backup region to the original code Upgrading whether succeed, and carried out after detecting and successfully upgrading the original code, then to the original code in the default zone It deletes.
In some embodiments of the present application, after the original code that described pair is read upgrades, the method Further include: the mark that code upgrade is completed in generation specifically can be to the original re-read from the default zone After code completes upgrading, the mark that code upgrade is completed is being generated.In the preferred embodiment of the application, from institute It states after re-reading the original code in default zone, before deleting the original code in the default zone, also needs Confirm whether the upgrading carried out in the backup region to the original code succeeds, generation only is completed detect generation After the mark of code upgrading, just the original code in the default zone is deleted, and then guaranteeing can in the default zone Always it is stored with the original code that can be used.
In some embodiments of the present application, it is described according to testing result, determine from default zone read original code side Formula reads the original code in a defined manner, comprising: if detecting the code in the backup region, and described standby Part is able to detect that the mark that code upgrade is completed in region;The code copies in the backup region are write from memory to described Recognize region, and deletes the data in the backup region;The code is read from the default zone.Specifically, in determination After being able to detect that the code in the backup region, it is also necessary to judge whether to be able to detect that in the backup region complete At the mark of code upgrade, if being able to detect that, show that the code in the backup region at this time is to have been completed upgrading And the backup region is resided in, at this point, the code copies of upgrading have been completed to described in this in the backup region In default zone, to substitute original original code in the default zone, wherein original original code can in the default zone Be detect it is described the mark of code upgrade is completed when be deleted.And liter will be completed in the backup region After the code copies to the default zone of grade, then directly the data in the backup region are deleted, wherein described Data include at least the mark that code upgrade is completed and the code that upgrading has been completed, so that the backup region There can be enough spaces to upgrade again to other original codes.
In some embodiments of the present application, it is described according to testing result, determine from default zone read original code side Formula reads the original code in a defined manner, further includes: if the code is not detected in the backup region;Then from The original code is read in the default zone.Specifically, if not existing during being detected to the backup region The code is detected in the backup region, then shows to can be used for being upgraded there is no any in the backup region Code, at this point it is possible to first clear up the backup region, such as invalid data, the fragment file that will test carry out It deletes, to guarantee that the backup region has enough spaces, so that it is described primary being directly read from the default zone Code, to upgrade in the backup region to the original code.
Step 103: the original code of reading is upgraded.
In some embodiments of the present application, after the original code that described pair is read upgrades, the method Further include: delete the mark that code upgrade is completed.Specifically to the mark that code upgrade is completed in the backup region It is deleted, so that can not be examined in the backup region when detection again to the backup region The mark that code upgrade is completed accordingly is measured, and then guarantees being normally carried out for the code upgrade process.
Present invention also provides a kind of electronic equipment, as shown in Figure 3, comprising:
It checks module 1, is used to check in backup region whether have code;
Processing module 2 is used to according to testing result, the mode for reading original code from default zone is determined, with determining Mode reads the original code, wherein the backup region and the default zone are when constructing basic input output system Creation;
Upgraded module 3 is used to upgrade the original code of reading.
In some embodiments of the present application, the processing module is specifically used for: if detecting in the backup region The code, and the mark that code upgrade is completed is not detected in the backup region;The code is loaded, and from The default zone reads the original code.
In some embodiments of the present application, the electronic equipment further include: generation module is used for generation and generation is completed The mark of code upgrading.
In some embodiments of the present application, the processing module is specifically used for: if detecting in the backup region The code, and the mark that code upgrade is completed is able to detect that in the backup region;By the institute in the backup region Code copies are stated to the default zone, and delete the data in the backup region;Described in being read from the default zone Code.
In some embodiments of the present application, the processing module is specifically used for: if not detecting in the backup region To the code;The original code is then read from the default zone.
In some embodiments of the present application, the electronic equipment further include: removing module is used for deletion and generation is completed The mark of code upgrading.
The storage medium introduced by the present embodiment, electronic equipment are method institute that processing is instructed in the embodiment of the present application Corresponding storage medium, electronic equipment, so, based on command processing method in the embodiment of the present application, those skilled in the art The specific embodiment and its various change form of storage medium in the embodiment of the present application, electronic equipment can be understood, so The storage medium, electronic equipment are no longer discussed in detail herein.As long as technical staff described in this field implements the application implementation Storage medium, the electronic equipment of command processing method, belong to the range to be protected of the application in example.
It should be understood by those skilled in the art that, embodiments herein can provide as method, system or computer program Product.Therefore, complete hardware embodiment, complete software embodiment or reality combining software and hardware aspects can be used in the application Apply the form of example.Moreover, it wherein includes the computer of computer usable program code that the application, which can be used in one or more, The computer program implemented in usable storage medium (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.) produces The form of product.
The application is referring to method, the process of equipment (system) and computer program product according to the embodiment of the present application Figure and/or block diagram describe.It should be understood that every one stream in flowchart and/or the block diagram can be realized by computer program instructions The combination of process and/or box in journey and/or box and flowchart and/or the block diagram.It can provide these computer programs Instruct the processing module of general purpose computer, special purpose computer, Embedded Processor or other programmable data processing devices with A machine is generated, so that generating use by the instruction that the processing module of computer or other programmable data processing devices executes In the function that realization is specified in one box or multiple boxes of one process or multiple processes and/or block diagrams of flow chart Device.
These computer program instructions, which may also be stored in, is able to guide computer or other programmable data processing devices with spy Determine in the computer-readable memory that mode works, so that it includes referring to that instruction stored in the computer readable memory, which generates, The manufacture of device is enabled, which realizes in a side of one process or multiple processes and/or block diagrams of flow chart The function of being specified in frame or multiple boxes.
These computer program instructions can also be loaded into computer or other programmable data processing devices, so that counting Series of operation steps are executed on calculation machine or other programmable devices to generate computer implemented processing, thus in computer or The instruction executed on other programmable devices is provided for realizing in one process or multiple processes and/or block diagrams of flow chart One box or multiple boxes in specify function the step of.
Above embodiments are only the exemplary embodiment of the application, are not used in limitation the application, the protection scope of the application It is defined by the claims.Those skilled in the art can make respectively the application in the essence and protection scope of the application Kind modification or equivalent replacement, this modification or equivalent replacement also should be regarded as falling within the scope of protection of this application.

Claims (10)

1. a kind of code upgrade method characterized by comprising
Check in backup region whether there is code;
According to testing result, it determines the mode for reading original code from default zone, reads the original code in a defined manner, In, the backup region and the default zone are created when constructing basic input output system;
The original code of reading is upgraded.
2. code upgrade method according to claim 1, which is characterized in that it is described according to testing result, determine from default The mode of original code is read in region, reads the original code in a defined manner, comprising:
If detecting the code in the backup region, and it is not detected in the backup region and code upgrade is completed Mark;
The code is loaded, and reads the original code from the default zone.
3. code upgrade method according to claim 2, which is characterized in that carried out in the original code that described pair is read After upgrading, the method also includes:
Generate the mark that code upgrade is completed.
4. code upgrade method according to claim 1, which is characterized in that it is described according to testing result, determine from default The mode of original code is read in region, reads the original code in a defined manner, comprising:
If detecting the code in the backup region, and it is able to detect that in the backup region and code upgrade is completed Mark;
By the code copies in the backup region to the default zone, and delete the data in the backup region;
The code is read from the default zone.
5. code upgrade method according to claim 1, which is characterized in that it is described according to testing result, determine from default The mode of original code is read in region, reads the original code in a defined manner, further includes:
If the code is not detected in the backup region;
The original code is then read from the default zone.
6. code upgrade method according to claim 4 or 5, which is characterized in that in the original code that described pair is read After being upgraded, the method also includes:
Delete the mark that code upgrade is completed.
7. a kind of electronic equipment characterized by comprising
It checks module, is used to check in backup region whether have code;
Processing module is used to according to testing result, determine the mode for reading original code from default zone, read in a defined manner Take the original code, wherein the backup region and the default zone are created when constructing basic input output system;
Upgraded module is used to upgrade the original code of reading.
8. electronic equipment according to claim 7, which is characterized in that the processing module is specifically used for:
If detecting the code in the backup region, and it is not detected in the backup region and code upgrade is completed Mark;
The code is loaded, and reads the original code from the default zone.
9. electronic equipment according to claim 7, which is characterized in that further include:
Generation module is used to generate the mark that code upgrade is completed.
10. electronic equipment according to claim 7, which is characterized in that the processing module is specifically used for:
If detecting the code in the backup region, and it is able to detect that in the backup region and code upgrade is completed Mark;
By the code copies in the backup region to the default zone, and delete the data in the backup region;
The code is read from the default zone.
CN201910019454.6A 2019-01-09 2019-01-09 A kind of code upgrade method and electronic equipment Pending CN109656602A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910019454.6A CN109656602A (en) 2019-01-09 2019-01-09 A kind of code upgrade method and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910019454.6A CN109656602A (en) 2019-01-09 2019-01-09 A kind of code upgrade method and electronic equipment

Publications (1)

Publication Number Publication Date
CN109656602A true CN109656602A (en) 2019-04-19

Family

ID=66119271

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910019454.6A Pending CN109656602A (en) 2019-01-09 2019-01-09 A kind of code upgrade method and electronic equipment

Country Status (1)

Country Link
CN (1) CN109656602A (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020188886A1 (en) * 2000-01-07 2002-12-12 Xiaodong Liu Method and apparatus for backing up application code upon power failure during a code update
CN1725180A (en) * 2005-07-18 2006-01-25 杭州华为三康技术有限公司 Method and device for on-line upgrading of programmable logic device
CN102023908A (en) * 2010-12-03 2011-04-20 中兴通讯股份有限公司 Method and device for backing up boot program

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020188886A1 (en) * 2000-01-07 2002-12-12 Xiaodong Liu Method and apparatus for backing up application code upon power failure during a code update
CN1725180A (en) * 2005-07-18 2006-01-25 杭州华为三康技术有限公司 Method and device for on-line upgrading of programmable logic device
CN102023908A (en) * 2010-12-03 2011-04-20 中兴通讯股份有限公司 Method and device for backing up boot program

Similar Documents

Publication Publication Date Title
CN102422299B (en) Information device, method for preventing execution of unauthorized program code
CN102736978B (en) A kind of method and device detecting the installment state of application program
US8539593B2 (en) Extraction of code level security specification
CN110727597B (en) A method for troubleshooting invalid code completion use cases based on logs
US10817211B2 (en) Method for completing a secure erase operation
CA2816814A1 (en) Repairing corrupt software
JP2009238153A (en) Malware handling system, method, and program
CN104461641B (en) A kind of data programming method, system, burn writing equipment and target device
CN108197476B (en) A kind of vulnerability detection method and device for intelligent terminal equipment
WO2008056944A1 (en) Confirmation method of api by the information at call-stack
CN109522010B (en) Initialization code adding method and device, storage medium and electronic equipment
CN111124921A (en) Memory out-of-range detection method, device, equipment and storage medium
CN110659171A (en) Test method, electronic device and computer readable storage medium
US20140208297A1 (en) Validation of revised computer programs
KR102324950B1 (en) A method and apparatus for efficiently detecting a vulnerability in a memory of a heap area
JP2016062583A (en) File processing method and apparatus
CN108196975B (en) Data verification method and device based on multiple checksums and storage medium
KR101769714B1 (en) System and method for prventing the activation of bad usb
US11868465B2 (en) Binary image stack cookie protection
CN109918912A (en) A kind of Ile repair method and relevant device for computer virus
CN109656602A (en) A kind of code upgrade method and electronic equipment
KR101563494B1 (en) Real-time source code security weaknesses detection apparatus and method according to the file changes
CN116909823A (en) GPU pressure testing method and device, electronic equipment and storage medium
KR102425474B1 (en) BinTyper: Type confusion detection without source code
CN111625824A (en) IAST-based security test method and device, electronic device and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20190419