Data query method and device, equipment, storage medium and program product
Through directed acyclic graph data structure and query box technology, the problem of decentralized query of government payment data is solved, efficient and flexible cross-system data query is realized, development complexity and front-end interaction difficulty are reduced, and the accuracy and real-time requirements of government payment data query are met.
Patent Information
- Application Number
- CN202510572865.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-30
- Publication Date
- 2025-08-19
AI Technical Summary
Government payment data is scattered in multiple systems, resulting in multiple cross-department and cross-system query, low query efficiency, and the existing technology lacks flexibility and scalability, making it difficult to be compatible with new services, and front-end interaction is difficult.
Using directed acyclic graph data structure, a data link is built based on business processes, a data link is determined through a deep priority search algorithm, a query box is built, and a query interface is encapsulated to obtain all relevant data in one query.
It improves data query efficiency, reduces development complexity, achieves high scalability and compatibility, optimizes front-end interactions, and meets the accuracy and real-time requirements of government payment data query.
Smart Images

Figure CN120508685A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of data processing technology, and in particular relates to a data query method, device, equipment, storage medium and program product. Background Art
[0002] With the rapid development of digital government, the importance of government bill payment services has become increasingly prominent. Currently, government bill payment data is often scattered across multiple systems, and these systems are distributed across different departments, making data flows extremely complex. If a user wants to query the complete data for a payment, they often need to conduct multiple queries across departments and systems, resulting in low data query efficiency. Summary of the Invention
[0003] The embodiments of the present application provide a data query method, apparatus, device, computer-readable storage medium, and computer program product, which can query all data related to the business to be queried through a single data query without the need for multiple queries across departments and systems, thereby improving data query efficiency.
[0004] In a first aspect, an embodiment of the present application provides a data query method, the method comprising:
[0005] In response to a first operation in which a user inputs a query condition for a service to be queried, obtaining the service query condition;
[0006] Querying an initial query result matching the business query condition from an initial business system associated with the business query condition, wherein the initial query result includes at least initial data, and the initial business system is a business system among multiple business systems associated with the business to be queried;
[0007] Determining a target data link corresponding to the initial data based on a data link of a directed acyclic graph data structure, wherein the directed acyclic graph data structure is determined based on a plurality of business systems through which business data of different businesses flow according to a business process;
[0008] querying associated data associated with the initial data from a target business system included in the target data link;
[0009] The initial data and the associated data are displayed.
[0010] In a possible implementation, before determining the target data link corresponding to the initial data based on the data link of the directed acyclic graph data structure, the method further includes:
[0011] Obtain business data and business processes for different businesses;
[0012] For each of the businesses, a directed acyclic graph is constructed based on the multiple business systems through which the business data flows according to the business process, where the nodes in the directed acyclic graph are the business systems;
[0013] For each of the services, a data link of the directed acyclic graph data structure is determined based on an upstream and downstream relationship between nodes in the directed acyclic graph.
[0014] In a possible implementation, determining the data link of the directed acyclic graph data structure based on the upstream and downstream relationships of the nodes in the directed acyclic graph includes:
[0015] Based on the upstream and downstream relationships of the nodes in the directed acyclic graph, a topological sorting of the directed acyclic graph is recursively constructed in reverse order through a depth-first search algorithm to obtain a data link of the directed acyclic graph data structure.
[0016] In a possible implementation, after determining the data link of the directed acyclic graph data structure, the method further includes:
[0017] Constructing a node unit based on every two adjacent nodes on the data link;
[0018] For each of the node units, encapsulate a query interface on the node unit to obtain a query unit;
[0019] Encapsulating a plurality of the query units to obtain a query box;
[0020] The querying of associated data associated with the initial data from the target business system included in the target data link includes:
[0021] The query box is called to query associated data associated with the initial data from the target business system included in the target data link.
[0022] In one possible implementation, the initial query result further includes an upstream business system identifier and a downstream business system identifier of the initial data, and there are multiple target business systems; calling the query box to query associated data associated with the initial data from the target business system included in the target data link includes:
[0023] Determine the target business system identifier from the upstream business system identifier and the downstream business system identifier of the initial data according to a preset query order;
[0024] If the target business system identifier is not empty, calling the query box to query the target business system corresponding to the target business system identifier to obtain a correlation query result, the correlation query result including the correlation data, and the upstream business system identifier and downstream business system identifier of the correlation data;
[0025] The associated query result is used as the initial query result, the target business system is used as the initial business system, and the preset query order is returned to determine the target business system identifier from the upstream business system identifier and the downstream business system identifier of the initial data until the target business system identifier is empty and the query of the target business systems in the target data link is completed, wherein each target business system is queried once.
[0026] In a possible implementation, calling the query box to query the target business system corresponding to the target business system identifier to obtain the associated query result includes:
[0027] Determining a target query unit corresponding to the target business system in the query box based on the target business system identifier and the system identifier of the initial business system;
[0028] The target query unit is called to query the target business system corresponding to the target business system identifier to obtain a related query result.
[0029] In a possible implementation, the initial query results are multiple, and before the data link based on the directed acyclic graph data structure determines the target data link corresponding to the initial data, the method further includes:
[0030] displaying a plurality of the initial query results;
[0031] receiving a second operation of the user selecting a target initial query result from the plurality of initial query results;
[0032] In response to the second operation, determining the initial data in the target initial query result as target initial data;
[0033] The data link based on the directed acyclic graph data structure determines the target data link corresponding to the initial data, comprising:
[0034] Based on the data links of the directed acyclic graph data structure, a target data link corresponding to the target initial data is determined.
[0035] In a possible implementation, before displaying the plurality of initial query results, the method further includes:
[0036] For each of the initial query results, obtaining the query identifier corresponding to the business query condition, the system identifier of the initial business system, the system identifier of the target business system, and a display sequence number;
[0037] For each of the initial query results, determining a display identifier based on the query identifier, the system identifier of the initial business system, the system identifier of the target business system, and the display sequence number;
[0038] For each initial query result, caching the display identifier and its corresponding initial query result;
[0039] Displaying a plurality of the initial query results, including:
[0040] displaying initial query results corresponding to the plurality of display identifiers respectively;
[0041] In response to the second operation, determining the initial data in the target initial query result as target initial data includes:
[0042] In response to the second operation, determining the display identifier of the target initial query result as a target display identifier;
[0043] The target initial data corresponding to the target display identifier is obtained from the cache.
[0044] In a possible implementation, the displaying of the initial data and the associated data includes:
[0045] Determining a display order of the initial data and the associated data based on a business process of the business to be queried;
[0046] The initial data and the associated data are displayed in the display order.
[0047] In a possible implementation, in response to the first operation of the user inputting a query condition for a service to be queried, before obtaining the service query condition, the method further includes:
[0048] Extracting real-time online data from the plurality of business systems corresponding to at least one business based on a data transfer tool;
[0049] Performing data preprocessing on the real-time online data corresponding to the plurality of business systems to obtain the business data corresponding to the plurality of business systems;
[0050] Based on the data flow direction of the business data flowing through the plurality of business systems according to the business process, marking each of the business data with an upstream business system identifier and a downstream business system identifier;
[0051] Storing the business data marked with upstream business system identifiers and downstream business system identifiers respectively corresponding to the plurality of business systems into the big data platform;
[0052] The querying of associated data associated with the initial data from the target business system included in the target data link includes:
[0053] Determining a target business system included in the target data link in the big data platform;
[0054] Query the target business system for associated data associated with the initial data.
[0055] In a second aspect, an embodiment of the present application provides a data query device, which includes:
[0056] An acquisition module, configured to acquire a service query condition in response to a first operation in which a user inputs a query condition for a service to be queried;
[0057] a query module, configured to query an initial query result matching the business query condition from an initial business system associated with the business query condition, wherein the initial query result includes at least initial data, and the initial business system is a business system among multiple business systems associated with the business to be queried;
[0058] a determination module, configured to determine a target data link corresponding to the initial data based on a data link of a directed acyclic graph data structure, wherein the directed acyclic graph data structure is determined based on a plurality of business systems through which business data of different businesses flow according to a business process;
[0059] The query module is further configured to query associated data associated with the initial data from a target business system included in the target data link;
[0060] A display module is used to display the initial data and the associated data.
[0061] In a third aspect, an embodiment of the present application provides an electronic device, the device comprising: a processor and a memory storing computer program instructions;
[0062] When the processor executes the computer program instructions, the method in any possible implementation method of the first aspect described above is implemented.
[0063] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having computer program instructions stored thereon. When the computer program instructions are executed by a processor, the method of any possible implementation method in the first aspect described above is implemented.
[0064] In a fifth aspect, an embodiment of the present application provides a computer program product. When the instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes a method as any possible implementation method in the first aspect above.
[0065] In an embodiment of the present application, the initial business system is a business system in a plurality of business systems associated with the business to be queried. Therefore, by responding to the first operation of the query condition of the business to be queried input by the user, the business query condition is obtained, and the initial query result that matches the business query condition is searched from the initial business system related to the business query condition, it is possible to determine that the data query entry of the business to be queried is the initial business system based on the user operation, and to search for the initial query result from the initial business system. Since the initial query result includes at least initial data, and the directed acyclic graph data structure is determined based on the business data of different businesses according to the multiple business systems through which the business process flows, therefore, by determining the target data link corresponding to the initial data based on the data link of the directed acyclic graph data structure, and querying the associated data associated with the initial data from the target business system included in the target data link, that is, by starting from the initial business system, determining the target business system based on the data flow of the business data, and querying the associated data associated with the initial data from the target business system, it is possible to achieve through a single data query, that is, to query all data related to the business to be queried (including initial data and associated data), without the need for multiple queries across departments and systems, thereby improving data query efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0066] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0067] Figure 1 This is a flow chart of a data query method provided in an embodiment of the present application;
[0068] Figure 2 is a schematic diagram of a directed acyclic graph provided in an embodiment of the present application;
[0069] Figure 3 is a schematic diagram of a query box provided in an embodiment of the present application;
[0070] Figure 4 This is a flow chart of another data query method provided in an embodiment of the present application;
[0071] Figure 5 This is a schematic diagram of a data query process provided by an embodiment of the present application;
[0072] Figure 6 This is a structural diagram of a data query device provided in an embodiment of the present application;
[0073] Figure 7 This is a structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0074] The features and exemplary embodiments of various aspects of the present application will be described in detail below. In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present application, rather than to limit the present application. For those skilled in the art, the present application can be implemented without the need for some of these specific details. The following description of the embodiments is merely to provide a better understanding of the present application by illustrating the examples of the present application.
[0075] It should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, the elements defined by the phrase "comprising..." do not exclude the presence of other identical elements in the process, method, article, or device comprising the elements.
[0076] In addition, the acquisition, storage, use, and processing of data in the technical solution of this application comply with the relevant provisions of national laws and regulations.
[0077] Requests for government fee payment data inquiries primarily come from user complaints, user issues forwarded by the tax authorities, transaction verification, and production verification issues. These requests are numerous and numerous. Because government fee payments are vital to payers, the government is highly attentive to public complaints, and the deadlines for resolution are short, the accuracy and timeliness of transaction inquiries are high. Therefore, a unified data query system for government fee payment data is necessary to meet the accuracy and real-time requirements of government fee payment data inquiries.
[0078] At present, government payment data is usually scattered across multiple systems, and multiple systems are scattered across different departments, making the data flow extremely complex. For example, the interaction status of industry systems needs to be queried in industry-side systems such as the government personalized industry post-processing system, the internal industry transaction status of financial institutions needs to be queried in industry content systems, content gateways and other systems, the clearing and deduction status needs to be queried in transfer, omni-channel, QR code platform and other systems, and the channel system docking status needs to be queried in channel-side systems such as government acceptance applications. Since the data is scattered across multiple systems, if a user wants to query all the data of a payment, it often requires multiple queries across departments and systems, and it is impossible to obtain all the required data at one time, resulting in low data query efficiency.
[0079] In related technologies, some data query methods can realize cross-system data query, but the data query link is single and it is impossible to query the entire link data from any system in the link, which lacks flexibility.
[0080] Furthermore, cross-system querying currently has poor scalability. Adding new services often creates incompatibility issues with existing systems, often requiring modifications to entire query nodes. This requires developers to understand the entire chain of business information and perform code modifications, which is highly invasive and increases development complexity.
[0081] Furthermore, related technologies fail to consider the interaction with the front-end during data querying. Specifically, they fail to consider how to structure data presentation across multiple systems, and when querying multiple data items from a particular system, how to design an elegant data structure to return to the front-end and reduce the difficulty of front-end interaction.
[0082] Thus, in order to solve the problems of the prior art, the embodiments of the present application provide a data query method, apparatus, device, computer-readable storage medium, and computer program product. The data query method can be applied to scenarios where data is queried across multiple systems. The data query method is applicable to online data queries involving all multi-system combinations with complex links, meeting the need for correlated and integrated queries of data from all systems. If the data query method is applied to the financial industry, the multiple systems may include gateway systems, industry systems, transfer systems, channel systems, risk control systems, and the like.
[0083] The following first introduces the data query method provided in the embodiment of the present application.
[0084] Figure 1 FIG1 shows a flow chart of a data query method provided by an embodiment of the present application. The data query method can be executed by a processor in a data query system. Figure 1 As shown, the data query method provided in the embodiment of the present application includes the following steps:
[0085] S110, in response to a first operation in which a user inputs a query condition for a service to be queried, obtaining the service query condition;
[0086] S120: Querying an initial query result matching the business query condition from an initial business system related to the business query condition, where the initial query result includes at least initial data, and the initial business system is a business system among multiple business systems associated with the business to be queried;
[0087] S130: Determine a target data link corresponding to the initial data based on a data link in a directed acyclic graph data structure, where the directed acyclic graph data structure is determined based on multiple business systems through which business data of different businesses flow according to a business process;
[0088] S140, querying the associated data associated with the initial data from the target business system included in the target data link;
[0089] S150: Display initial data and associated data.
[0090] In an embodiment of the present application, the initial business system is a business system in a plurality of business systems associated with the business to be queried. Therefore, by responding to the first operation of the query condition of the business to be queried input by the user, the business query condition is obtained, and the initial query result that matches the business query condition is searched from the initial business system related to the business query condition, it is possible to determine that the data query entry of the business to be queried is the initial business system based on the user operation, and to search for the initial query result from the initial business system. Since the initial query result includes at least initial data, and the directed acyclic graph data structure is determined based on the business data of different businesses according to the multiple business systems through which the business process flows, therefore, by determining the target data link corresponding to the initial data based on the data link of the directed acyclic graph data structure, and querying the associated data associated with the initial data from the target business system included in the target data link, that is, by starting from the initial business system, determining the target business system based on the data flow of the business data, and querying the associated data associated with the initial data from the target business system, it is possible to achieve through a single data query, that is, to query all data related to the business to be queried (including initial data and associated data), without the need for multiple queries across departments and systems, thereby improving data query efficiency.
[0091] The specific implementation methods of the above steps are introduced below.
[0092] In some embodiments, in S110, the business to be queried can be any one of the payment businesses such as social security payment, tax payment, customs travel tax, fiscal non-tax, traffic fines, and tax and fee payment. In addition, the data query system may include a front-end interactive interface and a back-end processing system. The front-end interactive interface may display multiple query condition input boxes and query controls. The multiple query condition input boxes may be used to input information such as ID number, transaction serial number, payment card number, order number, start date, end date, area code, amount, etc. The query control may be used to indicate the start of a data query operation. Based on this, the first operation may include the user entering query conditions in the query condition input box of the front-end interactive interface, and clicking the query control.
[0093] As an example, a user enters information such as ID number A, start date B, and end date C in the front-end interactive interface and clicks the query control. The back-end processing system then obtains the business query conditions. Business query conditions may include: ID number A, start date B, and end date C.
[0094] Additionally, as mentioned above, the front-end interface allows for a wide range of query conditions. However, multiple query conditions may not be compatible. For example, if the business query conditions include ID number A, transaction number D, payment card number E, and order number F, the data corresponding to these business query conditions may not be found.
[0095] Therefore, to ensure the success of data queries, in some embodiments, the front-end interactive interface may also display prompts. The prompts may be used to inform the user how to enter query criteria. For example, the prompts may include: ID number, transaction serial number, payment card number, and order number. Only one of these must be entered.
[0096] In some embodiments, in S120, if the business to be queried is a social security payment business, the multiple business systems associated with the business to be queried may include, for example, a QR code platform system, an omni-channel system, a content gateway system, an internal system of a financial institution, a government affairs post-placement system, etc. The initial business system associated with the business query condition may be one or more of the above-mentioned multiple business systems. For example, if the business query condition includes the certificate number but does not include the transaction serial number, the payment card number, and the order number, it can be determined that the initial business system is the government affairs post-placement system. If the business query condition includes the order number but does not include the transaction serial number, the certificate number, and the payment card number, it can be determined that the initial business system is the content gateway system. If the business query condition includes the payment card number but does not include the transaction serial number, the certificate number, and the order number, it can be determined that the initial business system includes the QR code platform system and the omni-channel system.
[0097] In an embodiment of the present application, the association relationship between the business to be queried and the business system, as well as the association relationship between the business query condition and the initial business system, may be pre-set or not, and is not limited here. If the association relationship between the business to be queried and the business system, as well as the association relationship between the business query condition and the initial business system, is pre-set, then after obtaining the business query condition of the business to be queried, the background processing system may first determine multiple business systems corresponding to the business to be queried, then determine the initial business system corresponding to the business query condition among the multiple business systems corresponding to the business to be queried, and then search the initial business system for the initial query result that matches the business query condition. If the association relationship between the business to be queried and the business system, as well as the association relationship between the business query condition and the initial business system, is not pre-set, then after obtaining the business query condition of the business to be queried, the background processing system may poll multiple business systems, respectively search for the initial query result that matches the business query condition in the multiple business systems, and determine the business system corresponding to the initial query result as the initial business system. The initial query result includes at least initial data. The initial data may be a piece of business data in the initial business system. In addition, the initial query result may be one or more.
[0098] In some embodiments, in S130, the directed acyclic graph data structure may be determined based on multiple business systems through which business data of different businesses flow according to business processes. That is, the directed acyclic graph data structure may be used to describe the data flow of business data in multiple business systems. Specifically, the directed acyclic graph data structure may include multiple data links. The nodes in the data links may be business systems. The data link including the initial business system in the multiple data links may be the target data link.
[0099] As an example, after obtaining the initial query result from the initial business system, the data link of the initial business system included in the multiple data links of the directed acyclic graph data structure may be determined as the target data link corresponding to the initial data.
[0100] Based on this, in order to clarify the ownership of business data in the directed acyclic graph data structure and thus provide a feasible basis for querying data across multiple systems, in some embodiments, before the above S130, the method may further include:
[0101] Obtain business data and business processes for different businesses;
[0102] For each business, a directed acyclic graph is constructed based on the multiple business systems through which business data flows according to the business process. The nodes in the directed acyclic graph are business systems.
[0103] For each business, the data link of the directed acyclic graph data structure is determined based on the upstream and downstream relationships of the nodes in the directed acyclic graph.
[0104] Different businesses here can include payment services such as social security contributions, tax payments, customs and postal tax, fiscal non-tax services, traffic fines, and combined tax and fee payments. They can also include non-payment services such as fund supervision and account management. A business process can be the ordered series of steps or activities involved in completing a business. Business data can be the information generated, used, or stored during the execution of a business process. Furthermore, a directed acyclic graph (DAG) is a directed graph without loops.
[0105] It should be noted that in the embodiment of the present application, there can be a one-to-one correspondence between the business and the directed acyclic graph, or multiple businesses can correspond to one directed acyclic graph, which is not limited here.
[0106] A schematic diagram of a directed acyclic graph provided in an embodiment of the present application can be shown as follows: Figure 2 As shown. Figure 2 In the example, different numbers can represent different business systems. Figure 2 As shown, the upstream of node 2 can be node 1, the downstream of node 2 can be node 8, the upstream of node 8 can include node 2, node 4 and node 7, and the downstream of node 8 can be node 10. Based on the upstream and downstream relationships of the nodes in the directed acyclic graph, multiple data links of the directed acyclic graph data structure can be determined. Figure 2 As shown, the multiple data links of the directed acyclic graph data structure may include 1→2→8→10, 3→4→8→10, 7→8→10, etc.
[0107] The embodiment of the present application first constructs a directed acyclic graph based on multiple business systems through which business data of different businesses flow according to business processes, and then determines the data link of the directed acyclic graph data structure based on the upstream and downstream relationships of nodes in the directed acyclic graph. This can clarify the ownership of business data in the directed acyclic graph data structure, that is, clarify the data flow direction of business data in multiple business systems, clarify to which business system the business data belongs, and clarify the upstream business system and downstream business system of the business data, thereby providing a feasibility basis for querying data across multiple systems.
[0108] Based on this, in order to ensure the accuracy of the data link of the directed acyclic graph data structure, in some embodiments, the above-mentioned determination of the data link of the directed acyclic graph data structure based on the upstream and downstream relationships of the nodes in the directed acyclic graph may specifically include:
[0109] Based on the upstream and downstream relationships of nodes in the directed acyclic graph, the topological sorting of the directed acyclic graph is recursively constructed in reverse order through the depth-first search algorithm to obtain the data link of the directed acyclic graph data structure.
[0110] Here, topological ordering can be to sort the nodes in the directed acyclic graph according to the upstream and downstream relationships, thereby forming a single linear arrangement with upstream and downstream relationships, which represents the execution order of the query. Each single linear arrangement can be a data link.
[0111] In practice, if the upstream and downstream relationships of nodes in a directed acyclic graph are incorrectly organized, a loop may appear in the directed acyclic graph, leading to data link errors. Therefore, to ensure the accuracy of the data link, the recursive limit of the node can be increased during the topological sorting process to reversely detect whether there is a loop structure in the directed acyclic graph.
[0112] As an example, based on the upstream and downstream relationships of nodes in a directed acyclic graph, the process of recursively constructing the topological sort of the directed acyclic graph in reverse order using the depth-first search algorithm (DFS) to obtain the data link of the directed acyclic graph data structure can be as follows:
[0113] Initialize the access status of all nodes in the directed acyclic graph to unvisited, and create an empty stack to store the sorting results;
[0114] Perform a depth-first search on each unvisited node in the directed acyclic graph, specifically:
[0115] Mark the current node as visited;
[0116] Recursively visit all downstream nodes of the current node;
[0117] When recursively returning, push the current node onto the stack;
[0118] When recursively accessing downstream nodes, the number of recursions is recorded. If the number of recursions exceeds a preset threshold, it is determined that there is a cycle in the directed acyclic graph, the algorithm is terminated, and the data flow of business data through multiple business systems according to the business process is reorganized, that is, the above process of constructing a directed acyclic graph is repeated, and the above process of recursively constructing the topological sorting of the directed acyclic graph in reverse order based on the upstream and downstream relationships of the nodes in the directed acyclic graph is repeated through the depth-first search algorithm, until all nodes in the directed acyclic graph are traversed and the number of recursions for all nodes is less than or equal to the preset threshold;
[0119] Finally, the nodes in the stack are popped out one by one to obtain the topological sorting result of the directed acyclic graph, that is, the data link of the directed acyclic graph data structure is obtained.
[0120] The embodiment of the present application constructs a topological sort of the directed acyclic graph in reverse order based on the upstream and downstream relationships of the nodes in the directed acyclic graph through a depth-first search algorithm in a recursive manner, and increases the recursive number limit of the node in the process of topological sorting. It can reversely detect whether there is a ring structure in the directed acyclic graph, and re-sort the data flow of business data through multiple business systems according to the business process when a ring structure exists. It can ensure that there is no ring structure in the directed acyclic graph, and thus ensure the accuracy of the data link of the directed acyclic graph data structure.
[0121] In some embodiments, in S140, the target data link may include an initial business system and multiple target business systems. The initial business system may be located anywhere in the target data link, and the target business system may be any of the multiple business systems included in the target data link, excluding the initial business system. For example, if the target data link is 1→2→8→10, the initial business system may be any one of node 1, node 2, node 8, and node 10. If the initial business system is node 2, the target business system may include node 1, node 8, and node 10. In addition, the associated data may be business data queried from the target business system. One or more associated data may be queried from each target business system.
[0122] It should be noted that if the initial business system is the most upstream business system in the target data link, then you can start from the initial business system and query multiple target business systems downstream in sequence. If the initial business system is the most downstream business system in the target data link, then you can start from the initial business system and query multiple target business systems upstream in sequence. If the initial business system has both upstream and downstream business systems in the target data link, then after querying the initial business system and obtaining the initial data, you can query multiple target business systems in a preset query order. The preset query order can be any one of the following query orders:
[0123] First query the upstream business system for the initial data, then query the downstream business system for the initial data;
[0124] First query the downstream business system of the initial data, then query the upstream business system of the initial data;
[0125] Query the upstream and downstream business systems of the initial data at the same time.
[0126] For example, if the target data link is 1→2→8→10, and the initial business system is node 2, then after querying the initial data from node 2, you can query node 1, node 8, and node 10 in sequence; you can query node 8, node 10, and node 1 in sequence; you can also query node 1 upstream while querying node 1 downstream in sequence.
[0127] Based on this, in order to reduce data query costs and achieve high scalability and compatibility of the data query system, in some embodiments, after determining the data links of the directed acyclic graph data structure, the method may further include:
[0128] Construct a node unit based on every two adjacent nodes on the data link;
[0129] For each node unit, encapsulate the query interface on the node unit to obtain the query unit;
[0130] Encapsulate multiple query units to obtain a query box.
[0131] Based on this, the above S140 may specifically include:
[0132] The query box is called to query the associated data associated with the initial data from the target business system included in the target data link.
[0133] Here, a node unit can include two adjacent nodes in an upstream-downstream relationship. For example, if the data link is 1→2→8→10, then the node units can include 1→2, 2→8, and 8→10. In addition, as described above, if the initial business system is not the most upstream business system in the target link, it is also possible to start from the initial business system and query upward to the target business system. Therefore, if the data link is 1→2→8→10, then the node units can also include 10→8, 8→2, and 1→1.
[0134] Additionally, a query unit can be the smallest query unit used to perform a query operation. The query interface can encapsulate a query function, which can be used to define query logic. The query logic can take the system identifiers of a first business system and a second business system as inputs, and output associated data corresponding to a target field in the second business system, as well as the system identifier of a third business system to be queried after querying the second business system. The first business system can be the business system for which data has been queried, and the second business system can be the business system to be queried after querying the first business system. Furthermore, the target field can be a document number, payment card number, order number, etc. For example, if the node unit is 1→2, the target field is a payment card number, and data has been queried in node 1, then the query unit corresponding to this node unit can take nodes 1 and 2 as inputs, output node 2 including associated data for the target payment card number, and node 8 to be queried after querying node 2. The target payment card number can be the payment card number included in the data queried in node 1.
[0135] After obtaining multiple query units, the query boxes can be obtained by encapsulating the multiple query units in a componentized manner. Figure 3 As shown, the query box 31 may include a first query box 311 for upward query and a second query box 312 for downward query.
[0136] In the embodiment of the present application, the query box can be a related query interface. Thus, after obtaining the query box, the related data associated with the initial data can be queried from the target business system included in the target data link by calling the query box.
[0137] In addition, since the query box encapsulates the system identifier of the business system, in order to ensure the success of the data query, the embodiment of the present application can also maintain a correspondence table between the business system and the system identifier, so as to accurately locate the business system based on the system identifier during the data query process to ensure the success of the data query.
[0138] The embodiment of the present application first constructs a query unit based on the data link, and then encapsulates multiple query units to obtain a query box. That is, by externally packaging it as a business interface (i.e., a query box) and internally configuring multiple query units, the person in charge of different business systems only needs to maintain the query unit they are responsible for, without having to understand the business of the entire link, thereby reducing the backend development business learning cost and, in turn, the data query cost. On this basis, if a new subsystem is added later, that is, when a new query node is added to any query link, the developer only needs to pay attention to the upstream and downstream systems of the current new node and develop the corresponding query unit to meet the query requirements of the entire link, thus achieving high scalability and compatibility of the data query system.
[0139] As mentioned above, there may be multiple target business systems. In addition, the initial query result may also include the upstream business system identifier and the downstream business system identifier of the initial data.
[0140] Based on this, in order to achieve a single data query to query all data related to the business to be queried and improve data query efficiency, the query box is called to query the associated data associated with the initial data from the target business system included in the target data link, which may specifically include:
[0141] According to the preset query order, determine the target business system ID from the upstream business system ID and downstream business system ID of the initial data;
[0142] If the target business system ID is not empty, call the query box to query the target business system corresponding to the target business system ID and obtain the associated query result. The associated query result includes the associated data, as well as the upstream business system ID and downstream business system ID of the associated data.
[0143] The associated query result is used as the initial query result, the target business system is used as the initial business system, and the preset query order is returned to determine the target business system identifier from the upstream business system identifier and downstream business system identifier of the initial data until the target business system identifier is empty and the query of the target business systems in the target data link is completed, wherein each target business system is queried once.
[0144] As mentioned above, the query box includes multiple query units. Therefore, the query box is called to query the target business system corresponding to the target business system identifier to obtain the associated query results, which may specifically include:
[0145] Determine the target query unit corresponding to the target business system in the query box based on the preset query sequence, the target business system identifier, and the system identifier of the initial business system;
[0146] The target query unit is called to query the target business system corresponding to the target business system identifier to obtain the associated query result.
[0147] Here, if the target data link is 1→2→8, the initial business system is node 2, and the initial data is M1, then the upstream business system identifier of the initial data can be node 1, and the downstream business system identifier can be node 8. Based on this, if the preset query order is to first query the upstream business system of the initial data and then query the downstream business system of the initial data, then the target business system identifier can be node 1, that is, the target business system identifier is not null. Therefore, based on the preset query order, node 1, and node 2, the query unit including the unit node 2→1 is determined in the query box as the target query unit. The target query unit is then called to query the target business system corresponding to node 1, obtaining an associated query result. The associated query result may include associated data M2, the upstream business system identifier of associated data M2 (NONE), and the downstream business system identifier node 2. Subsequently, the initial query result is updated using the associated query result, and the initial business system is updated using the target business system. The initial business system can be determined to be node 1, the initial data is M2, the upstream business system identifier of the initial data (NONE), and the downstream business system identifier node 2.
[0148] Since the preset query order is to first query the upstream business system of the initial data, then the downstream business system of the initial data, the upstream business system identifier of node 1 is determined as the target business system identifier. At this point, the target business system identifier is empty, indicating that, starting from node 2, all upstream business systems of the initial data have been queried. Since nodes 1 and 2 in the target data link have already been queried, node 2 is the original initial business system, and node 8 has not yet been queried, the query continues downstream from node 2. Specifically, the downstream business system identifier node 8 of the initial data M1 is determined as the target business system identifier, that is, the target business system identifier is not empty. Therefore, based on the preset query order, nodes 2, and 8, the query unit including the unit nodes 2→8 in the query box is determined as the target query unit. The target query unit is then called to query the target business system corresponding to node 8, obtaining the associated query result. The associated query result may include associated data M3, the upstream business system identifier node 2 of associated data M3, and the downstream business system identifier node NONE. Afterwards, the initial query result is updated using the above-mentioned associated query result, and the initial business system is updated using the above-mentioned target business system. It can be determined that the initial business system is node 8, the initial data is M3, the upstream business system identifier of the initial data is node 2, and the downstream business system identifier is NONE.
[0149] Based on the preset query order, the target business system identifier is determined to be NONE, the downstream business system identifier of the initial data M3. That is, the target business system identifier is empty. Since the query of all nodes in the target data link has been completed, it can be determined that this data query has ended, and one initial data and multiple related data are obtained.
[0150] If the preset query order is to first query the downstream business system of the initial data and then query the upstream business system of the initial data, please refer to the above description and will not be repeated here.
[0151] If the preset query order is to query the upstream business system and downstream business system of the initial data at the same time, the upward query and downward query processes can be performed respectively through two query threads. Please refer to the above description and will not be repeated here.
[0152] The embodiment of the present application obtains a specific process of calling the target query unit in a preset query order, querying the target business system corresponding to the target business system identifier, and obtaining the associated query result. It can obtain an initial data and multiple associated data corresponding to the business query conditions, and realize that all data related to the business to be queried can be queried through a single data query without the need for multiple queries across departments and systems, thereby improving data query efficiency.
[0153] In some embodiments, in S150, after the backend processing system obtains the initial data and associated data through query, it may return the initial data and associated data and display them on the front-end interactive interface. In embodiments of the present application, each time an initial data or associated data is queried, the data may be displayed once. Alternatively, each time an initial data or associated data is queried, the initial data or associated data may be cached, and then all data may be displayed at once after the initial data and associated data are queried. This is not limited to the above.
[0154] Based on this, in order to improve the user's query experience, in some embodiments, the above S150 may specifically include:
[0155] Determine the display order of initial data and related data based on the business process of the business to be queried;
[0156] Displays the initial data and related data in the order in which they are presented.
[0157] Here, the initial service system corresponding to the initial data may be at the first position of the target data link, may be at the last position of the target data link, or may be at the middle position of the target data link.
[0158] If the initial business system is at the top of the target data link, the query order of the initial data and associated data can be the same as the data flow of business data in multiple business systems, that is, the display order can be the same as the query order.
[0159] If the initial business system is at the end of the target data link, the query order of the initial data and associated data can be opposite to the data flow of business data in multiple business systems, that is, the display order can be opposite to the query order.
[0160] If the initial business system is in the middle of the target data link, after the initial data and related data are obtained through query, the initial data and related data can be reordered based on the business process of the business to be queried to obtain a display order.
[0161] The embodiment of the present application displays initial data and related data based on the business process of the business to be queried, that is, by hierarchically displaying the business data corresponding to multiple business systems, it can improve the comprehensibility of business data, enable users to obtain information more efficiently, and enhance the user's query experience.
[0162] In addition, as mentioned above, there may be multiple initial query results. If there are multiple initial query results, in order to make the query results meet the user's needs and improve the user's query experience, in some embodiments, such as Figure 4 As shown, the data query method provided in the embodiment of the present application may include the following steps S410-S480.
[0163] S410 , in response to a first operation of a user inputting a query condition for a service to be queried, obtaining a service query condition.
[0164] S420: Query an initial business system related to the business query condition for a plurality of initial query results that match the business query condition, where the initial query results at least include initial data.
[0165] Here, the initial business system may be one or more. That is, the multiple initial query results may be obtained from one initial business system or from multiple initial business systems, which is not limited here.
[0166] S430: Display multiple initial query results.
[0167] Here, if there are multiple initial query results, the background processing system can return the multiple initial query results to the front-end interactive interface, which is then displayed to the user.
[0168] S440: Receive a second operation of the user selecting a target initial query result from multiple initial query results.
[0169] Here, the target initial query result may be any one of the multiple initial query results. The second operation may be an operation in which the user clicks on the target initial query result on the front-end interactive interface.
[0170] S450: In response to the second operation, determine that the initial data in the target initial query result is the target initial data.
[0171] Here, after the user clicks the target initial query result, the front-end interactive interface can send the target initial query result to the background processing system, and the background processing system determines the initial data in the target initial query result as the target initial data and performs subsequent operations.
[0172] S460 , determining a target data link corresponding to the target initial data based on the data link of the directed acyclic graph data structure.
[0173] S470 , querying associated data associated with the initial data from the target business system included in the target data link.
[0174] S480: Display the initial data and associated data.
[0175] In addition, other steps of the method in the embodiment of the present application can be found in the above Figure 1 The description of the embodiments shown will not be repeated here.
[0176] In the embodiment of the present application, when there are multiple initial query results, the user can choose which initial query result to base subsequent queries on, so that the query results can meet the user's needs and improve the user's query experience.
[0177] Based on this, in order to improve the efficiency of acquiring the target initial data, in some embodiments, before the above S430, the method may further include:
[0178] For each initial query result, obtain the query ID corresponding to the business query condition, the system ID of the initial business system, the system ID of the target business system, and the display sequence number;
[0179] For each initial query result, determine a display identifier based on the query identifier, the system identifier of the initial business system, the system identifier of the target business system, and the display sequence number;
[0180] For each initial query result, a cache display identifier and its corresponding initial query result are cached.
[0181] Based on this, several initial query results are displayed, including:
[0182] Initial query results corresponding to the multiple display identifiers are displayed.
[0183] Based on this, in response to the second operation, determining the initial data in the target initial query result as the target initial data includes:
[0184] In response to the second operation, determining the display identifier of the target initial query result as the target display identifier;
[0185] Get the target initial data corresponding to the target display ID from the cache.
[0186] Here, after obtaining the business query conditions, the background processing system can generate a unique query flow for this query, that is, the query identifier. In addition, the display identifier can be a display serial number obtained by numbering multiple initial query results. The display identifier can be determined randomly. If the query identifier is recorded as qryId, the system identifier of the initial business system is recorded as curSys, the system identifier of the initial business system is recorded as qrySys, and the display serial number is recorded as seqNo, then the display identifier can be recorded as qryId+curSys+qrySys+seqNo. The display identifier can be used as the primary key of the cached data, and the initial query result corresponding to the display identifier can be used as the key value of the cached data.
[0187] Based on this, displaying multiple initial query results can specifically be displayed according to the display sequence number. In addition, when displaying multiple initial query results, the display identifiers corresponding to the initial query results can be displayed or not, which is not limited here.
[0188] After the user clicks the target initial query result, the background processing system may determine the target display identifier corresponding to the target initial query result based on the user's click operation, and obtain the target initial data corresponding to the target display identifier from the cache.
[0189] The embodiment of the present application can improve the efficiency of obtaining the target initial data by first caching the display identifier and the corresponding initial query result, and then obtaining the target initial data corresponding to the target display identifier from the cache.
[0190] Furthermore, during the data query process, each query may yield one or more associated query results. If there are multiple associated query results, these results can also be displayed on the front-end interactive interface, allowing the user to select which initial query result to base subsequent queries on. The specific selection process is described above and will not be repeated here.
[0191] Furthermore, in order to achieve efficient querying of data across multiple systems, in some embodiments, before the above S110, the method may further include:
[0192] Based on the data transfer tool, extract real-time online data from multiple business systems corresponding to at least one business;
[0193] Perform data preprocessing on the real-time online data corresponding to multiple business systems to obtain the business data corresponding to the multiple business systems;
[0194] Based on the data flow of business data through multiple business systems according to the business process, each business data is marked with the upstream business system ID and the downstream business system ID;
[0195] The business data corresponding to the multiple business systems and marked with upstream business system identifiers and downstream business system identifiers are stored in the big data platform.
[0196] Based on this, the above S140 may specifically include:
[0197] Determine the target business system included in the target data link in the big data platform;
[0198] Query the target business system for related data associated with the initial data.
[0199] Here, the data transfer tool may include at least one of the Data Transfer and Extraction Tool (DTEX), the Multi-Protocol Orchestrated Relay for Advanced Yields (MORAY), and the Global Data Distribution Service (GDDS). By extracting data from multiple business systems corresponding to at least one business through the data transfer tool, real-time online data can be obtained. After obtaining the real-time online data, the open source stream processing framework (FLINK) can be used for real-time calculations, combined with the rule engine (Drools), to filter out the transaction data involved in the source data that needs to be queried later, perform pre-processing such as deduplication and deformation, and obtain the business data corresponding to multiple business systems.
[0200] Afterwards, through business combing, the data flow direction of business data flowing through multiple business systems according to the business process can be determined. Based on the data flow direction of business data flowing through multiple business systems according to the business process, the upstream business system identifier and downstream business system identifier of each business data can be determined. If a certain business data does not have an upstream business system or downstream business system, the upstream business system identifier or downstream business system identifier of the business data can be recorded as NONE. After completing the data labeling, the business data marked with the upstream business system identifier and the downstream business system identifier corresponding to multiple business systems can be stored in the big data platform. Among them, the big data platform can include a distributed storage architecture (such as Hbase) and a query engine (Impala).
[0201] Thus, by adding upstream and downstream system identifiers to each piece of business data and storing the data on a big data platform, the present embodiment provides the foundation for cross-system data queries. Furthermore, the present embodiment can determine the target business system included in the target data link from HBase in the big data platform and, through Impala, query the target business system for associated data associated with the initial data, thus achieving efficient cross-system data queries.
[0202] In order to better describe the entire solution, a complete introduction to the solution is given based on the above embodiments.
[0203] First, before conducting a data query, data accuracy work is performed and a query structure is constructed. This data accuracy work may include: extracting real-time online data from multiple business systems corresponding to at least one business using a data transfer tool; preprocessing the real-time online data corresponding to the multiple business systems to obtain business data corresponding to the multiple business systems; marking each business data item with an upstream business system identifier and a downstream business system identifier based on the data flow of the business data through the multiple business systems according to the business process; and storing the business data corresponding to the multiple business systems, marked with the upstream business system identifier and the downstream business system identifier, in the big data platform.
[0204] The construction of the query structure may include: based on the business data obtained from the above sorting, according to the data flow direction of the business system flowing through multiple business systems in accordance with the business process, constructing a directed acyclic graph with the business system as the node; based on the upstream and downstream relationships of the nodes in the directed acyclic graph, through the depth-first search algorithm, recursively constructing the topological sorting of the directed acyclic graph in reverse order to obtain the data link of the directed acyclic graph data structure; based on every two adjacent nodes on the data link, constructing a node unit; for each node unit, encapsulating the query interface on the node unit to obtain a query unit; encapsulating multiple query units to obtain a query box.
[0205] A schematic diagram of a data query process provided in an embodiment of the present application can be shown as follows: Figure 5 shown.
[0206] like Figure 5 As shown, the data query process can be executed collaboratively by the front-end interactive interface and the back-end processing system. The front-end interactive interface may include a target query interface for inputting query conditions into the back-end processing system. The data query process may include the following steps:
[0207] S51. In response to a first operation of a user inputting a query condition for a business to be queried in a query condition input box, the front-end interactive interface obtains the business query condition and inputs the business query condition into a target query interface, so that the back-end processing system obtains the business query condition.
[0208] S52. The backend processing system searches for initial query results that match the business query conditions from the initial business system related to the business query conditions. The initial query results include initial data, and upstream business system identifiers and downstream system identifiers of the initial data.
[0209] S53, the background processing system determines whether the initial query result is found, if not, execute S54; if so, execute S55;
[0210] S54. The backend processing system returns a message that no data is found to the front-end interactive interface, which then displays the message that no data is found.
[0211] S55, the backend processing system determines whether the initial query result is multiple, if so, executes S56; if not, executes S58;
[0212] S56. The backend processing system returns the multiple initial query results to the front-end interactive interface, and the front-end interactive interface displays the multiple initial query results;
[0213] S57, in response to a second operation of the user selecting a target initial query result from the plurality of initial query results, returning initial data in the target initial query result to the background processing system;
[0214] S58. Call the query box according to the preset query order and determine the target business system identifier from the upstream business system identifier and the downstream business system identifier of the initial data;
[0215] S59, determine whether the target business system identifier is empty, if not, execute S510, if so, execute S512;
[0216] S510: Invoke the query box to query the target business system corresponding to the target business system identifier and obtain the associated query result, which includes the associated data and the upstream business system identifier and downstream business system identifier of the associated data;
[0217] S511, taking the associated query result as the initial query result, taking the target business system as the initial business system, and returning to execute S55;
[0218] S512. The backend processing system determines the display order of the initial data and the associated data based on the business process of the business to be queried;
[0219] S513. The background processing system returns the initial data and the associated data to the front-end interactive interface in the display order, and the front-end interactive interface displays the initial data and the associated data in the display order.
[0220] Therefore, after obtaining the business query conditions, the embodiment of the present application first queries the initial business system related to the business query conditions to obtain the initial data, and then calls the query box to query the target business system that has an upstream and downstream relationship with the initial data to obtain related data. This makes it possible to query the data of the entire link through a single query.
[0221] In addition, since the query box is built based on a directed acyclic graph data structure, it can flexibly query the data of the entire link based on any system, and use any query condition of any system as the query entry to query the data of the entire link, enriching the system query conditions and improving the flexibility of data query.
[0222] In addition, since the query box is built based on the directed acyclic graph data structure, when a new business system is added, a new query node can be added to any query link. Developers only need to pay attention to the upstream and downstream systems of the current new node to meet the query needs of the entire link. They do not need to understand all the businesses of the entire link. This ensures efficient and accurate development without the need to understand the business of the entire link, and achieves multi-person development in a componentized form. Developers of the corresponding system can provide query component aggregation calls, reducing the background development business learning cost and improving the scalability and compatibility of the data query system.
[0223] In addition, in the embodiment of the present application, when querying the business system each time, if multiple data are queried, the multiple data will be returned to the front end, and the user can choose which data to continue the subsequent query based on. This can ensure that the queried data meets the user's needs, improve data query efficiency and user query experience.
[0224] In addition, the embodiment of the present application uses the front-end interactive interface design (i.e., target query interface) and structural query design (i.e., query box) so that front-end development only needs to focus on business query data and provide interactive operations for users to select data to implement complex multi-system page display logic, and realizes the clear display of upstream and downstream relationships of multiple business data on the page, achieving an all-in-one display effect, solving the hierarchical display problem of data in multiple systems and the interactive problem of how to query multiple data in a system, greatly reducing the difficulty of front-end development.
[0225] Based on the data query method provided in the above embodiment, the present application also provides a specific implementation of a data query device. Please refer to the following embodiment.
[0226] like Figure 6 As shown, the data query device 600 provided in this embodiment of the application includes the following modules:
[0227] An acquisition module 610 is configured to acquire a service query condition in response to a first operation in which a user inputs a query condition for a service to be queried;
[0228] A query module 620 is configured to query an initial query result matching the business query condition from an initial business system associated with the business query condition, wherein the initial query result includes at least initial data, and the initial business system is a business system among multiple business systems associated with the business to be queried;
[0229] a determination module 630 for determining a target data link corresponding to the initial data based on a data link in a directed acyclic graph data structure, wherein the directed acyclic graph data structure is determined based on a plurality of business systems through which business data of different businesses flow according to a business process;
[0230] The query module 620 is further configured to query associated data associated with the initial data from the target business system included in the target data link;
[0231] The display module 640 is used to display the initial data and the associated data.
[0232] The data query device 600 is described in detail below.
[0233] In some embodiments, the acquisition module 610 may also be used to acquire business data and business processes of different businesses before determining a target data link corresponding to the initial data based on the data link of the directed acyclic graph data structure;
[0234] The data query device 600 may further include:
[0235] A construction module is used to construct a directed acyclic graph for each business based on the multiple business systems through which business data flows according to the business process. The nodes in the directed acyclic graph are business systems.
[0236] The determination module 630 is further configured to determine, for each service, a data link of the directed acyclic graph data structure based on the upstream and downstream relationships of the nodes in the directed acyclic graph.
[0237] In some embodiments, the determination module 630 may specifically include:
[0238] The sorting submodule is used to construct the topological sorting of the directed acyclic graph in reverse order based on the upstream and downstream relationships of the nodes in the directed acyclic graph through a depth-first search algorithm in a recursive manner to obtain the data link of the directed acyclic graph data structure.
[0239] In some embodiments, the construction module may further be configured to: after determining a data link of the directed acyclic graph data structure, construct a node unit based on every two adjacent nodes on the data link;
[0240] The data query device 600 may further include:
[0241] The encapsulation module is used to: encapsulate the query interface on each node unit to obtain a query unit; and encapsulate multiple query units to obtain a query box.
[0242] Based on this, the query module 620 may specifically include:
[0243] The query submodule is used to call the query box to query the associated data associated with the initial data from the target business system included in the target data link.
[0244] In some embodiments, the initial query result further includes an upstream business system identifier and a downstream business system identifier of the initial data, and there are multiple target business systems.
[0245] Based on this, the query submodule can specifically include:
[0246] a determination unit, configured to determine the target business system identifier from the upstream business system identifier and the downstream business system identifier of the initial data according to a preset query order;
[0247] A query unit, configured to, when the target business system identifier is not empty, call the query box to query the target business system corresponding to the target business system identifier, and obtain a related query result, wherein the related query result includes related data, and an upstream business system identifier and a downstream business system identifier of the related data;
[0248] The execution unit is used to use the associated query result as the initial query result, the target business system as the initial business system, and return to execute according to the preset query order, determine the target business system identifier from the upstream business system identifier and the downstream business system identifier of the initial data, until the target business system identifier is empty and the target business systems in the target data link are all queried, wherein each target business system is queried once.
[0249] In some embodiments, the query unit may be specifically configured to:
[0250] Based on the target business system identifier and the system identifier of the initial business system, determining the target query unit corresponding to the target business system in the query box;
[0251] The target query unit is called to query the target business system corresponding to the target business system identifier to obtain the associated query result.
[0252] In some embodiments, the initial query result is multiple.
[0253] Based on this, the display module 640 may also be used to display a plurality of initial query results before determining a target data link corresponding to the initial data based on the data link of the directed acyclic graph data structure;
[0254] The data query device 600 may further include:
[0255] A receiving module, configured to receive a second operation of a user selecting a target initial query result from a plurality of initial query results;
[0256] The determination module 630 may also be configured to determine, in response to the second operation, that the initial data in the target initial query result is the target initial data.
[0257] Based on this, the determination module 630 may specifically include:
[0258] The determination submodule is used to determine the target data link corresponding to the target initial data based on the data link of the directed acyclic graph data structure.
[0259] In some embodiments, the acquisition module 610 may also be configured to acquire, for each initial query result, a query identifier corresponding to the business query condition, a system identifier of the initial business system, a system identifier of the target business system, and a display sequence number before displaying the plurality of initial query results;
[0260] The determination module 630 may also be configured to determine a display identifier for each initial query result based on the query identifier, the system identifier of the initial business system, the system identifier of the target business system, and the display sequence number;
[0261] The data query device 600 may further include:
[0262] The cache module is used to cache the display identifier and the corresponding initial query result for each initial query result.
[0263] Based on this, the display module 640 may specifically include:
[0264] The display submodule is used to display the initial query results corresponding to the multiple display identifiers.
[0265] Based on this, the determination module 630 may specifically include:
[0266] The determination submodule is further configured to, in response to the second operation, determine the display identifier of the target initial query result as the target display identifier;
[0267] The acquisition submodule is used to obtain the target initial data corresponding to the target display identifier from the cache.
[0268] In some embodiments, the display module 640 may specifically include:
[0269] The determination submodule is also used to determine the display order of the initial data and the associated data based on the business process of the business to be queried;
[0270] The display submodule is further used to display the initial data and associated data in a display order.
[0271] In some embodiments, the data query device 600 may further include:
[0272] a data extraction module configured to extract, in response to a first operation of a user inputting a query condition for a business to be queried, real-time online data from a plurality of business systems corresponding to at least one business based on a data transfer tool before obtaining the business query condition;
[0273] The data processing module is used to pre-process the real-time online data corresponding to the multiple business systems to obtain the business data corresponding to the multiple business systems;
[0274] A marking module is used to mark the upstream business system ID and the downstream business system ID for each business data based on the data flow direction of the business data flowing through multiple business systems according to the business process;
[0275] The storage module is used to store business data marked with upstream business system identifiers and downstream business system identifiers corresponding to multiple business systems into the big data platform.
[0276] Based on this, the query module 620 may specifically include:
[0277] The determination submodule is also used to determine the target business system included in the target data link in the big data platform;
[0278] The query submodule is also used to query the associated data associated with the initial data from the target business system.
[0279] In an embodiment of the present application, the initial business system is a business system in a plurality of business systems associated with the business to be queried. Therefore, by responding to the first operation of the query condition of the business to be queried input by the user, the business query condition is obtained, and the initial query result that matches the business query condition is searched from the initial business system related to the business query condition, it is possible to determine that the data query entry of the business to be queried is the initial business system based on the user operation, and to search for the initial query result from the initial business system. Since the initial query result includes at least initial data, and the directed acyclic graph data structure is determined based on the business data of different businesses according to the multiple business systems through which the business process flows, therefore, by determining the target data link corresponding to the initial data based on the data link of the directed acyclic graph data structure, and querying the associated data associated with the initial data from the target business system included in the target data link, that is, by starting from the initial business system, determining the target business system based on the data flow of the business data, and querying the associated data associated with the initial data from the target business system, it is possible to achieve through a single data query, that is, to query all data related to the business to be queried (including initial data and associated data), without the need for multiple queries across departments and systems, thereby improving data query efficiency.
[0280] Based on the data query method provided in the above embodiment, the embodiment of the present application also provides a specific implementation of the electronic device. Figure 7 A schematic diagram of an electronic device 700 provided in an embodiment of the present application is shown.
[0281] The electronic device 700 may include a processor 710 and a memory 720 storing computer program instructions.
[0282] Specifically, the processor 710 may include a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.
[0283] The memory 720 may include a large capacity memory for data or instructions. By way of example and not limitation, the memory 720 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive, or a combination of two or more of these. Where appropriate, the memory 720 may include removable or non-removable (or fixed) media. Where appropriate, the memory 720 may be inside or outside the electronic device 700. In a specific embodiment, the memory 720 is a non-volatile solid-state memory.
[0284] The memory may include a read-only memory (ROM), a random access memory (RAM), a magnetic disk storage medium device, an optical storage medium device, a flash memory device, an electrical, optical or other physical / tangible memory storage device. Thus, generally, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., a memory device) 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 the first aspect of the present application.
[0285] The processor 710 implements any one of the data query methods in the above embodiments by reading and executing computer program instructions stored in the memory 720 .
[0286] In one example, the electronic device 700 may further include a communication interface 730 and a bus 740. Figure 7 As shown, the processor 710 , the memory 720 , and the communication interface 730 are connected via a bus 740 and communicate with each other.
[0287] The communication interface 730 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiments of the present application.
[0288] Bus 740 comprises hardware, software or both, couples the parts of electronic equipment to each other.For example, and not limitation, bus can comprise accelerated graphics port (AGP) or other graphics bus, enhanced industry standard architecture (EISA) bus, front side bus (FSB), hypertransport (HT) interconnection, industry standard architecture (ISA) bus, infinite bandwidth interconnection, low pin count (LPC) bus, memory bus, micro channel architecture (MCA) bus, peripheral component interconnection (PCI) bus, PCI-Express (PCI-X) bus, serial advanced technology attachment (SATA) bus, video electronics standard association local (VLB) bus or other suitable bus or two or more of these combinations.In suitable cases, bus 740 can comprise one or more buses.Although the present application embodiment describes and shows specific bus, the application considers any suitable bus or interconnection.
[0289] Illustratively, the electronic device 700 may be a mobile phone, a tablet computer, a laptop computer, a PDA, an in-vehicle electronic device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (PDA).
[0290] The electronic device can execute the data query method in the embodiment of the present application, thereby realizing the combination Figures 1 to 5 Describes the data query method.
[0291] In addition, in conjunction with the data query method in the above embodiments, embodiments of the present application may provide a computer-readable storage medium for implementation. The computer-readable storage medium stores computer program instructions; when the computer program instructions are executed by a processor, any one of the data query methods in the above embodiments is implemented.
[0292] In combination with the data query method in the above embodiments, the present application can provide a computer program product to implement the data query method in the above embodiments. When the instructions in the computer program product are executed by a processor of an electronic device, any one of the data query methods in the above embodiments is implemented.
[0293] It should be understood that the present application is not limited to the specific configurations and processes described above and illustrated in the figures. For the sake of brevity, a detailed description of known methods is omitted here. In the above embodiments, several specific steps are described and illustrated as examples. However, the method process of the present application is not limited to the specific steps described and illustrated. Those skilled in the art can make various changes, modifications, and additions, or change the order of the steps after understanding the spirit of the present application.
[0294] The functional blocks shown in the above-described 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 the present application are programs or code segments that are used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link by a data signal carried in a carrier wave. "Machine-readable medium" can include any medium that can store or transmit information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROMs, flash memories, erasable ROMs (EROMs), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (RF) links, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.
[0295] It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, this application is not limited to the order of the above steps. In other words, the steps can be performed in the order mentioned in the embodiments, or in a different order, or several steps can be performed simultaneously.
[0296] Aspects of the present application have been described above with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present application. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer or other programmable data processing device to produce a machine so that these instructions executed via the processor of the computer or other programmable data processing device enable the implementation of the function / action specified in one or more boxes of the flowchart and / or block diagram. This 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 box in the block diagram and / or the flowchart and the combination of the boxes in the block diagram and / or the flowchart can also be implemented by the dedicated hardware that performs the specified function or action, or can be implemented by the combination of dedicated hardware and computer instructions.
[0297] The above description is only a specific embodiment of the present application. Those skilled in the art will clearly understand that for the convenience and brevity of description, the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. It should be understood that the scope of protection of the present application is not limited thereto. Any person skilled in the art can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the scope of protection of the present application.
Claims
1. A data query method, characterized in that: include: In response to a first operation in which a user inputs a query condition for a service to be queried, obtaining the service query condition; Querying an initial query result matching the business query condition from an initial business system associated with the business query condition, wherein the initial query result includes at least initial data, and the initial business system is a business system among multiple business systems associated with the business to be queried; Determining a target data link corresponding to the initial data based on a data link of a directed acyclic graph data structure, wherein the directed acyclic graph data structure is determined based on a plurality of business systems through which business data of different businesses flow according to a business process; querying associated data associated with the initial data from a target business system included in the target data link; The initial data and the associated data are displayed.
2. The method according to claim 1, characterized in that Before determining the target data link corresponding to the initial data based on the data link of the directed acyclic graph data structure, the method further includes: Obtain business data and business processes for different businesses; For each of the businesses, a directed acyclic graph is constructed based on the multiple business systems through which the business data flows according to the business process, where the nodes in the directed acyclic graph are the business systems; For each of the services, a data link of the directed acyclic graph data structure is determined based on an upstream and downstream relationship between nodes in the directed acyclic graph.
3. The method according to claim 2, characterized in that The step of determining a data link of the directed acyclic graph data structure based on an upstream and downstream relationship between nodes in the directed acyclic graph comprises: Based on the upstream and downstream relationships of the nodes in the directed acyclic graph, a topological sorting of the directed acyclic graph is recursively constructed in reverse order through a depth-first search algorithm to obtain a data link of the directed acyclic graph data structure.
4. The method according to claim 2, characterized in that After determining the data link of the directed acyclic graph data structure, the method further includes: Constructing a node unit based on every two adjacent nodes on the data link; For each of the node units, encapsulate a query interface on the node unit to obtain a query unit; Encapsulating a plurality of the query units to obtain a query box; The querying of associated data associated with the initial data from the target business system included in the target data link includes: The query box is called to query associated data associated with the initial data from the target business system included in the target data link.
5. The method according to claim 4, characterized in that The initial query result also includes an upstream business system identifier and a downstream business system identifier of the initial data, and the target business system is multiple; calling the query box to query associated data associated with the initial data from the target business system included in the target data link includes: Determine the target business system identifier from the upstream business system identifier and the downstream business system identifier of the initial data according to a preset query order; If the target business system identifier is not empty, calling the query box to query the target business system corresponding to the target business system identifier to obtain a correlation query result, the correlation query result including the correlation data, and the upstream business system identifier and downstream business system identifier of the correlation data; The associated query result is used as the initial query result, the target business system is used as the initial business system, and the preset query order is returned to determine the target business system identifier from the upstream business system identifier and the downstream business system identifier of the initial data until the target business system identifier is empty and the query of the target business systems in the target data link is completed, wherein each target business system is queried once.
6. The method according to claim 5, characterized in that The calling of the query box to query the target business system corresponding to the target business system identifier and obtain the associated query result includes: Determining a target query unit corresponding to the target business system in the query box based on the target business system identifier and the system identifier of the initial business system; The target query unit is called to query the target business system corresponding to the target business system identifier to obtain a related query result.
7. The method according to any one of claims 1 to 6, characterized in that The initial query results are multiple, and before determining the target data link corresponding to the initial data based on the data link of the directed acyclic graph data structure, the method further includes: displaying a plurality of the initial query results; receiving a second operation of the user selecting a target initial query result from the plurality of initial query results; In response to the second operation, determining the initial data in the target initial query result as target initial data; The data link based on the directed acyclic graph data structure determines the target data link corresponding to the initial data, comprising: Based on the data links of the directed acyclic graph data structure, a target data link corresponding to the target initial data is determined.
8. The method according to claim 7, characterized in that Before displaying the plurality of initial query results, the method further includes: For each of the initial query results, obtaining the query identifier corresponding to the business query condition, the system identifier of the initial business system, the system identifier of the target business system, and a display sequence number; For each of the initial query results, determining a display identifier based on the query identifier, the system identifier of the initial business system, the system identifier of the target business system, and the display sequence number; For each initial query result, caching the display identifier and its corresponding initial query result; Displaying a plurality of the initial query results, including: displaying initial query results corresponding to the plurality of display identifiers respectively; In response to the second operation, determining the initial data in the target initial query result as target initial data includes: In response to the second operation, determining the display identifier of the target initial query result as a target display identifier; The target initial data corresponding to the target display identifier is obtained from the cache.
9. The method according to any one of claims 1 to 6, characterized in that The displaying of the initial data and the associated data includes: Determining a display order of the initial data and the associated data based on a business process of the business to be queried; The initial data and the associated data are displayed in the display order.
10. The method according to any one of claims 1 to 6, characterized in that In response to the first operation of the user inputting a query condition for a service to be queried, before obtaining the service query condition, the method further includes: Extracting real-time online data from the plurality of business systems corresponding to at least one business based on a data transfer tool; Performing data preprocessing on the real-time online data corresponding to the plurality of business systems to obtain the business data corresponding to the plurality of business systems; Based on the data flow direction of the business data flowing through the plurality of business systems according to the business process, marking each of the business data with an upstream business system identifier and a downstream business system identifier; Storing the business data marked with upstream business system identifiers and downstream business system identifiers respectively corresponding to the plurality of business systems into the big data platform; The querying of associated data associated with the initial data from the target business system included in the target data link includes: Determining a target business system included in the target data link in the big data platform; Query the target business system for associated data associated with the initial data.
11. A data query device, characterized in that: The device comprises: An acquisition module, configured to acquire a service query condition in response to a first operation in which a user inputs a query condition for a service to be queried; a query module, configured to query an initial query result matching the business query condition from an initial business system associated with the business query condition, wherein the initial query result includes at least initial data, and the initial business system is a business system among multiple business systems associated with the business to be queried; a determination module, configured to determine a target data link corresponding to the initial data based on a data link of a directed acyclic graph data structure, wherein the directed acyclic graph data structure is determined based on a plurality of business systems through which business data of different businesses flow according to a business process; The query module is further configured to query associated data associated with the initial data from a target business system included in the target data link; A display module is used to display the initial data and the associated data.
12. An electronic device, characterized in that: The electronic device includes: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, the data query method according to any one of claims 1 to 10 is implemented.
13. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer program instructions, and when the computer program instructions are executed by a processor, the data query method according to any one of claims 1 to 10 is implemented.
14. A computer program product, characterized in that When the instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes the data query method according to any one of claims 1 to 10.