CN106156265A - For the method and apparatus merging tree structure - Google Patents

For the method and apparatus merging tree structure Download PDF

Info

Publication number
CN106156265A
CN106156265A CN201510309143.5A CN201510309143A CN106156265A CN 106156265 A CN106156265 A CN 106156265A CN 201510309143 A CN201510309143 A CN 201510309143A CN 106156265 A CN106156265 A CN 106156265A
Authority
CN
China
Prior art keywords
node
combined
tree structure
merging
tree
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
CN201510309143.5A
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.)
Beijing Tianhe Yuan Software Ltd By Share Ltd
Original Assignee
Beijing Tianhe Yuan Software Ltd By Share Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Tianhe Yuan Software Ltd By Share Ltd filed Critical Beijing Tianhe Yuan Software Ltd By Share Ltd
Priority to CN201510309143.5A priority Critical patent/CN106156265A/en
Publication of CN106156265A publication Critical patent/CN106156265A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/13File access structures, e.g. distributed indices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The present invention relates to computer realm, disclose a kind of method and apparatus for merging tree structure.The method includes by the identification information identification of node from the node in correspondence with each other of different tree form structured file, then merges node in correspondence with each other.It is contemplated that retain and be merely stored in the node in one of them tree structured document in merging.Meanwhile, specific consolidation strategy can be configured as desired for the node each to be combined in merging every time.The application present invention can merge multiple tree structured document neatly, and the piecemeal storage and maintenance for tree structure information is provided convenience, and greatly reduces the probability made mistakes in system administration and maintenance work.Present disclosure can be applicable to the Software Development Platforms such as sword soul Software Development Platform (former title Witrix platform), and as the core technology of corresponding software development platform.

Description

For the method and apparatus merging tree structure
Technical field
The present invention relates to computer realm, in particular it relates to a kind of method for merging tree structure and A kind of device for merging tree structure.
Background technology
In computer systems, frequently with the file of tree structure storage information system is managed with Realize specific function.Such as, in B/S (Browser/Server, browser/server) structure The configuration file with tree structure storage information can be used on Enterprise Informatization system server to carry out system Parameter and the initial configuration etc. of attribute information.
Such as, in enterprise relatively large, architectonical applies, the computer subsystem of each subordinate enterprise It is relatively similar that the framework of system is typically ratio, but it each to be safeguarded by different configuration files, and And along with the increase of quantity is disposed in system application, the configuration file that also can form multiple version coexists shared Phenomenon, causes the maintenance side of system to need simultaneously and safeguards a lot of version.And owing to these systemic-functions are most Similar, so the major part in the content of its configuration file used also is identical, but different system Between or the different editions of system between exist again the individually definition of some special configuration item needs or The differently configured value of item is similarly configured for different editions.Therefore the configuration file of different editions is merged Management can greatly reduce system maintenance cost, and avoid being respectively modified each version loaded down with trivial detailsly and may bring Mistake.
The most such as, for realize certain function, can be potentially included easily by the information that tree structure manages Become part and steady component, if Piece file mergence can be conveniently realized, then just can consider this information In variable portion and steady component be each stored in different files with tree structure and safeguarded, and The information of storage in different files being combined in use, this is also greatly improved system administration effect Rate.
Summary of the invention
It is an object of the invention to provide a kind of method, the method can merge behaviour to multiple tree structures Make, to facilitate, multiple files with tree structure storage information are managed collectively and safeguard.The present invention Additionally provide a kind of device for merging tree structure.
To achieve these goals, the present invention provides a kind of method for merging tree structure, and this is tree-like Structure includes the first tree structure and the second tree structure, and the method includes: select from the second tree structure Select node to be combined, and described node to be combined is merged process.Described merging treatment includes: Judge whether described first tree structure exists the node corresponding with described node to be combined, and according to Judged result performs following one: exist relative with described node to be combined in described first tree structure In the case of the node answered, described node to be combined is incorporated in described first tree structure and treats with described Merge the node that node is corresponding;And do not exist and described node to be combined in described first tree structure In the case of corresponding node, described node to be combined is added to described first tree structure and is somebody's turn to do Under the node that the father node of node to be combined is corresponding.Wherein, identification information based on node determines not With the node in tree structure the most in correspondence with each other.
Above-mentioned first and second tree structures can be stored in different files.
Preferably, can be as needed for the differently configured consolidation strategy of node to be combined, to improve further Carry out the efficiency of tree structure merging.
Present invention also offers a kind of device for merging tree structure.
By technique scheme, multiple tree structured document can be merged neatly, for tree structure information Piecemeal storage and maintenance provide convenience, and greatly reduce system administration and maintenance work make mistakes Probability.Present disclosure can be applicable to the softwares such as sword soul Software Development Platform (former title Witrix platform) Development platform, and as the core technology of corresponding software development platform.
Other features and advantages of the present invention will be described in detail in detailed description of the invention part subsequently.
Accompanying drawing explanation
Accompanying drawing is used to provide a further understanding of the present invention, and constitutes the part of description, with Detailed description below is used for explaining the present invention together, but is not intended that limitation of the present invention.? In accompanying drawing:
Fig. 1 is to illustrate the exemplary plot merged tree structure according to the preferred embodiment for the present invention.
Fig. 2 is to illustrate to determine whether to carry out different tree form structured file according to the preferred embodiment for the present invention The example flow diagram merged.
Fig. 3 is the example flow diagram illustrating and carrying out tree structure merging according to the preferred embodiment for the present invention.
Detailed description of the invention
Below in conjunction with accompanying drawing, the detailed description of the invention of the present invention is described in detail.It should be appreciated that Detailed description of the invention described herein is merely to illustrate and explains the present invention, is not limited to this Bright.
In the present invention, the path of node i refers to the institute sequentially passed through from the root node of tree structure to node i Having node, such as root node is that L101, L101 have child node L201, and L201 has child node L301, Then the path of L301 is represented by L101/L201;The downstream site of node i refers to the tree-like of node i place Node with node i as root node in structure, it may include the child node of node i, the child node of node i Child node etc.;The superior node of node i refer to from the root node of tree structure to node i process All nodes, it may include the father node of node i, the father node of father node etc. of node i;Leaf saves Point refers to the node without child node.
The basic thought carrying out tree structure merging is to carry out node corresponding in different tree form structure Merge, and reservation exists only in the node in one of them tree structure.
Fig. 1 is to illustrate the example merged two tree structures according to the preferred embodiment for the present invention Figure.Fig. 1 (a) and Fig. 1 (b) respectively illustrates two tree structures, wherein Fig. 1 (b) before merging In tree structure can be considered as merge basis initial tree structure, can according to certain strategy successively Node in Fig. 1 (a) is merged or adds in the tree structure in Fig. 1 (b), to be merged After tree structure.Fig. 1 (c) is for being incorporated into the tree structure shown in Fig. 1 (a) according to the present invention The schematic diagram of the tree structure after the merging obtained after the tree structure shown in Fig. 1 (b).
As shown in Fig. 1 (a), L101 is the root node of the tree structure in Fig. 1 (a), and L101 has Two attributes of A1 and B1, its value is respectively a1 and b1.L101 has 3 child nodes L201, L202 With the attribute information of L204, L201 is (A2=a2;B2=b2), the attribute information of L202 is (D2=d2), The attribute information of L204 is (E2=e2).L201 has 2 child nodes L301 and L302, L202 to have son Node L303, L204 do not have child node.
As shown in Fig. 1 (b), L101 is the root node of the tree structure in Fig. 1 (b), and L101 has Two attributes of A1 and B1, its value is respectively a1 and b1.L101 has 3 child nodes L201, L203 And the attribute information of L204, L201 be (B2=b2 ';C2=c2), the attribute information of L203 is (D2=d2), The attribute information of L204 is (F2=f2).L201 has 2 child nodes L301 and L202, L204 to have son Node L304.
Can identification information based on node determine from different tree form structure node the most in correspondence with each other. In same tree structure, the identification information of node can uniquely identify node.In different tree form structure Node identification information between can have certain mapping relations, it is believed that meet the node of these mapping relations In correspondence with each other.Such as, in present embodiment, the identification information of node can include node routing information and Name information, can uniquely identify this node by identification information based on node in same tree structure, can base In node identification information identical determine from different tree form structure node in correspondence with each other.Additionally, some In the case of there may be collector node (with same node as father node and title in the most same tree structure Node in the set that identical multiple nodes are constituted), the identification information of the most each collector node also includes Its number information in set, to make a distinction with other nodes in this set.
After resolving with the file of tree structure storage information, it is preferable that can first determine whether that its root saves The identification information (such as, it is common that the title of root node) of point is the most identical, if the mark of root node Information is different, then the tree structure of storage in both of these documents can not be merged operation.It is believed that figure 1 (a) is identical with the identification information of the root node of the tree structure shown in Fig. 1 (b), and (such as, title is all For L101), therefore the tree structure shown in Fig. 1 (a) and Fig. 1 (b) can be merged.
Node to be combined can be selected successively, for same joint according to the order from root node to leaf node Point is multiple nodes (also becoming the brotgher of node) of father node, (corresponding can exist from front to back according to sequence For from left to right in Fig. 1) order select node to be combined successively.Can be first by Fig. 1 (a) L101 elects node to be combined as and merges.For the node L101 in Fig. 1 (a), can be at Fig. 1 (b) In find corresponding node L101, then the node L101 in Fig. 1 (a) can be incorporated into Fig. 1 (b) In node L101.(explicitly or implicitly) different one-level consolidation strategy can be configured as required.Root According to the present invention, one-level consolidation strategy can include " merging " and/or " replacement ".If joint in Fig. 1 (a) The one-level consolidation strategy of some L101 is " merging ", then the L101 after merging includes the L101 in Fig. 1 (a) The whole attributes being had with the L101 in Fig. 1 (b).If the one of Fig. 1 (a) interior joint L101 Level consolidation strategy is " replacement ", then the attribute information being had with the L101 in Fig. 1 (a) is as conjunction The attribute information of the L101 after and.L101 and Fig. 1 in example shown in Fig. 1, in Fig. 1 (a) B the attribute information of the L101 in () is identical, so it or " replaces for " merging " at one-level consolidation strategy Change " in the case of the attribute information of L101 after the merging that obtains be identical.
Preferably, different one-level consolidation strategies can be set for the merging of each node in Fig. 1 (a), Such as, different one-level consolidation strategies can be set for L101 and L201.One-level consolidation strategy can be explicit Or the appointment of implicit expression.Such as, one-level consolidation strategy can be stored in tree structure as the attribute of node, Also the one-level consolidation strategy for each node in this time merging can be configured by extra file, or logical Mode configuration crossing default configuration etc..
Each branch of root node can be processed successively.According to the preferred embodiment of the present invention, can be according to joining Putting (explicitly or implicitly) processes the downstream site of node to be combined in various ways.Such as, can be successively Select L101 each child node as new node to be combined and according to above-mentioned process L101 mode by Individual merge process (in the application, also referred to as two grades consolidation strategies are " merging ");Also can be by Fig. 1 (a) The downstream site of middle L101 is according to original path and original attribute information (i.e. tree-like shown in Fig. 1 (a) Path in structure and attribute information) directly it is added in the tree structure in Fig. 1 (b), such as Fig. 1 A in (), the downstream site of L101 can be added in Fig. 1 (b) (this before the downstream site of L101 In application, also referred to as two grades consolidation strategies are " front slotting ") or (also referred to as two grades of merging in the application afterwards Strategy is " adding ");Can also be used with L101 in downstream site coverage diagram 1 (b) of L101 in Fig. 1 (a) Downstream site (in the application also referred to as two grades of consolidation strategies be " covering "), " covering " can be considered by In Fig. 1 (a), the downstream site of L101 adds to Fig. 1 (b) according to original path and attribute information In tree structure, and delete the original downstream site of L101 in Fig. 1 (b).Preferred according to the present invention Embodiment, if the one-level consolidation strategy for certain node is " merging ", then for this node Two grades of consolidation strategies can be configured (explicitly or implicitly) be " merging ", " front slotting ", " adding " and " cover Lid " in any one;If the one-level consolidation strategy for certain node is " replacement ", then for Two grades of consolidation strategies of this node are typically configured (explicitly or implicitly) for " covering ".
If the one-level consolidation strategy of L101 is that " merging ", two grades of consolidation strategies are for " closing in Fig. 1 (a) And ", the L201 in optional Fig. 1 (a) is as new pending node.Can illustrate at Fig. 1 (b) Tree structure in find the node corresponding with the L201 in Fig. 1 (a).If L201 in Fig. 1 (a) One-level consolidation strategy be " merging ", two grades of consolidation strategies be " front insert ", L201 in Fig. 1 (a) Attribute information is (A2=a2;B2=b2), in Fig. 1 (b) attribute information of L201 be (B2=b2 '; C2=c2), the attribute information merging the L201 obtained is (A2=a2;B2=b2;C2=c2) (such as Fig. 1 Shown in (c)), it has whole attributes that the L201 in Fig. 1 (a) and Fig. 1 (b) is had, right The attribute B2 that in L201 and Fig. 1 (b), L201 has in Fig. 1 (a), its value and Fig. 1 (a) The value of the attribute B2 of middle L201 is identical.L102 after merging have 4 child nodes L301, L302, L301 and L202, wherein, if L301 is indicated as collector node, then its identification information is except bag Include the number information that may also include L301 outside routing information and name information in set;If L301 Be indicated as non-collector node, then this is a kind of abnormal condition, can report BUG.
It will be appreciated by persons skilled in the art that the L201 assumed in Fig. 1 (a) does not has child node, The most no matter two grades of consolidation strategies are " front slotting " or " adding ", L201 in the tree structure after merging The situation of child node is identical;If the L201 in Fig. 1 (b) does not has child node the most no matter Two grades of consolidation strategies are " front slotting ", " adding " or " covering ", L201 in the tree structure after merging The situation of child node is identical.
For the node L202 in Fig. 1 (a), because the most corresponding with L202 in Fig. 1 (b) Node, therefore the L202 in Fig. 1 (a) can be added under L101, in the tree structure after merging L202 attribute information can keep constant.Preferably, as it can be seen, can be by L202 in Fig. 1 (a) All downstream sites (such as L303) to be added on first according to original path and original attribute information tree-like In structure.
Optional L204 is as new node to be combined.Can look in the tree structure that Fig. 1 (b) illustrates To the node corresponding with the L204 in Fig. 1 (a).If the one-level consolidation strategy of L204 be " replacement ", Two grades of consolidation strategies are " covering ".In Fig. 1 (a), the attribute information of L204 is (E2=e2), Fig. 1 B in (), the attribute information of L204 is (F2=f2), the L204 in Fig. 1 (b) also has child node L304. Being " replacement " based on one-level consolidation strategy, the attribute information of the L204 after merging is (E2=e2).Based on Two grades of consolidation strategies are " covering ", and the L204 after merging does not has child node.
As it can be seen, the L203 in Fig. 1 (b) does not has corresponding node in Fig. 1 (a), therefore L203 can not be affected by the merging treatment for the node in Fig. 1 (a), and it is with original path and former Attribute information is had to retain in tree structure after merging.
Preferably, in some cases, can be configured to need deletion of node by certain node in Fig. 1 (a), Tree structure after merging does not include the node corresponding with this node.Therefore, this node can not be entered Row merging treatment, directly can delete (if present) from Fig. 1 (b) by the node corresponding with this node.
Fig. 2 is to illustrate to determine whether to carry out different tree form structured file according to the preferred embodiment for the present invention The example flow diagram merged.As in figure 2 it is shown, at S201, the first tree-like file and can be resolved respectively Two tree-like files obtain the first tree structure and the second tree structure.At S202, can determine whether that first is tree-like The identification information (such as, title) of the root node of structure and the second tree structure is the most identical.If phase With, it is determined that merge the two tree structure (S203), if it is not the same, then determine not to the two Tree structure merges operation (S204).
Fig. 3 is the example flow diagram illustrating and carrying out tree structure merging according to the preferred embodiment for the present invention. For ease of describe, in this embodiment, if two grades of consolidation strategies of each node in the second tree structure It is configured to " merging ", and thinks each child node for having identical father node, according to row The vertical order of sequence processes.
At S301, select the root node of the second tree structure as node to be combined, can claim selected Node to be combined is node i.At S302, it is judged that whether exist tree-like with second in the first tree structure The node i that node i in structure is corresponding '.If do not exist in S302 judges the first tree structure with The node i that node i is corresponding ', then in all by node i and the second tree structure interior joint i of S308 Downstream site is according to original path and attribute information (path in the i.e. second tree structure and attribute information) Adding to the first tree structure, for ease of distinguishing, node i adds to the first tree structure referred to as joint Point i ".After completing node interpolation in S308, whether it is root node in S309 decision node i.
If there is the node i corresponding with node i in S302 judges the first tree structure ', then at S303 Determine whether that the one-level consolidation strategy of node i is for " replacement " or " merging ".If S303 sentences The downstream site that disconnected result is " replacement ", then at S307 by node i ' and node i ' is from the first tree-like file Then all downstream sites of node i and the second tree structure interior joint i are pressed by middle deletion at S308 Add to first according to original path and attribute information (path in the i.e. second tree structure and attribute information) In tree structure, for ease of distinguishing, node i adds to the first tree structure referred to as node i ".At S308 In complete node add after, whether be root node in S309 decision node i.
If the judged result of S303 is " merging " (the most non-" replacement "), then at S304 by node i ', the node i after merging " there is node i and the node i ' all properties that had that is incorporated into node i, right In node i and node i ' attribute that all has, preferably node i " the value of this attribute and node i should The property value of attribute is identical.Then whether there is child node in S305 decision node i.If sentenced at S305 Disconnected node i has child node, then select first (i.e. sort before) from the child node of node i at S306 Child node, as new node to be combined, is then return to S302.If do not had in S305 decision node i At S309, child node, then continue whether decision node i is root node.
If being root node in S309 decision node i, then for the tree-like knot of the first tree structure and second The merging of structure terminates (S317).If not being root node in S309 decision node i, the most further at S310 Whether decision node i has the follow-up brotgher of node.If S310 decision node i has the follow-up brotgher of node, Then select the later brotgher of node of node i as new joint to be combined at S311, be then return to S302. If S310 decision node i does not has the follow-up brotgher of node, then select the father node of node i at S312 As backtracking node.Judge to recall whether node is root node at S313, if the judged result of S313 For "Yes", then the merging for the first tree structure and the second tree structure terminates (S317);If The judged result of S313 is "No", then determine whether currently to recall whether node has follow-up at S314 The brotgher of node.If the judged result of S314 is "Yes", then select currently to recall node at S316 The later brotgher of node as new node to be combined, be then return to S302.If the judgement of S314 Result is "No", then S315 select the father node of current backtracking node as new backtracking node, so After return to S313.By recalling step by step, until dateing back root node, (i.e. the judged result of S313 is "Yes"), then the merging for the first tree structure and the second tree structure terminates (S317).
Add, if the current node to be combined selected is configured to need deletion of node, this can not be treated Merge node and merge operation, and delete corresponding with this node to be combined from the first tree structure Node (if there is).Then S310 (usual root node will not be configured to need deletion of node) is jumped directly to And complete the merging treatment for other nodes follow-up.
According to a further aspect in the invention, it is provided that a kind of device for merging tree structure, this is tree-like Structure includes the first tree structure and the second tree structure, and this device includes: node selects unit, described Node selects unit to select node to be combined from the second tree structure;Node combining unit, described node Combining unit merges process to described node to be combined.Described merging treatment includes: judge described Whether one tree structure exists the node corresponding with described node to be combined, and holds according to judged result The following one of row: there is the node corresponding with described node to be combined in described first tree structure In the case of, described node to be combined is incorporated in described first tree structure and described node phase to be combined Corresponding node;And in described first tree structure, there is not the joint corresponding with described node to be combined In the case of Dian, described node to be combined is added to described first tree structure and this node to be combined The corresponding node of father node under.Wherein, identification information based on node determines different tree form structure In node the most in correspondence with each other.
Preferably, described node to be combined is incorporated in described first tree structure and described joint to be combined The corresponding node of point includes following at least one:
In the case of one-level consolidation strategy is " merging ", the node after merging has described joint to be combined The all properties that the some node corresponding with described and described node to be combined is had;And
In the case of one-level consolidation strategy is " replacement ", the node after merging only has described to be combined The all properties that node is had.
Preferably, in the case of one-level consolidation strategy is " merging ": for described node to be combined and Attribute that the corresponding node of described and described node to be combined is respectively provided with and the most described node to be combined The attribute being had, the property value of this attribute of the node after described merging is equal to described node to be combined The property value of this attribute;And had for the only described node corresponding with described node to be combined Attribute, the property value of this attribute of the node after described merging is relative equal to described and described node to be combined The property value of this attribute of the node answered.
Preferably, described first tree structure exists the node corresponding with described node to be combined In the case of, described node combining unit is additionally based upon two grades of consolidation strategies and processes institute in described second tree structure State the downstream site of node to be combined.
It is preferably based on two grades of consolidation strategies and processes node to be combined described in described second tree structure Downstream site includes following at least one: in the case of described two grades of consolidation strategies are for " merging ", by Described node select unit select successively the child node of described node to be combined as new node to be combined, Described node combining unit carries out described merging treatment to the node to be combined that this is new;In described two grades of merging In the case of strategy is " front slotting ", described node combining unit is by all subordinates of described node to be combined Node adds to described first tree structure according to original path and original attribute information, and described in treat The downstream site merging node is added to the subordinate of the described node corresponding with described node to be combined Before node;In the case of described two grades of consolidation strategies are " adding ", described node combining unit will All downstream sites of described node to be combined add to described according to original path and original attribute information In first tree structure, and the downstream site of described node to be combined is added to described close with described waiting And after the downstream site of the corresponding node of node;In the feelings that described two grades of consolidation strategies are " covering " Under condition, described node combining unit by all downstream sites of described node to be combined according to original path and Original attribute information adds to described first tree structure, and deletes described and described node to be combined The original downstream site of corresponding node.
Preferably, described node to be combined is added to described first tree structure and this node to be combined The corresponding node of father node under include: the attribute of this node added to described first tree structure Information is identical with the attribute information of node to be combined described in described second tree structure.
Preferably, described first tree structure does not exist the node corresponding with described node to be combined In the case of, described node combining unit owning node to be combined described in described second tree-like file Downstream site adds to described first tree structure according to original path and original attribute information.
Preferably, after selecting node to be combined from the second tree structure, if described node to be combined It is configured to need deletion of node, then the tree structure after merging does not includes relative with described node to be combined The node answered.
Preferably, before selecting node to be combined from the second tree structure, described node combining unit base Identical with the described identification information of the root node of described second tree structure next in described first tree structure Determine described first tree structure of merging and described second tree structure.
Preferably, described first tree structure and described second tree structure are stored in different files In.
Preferably, described in same tree structure, identification information can uniquely identify node.
Preferably, the described identification information of node includes the routing information of this node and the title letter of this node Breath.
Preferably, the described identification information of the node being indicated as collector node also includes that this node is in set Interior number information.
Can be real in the computer program combined with computer-readable medium, software and/or firmware Executing said method and device, this computer-readable medium can be run by computer and/or processor.Computer The example of computer-readable recording medium include but not limited to the signal of telecommunication (by wiredly and/or wirelessly connecting transmission) and/ Or computer-readable recording medium.The example of computer-readable recording medium includes but not limited to read-only storage Device (ROM), random access memory (RAM), depositor, cache memory, quasiconductor Storage arrangement, magnetizing mediums (such as, but not limited to internal hard drive and moveable magnetic disc), magnet-optical medium, And/or such as CD-ROM disk and/or the optical medium of digital versatile disc (DVD).
The preferred embodiment of the present invention is described in detail above in association with accompanying drawing, but, the present invention does not limit Detail in above-mentioned embodiment, in the technology concept of the present invention, can be to the present invention Technical scheme carry out multiple simple deformation, these simple deformation belong to protection scope of the present invention.
It is further to note that each the concrete technology described in above-mentioned detailed description of the invention is special Levy, in the case of reconcilable, can be combined by any suitable means.In order to avoid need not The repetition wanted, various possible compound modes are illustrated by the present invention the most separately.
Additionally, combination in any can also be carried out between the various different embodiment of the present invention, as long as its Without prejudice to the thought of the present invention, it should be considered as content disclosed in this invention equally.

Claims (10)

1., for the method that merges tree structure, this tree structure includes the first tree structure and the Two tree structures, the method includes:
Node to be combined is selected from the second tree structure;
Described node to be combined is merged process, and described merging treatment includes:
Judge whether described first tree structure exists the joint corresponding with described node to be combined Point, and according to the judged result following one of execution:
The node corresponding with described node to be combined is there is in described first tree structure In the case of, described node to be combined is incorporated in described first tree structure and described joint to be combined The node that point is corresponding;And
The node corresponding with described node to be combined is there is not in described first tree structure In the case of, described node to be combined is added to described first tree structure and this joint to be combined Under the corresponding node of father node of point;
Wherein, identification information based on node determines that the node in different tree form structure is the most mutual Corresponding.
Method the most according to claim 1, wherein, is incorporated into described by described node to be combined Node corresponding with described node to be combined in first tree structure includes following at least one:
In the case of one-level consolidation strategy is " merging ", the node after merging has described joint to be combined The all properties that the some node corresponding with described and described node to be combined is had;And
In the case of one-level consolidation strategy is " replacement ", the node after merging only has described to be combined The all properties that node is had.
Method the most according to claim 2, wherein, is " merging " at one-level consolidation strategy In the case of,
It is respectively provided with for the node that described node to be combined is corresponding with described and described node to be combined The attribute that attribute and the most described node to be combined are had, the genus of this attribute of the node after described merging Property value equal to the property value of this attribute of described node to be combined;And
The attribute being had for the only described node corresponding with described node to be combined, after described merging The property value of this attribute of node equal to this genus of the corresponding node of described and described node to be combined The property value of property.
Method the most according to claim 1, wherein, described merging treatment also includes:
In the case of there is the node corresponding with described node to be combined in described first tree structure, The downstream site of node to be combined described in described second tree structure is processed based on two grades of consolidation strategies.
Method the most according to claim 4, wherein, processes described the based on two grades of consolidation strategies The downstream site of node to be combined described in two tree structures includes following at least one:
In the case of described two grades of consolidation strategies are " merging ", select described node to be combined successively Child node is as new node to be combined, and the node to be combined that this is new is carried out described merging treatment;
In the case of described two grades of consolidation strategies are " front insert ", by described node to be combined all under Level node adds to described first tree structure according to original path and original attribute information, and described The downstream site of node to be combined is added under the described node corresponding with described node to be combined Before level node;
In the case of described two grades of consolidation strategies are " adding ", by described node to be combined all under Level node adds to described first tree structure according to original path and original attribute information, and described The downstream site of node to be combined is added under the described node corresponding with described node to be combined After level node;
In the case of described two grades of consolidation strategies are " covering ", by described node to be combined all under Level node adds to described first tree structure according to original path and original attribute information, and deletes The original downstream site of node that described and described node to be combined is corresponding.
6., for merging the device of tree structure, this tree structure includes the first tree structure and the Two tree structures, this device includes:
Node selects unit, and described node selects unit to select node to be combined from the second tree structure;
Node combining unit, described node combining unit merges process to described node to be combined, institute State merging treatment to include:
Judge whether described first tree structure exists the joint corresponding with described node to be combined Point, and according to the judged result following one of execution:
The node corresponding with described node to be combined is there is in described first tree structure In the case of, described node to be combined is incorporated in described first tree structure and described joint to be combined The node that point is corresponding;And
The node corresponding with described node to be combined is there is not in described first tree structure In the case of, described node to be combined is added to described first tree structure the father with this node to be combined Under the node that node is corresponding;
Wherein, identification information based on node determines that the node in different tree form structure is the most mutual Corresponding.
Device the most according to claim 6, wherein, is incorporated into described by described node to be combined Node corresponding with described node to be combined in first tree structure includes following at least one:
In the case of one-level consolidation strategy is " merging ", the node after merging has described joint to be combined The all properties that the some node corresponding with described and described node to be combined is had;And
In the case of one-level consolidation strategy is " replacement ", the node after merging only has described to be combined The all properties that node is had.
Device the most according to claim 7, wherein, is " merging " at one-level consolidation strategy In the case of,
It is respectively provided with for the node that described node to be combined is corresponding with described and described node to be combined The attribute that attribute and the most described node to be combined are had, the genus of this attribute of the node after described merging Property value equal to the property value of this attribute of described node to be combined;And
The attribute being had for the only described node corresponding with described node to be combined, after described merging The property value of this attribute of node equal to this genus of the corresponding node of described and described node to be combined The property value of property.
Device the most according to claim 6, wherein:
In the case of there is the node corresponding with described node to be combined in described first tree structure, Described node combining unit is additionally based upon described in two grades of consolidation strategies described second tree structures of process and waits to close And the downstream site of node.
Device the most according to claim 9, wherein, processes described the based on two grades of consolidation strategies The downstream site of node to be combined described in two tree structures includes following at least one:
In the case of described two grades of consolidation strategies are " merging ", described node unit is selected to select successively Selecting the child node of described node to be combined as new node to be combined, described node combining unit is new to this Node to be combined carry out described merging treatment;
In the case of described two grades of consolidation strategies are " front slotting ", described node combining unit is treated described The all downstream sites merging node add to described first tree according to original path and original attribute information In shape structure, and the downstream site of described node to be combined is added to described and described node to be combined Before the downstream site of corresponding node;
In the case of described two grades of consolidation strategies are " adding ", described node combining unit is treated described The all downstream sites merging node add to described first tree according to original path and original attribute information In shape structure, and the downstream site of described node to be combined is added to described and described node to be combined After the downstream site of corresponding node;
In the case of described two grades of consolidation strategies are " covering ", described node combining unit is treated described The all downstream sites merging node add to described first tree according to original path and original attribute information In shape structure, and delete the described node original downstream site corresponding with described node to be combined.
CN201510309143.5A 2015-06-08 2015-06-08 For the method and apparatus merging tree structure Pending CN106156265A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510309143.5A CN106156265A (en) 2015-06-08 2015-06-08 For the method and apparatus merging tree structure

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510309143.5A CN106156265A (en) 2015-06-08 2015-06-08 For the method and apparatus merging tree structure

Publications (1)

Publication Number Publication Date
CN106156265A true CN106156265A (en) 2016-11-23

Family

ID=57348324

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510309143.5A Pending CN106156265A (en) 2015-06-08 2015-06-08 For the method and apparatus merging tree structure

Country Status (1)

Country Link
CN (1) CN106156265A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106933744A (en) * 2017-03-21 2017-07-07 网易(杭州)网络有限公司 Node revision status indication method and device, electronic equipment and storage medium
CN109033323A (en) * 2018-07-18 2018-12-18 中国人民解放军91776部队 A kind of tree structure basic data change record method based on operator
CN110689418A (en) * 2019-09-27 2020-01-14 支付宝(杭州)信息技术有限公司 Bill generation method and device
CN111612388A (en) * 2019-02-26 2020-09-01 北京京东尚科信息技术有限公司 Method and device for merging target orders
CN112819160A (en) * 2021-02-24 2021-05-18 文远鄂行(湖北)出行科技有限公司 Visualization method, device, equipment and storage medium of neural network model
CN113711146A (en) * 2019-04-17 2021-11-26 阿自倍尔株式会社 Management system

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106933744A (en) * 2017-03-21 2017-07-07 网易(杭州)网络有限公司 Node revision status indication method and device, electronic equipment and storage medium
CN109033323A (en) * 2018-07-18 2018-12-18 中国人民解放军91776部队 A kind of tree structure basic data change record method based on operator
CN109033323B (en) * 2018-07-18 2020-10-23 中国人民解放军91776部队 Tree structure basic data change recording method based on operator
CN111612388A (en) * 2019-02-26 2020-09-01 北京京东尚科信息技术有限公司 Method and device for merging target orders
CN113711146A (en) * 2019-04-17 2021-11-26 阿自倍尔株式会社 Management system
CN110689418A (en) * 2019-09-27 2020-01-14 支付宝(杭州)信息技术有限公司 Bill generation method and device
CN112819160A (en) * 2021-02-24 2021-05-18 文远鄂行(湖北)出行科技有限公司 Visualization method, device, equipment and storage medium of neural network model
CN112819160B (en) * 2021-02-24 2023-10-31 文远鄂行(湖北)出行科技有限公司 Visualization method, device and equipment for neural network model and storage medium

Similar Documents

Publication Publication Date Title
CN106156265A (en) For the method and apparatus merging tree structure
Teubner Rights of non‐humans? Electronic agents and animals as new actors in politics and law
CN104811465B (en) The decision-making technique and equipment of a kind of access control
US20070260971A1 (en) Computer-implemented methods and systems for electronic document inheritance
CN103093038B (en) The update method of a kind of BOM and device
CN109118353B (en) Data processing method and device of wind control model
CN106227666A (en) A kind of automated testing method based on big data and system
CN101887464A (en) Method and device for displaying data in database
CN108241632A (en) A kind of data verification method of data base-oriented Data Migration
CN103324576A (en) Memory space changing method and electronic equipment
CN104486421A (en) Realization method for business policy management on cloud platform of wireless business system
CN110968894B (en) Fine granularity access control scheme for game service data
CN104679510B (en) The fault tree generation method of the extensible SQL class graph model of Safety-Critical System
Kleppmann Moving elements in list CRDTs
CN103678138A (en) Method and device for generating state conversion test samples
US20130198215A1 (en) Method for Forming Database on Basis of Relationship Between Video Data, and Database Formation System
Al-Abdulkarim et al. Angelic secrets: bridging from factors to facts in US Trade Secrets
KR101761177B1 (en) Method for mining important pattern of high rank k, apparatus performing the same and storage medium storing the same
WO2023030461A1 (en) Distributed database detection method and apparatus
CN106777310A (en) The method of calibration and device of information
CN104969186A (en) An interface for creating a plan artifact
CN105335160A (en) Method for agile development of WEB-side components based JSF (Java Server Face)
CN106657227A (en) Method and device for changing subscription resources
CN105302728B (en) The method of testing and device of SAP interfaces
CN106970795A (en) A kind of information interacting method and system

Legal Events

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

Application publication date: 20161123

RJ01 Rejection of invention patent application after publication