CN108647053A - The De-weight method and device of registration table sub-key - Google Patents

The De-weight method and device of registration table sub-key Download PDF

Info

Publication number
CN108647053A
CN108647053A CN201810408910.1A CN201810408910A CN108647053A CN 108647053 A CN108647053 A CN 108647053A CN 201810408910 A CN201810408910 A CN 201810408910A CN 108647053 A CN108647053 A CN 108647053A
Authority
CN
China
Prior art keywords
sub
key
registration table
path
table path
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201810408910.1A
Other languages
Chinese (zh)
Other versions
CN108647053B (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.)
New H3C Cloud Technologies Co Ltd
Original Assignee
New H3C Cloud Technologies 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 New H3C Cloud Technologies Co Ltd filed Critical New H3C Cloud Technologies Co Ltd
Priority to CN201810408910.1A priority Critical patent/CN108647053B/en
Publication of CN108647053A publication Critical patent/CN108647053A/en
Application granted granted Critical
Publication of CN108647053B publication Critical patent/CN108647053B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation

Abstract

The present invention provides a kind of De-weight method and device of registration table sub-key, the method includes:Obtain the total quantity of sub-key in former registration table path and registration table path to be combined;According to the sequence of the sub-key index built based on total quantity, the sub-key in former registration table path and registration table path to be combined is traversed, find out that sub-key title in registration table path to be combined is not located in former registration table path all does not repeat sub-key;All not iteron keys in registration table path to be combined are merged into the former registration table path.Reaching can compare to find out in path to be combined and former registration table path by way of being combined and not repeat sub-key indexing traversal and title, and all not iteron keys in registration table path to be combined are merged into the former registration table path, method is simple and convenient, and then convenient for improving the technique effect for the efficiency for repeating sub-key in removal registration table path.

Description

The De-weight method and device of registration table sub-key
Technical field
The present invention relates to field of computer technology, more particularly, to a kind of De-weight method and device of registration table sub-key.
Background technology
Software distribution can assist in administrator and issue software and automatic software installation in several terminals of user group.Example Such as:Certain enterprise needs uniformly to install office software to a collection of terminal, and at this moment, system manager can be by way of software distribution Office software is installed in each terminal.
In software distribution process, software is installed on a station terminal, when software is distributed in other terminals, due to other The remaining registration table of the software is might have in terminal in itself, so needing the pooling function for using registration table to repeat sub-key.
Registration table filter drive program needs to create context session, and duplicate removal and the conjunction of sub-key are realized by context session And however, this mode needs to safeguard the session management mechanism of registration table, such as establishment, management and the deletion process of session, dimension Shield get up it is sufficiently complex it is cumbersome, efficiency is low.
Invention content
In order to solve the above technical problems, the purpose of the present invention is to provide a kind of De-weight methods and dress of registration table sub-key It sets.
In a first aspect, an embodiment of the present invention provides a kind of De-weight method of registration table sub-key, the method includes:
Obtain the total quantity of sub-key in former registration table path and registration table path to be combined;
According to the sequence of the sub-key index built based on the total quantity, to the former registration table path and described to be combined Sub-key in registration table path is traversed, and is found out sub-key title in the registration table path to be combined and is not located at the original annotation All in volume table path do not repeat sub-key;
All not iteron keys in registration table path to be combined are merged into the former registration table path.
With reference to first aspect, an embodiment of the present invention provides the first possible embodiments of first aspect, wherein institute The sequence according to the sub-key index built based on the total quantity is stated, to the former registration table path and the registration table to be combined Sub-key in path is traversed, and is found out sub-key title in the registration table path to be combined and is not located at the former registration table road In diameter it is all not repeat sub-key, including:
If being less than or equal to first of sub-key in the former registration table path by the sub-key quantity of sub-key index traversal Quantity then directly returns to sub-key and indexes corresponding sub-key title;
If being more than the first quantity of sub-key in the former registration table path by the sub-key quantity of sub-key index traversal, according to The difference of the sub-key index value and first quantity determines the merging path indexing in the registration table path to be combined, institute It states merging path indexing and does not repeat sub-key for indexing in the registration table path to be combined;
Lookup is corresponding with the merging path indexing in the registration table path to be combined does not repeat sub-key.
With reference to first aspect, an embodiment of the present invention provides second of possible embodiments of first aspect, wherein institute State in the registration table path to be combined search it is corresponding with the merging path indexing not repeatedly sub-key, including:
According to the sequence that the sub-key indexes, sub-key is traversed one by one in the registration table path to be combined, finds institute State the sub-key title of sub-key;
Judge whether the sub-key title is all different with whole sub-key titles in the former registration table path;
If the sub-key title is all different with whole sub-key titles in the former registration table path, determination finds one It is corresponding with the merging path indexing not repeat sub-key.
With reference to first aspect, an embodiment of the present invention provides the third possible embodiments of first aspect, wherein institute State in the registration table path to be combined search it is corresponding with the merging path indexing not repeatedly sub-key, further include:
If the sub-key title is identical as any sub-key title in the former registration table path, determine described to be combined A sub- key name is traversed in registration table path claims the repetition sub-key being located in the former registration table path.
With reference to first aspect, an embodiment of the present invention provides the 4th kind of possible embodiments of first aspect, wherein It obtains in former registration table path and registration table path to be combined before the total quantity of sub-key, the method further includes:
Receive the configuration information of distribution software;
It determines the quantity of sub-key in local registration table path to be combined, and the original annotation is determined according to the configuration information The quantity of sub-key in volume table path;
After all not iteron keys in registration table path to be combined being merged into the former registration table path, institute The method of stating further includes:
The configuration information is updated according to the sub-key in the former registration table path.
Second aspect, the embodiment of the present invention also provide a kind of duplicate removal device of registration table sub-key, and described device includes:
Quantity acquisition module, for obtaining the total of sub-key in the former registration table path and the registration table path to be combined Quantity;
Sub-key spider module, for the sequence according to the sub-key index built based on the total quantity, to the original annotation volume Sub-key in table path and the registration table path to be combined is traversed, and sub-key in the registration table path to be combined is found out What title was not located in the former registration table path all does not repeat sub-key;
All not iteron keys in registration table path to be combined are merged into the former registration table path by merging module In.
In conjunction with second aspect, an embodiment of the present invention provides the first possible embodiments of second aspect, wherein institute Sub-key spider module is stated, including:
First Traversal Unit, if for being less than or equal to the former registration table by the sub-key quantity of sub-key index traversal First quantity of sub-key in path then directly returns to sub-key and indexes corresponding sub-key title;
Second Traversal Unit, for being more than former registration table path neutron in the sub-key quantity by sub-key index traversal When the first quantity of key, determined in the registration table path to be combined according to the difference of the sub-key index value and first quantity In merging path indexing, it is described merge path indexing be used for index in the registration table path to be combined not repeat sub-key;
Searching unit corresponding with the merging path indexing is not weighed for being searched in the registration table path to be combined Multiple sub-key.
In conjunction with second aspect, an embodiment of the present invention provides second of possible embodiments of second aspect, wherein institute Searching unit is stated to be additionally operable to:
According to the sequence that the sub-key indexes, sub-key is traversed one by one in the registration table path to be combined, finds institute State the sub-key title of sub-key;
Judge whether the sub-key title is all different with whole sub-key titles in the former registration table path;
If the sub-key title is all different with whole sub-key titles in the former registration table path, determination finds one It is corresponding with the merging path indexing not repeat sub-key.
In conjunction with second aspect, an embodiment of the present invention provides the third possible embodiments of second aspect, wherein institute Searching unit is stated, is additionally operable to:
If the sub-key title is identical as any sub-key title in the former registration table path, determine described to be combined A sub- key name is traversed in registration table path claims the repetition sub-key being located in the former registration table path.
In conjunction with second aspect, an embodiment of the present invention provides the 4th kind of possible embodiments of second aspect, wherein Before first Traversal Unit, described device further includes:
Receiving module, the configuration information for receiving distribution software;
Determining module, the quantity for determining sub-key in local registration table path to be combined, and match confidence according to described Breath determines the quantity of sub-key in the former registration table path;
After the searching unit, described device further includes:
Update module, for updating the configuration information according to the sub-key in the former registration table path.
The third aspect, the embodiment of the present invention also provide a kind of electronic equipment, including memory, processor, the memory In be stored with the computer program that can be run on the processor, the processor is realized when executing the computer program The step of stating the method described in first aspect.
Fourth aspect, the embodiment of the present invention also provide a kind of meter for the non-volatile program code that can perform with processor Calculation machine readable medium, said program code make the processor execute described first aspect the method.
The embodiment of the present invention brings following advantageous effect:The embodiment of the present invention first by obtain former registration table path and The total quantity of sub-key in registration table path to be combined is right then according to the sequence of the sub-key index built based on the total quantity Sub-key in the original registration table path and the registration table path to be combined is traversed, and the registration table to be combined is found out In path sub-key title be not located in the former registration table path it is all do not repeat sub-key, finally can be by registration table to be combined All not iteron keys in path are merged into the former registration table path.
The embodiment of the present invention can compare by way of being combined indexing traversal and title and find out path to be combined Sub-key is not repeated with former registration table path, and all not iteron keys in registration table path to be combined are merged into described In former registration table path, the complex operations for safeguarding the processes such as the establishment of session, management and deletion are avoided, method is simple and convenient, into And convenient for improving the efficiency for repeating sub-key in removal registration table path.
Other features and advantages of the present invention will illustrate in the following description, also, partly become from specification It obtains it is clear that understand through the implementation of the invention.The purpose of the present invention and other advantages are in specification, claims And specifically noted structure is realized and is obtained in attached drawing.
To enable the above objects, features and advantages of the present invention to be clearer and more comprehensible, preferred embodiment cited below particularly, and coordinate Appended attached drawing, is described in detail below.
Description of the drawings
It, below will be to specific in order to illustrate more clearly of the specific embodiment of the invention or technical solution in the prior art Embodiment or attached drawing needed to be used in the description of the prior art are briefly described, it should be apparent that, in being described below Attached drawing is some embodiments of the present invention, for those of ordinary skill in the art, before not making the creative labor It puts, other drawings may also be obtained based on these drawings.
Fig. 1 is a kind of flow chart of the De-weight method of registration table sub-key provided in an embodiment of the present invention;
Fig. 2 is the flow chart of step S102 in Fig. 1;
Fig. 3 is a kind of structure chart of the duplicate removal device of registration table sub-key provided in an embodiment of the present invention;
Fig. 4 is the structure chart of sub-key spider module 12 in Fig. 3.
Specific implementation mode
In order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below in conjunction with attached drawing to the present invention Technical solution be clearly and completely described, it is clear that described embodiments are some of the embodiments of the present invention, rather than Whole embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art are not making creative work premise Lower obtained every other embodiment, shall fall within the protection scope of the present invention.
It at present when carrying out the merging of registration table repetition sub-key, needs to create context session, passes through context session reality The merging of existing sub-key, however, this mode needs to safeguard the session management mechanism of registration table, as session establishment, manage and delete Except etc. processes, safeguard get up it is sufficiently complex cumbersome, be based on this, a kind of removing repeat of registration table sub-key provided in an embodiment of the present invention Method and device can be removed relative to the sub-key repeated in the first registration table path in the second registration table path to be combined, only It need to look for the identical sub-key of title that can find repetition sub-key, Maintenance free context session etc. one by one according to index value, safeguard letter It is single to be easy to use.
For ease of understanding the present embodiment, a kind of registration table sub-key disclosed in the embodiment of the present invention is gone first Weighing method describes in detail, and illustratively, the De-weight method of the registration table sub-key can be applied to software distribution scene In be distributed in the terminal of software, this method can find out by way of indexing traversal and title comparison is combined and wait closing And path does not repeat sub-key with former registration table path, and simultaneously by all not iterons bonding in registration table path to be combined Into the former registration table path, the complex operations for safeguarding the processes such as the establishment of session, management and deletion are avoided, method is simply just Victory, and then convenient for improving the efficiency for repeating sub-key in removal registration table path.
Registration table is the important database of Window systems, is used for the setting information of storage system and application program, registration Table directly controls the startup of windows, the operation of the loading of hardware drive program and some windows application programs, Central role is played in whole system.These effects include in the relevant configuration and status information, such as registration table of soft and hardware Preserve the primary condition of application program and explorer shell, preference and unloading data etc., Net-connected computer it is entire The setting of system and various licenses, file extension are associated with application program, description, state and the attribute of hardware component, property It can record and the system status information of other bottoms and other data etc..
Specifically, when starting Windows, register machine (Registry) can compare existing hardware configuration data, detection New hardware information;System kernel chooses information from Registry, including to be packed into what device driver, and according to assorted Order is packed into, and kernel sends back the information of own, such as copyright number etc.;Device driver is also passed to Registry simultaneously Send data, and receive from Registry and to be packed into and configuration parameter, a good device driver can tell Registry it Using what system resource, such as hardware interrupts or DMA channel etc., in addition, device driver will also report that is found matches Set data;The service of the new configuration data of increase is provided for the operation of application program or hardware.Windows is additionally provided greatly simultaneously Other interfaces are measured, user is allowed to change system configuration data, such as control panel, setting program etc..
Registration table is made of key (being also major key or " item "), sub-key (subitem) and value item.One key is exactly in branch One file, and sub-key is exactly the sub-folder in this file, sub-key it is same it be also a key.One value Xiang Ze It is the current definition of a key, is made of title, data type and the value of distribution.One key can there are one or multiple values, The title being each worth is different, if the entitled sky of a value, which is the default value of the key.
Registration table merging refers to that the sub-key (SUB KEY) in the registration table path at two is merged on a key (KEY), That is, the sub-key in key after merging is in two registration table paths, to realize unified read-write;Wherein, key (KEY) refer to a memory node in registry system, sub-key (SUB KEY) refers to the son in registry system in a memory node Memory node.
As shown in Figure 1, the De-weight method of the registration table sub-key may comprise steps of.
Before step S101, the configuration information of distribution software can be received first, it is in embodiments of the present invention, described to match Confidence breath includes the registry information etc. of the distribution software;Then it can determine sub in local registration table path to be combined The quantity of key, and determine according to the configuration information quantity of sub-key in the former registration table path.
Step S101 obtains the total quantity of sub-key in former registration table path and registration table path to be combined.
In embodiments of the present invention, former registration table path can refer to the A terminals for distributing software before carrying out software distribution, The former registration table path generated when locally-installed software can include at least one sub-key in the original registration table path, in software After being distributed to the B terminals for being distributed software, which can also be distributed to the B terminals for being distributed software, B terminals There is registration table path to be combined in being distributed before software, can include 0 sub-key in the registration table path to be combined, Can include at least one sub-key, in being distributed software, it includes the original registration table road simultaneously to be distributed in the B terminals of software Diameter and registration table path to be combined, registration table path to be combined are to be waited in the B terminals for be distributed software and the former registration table road The registration table path of sub-key merging is carried out in diameter.
Illustratively, former registration table path can be:
HKEY_LOCAL_MACHINE SOFTWARE, sub-key wherein included:
Notepad++;
Microsoft。
Illustratively, registration table path to be combined can be:
HKEY_LOCAL_MACHINE VDI MACHINE SOFTWARE, sub-key wherein included:
Notepad++;
Test。
In this step, the quantity that can inquire sub-key in former registration table path, obtains the first quantity and registration to be combined The quantity of sub-key in table path, obtains the second quantity, total quantity be the first quantity with the second quantity and.If for example, original annotation Include 2 sub-keys in volume table path, then the first quantity is 2, if in registration table path to be combined including 2 sub-keys, the second number Amount is also 2, then total quantity is 4.
Step S102, according to the sequence of the sub-key index built based on the total quantity, to the former registration table path and Sub-key in the registration table path to be combined is traversed, and sub-key title not position is found out in the registration table path to be combined Sub-key is not repeated in all in the former registration table path.
In this step, it can be based on total quantity structure sub-key index, original annotation is first then traversed by sub-key index Each sub-key in volume table path, then traverse each sub-key in registration table path to be combined.
In embodiments of the present invention, it is based on total quantity structure sub-key index, illustratively, if former registration table path packet It includes:A sub-keys and B sub-keys, registration table path to be combined include:C sub-keys and D sub-keys, then former registration table path and registration to be combined The total quantity of sub-key is 4 in table path, and the index number of sub-key index is 0,1,2 and 3, and it is right that each index number is respectively directed to its The registration table sub-key answered, that is to say, that:Index number is 0, is directed toward the 1st sub-key in former registration table path, i.e. A sub-keys;Index Serial number 1 is directed toward the 2nd sub-key in former registration table path, i.e. B sub-keys;Index number is 2, is directed toward the 3rd of former registration table path A sub-key, i.e. C sub-keys;Index number is 3, is directed toward the 4th sub-key in former registration table path, i.e. D sub-keys.
As shown in Fig. 2, step S102 may comprise steps of:Step S201, if passing through the sub-key of sub-key index traversal Quantity is less than or equal to the first quantity of sub-key in the former registration table path, then directly returns to sub-key and index corresponding sub-key Title;
Illustratively, if total quantity is 4, sub-key index may include 0~3, if the original registration table path and described 2 sub-keys are separately included in registration table path to be combined, then when sub-key index is 0, traverse first in former volume table path Sub-key, due to 1 (referring to the 1st sub-key just in traversal former volume table path)<2 (the first quantity of sub-key in former registration table path It is 2), then continue to traverse next sub-key according to sub-key index, when sub-key index is 1, traverse in former registration table path Second sub-key;(refer to the 2nd sub-key just in traversal former volume table path) due to 2=2 (the of sub-key in former registration table path One quantity is 2), then continue to traverse next sub-key according to sub-key index.
Step S202, if being more than first of sub-key in the former registration table path by the sub-key quantity of sub-key index traversal Quantity determines the merging road in the registration table path to be combined according to the difference of the sub-key index value and first quantity Diameter indexes, and the path indexing that merges does not repeat sub-key for indexing in the registration table path to be combined;
When sub-key index is 2, third sub-key will be traversed, (refers to the 3rd just in traversal original volume table path due to 3 Sub-key)>2 (the first quantity of sub-key is 2 in former registration table path), at this moment two sub-keys in former registration table path have traversed Finish, so should determine the merging in the registration table path to be combined according to the difference of sub-key index value and the first quantity at this time Path indexing, namely:By 3 (3 are obtained by sub-key index value 2+1) -2=1,1 obtained is to merge path indexing.
Step S203 searches not iteron corresponding with the merging path indexing in the registration table path to be combined Key;
In this step, the sequence that can be indexed according to the sub-key, in the registration table path to be combined one by one time Sub-key is gone through, the sub-key title of the sub-key is found;Then judge the sub-key title whether in the former registration table path Whole sub-key titles are all different, if the sub-key title is all different with whole sub-key titles in the former registration table path, Determine find one it is corresponding with the merging path indexing not repeatedly sub-key, can be by index counter to having found The quantity for not repeating sub-key is counted.
If the sub-key title is identical as any sub-key title in the former registration table path, determine described to be combined A sub- key name is traversed in registration table path and claims the repetition sub-key being located in the former registration table path, in the embodiment of the present invention In, the sub-key quantity that repeat counter record repeats can be set.
Illustratively, when sub-key index is 2, third sub-key (namely the in registration table path to be combined will be traversed One sub-key), if the sub-key title of the sub-key is not located in the former registration table path, it is determined that find first merging Sub-key is not repeated corresponding to path indexing;If desired it searches and does not repeat sub-key (i.e. corresponding to second merging path indexing; Again it indexes from first sub-key in registration table path to be combined and begins look for according to sub-key, if finding first not iteron Key is directly let off because having found first does not repeat sub-key, continues to look for next sub-key according to sub-key index, directly Sub-key is not repeated to finding second), until finding each and merging sub-key is not repeated corresponding to path indexing.
If the sub-key title of the sub-key is located in the former registration table path, it is determined that do not find first merging road Diameter index it is corresponding do not repeat sub-key (namely finding a repetition sub-key), then continue the 4th sub-key of traversal and (namely wait for Merge second sub-key in registration table path) etc., until finding the son that sub-key title is not located in the former registration table path Key, if the sub-key title of the 4th sub-key is not located in the former registration table path, it is determined that find first merging road Sub-key is not repeated corresponding to diameter index.
All not iteron keys in registration table path to be combined are merged into the former registration table path by step S103 In.
In this step, all corresponding sub-keys of sub-key title for not repeating sub-key can be merged into former registration table path HKEY_LOCAL_MACHINE SOFTWARE, after merging, sub-key that former registration table path includes:
Notepad++;
Microsoft;
Test。
Found out by comparing, after merging, the sub-key (Notepad++) of repetition is eliminated, if not duplicate removal, just can be appreciated that The sub-key of two Notepad++.Sub-key after merging in registration table path to be combined can continue to retain.
After step s 103, the configuration information can be updated according to the sub-key in the former registration table path, at this In inventive embodiments, due to relative to the registry information in the configuration information received, will be in registration table path to be combined All not iteron keys be merged into the former registration table path after, registry information changes, it is possible to update Configuration information.
The embodiment of the present invention is first by obtaining sub-key in the former registration table path and the registration table path to be combined Total quantity, then according to the sequence of the sub-key index built based on the total quantity, to the former registration table path and described Sub-key in registration table path to be combined is traversed, and is found out sub-key title in the registration table path to be combined and is not located at institute State in former registration table path it is all not repeat sub-key, finally can by registration table path to be combined it is all not repeat sub-key It is merged into the former registration table path.
The embodiment of the present invention can compare by way of being combined indexing traversal and title and find out path to be combined Sub-key is not repeated with former registration table path, and all not iteron keys in registration table path to be combined are merged into described In former registration table path, the complex operations for safeguarding the processes such as the establishment of session, management and deletion are avoided, method is simple and convenient, into And convenient for improving the efficiency for repeating sub-key in removal registration table path.
In another embodiment of the present invention, as shown in figure 3, a kind of duplicate removal device of registration table sub-key is also provided, it is described Device includes:
Quantity acquisition module 11, for obtaining sub-key in the former registration table path and the registration table path to be combined Total quantity;
In embodiments of the present invention, former registration table path can refer to the A terminals for distributing software before carrying out software distribution, The former registration table path generated when locally-installed software can include at least one sub-key in the original registration table path, in software After being distributed to the B terminals for being distributed software, which can also be distributed to the B terminals for being distributed software, B terminals There is registration table path to be combined in being distributed before software, can include 0 sub-key in the registration table path to be combined, Can include at least one sub-key, in being distributed software, it includes the original registration table road simultaneously to be distributed in the B terminals of software Diameter and registration table path to be combined, registration table path to be combined are to be waited in the B terminals for be distributed software and the former registration table road The registration table path of sub-key merging is carried out in diameter.
Illustratively, former registration table path can be:
HKEY_LOCAL_MACHINE SOFTWARE, sub-key wherein included:
Notepad++;
Microsoft。
Illustratively, registration table path to be combined can be:
HKEY_LOCAL_MACHINE VDI MACHINE SOFTWARE, sub-key wherein included:
Notepad++;
Test。
The quantity that sub-key in former registration table path can be inquired obtains sub-key in the first quantity and registration table path to be combined Quantity, obtain the second quantity, total quantity be the first quantity with the second quantity and.If for example, former registration table path Nei Bao 2 sub-keys are included, then the first quantity is 2, if in registration table path to be combined including 2 sub-keys, the second quantity is also 2, then always Quantity is 4.
Sub-key spider module 12, for the sequence according to the sub-key index built based on the total quantity, to the original annotation Sub-key in volume table path and the registration table path to be combined is traversed, and is found out sub in the registration table path to be combined What key name claimed not to be located in the former registration table path all does not repeat sub-key;
It can be based on total quantity structure sub-key index, then first traversed in former registration table path by sub-key index Each sub-key, then traverse each sub-key in registration table path to be combined.
In embodiments of the present invention, it is based on total quantity structure sub-key index, illustratively, if former registration table path packet It includes:A sub-keys and B sub-keys, registration table path to be combined include:C sub-keys and D sub-keys, then former registration table path and registration to be combined The total quantity of sub-key is 4 in table path, and the index number of sub-key index is 0,1,2 and 3, and it is right that each index number is respectively directed to its The registration table sub-key answered, that is to say, that:Index number is 0, is directed toward the 1st sub-key in former registration table path, i.e. A sub-keys;Index Serial number 1 is directed toward the 2nd sub-key in former registration table path, i.e. B sub-keys;Index number is 2, is directed toward the 3rd of former registration table path A sub-key, i.e. C sub-keys;Index number is 3, is directed toward the 4th sub-key in former registration table path, i.e. D sub-keys.
Title returns to module 13, for all not iteron keys in registration table path to be combined to be merged into the original annotation In volume table path.
All corresponding sub-keys of sub-key title for not repeating sub-key can be merged into former registration table path HKEY_ LOCAL_MACHINE SOFTWARE, after merging, sub-key that former registration table path includes:
Notepad++;
Microsoft;
Test。
Found out by comparing, after merging, the sub-key (Notepad++) of repetition is eliminated, if not duplicate removal, just can be appreciated that The sub-key of two Notepad++.Sub-key after merging in registration table path to be combined can continue to retain.
The embodiment of the present invention is first by obtaining sub-key in the former registration table path and the registration table path to be combined Total quantity, then according to the sequence of the sub-key index built based on the total quantity, to the former registration table path and described Sub-key in registration table path to be combined is traversed, and is found out sub-key title in the registration table path to be combined and is not located at institute State in former registration table path it is all not repeat sub-key, finally can by registration table path to be combined it is all not repeat sub-key It is merged into the former registration table path.
The embodiment of the present invention can compare by way of being combined indexing traversal and title and find out path to be combined Sub-key is not repeated with former registration table path, and all not iteron keys in registration table path to be combined are merged into described In former registration table path, the complex operations for safeguarding the processes such as the establishment of session, management and deletion are avoided, method is simple and convenient, into And convenient for improving the efficiency for repeating sub-key in removal registration table path.
In another embodiment of the present invention, as shown in figure 4, the sub-key spider module 12, including:
First Traversal Unit 21, if for being less than or equal to the original annotation volume by the sub-key quantity of sub-key index traversal First quantity of sub-key in table path then directly returns to sub-key and indexes corresponding sub-key title;Pass through the son of sub-key index traversal Bond number amount can be counted to get by index counter.
Illustratively, if total quantity is 4, sub-key index may include 0~3, if the original registration table path and described 2 sub-keys are separately included in registration table path to be combined, then when sub-key index is 0, traverse first in former volume table path Sub-key, due to 1 (referring to the 1st sub-key just in traversal former volume table path)<2 (the first quantity of sub-key in former registration table path It is 2), then continue to traverse next sub-key according to sub-key index, when sub-key index is 1, traverse in former registration table path Second sub-key;(refer to the 2nd sub-key just in traversal former volume table path) due to 2=2 (the of sub-key in former registration table path One quantity is 2), then continue to traverse next sub-key according to sub-key index.
Second Traversal Unit 22, for being more than in the former registration table path by the sub-key quantity of sub-key index traversal When the first quantity of sub-key, determined on the registration table road to be combined according to the difference of the sub-key index value and first quantity Merging path indexing in diameter, the path indexing that merges are used to index the not iteron in the registration table path to be combined Key;
When sub-key index is 2, third sub-key will be traversed, (refers to the 3rd just in traversal original volume table path due to 3 Sub-key)>2 (the first quantity of sub-key is 2 in former registration table path), at this moment two sub-keys in former registration table path have traversed Finish, so should determine the merging in the registration table path to be combined according to the difference of sub-key index value and the first quantity at this time Path indexing, namely:By 3 (3 are obtained by sub-key index value 2+1) -2=1,1 obtained is to merge path indexing.
Searching unit 23, it is corresponding not with the merging path indexing for being searched in the registration table path to be combined Repeat sub-key.
In another embodiment of the present invention, the searching unit is additionally operable to:
According to the sequence that the sub-key indexes, sub-key is traversed one by one in the registration table path to be combined, finds institute State the sub-key title of sub-key;
Judge whether the sub-key title is all different with whole sub-key titles in the former registration table path;
If the sub-key title is all different with whole sub-key titles in the former registration table path, determination finds one It is corresponding with the merging path indexing not repeat sub-key.The number of sub-key can not be repeated to having found by index counter Amount is counted.
If the sub-key title is identical as any sub-key title in the former registration table path, determine described to be combined A sub- key name is traversed in registration table path and claims the repetition sub-key being located in the former registration table path, returns to the iteron The sub-key quantity that repeat counter record repeats can be arranged in embodiments of the present invention in the sub-key title of key.
Illustratively, when sub-key index is 2, third sub-key (namely the in registration table path to be combined will be traversed One sub-key), if the sub-key title of the sub-key is not located in the former registration table path, it is determined that find first merging Sub-key is not repeated corresponding to path indexing, if desired searches and does not repeat sub-key (i.e. corresponding to second merging path indexing; Again it indexes from first sub-key in registration table path to be combined and begins look for according to sub-key, if finding first not iteron Key is directly let off because having found first does not repeat sub-key, continues to look for next sub-key according to sub-key index, directly Sub-key is not repeated to finding second), until finding each and merging sub-key is not repeated corresponding to path indexing.
If the sub-key title of the sub-key is located in the former registration table path, it is determined that do not find first merging road Diameter index it is corresponding do not repeat sub-key (namely finding a repetition sub-key), then continue the 4th sub-key of traversal and (namely wait for Merge second sub-key in registration table path) etc., until finding the son that sub-key title is not located in the former registration table path Key, if the sub-key title of the 4th sub-key is not located in the former registration table path, it is determined that find first merging road Sub-key is not repeated corresponding to diameter index.
In another embodiment of the present invention, before first Traversal Unit, described device further includes:
Receiving module, the configuration information for receiving distribution software;
Determining module, the quantity for determining sub-key in local registration table path to be combined, and match confidence according to described Breath determines the quantity of sub-key in the former registration table path;
After the searching unit, described device further includes:
Update module, for updating the configuration information according to the sub-key in the former registration table path.
In another embodiment of the present invention, a kind of electronic equipment, including memory, processor, the storage are also provided The computer program that can be run on the processor is stored in device, the processor is realized when executing the computer program The step of method described in above method embodiment.
In another embodiment of the present invention, a kind of non-volatile program code that can perform with processor is also provided Computer-readable medium, said program code make the processor execute the method described in the method embodiment.
The computer program product of the De-weight method for the registration table sub-key that the embodiment of the present invention is provided, including store journey The computer readable storage medium of sequence code, the instruction that said program code includes can be used for executing institute in previous methods embodiment The method stated, specific implementation can be found in embodiment of the method, and details are not described herein.
It is apparent to those skilled in the art that for convenience and simplicity of description, the system of foregoing description It with the specific work process of device, can refer to corresponding processes in the foregoing method embodiment, details are not described herein.
In addition, in the description of the embodiment of the present invention unless specifically defined or limited otherwise, term " installation ", " phase Even ", " connection " shall be understood in a broad sense, for example, it may be being fixedly connected, may be a detachable connection, or be integrally connected;It can Can also be electrical connection to be mechanical connection;It can be directly connected, can also indirectly connected through an intermediary, Ke Yishi Connection inside two elements.For the ordinary skill in the art, above-mentioned term can be understood at this with concrete condition Concrete meaning in invention.
It, can be with if the function is realized in the form of SFU software functional unit and when sold or used as an independent product It is stored in a computer read/write memory medium.Based on this understanding, technical scheme of the present invention is substantially in other words The part of the part that contributes to existing technology or the technical solution can be expressed in the form of software products, the meter Calculation machine software product is stored in a storage medium, including some instructions are used so that a computer equipment (can be People's computer, server or network equipment etc.) it performs all or part of the steps of the method described in the various embodiments of the present invention. And storage medium above-mentioned includes:USB flash disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), arbitrary access are deposited The various media that can store program code such as reservoir (RAM, Random Access Memory), magnetic disc or CD.
In the description of the present invention, it should be noted that term "center", "upper", "lower", "left", "right", "vertical", The orientation or positional relationship of the instructions such as "horizontal", "inner", "outside" be based on the orientation or positional relationship shown in the drawings, merely to Convenient for the description present invention and simplify description, do not indicate or imply the indicated device or element must have a particular orientation, With specific azimuth configuration and operation, therefore it is not considered as limiting the invention.In addition, term " first ", " second ", " third " is used for description purposes only, and is not understood to indicate or imply relative importance.
Finally it should be noted that:Embodiment described above, only specific implementation mode of the invention, to illustrate the present invention Technical solution, rather than its limitations, scope of protection of the present invention is not limited thereto, although with reference to the foregoing embodiments to this hair It is bright to be described in detail, it will be understood by those of ordinary skill in the art that:Any one skilled in the art In the technical scope disclosed by the present invention, it can still modify to the technical solution recorded in previous embodiment or can be light It is readily conceivable that variation or equivalent replacement of some of the technical features;And these modifications, variation or replacement, do not make The essence of corresponding technical solution is detached from the spirit and scope of technical solution of the embodiment of the present invention, should all cover the protection in the present invention Within the scope of.Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (10)

1. a kind of De-weight method of registration table sub-key, which is characterized in that the method includes:
Obtain the total quantity of sub-key in former registration table path and registration table path to be combined;
According to the sequence of the sub-key index built based on the total quantity, to the former registration table path and the registration to be combined Sub-key in table path is traversed, and is found out sub-key title in the registration table path to be combined and is not located at the former registration table In path it is all not repeat sub-key;
All not iteron keys in registration table path to be combined are merged into the former registration table path.
2. according to the method described in claim 1, it is characterized in that, described indexed according to the sub-key built based on the total quantity Sequence, the sub-key in the former registration table path and the registration table path to be combined is traversed, described wait for is found out Merge that sub-key title in registration table path is not located in the former registration table path it is all do not repeat sub-key, including:
If being less than or equal to the first quantity of sub-key in the former registration table path by the sub-key quantity of sub-key index traversal, It then directly returns to sub-key and indexes corresponding sub-key title;
If being more than the first quantity of sub-key in the former registration table path by the sub-key quantity of sub-key index traversal, according to described The difference of sub-key index value and first quantity determines the merging path indexing in the registration table path to be combined, the conjunction And path indexing is used to index in the registration table path to be combined and does not repeat sub-key;
Lookup is corresponding with the merging path indexing in the registration table path to be combined does not repeat sub-key.
3. according to the method described in claim 2, it is characterized in that, lookup and the institute in the registration table path to be combined State merge path indexing it is corresponding not repeat sub-key, including:
According to the sequence that the sub-key indexes, sub-key is traversed one by one in the registration table path to be combined, finds the son The sub-key title of key;
Judge whether the sub-key title is all different with whole sub-key titles in the former registration table path;
If the sub-key title is all different with whole sub-key titles in the former registration table path, determination finds one and institute State merge path indexing it is corresponding not repeat sub-key.
4. according to the method described in claim 3, it is characterized in that, lookup and the institute in the registration table path to be combined State merge path indexing it is corresponding not repeat sub-key, further include:
If the sub-key title is identical as any sub-key title in the former registration table path, determine in the registration to be combined A sub- key name is traversed in table path claims the repetition sub-key being located in the former registration table path.
5. according to the method described in claim 4, it is characterized in that, obtaining former registration table path and registration table path to be combined Before the total quantity of interior sub-key, the method further includes:
Receive the configuration information of distribution software;
It determines the quantity of sub-key in local registration table path to be combined, and the former registration table is determined according to the configuration information The quantity of sub-key in path;
After all not iteron keys in registration table path to be combined being merged into the former registration table path, the side Method further includes:
The configuration information is updated according to the sub-key in the former registration table path.
6. a kind of duplicate removal device of registration table sub-key, which is characterized in that described device includes:
Quantity acquisition module, the total quantity for obtaining sub-key in former registration table path and registration table path to be combined;
Sub-key spider module, for the sequence according to the sub-key index built based on the total quantity, to the former registration table road Sub-key in diameter and the registration table path to be combined is traversed, and sub-key title in the registration table path to be combined is found out Be not located in the former registration table path all does not repeat sub-key;
Merging module, for all not iteron keys in registration table path to be combined to be merged into the former registration table path In.
7. device according to claim 6, which is characterized in that the sub-key spider module, including:
First Traversal Unit, if for being less than or equal to the former registration table path by the sub-key quantity of sub-key index traversal First quantity of middle sub-key then directly returns to sub-key and indexes corresponding sub-key title;
Second Traversal Unit, for being more than sub-key in the former registration table path by the sub-key quantity of sub-key index traversal When the first quantity, determined in the registration table path to be combined according to the difference of the sub-key index value and first quantity Merge path indexing, the path indexing that merges does not repeat sub-key for indexing in the registration table path to be combined;
Searching unit, for searching not iteron corresponding with the merging path indexing in the registration table path to be combined Key.
8. device according to claim 7, which is characterized in that the searching unit is additionally operable to:
According to the sequence that the sub-key indexes, sub-key is traversed one by one in the registration table path to be combined, finds the son The sub-key title of key;
Judge whether the sub-key title is all different with whole sub-key titles in the former registration table path;
If the sub-key title is all different with whole sub-key titles in the former registration table path, determination finds one and institute State merge path indexing it is corresponding not repeat sub-key.
9. according to any device of claim 6 to 8, which is characterized in that the searching unit is additionally operable to:
If the sub-key title is identical as any sub-key title in the former registration table path, determine in the registration to be combined A sub- key name is traversed in table path claims the repetition sub-key being located in the former registration table path.
10. device according to claim 9, which is characterized in that before first Traversal Unit, described device is also wrapped It includes:
Receiving module, the configuration information for receiving distribution software;
Determining module, the quantity for determining sub-key in local registration table path to be combined, and it is true according to the configuration information The quantity of sub-key in the fixed former registration table path;
After the searching unit, described device further includes:
Update module, for updating the configuration information according to the sub-key in the former registration table path.
CN201810408910.1A 2018-04-28 2018-04-28 Method and device for removing duplicate of registry sub-keys Active CN108647053B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810408910.1A CN108647053B (en) 2018-04-28 2018-04-28 Method and device for removing duplicate of registry sub-keys

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810408910.1A CN108647053B (en) 2018-04-28 2018-04-28 Method and device for removing duplicate of registry sub-keys

Publications (2)

Publication Number Publication Date
CN108647053A true CN108647053A (en) 2018-10-12
CN108647053B CN108647053B (en) 2021-04-06

Family

ID=63748881

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810408910.1A Active CN108647053B (en) 2018-04-28 2018-04-28 Method and device for removing duplicate of registry sub-keys

Country Status (1)

Country Link
CN (1) CN108647053B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7533372B2 (en) * 2003-08-05 2009-05-12 Microsoft Corporation Cross language migration
CN102968359A (en) * 2012-11-13 2013-03-13 福建升腾资讯有限公司 Registry transparent penetration method under disc protection system
CN104424222A (en) * 2013-08-23 2015-03-18 华为技术有限公司 Database indexing method and device
CN105426330A (en) * 2015-11-05 2016-03-23 飞天诚信科技股份有限公司 Method and apparatus for automatically opening expansion channel
CN106528332A (en) * 2016-10-25 2017-03-22 公安部第三研究所 Recovery method for deleted data in registry

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7533372B2 (en) * 2003-08-05 2009-05-12 Microsoft Corporation Cross language migration
CN102968359A (en) * 2012-11-13 2013-03-13 福建升腾资讯有限公司 Registry transparent penetration method under disc protection system
CN104424222A (en) * 2013-08-23 2015-03-18 华为技术有限公司 Database indexing method and device
CN105426330A (en) * 2015-11-05 2016-03-23 飞天诚信科技股份有限公司 Method and apparatus for automatically opening expansion channel
CN106528332A (en) * 2016-10-25 2017-03-22 公安部第三研究所 Recovery method for deleted data in registry

Also Published As

Publication number Publication date
CN108647053B (en) 2021-04-06

Similar Documents

Publication Publication Date Title
CN109416643B (en) Application program migration system
US9292217B2 (en) Logical volume space sharing
US9377936B2 (en) Framework for automated storage processes and flexible workflow
EP2656210B1 (en) Providing a persona-based application experience
CN102902573B (en) Task processing method and device based on shared resources
CN106294352B (en) A kind of document handling method, device and file system
US20130091183A1 (en) Volume Management
US20160019206A1 (en) Methods and systems to identify and use event patterns of application workflows for data management
US10909086B2 (en) File lookup in a distributed file system
CN109002330A (en) A kind of method, device and equipment identifying UEFI OS startup item
US20050234966A1 (en) System and method for managing supply of digital content
US11811839B2 (en) Managed distribution of data stream contents
US11636072B2 (en) Parallel processing of a keyed index file system
JP6211631B2 (en) Identifying workloads and sizing buffers for volume replication purposes
CN110018989A (en) A kind of method and apparatus that snapshot compares
CN106663023A (en) Grouping virtual machines in a cloud application
CN104216724A (en) Method and system for updating network application program interface
US10417192B2 (en) File classification in a distributed file system
US20200244766A1 (en) Systems and methods for semi-automatic workload domain deployments
CN109388614A (en) A kind of method, system and the equipment of catalogue file number quota
US11941413B2 (en) Managed control plane service
CN105389266B (en) A kind of data managing method and device
US20170249304A1 (en) File system quota versioning
CN107239568B (en) Distributed index implementation method and device
CN105868023B (en) Data processing method and calculate node in a kind of distributed 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