Embodiment
Exemplary embodiment of the present disclosure is described below with reference to accompanying drawings in more detail.Although shown exemplary embodiment of the present disclosure in accompanying drawing, yet should be appreciated that and to realize the disclosure and the embodiment that should do not set forth limits here with various forms.On the contrary, it is in order to understand the disclosure more thoroughly that these embodiment are provided, and can with the scope of the present disclosure complete convey to those skilled in the art.
The embodiment of the present invention provides a kind of backup method of driver, and as shown in Figure 1, the method comprises:
Step 101, when being backed up system's off-duty, load the registry file that this is backed up system, and obtain registration table key assignments path;
Wherein, this is backed up system and can be the Windows system;
This step 101 can comprise: load the described registry file path that is backed up system, load according to described registry file path the registry file that this is backed up system;
For convenience of description, hereinafter with " driver " referred to as " driving ";
Step 102, obtain the information of each equipment according to above-mentioned registration table key assignments path from the registration table that is backed up system, obtain the configuration file identification information that corresponding device drives from the information of above-mentioned each equipment;
In the present embodiment, the information of above-mentioned each equipment comprises: the device type of each equipment, equipment class and activation point etc.; This configuration file identification information can be profile name or other identification informations;
Step 103, resolve according to above-mentioned configuration file identification information the configuration file that corresponding device drives, obtain configuration information;
In the present embodiment, resolve according to above-mentioned configuration file identification information the configuration file that corresponding device drives, the step that obtains configuration information comprises: load the required configuration file of corresponding device driver is installed, described configuration file is carried out lexical analysis, obtain backup required fileinfo and bibliographic structure; Further, described configuration file is carried out lexical analysis, obtain backup required fileinfo and bibliographic structure, comprise: above-mentioned configuration file is carried out lexical analysis, obtain the adduction relationship that comprises mutually between adduction relationship between the joint that comprises in above-mentioned configuration file and above-mentioned configuration file, and the involved configuration file of recursion resolution, parse backup required fileinfo and bibliographic structure;
Step 104, complete the backup that corresponding device drives in this locality according to above-mentioned configuration information.
Set up catalogue according to the described bibliographic structure of configuration information, the file backup that above-mentioned fileinfo is corresponding is to above-mentioned catalogue.
In embodiments of the present invention, the main body of carrying out aforesaid operations is standby system, this standby system is another system different from the system that is backed up, and for example this standby system can be the linux system, also can be for being backed up different another Windows system of system from this.
The backup method of above-mentioned driver in the embodiment of the present invention, can use the system different from the system that is backed up to back up being backed up system, can be to because of the poisoning off-duty system that can not start or be inconvenient to start of the system failure or system, for example the system of shutdown backs up, make the user can use the file of backup to install after the refitting system and drive, and do not need to seek again the drive installation bag on the net; In addition, because backup procedure is supermatic, therefore exempted the requirement to subscriber computer knowledge.
The below is take video card as example, and the technical scheme of the embodiment of the present invention is described in detail:
In 360 first aid dishes, suppose that operated Windows is mapped to C dish (Linux simulated environment), need the backup video driver, as shown in Figure 2, this backup procedure comprises the following steps:
Step 201, obtain Windows system registry catalogue, obtain the registry file path;
Wherein, this registry file path can be C: Windows System32 config System;
Step 202, load registry file according to this registry file path, obtain registration table key assignments path;
Wherein, this registration table key assignments path can be set to: HKEY_LOCAL_MACHINE SYSTEM ControlSet001;
Step 203, search video card enumerating of this registration table key assignments path below (Enum) sub-key, find the position of depositing video card information;
Wherein, this position of depositing video card information can be set to: PCI VEN_10DE﹠amp; DEV_0600﹠amp; SUBSYS_050210DE﹠amp; REV_A2 4﹠amp; 22c1a2ee﹠amp; 0﹠amp; 0008; The information that can get video card equipment from the position of depositing video card is as follows:
Mainly comprise: device type, for example, the device type of this video card equipment is Display;
And, video card equipment class (ClassGUID), for example, the video card equipment class can be { 4d36e968-e325-11ce-bfc1-08002be10318};
Activation point, for example, in the present embodiment, activation point be 4d36e968-e325-11ce-bfc1-08002be10318} 0001;
Step 204, open registration table key assignments path according to activation point information, obtain the activation bit of video card, comprising the required inf configuration file of video driver is installed;
Particularly, { 4D36E968-E325-11CE-BFC1-08002BE10318} 0001 can obtain the activation bit of video card in this position can to open the Control Class of registration table such as upper/lower positions HKEY_LOCAL_MACHINE SYSTEM ControlSet001 with activation point information;
The inf configuration file that video driver is used is installed in step 205, loading, and this inf configuration file is carried out lexical analysis, obtains various cross reference information, obtains backup required fileinfo and bibliographic structure;
Wherein, various cross reference relations comprise the adduction relationship between the joint that comprises in the inf configuration file, and the below simply introduces the adduction relationship between inf configuration file and joint:
Structure for the inf configuration file is as follows:
Wherein:
A) the behavior explanatory notes that starts with branch;
B) take square bracket [] beginnings as a joint, be section name in square bracket, section name also might with " main section name. the chromaffin body name " the form appearance, simultaneously also may be with the architecture suffix;
The driver that can be used for multiple architecture operation system for same inf configuration file is installed, and institute thinks that the inf configuration file has designed the grammer that architecture is correlated with:
.NTx86 represent the computing machine based on intel x86;
.NTia64 represent the computing machine based on the intel Anthem;
.NTamd64 represent the computing machine based on AMD64 and Intel x86-64;
The for example MIPS of other kinds, Power etc. can not take in.
C) content of joint is with behavior unit, and its form is: key=key assignments.
1) do not have for the inf configuration file situation that comprises joint:
This inf configuration file is carried out lexical analysis, obtains various cross reference information, obtain backup required listed files and bibliographic structure, as shown in Figure 3, comprising:
Step 2051, know according to the activation bit of video card the section name that video driver uses is installed, search in the inf configuration file joint that should section name;
For example: the activation bit that obtains from registration table as can be known, it is Section011(InfSection that the section name that video driver uses is installed), search the joint that section name is Section011 in inf:
Step 2052, copy (CopyFiles) key at all to finding in should the joint of section name, resolve the joint that the duplicate key key-value pair is answered, obtain the filename list;
For example, for all take Section011 as section name or the joint of main section name, find the CopyFiles key, CopyFiles=nv_Drs_copyfiles below [Section011] is as example, need as can be known to continue to resolve the nv_Drs_copyfiles joint, the below searches the joint take nv_Drs_copyfiles as section name:
Carry out this step, the parsing of the filename of required file is complete, the configuration file list of file names;
Step 2053, search the joint of description document directory information, obtain bibliographic structure.
Search [SourceDisksFiles] joint, this joint is all filename and the position of described file in the drive installation bag in having described and having driven:
The supporting information of description document name (key) and this document in this joint (source position, relative catalogue of source position etc. relatively), in the present embodiment, need to further search source disk title [SourceDisksNames] joint:
[SourceDisksNames]
1=%DiskID1%
As from the foregoing, All Files all under the root directory of drive installation bag, does not have sub-directory.
2) have for the inf configuration file situation that comprises joint:
For the resolving that comprises joint is described, the below with another inf file as an illustration:
In this joint, the Include key has appearred, illustrate that this inf configuration file quoted another inf configuration file, name is called mshdc.inf in this example, and the section name of quoting is called pciide_Inst.
For this situation, need to analyze mshdc.inf, and analyze take pciide_Inst as section name or the joint of main section name, search relevant adduction relationship, file and bibliographic structure, above content is all backed up.
In addition, when resolving the inf configuration file, need to detect the modification to section name, when for example backing up the driving of Windows7x64 operating system, need to further search and carry the section name that .NTamd64 modifies, in order to avoid omit backup file.
Step 206, the file in the filename list is set up catalogue according to the bibliographic structure that parses.
Setting up the catalogue copied files according to the bibliographic structure that parses during backup gets final product.
So far, in 360 first aid dishes, the device drives of the Windows system that has realized under linux system that backup will be reset, and use afterwards the file of backup to install in refitting to drive, can guarantee that equipment is working properly.
This shows, this 360 first aid dish can back up driving before installation system, and after installation system, the driving of backup before Auto-mounting, make the user directly can obtain a brand-new available system.
The embodiment of the present invention also provides a kind of back-up device of driver, as shown in Figure 4, this device comprises acquisition module 41, acquisition of information module 42, parsing module 43 and backup module 44, wherein: acquisition module 41 is suitable for when being backed up system's off-duty, load the registry file that this is backed up system, and obtain registration table key assignments path; Acquisition of information module 42 is suitable for obtaining the information of each equipment according to described registration table key assignments path from the registration table that is backed up system, obtains the configuration file identification information of corresponding device driver from the information of described each equipment; Parsing module 43 is suitable for resolving according to described configuration file identification information the configuration file of corresponding device driver, obtains configuration information; Backup module 44 is suitable for completing in this locality according to described configuration information the backup of corresponding device driver.
Wherein, the above-mentioned system that is backed up is the Windows system; Above-mentioned acquisition module specifically is suitable for: load the described registry file path that is backed up system, load according to described registry file path the registry file that this is backed up system; The information of above-mentioned each equipment comprises: the device type of each equipment, equipment class and activation point etc.
Particularly, above-mentioned acquisition of information module can be obtained the configuration file identification information that corresponding device drives according to above-mentioned registration table key assignments path and above-mentioned activation point, and this configuration file identification information can be profile name.Above-mentioned parsing module can load installs the required configuration file of corresponding device driver, and described configuration file is carried out lexical analysis, obtains backup required fileinfo and bibliographic structure; Further, above-mentioned parsing module can carry out lexical analysis to above-mentioned configuration file, obtain the adduction relationship that comprises mutually between adduction relationship between the joint that comprises in above-mentioned configuration file and above-mentioned configuration file, and the involved configuration file of recursion resolution, parse backup required fileinfo and bibliographic structure.Above-mentioned backup module can be set up catalogue according to the above-mentioned bibliographic structure that above-mentioned parsing module parses, and the file backup that the above-mentioned fileinfo that above-mentioned parsing module is parsed is corresponding arrives above-mentioned catalogue.
The back-up device of above-mentioned driver, can the device drives of the off-duty system that can not start or be inconvenient to start be backed up, make the user can use the file of backup to install after the refitting system and drive, and do not need to seek again the drive installation bag on the net; In addition, because backup procedure is supermatic, therefore exempted the requirement to subscriber computer knowledge.
Intrinsic not relevant to any certain computer, virtual system or miscellaneous equipment with demonstration at this algorithm that provides.Various general-purpose systems also can with based on using together with this teaching.According to top description, it is apparent constructing the desired structure of this type systematic.In addition, the present invention is not also for any certain programmed language.Should be understood that and to utilize various programming languages to realize content of the present invention described here, and the top description that language-specific is done is in order to disclose preferred forms of the present invention.
In the instructions that provides herein, a large amount of details have been described.Yet, can understand, embodiments of the invention can be in the situation that do not have these details to put into practice.In some instances, be not shown specifically known method, structure and technology, so that not fuzzy understanding of this description.
Similarly, be to be understood that, in order to simplify the disclosure and to help to understand one or more in each inventive aspect, in the description to exemplary embodiment of the present invention, each feature of the present invention is grouped together in single embodiment, figure or the description to it sometimes in the above.Yet the method for the disclosure should be construed to the following intention of reflection: namely the present invention for required protection requires the more feature of feature clearly put down in writing than institute in each claim.Or rather, as following claims reflected, inventive aspect was to be less than all features of the disclosed single embodiment in front.Therefore, follow claims of embodiment and incorporate clearly thus this embodiment into, wherein each claim itself is as independent embodiment of the present invention.
Those skilled in the art are appreciated that and can adaptively change and they are arranged in one or more equipment different from this embodiment the module in the equipment in embodiment.Can be combined into a module or unit or assembly to the module in embodiment or unit or assembly, and can put them into a plurality of submodules or subelement or sub-component in addition.At least some in such feature and/or process or unit are mutually repelling, and can adopt any combination to disclosed all features in this instructions (comprising claim, summary and the accompanying drawing followed) and so all processes or the unit of disclosed any method or equipment make up.Unless clearly statement in addition, in this instructions (comprising claim, summary and the accompanying drawing followed), disclosed each feature can be by providing identical, being equal to or the alternative features of similar purpose replaces.
In addition, those skilled in the art can understand, although embodiment more described herein comprise some feature rather than further feature included in other embodiment, the combination of the feature of different embodiment mean be in scope of the present invention within and form different embodiment.For example, in the following claims, the one of any of embodiment required for protection can be used with array mode arbitrarily.
All parts embodiment of the present invention can realize with hardware, perhaps realizes with the software module of moving on one or more processor, and perhaps the combination with them realizes.It will be understood by those of skill in the art that and to use in practice microprocessor or digital signal processor (DSP) to realize according to some or all some or repertoire of parts in the back-up device of the embodiment of the present invention.The present invention can also be embodied as be used to part or all equipment or the device program (for example, computer program and computer program) of carrying out method as described herein.The program of the present invention that realizes like this can be stored on computer-readable medium, perhaps can have the form of one or more signal.Such signal can be downloaded from internet website and obtain, and perhaps provides on carrier signal, perhaps provides with any other form.
It should be noted above-described embodiment the present invention will be described rather than limit the invention, and those skilled in the art can design alternative embodiment in the situation that do not break away from the scope of claims.In the claims, any reference symbol between bracket should be configured to limitations on claims.Word " comprises " not to be got rid of existence and is not listed in element or step in claim.Being positioned at word " " before element or " one " does not get rid of and has a plurality of such elements.The present invention can realize by means of the hardware that includes some different elements and by means of the computing machine of suitably programming.In having enumerated the unit claim of some devices, several in these devices can be to come imbody by same hardware branch.The use of word first, second and C grade does not represent any order.Can be title with these word explanations.