A service data query method, device, equipment and medium
By combining a tree structure and metadata field table in multi-organization management software, the cumbersome operation and high development workload of generating multi-organization business data reports are solved, enabling all business data to be queried and displayed intuitively with a single development.
Patent Information
- Application Number
- CN202211016292.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-24
- Publication Date
- 2025-12-23
- Estimated Expiration
- 2042-08-24
AI Technical Summary
In multi-organization management software, generating multi-organization business data reports is cumbersome and requires a large amount of development work, especially due to the complexity of development caused by the large number of business data types and organizations.
By combining a tree structure with a metadata field table, a query scheme for specified business data is determined. The model identifier and field name identifier in the metadata model table are used to query the business data table and traverse the dataset to achieve data aggregation and display.
It enables users to query all business data by organizational structure in a single development process, reducing development workload and providing more intuitive output results, thus simplifying user operations.
Smart Images

Figure CN115374118B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present specification relates to the technical field of computer technology, and in particular, to a business data query method, device, equipment and medium. BACKGROUND
[0002] In a management software supporting multiple organizations, there is a subordinate relationship between each organization (referred to as organization). Each organization has its own business dealings. When viewing the business data of each subordinate organization and the data aggregated by the subordinate organization to the superior organization, code needs to be written for a certain business scenario to obtain a report (such as a multi-organization subject balance table, a multi-organization accounting dimension balance table).
[0003] When a multi-organization report of multiple business data is needed, the traditional scheme has the problems of complicated operation and large development workload, which are mainly caused by the two aspects of multiple business data and multiple organizations. SUMMARY
[0004] One or more embodiments of the present specification provide a business data query method, device, equipment and medium to solve the technical problems proposed in the background.
[0005] One or more embodiments of the present specification adopt the following technical solutions:
[0006] A business data query method provided by one or more embodiments of the present specification includes:
[0007] Determine the query scheme of the specified business data, the query scheme including a tree structure corresponding to the specified data and a metadata field table, the metadata field table including a pre-defined model identifier in a metadata model table, and a field name identifier corresponding to the specified business data;
[0008] According to the model identifier, determine the business data table corresponding to the specified business data;
[0009] According to the field identifier, query the business data table to obtain the corresponding data set;
[0010] According to the tree structure, traverse the data set to obtain the query result of the specified business data.
[0011] A business data query device provided by one or more embodiments of the present specification includes:
[0012] The scheme determination unit determines the query scheme of the specified business data, the query scheme including a tree structure corresponding to the specified data and a metadata field table, the metadata field table including a pre-defined model identifier in a metadata model table, and a field name identifier corresponding to the specified business data;
[0013] a data table determination unit configured to determine, according to the model identifier, a business data table corresponding to the specified business data;
[0014] a query unit configured to query the business data table according to the field identifier to obtain a corresponding data set;
[0015] a result unit configured to traverse the data set according to the tree structure to obtain a query result of the specified business data.
[0016] One or more embodiments of the present specification provide a business data query device, comprising:
[0017] at least one processor; and
[0018] a memory in communication connection with the at least one processor; wherein
[0019] the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to:
[0020] determine a query scheme of specified business data, the query scheme comprising a tree structure corresponding to the specified data and a metadata field table, the metadata field table comprising a pre-defined model identifier in a metadata model table and a field name identifier corresponding to the specified business data;
[0021] determine, according to the model identifier, a business data table corresponding to the specified business data;
[0022] query the business data table according to the field identifier to obtain a corresponding data set;
[0023] traverse the data set according to the tree structure to obtain a query result of the specified business data.
[0024] One or more embodiments of the present specification provide a non-volatile computer storage medium, which stores computer executable instructions, and the computer executable instructions are configured to:
[0025] determine a query scheme of specified business data, the query scheme comprising a tree structure corresponding to the specified data and a metadata field table, the metadata field table comprising a pre-defined model identifier in a metadata model table and a field name identifier corresponding to the specified business data;
[0026] determine, according to the model identifier, a business data table corresponding to the specified business data;
[0027] query the business data table according to the field identifier to obtain a corresponding data set;
[0028] According to the tree structure, the data set is traversed to obtain a query result of the specified business data.
[0029] The above at least one technical solution adopted by the embodiments of the present specification can achieve the following beneficial effects:
[0030] The embodiments of the present specification give an implementation mode of a multi-organization data summary tool by combining two metadata tables and a tree structure diagram, which can achieve the purpose of querying all business data summaries according to the organizational structure by one development. Compared with the traditional technology, the development workload is reduced, and the output result is more intuitive. BRIEF DESCRIPTION OF DRAWINGS
[0031] In order to more clearly illustrate the technical solutions in the embodiments of the present specification or the prior art, the drawings needed to be used in the embodiments or the prior art description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments described in the present specification, and other drawings can be obtained by those skilled in the art without creative labor. In the drawings:
[0032] Figure 1 A flowchart of a business data query method provided for one or more embodiments of the present specification;
[0033] Figure 2 A flowchart of querying X, Y, Z business data of A, B, C organizations provided for one or more embodiments of the present specification;
[0034] Figure 3 A schematic diagram of a subject balance table provided for one or more embodiments of the present specification;
[0035] Figure 4 A schematic diagram of a result page of a subject balance table provided for one or more embodiments of the present specification;
[0036] Figure 5 A schematic diagram of a business data table provided for one or more embodiments of the present specification;
[0037] Figure 6 A schematic diagram of a metadata model table provided for one or more embodiments of the present specification;
[0038] Figure 7 A schematic diagram of a metadata field table provided for one or more embodiments of the present specification;
[0039] Figure 8 A schematic diagram of a tree structure provided for one or more embodiments of the present specification;
[0040] Figure 9A schematic diagram of a main query scheme provided for one or more embodiments of the present specification;
[0041] Figure 10 A schematic diagram of an optional query scheme provided for one or more embodiments of the present specification;
[0042] Figure 11 A structural schematic diagram of a business data query device provided for one or more embodiments of the present specification;
[0043] Figure 12 A structural schematic diagram of a business data query device provided for one or more embodiments of the present specification. DETAILED DESCRIPTION
[0044] The embodiments of the present specification provide a business data query method, device, equipment and medium.
[0045] In order for those skilled in the art to better understand the technical solutions in the present specification, the technical solutions in the embodiments of the present specification will be described clearly and completely below in conjunction with the drawings in the embodiments of the present specification. Obviously, the described embodiments are only part of the embodiments of the present specification, not all. Based on the embodiments of the present specification, all other embodiments obtained by those skilled in the art without creative labor should be within the scope of protection of the present specification.
[0046] Figure 1 A flowchart of a business data query method provided for one or more embodiments of the present specification, which can be executed by a business data query system. Some input parameters or intermediate results in the flow allow manual intervention to adjust to help improve accuracy.
[0047] The method flow steps of the embodiments of the present specification are as follows:
[0048] S102, determine a query scheme of specified business data, the query scheme includes a tree structure corresponding to the specified data and a metadata field table, the metadata field table includes a pre-defined model identifier in a metadata model table, and a field name identifier corresponding to the specified business data.
[0049] In the embodiments of the present specification, the specified business data can be different business data such as sales and warehouse remaining space. The tree structure can be composed of m n-ary trees, and a node on each tree represents an organization, and the height of the node represents the level of the organization. The m n-ary trees represent m top-level organizations of the same level, and each level under each top-level organization has indefinite subordinate organizations, and the organization range w is determined.
[0050] In the embodiments of the present disclosure, the metadata field table is used to store the field name identifier and the model identifier of the business data table.
[0051] In the embodiments of the present disclosure, the metadata model table is used to store the model identifier of the business data table, so as to locate the business data table according to the model identifier.
[0052] S104, determining the business data table corresponding to the specified business data according to the model identifier.
[0053] S106, querying the business data table according to the field identifier to obtain a corresponding data set.
[0054] S108, traversing the data set according to the tree structure to obtain the query result of the specified business data.
[0055] In the embodiments of the present disclosure, the query result of the specified business data can be obtained by aggregating data from the leaf node to the upper level according to the pre-defined organization structure of the tree structure, and the query result can be output to the display interface according to the tree structure.
[0056] Further, before determining the query scheme of the specified business data, the present disclosure can create the business data table, which is used to store the specified business data and store the organization identifier.
[0057] Further, before determining the query scheme of the specified business data, the present disclosure can create the metadata model table, which is used to store the model identifier of the business data table, so as to locate the business data table according to the model identifier.
[0058] Further, before determining the query scheme of the specified business data, the present disclosure can create the metadata field table, which is used to store the field name identifier and the model identifier of the business data table.
[0059] Further, before determining the query scheme of the specified business data, the present disclosure can create the tree structure, which includes a specified number of hierarchical structures, and each hierarchical structure includes a specified data node, and the specified data node represents a corresponding organization.
[0060] Further, before determining the query scheme of the specified business data, the present disclosure can create an additional query scheme, which is a pre-set filtering condition. When traversing the data set according to the tree structure to obtain the query result of the specified business data, the filtering condition and the tree structure can be used to traverse the data set to obtain the query result of the specified business data.
[0061] Referring to Figure 2 The flowchart shown in query A, B, C organizes the X, Y, Z business data, and in the process, there is a large amount of code development work, and the developer needs to develop multiple times (develop a report application for each type of business) to achieve the goal, and the organizational hierarchical relationship cannot be well reflected.
[0062] The embodiment of the present specification proposes an implementation scheme of a multi-organizational data aggregation tool with universality and flexibility, which can arbitrarily change the organizational structure, support multiple business data types, and the report content can reflect the organizational structure.
[0063] Taking GSCloud as an example, the embodiment of the present specification can select an account set to query business data, but the obtained query result cannot reflect the organizational structure, and is also coded for a certain business scenario, referring to Figure 3 The diagram of the subject balance table shown in Figure 4 The diagram of the result page of the subject balance table shown in.
[0064] It should be noted that the embodiment of the present specification can be applied to ERP software. When multiple organizational reports of multiple business data need to be obtained in ERP software, the traditional scheme has the problems of complicated operation and large development workload, which are mainly caused by the two aspects of multiple business data types and multiple organizations. The embodiment of the present specification can store business table information and business table attribute information through a metadata module, freely configure multiple organizational structures and business table attribute information, and store reusable multiple organizational structure schemes and filtering information schemes, and convert repeated code development into configuration schemes. The multiple organizational structure scheme can be the above-mentioned query scheme, and the filtering information scheme can be the above-mentioned additional query scheme.
[0065] The embodiment of the present specification can simplify the user operation steps and reduce the repeated coding of the developer when implementing the query of multiple organizations and multiple business data.
[0066] The embodiment of the present specification can include the following 7 parts:
[0067] (1) Create a business data table B.
[0068] (2) Create a metadata model table M.
[0069] (3) Create a metadata field table F.
[0070] (4) Create a tree structure diagram S.
[0071] (5) Create a main query scheme MP.
[0072] (6) Create a selectable query scheme SP.
[0073] (7) Query the business data table and show the data.
[0074] For the above 7 contents, the embodiments of the present specification are implemented through the following specific contents:
[0075] (1) For the business data table, the business data table stores various business data, and there is an organization unique identifier field on the table, which can be recorded as organization id, which can be seen in detail from Figure 5 The schematic diagram of the business data table is shown.
[0076] (2) For the metadata model table, the metadata model table is used to store the unique identifier of the business data table, which can be used to locate the business data table according to the identifier, which can be recorded as model id, which can be seen in detail from Figure 6 The schematic diagram of the metadata model table is shown.
[0077] (3) For the metadata field table, the metadata field table is used to store which field names the business data table contains and the model id (which can be used to locate any field in the business data table according to this table) in the metadata model table corresponding to the business data table, which can be seen in detail from Figure 7 The schematic diagram of the metadata field table is shown.
[0078] (4) For the tree structure diagram, the tree structure diagram can be composed of m n-ary trees, a node on each tree represents an organization, the height of the node represents the level of the organization, and m n-ary trees represent m top-level organizations of the same level, each top-level organization has indefinite subordinate organizations at each level, and the organization range w is determined, which can be seen in detail from Figure 8 The schematic diagram of the tree structure is shown.
[0079] (5) For the query scheme, the query scheme MP records the required tree structure diagram s, the field information f (including model id and field name a, a can be multiple) in the required metadata field table F, and the corresponding business data table b can be found from M according to the model id of f, which can be seen in detail from Figure 9 The schematic diagram of the main query scheme is shown.
[0080] (6) For the optional query scheme, the optional query scheme SP records the filtering conditions q for the fields a on the business data table b in addition to the organization range w, which can be seen in detail from Figure 10 The schematic diagram of the optional query scheme is shown.
[0081] (7) For querying the business data table and displaying the data, according to a and b obtained in the main query scheme MP, other filtering conditions q obtained in the optional query scheme SP, the column a in the table b is queried to obtain a data set r, the data set r is traversed, and data is summarized from a leaf node (the last level node of the tree) to an upper node according to the organization structure defined by the tree structure diagram s, the data of each node is the sum of the data of the node and all lower level nodes of the node, and finally the data is output to a graphic interface according to the structure of the tree structure diagram s.
[0082] It should be noted that the embodiments of the present specification give an implementation mode of a multi-organization data summarizing tool in an ERP software in combination with two metadata tables and a tree structure diagram, which can achieve the purpose of querying all business data summaries according to the organization structure once. Compared with the traditional technology, the development workload is reduced, and the output result is more intuitive.
[0083] The key step of the embodiments of the present specification is the combination of the tree structure diagram and the two metadata tables. As the organization structure is continuously expanded, the business data fields are increased, and this implementation mode encapsulates the business data table and the business data field again, describes the data by using the metadata, and then combines the tree structure diagram, so that the complex organization structure analysis and data processing can be simplified.
[0084] Meanwhile, in the current data query of the ERP system, the query report is often written for a single organization business scene, and the related requirements of multiple organizations are not very perfect, and there is a lack of a solution scheme for querying all business data reflecting the organization structure under the multi-organization situation.
[0085] Figure 11 A structural schematic diagram of a business data query device provided for one or more embodiments of the present specification, the device comprises: a scheme determination unit 1102, a data table determination unit 1104, a query unit 1106 and a result unit 1108.
[0086] The scheme determination unit 1102 determines a query scheme of specified business data, the query scheme comprises a tree structure corresponding to the specified data and a metadata field table, the metadata field table comprises a model identifier in a metadata model table and a field name identifier corresponding to the specified business data;
[0087] The data table determination unit 1104 determines a business data table corresponding to the specified business data according to the model identifier;
[0088] The query unit 1106 queries the business data table according to the field identifier to obtain a corresponding data set;
[0089] A result unit 1108 traverses the data set according to the tree structure to obtain a query result of the specified business data.
[0090] Figure 12 A structural diagram of a business data query device is provided for one or more embodiments of the present specification, comprising:
[0091] at least one processor; and
[0092] a memory in communication connection with the at least one processor; wherein
[0093] The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to:
[0094] determine a query scheme of specified business data, the query scheme comprising a tree structure corresponding to the specified data and a metadata field table, the metadata field table comprising a pre-defined model identifier in a metadata model table, and a field name identifier corresponding to the specified business data;
[0095] determine a business data table corresponding to the specified business data according to the model identifier;
[0096] query the business data table according to the field identifier to obtain a corresponding data set;
[0097] traverse the data set according to the tree structure to obtain a query result of the specified business data.
[0098] One or more embodiments of the present specification provide a non-volatile computer storage medium, which stores computer executable instructions, the computer executable instructions are set to:
[0099] determine a query scheme of specified business data, the query scheme comprising a tree structure corresponding to the specified data and a metadata field table, the metadata field table comprising a pre-defined model identifier in a metadata model table, and a field name identifier corresponding to the specified business data;
[0100] determine a business data table corresponding to the specified business data according to the model identifier;
[0101] query the business data table according to the field identifier to obtain a corresponding data set;
[0102] traverse the data set according to the tree structure to obtain a query result of the specified business data.
[0103] The various embodiments in this specification describe the application in progressive stages. Identical or similar parts from one embodiment to another embodiment can be mutually referred to. Each embodiment focuses on the difference from other embodiments. In particular, the device, apparatus, and non-transitory computer storage medium embodiments are described more simply because they are substantially similar to the method embodiments. The relevant parts can be referred to the method embodiment description.
[0104] The above describes specific embodiments of the present specification. Other embodiments are within the scope of the appended claims. In some cases, the acts or steps recited in the claims can be performed in a different order than the order in which they are recited and still achieve desirable results. In addition, the processes depicted in the figures do not necessarily require the particular order shown, or sequential order, to achieve the desired results. In certain implementations, multitasking and parallel processing can be advantageous or necessary.
[0105] The above only describes one or more embodiments of the present specification and is not intended to limit the present specification. One or more embodiments of the present specification can have various modifications and changes for those skilled in the art. Any modification, equivalent replacement, improvement, etc. within the spirit and principles of one or more embodiments of the present specification shall be included in the scope of the claims of the present specification.
Claims
1. A service data query method, characterized by, The method comprises: determining a query scheme of specified business data, the query scheme comprising a tree structure corresponding to the specified data and a metadata field table, the metadata field table comprising a pre-defined model identifier in a metadata model table and a field name identifier corresponding to the specified business data; determining a business data table corresponding to the specified business data according to the model identifier; querying the business data table according to the field name identifier to obtain a corresponding data set; traversing the data set according to the tree structure to obtain a query result of the specified business data; before the determination of the query scheme of the specified business data, the method further comprises: creating the business data table, the business data table being used to store the specified business data and store an organization identifier; before the determination of the query scheme of the specified business data, the method further comprises: creating the metadata model table, the metadata model table being used to store a model identifier of the business data table so as to locate the business data table according to the model identifier; before the determination of the query scheme of the specified business data, the method further comprises: creating the metadata field table, the metadata field table being used to store a field name identifier included in the business data table and the model identifier; the traversing of the data set according to the tree structure to obtain the query result of the specified business data specifically comprises: according to a pre-defined organization structure of the tree structure, aggregating data from a leaf node upwards to obtain the query result of the specified business data, and outputting the query result to a display interface according to the tree structure.
2. The method of claim 1, wherein, before the determination of the query scheme of the specified business data, the method further comprises: creating the tree structure, the tree structure comprising a specified number of hierarchical structures, and each hierarchical structure comprising a specified data node, the specified data node representing a corresponding organization.
3. The method of claim 1, wherein, before the determination of the query scheme of the specified business data, the method further comprises: creating an additional query scheme, the additional query scheme being a pre-set filtering condition; the traversing of the data set according to the tree structure to obtain the query result of the specified business data specifically comprises: traversing the data set according to the filtering condition and the tree structure to obtain the query result of the specified business data.
4. A service data query apparatus characterized by comprising: The device comprises: a scheme determination unit, which determines a query scheme of specified business data, the query scheme comprising a tree structure corresponding to the specified data and a metadata field table, the metadata field table comprising a pre-defined model identifier in a metadata model table and a field name identifier corresponding to the specified business data; a data table determination unit, which determines a business data table corresponding to the specified business data according to the model identifier; a querying unit, which queries the business data table according to the field name identifier to obtain a corresponding data set; a result unit, which traverses the data set according to the tree structure to obtain a query result of the specified business data; before the determination of the query scheme of the specified business data, the method further comprises: creating the business data table, the business data table being used to store the specified business data and store an organization identifier; Before the determining the query scheme of the specified business data, the method further comprises: creating the metadata model table, which is used to store the model identifier of the business data table, so as to locate the business data table according to the model identifier; Before the determining the query scheme of the specified business data, the method further comprises: creating the metadata field table, which is used to store the field name identifier included in the business data table and the model identifier; The method according to the tree structure traverses the data set to obtain the query result of the specified business data, and specifically comprises: According to the organizational structure predefined in the tree structure, data is summarized from the leaf node to the upper level, the query result of the specified business data is obtained, and the query result is output to the display interface according to the tree structure.
5. A service data query apparatus characterized by comprising: comprise: at least one processor; and a memory connected in communication with the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to: determine a query scheme of specified business data, the query scheme comprising a tree structure corresponding to the specified data and a metadata field table, the metadata field table comprising a model identifier predefined in a metadata model table and a field name identifier corresponding to the specified business data; determine a business data table corresponding to the specified business data according to the model identifier; query the business data table according to the field name identifier to obtain a corresponding data set; traverse the data set according to the tree structure to obtain the query result of the specified business data; Before the determining the query scheme of the specified business data, the method further comprises: creating the business data table, which is used to store the specified business data and store an organizational identifier; Before the determining the query scheme of the specified business data, the method further comprises: creating the metadata model table, which is used to store the model identifier of the business data table, so as to locate the business data table according to the model identifier; Before the determining the query scheme of the specified business data, the method further comprises: creating the metadata field table, which is used to store the field name identifier included in the business data table and the model identifier; The method according to the tree structure traverses the data set to obtain the query result of the specified business data, and specifically comprises: According to the organizational structure predefined in the tree structure, data is summarized from the leaf node to the upper level, the query result of the specified business data is obtained, and the query result is output to the display interface according to the tree structure.
6. A non-transitory computer storage medium, comprising, store computer executable instructions, the computer executable instructions are set to: determine a query scheme of specified business data, the query scheme comprising a tree structure corresponding to the specified data and a metadata field table, the metadata field table comprising a model identifier predefined in a metadata model table and a field name identifier corresponding to the specified business data; determine a business data table corresponding to the specified business data according to the model identifier; According to the field name, the business data table is queried to obtain a corresponding data set; According to the tree structure, the data set is traversed to obtain a query result of the specified business data; Before the query scheme of the specified business data is determined, the method further includes: The business data table is created, and the business data table is used to store the specified business data and store an organization identifier; Before the query scheme of the specified business data is determined, the method further includes: The metadata model table is created, and the metadata model table is used to store a model identifier of the business data table, so as to locate the business data table according to the model identifier; Before the query scheme of the specified business data is determined, the method further includes: The metadata field table is created, and the metadata field table is used to store a field name identifier included in the business data table and the model identifier; According to the tree structure, the data set is traversed to obtain a query result of the specified business data, and the query result is output to a display interface according to the tree structure.
Citation Information
Patent Citations
Service table query method and device, server and computer readable storage medium
CN110083605A
Sub-service section data processing system and method
CN111858593A
Data query method and device, electronic equipment and storage medium
CN112836093A