Data structured processing method and device, computer equipment, readable storage medium and program product
By building the tree structure of the target business and updating the data, the problem of low accuracy of data structured processing in traditional methods is solved, and more efficient and flexible data processing is achieved.
Patent Information
- Application Number
- CN202411631056.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-14
- Publication Date
- 2025-02-25
AI Technical Summary
Traditional data structured processing methods cannot accurately process the structured information of the data, resulting in low accuracy.
By building a tree structure of the target business, obtaining and correlating business data, updating data to the parent level according to the child level, and building detailed leaf nodes to improve data accuracy.
It realizes more accurate data structured processing, can dynamically adjust the tree structure to meet business needs, and improves the accuracy and flexibility of data processing.
Smart Images

Figure CN119513094A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a data structured processing method, apparatus, computer equipment, computer-readable storage medium, and computer program product. Background Art
[0002] With the development of computer technology, users can use various methods such as EXCEL tables, mind maps, etc. to display data in multiple dimensions. The traditional data structured processing method is usually to deploy relevant logic plug-ins on the server side, run these plug-ins, and build multiple fixed dimensions into the plug-ins to achieve multi-dimensional display of data.
[0003] However, traditional data structured processing methods have fixed functional service logic for data structured processing and can only implement fixed functional services. They are often unable to accurately process the structured information of the data and have the problem of low accuracy. Summary of the invention
[0004] Based on this, it is necessary to provide a data structured processing method, device, computer equipment, computer-readable storage medium and computer program product that can improve accuracy in response to the above technical problems.
[0005] In a first aspect, the present application provides a data structured processing method, comprising:
[0006] Based on the structured data of the target business, construct a first tree structure of the target business; the first tree structure includes at least two levels with a parent-child relationship, and each level includes at least one node;
[0007] Acquire business data of the target business, and associate the business data with nodes in the first tree structure to obtain first structured business data;
[0008] In the direction from the sub-level to the parent-level, based on the business data of each sub-level node in the first structured business data, the target business data of each parent-level node in the first structured business data is obtained, and the first structured business data is updated based on the target business data of each parent-level node to obtain the second structured business data;
[0009] If there is a first node in the second structured business data, and the first node has first detail data, a sub-level detail leaf node is constructed for the first node, and the first detail data is associated with the detail leaf node to obtain the target structured business data.
[0010] In one embodiment, the method further comprises:
[0011] If in one of the embodiments, there is a second node in the second structured business data, the second node belongs to a parent-level node and the second node has second detailed data, a sub-level virtual leaf node is constructed for the second node; the virtual leaf node has the second detailed data;
[0012] The virtual leaf node is used as the first node, and the second detailed data is used as the first detailed data, and the step of constructing a sub-level detailed leaf node for the first node is performed.
[0013] In one embodiment, the virtual leaf node includes a current data identifier, a parent level identifier and a child level identifier. The current data identifier of the virtual leaf node is used to represent the data identifier of the virtual leaf node, the parent level identifier of the virtual leaf node is used to represent the data identifier of the parent level node of the virtual leaf node, and the parent level identifier of the virtual leaf node is the same as the current data identifier of the second node, and the child level identifier is used to represent whether the virtual leaf node has a child level node.
[0014] In one embodiment, the method further comprises:
[0015] For each of the detail leaf nodes, a current data identifier, a parent level identifier and a child level identifier are added to the detail leaf node, and the current data identifier of the detail leaf node is not repeated with the current data identifiers of other nodes in the second structured business data.
[0016] In one embodiment, after associating the first detail data to the detail leaf node to obtain the target structured business data, the method further includes:
[0017] In response to an instruction to adjust the first tree structure, adjusting the first tree structure to obtain a second tree structure;
[0018] Based on the second tree structure, the target structured service data is adjusted to obtain new target structured service data.
[0019] In one embodiment, adjusting the target structured service data based on the second tree structure to obtain new target structured service data includes:
[0020] Determining that the second tree structure has an adjusted node relative to the first tree structure;
[0021] The adjusted business data corresponding to the adjustment node in the target structured business data is acquired, and the adjusted business data is associated with the adjustment node to obtain new target structured business data.
[0022] In a second aspect, the present application further provides a data structured processing device, comprising:
[0023] A tree structure building module, used to build a first tree structure of the target business based on the structured data of the target business; the first tree structure includes at least two levels with a parent-child relationship, and each level includes at least one node;
[0024] A business data structuring module, used to obtain business data of the target business, and associate the business data with the nodes of the first tree structure to obtain first structured business data;
[0025] a parent-level business data processing module, configured to obtain target business data of each parent-level node in the first structured business data in a direction from the child level to the parent level based on the business data of each child-level node in the first structured business data, and update the first structured business data based on the target business data of each parent-level node to obtain second structured business data;
[0026] A detail leaf node construction module is used to construct a sub-level detail leaf node for the first node if there is a first node in the second structured business data and the first node has first detail data, and associate the first detail data to the detail leaf node to obtain the target structured business data.
[0027] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0028] Based on the structured data of the target business, construct a first tree structure of the target business; the first tree structure includes at least two levels with a parent-child relationship, and each level includes at least one node;
[0029] Acquire business data of the target business, and associate the business data with nodes in the first tree structure to obtain first structured business data;
[0030] In the direction from the sub-level to the parent-level, based on the business data of each sub-level node in the first structured business data, the target business data of each parent-level node in the first structured business data is obtained, and the first structured business data is updated based on the target business data of each parent-level node to obtain the second structured business data;
[0031] If there is a first node in the second structured business data, and the first node has first detail data, a sub-level detail leaf node is constructed for the first node, and the first detail data is associated with the detail leaf node to obtain the target structured business data.
[0032] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:
[0033] Based on the structured data of the target business, construct a first tree structure of the target business; the first tree structure includes at least two levels with a parent-child relationship, and each level includes at least one node;
[0034] Acquire business data of the target business, and associate the business data with nodes in the first tree structure to obtain first structured business data;
[0035] In the direction from the sub-level to the parent-level, based on the business data of each sub-level node in the first structured business data, the target business data of each parent-level node in the first structured business data is obtained, and the first structured business data is updated based on the target business data of each parent-level node to obtain the second structured business data;
[0036] If there is a first node in the second structured business data, and the first node has first detail data, a sub-level detail leaf node is constructed for the first node, and the first detail data is associated with the detail leaf node to obtain the target structured business data.
[0037] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:
[0038] Based on the structured data of the target business, construct a first tree structure of the target business; the first tree structure includes at least two levels with a parent-child relationship, and each level includes at least one node;
[0039] Acquire business data of the target business, and associate the business data with nodes in the first tree structure to obtain first structured business data;
[0040] In the direction from the sub-level to the parent-level, based on the business data of each sub-level node in the first structured business data, the target business data of each parent-level node in the first structured business data is obtained, and the first structured business data is updated based on the target business data of each parent-level node to obtain the second structured business data;
[0041] If there is a first node in the second structured business data, and the first node has first detail data, a sub-level detail leaf node is constructed for the first node, and the first detail data is associated with the detail leaf node to obtain the target structured business data.
[0042] The above-mentioned data structured processing method, device, computer equipment, computer-readable storage medium and computer program product construct a first tree structure of the target business based on the structured data of the target business, and the first tree structure includes at least two levels with a parent-child relationship, and each level includes at least one node; obtain the business data of the target business, and associate the business data with the nodes of the first tree structure to obtain the first structured business data; in the direction from the sub-level to the parent level, based on the business data of each sub-level node in the first structured business data, the target business data of each parent-level node in the first structured business data can be accurately obtained, so that the first structured business data is updated based on the target business data of each parent-level node to obtain more accurate second structured business data; if there is a first node in the second structured business data, and the first node has first detailed data, then a detailed leaf node of the sub-level is constructed for the first node, and the first detailed data is associated with the detailed leaf node, so that the detailed data of the first node can be obtained, and then more accurate target structured business data can be obtained. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0044] Figure 1 A schematic diagram of a flow chart of a data structured processing method in one embodiment;
[0045] Figure 2 is a flowchart of a data structured processing method in another embodiment;
[0046] Figure 3 is a flowchart of a data structured processing method in another embodiment;
[0047] Figure 4 is an architectural diagram of a data structured processing method in another embodiment;
[0048] Figure 5 is a schematic diagram of a first tree structure in one embodiment;
[0049] Figure 6 An interface diagram of target structured business data in an embodiment;
[0050] Figure 7 is a schematic diagram of an adjusted second tree structure in one embodiment;
[0051] Figure 8 An interface diagram of new target structured business data in an embodiment;
[0052] Fig. 9 is a structural block diagram of a data structuring processing device in one embodiment;
[0053] Fig.10 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0054] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0055] In one embodiment, Figure 1 As shown, a data structured processing method is provided. This embodiment uses the method applied to a computer device as an example. The computer device can be a terminal or a server. It can be understood that the method can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. Among them, the terminal can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car devices, projection devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The head-mounted device can be a virtual reality (VR) device, an augmented reality (AR) device, smart glasses, etc. The server can be an independent physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server that provides cloud computing services.
[0056] In this embodiment, the data structuring processing method includes the following steps:
[0057] Step S102: construct a first tree structure of the target business based on the structured data of the target business; the first tree structure includes at least two levels with a parent-child relationship, and each level includes at least one node.
[0058] Among them, structured data is data with parent-child hierarchy or superior-subordinate relationship. For example, structured data can be XX head office, the first branch and the second branch, etc., XX head office is the node of the parent level, and the first branch and the second branch are both nodes of the child level of XX head office. Tree structure is an important type of nonlinear data structure, which is a hierarchical structure defined by branch relationship. The first tree structure is an initial tree structure constructed based on structured data. The first tree structure includes at least two levels, such as three levels, four levels, etc.
[0059] Optionally, the computer device obtains structured data within the scope of the user's authority for each user of the target business based on the user's authority. It is understandable that the software system of the computer device is divided into different users, and the user authority of each user is different, so it is necessary to filter data in combination with the user authority scope.
[0060] Optionally, the computer device obtains the current data identifier, parent level identifier and child level identifier in each structured data, determines the hierarchical relationship between each structured data based on the current data identifier, parent level identifier and child level identifier in each structured data, and constructs a first tree structure of the target business based on the hierarchical relationship between each structured data.
[0061] Among them, the current data identifier (rowid) is the unique identifier of the current row of structured data, that is, the data ID; the parent level identifier (Pid) is the parent level identifier (ID) of the structured data. The value of the parent level identifier is 0, which means that the structured data does not have a parent level. The value of the parent level identifier is a current data identifier (rowid), which means that the parent level of the current structured data is the node corresponding to the rowid; the child level identifier (isgroup) is used to mark whether the structured data has a child level. If the child level identifier is true, it means that the structured data has a child level. If the child level identifier is false, it means that the structured data does not have a child level.
[0062] Step S104: Acquire the business data of the target business, and associate the business data with the nodes of the first tree structure to obtain first structured business data.
[0063] Among them, business data refers to data stored in the software system, which is generally data with a standardized structure / specific type, such as expense reimbursement / delivery order / order data. The first structured business data is business data with a structure (hierarchical relationship).
[0064] Optionally, the computer device obtains initial data of the target business, filters the initial data, and obtains business data that meets the target conditions. The target conditions can be set as needed, such as user authority range, customized filtering of business data, etc. Exemplarily, the computer device obtains business data within the user authority range for each user of the target business based on the user's user authority.
[0065] Optionally, the computer device obtains a target classification rule, classifies the business data according to the target classification rule, obtains at least one set of business data, and associates at least one set of business data to a node of the first tree structure. The target classification rule can be set as needed, such as classification according to organizational dimensions.
[0066] Exemplarily, the computer device classifies the business data according to the target field identifier, obtains the business data including the target field identifier, and associates the business data including the target field identifier to the node of the first tree structure.
[0067] The computer device matches the target field identifier of the business data with the current data identifier of the structured data corresponding to each node in the first tree structure, determines the node corresponding to each business data, and associates the business data to the corresponding node in the first tree structure to obtain the first structured business data.
[0068] It is understandable that the target field of the business data includes an identification field, and the identification field has an identification of the business data. The computer device matches the target field of the business data with the first tree structure, and can match the identification of the business data to a node in the first tree structure.
[0069] Exemplarily, the orgid in the business data is used as the target field, and the computer device obtains the business data containing orgid, and the orgid and the current data identifier (rowid) of the structured data are corresponding. The two fields are matched and associated, and the business data can be associated with the corresponding node of the first tree structure.
[0070] Step S106, in the direction from the sub-level to the parent-level, based on the business data of each sub-level node in the first structured business data, obtain the target business data of each parent-level node in the first structured business data, and update the first structured business data based on the target business data of each parent-level node to obtain the second structured business data.
[0071] Optionally, the computer device aggregates the business data of each sub-level node in the first structured business data in the direction from the sub-level to the parent level, starting from the childmost level, to obtain the target business data of each parent-level node in the first structured business data.
[0072] It can be understood that if the parent level in the first structured data includes business data, the business data is updated based on the target business data of the parent level; if the parent level in the first structured data does not include business data, the target business data of the parent level is used as the new business data of the parent level to obtain the second structured business data, and the business data of the parent level node in the second structured business data is the summary result of the business data of the corresponding child level node, and the business data of the child level node can also be used as the detailed data of the summary result of the parent level node.
[0073] Step S108, if there is a first node in the second structured business data, and the first node has first detail data, a sub-level detail leaf node is constructed for the first node, and the first detail data is associated with the detail leaf node to obtain the target structured business data.
[0074] The first node is a node with first detail data. The first node can be a parent node or a non-parent node. The first detail data is the detail data of the first node. The detail leaf node is a node for displaying detail data, and the detail leaf node is a child node of the first node.
[0075] Optionally, the above method also includes: for each detail leaf node, adding a current data identifier, a parent level identifier and a child level identifier to the detail leaf node, and the current data identifier of the detail leaf node is not repeated with the current data identifiers of other nodes in the second structured business data.
[0076] Among them, the parent level identifier of the detail leaf node and the current data identifier of the first node indicate that the parent level of the detail leaf node is the first node, and the child level identifier of the detail leaf node indicates that the detail leaf node has no child level node.
[0077] Optionally, the computer device randomly assigns a current data identifier of the detail leaf node so that the current data identifier of the detail leaf node does not overlap with the current data identifiers of other nodes in the second structured business data.
[0078] It can be understood that the detailed leaf node, as the most detailed leaf node in the first tree structure, can facilitate the tracing of the calculation source of the hierarchical structure data results.
[0079] Optionally, the computer device displays the target structured business data.
[0080] The above-mentioned data structured processing method constructs a first tree structure of the target business based on the structured data of the target business, and the first tree structure includes at least two levels with a parent-child relationship, and each level includes at least one node; obtains the business data of the target business, and associates the business data with the nodes of the first tree structure to obtain the first structured business data; in the direction from the sub-level to the parent level, based on the business data of each sub-level node in the first structured business data, the target business data of each parent-level node in the first structured business data can be accurately obtained, so that the first structured business data is updated based on the target business data of each parent-level node to obtain more accurate second structured business data; if there is a first node in the second structured business data, and the first node has first detailed data, then a detailed leaf node of the sub-level is constructed for the first node, and the first detailed data is associated with the detailed leaf node, so that the detailed data of the first node can be obtained, and then more accurate target structured business data can be obtained.
[0081] In one embodiment, the above method also includes: if there is a second node in the second structured business data, the second node belongs to a parent-level node and the second node has second detailed data, then a sub-level virtual leaf node is constructed for the second node; the virtual leaf node has second detailed data; the virtual leaf node is used as the first node, and the second detailed data is used as the first detailed data, and the step of constructing a sub-level detailed leaf node for the first node is executed.
[0082] The virtual leaf node is used to display the second detailed data of the second node. It can be understood that the second node has the second detailed data, that is, the second node has related detailed data.
[0083] Optionally, the virtual leaf node includes a current data identifier, a parent level identifier and a child level identifier. The current data identifier of the virtual leaf node is used to represent the data identifier of the virtual leaf node. The parent level identifier of the virtual leaf node is used to represent the data identifier of the parent level node of the virtual leaf node. The parent level identifier of the virtual leaf node is the same as the current data identifier of the second node. The child level identifier is used to represent whether the virtual leaf node has a child level node.
[0084] Optionally, the computer device uses the virtual leaf node as the first node and the second detailed data as the first detailed data, and executes the step of constructing a sub-level detailed leaf node for the first node to construct a sub-level detailed leaf node for the virtual leaf node.
[0085] It can be understood that the current data identifier that matches the target field of the business data belongs to the parent node in the second structured business data. It can be considered that the second node to which the current data identifier belongs has second detailed data, and the second detailed data is the business data that matches the target field. Therefore, it is necessary to construct a sub-level virtual leaf node for the second node to distinguish the second detailed data of the second node (parent node) and other business data of the sub-level nodes of the second node, so as to obtain the target structured business data more accurately.
[0086] In addition, by customizing tree-structured data, you can dynamically display target structured business data and report styles with hierarchical effects; summary and detailed data are displayed at the same time, and based on the summary data, you can intuitively trace back to the detailed data at the bottom level; business data is automatically associated with tree-structured data.
[0087] In one embodiment, Figure 2 As shown, the computer device performs tree structure assembly / optimization based on the structured data of the target business; associates the business data to the nodes of the first tree structure to structure the business data; summarizes it step by step from the child level to the parent level to obtain the second structured business data; if there is a second node in the second structured business data, constructs a virtual leaf node; constructs a detailed leaf node for the virtual leaf node, and associates the first detailed data to the detailed leaf node to obtain the target structured business data.
[0088] In one embodiment, Figure 3 As shown, the server obtains the structured data and business data of the target business, and constructs the first structured business data through the code logic of the server, so that the tree-structured data is associated with the business data. The first structured business data includes the current data identifier, the parent level identifier and the child level identifier. The value of all parent level identifiers is one of the values of the current data identifier; and the data of the child level node exists, that is, the child level identifier is true, otherwise it is false. The server sends the target structured business data to the client, and the client's browser can display the target structured business data in the style of a tree report by parsing the target structured business data.
[0089] In one embodiment, Figure 4The figure shows the architecture diagram of data structured processing, which is decomposed into four layers, namely service layer, data layer, business layer, and client. The service layer is mainly mainstream hardware service facilities, such as Linux server / Nginx / DB, etc. The data layer contains structured data and business data that need to be displayed in a tree structure, as well as data such as business units, organizational views, and user authorization. The business layer is the core logic of data structured processing, including tree dimension construction and data processing of other dimensions. The tree dimension construction includes organizational structure and tree organization. The data processing of other dimensions includes data aggregation, virtual leaf nodes, and detailed leaf nodes. The client parses and displays the target structured business data.
[0090] The client can customize data statistics dimensions and use SQL technology to process data, so that the system can output summary and detailed data according to rules; the server flexibly parses customized tree-structured data and implements multi-dimensional display of data according to predetermined logic; the server plug-in combines the organizational structure and business data by building, assembling, and optimizing data parameters such as rowid, pid, isgroup, etc., and outputs hierarchical structured data with parent-child relationships that can be recognized by the front end. In addition, tree-structured data is customized on the client to build a standard tree structure with a parent-child hierarchical relationship. Business data and structured data are related, such as order-type business data, which can be constructed using product types as tree-structured data, so that order data can be counted in the structure of product types; business data is associated with tree-structured data according to unified rules, without distinguishing the sources of business data and tree-structured data.
[0091] Taking organizational data as tree-structured data as an example, in actual application, the type of tree-structured data is not limited. For example, data with hierarchical structures such as cooperative financial institutions / expense items / suppliers / customers can all be used as tree-structured data; a fixed tree structure is used to associate the data that needs statistical analysis with the tree structure in a fixed matching method, and assemble it into hierarchical data; the rowid / pid / isgroup values are directly maintained in the business data, so that the business data itself has a parent-child structure relationship, and is displayed in the style of a tree structure.
[0092] like Figure 5 Shown is the first tree structure of the target business, which includes three levels. The first level includes a node "XXX Test 2024", the second level includes a node "XXX China Headquarters Company", and the third level includes four nodes, namely "XXX Central China Headquarters", "XXX Shanghai Company", "XXX Guangzhou Company" and "XXX Shenzhen Company". The first level is the parent level of the second level, and the second level is the parent level of the third level.
[0093] like Figure 6 The following is an interface diagram of the target structured business data. The target structured business data includes two virtual leaf nodes, of which the virtual leaf node "XXX Test 2024" is not expanded; for the virtual leaf node "XXX China Headquarters Company", a sub-level detailed leaf node is constructed; for the first node "Shenzhen Company" of the non-parent level, a sub-level detailed leaf node is constructed. Business data is based on Figure 5 After filtering, grouping and summarizing the first tree structure in the tree structure, the detailed data and summary data of each node are obtained, and the summary data is associated with the nodes of the first tree structure. According to the hierarchical order of the nodes, the summary amount of each parent level can be obtained from the child level upward. The detailed data is associated with the tree structure as the subordinate of the third level node. Through the browser's parsing of the data, the hierarchical relationship of the data and the summary results can be clearly seen, and the summary and detailed data of each organization are also displayed more intuitively.
[0094] In one embodiment, after associating the first detail data to the detail leaf node to obtain the target structured business data, it also includes: in response to an adjustment instruction for the first tree structure, adjusting the first tree structure to obtain a second tree structure; based on the second tree structure, adjusting the target structured business data to obtain new target structured business data.
[0095] Optionally, when the user adjusts the first tree structure, the computer device generates an adjustment instruction for the first tree structure, and in response to the adjustment instruction, adjusts the first tree structure to obtain the second tree structure.
[0096] Optionally, based on the second tree structure, the target structured business data is adjusted to obtain new target structured business data, including: determining that there is an adjustment node in the second tree structure relative to the first tree structure; obtaining the adjustment business data corresponding to the adjustment node in the target structured business data, and associating the adjustment business data to the adjustment node to obtain new target structured business data.
[0097] The computer device determines that there is an adjusted node in the second tree structure relative to the first tree structure, determines the adjusted business data corresponding to the adjusted node from the target structured business data, and associates the adjusted business data with the adjusted node to obtain new target structured business data.
[0098] It is understandable that the report dimensions of the tree structure of traditional technology cannot be adjusted dynamically, and thus the adjusted node data cannot be summarized in real time; whereas in this embodiment, in response to an adjustment instruction to the first tree structure, the first tree structure is adjusted to obtain a second tree structure, and based on the second tree structure, the target structured business data can be dynamically adjusted to obtain new target structured business data, thereby avoiding the problem of being unable to adjust structured data due to the solidification of functional service logic, and being able to dynamically adjust structured business data, thereby summarizing the adjusted structured business data in real time, thereby improving the accuracy and flexibility of structured processing.
[0099] Furthermore, the computer device determines that there is an adjusted node in the second tree structure relative to the first tree structure, obtains the adjusted business data corresponding to the adjusted node in the target structured business data, and associates the adjusted business data with the adjusted node, so as to accurately adjust the structured data and obtain new target structured business data.
[0100] In one embodiment, the client adjusts Figure 5 The first tree structure in , we get Figure 7 In the second tree structure, the second level is adjusted to two nodes, and the second level has one sub-level node and two sub-level nodes. Figure 8 As shown, business data will be based on Figure 7 The second tree structure is adjusted, the data of different nodes are associated with the corresponding nodes of the second tree structure, and summarized according to different hierarchical structures. It can be seen that the dimensions and Figure 6 There are differences, and the parent node to which the detail data belongs will also be different.
[0101] In one embodiment, a data structure processing method is also provided, which is applied to a computer device, and the data structure processing method includes the following steps:
[0102] Step A1: construct a first tree structure of the target business based on the structured data of the target business; the first tree structure includes at least two levels with a parent-child relationship, and each level includes at least one node.
[0103] Step A2: Acquire the business data of the target business, and associate the business data with the nodes of the first tree structure to obtain first structured business data.
[0104] Step A3, in the direction from sub-level to parent-level, based on the business data of each sub-level node in the first structured business data, obtain the target business data of each parent-level node in the first structured business data, and update the first structured business data based on the target business data of each parent-level node to obtain the second structured business data.
[0105] Step A4, if there is a second node in the second structured business data, the second node belongs to a parent-level node and the second node has second detailed data, then a sub-level virtual leaf node is constructed for the second node; the virtual leaf node is taken as the first node, and the second detailed data is taken as the first detailed data, and step A6 is executed; the virtual leaf node has the second detailed data, and the virtual leaf node includes a current data identifier, a parent-level identifier and a sub-level identifier. The current data identifier of the virtual leaf node is used to represent the data identifier of the virtual leaf node, the parent-level identifier of the virtual leaf node is used for the data identifier of the parent-level node of the virtual leaf node, and the parent-level identifier of the virtual leaf node is the same as the current data identifier of the second node, and the sub-level identifier is used to represent whether the virtual leaf node has a sub-level node.
[0106] Step A5: If there is a first node in the second structured business data, and the first node has first detailed data, then execute step A6; the first node belongs to a non-parent level node.
[0107] Step A6, constructing a sub-level detailed leaf node for the first node, and associating the first detailed data to the detailed leaf node to obtain target structured business data.
[0108] Step A7, for each detail leaf node, add the current data identifier, parent level identifier and child level identifier to the detail leaf node, and the current data identifier of the detail leaf node is not repeated with the current data identifiers of other nodes in the second structured business data.
[0109] Step A8: In response to the instruction to adjust the first tree structure, the first tree structure is adjusted to obtain a second tree structure.
[0110] Step A9: determining whether the second tree structure has an adjusted node relative to the first tree structure.
[0111] Step A10: acquiring the adjusted business data corresponding to the adjusted node in the target structured business data, and associating the adjusted business data with the adjusted node to obtain new target structured business data.
[0112] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0113] Based on the same inventive concept, the embodiment of the present application also provides a data structure processing device for implementing the data structure processing method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in the one or more data structure processing device embodiments provided below can refer to the limitations on the data structure processing method above, and will not be repeated here.
[0114] In an exemplary embodiment, Fig. 9 As shown, a data structure processing device is provided, including: a tree structure construction module 902, a business data structure module 904, a parent level business data processing module 906 and a detailed leaf node construction module 908, wherein:
[0115] The tree structure building module 902 is used to build a first tree structure of the target business based on the structured data of the target business; the first tree structure includes at least two levels with a parent-child relationship, and each level includes at least one node.
[0116] The business data structuring module 904 is used to obtain the business data of the target business and associate the business data with the nodes of the first tree structure to obtain first structured business data.
[0117] The parent-level business data processing module 906 is used to obtain the target business data of each parent-level node in the first structured business data in the direction from the child level to the parent level based on the business data of each child-level node in the first structured business data, and update the first structured business data based on the target business data of each parent-level node to obtain the second structured business data.
[0118] The detail leaf node construction module 908 is used to construct a sub-level detail leaf node for the first node if there is a first node in the second structured business data and the first node has first detail data, and associate the first detail data to the detail leaf node to obtain the target structured business data.
[0119] The above-mentioned data structuring processing device constructs a first tree structure of the target business based on the structured data of the target business, and the first tree structure includes at least two levels with a parent-child relationship, and each level includes at least one node; obtains the business data of the target business, and associates the business data with the nodes of the first tree structure to obtain the first structured business data; in the direction from the sub-level to the parent level, based on the business data of each sub-level node in the first structured business data, the target business data of each parent-level node in the first structured business data can be accurately obtained, so that the first structured business data is updated based on the target business data of each parent-level node to obtain more accurate second structured business data; if there is a first node in the second structured business data, and the first node has first detailed data, then a detailed leaf node of the sub-level is constructed for the first node, and the first detailed data is associated with the detailed leaf node, so that the detailed data of the first node can be obtained, and then more accurate target structured business data can be obtained.
[0120] In one embodiment, the above-mentioned device also includes a virtual leaf node construction module, which is used to construct a sub-level virtual leaf node for the second node if there is a second node in the second structured business data, the second node belongs to a parent-level node and the second node has second detailed data; the virtual leaf node has the second detailed data; the above-mentioned detailed leaf node construction module 908 is also used to use the virtual leaf node as the first node, and use the second detailed data as the first detailed data, to construct a sub-level detailed leaf node for the first node.
[0121] In one embodiment, the virtual leaf node includes a current data identifier, a parent level identifier and a child level identifier. The current data identifier of the virtual leaf node is used to represent the data identifier of the virtual leaf node. The parent level identifier of the virtual leaf node is used to represent the data identifier of the parent level node of the virtual leaf node. The parent level identifier of the virtual leaf node is the same as the current data identifier of the second node. The child level identifier is used to represent whether the virtual leaf node has a child level node.
[0122] In one embodiment, the above-mentioned detail leaf node construction module 908 is also used to add a current data identifier, a parent level identifier and a child level identifier to each of the detail leaf nodes, and the current data identifier of the detail leaf node is not repeated with the current data identifiers of other nodes in the second structured business data.
[0123] In one embodiment, the above-mentioned device also includes a structured data adjustment module, which is used to adjust the first tree structure to obtain a second tree structure in response to an adjustment instruction for the first tree structure; based on the second tree structure, adjust the target structured business data to obtain new target structured business data.
[0124] In one embodiment, the above-mentioned structured data adjustment module is also used to determine whether the second tree structure has an adjustment node that is adjusted relative to the first tree structure; obtain the adjustment business data corresponding to the adjustment node in the target structured business data, and associate the adjustment business data to the adjustment node to obtain new target structured business data.
[0125] Each module in the above-mentioned data structured processing device can be implemented in whole or in part by software, hardware, or a combination thereof. Each of the above-mentioned modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each of the above modules.
[0126] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Fig.10 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store structured data, business data, etc. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a data structured processing method is implemented.
[0127] Those skilled in the art will understand that Fig.10The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0128] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.
[0129] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0130] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0131] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0132] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0133] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0134] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A data structured processing method, characterized in that: The method comprises: Based on the structured data of the target business, construct a first tree structure of the target business; the first tree structure includes at least two levels with a parent-child relationship, and each level includes at least one node; Acquire business data of the target business, and associate the business data with nodes in the first tree structure to obtain first structured business data; In the direction from the sub-level to the parent-level, based on the business data of each sub-level node in the first structured business data, the target business data of each parent-level node in the first structured business data is obtained, and the first structured business data is updated based on the target business data of each parent-level node to obtain the second structured business data; If there is a first node in the second structured business data, and the first node has first detail data, a sub-level detail leaf node is constructed for the first node, and the first detail data is associated with the detail leaf node to obtain the target structured business data.
2. The method according to claim 1, characterized in that The method further comprises: If there is a second node in the second structured business data, the second node belongs to a parent-level node and the second node has second detailed data, then constructing a sub-level virtual leaf node for the second node; the virtual leaf node has the second detailed data; The virtual leaf node is used as the first node, and the second detailed data is used as the first detailed data, and the step of constructing a sub-level detailed leaf node for the first node is performed.
3. The method according to claim 2, characterized in that The virtual leaf node includes a current data identifier, a parent level identifier and a child level identifier. The current data identifier of the virtual leaf node is used to represent the data identifier of the virtual leaf node. The parent level identifier of the virtual leaf node is used to represent the data identifier of the parent level node of the virtual leaf node. The parent level identifier of the virtual leaf node is the same as the current data identifier of the second node. The child level identifier is used to represent whether the virtual leaf node has a child level node.
4. The method according to claim 1, characterized in that: The method further comprises: For each of the detail leaf nodes, a current data identifier, a parent level identifier and a child level identifier are added to the detail leaf node, and the current data identifier of the detail leaf node is not repeated with the current data identifiers of other nodes in the second structured business data.
5. The method according to claim 1, characterized in that After associating the first detail data with the detail leaf node to obtain target structured business data, the method further includes: In response to an instruction to adjust the first tree structure, adjusting the first tree structure to obtain a second tree structure; Based on the second tree structure, the target structured service data is adjusted to obtain new target structured service data.
6. The method according to claim 5, characterized in that The step of adjusting the target structured service data based on the second tree structure to obtain new target structured service data includes: Determining that the second tree structure has an adjusted node relative to the first tree structure; The adjusted business data corresponding to the adjustment node in the target structured business data is acquired, and the adjusted business data is associated with the adjustment node to obtain new target structured business data.
7. A data structure processing device, characterized in that: The device comprises: A tree structure building module, used to build a first tree structure of the target business based on the structured data of the target business; the first tree structure includes at least two levels with a parent-child relationship, and each level includes at least one node; A business data structuring module, used to obtain business data of the target business, and associate the business data with the nodes of the first tree structure to obtain first structured business data; a parent-level business data processing module, configured to obtain target business data of each parent-level node in the first structured business data in a direction from the child level to the parent level based on the business data of each child-level node in the first structured business data, and update the first structured business data based on the target business data of each parent-level node to obtain second structured business data; A detail leaf node construction module is used to construct a sub-level detail leaf node for the first node if there is a first node in the second structured business data and the first node has first detail data, and associate the first detail data to the detail leaf node to obtain the target structured business data.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Cited By
Structural information normalization method and device, computer readable storage medium and electronic equipment
CN120578783A
Structural information normalization method and device, computer readable storage medium and electronic device
CN120578783B
Production information processing method and device and storage medium
CN120780781A