Data query method and device, electronic equipment and storage medium
By partitioning the relational tables and splitting data query commands, the problem of low query efficiency caused by differences in data storage structure in centralized query platforms is solved, enabling efficient parallel queries and personalized data queries.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA MOBILE COMM GRP SHAANXI CO LTD
- Filing Date
- 2022-11-30
- Publication Date
- 2026-05-15
AI Technical Summary
In centralized query platforms, differences in data collection rules and data attributes across different systems lead to significant variations in data storage structures, resulting in low query efficiency.
By partitioning the relational table, data query commands are split based on business type and data link. Leveraging the capabilities of the big data platform, data query and integration are unified, thereby improving query efficiency.
It enables personalized customization and efficient parallel querying of data queries, improving the performance and accuracy of system data queries.
Smart Images

Figure CN116910089B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of heterogeneous multi-source data querying in big data, specifically to a data querying method, apparatus, electronic device, and storage medium. Background Technology
[0002] With the establishment of a centralized query system platform, it is possible to query financial data across the entire business process within the province. However, due to historical reasons or limitations in data collection, much data is stored on different media. When performing correlation analysis on data from different media, it is necessary to migrate the data from different media to a unified database.
[0003] Even when data from some systems is migrated and integrated into a unified database within a centralized query system platform, significant differences in data collection rules and inherent data attributes between the original systems result in substantial variations in data storage structures. Despite some data migration, inconvenience in data utilization persists. Therefore, centralized query platforms suffer from low query efficiency when retrieving data of different types, time periods, and structures. Summary of the Invention
[0004] This application provides a data query method, apparatus, electronic device, and storage medium, which can solve the problem of low data query efficiency in the prior art.
[0005] In a first aspect, embodiments of this application provide a data query method, the method comprising:
[0006] Get data query request;
[0007] Generate a data query command based on the data query request;
[0008] Based on the key fields in the data query command, obtain the target relationship table and target business type corresponding to the key fields;
[0009] Based on the target relationship table and the target business type, determine the target partition information of the target relationship table;
[0010] Based on the target partition information and the data link corresponding to the data query request, the data query command is split to obtain data query sub-commands;
[0011] The data obtained from the data query subcommand is integrated to obtain the target query data.
[0012] In one possible implementation, the data query method further includes, before obtaining the data query request:
[0013] Identify the business types to which multiple relation tables belong;
[0014] Relationship tables belonging to the same business type are classified into the same partition to obtain the partition information of the relationship tables.
[0015] In one possible implementation, the data query method includes:
[0016] Based on the target partition information and the data links corresponding to the data query requests, the first directed graph of the target partition is determined;
[0017] The data fusion points in the first directed graph are determined based on the business relevance of the data link relationship table;
[0018] The data query command is split based on the data fusion point to obtain the data query sub-command.
[0019] In one possible implementation, after obtaining the partition information of the relation table and before obtaining the data query request, the data query method further includes:
[0020] Based on the order of relation tables in the data link, determine the hierarchical level of the partition corresponding to the business type to which the relation table belongs;
[0021] The relation table is partitioned based on its partitioning information to obtain a directed graph.
[0022] In one possible implementation, the data query method includes:
[0023] Modify the first data link segment in the first directed graph that does not conform to the partitioning hierarchy rules;
[0024] Sub-data link segments are added according to the partitioning hierarchy rules to obtain the second data link segment of the second directed graph;
[0025] The business relevance between relational tables is determined based on the overlap of key fields in adjacent relational tables in the second data link segment.
[0026] Relationship tables with business relevance less than a preset threshold are identified as data fusion points in the first directed graph.
[0027] In one possible implementation, the data query method includes:
[0028] Based on the data fusion point, the first data link segment in the first directed graph is split to obtain multiple relation table combinations;
[0029] Based on the data fusion points, the data query command is broken down into a corresponding number of data query sub-commands that combine relational tables.
[0030] Secondly, embodiments of this application provide a data query device, which includes a first acquisition module for acquiring data query requests;
[0031] The generation module is used to generate data query commands based on data query requests;
[0032] The second acquisition module is used to obtain the target relationship table and target business type corresponding to the key fields in the data query command;
[0033] The determination module is used to determine the target partition information of the target relationship table based on the target relationship table and the target business type;
[0034] The splitting module is used to split the data query command based on the target partition information and the data link corresponding to the data query request, and obtain the data query sub-command;
[0035] The integration module is used to integrate the data obtained from the data query subcommands to obtain the target query data.
[0036] Thirdly, embodiments of this application provide an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that the processor executes the computer program to implement the above-described data query method.
[0037] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program, characterized in that the computer program, when executed by a processor, implements the various processes of the above-described data query method embodiments.
[0038] Fifthly, embodiments of this application provide a computer program product in which instructions are executed by the processor of an electronic device, causing the electronic device to perform various processes of the above-described data query method.
[0039] This application provides a data query method, apparatus, electronic device, and storage medium. The method involves: acquiring a data query request; generating a data query command based on the data query request; obtaining a target relationship table and target business type corresponding to the key fields in the data query command; determining target partition information of the target relationship table based on the target relationship table and target business type; splitting the data query command into sub-commands based on the target partition information and the data link corresponding to the data query request; and integrating the data obtained from the sub-commands to obtain the target query data. By partitioning the relationship table according to business type and then splitting the data query command based on the business scenario, the split sub-commands can perform parallel data queries, improving the efficiency of data querying. Attached Figure Description
[0040] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application are briefly introduced below. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0041] Figure 1 A flowchart illustrating a data query method provided in this application embodiment;
[0042] Figure 2 This is a structural diagram of a first directed graph for a data query method provided in an embodiment of this application;
[0043] Figure 3 This is a structural diagram of a second directed graph for a data query method provided in an embodiment of this application;
[0044] Figure 4 A data migration structure diagram for a data query method provided in this application embodiment;
[0045] Figure 5 A database structure diagram for a data query method provided in this application embodiment;
[0046] Figure 6 This application provides a structural diagram of data flow in a database for a data query method according to an embodiment of the present application.
[0047] Figure 7 A structural block diagram of a data query method provided in an embodiment of this application;
[0048] Figure 8 This is a structural diagram of a data query electronic device provided in an embodiment of this application. Detailed Implementation
[0049] The features and exemplary embodiments of various aspects of this application will be described in detail below. To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain this application and not to limit it. For those skilled in the art, this application can be implemented without some of these specific details. The following description of the embodiments is merely to provide a better understanding of this application by illustrating examples.
[0050] In this document, relational terms such as "first," "second," etc., are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus that includes said element.
[0051] For ease of understanding, the following describes some aspects of the embodiments of this application:
[0052] ERP (Enterprise Resource Planning) systems are management platforms built on information technology, integrating information technology with advanced management concepts. They provide decision-making tools for employees and management through a systematic management approach. Evolved from Material Requirements Planning (MRP), ERP is a new generation of integrated management information systems that expands the functionality of MRP. Its core concept is supply chain management. It transcends traditional enterprise boundaries, optimizing enterprise resources from a supply chain perspective, thus optimizing the operational model of modern enterprises and reflecting market demands for the rational allocation of resources. It plays a significant role in improving business processes and enhancing core competitiveness.
[0053] M domain: The data domain of the management support system (M domain) can include location information, such as crowd movement trajectories and map information.
[0054] The centralized local financial system refers to the original provincial ERP system, expense reimbursement system, bank-enterprise interconnection system, and electronic voucher system. With the phasing out of the centralized local financial system, the data stored in it will be permanently retained and used as historical data for user queries. The established centralized query platform will migrate and integrate data from some systems, such as the original provincial expense reimbursement system, bank-enterprise interconnection system, electronic voucher system, funds system, and contract system, into a unified database, enabling users to query data from each system and enhancing data query performance.
[0055] The applicant's research has revealed the following technical problems with the current data query method: Even when data from some systems, such as the original provincial reimbursement system, bank-enterprise interconnection system, electronic voucher system, fund system, and contract system, are migrated and integrated into a unified database within a centralized query platform, the data storage structure will vary significantly due to differences in the data collection rules and inherent attributes of the original systems. Therefore, when performing correlation queries on data of different types, periods, and structures on the centralized query platform, the query efficiency is low.
[0056] In view of the above research findings, this application provides a data query method to solve the aforementioned technical problems existing in the prior art.
[0057] The technical concept of this application embodiment is as follows:
[0058] The centralized data query platform is based on the group's comprehensive query platform architecture. It migrates and integrates data from the original provincial reimbursement system, bank-enterprise interconnection system, and electronic voucher system into a unified database, and creates new query applications while retaining the local ERP system and migrating it to the resource pool. By leveraging the capabilities of a big data platform, the centralized data query platform builds a data query SaaS application, which can adopt a "data query SaaS" service model.
[0059] The centralized data query platform breaks down the data barriers between multiple systems, enabling the display of data relationships across all business scenarios and increasing data connectivity. This allows it to meet the needs of application scenarios such as relationship queries based on historical data, data analysis, and internal and external auditing. It has strong promotion capabilities, and its model is replicable and its applications are transferable.
[0060] In a centralized data query platform, by determining the business type and partition information of a relational table, and splitting the data query command according to the partition information and the data link corresponding to the data query request, sub-commands are obtained. The data obtained from these sub-commands is then integrated to obtain the query data. The data query method provided in this application achieves integrated data query and integration without manual intervention, improving data query efficiency and enhancing system performance.
[0061] This embodiment provides a data query method, such as Figure 1 As shown, the steps are as follows:
[0062] S101: Get data query request.
[0063] When building a centralized data query platform, it standardizes initial source data from different business types based on various data models. This standardization process yields source data from multiple systems, enabling large-scale data correlation queries. The platform can then provide users with multiple different business scenarios based on the standardized source data. Users can select a scenario in the platform interface to generate a data query request corresponding to that business scenario.
[0064] Different business scenarios may correspond to multiple different source data. For example, the source data for one business scenario may include general business document queries, general statistical report queries, image file queries, and audit-specific reports, and each business scenario has a customized data link. This data link refers to the order in which the data from different source data are integrated.
[0065] The initial source data consists of data stored in the original expense reporting system, the original bank-enterprise interconnection system, the original electronic voucher system, the original funds system, and the original contract system. Due to differences in data format and data type, the data stored in each system cannot be directly correlated and queried. The standardization process of the initial source data is to ensure the consistency of data format and data type among the data stored in each system. The data after standardization is called source data. The data obtained after standardization of multiple data stored in different systems is called multi-source data.
[0066] Data query requests can include keywords, field ranges, and a second accessible data range.
[0067] Users of the centralized data query platform can customize their data query content through a personalized user page provided by the platform. The platform uses an Application Program Interface (API) service gateway to authenticate and verify the identities and permissions of each user, ensuring the data stored within the platform is not leaked. Based on the user's selected business scenario, the platform can obtain the user's data-related query requests and the initial accessible data range. The initial accessible data range is the maximum data range a user can access within the centralized data query platform, and the second accessible data range is the range of data that the user restricts from the initial accessible data range.
[0068] In one example, a user can log in to the centralized data query platform on a front-end electronic device. After confirming the user's identity and permission information, the user can select the desired business scenario A from the business scenarios provided on the centralized data query platform's page. The centralized data query platform will then generate a corresponding data query request for business scenario A based on the user's selection.
[0069] In another example, the centralized data query platform can also select the corresponding application scenario by default based on the application scenarios selected by the user in the previous few times, and generate a data query request corresponding to that application scenario.
[0070] Therefore, the application scenarios can be selected by the user or automatically selected by the centralized data query platform based on the user's historical data.
[0071] Since the embodiments of this application can determine the data query request based on the business scenario selected by the customer, the data content to be queried can be customized for the user, thus meeting the user's personalized needs.
[0072] S102: Generate a data query command based on the data query request.
[0073] The centralized data query platform generates multi-source data association query commands based on the keywords, field ranges, and second accessible data ranges in the acquired data association query requests. The generated association query commands can be common data query commands such as SQL, MySQL, and Oracle.
[0074] Transforming data query requests into data query commands is equivalent to translating user needs into computer language that the platform system can understand.
[0075] Based on the data query request generated by the user's selected business scenario, the centralized data query platform responds to the data query request by generating a data query command, which can query all the data that the user needs within the selected business scenario, thereby improving the data query performance of the centralized data query platform.
[0076] S103: Based on the key fields in the data query command, obtain the target relationship table and target business type corresponding to the key fields.
[0077] In one example, the `prediction_table` table is stored in a Structured Query Language (MySQL) database system, representing sales account balance information; the `all_in_one` table is stored in the data warehouse tool Hive, representing cash flow information. 'select', 'from', 'where', 'and', 'join', and 'between' are all key fields, each with different query semantics. By retrieving the corresponding relational tables from historical query data, the relevant processes corresponding to the relational tables are determined. The frequency of each field in each relational table is compared, and fields with a frequency exceeding a preset threshold are extracted as key fields.
[0078] The specific data query object can be determined by using 'from', which is the relational table information mentioned in this solution. At the same time, the business type information of all relational tables will be defined when the centralized data query platform is built.
[0079] In one example, the relational tables retrieved based on the `from` key field include account balance information, asset details information, expense report information, cash flow information, expense reimbursement payment information, and purchase order information. Then, based on the basic information of these relational tables, the business type information corresponding to each table can be determined. Here, business type information mainly refers to the business system to which it belongs. It can be determined that the business type of account balance information, asset details information, and purchase order information is Enterprise Resource Planning (ERP) system; the business type of expense report information and expense reimbursement payment information is expense reimbursement system; and the business type of cash flow information is cash management system.
[0080] The target relation table 5, obtained from the key fields in the relational query command, is classified according to the target business type to facilitate the execution of step 4 and determine the partition information of the target relation table.
[0081] S104: Based on the target relationship table and the target business type, determine the target partition information of the target relationship table.
[0082] The target partition information may include the partition corresponding to the business type, the data link of the target relationship table, the relationship between the target relationship table and each partition, and the hierarchical level of each partition.
[0083] Because the initial source data in the relationship tables for different business types uses different data storage structures, even after standardization in the centralized data query platform, the original data storage...
[0084] Due to limitations in storage structure, the structure and performance of relational tables in various systems still differ after standardization.
[0085] In one example, the business types include account balance information, asset details information, and purchase order information.
[0086] The ERP system is divided into partition 1; the business type of expense report information and expense report payment information is the expense report 5 system, which is divided into partition 2; the business type of fund flow information is the fund system, which is divided into partition 3.
[0087] Unlike existing technologies that split query commands by relational tables, this application takes into account the interconnected relationships of multi-source data in business scenarios and uses relational tables with low correlation as the splitting points for commands. This can reduce the number of split data query subcommands and improve the efficiency and accuracy of data queries.
[0088] 0S105: Based on the target partition information and the data link corresponding to the data query request, perform data query command...
[0089] The command is split to obtain a data query subcommand.
[0090] Each business scenario corresponds to a set of relational table information and a data link. This data link is the data integration rule set during the construction of the centralized data query platform to integrate the data of each relational table, and corresponds to the business scenario relationship. This application can further confirm the split point of the related query command by using the target partition information and the data link corresponding to the data query request.
[0091] For a data link, it is classified according to the business type corresponding to the relational tables within the data link. In one example, a data link can be: Account Balance Information ① → Asset Details Information ② → Expense Reporting Information ③ → Fund Flow Information ④ → Expense Reporting and Payment Information ⑤ → Purchase Order Information ⑥. Based on the target partition information corresponding to each relational table, it can be determined that Account Balance Information ①, Asset Details Information ②, and Purchase Order Information ⑥ belong to the same business type 1, Asset Details Information ② and Expense Reporting Information ③ belong to the same business type 2, and Fund Flow Information ④ belongs to business type 3.
[0092] Based on the identified data fusion points from the multi-source data, the data chain can be broken down into multiple relational table combinations: (Account Balance Information ① → Asset Details Information ②), (Reimbursement Document Information ③ → Fund Flow Information ④), and (Reimbursement Payment Information ⑤ → Purchase Order Information ⑥). If the data query value of Purchase Order Information ⑥ → Reimbursement Document Information ③ → Fund Flow Information ④ is determined to be the highest, the data chain can be broken down into multiple relational table combinations: (Account Balance Information ① → Asset Details Information ② → Reimbursement Document Information ③), (Fund Flow Information ④), and (Reimbursement Payment Information ⑤ → Purchase Order Information ⑥). Then, based on the obtained multiple relational table combinations, the associated query command is broken down into a corresponding number of query sub-commands, and each query command is executed separately.
[0093] The splitting here is based on the data fusion point to complete the splitting of the query conditions (query content) and relation tables in the related query command.
[0094] In an example of a relational query command, relational tables `prediction_table a` and `all_in_oneb` belong to different partitions, and `all_in_oneb` is a data fusion point for multi-source data. The final split query subcommands can include query command 1 and query command 2. By splitting the data query command according to the target partition information and the data link corresponding to the data query request, a smaller number of data query subcommands with less correlation can be obtained, thus improving the efficiency of data query.
[0095] S106: Integrate the data obtained from the data query subcommand to obtain the target query data.
[0096] The query subcommands are sent to the corresponding systems to retrieve the source data from each system. Data fusion is then completed based on the data fusion points, resulting in the data retrieved by the data query command. This achieves the integration of querying and data integration, improving the performance and efficiency of data querying on the centralized data query platform.
[0097] This application provides a data query method that involves: obtaining a data query request; generating a data query command based on the data query request; obtaining the target relational table and target business type corresponding to the key fields in the data query command; determining the target partition information of the target relational table based on the target relational table and target business type; splitting the data query command into sub-commands based on the target partition information and the data link corresponding to the data query request; and integrating the data obtained from the sub-commands to obtain the target query data. By partitioning the relational table according to business type and then splitting the data query command according to the business scenario, the split sub-commands can perform parallel data queries, improving the efficiency of data querying.
[0098] In some embodiments, the data query method may further include, before obtaining the data query request:
[0099] Identify the business types to which multiple relationship tables belong;
[0100] Relationship tables belonging to the same business type are classified into the same partition to obtain the partition information of the relationship tables.
[0101] A relational table can include a header index, which can be used to identify the business type corresponding to the relational table.
[0102] In one example, based on the header indexes within each relational table, the business type of account balance information, asset details information, and purchase order information can be determined as ERP system; the business type of expense report information and expense report payment information is expense report system; and the business type of cash flow information is cash system. Specifically, account balance information, asset details information, purchase order information, expense report information, expense report payment information, and cash flow information are all relational tables.
[0103] For each partition, corresponding settings are configured based on the business type: the ERP system can be partition 1, the expense reporting system can be partition 2, and the funds system can be partition 3.
[0104] Therefore, account balance information, asset details information, and purchase order information can be classified into partition 1, invoice information and reimbursement payment information into partition 2, and cash flow information into partition 3.
[0105] By pre-setting multiple partitions corresponding to multiple business types and identifying the header indexes within multiple relational tables, the business type corresponding to the relational table can be determined. Relational tables of the same business type can be classified into the corresponding business type partitions, and the partition information of the relational tables can be obtained, which facilitates the classification of relational tables of different business types.
[0106] In some embodiments, the data query method may include:
[0107] Based on the target partition information and the data links corresponding to the data query requests, the first directed graph of the target partition is determined;
[0108] The data fusion points in the first directed graph are determined based on the business relevance of the data link relationship table;
[0109] The data query command is split based on the data fusion point to obtain the data query sub-command.
[0110] When building a centralized data query platform, data links can be set up according to business scenarios. Data links can be used to integrate data from various relational tables. Each business scenario corresponds to a set of relational tables and a data link.
[0111] Based on the target partition information and the data link corresponding to the data query request, the target partition information is set according to the business type. The relationship table in the data link is partitioned according to the corresponding business type. The logical relationship between the data link and the target partition can be visualized and made concrete, making the logical relationship easy to understand.
[0112] By using relational tables with low business relevance in the data link as data fusion points in the first directed graph, the data fusion points in the first directed graph can be determined. Data query commands can be split using the data fusion points in the first directed graph to obtain data query subcommands. Data in the database can be queried according to the data query subcommands, which can perform parallel data queries and improve data query efficiency.
[0113] In one example, the data link corresponding to the data query request can be: account balance information → asset details information → expense report information → cash flow information → expense report payment information → purchase order information. Here, the business type of account balance information, asset details information, and purchase order information is ERP system, and it is divided into partition 1; the business type of expense report information and expense report payment information is expense report system, and it is divided into partition 2; the business type of cash flow information is cash system, and it is divided into partition 3. Based on the target partition information and the data link corresponding to the data query request, the first directed graph of the target partition (i.e., ...) can be determined. Figure 2 ).
[0114] To make the description clearer, we can use ① to represent the account balance information of the relationship table, ② to represent the asset details information of the relationship table, ③ to represent the invoice information of the relationship table, ④ to represent the cash flow information of the relationship table, ⑤ to represent the payment information of the relationship table, and ⑥ to represent the purchase order information of the relationship table. Therefore, the data link can be simplified to ①→②→③→④→⑤→⑥, as follows. Figure 2 As shown:
[0115] After partitioning, the determined data link segments are as follows: ①→② belongs to partition 1, and ②→③, ③→④, ④→⑤, and ⑤→⑥ are cross-partition link segments. Relationship tables with low business relevance can be used as data fusion points. In one example, relationship tables ②, ⑤, and ④ can be selected as the data fusion points of the first directed graph. The data query command is split into multiple data query sub-commands. Assuming that relationship table prediction_table a and relationship table all_in_one b belong to different partitions, and relationship table all_in_one b is a data fusion point for multi-source data, the final split query sub-commands can include query command 1 and query command 2.
[0116] The data obtained from the data query subcommand is integrated based on the data fusion point to obtain all the data queried by the data query command. The data query command is obtained from the data query request, which is determined by the business scenario selected by the user. Therefore, the data obtained by the data query command can meet the user's needs, thereby realizing personalized customization of data query.
[0117] In some embodiments, after obtaining the partition information of the relational table and before obtaining the data query request, the data query method may further include:
[0118] Based on the order of relation tables in the data link, determine the hierarchical level of the partition corresponding to the business type to which the relation table belongs;
[0119] The relation table is partitioned based on its partitioning information to obtain a directed graph.
[0120] In one example, the data link can be ①→②→③→④→⑤→⑥. Since the business types of ①, ②, and ⑥ correspond to partition 1, the business types of ③ and ⑤ correspond to partition 2, and the business type of ④ corresponds to partition 3, based on the order of the relation tables in the data link, we can determine that ① and ② come first, followed by ③ and ④, and finally ⑤ and ⑥. The business types corresponding to the relation tables in the data link can further determine the partitions corresponding to the relation tables: ①, ②, and ⑥ correspond to partition 1, ③ and ⑤ correspond to partition 2, and ④ corresponds to partition 3. The data link segment ①→②, which is merged first, belongs to partition 1. Therefore, we can set that partition 1 has the highest level, partition 2 has the next highest level, and partition 3 has the lowest level.
[0121] Partitioning the relational tables corresponding to the data link can produce a directed graph, which represents the relationship between the relational tables in the data link and the partition hierarchy. The directed graph can show the fusion order of the corresponding relational tables in each partition, further reflecting the logical relationship between the data link and the partition, making the logical relationship more concrete, and improving the user's perception experience.
[0122] In some embodiments, the data query method includes:
[0123] Modify the first data link segment in the first directed graph that does not conform to the partitioning hierarchy rules;
[0124] Sub-data link segments are added according to the partitioning hierarchy rules to obtain the second data link segment of the second directed graph;
[0125] The business relevance between relational tables is determined based on the overlap of key fields in adjacent relational tables in the second data link segment.
[0126] Relationship tables with business relevance less than a preset threshold are identified as data fusion points in the first directed graph.
[0127] Partition hierarchy rules can be used to cross data link segments, but the following two conditions must be met:
[0128] 1) Data link segments can traverse from higher-level partitions to lower-level partitions;
[0129] 2) While satisfying the requirement of traversing from higher-level partitions to lower-level partitions, the data link segment also traverses from higher-level partitions to lower-level partitions in a sequential manner, from higher to lower levels.
[0130] In the first directed graph, the data fusion process follows a hierarchical order based on the partition hierarchy. However, some data link segments traverse from lower to higher levels, making it impossible to fused in the correct order. Therefore, it's necessary to modify data links that don't conform to the partition hierarchy rules to ensure compliance. Additionally, sub-data link segments that satisfy the partition hierarchy rules are added, resulting in the second directed graph.
[0131] The preset threshold can be set by the user or by the centralized data query platform based on the business scenario. In this embodiment, the business relevance between adjacent relational tables can be determined based on the overlap of key fields in the data link. The overlap of key fields is directly proportional to the business relevance, and relational tables with a business relevance less than the preset threshold are used as data fusion points.
[0132] In one example, by Figure 2 It can be seen that, after partitioning, the data link segments determined are as follows: Account Balance Information ① → Asset Details Information ② belongs to Partition 1; Asset Details Information ② → Expense Receipt Information ③, Expense Receipt Information ③ → Fund Flow Information ④, Fund Flow Information ④ → Expense Payment Information ⑤, and Expense Payment Information ⑤ → Purchase Order Information ⑥ are cross-partition link segments. Since the data integration order of the data link segments Fund Flow Information ④ → Expense Payment Information ⑤ and Expense Payment Information ⑤ → Purchase Order Information ⑥ does not conform to the determined partition hierarchy rules, at this time, [the following is missing from the original text]. Figure 3 It is evident that the data link segments that do not conform to the partitioning hierarchy rules need to be modified first. The data link segments of Funds Flow Information ④ → Reimbursement Payment Information ⑤ and Reimbursement Payment Information ⑤ → Purchase Order Information ⑥ can be modified to Purchase Order Information ⑥ → Reimbursement Payment Information ⑤ and Reimbursement Payment Information ⑤ → Funds Flow Information ④. In addition, the existing data link segments can be expanded according to the partitioning hierarchy rules. The existing data link segments are: Account Balance Information ① → Asset Details Information ② → Expense Reporting Document Information ③ → Fund Flow Information ④ and Purchase Order Information ⑥ → Expense Reporting Payment Information ⑤ → Fund Flow Information ④. The expanded data link segments need to add several sub-data link segments, namely: Account Balance Information ① → Expense Reporting Document Information ③ → Fund Flow Information ④, Account Balance Information ① → Expense Reporting Payment Information ⑤ → Fund Flow Information ④, Asset Details Information ② → Expense Reporting Document Information ③ → Fund Flow Information ④, Asset Details Information ② → Expense Reporting Payment Information ⑤ → Fund Flow Information ④, Purchase Order Information ⑥ → Expense Reporting Document Information ③ → Fund Flow Information ④, Purchase Order Information ⑥ → Expense Reporting Payment Information ⑤ → Fund Flow Information ④.
[0133] If the business relevance value of the link segment from Asset Details Information ② to Expense Payment Information ⑤ to Fund Flow Information ④ is the lowest, meaning the data query cost is the highest, then the following relational tables can be selected as data fusion points: Asset Details Information ②, Expense Payment Information ⑤, and Fund Flow Information ④. Selecting the relational table with the highest data query cost as the data fusion point avoids querying relational tables with significantly different data structures simultaneously, which would affect query efficiency. Breaking down highly different data query commands into different data query sub-commands can greatly improve data query efficiency.
[0134] In some embodiments, the data query method includes:
[0135] Based on the data fusion points, the first data link segment in the first directed graph is split to obtain multiple relation table combinations;
[0136] Based on the data fusion point, the data query command is split into a corresponding number of data query sub-commands for the relationship table combination.
[0137] Based on the data fusion points obtained from the second directed graph, the first data link segment in the first directed graph is split to obtain multiple relation table combinations. The number of relation table combinations is obtained, and the data query command is split into the corresponding number of data query sub-commands for each relation table combination. Data queries are performed using each data query sub-command with significant differences, which can retrieve data with significant differences and improve the quality of the queried data.
[0138] In one example, if the data fusion points are determined to be asset details information ②, expense reimbursement information ⑤, and cash flow information ④, then the relationship table combination for splitting the first data link segment can be: account balance information ① → asset details information ②, expense reimbursement document information ③ → cash flow information ④, expense reimbursement information ⑤, and purchase order information ⑥.
[0139] In another example, if the purchase order information ⑥, the invoice information ③, and the cash flow information ④ are determined as the data fusion points, then the relationship table combination for splitting the first data link segment can be: account balance information ① → asset details information ② → invoice information ③, cash flow information ④, and invoice payment information ⑤ → purchase order information ⑥.
[0140] In another example, if the data fusion point is determined to be account balance information ①, invoice information ③, and cash flow information ④, then the relationship table combination for splitting the first data link segment can be account balance information ①, asset details information ② → invoice information ③, cash flow information ④, and invoice payment information ⑤ → purchase order information ⑥.
[0141] In this way, the first data link segment corresponding to a business scenario can be split according to the data fusion point. However, due to the different data fusion points, the resulting combination of relational tables will also be very different. The different combination of relational tables can further determine the diversity of data query sub-commands corresponding to the data query command, enabling the query of corresponding data according to the user's personalized needs and improving the performance of data query.
[0142] See Figure 4 This allows us to determine the database architecture of the centralized data query platform in this application. Based on the group's comprehensive query platform architecture, historical data from the original provincial reimbursement system, bank-enterprise interconnection system, and electronic voucher system will be migrated and integrated into a unified database. The local ERP system will be retained and migrated to a resource pool. A unified single sign-on and access control system will be integrated into the financial portal to support historical financial data queries. The centralized data query platform's database architecture breaks down the data barriers between multiple systems, enabling the display of data relationships across all business scenarios and increasing data connectivity. This supports application scenarios such as relationship queries based on historical data, data analysis, and internal and external audits. It has strong scalability, and its model is replicable and its applications are transferable.
[0143] Historical data can include expense reports, bank and corporate data, and vouchers. Historical data is stored in different databases (such as DB2 and Oracle databases), so there will be differences in data format and type. When applying the data, the data in the database needs to be standardized.
[0144] See Figure 5 The technical architecture of the centralized data query platform can be determined. It can be seen that the technical architecture can perform data query on public cloud, private cloud and Pan-Cloud data storage platforms. The source data is obtained from the data source. After the source data is standardized in the acquisition layer, it is stored in the data layer distributed file system (Hadoop Distributed System, HDFS) or in the storage space (bucket). Users can perform application processing on the data stored in the data layer through the application layer after authorization.
[0145] See Figure 6This allows us to define the project product architecture of the centralized data query platform. At the data source layer, data can be synchronized to the basic data layer and migrated to a cloud resource database. The basic data layer standardizes the data synchronized from the data source layer, converting it into a unified data layer storage format and type, and classifying the data into databases for various business types. The unified data layer, once authorized, can be provided to the application layer for querying. The application layer has general basic functions, authenticating user identity information and permissions, and authorizing permissions for each user. Users can view data within their authorized scope, improving the security of data applications.
[0146] In addition, see Figure 7 This application also provides a data query device 700, which includes a first acquisition module 701, a generation module 702, a second acquisition module 703, a determination module 704, a splitting module 705, and an integration module 706. These modules work together to complete the data query process, specifically:
[0147] The first acquisition module 701 is used to acquire data query requests.
[0148] The generation module 702 is used to generate data query commands based on data query requests.
[0149] The second acquisition module 703 is used to obtain the target relationship table and target business type corresponding to the key fields in the data query command.
[0150] The determination module 704 is used to determine the target partition information of the target relationship table based on the target relationship table and the target business type.
[0151] The splitting module 705 is used to split the data query command based on the target partition information and the data link corresponding to the data query request, and obtain the data query sub-command.
[0152] Integration module 706 is used to integrate the data obtained from the data query subcommand to obtain the target query data.
[0153] In some embodiments, the data query device 700 further includes an identification module and a classification module.
[0154] The identification module is used to identify the business type to which multiple relationship tables belong.
[0155] The classification module is used to classify relational tables belonging to the same business type into the same partition, thereby obtaining the partition information of the relational tables.
[0156] In some embodiments, the data query apparatus includes a determination module and a splitting module.
[0157] The determination module is also used to determine the first directed graph of the target partition based on the target partition information and the data link corresponding to the data query request.
[0158] The determination module is also used to determine the data fusion points in the first directed graph based on the business relevance of the data link relationship table.
[0159] The splitting module is also used to split data query commands based on data fusion points to obtain data query sub-commands.
[0160] In some embodiments, the data query device further includes a partitioning module.
[0161] The determination module also includes determining the hierarchical level of the partition corresponding to the business type of the relation table based on the order of the relation tables in the data link.
[0162] The partitioning module includes partitioning the relation table according to the partitioning information of the relation table to obtain a directed graph.
[0163] In some embodiments, the data query device further includes a modification module and an addition module.
[0164] The modification module is used to modify the first data link segment in the first directed graph that does not conform to the partitioning hierarchy rules.
[0165] An additional module is added to add sub-data link segments according to the partitioning hierarchy rules, thereby obtaining the second data link segment of the second directed graph.
[0166] The determination module is also used to determine the business relevance between relational tables based on the overlap of key fields in adjacent relational tables in the second data link segment.
[0167] The determination module is also used to identify relationship tables with a business relevance of less than a preset threshold as data fusion points in the first directed graph.
[0168] In some embodiments, the data query apparatus includes a splitting module for splitting a first data link segment in a first directed graph based on a data fusion point to obtain a combination of multiple relation tables.
[0169] The splitting module is used to split data query commands into a number of data query subcommands corresponding to the relationship table combinations based on the data fusion points.
[0170] The various modules of the data query device provided in this application embodiment can achieve Figure 1 The functions of each step in the provided data query method and the corresponding technical effects are described briefly and will not be elaborated here.
[0171] This application also provides an electronic device, such as... Figure 8As shown, the electronic device 800 may include: a processor 801, a memory 802, a communication interface 803, and a bus 810.
[0172] Specifically, the processor 801 may include a central processing unit (CPU), an application specific integrated circuit (ASIC), or one or more integrated circuits that can be configured according to the embodiments of the present application.
[0173] Memory 802 may include mass storage for data or instructions. For example, and not limitingly, memory 802 may include a hard disk drive (HDD), floppy disk drive, flash memory, optical disk, magneto-optical disk, magnetic tape, or Universal Serial Bus (USB) drive, or a combination of two or more of these. In one embodiment, memory 802 may include removable or non-removable (or fixed) media, or memory 802 may be non-volatile solid-state memory. Memory 802 may be internal or external to the integrated gateway housing device.
[0174] In one embodiment, memory 802 may be read-only memory (ROM). In one embodiment, the ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), an electrically rewritable ROM (EAROM), or flash memory, or a combination of two or more of these.
[0175] Storage 802 may include read-only memory (ROM), random access memory (RAM), disk storage media devices, optical storage media devices, flash memory devices, electrical, optical, or other physical / tangible memory storage devices. Therefore, typically, memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to one aspect of this disclosure.
[0176] The processor 801 reads and executes computer program instructions stored in the memory 802 to achieve... Figure 1 The method in the illustrated embodiment achieves... Figure 1 The embodiments shown achieve the corresponding technical effects by performing their methods / steps, which will not be elaborated here for the sake of brevity.
[0177] In one example, the electronic device 700 may also include a communication interface 803 and a bus 810. For example, Figure 3 As shown, the processor 801, memory 802, and communication interface 803 are connected through bus 810 and complete communication with each other.
[0178] The communication interface 803 is mainly used to realize communication between various modules, devices, units and equipment in the embodiments of the present invention.
[0179] Bus 810 includes hardware, software, or both, that couples together components of an electronic device that embeds files in a document. For example, and not limitingly, the bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Extended Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a Hyper Transport (HT) interconnect, an Industry Standard Architecture (ISA) bus, a Wireless Bandwidth Interconnect, a Low Pin Count (LPC) bus, a memory bus, a Microchannel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local (VLB) bus, or other suitable single buses or combinations of two or more of these. Where appropriate, bus 810 may include one or more buses. Although specific buses are described and illustrated in embodiments of this application, this application contemplates any suitable bus or interconnect.
[0180] The electronic device can execute the data query method in the embodiments of this application, thereby achieving a combination Figure 1 Describes the data query method.
[0181] Furthermore, in conjunction with the data query methods in the above embodiments, this application embodiment can provide a computer storage medium for implementation. The computer storage medium stores computer program instructions; these computer program instructions are executed by a processor using any of the data query methods described in the above embodiments.
[0182] This application also provides a computer program product in which the instructions, when executed by the processor of an electronic device, cause the electronic device to perform various processes that implement any of the above-described data query method embodiments.
[0183] This application, employing the above technical solutions, provides a data query method, apparatus, electronic device, computer-readable storage medium, and computer program product. In a centralized data query platform, by determining the business type corresponding to a relation table and its partitioning information, the data query command is split according to the partitioning information and the data link corresponding to the data query request to obtain data query sub-commands. The data obtained from the data query sub-commands is then integrated to obtain the query data. The data query method provided by this application achieves integrated data query and integration without manual intervention, improving data query efficiency and enhancing system data query performance.
[0184] It should be clarified that this application is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present invention is not limited to the specific steps described and shown. Those skilled in the art can make various changes, modifications, and additions, or change the order of steps, after understanding the spirit of the present invention.
[0185] The functional blocks shown in the above block diagram can be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, they can be, for example, electronic circuits, application-specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of this invention are programs or code segments used to perform the required tasks. Programs or code segments can be stored on a machine-readable medium or transmitted over a transmission medium or communication link via data signals carried on a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, read-only memory (ROM), flash memory, erasable read-only memory (EROM), floppy disks, compact disc read-only memory (CD-ROM), optical disks, hard disks, fiber optic media, radio frequency (RF) links, etc. Code segments can be downloaded via computer networks such as the Internet, intranets, etc.
[0186] It should also be noted that the exemplary embodiments mentioned in this invention describe methods or systems based on a series of steps or apparatus. However, this invention is not limited to the order of the steps described above; that is, the steps can be performed in the order mentioned in the embodiments, or in a different order, or several steps can be performed simultaneously.
[0187] The aspects of this disclosure have been described above with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), electronic devices, and storage media according to embodiments of this application. It should be understood that each block in the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to create a machine such that these instructions, executable via the processor of the computer or other programmable data processing apparatus, enable the implementation of the functions / actions specified in one or more blocks of the flowchart illustrations and / or block diagrams. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field-programmable logic circuit. It is also understood that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can also be implemented by special-purpose hardware performing the specified functions or actions, or can be implemented by a combination of special-purpose hardware and computer instructions.
[0188] The above description is merely a specific embodiment of the present invention. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, modules, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. It should be understood that the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present invention, and these modifications or substitutions should all be covered within the protection scope of the present invention.
Claims
1. A data query method, characterized in that, The method includes: Get data query request; Based on the data query request, a data query command is generated; Based on the key fields in the data query command, obtain the target relationship table and target business type corresponding to the key fields; Based on the target relationship table and the target business type, determine the target partition information of the target relationship table; Based on the target partition information and the data link corresponding to the data query request, the data query command is split to obtain data query sub-commands; The data obtained from the data query subcommand is integrated to obtain the target query data; Specifically, the step of splitting the data query command based on the target partition information and the data link corresponding to the data query request to obtain data query sub-commands includes: Based on the target partition information and the data link corresponding to the data query request, a first directed graph of the target partition is determined; The data fusion points in the first directed graph are determined based on the business relevance of the relationship table of the data links; The data query command is split based on the data fusion point to obtain data query sub-commands; The determination of data fusion points in the first directed graph based on the business relevance of the data link relationship table includes: Modify the first data link segment in the first directed graph that does not conform to the partitioning hierarchy rules; Sub-data link segments are added according to the partitioning hierarchy rules to obtain the second data link segment of the second directed graph; The business relevance between the relation tables is determined based on the overlap of key fields in adjacent relation tables in the second data link segment. The relationship tables with a business relevance less than a preset threshold are identified as data fusion points in the first directed graph.
2. The data query method according to claim 1, characterized in that, Before obtaining the data query request, the method further includes: Identify the business types to which multiple relationship tables belong; Relationship tables belonging to the same business type are classified into the same partition to obtain the partition information of the relationship tables.
3. The data query method according to claim 2, characterized in that, After obtaining the partition information of the relation table and before obtaining the data query request, the method further includes: Based on the order of the relation tables in the data link, determine the hierarchical level of the partition corresponding to the business type to which the relation tables belong; The relation table is partitioned according to its partitioning information to obtain a directed graph.
4. The data query method according to claim 1, characterized in that, The process of splitting the data query command based on the data fusion point to obtain data query sub-commands includes: Based on the data fusion points, the first data link segment in the first directed graph is split to obtain multiple relation table combinations; Based on the data fusion point, the data query command is split into a corresponding number of data query sub-commands for the relationship table combination.
5. A data query device, characterized in that, The device includes: The first acquisition module is used to acquire data query requests; The generation module is used to generate data query commands based on data query requests; The second acquisition module is used to acquire the target relationship table and target business type corresponding to the key fields in the data query command; The determination module is used to determine the target partition information of the target relationship table based on the target relationship table and the target business type; The splitting module is used to split the data query command based on the target partition information and the data link corresponding to the data query request to obtain data query sub-commands; The integration module is used to integrate the data obtained from the data query subcommand to obtain the target query data; The determining module is further configured to determine a first directed graph of the target partition based on the target partition information and the data link corresponding to the data query request; The determining module is further configured to determine the data fusion point in the first directed graph based on the business relevance of the relationship table of the data link; The splitting module is also used to split the data query command based on the data fusion point to obtain data query sub-commands; The data query device further includes: a modification module and an addition module; The modification module is used to modify the first data link segment in the first directed graph that does not conform to the partitioning level rules; The adding module is used to add sub-data link segments according to the partitioning hierarchy rules to obtain the second data link segment of the second directed graph; The determining module is further configured to determine the business relevance between the relationship tables based on the overlap of key fields in adjacent relationship tables in the second data link segment; The determining module is further configured to determine the relationship table with a business relevance less than a preset threshold as a data fusion point in the first directed graph.
6. An electronic device, the device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it performs the data query method as described in any one of claims 1 to 4.
7. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the data query method as described in any one of claims 1 to 4.
8. A computer program product, characterized in that, When the instructions in the computer program product are executed by the processor of the electronic device, the electronic device performs the data query method as described in any one of claims 1 to 4.