Data Processing Method, Device, Equipment and Medium Based on Organization Tree
By obtaining business request data and preset candidate table-level knowledge graphs, determining the organization tree and data table, and processing them based on the functional data in the business request data, the problem of omission of data updates during organization tree adjustment is solved, and the comprehensiveness of data updates is improved.
Patent Information
- Application Number
- CN202510353708.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-25
- Publication Date
- 2025-06-24
- Estimated Expiration
- 2045-03-25
AI Technical Summary
During the organization tree adjustment process, the historical data of the business system changes, resulting in a large amount of data migration work and prone to data update omissions, affecting the comprehensiveness of data updates.
By obtaining business request data, and based on the preset candidate table-level knowledge graph, the current master table identification and slave table identification are determined, the corresponding organization tree and data table are determined, and the organization tree and data table are processed according to the functional data in the business request data to realize data update.
This method accurately determines the organization tree and data table corresponding to the service request data through a predetermined candidate table-level knowledge graph, so as to realize data updates, avoid the omission of update data, and improve the comprehensiveness of data updates.
Smart Images

Figure CN119884279B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the technical field of data processing, and in particular, to a data processing method, apparatus, device, and medium based on an organizational tree. Background Art
[0002] With the development and changes of society, some organizations need to adjust their internal structures to adapt to the development. Operations such as merging, splitting, deleting, and adding to the organizational tree will be carried out. Moreover, since business data is associated with various business functions, the historical data of the business system will change, resulting in a relatively large workload for data migration and the occurrence of data update omissions. Therefore, how to improve the comprehensiveness of data update based on the organizational tree is crucial. Summary of the Invention
[0003] The present invention provides a data processing method, apparatus, device, and medium based on an organizational tree to improve the comprehensiveness of data update based on the organizational tree.
[0004] According to one aspect of the present invention, there is provided a data processing method based on an organizational tree, including:
[0005] Obtaining business request data, and determining a current main table identifier and a current slave table identifier based on the business request data and a preset candidate table-level knowledge graph; wherein, the candidate table-level knowledge graph is determined according to candidate interface request data, candidate bytecode files, and candidate data tables;
[0006] Determining a current main organizational tree corresponding to the current main table identifier, and determining a current slave data table corresponding to the current slave table identifier;
[0007] Processing a current main data node in the current main organizational tree and current slave update data in the current slave data table respectively according to current function data in the business request data to obtain a correspondingly updated current main organizational tree and current slave data table; wherein, the current function data includes at least one of current merge data and current transfer data.
[0008] According to another aspect of the present invention, there is provided a data processing apparatus based on an organizational tree, including:
[0009] A current table identifier determination module, configured to obtain business request data, and determine a current main table identifier and a current slave table identifier based on the business request data and a preset candidate table-level knowledge graph; wherein, the candidate table-level knowledge graph is determined according to candidate interface request data, candidate bytecode files, and candidate data tables;
[0010] A main organizational tree determination module, configured to determine a current main organizational tree corresponding to the current main table identifier, and determine a current slave data table corresponding to the current slave table identifier;
[0011] A data processing module, configured to process a current master data node in the current master organization tree and current slave update data in the current slave data table respectively according to current function data in the service request data, so as to obtain a correspondingly updated current master organization tree and current slave data table; wherein, the current function data includes at least one of current merge data and current transfer data.
[0012] According to another aspect of the present invention, there is provided an electronic device, including:
[0013] One or more processors;
[0014] A memory for storing one or more programs;
[0015] When the one or more programs are executed by the one or more processors, the one or more processors are enabled to execute any one of the data processing methods based on the organization tree provided by the embodiments of the present invention.
[0016] According to another aspect of the present invention, there is provided a computer-readable storage medium storing computer instructions for causing a processor to implement any one of the data processing methods based on the organization tree provided by the embodiments of the present invention when executed.
[0017] The embodiments of the present invention provide a data processing solution based on an organization tree. By obtaining service request data and determining a current master table identifier and a current slave table identifier based on the service request data and a preset candidate table-level knowledge graph; wherein, the candidate table-level knowledge graph is determined according to a target master table identifier determined from target interface request data and candidate data tables; determining a current master organization tree corresponding to the current master table identifier and determining a current slave data table corresponding to the current slave table identifier; processing a current master data node in the current master organization tree and current slave update data in the current slave data table respectively according to current function data in the service request data, so as to obtain a correspondingly updated current master organization tree and current slave data table; wherein, the current function data includes at least one of current merge data and current transfer data. In the above solution, through the pre-determined candidate table-level knowledge graph, according to the candidate table-level knowledge graph, the current master organization tree and the current slave data table corresponding to the service request data are determined, and data update is realized according to the current master organization tree and the current slave data table, avoiding the omission of updated data and improving the comprehensiveness of data update based on the organization tree.
[0018] It should be understood that the content described in this part is not intended to identify the key or important features of the embodiments of the present invention, nor is it used to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. Description of the Drawings
[0019] To more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the accompanying drawings required for the description of the embodiments. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other accompanying drawings can also be obtained based on these drawings.
[0020] Figure 1 It is a flowchart of a data processing method based on an organization tree provided in Embodiment 1 of the present invention;
[0021] Figure 2 It is a flowchart of a data processing method based on an organization tree provided in Embodiment 2 of the present invention;
[0022] Figure 3 It is a schematic structural diagram of a data processing device based on an organization tree provided in Embodiment 4 of the present invention;
[0023] Figure 4 It is a schematic structural diagram of an electronic device for implementing a data processing method based on an organization tree provided in Embodiment 5 of the present invention. Detailed implementation manners
[0024] The following will further elaborate on the present invention in conjunction with the accompanying drawings and embodiments. It can be understood that the specific embodiments described herein are only used to explain the present invention, rather than limiting the present invention. Additionally, it should be noted that for the sake of convenience of description, only the parts related to the present invention rather than all the structures are shown in the accompanying drawings.
[0025] Embodiment 1
[0026] Figure 1 It is a flowchart of a data processing method based on an organization tree provided in Embodiment 1 of the present invention. This embodiment is applicable to the situation of updating the main organization tree and associated business data. This method can be executed by a data processing device based on an organization tree. The device can be implemented in a software and / or hardware manner and can be configured in an electronic device carrying the data processing function based on an organization tree.
[0027] See Figure 1 The data processing method based on an organization tree shown, including:
[0028] S110. Obtain business request data, and determine the current main table identifier and the current slave table identifier based on the business request data and a preset candidate table-level knowledge graph.
[0029] Among them, the service request data can be used to indicate an update to the data in the database. The candidate table-level knowledge graph can be used to record the association relationship between the main table and the slave table in the database. Exemplarily, the candidate table-level knowledge graph includes a target main table identifier - a target association field identifier - a target slave table identifier.
[0030] Exemplarily, the candidate table-level knowledge graph is determined according to the candidate interface request data, the candidate bytecode file, and the candidate data table. Among them, the candidate interface request data can be used to indicate calling the interface of the target application system. The target application system refers to the application system that obtains the candidate interface request data. The candidate data table refers to the data table pre-stored in the database. The candidate bytecode file refers to the program running file in the backend service.
[0031] Among them, the current main table identifier can be used to uniquely represent the identity of the main table corresponding to the service request data. The current slave table identifier can be used to uniquely represent the identity of the slave table corresponding to the service request data.
[0032] In an alternative embodiment, based on the service request data and the preset candidate table-level knowledge graph, determining the current main table identifier and the current slave table identifier includes: determining the current interface identifier corresponding to the service request data, and according to the current interface identifier, determining the current table-level knowledge graph from the candidate table-level knowledge graph; according to the current table-level knowledge graph, determining the current main table identifier and the current slave table identifier.
[0033] Among them, the current interface identifier refers to the identity identifier of the interface that receives the service request data, that is, the current interface identifier can be used to uniquely represent the identity of the interface that receives the service request data. The current table-level knowledge graph refers to the candidate table-level knowledge graph corresponding to the current interface identifier. It should be noted that different interfaces have a uniquely corresponding candidate table-level knowledge graph.
[0034] Specifically, the main table identifier recorded in the current table-level knowledge graph is used as the current main table identifier, and the slave table identifier recorded in the current table-level knowledge graph is used as the current slave table identifier.
[0035] It can be understood that by determining the current table-level knowledge graph according to the current interface identifier corresponding to the service request data, and then determining the current main table identifier and the current slave table identifier according to the current table-level knowledge graph, the accuracy of the determined current main table identifier and current slave table identifier is improved.
[0036] S120. Determine the current main organization tree corresponding to the current main table identifier, and determine the current data slave table corresponding to the current slave table identifier.
[0037] Among them, the current main organization tree refers to the data table corresponding to the current main table identifier. In the embodiments of the present invention, the data of the main table is stored in the form of an organization tree, so the main table corresponding to the current main table identifier can be the current main organization tree.
[0038] Among them, the current slave data table refers to the data table corresponding to the current slave table identifier. The current slave data table can be understood as an additional table or a foreign key table of the current main organization tree.
[0039] Specifically, determine the current main organization tree corresponding to the current main table identifier and the current slave data table corresponding to the current slave table identifier respectively.
[0040] S130. According to the current function data in the service request data, process the current main data nodes in the current main organization tree and the current slave update data in the current slave data table respectively, to obtain the corresponding updated current main organization tree and current slave data table.
[0041] Among them, the current function data refers to the function data used to indicate specific update operations on the data. Exemplarily, the current function data includes at least one of current merge data, current transfer data, and current split data, etc.
[0042] Among them, the current merge data can be used to indicate a merge operation on the data. Exemplarily, the current merge data can be node deletion or node creation. Node deletion means deleting the current main data nodes in the current main organization tree. Node creation means deleting at least two current main data nodes in the current main organization data and creating a new node.
[0043] Among them, the current transfer data can be used to indicate a transfer operation on the data. Exemplarily, the current transfer data can be collective transfer or unbinding transfer. Collective transfer means that the current main data nodes in the current main organization tree are transferred together. Unbinding transfer means that some of the current main data nodes in the current main organization tree are transferred.
[0044] Among them, the current split data can be used to indicate a split operation on the data.
[0045] Among them, the current main data node refers to the data node in the current main organization tree that needs to be processed. The current slave update data refers to the data in the current slave data table that needs to be processed.
[0046] In an alternative embodiment, according to the current function data in the service request data, the current master data node in the current master organization tree and the current slave data node in the current slave data table are respectively processed to obtain the corresponding updated current master organization tree and the current slave data table, including: determining and processing the current master data node in the current master organization tree according to the current function data, and updating the reference master data node associated with the current master data node to obtain the updated current master organization tree; determining the current association field according to the current master data node and the reference master data node, and determining the current slave update data in the current slave data table according to the current association field; processing the current slave update data according to the current function data to obtain the updated current slave data table.
[0047] Among them, the reference master data node refers to the candidate master data node associated with the current master data node in the current master organization tree. The candidate master data node refers to the data node in the current master organization tree. The current association field refers to the field updated in the current master organization tree.
[0048] It can be understood that by introducing the reference master data node, the reference master data node and the current master data node in the current master organization tree are updated, which improves the accuracy of the updated current master organization tree and avoids the situation of update chaos; at the same time, in the embodiment of the present invention, the current association field is determined according to the current master data node and the reference master data node, and then the current slave update data is determined according to the current association field, which improves the accuracy and comprehensiveness of the determined current slave update data, and further improves the accuracy of the updated current slave data table.
[0049] The embodiment of the present invention provides a data processing solution based on an organization tree. By obtaining service request data and based on the service request data and a preset candidate table-level knowledge graph, the current master table identifier and the current slave table identifier are determined; among them, the candidate table-level knowledge graph is determined according to the target master table identifier determined by the target interface request data and the candidate data table; determining the current master organization tree corresponding to the current master table identifier and determining the current slave data table corresponding to the current slave table identifier; according to the current function data in the service request data, the current master data node in the current master organization tree and the current slave update data in the current slave data table are respectively processed to obtain the corresponding updated current master organization tree and the current slave data table; among them, the current function data includes at least one of the current merge data and the current transfer data. The above solution, through the pre-determined candidate table-level knowledge graph, determines the current master organization tree and the current slave data table corresponding to the service request data according to the candidate table-level knowledge graph, and realizes data update according to the current master organization tree and the current slave data table, avoiding the omission of update data and improving the comprehensiveness of data update based on the organization tree.
[0050] Embodiment 2
[0051] Figure 2 It is a flowchart of a data processing method based on an organization tree provided in the second embodiment of the present invention. On the basis of the above embodiments, further, the operation of "obtaining candidate interface request data, and determining whether the candidate interface request data is target interface request data based on preset interface request judgment data; wherein, the interface request judgment data includes tree structure key data and interface function data; if so, determining a target main table identifier according to the tree structure key data, candidate bytecode files, and preset standard types in the target interface request data, and determining a target main table from the candidate data tables according to the target main table identifier, and judging whether there is a target slave table in the target main table; if not, determining a target association field identifier according to the target main table identifier and other candidate data tables, and determining a corresponding target slave table from the other candidate data tables according to the target association field identifier; generating a candidate table-level knowledge graph including the target main table identifier, target association field identifier, and target slave table identifier" is added to improve the determination mechanism of the candidate table-level knowledge graph. It should be noted that for the parts not detailed in the embodiments of the present invention, reference can be made to the descriptions of other embodiments.
[0052] See Figure 2 The data processing method based on the organization tree shown includes:
[0053] S210. Obtain candidate interface request data, and determine whether the candidate interface request data is target interface request data based on preset interface request judgment data.
[0054] Among them, the candidate interface request data refers to the request data used to indicate the invocation of an interface. The interface request judgment data can be used to judge whether the candidate interface request data can determine the corresponding candidate table-level knowledge graph. Exemplarily, the interface request judgment data includes tree structure key data and interface function data.
[0055] Among them, the tree structure key data can be used to judge whether there is a tree structure in the candidate interface request data. Exemplarily, the tree structure key data may include code, parentId, and children array.
[0056] Among them, the interface function data can be used to judge whether the interface corresponding to the candidate interface request data has a target function. Exemplarily, the interface function data may include merge function, split function, and transfer function. The target interface request data refers to the candidate interface request data that can be used to construct a candidate table-level knowledge graph.
[0057] Exemplarily, based on preset interface request judgment data, determining whether candidate interface request data is target interface request data includes: determining whether there is a tree structure in the candidate interface request data based on preset tree structure key data; if so, determining whether the interface corresponding to the candidate interface request data has target function requests (including merge requests, split requests, and transfer requests) based on preset interface function data; if so, determining that the candidate interface request data is target interface request data.
[0058] Exemplarily, determining whether there is a tree structure in the candidate interface request data based on preset tree structure key data includes: determining whether there is tree structure key data in the candidate interface request data, that is, whether there are code, parentId, and children arrays in the candidate interface request data; if so, determining that there is a tree structure in the candidate interface request data; if not, indicating that there is no tree structure in the candidate interface request data.
[0059] Optionally, determining whether the interface corresponding to the candidate interface request data has target function requests based on preset interface function data includes: judging whether the interface request of the interface function data is included in the js file under the interface corresponding to the candidate interface request data; if so, determining that the interface corresponding to the candidate interface request data has target function requests; if not, determining that the interface corresponding to the candidate interface request data does not have target function requests.
[0060] Optionally, determining whether the interface corresponding to the candidate interface request data has target function requests based on preset interface function data includes: calling the data stack through the candidate interface request data to locate the current call page (i.e., the front-end page), and judging whether operation buttons such as merge, split, and transfer appear in the current call page; if so, determining that the interface corresponding to the candidate interface request data has target function requests; if not, determining that the interface corresponding to the candidate interface request data does not have target function requests.
[0061] Specifically, obtaining candidate interface request data through a page interface request interceptor, and determining whether the candidate interface request data is target interface request data according to the tree structure key data and interface function data. Among them, the page interface request interceptor can be used to obtain candidate interface request data.
[0062] S220. If so, determine the target main table identifier according to the tree structure key data, candidate bytecode file, and preset standard type in the target interface request data, and determine the target main table from the candidate data tables according to the target main table identifier, and judge whether there is a target slave table in the target main table.
[0063] Among them, the candidate bytecode file refers to the program running file in the backend service. The preset standard type refers to the type of class set in advance. Exemplarily, the preset standard type may include entity classes and DO classes. The target main table identifier can be used to represent the identity of the main table corresponding to the target interface request data. The target main table refers to the candidate data table corresponding to the target main table identifier. The target main table can also be called the target main organization tree, and the target main table stores data in the form of an organization tree. The target slave table refers to the additional table of the target main table.
[0064] In an alternative embodiment, determining the target main table identifier according to the tree structure key data, the candidate bytecode file, and the preset standard type includes: determining a matching reference bytecode file from the candidate bytecode file, and determining the reference type of the reference class to which the tree structure key data in the reference bytecode file belongs; according to the preset standard type, determining whether the reference type is the target type, and if so, determining the corresponding target main table identifier according to the target type.
[0065] Among them, the reference bytecode file refers to the candidate bytecode file including the tree structure key data. The reference class refers to the class to which the tree structure key data in the reference bytecode file belongs. The reference type refers to the type of the reference class to which the tree structure key data belongs in the reference bytecode file. The target type refers to the reference type that is the same as the preset standard type.
[0066] It should be noted that if the number of target main table identifiers determined according to the target type is at least two, then the actual target type corresponding to the target number interface request data can be determined from the at least two target types according to the interface address in the target interface request data. The advantage is that the accuracy and uniqueness of the target main table identifier determined subsequently based on the target type are improved. Among them, the interface address can represent the interface identity corresponding to the target interface request data.
[0067] Specifically, the candidate bytecode file with the tree structure key data is used as the reference bytecode file; the reference type of the reference class to which the tree structure key data belongs in the reference bytecode file is determined; the reference type that matches the preset standard type is used as the target type; the target main table identifier corresponding to the target interface request data is determined according to the target type and the class name of the reference class.
[0068] It can be understood that by determining the reference bytecode file from the candidate bytecode file, then determining the reference type in the reference bytecode file according to the tree structure key data, determining the target type according to the preset standard type, and finally determining the target main table identifier according to the reference type, the accuracy of the determined target main table identifier is improved.
[0069] Exemplarily, according to the target main table identifier, a matching target main table is determined from the candidate data tables in the database, and it is determined whether there is a primary-foreign key situation in the target main table, that is, it is determined whether there is a target slave table for the target main table.
[0070] S230. If not, according to the target main table identifier and other candidate data tables, determine the target association field identifier, and according to the target association field identifier, determine the corresponding target slave table from other candidate data tables.
[0071] Among them, other candidate data tables refer to the candidate data tables in the database except the target main table. The target association field refers to the field where there is an association between the target main table and other candidate data tables. The target association field identifier can be used to uniquely represent the identity of the target association field.
[0072] In an alternative embodiment, determining the target association field identifier according to the target main table identifier of the target main table and other candidate data tables includes: segmenting the target main table identifier of the target main table to obtain main table sub-identifiers, and based on preset identifier data and the main table sub-identifiers, obtaining candidate association field identifiers; determining the target association field identifier according to the candidate association field identifiers and other candidate data tables.
[0073] Among them, the main table sub-identifiers refer to partial target main table identifiers obtained by segmenting the target main table identifier. The preset identifier data refers to the data that is combined with the main table sub-identifiers to determine the candidate association field identifiers. The embodiments of the present invention do not specifically limit the setting of the preset identifier data, and it can be set by those skilled in the art according to experience. Exemplarily, the preset identifier data can be Id or code. The candidate association fields refer to the fields where there may be an association between the target main table and other candidate data tables. The candidate association field identifiers can be used to uniquely represent the identity of the candidate association fields.
[0074] Exemplarily, candidate association field identifiers are obtained by segmenting the target main table identifier to obtain target main table sub-identifiers + Id or code; the target association field identifier is determined according to the candidate association field identifiers and the candidate field identifiers in other candidate data tables.
[0075] Specifically, for any candidate association field identifier, it is determined whether there is at least one candidate field identifier in other candidate data tables that is the same as the candidate association field identifier; if so, it is determined that the candidate association field identifier is the target association field identifier; if not, the candidate association field identifier is prohibited from being used as the target association field identifier.
[0076] It can be understood that by determining the sub-identifier of the main table and the preset identifier data obtained after word segmentation according to the target main table identifier, and then determining the target associated field identifier from the candidate associated field identifiers, the accuracy of the determined target associated field identifier is improved.
[0077] Specifically, use the other candidate data tables where the target associated field identifier is located as the target slave table corresponding to the target main table.
[0078] S240. Generate a candidate table-level knowledge graph including the target main table identifier, the target associated field identifier, and the target slave table identifier.
[0079] S250. Obtain the business request data, and based on the business request data and the preset candidate table-level knowledge graph, determine the current main table identifier and the current slave table identifier.
[0080] Among them, the candidate table-level knowledge graph is determined according to the target main table identifier determined from the target interface request data and the candidate data tables.
[0081] S260. Determine the current main organization tree corresponding to the current main table identifier, and determine the current slave data table corresponding to the current slave table identifier.
[0082] S270. According to the current function data in the business request data, process the current main data nodes in the current main organization tree and the current slave update data in the current slave data table respectively, to obtain the corresponding updated current main organization tree and current slave data table.
[0083] An embodiment of the present invention provides a data processing solution based on an organizational tree. By adding the acquisition of candidate interface request data and determining whether the candidate interface request data is target interface request data based on preset interface request judgment data; wherein, the interface request judgment data includes tree structure key data and interface function data; if so, determine the target main table identifier according to the tree structure key data, candidate bytecode file and preset standard type in the target interface request data, and determine the target main table from the candidate data tables according to the target main table identifier, and determine whether there is a target slave table in the target main table; if not, determine the target association field identifier according to the target main table identifier and other candidate data tables, and determine the corresponding target slave table from other candidate data tables; generate a candidate table-level knowledge graph operation including the target main table identifier, target association field identifier and target slave table identifier, improving the determination mechanism of the candidate table-level knowledge graph. In the above solution, the target main table identifier is determined through the tree structure key data, candidate bytecode file and preset standard type, and then it is determined whether there is a target slave table in the target main table corresponding to the target main table identifier. If not, the target slave table is determined through the determined target association field identifier, and a candidate table-level knowledge graph including the target main table identifier, target association field identifier and target slave table identifier is generated, avoiding the situation of missing target slave tables and improving the accuracy and comprehensiveness of the determined candidate table-level knowledge graph.
[0084] Based on the above technical solution, the method further includes: determining the application type of the target application system corresponding to the target interface request data; if the application type is a cluster application, use the target main table identifier and target association field identifier as request additional values and add them to the request return value corresponding to the target interface request; detect whether there is a request additional value through the service gateway, and if so, send the request additional value to other application systems associated with the target application system, so that other application systems generate corresponding candidate table-level knowledge graphs according to the request additional values.
[0085] Wherein, the target application system refers to the application system that acquires the candidate interface request data. The application type refers to the type of the target application system. Exemplarily, the application type may include cluster applications and single applications. A cluster application refers to a set of applications with multiple associated application nodes. A single application refers to an application without associated application nodes.
[0086] Wherein, the request additional value can be used to supplement the request return value. The request return value refers to the return value corresponding to the target interface request. The service gateway can be used to acquire and detect the request return value. Other application systems refer to application systems other than the target application system in the application cluster.
[0087] The embodiments of the present invention do not specifically limit the method for determining the application type of the target application system corresponding to the target interface request data, and it can be set by those skilled in the art according to experience or needs. Exemplarily, it is detected whether the main startup application class of the backend service has the @EnableDiscoveryClient annotation. If it exists, it is a cluster application; if not, it is a single application. Or, by obtaining the current spring container context, obtaining the class object marked with @SpringBootApplication through the container context, and obtaining all the class annotations of this class, it is analyzed according to the class annotations whether there are common annotations of cluster applications such as nacos, feign, and eraka. If it contains, the current application is defined as a cluster application; if not, it is a single application.
[0088] It can be understood that if the target application system is determined to be a cluster application, the request additional value can be added to the request return value, and the service gateway is used to detect whether there is a request additional value in the request return value. If it exists, the request additional value is sent to other application systems in the cluster application, and other application systems can generate corresponding candidate table-level knowledge graphs according to the request additional value, improving the efficiency of generating candidate table-level knowledge graphs.
[0089] Embodiment III
[0090] Based on the above embodiments, the embodiments of the present invention provide an optional example. It should be noted that for the parts not detailed in the embodiments of the present invention, reference can be made to the descriptions of other embodiments.
[0091] Exemplarily, when the user enters the application system of the service, a page interface request interceptor is added, and the candidate interface request data is automatically identified to determine whether there is a tree structure (that is, to determine whether there are code, parentId, and children array in the candidate interface request data. If it exists, it is a tree structure). If it is detected that there is a tree structure, page behavior understanding needs to be started. Whether the js file under the candidate request interface (that is, the interface corresponding to the candidate interface request data) contains interface requests for operations such as merging, splitting, deleting, and adding, or by calling the data stack, locate the current calling page (that is, the front-end page). Whether there are operation buttons such as merging, splitting, deleting, and adding in the current calling page. If it is satisfied, business data modeling analysis is automatically started, and at the same time, the interfaces for action requests such as merging, splitting, and transferring are extracted and passed to the backend service, that is, the key data and interface addresses of the tree structure in the target interface request data are sent to the backend.
[0092] Exemplarily, by building a modeling analysis service in the backend service, when the modeling conditions are met, the tree structure field definition (i.e., the key data of the tree structure) detected by the front-end page construction is passed into the modeling analysis service. After receiving the key data of the tree structure, the modeling analysis service starts in the current working environment (i.e., the application environment of the backend service), obtains all candidate bytecode files, reads the candidate bytecode files, and performs inverse definition on the bytecode files to match the key data of the tree structure. If a match can be made and the reference type of the class is an entity, DO, or other class files (i.e., if a match can be made and the class corresponding to the matched reference bytecode file is an entity or DO), the target main table identifier corresponding to the reference class is extracted, and based on the current database connection information, it is determined whether there is a primary-foreign key relationship in the target main table. If there is, the field name of the foreign key is determined. If there is no primary-foreign key relationship, it indicates that the target main table is a weak reference. For the case of weak references, all table name metadata in the database needs to be read, and each table field is detected to determine the name of the weak reference field. The main detection rule is table name word segmentation + Id or code. Once the name of the weak reference field is determined and the field determination is completed, the field name (i.e., the target associated field identifier) and the tree structure table name (i.e., the target main table identifier) are constructed into key-value pairs and placed in the global configuration variable with the tree structure identifier as the key. If there are multiple tree structures, there will be multiple records for the value of the tree structure identifier key. After the addition is completed, the current backend service environment is detected to determine whether the current environment is a single application or a cluster application.
[0093] Exemplarily, for a cluster application, after the application type is determined, the field name and the tree structure table name are appended as the return value of each http (HyperText Transfer Protocol) request (i.e., the request additional value is added to the request return value). At the same time, detection is performed in the service gateway. If the addition of this return value (i.e., the request additional value is detected), the relationship propagation of the tree fields is started. In the gateway service, all service lists are obtained, and a simulated user http request is made to propagate the field name and the tree structure table name to each microservice. When each microservice detects the relationship propagation of the tree fields in the request, the generation of the tree field business graph (i.e., the candidate table-level knowledge graph) is automatically started; if it is a single application, after the application is identified, the generation of the candidate table-level knowledge graph is automatically triggered.
[0094] Specifically, by obtaining the database connection pool of the current spring container, obtaining a database connection, and obtaining all database table fields, and matching according to the target association field identifier. If a match is found, a relationship graph is established in the current service (i.e., determining the candidate table-level knowledge graph), in the form of a tree-structured table name (i.e., the target main table identifier) - target association field identifier - business table name (i.e., the target slave table identifier). When the service detection is completed, the established relationship graph is placed in the global variable of the current spring container. If it is a cluster application, it will return to the gateway for registration and start monitoring the tree operation at the same time.
[0095] Exemplarily, when operations such as merging, splitting, and transferring are monitored, the operations on the tree structure are automatically propagated. After the operations on the tree structure are monitored in each backend service, the management actions of business data are started.
[0096] Specifically, for the merge operation, first, in the tree management, intercept the two tree nodes involved in the operation and analyze the changes of the two tree nodes after the merge operation, whether to delete a certain node or create a new tree node. When the operation intention of the tree node is determined, perform data operations on the business service relationship graph according to the business intention. If a certain node is to be deleted, update the associated fields of the business data associated with the deleted node and record the update log at the same time; if it is an operation to delete two nodes and create a new node, the business IDs of the two business tables need to be updated.
[0097] Specifically, for the split operation, it is impossible to determine the data split intention automatically. All requests need to be monitored. When there is data related to the split tree node, automatically intercept the operation and prompt the user to perform the corresponding split of the business data to complete the split of the business data.
[0098] Specifically, the transfer operation mainly involves the transfer of different levels and cross-levels of tree nodes. For the transfer operation, intercept the transfer action and determine whether the action on the relevant business data is to transfer together or unbind the nodes. If it is to transfer together, the business data is not processed; if it is to unbind, obtain the upper-level node of the currently transferred node and change the upper-level node of the current business data.
[0099] Embodiment 4
[0100] Figure 3 It is a schematic structural diagram of a data processing device based on an organization tree provided by Embodiment 4 of the present invention. This embodiment is applicable to the situation of updating the main organization tree and related business data. This method can be executed by a data processing device based on an organization tree. The device can be implemented in software and / or hardware and can be configured in an electronic device carrying the data processing function based on an organization tree.
[0101] As Figure 3 shown, the device includes: a current table identifier determination module 310, a main organization tree determination module 320, and a data processing module 330. Among them,
[0102] The current table identifier determination module 310 is configured to obtain service request data, and determine a current main table identifier and a current slave table identifier based on the service request data and a preset candidate table-level knowledge graph; wherein, the candidate table-level knowledge graph is determined according to a target main table identifier determined from target interface request data and candidate data tables;
[0103] The main organization tree determination module 320 is configured to determine a current main organization tree corresponding to the current main table identifier, and determine a current slave data table corresponding to the current slave table identifier;
[0104] The data processing module 330 is configured to process a current main data node in the current main organization tree and current slave update data in the current slave data table respectively according to current function data in the service request data, to obtain a correspondingly updated current main organization tree and current slave data table; wherein, the current function data includes at least one of current merge data and current transfer data.
[0105] An embodiment of the present invention provides a data processing solution based on an organization tree. By obtaining service request data, and determining a current main table identifier and a current slave table identifier based on the service request data and a preset candidate table-level knowledge graph; wherein, the candidate table-level knowledge graph is determined according to a target main table identifier determined from target interface request data and candidate data tables; determining a current main organization tree corresponding to the current main table identifier, and determining a current slave data table corresponding to the current slave table identifier; processing a current main data node in the current main organization tree and current slave update data in the current slave data table respectively according to current function data in the service request data, to obtain a correspondingly updated current main organization tree and current slave data table; wherein, the current function data includes at least one of current merge data and current transfer data. The above solution determines a current main organization tree and a current slave data table corresponding to service request data according to a pre-determined candidate table-level knowledge graph, and realizes data update according to the current main organization tree and the current slave data table, avoiding omission of updated data and improving the comprehensiveness of data update based on the organization tree.
[0106] Optionally, the candidate table-level knowledge graph is determined based on the following device:
[0107] A target request data determination module, configured to obtain candidate interface request data and determine whether the candidate interface request data is target interface request data based on preset interface request judgment data; wherein, the interface request judgment data includes tree structure key data and interface function data;
[0108] A target slave table judgment module, configured to, if so, determine a target master table identifier according to the tree structure key data, candidate bytecode files and preset standard types in the target interface request data, and determine a target master table from the candidate data tables according to the target master table identifier, and determine whether there is a target slave table in the target master table;
[0109] A target slave table determination module, configured to, if not, determine a target associated field identifier according to the target master table identifier and other candidate data tables, and determine a corresponding target slave table from the other candidate data tables according to the target associated field identifier;
[0110] A candidate table-level knowledge graph construction module, configured to generate a candidate table-level knowledge graph including the target master table identifier, the target associated field identifier and the target slave table identifier.
[0111] Optionally, the target slave table judgment module is specifically configured to:
[0112] Determine a matching reference bytecode file from the candidate bytecode files, and determine the reference type of the reference class to which the tree structure key data in the reference bytecode file belongs;
[0113] According to the preset standard type, determine whether the reference type is a target type, and if so, determine a corresponding target master table identifier according to the target type.
[0114] Optionally, the target slave table determination module is specifically configured to:
[0115] Perform word segmentation on the target master table identifier of the target master table to obtain master table sub-identifiers, and obtain candidate associated field identifiers based on preset identifier data and the master table sub-identifiers;
[0116] Determine a target associated field identifier according to the candidate associated field identifier and other candidate data tables.
[0117] Optionally, the device further includes:
[0118] An application type determination module, configured to determine the application type of the target application system corresponding to the target interface request data;
[0119] A request return value adding module, configured to, if the application type is a cluster application, add the target main table identifier and the target associated field identifier as request additional values to the request return value corresponding to the target interface request;
[0120] A request additional value sending module, configured to detect whether there is the request additional value through a service gateway, and if so, send the request additional value to other application systems associated with the target application system, so that the other application systems generate corresponding candidate table-level knowledge graphs according to the request additional value.
[0121] Optionally, the current table identifier determining module 310 includes:
[0122] A current table-level knowledge graph determining unit, configured to determine a current interface identifier corresponding to the service request data, and determine a current table-level knowledge graph from the candidate table-level knowledge graphs according to the current interface identifier;
[0123] A current table identifier determining unit, configured to determine a current main table identifier and a current slave table identifier according to the current table-level knowledge graph.
[0124] Optionally, the data processing module 330 includes:
[0125] A main organization tree updating unit, configured to determine and process a current main data node in the current main organization tree according to the current function data, and update a reference main data node associated with the current main data node to obtain an updated current main organization tree;
[0126] A slave update data determining unit, configured to determine a current associated field according to the current main data node and the reference main data node, and determine current slave update data in the current slave data table according to the current associated field;
[0127] A current slave data table updating unit, configured to process the current slave update data according to the current function data to obtain an updated current slave data table.
[0128] The data processing device based on an organization tree provided by an embodiment of the present invention can execute the data processing method based on an organization tree provided by any embodiment of the present invention, and has corresponding functional modules and beneficial effects for executing each data processing method based on an organization tree.
[0129] In the technical solution of the present invention, the processing of collection, storage, use, processing, transmission, provision, and disclosure of service request data, candidate interface request data, etc. all comply with the provisions of relevant laws and regulations and do not violate public order and good customs.
[0130] Embodiment Five
[0131] Figure 4 It is a schematic structural diagram of an electronic device for implementing a data processing method based on an organizational tree provided in the fifth embodiment of the present invention. The electronic device 410 is intended to represent various forms of digital computers, such as, laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as, personal digital processors, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or claimed herein.
[0132] As Figure 4 shown, the electronic device 410 includes at least one processor 411, and a memory communicatively connected to the at least one processor 411, such as a read-only memory (ROM) 412, a random access memory (RAM) 413, etc. Among them, the memory stores a computer program executable by the at least one processor. The processor 411 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 412 or the computer program loaded from the storage unit 418 into the random access memory (RAM) 413. In the RAM 413, various programs and data required for the operation of the electronic device 410 can also be stored. The processor 411, the ROM 412, and the RAM 413 are connected to each other through a bus 414. The input / output (I / O) interface 415 is also connected to the bus 414.
[0133] Multiple components in the electronic device 410 are connected to the I / O interface 415, including: an input unit 416, such as a keyboard, a mouse, etc.; an output unit 417, such as various types of displays, speakers, etc.; a storage unit 418, such as a magnetic disk, an optical disk, etc.; and a communication unit 419, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 419 allows the electronic device 410 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0134] The processor 411 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the processor 411 include but are not limited to a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The processor 411 executes the various methods and processes described above, such as the data processing method based on the organizational tree.
[0135] In some embodiments, the data processing method based on the organization tree can be implemented as a computer program, which is tangibly included in a computer-readable storage medium, such as the storage unit 418. In some embodiments, part or all of the computer program can be loaded and / or installed onto the electronic device 410 via the ROM 412 and / or the communication unit 419. When the computer program is loaded into the RAM 413 and executed by the processor 411, one or more steps of the data processing method based on the organization tree described above can be executed. Alternatively, in other embodiments, the processor 411 can be configured to execute the data processing method based on the organization tree by any other suitable means (e.g., by means of firmware).
[0136] The various embodiments of the systems and techniques described above in this document can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on a chip (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include: being implemented in one or more computer programs, which can be executed and / or interpreted on a programmable system including at least one programmable processor, the programmable processor can be a dedicated or general-purpose programmable processor, and can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit the data and instructions to the storage system, the at least one input device, and the at least one output device.
[0137] The computer program for implementing the method of the present invention can be written in any combination of one or more programming languages. These computer programs can be provided to the processor of a general-purpose computer, a dedicated computer, or other programmable data processing devices, such that when the computer programs are executed by the processor, the functions / operations specified in the flowchart and / or block diagram are implemented. The computer programs can be executed entirely on the machine, partially on the machine, as an independent software package partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0138] In the context of the present invention, a computer-readable storage medium can be a tangible medium that can contain or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer-readable storage medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. Alternatively, the computer-readable storage medium can be a machine-readable signal medium. More specific examples of the machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0139] To provide for interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the electronic device. Other kinds of devices can also be used to provide for interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0140] The systems and techniques described herein can be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer having a graphical user interface or a web browser through which the user can interact with an implementation of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of the communication network include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0141] A computing system may include a client and a server. The client and the server are generally far from each other and usually interact via a communication network. The relationship between the client and the server is created by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or a cloud host, which is a host product in the cloud computing service system, and solves the defects of difficult management and weak business scalability existing in traditional physical hosts and VPS services.
[0142] It should be understood that various forms of processes shown above can be used, with steps reordered, added or deleted. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and no limitation is imposed herein.
[0143] The above specific embodiments do not constitute a limitation on the protection scope of the present invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.
Claims
1. A data processing method based on an organization tree, characterized in that: include: Obtaining business request data, and determining a current master table identifier and a current slave table identifier based on the business request data and a preset candidate table-level knowledge graph; wherein the candidate table-level knowledge graph is determined according to candidate interface request data, candidate bytecode files, and candidate data tables; Determine the current master organization tree corresponding to the current master table identifier, and determine the current slave data table corresponding to the current slave table identifier; According to the current function data in the business request data, the current master data node in the current master organization tree and the current slave update data in the current slave data table are processed respectively to obtain the corresponding updated current master organization tree and current slave data table; wherein the current function data includes at least one of current merged data and current transferred data; The candidate table-level knowledge graph is determined based on the following method: Acquire candidate interface request data, and determine whether the candidate interface request data is target interface request data based on preset interface request judgment data; wherein the interface request judgment data includes tree structure key data and interface function data; If so, determine the target master table identifier according to the tree structure key data, the candidate bytecode files and the preset standard type in the target interface request data, determine the target master table from the candidate data table according to the target master table identifier, and determine whether the target master table has a target slave table; If it does not exist, determine the target associated field identifier according to the target master table identifier and other candidate data tables, and determine the corresponding target slave table from the other candidate data tables according to the target associated field identifier; Generate a candidate table-level knowledge graph including the target master table identifier, the target associated field identifier, and the target slave table identifier; Wherein, the current master data node in the current master organization tree and the current slave update data in the current slave data table are processed respectively according to the current function data in the business request data to obtain the corresponding updated current master organization tree and current slave data table, including: Determine and process the current master data node in the current master organization tree according to the current functional data, and update the reference master data node associated with the current master data node to obtain an updated current master organization tree; Determine a current associated field according to the current master data node and the reference master data node, and determine the current slave update data in the current slave data table according to the current associated field; The current slave update data is processed according to the current function data to obtain an updated current slave data table.
2. The method according to claim 1, characterized in that: The step of determining the target main table identifier according to the tree structure key data, the candidate bytecode files and the preset standard type includes: Determine a matching reference bytecode file from the candidate bytecode file, and determine a reference type of a reference class to which the tree structure key data in the reference bytecode file belongs; According to the preset standard type, determine whether the reference type is a target type, and if so, determine the corresponding target master table identifier according to the target type.
3. The method according to claim 1, characterized in that The step of determining the target associated field identifier according to the target master table identifier and other candidate data tables includes: Segmenting the target main table identifier of the target main table to obtain a main table sub-identifier, and obtaining a candidate associated field identifier based on preset identifier data and the main table sub-identifier; A target association field identifier is determined according to the candidate association field identifier and other candidate data tables.
4. The method according to claim 1, characterized in that: The method further comprises: Determine the application type of the target application system corresponding to the target interface request data; If the application type is a cluster application, the target main table identifier and the target associated field identifier are added as request additional values to the request return value corresponding to the target interface request; The service gateway detects whether the request additional value exists. If so, the request additional value is sent to other application systems associated with the target application system, so that the other application systems generate corresponding candidate table-level knowledge graphs according to the request additional value.
5. The method according to claim 1, characterized in that The determining the current master table identifier and the current slave table identifier based on the business request data and the preset candidate table-level knowledge graph includes: Determine a current interface identifier corresponding to the business request data, and determine a current table-level knowledge graph from the candidate table-level knowledge graphs according to the current interface identifier; According to the current table-level knowledge graph, a current master table identifier and a current slave table identifier are determined.
6. A data processing device based on an organization tree, characterized in that: include: A current table identification determination module is used to obtain business request data, and determine the current main table identification and the current sub-table identification based on the business request data and a preset candidate table-level knowledge graph; wherein the candidate table-level knowledge graph is determined according to the candidate interface request data, the candidate bytecode file and the candidate data table; A main organization tree determination module, used to determine the current main organization tree corresponding to the current main table identifier, and determine the current slave data table corresponding to the current slave table identifier; A data processing module, used to process the current master data node in the current master organization tree and the current slave update data in the current slave data table according to the current function data in the business request data, to obtain the corresponding updated current master organization tree and current slave data table; wherein the current function data includes at least one of current merged data and current transferred data; The candidate table-level knowledge graph is determined based on the following means: A target request data determination module is used to obtain candidate interface request data and determine whether the candidate interface request data is target interface request data based on preset interface request judgment data; wherein the interface request judgment data includes tree structure key data and interface function data; a target slave table judgment module, for determining a target master table identifier according to the tree structure key data, the candidate bytecode files and the preset standard type in the target interface request data, and determining the target master table from the candidate data table according to the target master table identifier, and determining whether the target slave table exists in the target master table; A target slave table determination module, for determining a target associated field identifier according to the target master table identifier and other candidate data tables if the target slave table does not exist, and determining a corresponding target slave table from the other candidate data tables according to the target associated field identifier; A candidate table-level knowledge graph construction module, used to generate a candidate table-level knowledge graph including the target master table identifier, the target associated field identifier and the target slave table identifier; Wherein, the data processing module includes: A main organization tree updating unit, configured to determine and process a current main data node in the current main organization tree according to the current functional data, and to update a reference main data node associated with the current main data node to obtain an updated current main organization tree; a slave update data determining unit, configured to determine a current associated field according to the current master data node and the reference master data node, and determine the current slave update data in the current slave data table according to the current associated field; The current slave data table updating unit is used to process the current slave update data according to the current functional data to obtain an updated current slave data table.
7. An electronic device, characterized in that: include: one or more processors; A memory for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement a data processing method based on an organization tree as described in any one of claims 1 to 5.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, an organization tree-based data processing method as described in any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Data processing method and device
CN115374105A
Data processing method and device, equipment and storage medium
CN117667976A