CN115599961A - Method and device for processing tree structure of service - Google Patents

Method and device for processing tree structure of service Download PDF

Info

Publication number
CN115599961A
CN115599961A CN202211314128.6A CN202211314128A CN115599961A CN 115599961 A CN115599961 A CN 115599961A CN 202211314128 A CN202211314128 A CN 202211314128A CN 115599961 A CN115599961 A CN 115599961A
Authority
CN
China
Prior art keywords
node
tree structure
service
target
update
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
CN202211314128.6A
Other languages
Chinese (zh)
Inventor
陈亮
张磊
王颖
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alibaba China Co Ltd
Original Assignee
Alibaba China 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 Alibaba China Co Ltd filed Critical Alibaba China Co Ltd
Priority to CN202211314128.6A priority Critical patent/CN115599961A/en
Publication of CN115599961A publication Critical patent/CN115599961A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/901Indexing; Data structures therefor; Storage structures
    • G06F16/9027Trees
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Abstract

The embodiment of the application provides a method and a device for processing a tree structure of a service, wherein the method comprises the following steps: and acquiring a service adjusting instruction, wherein the service adjusting instruction is used for indicating the adjusting operation of the target service. And acquiring a first tree structure corresponding to the target service, wherein the first tree structure comprises a plurality of original nodes, and the original nodes correspond to operation links in the target service. And determining a first node corresponding to the adjustment operation in the plurality of original nodes. And generating an updating node corresponding to the first node according to the service adjusting instruction, forming a second tree structure by the updating node and the second nodes left in the plurality of original nodes except the first node, wherein the second nodes are the nodes multiplexed by the first tree structure and the second tree structure. And determining node information of the update node, wherein the node information is used for indicating the version of the update node and the dependency relationship of the update node. The technical scheme of the application can effectively reduce the number of nodes needing to be maintained in the service adjusting process.

Description

Method and device for processing tree structure of service
Technical Field
The embodiment of the application relates to computer technologies, and in particular, to a method and an apparatus for processing a tree structure of a service.
Background
The tree structure is a very important data structure, and in some service scenarios, calculation or decision can be simply and effectively realized through the tree structure.
Currently, in the related art, after a tree structure is constructed for a certain service scenario, if it is said that some service logics in the service scenario are changed, an update needs to be performed for corresponding nodes in the tree structure. Meanwhile, due to the need of historical data backtracking calculation and the characteristics of interdependence between tree nodes, the current processing mode is to create a new tree structure and update corresponding nodes in the new tree structure.
However, since the new tree structure and the old tree structure are simultaneously stored, the number of nodes of the tree structure to be maintained is increased sharply with frequent changes of service requirements, and thus the number of nodes to be maintained is increased.
Disclosure of Invention
The embodiment of the application provides a method and a device for processing a tree structure of a service, so as to overcome the problem that the number of nodes needing to be maintained is large.
In a first aspect, an embodiment of the present application provides a method for processing a tree structure of a service, including:
acquiring a service adjusting instruction, wherein the service adjusting instruction is used for indicating the adjusting operation of a target service;
acquiring a first tree structure corresponding to the target service, wherein the first tree structure comprises a plurality of original nodes, and the original nodes correspond to operation links in the target service;
determining a first node corresponding to the adjustment operation in the plurality of original nodes;
generating an updated node corresponding to the first node according to the service adjustment instruction, wherein the updated node and a remaining second node except the first node in the plurality of original nodes form a second tree structure, and the second node is a node multiplexed by the first tree structure and the second tree structure;
determining node information of the update node, wherein the node information is used for indicating the version of the update node and the dependency relationship of the update node.
In a second aspect, an embodiment of the present application provides an apparatus for processing a tree structure of a service, including:
the system comprises an acquisition module, a service adjusting module and a service processing module, wherein the acquisition module is used for acquiring a service adjusting instruction which is used for indicating the adjustment operation of a target service;
the obtaining module is further configured to obtain a first tree structure corresponding to the target service, where the first tree structure includes a plurality of original nodes, and the original nodes correspond to operation links in the target service;
a determining module, configured to determine, in the multiple original nodes, a first node corresponding to the adjustment operation;
a processing module, configured to generate, according to the service adjustment instruction, an updated node corresponding to the first node, where the updated node and a remaining second node, except the first node, in the multiple original nodes form a second tree structure, and the second node is a node multiplexed by the first tree structure and the second tree structure;
the processing module is further configured to determine node information of the update node, where the node information is used to indicate a version of the update node and a dependency relationship of the update node.
In a third aspect, an embodiment of the present application provides a device for processing a tree structure of a service, including:
a memory for storing a program;
a processor for executing the program stored by the memory, the processor being adapted to perform the method of the first aspect as well as any of the various possible designs of the first aspect, when the program is executed.
In a fourth aspect, embodiments of the present application provide a computer-readable storage medium, which includes instructions that, when executed on a computer, cause the computer to perform the method as described above in the first aspect and any one of various possible designs of the first aspect.
In a fifth aspect, embodiments of the present application provide a computer program product comprising a computer program that, when executed by a processor, implements the method as described above in the first aspect and any one of various possible designs of the first aspect.
The embodiment of the application provides a method and a device for processing a tree structure of a service, wherein the method comprises the following steps: and acquiring a service adjusting instruction, wherein the service adjusting instruction is used for indicating the adjusting operation of the target service. And acquiring a first tree structure corresponding to the target service, wherein the first tree structure comprises a plurality of original nodes, and the original nodes correspond to operation links in the target service. And determining a first node corresponding to the adjustment operation in the plurality of original nodes. And generating an updating node corresponding to the first node according to the service adjusting instruction, forming a second tree structure by the updating node and the second nodes left in the plurality of original nodes except the first node, wherein the second nodes are the nodes multiplexed by the first tree structure and the second tree structure. And determining node information of the update node, wherein the node information is used for indicating the version of the update node and the dependency relationship of the update node. When the service adjustment is needed, a first node needing to be adjusted is determined in the first tree structure according to the service adjustment instruction, and then a corresponding update node is generated only aiming at the first node needing to be adjusted according to the service adjustment instruction. And then, a second tree structure is formed according to the updated nodes and the unadjusted second nodes, and the maintenance of the second tree structure can be effectively realized by determining the node information of the updated nodes, so that the technical scheme of the application can realize the updating of the corresponding tree structure based on the service adjustment, and can effectively reduce the number of the nodes needing to be maintained.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present application, and those skilled in the art can obtain other drawings without inventive labor.
Fig. 1 is a schematic structural diagram of a tree structure provided in an embodiment of the present application;
fig. 2 is a schematic diagram illustrating an implementation of adjusting a tree structure according to an embodiment of the present application;
fig. 3 is a flowchart of a method for processing a tree structure of a service according to an embodiment of the present application;
fig. 4 is a second flowchart of a tree structure processing method of a service provided in the embodiment of the present application;
fig. 5 is a schematic diagram illustrating an implementation of tree structure adjustment according to an embodiment of the present application;
FIG. 6 is a schematic interface diagram of a processing tree structure according to an embodiment of the present application;
fig. 7 is a flow chart of a tree structure processing method of a service according to the embodiment of the present application;
fig. 8 is a schematic interface diagram of a service information query provided in an embodiment of the present application;
FIG. 9 is a schematic diagram of an implementation of determining a target tree structure according to an embodiment of the present application;
fig. 10 is a schematic structural diagram of a tree structure processing apparatus of a service according to an embodiment of the present application;
fig. 11 is a schematic hardware structure diagram of a tree structure processing device of a service according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present application without making any creative effort belong to the protection scope of the present application.
In order to better understand the technical solution of the present application, the following provides further detailed description of the related art related to the present application.
The tree structure is a very important data structure, and in some application scenarios, the tree structure can simply and effectively realize calculation or decision.
For example, in a scenario of sales pricing or salary calculation, for example, a data engineer may split a business index into multiple logically independent sub-indexes according to the meaning of the index (i.e., business logic relationship), and then the sub-indexes may construct a tree structure according to the dependency relationship and the hierarchical structure, where the tree structure may also be understood as a rule tree.
Some classifications of indices will be described first herein, where an atomic index refers to an index that is processed using raw data without any limiting conditions. The derived index is an index generated by adding a constraint to the processing logic of the atomic index. The composite index is obtained by performing operations such as addition, subtraction, multiplication, division and the like on the original value index or the derivative index.
The tree structure has the advantages of simplifying calculation, visualizing the calculation process and the like. It can be understood that the upper level index in the tree structure needs to maintain the relationship with the adjacent lower level sub-index, and the calculation of the upper level index depends on the calculation of the lower level index, for example, necessary parameters can be introduced into the tree structure, and the leaf index can be calculated from the leaf index up along the index dependency layer by layer until the value of the index referred by the tree root is calculated.
For example, the scenario of calculating salary is taken as an example, and the above description is understood with reference to fig. 1, where fig. 1 is a schematic structural diagram of a tree structure provided in the embodiment of the present application.
As shown in fig. 1, fig. 1 shows a tree structure in which 7 nodes are included. The index corresponding to the node E is monthly total performance, and the index corresponding to the node F is monthly renewal performance.
And the D node is an upper node of the E node and the F node, and there is a dependency relationship between the D node and the E node and the F node, where the index calculation corresponding to the D node is calculated in dependence on the index of the lower node, and in the example of fig. 1, the relationship between the index calculation corresponding to D and the index calculation between the E node and the F node is D = E10% + F5%.
And, the index corresponding to the node C in fig. 1 is the late count. The node a is an upper node of the node C and the node D, and there is a dependency relationship between the node a and the node C and the node D, where the index calculation corresponding to the node a is index calculation dependent on the lower node, and in the example of fig. 1, the relationship between the index calculation corresponding to the node a and the index calculation between the node C and the node D is a = D5% -C100.
And, the index corresponding to the node B in fig. 1 is the language allowance. The R node is an upper node of the a node and the B node, and there is a dependency relationship between the R node and the a node and the B node, where the metric calculation corresponding to the R node is calculated depending on the metric of the lower node, and in the example of fig. 1, the relationship between the metric calculation corresponding to R and the metric calculation between the a node and the B node is R = a + B. For example, the R index corresponds to the final salary calculated.
When the salary is calculated, the salary of a specific employee can be calculated by acquiring the monthly total performance, the monthly renewal performance, the tardiness and the language allowance of the employee and transmitting the data into the tree structure.
Fig. 1 above schematically shows a tree structure in a salary calculation scenario. In the actual implementation process, the specific implementation of the tree structure, the meaning represented by each node in the tree structure, and the relationship between each node in the tree structure may be selected and set according to actual requirements, which is not limited in this embodiment. And the specific application scenario of the tree structure may also be expanded according to actual requirements, for example, the tree structure may also be applied to some decision scenarios, and the specific implementation of the application scenario is not particularly limited in this embodiment.
After a rule tree is constructed for a certain service scenario, if it is said that the service logic in the service scenario changes, the corresponding tree structure needs to be adjusted.
The tree structure adjustment can be mainly divided into two types, one is intra-index adjustment and the other is inter-index adjustment.
The intra-index adjustment usually has a large relationship with the calculation logic change, and includes adjustment of the coefficient size of a certain variable of the index, and adjustment of the operation relationship between variables (addition, subtraction, multiplication and division) constituting the index. For example, in the example shown in fig. 1, the index calculation corresponding to the node a is a = D × 5% -C × 100. For example, the coefficients in this calculation rule may be adjusted, for example, to a = D10% -C100. Alternatively, the calculation rule may be adjusted to the operational relationship, for example, a = D × 10% + C × 100.
And the adjustment between indexes is usually more related to the change of business logic, for example, in some cases, all the lower-layer sub indexes may be replaced by completely different new indexes. For example, in the example shown in fig. 1, the index meaning corresponding to the node C is the late arrival times, and if the index meaning of the node C is replaced by the unit time overtime.
It can be understood that, with the development of services, the computation logic and service logic corresponding to the nodes in the tree structure may be frequently adjusted, and due to the need of historical data backtracking computation, the currently commonly adopted adjustment method is to create a new tree structure, adjust the computation logic of the nodes in the new tree structure, and store and maintain both the old tree structure and the new tree structure.
For example, the implementation of the current adjustment tree structure can be understood by referring to fig. 2, and fig. 2 is a schematic diagram of an implementation of the adjustment tree structure provided in the embodiment of the present application.
As shown in fig. 2, the tree structure 201 is assumed to be an original tree structure, i.e., the tree structure illustrated in fig. 1 described above.
Assuming that the computation logic for node a in the tree structure 201 is adjusted, the index computation corresponding to node a is adjusted to a = D10% -C100. And because node R is node a dependent, it is adjusted accordingly for node R.
Then, it is possible to obtain that in the tree structure 202 in fig. 2, the node a is adjusted to be the node a 'and the node R is adjusted to be the node R' compared to the tree structure 201.
The above describes a service adjustment process, and assuming that a next service adjustment is required after the service adjustment, the adjustment is continued on the basis of the tree structure 202.
Assuming that the computation logic for the node D in the tree structure 202 is adjusted, the index computation corresponding to the node D is adjusted to D = (E + F) × 10%. And because the node A ' is dependent on the node D, and the node R ' is dependent on the node A ', the node R ' and the node A ' are adjusted accordingly.
Then, it is also possible to obtain the tree structure 203 in fig. 2, in which the node D is adjusted to be the node D ', the node a ' is adjusted to be the node a ″ and the node R ' is adjusted to be the node R ″ compared to the tree structure 202.
Based on the example of fig. 2 above, it is actually two simple traffic adjustments, after which three tree structures have been obtained. And the total number of nodes in the three tree structures has reached 21.
For example, the tree structure 201 described above is a payroll tree structure for a certain employee in month 9, then the tree structure 202 is a payroll tree structure for a certain employee in month 10, and then the tree structure 203 is a payroll tree structure for a certain employee in month 11. Then, say in month 11, the payroll of this employee in month 9 needs to be calculated back again, and then the tree structure 201 needs to be called. Therefore, for the need of historical data backtracking calculation, the tree structure of each version is usually saved in the prior art, and nodes in the tree structure of each version are maintained.
However, it can be determined based on the above description that performing two service adjustments on two nodes in an exemplary simple tree structure results in a multiple increase of the tree structure and the number of nodes to be maintained, and in an actual implementation process, if the above implementation manner is used, the tree structure and the number of indexes are doubled, and for a complex tree structure that may include a large number of service indexes, the multiple increase of the number of indexes results in a sharp increase of maintenance complexity and cost.
Based on the above description, it can be determined that in the case of rapid change of index calculation logic, the current research focus needs to shift from how to calculate the index to how to better manage and maintain the index. Therefore, the method for calculating, maintaining and managing the indexes at low cost under the condition that the service logic changes frequently is provided.
The technical idea of the application is as follows: although the service adjustment needs to update the corresponding child node, in practice, each service adjustment usually only affects a small range of child indexes, so that the characteristic can be fully utilized, and unchanged nodes are multiplexed, thereby effectively controlling the number of total indexes of new and old tree structures, and reducing the complexity of maintaining the tree structures.
Based on the above introduction, the following describes a tree structure processing method for services provided by the present application with reference to a specific embodiment. It should be noted that the execution main body in each embodiment of the present application may be a device with a data processing function, such as a server, a processor, a chip, and the like, and the embodiment does not limit an implementation manner of a specific execution main body, and the execution main body may be selected and set according to actual requirements.
First, referring to fig. 3, fig. 3 is a flowchart of a method for processing a tree structure of a service according to an embodiment of the present disclosure.
As shown in fig. 3, the method includes:
s301, a service adjusting instruction is obtained, and the service adjusting instruction is used for indicating the adjusting operation of the target service.
In this embodiment, a service adjustment instruction may be obtained, where the service adjustment instruction may be input by a user, for example. In one possible implementation, the service adjustment instruction is used to indicate an adjustment operation on the target service. The target business is, for example, a salary calculation business, and may be, for example, a cost calculation business, which is not limited in this embodiment.
And, the adjustment operation of the target business may be, for example, to adjust the business logic of the target business, such as in salary calculation business, adjusting the meaning of the calculation index, or adjusting the calculation logic of the calculation index, etc. In the actual implementation process, the specific indication condition of the service adjustment instruction can be selected and set according to the actual requirement.
S302, a first tree structure corresponding to the target service is obtained, wherein the first tree structure comprises a plurality of original nodes, and the original nodes correspond to operation links in the target service.
In this embodiment, the implementation of adjusting the tree structure according to the adjustment operation indicated by the service adjustment instruction is described, and different services correspond to different tree structures, so that a first tree structure corresponding to a target service needs to be obtained first.
In this embodiment, the nodes in the first tree structure are referred to as original nodes, where each original node can be understood as corresponding to an operation link in a target service, and the operation links of the original nodes together form processing logic of the target service.
And in a possible implementation manner, each original node may correspond to respective service information. For example, in the above-described example, the index corresponding to the C node is the late time, and then the service information corresponding to the C node may be the late time.
Or the service information may also be the calculation logic of the node corresponding to the lower layer index, for example, in the above-described example, the R node corresponding to the lower layer index calculation logic is the sum of the index of the a node and the index of the B node. Meanwhile, the R node in the above example also has its own target meaning, i.e. salary.
In the actual implementation process, the specific implementation of the service information of each node may be designed according to the actual service scenario and the service requirement, which is not limited in this embodiment.
S303, determining a first node corresponding to the adjustment operation in the plurality of original nodes.
It can be understood that the service adjustment instruction in this embodiment is used to instruct to adjust the target service, and a specific operation link of the target service is embodied in each element node in the first tree structure, and then the adjustment operation instructed by the service adjustment instruction is reflected in the first tree structure, so that it can be understood that the service adjustment instruction instructs to adjust the service information of some original nodes, but nodes in the tree structure have a dependency relationship, and therefore, the service information of some original nodes is adjusted, and correspondingly, the service information of upper nodes depending on these original nodes also needs to be adjusted accordingly, that is, the adjustment operation instructed by the service adjustment instruction relates to a certain adjustment range.
Therefore, in this embodiment, the first node corresponding to the adjustment operation, that is, the node related to the service adjustment instruction and requiring adjustment of the service information, may be determined from the plurality of original nodes.
S304, according to the service adjusting instruction, generating an updating node corresponding to the first node, forming a second tree structure by the updating node and the remaining second nodes except the first node in the plurality of original nodes, wherein the second nodes are the nodes multiplexed by the first tree structure and the second tree structure.
After the first node is determined, the service information of the first node needs to be correspondingly adjusted in response to the service adjustment instruction, so in this embodiment, an updated node corresponding to the first node may be generated according to the service adjustment instruction.
And updating the service information of the node, namely the node after the adjustment corresponding to the service adjustment instruction is performed.
After generating the corresponding updated node for the first node needing to be adjusted, the remaining second nodes except the first node may be determined among the plurality of element nodes, where the updated node and the second nodes may form a second tree structure. It will be appreciated that the second tree structure is an adapted tree structure based on the first tree structure.
Since the second node is an unchanged node, multiplexing between the first tree structure and the second tree structure is possible. Therefore, for the unchanged nodes, additional creation and maintenance are not needed, so that the number of the nodes needing to be maintained can be effectively reduced, and the number of the nodes needing to be maintained is further reduced.
S305, determining node information of the update node, wherein the node information is used for indicating the version of the update node and the dependency relationship of the update node.
After the update node is determined, the update node and the second node already form the second tree structure, and since only the update node is the newly added node, the node information of the update node may be generated in this embodiment.
In one possible implementation, after determining the node information of the update node, the node information of the update node may be stored in a database, for example, to achieve effective maintenance of the update node and the second tree structure.
Since the second node is an originally existing node and the node information thereof is already stored in the database, after the node information of the update node is stored in the database, the storage of the second tree structure is actually implemented, and the node information in this embodiment may indicate the version of the update node and the dependency relationship of the update node.
The method for processing the tree structure of the service provided by the embodiment of the application comprises the following steps: and acquiring a service adjusting instruction, wherein the service adjusting instruction is used for indicating the adjusting operation of the target service. And acquiring a first tree structure corresponding to the target service, wherein the first tree structure comprises a plurality of original nodes, and the original nodes correspond to operation links in the target service. And determining a first node corresponding to the adjustment operation in the plurality of original nodes. And generating an updating node corresponding to the first node according to the service adjusting instruction, forming a second tree structure by the updating node and the second nodes left in the plurality of original nodes except the first node, wherein the second nodes are the nodes multiplexed by the first tree structure and the second tree structure. And determining node information of the update node, and storing the node information of the update node in a database, wherein the node information is used for indicating the version of the update node and the dependency relationship of the update node. When the service adjustment is needed, a first node needing to be adjusted is determined in the first tree structure according to the service adjustment instruction, and then a corresponding update node is generated only aiming at the first node needing to be adjusted according to the service adjustment instruction. And then, a second tree structure is formed according to the updated nodes and the unadjusted second nodes, and the maintenance of the second tree structure can be effectively realized by determining the node information of the updated nodes, so that the technical scheme of the application can realize the updating of the corresponding tree structure based on the service adjustment, and can effectively reduce the number of the nodes needing to be maintained.
Based on the foregoing embodiment, the following describes in further detail a tree structure processing method for a service provided by the present application with reference to fig. 4 to 5, where fig. 4 is a second flowchart of the tree structure processing method for a service provided by the present application, and fig. 5 is a schematic implementation diagram of tree structure adjustment provided by the present application.
As shown in fig. 4, the method includes:
s401, a service adjusting instruction is obtained, and the service adjusting instruction is used for indicating the adjusting operation of the target service.
Wherein, the implementation manner of S401 is similar to the implementation manner of S301 introduced above.
S402, obtaining a first tree structure corresponding to the target service, wherein the first tree structure comprises a plurality of original nodes, and the original nodes correspond to operation links in the target service.
Wherein, the implementation manner of S402 is similar to the implementation manner of S302 described above.
In the following description with reference to fig. 5, it is assumed that the first tree structure corresponding to the target service is the first tree structure shown in 501 in fig. 5 and composed of node R, node a, node B, node C, node D, node E, and node F. These nodes can also be understood as the original nodes in this embodiment, where the service information corresponding to each original node can be understood, for example, with reference to the example in fig. 1.
S403, determining a third node in the plurality of original nodes according to the service adjusting instruction.
In this embodiment, the service adjustment instruction is used to instruct to adjust the service information corresponding to the third node in the first tree structure.
The adjustment of the service information for the third node may be, for example, adjustment of the index meaning of the third node, or may also be adjustment of the third node with respect to the computation logic of the lower node. That is, the adjustments described herein may differ between the intra-index adjustments and the inter-index adjustments described above.
And it should be noted that the third node is a node that needs to perform service adjustment and is directly indicated by the service adjustment instruction.
For example, as can be appreciated in connection with the example of fig. 5, assume that the indicator represented by node E in fig. 5 means monthly overall performance. The traffic adjustment instruction is then used to instruct to adjust the meaning of the index represented by the node E to the monthly total singular number. It can be determined that node E is the third node in this embodiment.
S404, obtaining a dependent node dependent on the third node in the first tree structure.
It will be appreciated that if adjustments are made to the third node, then all nodes that depend on the third node will also need to be adjusted accordingly. Therefore, in this embodiment, a dependent node having a dependency relationship with the third node may be further acquired in the first tree structure.
For example, in the example of fig. 5, the third node is a node E, where the upper nodes of the node E in the first structure include 5 nodes, i.e., a node R, a node a, a node B, a node C, and a node D. Then, the node having a dependency relationship with the node E needs to be acquired from the 5 nodes.
With reference to fig. 5, it can be determined that node D is directly dependent on node C, and node a and node R are indirectly dependent on node C, so that the dependent nodes having a dependency relationship with node E can be determined to include node R, node a, and node D, and thus the dependent nodes can be determined to include node R, node a, and node D.
S406, determining the third node and the dependent node as the first node.
The third node in this embodiment is a node directly instructed to be adjusted by the service adjustment instruction, and the dependent node is a node that needs to be adjusted by the third node, so that both the third node and the dependent node dependent on the third node can be determined as the first node. The first node in this embodiment is a node that needs to perform service information adjustment.
S407, creating an updating node corresponding to the third node, and setting the service information of the updating node corresponding to the third node according to the service adjusting instruction.
The following describes the adjustment of the service information of the third node and the adjustment of the service information of the dependent node, respectively. In this embodiment, the service information adjustment of the third node is directly indicated by the service adjustment instruction, so in this embodiment, an update node corresponding to the third node may be first created, and the service information of the update node corresponding to the third node is set according to the service adjustment instruction.
It is understood that, if the third node is a leaf node, the adjustment of the traffic information of the third node indicated by the traffic adjustment instruction may be, for example, an index meaning of the third node. For example, in the example of fig. 5, the traffic adjustment instruction is used to instruct to adjust the index meaning of the node E to the monthly total singular number.
Referring to fig. 5, an updated node corresponding to the node E, that is, the node E' shown in fig. 5, may be generated. Then, the service information (index meaning) of the node E' may be set to the monthly total singular number, thereby completing the instruction of the service adjustment instruction.
Alternatively, in another possible scenario, if the third node is not a leaf node, then the adjustment to the third node may be, for example, adjusting the computational logic of the third node relative to the lower level nodes. Then, an updated node corresponding to the third node may also be generated, and then the computation logic of the updated node corresponding to the third node may be set as the computation logic indicated by the traffic adjustment instruction.
Alternatively, it is also possible that if the third node is not a leaf node, and the adjustment for the third node may be, for example, adjusting the dependency relationship between the third node and the lower level node, for example, deleting the dependency relationship with some lower level nodes and/or adding the dependency relationship with some lower level nodes. Then, an updated node corresponding to the third node may also be generated, and then, for the updated node corresponding to the third node, the dependency relationship and/or the calculation logic of the updated node may be set to the condition indicated by the service adjustment instruction.
Therefore, it can be understood that, for the adjustment of the service information of the third node directly indicated by the service indication information, a corresponding node can be directly created, and then according to the specific indication condition of the service indication information, the service information of the newly created node is correspondingly set. The specific indication content of the service indication information can be selected and set according to actual requirements.
And S408, creating an updating node corresponding to the dependent node.
And in this embodiment, a corresponding update node needs to be generated for the dependent node. For example, in the example of fig. 5, the dependent nodes determined by the above description include node R, node a, and node D.
Referring to fig. 5, a corresponding update node D ' is created for node D, a corresponding update node a ' is created for node a, and a corresponding update node R ' is created for node R.
S407, obtaining the original dependency relationship of the dependent node, and replacing the third node in the original dependency relationship with an updated node corresponding to the third node to obtain an updated dependency relationship.
It can be understood that, the dependent node in this embodiment originally depends on the third node, but in this embodiment, a corresponding update node is generated for the third node, and therefore after the update node corresponding to the dependent node is generated, the dependency relationship of the update node corresponding to the dependent node is also adjusted accordingly.
In a possible implementation manner, for example, an original dependency relationship of the dependency node may be obtained, and then a third node in the original dependency relationship is replaced with an updated node corresponding to the third node, so as to obtain an updated dependency relationship.
For example, this may be illustrated in connection with the example of fig. 5. Taking the dependent node D as an example, the original dependency relationship of the node D is that the node D depends on the node E and the node F, because the current node E generates the corresponding updated node E ', the dependency relationship "depending on the node E and the node F" needs to be modified to "depending on the node E' and the node F" correspondingly, so as to obtain the updated dependency relationship.
S409, obtaining the original calculation logic of the dependent node, and replacing a third node in the original calculation logic with an update node corresponding to the third node to obtain the updated calculation logic.
It should be noted that, for any non-leaf node in the original node, the service information is calculated according to the service information of the child node on which it depends, that is, for each non-leaf node, there is a calculation logic corresponding to the dependent child node. It is understood that non-leaf nodes are nodes other than leaf nodes.
It can be understood that, in this embodiment, a certain calculation logic originally exists between the dependent node and the third node, but in this embodiment, a corresponding update node is generated for the third node, and therefore, after the update node corresponding to the dependent node is generated, the calculation logic of the update node corresponding to the dependent node is also adjusted accordingly.
In a possible implementation manner, for example, an original computation logic of the dependent node may be obtained, and then a third node in the original computation logic is replaced with an updated node corresponding to the third node, so as to obtain an updated computation logic.
For example, this may be illustrated in connection with the example of fig. 5. Taking the dependent node D as an example, assume the original computation logic of node D: d = E × 10% + F × 5%, since the current node E generates the corresponding updated node E ', the corresponding calculation logic of "D = E × 10% + F × 5%" needs to be modified to "D = E' + 10% + F × 5%", so as to obtain the updated calculation logic.
And S410, setting the updated dependency relationship and the updated calculation logic for the service information of the updated node corresponding to the dependency node.
After the updated dependency relationship is obtained, the updated dependency relationship may be set as the dependency relationship of the update node corresponding to the dependency node. And after the updated computation logic is obtained, setting the updated computation logic as the computation logic of the update node corresponding to the dependent node, thereby completing the setting of the service information of the update node corresponding to the dependent node.
For example, in the example of fig. 5, also for the dependent node D, it can be determined based on the above description that the corresponding updated node D ' is generated for the dependent node D, and at the same time, it can also be determined based on the above description that we obtain the updated dependency relationship "dependent on node E ' and node F", and the updated calculation logic "D = E ' 10% + F5%". It can thus be determined that the dependency of the node D ' depends on the node E ' and the node F, and the computation logic of the node D ' is D ' = E ' = 10% + F × 5%. For example, D ' = E ' 10% + F5% may be understood as traffic information of node D ', and the dependency may also be understood as traffic information.
The above description is similar to the implementation of determining the corresponding update node D ' for the dependent node D, the implementation of determining the corresponding update node a ' for the dependent node a, and the implementation of determining the corresponding update node R ' for the dependent node R, and details are not repeated here.
In the example of fig. 5, the update nodes corresponding to the first node actually include the node R ', the node a', the node D ', and the node E'. And the second nodes that have not changed in the first tree structure include node F, node C, and node B.
It can be understood that, in the above process, it is determined that the service information of the node R ', the node a', the node D ', the node E', and the service information of the node F, the node C, and the node B are not changed, then the node R ', the node a', the node D ', the node E', the node F, the node C, and the node B may form an adjusted second tree structure, where the dependency relationship among the nodes, the index meaning of each node, and the calculation logic of each node with respect to the lower node are correspondingly determined, so that a required second tree structure may be determined, and a calculation requirement and a decision requirement under an actual service scene may be satisfied by performing corresponding calculation or decision based on the second tree structure.
S411, according to the version identification of the first node, generating a version identification of an update node corresponding to the first node.
It can be understood that each update node is actually obtained by performing adjustment on the basis of the corresponding first node, so the update node in this embodiment may be understood as a node of the next version of the first node, and in order to facilitate access to the nodes of the respective versions, the node information of the update node generated in each service adjustment process is recorded.
In one possible implementation manner, for example, the version identifier of the first version may be incremented based on the version identifier of the first version, so as to generate the version identifier of the update node corresponding to the first node. For example, the version id of the first node is V1, and the version id of the update node corresponding to the first node may be V2.
In the actual implementation process, the specific determination mode of the version identifier corresponding to the update node may be selected and set according to actual requirements, as long as it is ensured that the update node after each adjustment can be distinguished from the original node before the adjustment.
S412, for any update node, obtaining the dependency information corresponding to the update node, wherein the dependency information includes: the child nodes on which the update node depends, the version identification of the child nodes on which the update node depends, and the computational logic between the child nodes of the update node on which it depends.
In this embodiment, after the second tree structure is generated, maintenance needs to be performed on the second tree structure, and it can be understood that the second node in the second tree structure is a node that is originally in the first tree structure and has not changed, so that the related information of the second node is already stored and maintained. In this embodiment, the second tree structure can be maintained only by storing and maintaining the node information of the updated node.
And in this embodiment, each node is maintained to determine a corresponding tree structure as needed. Therefore, in this embodiment, it is also necessary to determine, for each update node, dependency information corresponding to the update node. The dependency information may include child nodes on which the update node depends, and different versions of the child nodes may also exist, so that the dependency information may also include version identifiers of the child nodes on which the update node depends. And when determining the tree structure, the computing logic corresponding to the update node also needs to be determined, so that the dependency information also can include the computing logic between the update node and the child node on which the update node depends.
Or, if the update node is a leaf node, that is, there is no dependent child node, it may be determined that the dependency information of the update node is empty, for example. In this case, for example, the index meaning of the update node may be stored.
And S413, determining the version identification of the update node and the dependency information of the update node as the node information of the update node.
After determining the version identification of the update node and the dependency information of the update node, for example, the version identification of the update node and the dependency information of the update node may be determined as the node information of the update node.
The specific content included in the node information may also be selected and expanded according to actual requirements, for example, the node information may also include a generation time of the update node, a submission time of the update node, and the like, which is not limited in this embodiment.
And S414, storing the node information of the update node into a database, wherein the node information is used for indicating the version and the dependency relationship of the update node.
After determining the node information of the update node, the node information of the update node may be stored to a database. It can be understood that, in the present embodiment, the storage and maintenance of the second tree structure are actually implemented by performing corresponding data storage and maintenance on the newly generated node.
And a complete description of the process described in the current embodiment may also be made in conjunction with 502 of fig. 5. It is understood that the above-described process determines, for example, a second tree structure composed of node R ', node a', node D ', node E', node F, node C, and node B.
If the adjustment is needed to the tree structure composed of the node R ', the node a', the node D ', the node E', the node F, the node C and the node B, the tree structure can be used as a new first tree structure to perform corresponding adjustment.
For example, referring to the example in 502, assuming that the traffic adjustment instruction indicates that the traffic information for node D ' is to be adjusted, node D ' may be determined as the first node, and node a ' and node R ' that depend on node D ' may also be determined as the first node.
Then, corresponding update nodes are determined for the node D ', the node a ' and the node R ', so as to obtain the node a ″ and the node R ″ of the node D ″ shown in fig. 5. And for the three updated nodes, corresponding dependency relationships, calculation logics, and the like are determined according to the above-described implementation manner, so that a second tree structure composed of nodes R ", a node a", a node D ", a node E', a node F, a node C, and a node B as shown in fig. 5 can be obtained. Then, the node information of the nodes R ', A ', and D ' is determined and stored, so that the maintenance of the newly generated tree structure and nodes can be realized, and the implementation manner is similar to that described above.
It can be understood that 501 and 502 in fig. 5 also illustrate two traffic adjustments for one tree structure, but in the illustration of fig. 5, the number of nodes after two traffic adjustments is only 14, which effectively reduces the number of nodes to be maintained compared to the above-described implementation.
In the method for processing a service tree structure provided in the embodiment of the present application, after the service adjustment instruction is obtained, the third node directly indicated by the service adjustment instruction in the original node and the dependent node dependent on the third node are determined as the first node to be adjusted, so that it is ensured that the node related to the service adjustment instruction can be completely and effectively determined in multiple original nodes. And then, aiming at each first node needing to be adjusted, creating a corresponding updating node. And aiming at the update node corresponding to the third node, setting the service information of the update node corresponding to the third node according to the instruction of the service adjustment instruction. And aiming at the updating node corresponding to the dependent node, setting the service information of the updating node corresponding to the dependent node according to the original dependency relationship and the original calculation logic of the dependent node, thereby ensuring that the adjustment indicated by the service adjustment instruction can be realized aiming at the updating node corresponding to the first node. And then, the version identification and the dependency relationship of the update node are determined, and the version identification and the dependency relationship are stored in an associated manner, so that the node information of the update node can be effectively maintained. In this embodiment, only the node information of the updated node is stored and maintained, so that the adjustment of the tree structure can be effectively realized, and the number of nodes to be maintained can be effectively reduced.
Based on the above description, an exemplary description is made below with reference to fig. 6 for an operation interface for tree structure editing. Fig. 6 is a schematic interface diagram of a processing tree structure according to an embodiment of the present application.
As shown in fig. 6, each layer of the tree structure may be provided on the operation interface, for example, the service index "sales" in fig. 6, and the currently illustrated version identifier is V2, which may correspond to R' in the tree structure described above, for example.
Referring again to the "sales" business index in FIG. 6, the business indexes of the next layer include base pay and language allowance. Where the version identifier of the base salary illustrated in fig. 6 is V2, which may correspond to a' in the tree structure described above, for example. And, the version identification of the language paster illustrated in fig. 6 is V1, which may for example correspond to B in the tree structure described above.
Referring again to the "base pay" business indicator of fig. 6, the business indicators of the next level include performance and late times. Where the version identification for performance illustrated in fig. 6 is V2, which may correspond, for example, to D' in the tree structure introduced above. And, the version identification of the late times illustrated in fig. 6 is V1, which may correspond, for example, to C in the tree structure described above.
Referring to the "performance" business index in fig. 6, the business index of the next layer includes monthly total performance and monthly updated performance. Where the version identification for monthly overall performance is illustrated in fig. 6 as V2, which may correspond, for example, to E' in the tree structure described above. And, the version identification of monthly pull performance illustrated in fig. 6 is V1, which may correspond, for example, to F in the tree structure described above.
Then, based on the tree structure illustrated in fig. 5 and illustrated in fig. 6, it can be understood that the tree structure illustrated in fig. 6 is actually the tree structure described in fig. 5 and composed of the nodes R ', a', D ', E', F, C and B.
On the basis of the tree structure, a user can further adjust the tree structure, for example, for each node, the present embodiment provides controls for addition, detail, editing, and deletion in the interface. Then, the user may operate the corresponding control, so as to implement adjustment on the corresponding node in the tree structure, and the specific adjustment manner may refer to the description of the foregoing embodiment.
And obtaining a corresponding updating node after the adjustment is finished, and then storing the updating node in a database, so that the adjusted tree structure can be stored.
And it can also be determined with reference to fig. 6 that, in the present embodiment, a person who adjusts the tree structure and a time when the tree structure is adjusted can also be recorded. In a possible implementation manner, when a user adjusts the tree structure, the user may lock the tree structure first to prevent multiple people from adjusting the same tree structure at the same time. And then, performing trial calculation in the adjustment process of the tree structure, wherein the trial calculation means calculating a corresponding calculation logic based on the tree structure in the adjustment process, and if the adjustment of the current tree structure is considered to be ready to be submitted after the trial calculation, submitting and saving the tree structure.
When the tree structure is submitted, the process of saving is actually performed for the updated node in the tree structure. In a possible implementation manner, referring to fig. 6, in this embodiment, it may further record that a user modifies the tree structure, and for example, a mirror image of the tree structure may also be saved. The mirror of the tree structure here may be only node information of the respective nodes, not the complete tree structure.
After the adjustment of the current user is completed, the tree structure can be unlocked, and the other users are allowed to perform corresponding editing.
Based on the foregoing embodiment, it can be understood that the tree structure in this embodiment is used for performing calculation and decision-making in some service scenarios, so that in an actual use process, for example, according to a service query request submitted by a user, corresponding calculation and decision-making may be performed to output service information that the user needs to query.
Next, an implementation manner of processing a query request based on a tree structure of a service is described with reference to fig. 7 to fig. 8, where fig. 7 is a third flowchart of a tree structure processing method of a service provided in the embodiment of the present application, fig. 8 is a schematic interface diagram of a service information query provided in the embodiment of the present application, and fig. 9 is a schematic implementation diagram of determining a target tree structure provided in the embodiment of the present application.
As shown in fig. 7, the method includes:
s701, acquiring a service query request, wherein the service query request comprises a target node corresponding to service information to be queried and a target version identifier of the target node.
In this embodiment, a user may submit a query request to the system, where the query request includes a target node corresponding to service information to be queried.
It can be understood that, because the tree structure in this embodiment changes as the business advances, correspondingly, that is, there may be multiple different versions of one index, when a user performs a business information query, it is usually necessary to specify which version of business information is queried.
For example, as can be understood in conjunction with fig. 8, it can be further appreciated that, as shown in fig. 8, assuming that the current user has queried a base salary of 10000, the base salary is determined by both the performance indicator and the late time indicator based on the interface in fig. 8.
Meanwhile, because the performance index has a next-layer node, a detail control is provided on the graphical user interface for the performance index, when the user clicks the detail control, a service query request for the performance index can be generated, and the service query request also includes a target version identifier corresponding to the performance index.
It should be noted that, because the node corresponding to the late time is already a leaf node, that is, there is no next layer that can be queried, the detail control is not displayed on the graphical user interface.
Meanwhile, it should be noted that, in the scenario of calculating payroll, the user may query the payroll of the current month, and may also query the payroll of the previous month. And in each month, which version each node in the tree structure specifically corresponding to the month specifically corresponds to, for example, a corresponding storage in the database.
For example, for the tree structure of salary calculation in month 11, which may be, for example, a tree structure composed of nodes R ', a', D ', E', F, C and B, the node information of each node may be, for example, the case illustrated in fig. 7.
For another example, the tree structure for salary calculation in 9 months is a tree structure composed of a node R, a node a, a node D, a node E, a node F, a node C, and a node B, then the version corresponding to the index of performance may be, for example, V1, and the version corresponding to the index of monthly updated performance may also be V1.
In an actual query process, a user may select a corresponding query month, and then the system may determine, for example, based on the query month required by the user, a version identifier corresponding to service information to be queried, so as to obtain a target version identifier included in a service query request.
In an actual implementation process, the service information to be queried and the target version identifier included in the specific query information may be determined according to an actual query requirement, which is not limited in this embodiment.
S702, determining a target node according to the service information to be inquired and the target version identification.
It can be understood that, in the embodiment, when the tree structure is adjusted, a new version is generated for the nodes corresponding to the indexes. For example, in the above-described example, three versions of nodes, D', and D ″, exist for the index of performance. The version id of the node D may be, for example, V1, the version id of the node D' may be, for example, V2, and the version id of the node D ″ may be, for example, V3.
Then, assuming that the service information to be queried is "performance" and the target version identification is V2, the corresponding target node can be determined to be node D'.
And S703, acquiring the dependency information of the target node.
In this embodiment, node information of each target node is stored, and the node information includes version identification and dependency information. Therefore, after the target node is determined, the dependency information of the target node can be obtained.
For example, continuing the above description, if it is currently determined that the target node is the node D ', the dependency information of the target node a' may be obtained.
S704, taking the target node as a root node, and obtaining each layer of child nodes depended on by the target node and the calculation rules between the target node and each layer of child nodes depended on by the target node according to the dependency information of the target node.
S705, determining a target tree structure according to each layer of child nodes depended on by the target node and the calculation logic between the target node and each layer of child nodes depended on by the target node.
S704 and SS705 are introduced simultaneously below. The target node in this embodiment is a node that a user needs to query at present, so that the target node can be used as a root node, and according to the dependency information of the target node, the child nodes of each layer on which the target node depends and the computation logic between the target node and the child nodes of each layer on which the target node depends are obtained.
For example, it can be understood by combining fig. 9, that is, because version identifiers and dependency relationships of each node are maintained in this embodiment, actually, the newly added node will continuously expand the tree structure, so as to obtain a three-dimensional tree structure, for example, the tree structure shown by 901 in fig. 9, which is subjected to two service adjustments on the basis of the initial tree structure, so as to obtain the situation of the tree structure shown by 901.
Then, the user can determine the partial tree structure needed by the user in the tree structure according to actual requirements. For example, in the current example, if the target node to be queried by the user is D ', the dependency relationship of the node D' may be obtained.
Referring to fig. 9, a node D 'depends on a node E' and a node F, and a computation logic between the node D 'and the nodes E' and F may also be obtained, so as to obtain a target tree structure shown as 901 in fig. 9.
For another example, if the target node to be queried by the user is a ', the dependency relationship of the node a' may be obtained.
Referring to fig. 9, a node a 'depends on a node C and a node D', and computation logic between the node a 'and the nodes C and D' may also be obtained. Meanwhile, the node D 'depends on the node E' and the node F, and the calculation logics between the node D 'and the node E' as well as between the node D 'and the node F can be obtained, so that a target tree structure formed by the node A', the node C, the node D ', the node E' and the node F is obtained.
S706, determining a query result corresponding to the service query request according to the target tree structure.
After the target tree structure is determined, the query result corresponding to the service query request can be determined according to the target tree structure. In the present example, if the service query request is for requesting the specification of the index constituting the performance, the service information of the lower-level child node constituting the node D' may be determined based on the target tree structure and may be displayed accordingly, for example, referring to the detailed information of the monthly total performance and the monthly updated performance shown in fig. 8.
The current example situation is a situation where a user needs to query details of a certain index, and in another application scenario, for example, what the user needs to query is a specific numerical value of a certain index. For example, what the user wants to query for his/her performance, the corresponding parameters are input and then calculated based on the determined target tree structure, so that the calculated result is determined as the query result.
According to the method for processing the tree structure of the service, provided by the embodiment of the application, the target node corresponding to the query request information is firstly found in the plurality of nodes maintained by the system according to the query request information of the user, then the target tree structure corresponding to the target node is determined according to the dependency information of the target node, and then the corresponding query result is determined based on the target tree structure. Therefore, the realization mode that newly increased maintenance is carried out on newly increased updated nodes every time and then multiplexing is carried out on unchanged nodes can be ensured, and the service query requirements of users can be effectively met. Meanwhile, because the version identifier is recorded for each node in the embodiment, backtracking calculation and query of historical data can be effectively realized by carrying the version identifier of the service information to be queried in the query request information, and meanwhile, a complete tree structure does not need to be maintained every time, so that the complexity of tree structure maintenance can be effectively reduced.
To sum up, in the method for processing a tree structure of a service provided in this embodiment of the present application, by introducing the version identifier of a node into the tree structure, each tree structure that needs to be maintained independently can be converted into a tree structure formed by nodes carrying version identifiers, so as to reuse nodes of the same version as much as possible, thereby achieving the purposes of controlling the number of nodes and reducing the cost and complexity of node management. And by introducing the version identification of the node into the tree structure, the consistency of the version can be maintained among indexes which change frequently.
Fig. 10 is a schematic structural diagram of a tree structure processing apparatus for a service according to an embodiment of the present application. As shown in fig. 10, the apparatus 100 includes: an acquisition module 1001, a determination module 1002, and a processing module 1003.
An obtaining module 1001, configured to obtain a service adjustment instruction, where the service adjustment instruction is used to instruct an adjustment operation on a target service;
the obtaining module 1001 is further configured to obtain a first tree structure corresponding to the target service, where the first tree structure includes a plurality of original nodes, and the original nodes correspond to operation links in the target service;
a determining module 1002, configured to determine, in the multiple original nodes, a first node corresponding to the adjustment operation;
a processing module 1003, configured to generate, according to the service adjustment instruction, an updated node corresponding to the first node, where the updated node and a remaining second node, except the first node, in the multiple original nodes form a second tree structure, and the second node is a node multiplexed by the first tree structure and the second tree structure;
the processing module 1003 is further configured to determine node information of the update node, where the node information is used to indicate a version of the update node and a dependency relationship of the update node.
In a possible design, the service adjustment instruction is used to instruct to adjust service information corresponding to a third node in the first tree structure;
the determining module 1002 is specifically configured to:
determining the third node in the plurality of original nodes according to the service adjustment instruction;
obtaining, in the first tree structure, a dependent node dependent on the third node;
and determining the third node and the dependent node as the first node.
In one possible design, the processing module 1003 is specifically configured to:
creating an updating node corresponding to the third node, and setting the service information of the updating node corresponding to the third node according to the service adjusting instruction;
and creating an updating node corresponding to the dependent node, and setting the service information of the updating node corresponding to the dependent node according to the updating node corresponding to the third node.
In one possible design, for any one of the original nodes, the traffic information of the non-leaf node is calculated according to the traffic information of the child node on which the non-leaf node depends;
the processing module 1003 is specifically configured to:
acquiring an original dependency relationship of the dependency nodes, and replacing the third node in the original dependency relationship with an update node corresponding to the third node to obtain an updated dependency relationship;
acquiring original computing logic of the dependent node, and replacing the third node in the original computing logic with an updating node corresponding to the third node to obtain updated computing logic;
and setting the service information of the updated node corresponding to the dependent node according to the updated dependency relationship and the updated calculation logic.
In a possible design, the processing module 1003 is specifically configured to:
generating a version identifier of an update node corresponding to the first node according to the version identifier of the first node;
for any one of the update nodes, obtaining dependency information corresponding to the update node, where the dependency information includes: computing logic between child nodes on which the update node depends, version identifications of child nodes on which the update node depends, and child nodes on which the update node depends;
and determining the version identification of the update node and the dependency information of the update node as the node information of the update node.
In one possible design, the processing module 1003 is further configured to:
acquiring a service query request, wherein the service query request comprises service information to be queried and a target version identifier;
determining a target node according to the service information to be inquired and the target version identification;
determining a target tree structure corresponding to the target node by taking the target node as a root node;
and determining a query result corresponding to the service query request according to the target tree structure.
In one possible design, the processing module 1003 is specifically configured to:
acquiring the dependency information of the target node;
and taking the target node as a root node, and acquiring a target tree structure according to the dependency information of the target node.
In a possible design, the processing module 1003 is specifically configured to:
taking the target node as a root node, and acquiring each layer of child nodes depended on by the target node and computing logic between the target node and each layer of child nodes depended on by the target node according to the dependency information of the target node;
and determining the target tree structure according to the subnodes of each layer depended by the target node and the calculation logic between the target node and the subnodes of each layer depended by the target node.
The apparatus provided in this embodiment may be configured to implement the technical solutions of the method embodiments, and the implementation principles and technical effects are similar, which are not described herein again.
Fig. 11 is a schematic diagram of a hardware structure of a tree structure processing device of a service provided in an embodiment of the present application, and as shown in fig. 11, a tree structure processing device 110 of a service of the present embodiment includes: a processor 1101 and a memory 1102; wherein
A memory 1102 for storing computer-executable instructions;
the processor 1101 is configured to execute computer-executable instructions stored in the memory to implement the steps performed by the tree structure processing method of the service in the foregoing embodiments. Reference may be made in particular to the description relating to the method embodiments described above.
Alternatively, the memory 1102 may be separate or integrated with the processor 1101.
When the memory 1102 is separately provided, the tree structure processing device of the service further includes a bus 1103 for connecting the memory 1102 and the processor 1101.
An embodiment of the present application further provides a computer-readable storage medium, where a computer executing instruction is stored in the computer-readable storage medium, and when a processor executes the computer executing instruction, the method for processing a tree structure of a service, executed by the tree structure processing device of the above service, is implemented.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is only one logical functional division, and other divisions may be realized in practice, for example, a plurality of modules may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or modules, and may be in an electrical, mechanical or other form.
The integrated module implemented in the form of a software functional module may be stored in a computer-readable storage medium. The software functional module is stored in a storage medium and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device) or a processor (processor) to execute some steps of the methods according to the embodiments of the present application.
It should be understood that the Processor may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of a method disclosed in connection with the present invention may be embodied directly in a hardware processor, or in a combination of hardware and software modules.
The memory may comprise a high speed RAM memory, and may further comprise a non-volatile storage NVM, such as at least one magnetic disk memory, and may also be a usb disk, a removable hard disk, a read-only memory, a magnetic or optical disk, or the like.
The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an Extended ISA (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, the buses in the figures of the present application are not limited to only one bus or one type of bus.
The storage medium may be implemented by any type or combination of volatile or non-volatile memory devices, such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks. A storage media may be any available media that can be accessed by a general purpose or special purpose computer.
Those of ordinary skill in the art will understand that: all or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The foregoing program may be stored in a computer-readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present application.

Claims (13)

1. A method for processing a tree structure of a service, comprising:
acquiring a service adjusting instruction, wherein the service adjusting instruction is used for indicating the adjusting operation of a target service;
acquiring a first tree structure corresponding to the target service, wherein the first tree structure comprises a plurality of original nodes, and the original nodes correspond to operation links in the target service;
determining a first node corresponding to the adjustment operation in the plurality of original nodes;
generating an updated node corresponding to the first node according to the service adjustment instruction, wherein the updated node and a remaining second node except the first node in the plurality of original nodes form a second tree structure, and the second node is a node multiplexed by the first tree structure and the second tree structure;
determining node information of the update node, wherein the node information is used for indicating the version of the update node and the dependency relationship of the update node.
2. The method of claim 1, wherein the traffic adjustment instruction is used to instruct to adjust traffic information corresponding to a third node in the first tree structure;
the determining, in the plurality of original nodes, a first node corresponding to the adjustment operation includes:
determining the third node in the plurality of original nodes according to the service adjusting instruction;
obtaining, in the first tree structure, a dependent node dependent on the third node;
and determining the third node and the dependent node as the first node.
3. The method according to claim 1 or 2, wherein the generating an update node corresponding to the first node according to the service adjustment instruction includes:
creating an updating node corresponding to the third node, and setting the service information of the updating node corresponding to the third node according to the service adjusting instruction;
and creating an updating node corresponding to the dependent node, and setting the service information of the updating node corresponding to the dependent node according to the updating node corresponding to the third node.
4. The method according to claim 3, wherein for any one of the original nodes, the traffic information of the non-leaf node is calculated according to the traffic information of the sub-node on which the non-leaf node depends;
the setting the service information of the update node corresponding to the dependent node according to the update node corresponding to the third node includes:
acquiring an original dependency relationship of the dependent node, and replacing the third node in the original dependency relationship with an update node corresponding to the third node to obtain an updated dependency relationship;
acquiring original computing logic of the dependent node, and replacing the third node in the original computing logic with an updating node corresponding to the third node to obtain updated computing logic;
and setting the service information of the updated node corresponding to the dependent node according to the updated dependency relationship and the updated calculation logic.
5. The method according to any one of claims 1 to 4, wherein the determining the node information of the update node comprises:
generating a version identifier of an update node corresponding to the first node according to the version identifier of the first node;
for any one of the update nodes, obtaining dependency information corresponding to the update node, where the dependency information includes: computing logic between child nodes relied upon by the update node, version identifications of child nodes relied upon by the update node, and child nodes relied upon by the update node;
and determining the version identification of the update node and the dependency information of the update node as the node information of the update node.
6. The method of claim 5, further comprising:
acquiring a service query request, wherein the service query request comprises service information to be queried and a target version identifier;
determining a target node according to the service information to be inquired and the target version identification;
determining a target tree structure corresponding to the target node by taking the target node as a root node;
and determining a query result corresponding to the service query request according to the target tree structure.
7. The method of claim 6, wherein determining the target tree structure corresponding to the target node with the target node as a root node comprises:
acquiring the dependency information of the target node;
and taking the target node as a root node, and acquiring a target tree structure according to the dependency information of the target node.
8. The method according to claim 7, wherein the obtaining a target tree structure according to the dependency information of the target node by using the target node as a root node comprises:
taking the target node as a root node, and acquiring each layer of child nodes depended on by the target node and computing logic between the target node and each layer of child nodes depended on by the target node according to the dependency information of the target node;
and determining the target tree structure according to each layer of child nodes depended on by the target node and the calculation logic between the target node and each layer of child nodes depended on by the target node.
9. The method according to any of claims 1-8, wherein after determining the node information of the update node, the method further comprises:
and storing the node information of the update node in a database.
10. A tree structure processing apparatus for a service, comprising:
the system comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring a service adjustment instruction which is used for indicating the adjustment operation of a target service;
the obtaining module is further configured to obtain a first tree structure corresponding to the target service, where the first tree structure includes a plurality of original nodes, and the original nodes correspond to operation links in the target service;
a determining module, configured to determine, in the multiple original nodes, a first node corresponding to the adjustment operation;
a processing module, configured to generate, according to the service adjustment instruction, an updated node corresponding to the first node, where the updated node and a remaining second node, except the first node, in the multiple original nodes form a second tree structure, and the second node is a node multiplexed by the first tree structure and the second tree structure;
the processing module is further configured to determine node information of the update node, where the node information is used to indicate a version of the update node and a dependency relationship of the update node.
11. A tree structure processing apparatus of a service, comprising:
a memory for storing a program;
a processor for executing the program stored by the memory, the processor being configured to perform the method of any of claims 1 to 9 when the program is executed.
12. A computer-readable storage medium comprising instructions which, when executed on a computer, cause the computer to perform the method of any one of claims 1 to 9.
13. A computer program product comprising a computer program, characterized in that the computer program realizes the method of any of claims 1 to 9 when executed by a processor.
CN202211314128.6A 2022-10-25 2022-10-25 Method and device for processing tree structure of service Pending CN115599961A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211314128.6A CN115599961A (en) 2022-10-25 2022-10-25 Method and device for processing tree structure of service

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211314128.6A CN115599961A (en) 2022-10-25 2022-10-25 Method and device for processing tree structure of service

Publications (1)

Publication Number Publication Date
CN115599961A true CN115599961A (en) 2023-01-13

Family

ID=84848298

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211314128.6A Pending CN115599961A (en) 2022-10-25 2022-10-25 Method and device for processing tree structure of service

Country Status (1)

Country Link
CN (1) CN115599961A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112036937A (en) * 2020-08-19 2020-12-04 深圳市分期乐网络科技有限公司 Commodity pricing method and device, computer equipment and storage medium
CN116302513A (en) * 2023-02-28 2023-06-23 易方达基金管理有限公司 Quantization factor processing method, quantization factor processing device, computer equipment and readable storage medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112036937A (en) * 2020-08-19 2020-12-04 深圳市分期乐网络科技有限公司 Commodity pricing method and device, computer equipment and storage medium
CN112036937B (en) * 2020-08-19 2023-11-28 深圳市分期乐网络科技有限公司 Commodity pricing method, device, computer equipment and storage medium
CN116302513A (en) * 2023-02-28 2023-06-23 易方达基金管理有限公司 Quantization factor processing method, quantization factor processing device, computer equipment and readable storage medium

Similar Documents

Publication Publication Date Title
CN115599961A (en) Method and device for processing tree structure of service
US8041744B2 (en) Computer-aided modeling
JP6045706B2 (en) Data processing system, data processing method, and data processing apparatus
CN112650766B (en) Database data operation method, system and server
CN111352712B (en) Cloud computing task tracking processing method and device, cloud computing system and server
US10380085B2 (en) Method, apparatus and computer program for migrating records in a database from a source database schema to a target database schema
CN109947399A (en) Code structure generation method, device, computer installation and readable storage medium storing program for executing
CN110858160A (en) Resource scheduling method and device, storage medium and processor
US8086436B2 (en) Preliminary data representations of a deployment activity model
CN110275889B (en) Feature processing method and device suitable for machine learning
CN114036187A (en) File acquisition method and device, computer equipment and storage medium
CN112364021B (en) Service data processing method, device and storage medium
CN115878589A (en) Version management method and device of structured data and related equipment
CN108984178B (en) Communication method and device
CN111488531A (en) Information recommendation method, device and medium based on collaborative filtering algorithm
CN115543428A (en) Simulated data generation method and device based on strategy template
JPH0644074A (en) Knowledge base, inference method and descriptive text preparation method
US6816866B2 (en) Method of changing a parameter of an operating system of a computer system
CN107194278A (en) A kind of data generaliza-tion method based on Skyline
JP4813155B2 (en) Data management apparatus, data management method for data management apparatus, and data management program
CN113010489A (en) Data migration method and system
CN103164225A (en) Internet software architecture on-line evolution method based on hypergraph
EP4109290B1 (en) A method and apparatus for validation of modifications in a database
CN116027938B (en) Information interaction method, device, equipment, medium and program product
CN114780300B (en) Backup system authority management method and system based on resource layering

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