A data processing method and system
By extracting and cutting off multiple paths in the data flow graph and storing them in a distributed manner, it solves the problems of low query efficiency and high storage pressure caused by the growth of data flow information, and achieves efficient query and analysis.
Patent Information
- Application Number
- CN202210766110.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-07-22
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2041-07-22
AI Technical Summary
With the increase of data flow information, existing technology is difficult to efficiently record and utilize this data, resulting in low query efficiency and high storage pressure, making it impossible to effectively analyze and make decisions.
By obtaining the data flow diagram, multiple flow paths are extracted, and the destination sub-path and source sub-path are truncated and stored in a distributed manner to improve query efficiency and flexibility.
It achieves efficient query and storage of massive data flow information, reduces data storage pressure, and improves the convenience of analysis and decision-making.
Smart Images

Figure CN115080622B
Abstract
Description
[0001] Divisional application
[0002] This application is a divisional application of a patent with an application date of July 22, 2021, application number 202110834327.9, and invention name “A data processing method and system”. Technical Field
[0003] The present invention relates to the field of information technology, and in particular to a data processing method and system. Background Art
[0004] In daily life and production, data flow scenarios often occur, such as funds flowing between different accounts, goods being transported between different warehouses, and users traveling between different locations. As data flows, it will generate flow tracks and information. These data hide a lot of valuable information, such as user preferences, behavioral habits, intentions, etc. Recording these data can facilitate subsequent analysis, decision-making, and other further use, creating more convenience or value for production and life.
[0005] But as time goes by, more and more data is generated, and how to record this data and make it available for efficient use becomes a problem that needs to be solved. Summary of the invention
[0006] One aspect of an embodiment of the present specification provides a data processing method. The method includes: obtaining a data flow graph; the data flow graph includes nodes and edges, wherein data flows between nodes, and the edges between nodes reflect the flow direction of data between nodes; obtaining the flow path of the same data from the starting node to the ending node from the data flow graph, and then obtaining multiple flow paths corresponding to different data; at least multiple flow paths are cut multiple times from the starting node to the ending node respectively, to obtain multiple destination sub-paths; at least multiple flow paths are cut multiple times from the ending node to the starting node respectively, to obtain multiple source sub-paths; the multiple flow paths, multiple destination sub-paths and multiple source sub-paths are distributed and stored on multiple storage devices for query.
[0007] Another aspect of the embodiments of the present specification provides a data processing system. The system includes: a data flow graph acquisition module, used to acquire a data flow graph; the data flow graph includes nodes and edges, wherein the nodes have data flow, and the edges between the nodes reflect the flow direction of the data between the nodes; a flow path acquisition module, used to acquire the flow path of the same data from the starting node to the ending node from the data flow graph, and then obtain multiple flow paths corresponding to different data; a destination path truncation module, used to at least truncate multiple flow paths from the starting node to the ending node multiple times, and obtain multiple destination sub-paths; a source path truncation module, used to at least truncate multiple flow paths from the ending node to the starting node multiple times, and obtain multiple source sub-paths; a path storage module, used to store the multiple flow paths, multiple destination sub-paths, and multiple source sub-paths in a distributed manner on multiple storage devices for query.
[0008] Another aspect of the embodiments of this specification provides a data query method. The method includes: obtaining a query request; wherein the query request includes a path matching condition, and the path matching condition describes multiple nodes in the path to be queried and the data flow relationship between them; based on the query request, obtaining one or more candidate paths from the data flow paths and / or sub-paths in one or more storage devices respectively; wherein the data flow paths and / or sub-paths in one or more storage devices are obtained by processing as the above-mentioned data processing method; and summarizing the one or more candidate paths to obtain the path to be queried.
[0009] Another aspect of the embodiments of this specification provides a data query system. The system includes: a query request acquisition module, used to acquire a query request; wherein the query request includes a path matching condition, and the path matching condition describes multiple nodes in the path to be queried and the data flow relationship between them; a path acquisition module, used to acquire one or more candidate paths from the data flow paths and / or sub-paths in one or more storage devices based on the query request; wherein the data flow paths and / or sub-paths in one or more storage devices are obtained by processing as described above in the data processing method; a path processing module, used to aggregate and process the one or more candidate paths to obtain the path to be queried.
[0010] Another aspect of an embodiment of the present specification provides a data processing device including at least one storage medium and at least one processor, wherein the at least one storage medium is used to store computer instructions; and the at least one processor is used to execute the computer instructions to implement a data processing method.
[0011] Another aspect of the embodiments of this specification provides a computer-readable storage medium, wherein the storage medium stores computer instructions. When a computer reads the computer instructions in the storage medium, the computer executes a data processing method.
[0012] Another aspect of an embodiment of the present specification provides a data processing device including at least one storage medium and at least one processor, wherein the at least one storage medium is used to store computer instructions; and the at least one processor is used to execute the computer instructions to implement a data query method.
[0013] Another aspect of the embodiments of this specification provides a computer-readable storage medium, wherein the storage medium stores computer instructions. When a computer reads the computer instructions in the storage medium, the computer executes a data query method. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] This specification will be further described in the form of exemplary embodiments, which will be described in detail by the accompanying drawings. These embodiments are not restrictive, and in these embodiments, the same number represents the same structure, wherein:
[0015] Figure 1 is an exemplary schematic diagram of a data flow diagram according to some embodiments of this specification;
[0016] Figure 2 is an exemplary flow chart of a data processing method according to some embodiments of this specification;
[0017] Figure 3 is an exemplary schematic diagram of obtaining multiple flow paths according to some embodiments of this specification;
[0018] Figure 4 is an exemplary schematic diagram of truncation according to some embodiments of this specification;
[0019] Figure 5 is an exemplary schematic diagram of source truncation according to some embodiments of the present specification;
[0020] Figure 6 is an exemplary schematic diagram of similar path merging according to some embodiments of this specification;
[0021] Figure 7 is an exemplary schematic diagram of distributed storage according to time partitions according to some embodiments of this specification;
[0022] Figure 8 is an exemplary schematic diagram of an update flow path according to some embodiments of this specification;
[0023] Fig. 9is an exemplary flow chart of a data query method according to some embodiments of this specification;
[0024] Fig.10 is an exemplary module diagram of a data processing system according to some embodiments of this specification;
[0025] Fig.11 It is an exemplary module diagram of a data query system according to some embodiments of this specification. DETAILED DESCRIPTION
[0026] In order to more clearly illustrate the technical solutions of the embodiments of this specification, the following is a brief introduction to the drawings required for the description of the embodiments. Obviously, the drawings described below are only some examples or embodiments of this specification. For ordinary technicians in this field, this specification can also be applied to other similar scenarios based on these drawings without creative work. Unless it is obvious from the language environment or otherwise explained, the same reference numerals in the figures represent the same structure or operation.
[0027] It should be understood that the "system", "device", "unit" and / or "module" used herein are a method for distinguishing different components, elements, parts, portions or assemblies at different levels. However, if other words can achieve the same purpose, the words can be replaced by other expressions.
[0028] As shown in this specification and claims, unless the context clearly indicates an exception, the words "a", "an", "an" and / or "the" do not refer to the singular and may also include the plural. Generally speaking, the terms "comprise" and "include" only indicate the inclusion of the steps and elements that have been clearly identified, and these steps and elements do not constitute an exclusive list. The method or device may also include other steps or elements.
[0029] Flowcharts are used in this specification to illustrate the operations performed by the system according to the embodiments of this specification. It should be understood that the preceding or following operations are not necessarily performed precisely in order. Instead, the steps may be processed in reverse order or simultaneously. At the same time, other operations may also be added to these processes, or one or more operations may be removed from these processes.
[0030] In daily life and production, data flow scenarios often occur, such as funds flowing between different fund accounts, goods being transported between different warehouses, and users traveling between different locations. These scenarios will generate a large amount of data flow data, which contains rich and valuable information.
[0031] Take funds as an example. Funds can be transferred between users and enterprises, or between enterprises in certain ways. The transfer of funds can also be called the circulation of funds.
[0032] By analyzing the fund flow data, we can know the intention of users or enterprises to transfer funds and promptly discover illegal behaviors, such as collecting funds through unreasonable means or using funds in abnormal channels. Therefore, by analyzing the fund flow information, for example, each fund in the fund flow process, where it comes from (recharge, transfer, etc.), where it passes through, how long it takes and where it finally flows to, we can know the destination of the funds, whether the way the funds are used is illegal, where the funds staying in a certain fund account come from, and whether the source of these funds is normal.
[0033] As time goes by, more and more information is circulated, which leads to an increase in the volume of the graph. Therefore, it is necessary to propose a data processing method to reduce the pressure of data storage and improve the speed of data query during subsequent analysis; other embodiments of this specification propose a data query method to improve the speed and flexibility of data query. It should be noted that the above examples of capital flow are for illustrative purposes only and are not intended to limit the application scenarios of the technical solutions disclosed in this specification. For example, it can also be used to analyze phone charges, traffic, cargo transportation, personnel flow, vehicle flow, etc. The technical solution disclosed in this specification is explained in detail below through the description of the accompanying drawings.
[0034] Figure 1 It is an exemplary schematic diagram of a data flow diagram shown in some embodiments of this specification.
[0035] In some embodiments, data flow can be represented by a data flow diagram. Figure 1 As shown, the data flow graph 100 may include nodes 110 and edges 120 .
[0036] There is data flow between nodes 110. In some embodiments, node 110 may correspond to an account (such as a bank account capable of storing funds, an application account, etc.), a location, a warehouse, etc. Data may be an abstract reference to relevant information of people or things that flow between different nodes. Exemplarily, data may be information related to funds, phone charges, traffic, people, goods, vehicles, etc. In some embodiments, data flow diagram 100 may be used to represent the flow of funds, phone charges, traffic, etc. between nodes, for example, which node the data comes from and which node it goes to. In some embodiments, data flow diagram 100 may also be used to represent the movement trajectory of an individual or vehicle, for example, where the person or vehicle comes from and where it goes.
[0037] Edge 120 can be used to indicate the direction of data flow between nodes 110. Edge 120 can be a directed edge, pointing from one node to another. In some embodiments, edge 120 can also represent the data flow scenario between nodes 110. For example, the way data flows, etc. For example, when the data is funds, phone bills, traffic, etc., the data can flow from node A to node I, and ABCDEFI can represent the path through which the data flows. In the flow path, data can flow to node I in a variety of ways, where node A can be user A's bank account, node B can be user A's application account, node C can be user B's bank account, and so on. The edge can represent the direction of object flow and scene information such as transfer, recharge, and consumption. For example, the AB edge can represent the transfer of 10 yuan from node A to node B by transfer on January 1, 2021, and the BC edge can represent the recharge of 10 yuan from node B to node C by recharge on January 2, 2021. ABCDEFI indicates that the amount of 10 yuan at node A passes through nodes B, C, D, E, and F through the corresponding flow scenario, and finally flows into node I. For another example, a node can represent a location, and an edge can represent the direction and mode of movement of people and vehicles. For example, the path ABCDEFI can indicate the time when a user moved from node A to node I by which means (for example, walking, cycling, taking a taxi, or taking public transportation), and can also indicate the time when a vehicle moved from node A to location I by which nodes it passed.
[0038] In some embodiments, it is necessary to obtain relevant information from the data flow graph based on preset query conditions (or query requests). For example, the path matching conditions in the query request include "AB", that is, it is necessary to obtain all flow paths containing sub-paths from node A to node B from the data flow graph. It is necessary to traverse the entire graph to obtain all flow paths that meet the aforementioned path matching conditions. This method requires traversing the nodes and edges of the entire graph, which has low query efficiency and occupies more computing resources. To this end, in some embodiments of the present specification, a data processing method is proposed, which can disassemble or merge and store the data of the data flow graph to improve query efficiency and save query time.
[0039] Figure 2 is an exemplary flow chart of a data processing method according to some embodiments of the present specification. In some embodiments, process 200 may be executed by a processing device (such as a server or a load balancing device in a distributed device cluster). For example, process 200 may be stored in a storage device (such as a built-in storage unit of a processing device or an external storage device) in the form of a program or instruction, and the program or instruction may implement process 200 when executed. Process 200 may include the following operations.
[0040] Step 202 , obtaining a data flow graph. In some embodiments, step 202 may be performed by the data flow graph obtaining module 1010 .
[0041] Data can be an abstract reference to information about certain things, such as money, phone bills, traffic, people, vehicles, etc.
[0042] The data flow graph is a data structure that reflects the flow information of data between nodes. For different data, the nodes may be different. For example, when the data is information related to funds, phone charges, and traffic, the node may be an account that can store / accommodate funds, traffic, and phone charges (which may include type and account number, such as 2088 balance, 139xxxxxxxx mobile phone account, 1399 application balance, etc.), a bank account (for example, 2088xx bank debit card, 2072yy bank credit card), etc.; when the data is information related to a person or vehicle (such as identity identification or license plate information, etc.), the node may be a space such as a building or location. The edge may indicate the direction in which data is transferred from one node to another. For example, funds are transferred from a 2088xx bank debit card to a 2072yy bank credit card; for another example, user XX goes from Beijing Railway Station to a certain community.
[0043] In some embodiments, the edges between nodes can also represent the scenarios of data flow between nodes. The scenario refers to the situation when data flows between nodes. For example, funds are transferred from 2088xx bank debit card to 2072yy bank credit card by transfer on January 1, 2021. The time and transfer can be considered as the scenario of data flow between nodes. In some embodiments, the scenario can also include recharge, consumption, red envelopes, etc.
[0044] In some embodiments, the processing device may obtain the data flow graph by reading from a storage device or a database, calling a data interface, or constructing a data flow graph based on nodes and edges.
[0045] It should be noted that in the following text of this specification, in order to explain the technical solution disclosed in this specification more clearly and concisely, data related to funds is mainly used as an example for description, but it should be understood that the technical solution disclosed in this specification can also be applied to other scenarios.
[0046] Step 204 , obtaining the flow path of the same data from the starting node to the ending node from the data flow graph, thereby obtaining multiple flow paths corresponding to different data. In some embodiments, step 204 may be performed by the flow path acquisition module 1020 .
[0047] The flow path refers to the path formed by the nodes and edges connecting these nodes that a certain amount of funds passes through when it flows in the data flow graph. Figure 1 As shown, it includes multiple circulation paths, for example, ABCDEFI, ABCDEFX, KLDEFH, etc.
[0048] The starting node can refer to the first node of a certain amount of funds in the data flow graph, or the first time that funds outside the data flow graph enter the graph through its starting node. For example, there is a node in the data flow graph that has no incoming edges but has outgoing edges. For example, Figure 1 In some embodiments, even a node with an incoming edge can be the starting node of a certain amount of funds. For example, if the L node receives a sum of 50 yuan of funds from the K node, and at the same time, a sum of 30 yuan of funds flows in from outside the graph, then the L node can be regarded as the starting node of the fund data of 30 yuan.
[0049] The end node can refer to the last node of a certain fund in the data flow graph, or the end node where the fund finally stops. For example, there is a node in the data flow graph that has an incoming edge but no outgoing edge. For example, Figure 1 In some embodiments, even if there is a node with an outgoing edge, it can also be the starting node of a certain amount of funds. For example, after G node receives a sum of 30 yuan of funds from F node, it transfers 10 yuan to J node, and the remaining 20 yuan remains in J node. At this time, J node can be considered as the termination node of the fund data of 20 yuan. It can be understood that the circulation path is related to the data. In some embodiments, the circulation path of the same data can be obtained while determining its circulation path.
[0050] In some embodiments, each flow data may have a unique identity, and then the same flow data may be quickly and conveniently determined based on the identity; such as a user with a user number, a vehicle with a license plate number, etc. However, for fund data, especially fund data in the form of digital currency, different fund data do not have a clear identity, and there may be a relationship of inclusion or splitting between different fund data. For example, after node A receives 500 yuan of funds from node B, 200 yuan is transferred to node C, 150 yuan is transferred to node E, and 150 yuan remains at node A. Here, it can be regarded as there are 4 fund data, namely, 500 yuan of funds transferred in, 200 yuan of funds transferred to node C, 150 yuan of funds transferred to node E, and the remaining 150 yuan of funds. Among them, 200 yuan of funds are included in the 500 yuan fund data, or are split from the 500 yuan fund data. It can be considered that the input edge of B to A transfer 500 yuan and the output edge of A to C transfer 200 yuan involve the same fund data 200 yuan. Therefore, a practical method is needed to find the same fund data in the data flow diagram.
[0051] In some embodiments, the same data in the inflow data and outflow data of the node can be determined first. For example, the part of the inflow fund data and the outflow fund data of the same node that meets the preset conditions is determined as the same data. The preset conditions may include last in, first out, and equal amounts. Last in, first out can be the funds flowing into the node, and the funds that flow in later have priority to flow out in chronological order, that is, it can be considered that in the same node, the funds data b that flows out first after the funds data a flows in contains the same funds data; equal amounts can be when funds flow out of the node, the funds that have the same amount when they flow in and out of the node are prioritized to flow out, that is, it is considered that in the same node, the equal amount of inflow funds and the outflow funds that flow out of the node later are the same data. In some embodiments, the same data in the inflow funds and outflow funds in the same node can be determined based on the last in, first out principle and further combined with the equal amount principle to determine.
[0052] In some embodiments, after the same data in the node is determined, the next node of the data flow path can be determined based on the intersection of the same data between the nodes, so that a flow path can be determined. Therefore, it is not difficult to understand that the data of the flow path is the intersection of the same data of each node on the flow path.
[0053] For ease of understanding, combined Figure 1The same data and the flow path are explained. For example, a fund data of 100 yuan enters the data flow diagram from the D node, and then 50 yuan of it is transferred to the E node, the E node transfers 20 yuan to the F node, and the E node transfers 30 yuan to the Q node, and then the F node transfers 10 yuan to the G node, and finally the 10 yuan stays at the G node. Then for the E node, the 50 yuan transferred from the D node includes the 30 yuan transferred to the Q node, so the flow path of the fund data of 30 yuan is DEQ, and for this flow path, the intersection of the same data of each node is 30 yuan. Similarly, for the E node, the 50 yuan transferred from the D node includes the 20 yuan transferred to the F node. For the F node, the 10 yuan part of the 20 yuan transferred from E and the 10 yuan transferred from E to G are the same data, so there is a flow path DEFG, and its data is the intersection of the same data of each node - 10 yuan.
[0054] In some implementations, the processing device can extract the nodes in the flow graph that are the intersection of the same data and the edges connecting these nodes based on one or more identical data, one or more starting nodes, and one or more ending nodes in the data flow graph, to obtain multiple flow paths corresponding to different data.
[0055] See also Figure 3 , Figure 3 is an exemplary schematic diagram of obtaining multiple flow paths according to some embodiments of this specification. Figure 3 In the figure, 310 represents a simple data flow graph, and 320 represents multiple flow paths obtained from the data flow graph 310.
[0056] Let's assume that node A has 50 yuan in funds, and node A transfers 30 yuan, 15 yuan, and 5 yuan to node B at different times. For node B, 30 yuan, 15 yuan, and 5 yuan are each a piece of data, that is, there are three data in total. Node B then flows these data into node C at different times, and finally into node F. After that, node F transfers 30 yuan to node I, 15 yuan to node X, and 5 yuan to node H. Therefore, three flow paths can be obtained, namely flow path 321 from node A to node I, flow path 322 from node A to node X, and flow path 323 from node A to node H, corresponding to data of 30 yuan, 15 yuan, and 5 yuan respectively. Combined with Figure 3 It is easy to see that in the above three flow paths, node A is the starting node, and nodes I, X, and H are the ending nodes. It can be considered that the flow path is the complete path of a sum of capital data from entering the flow graph to finally staying. It is understandable that the data flow graph can be expanded with time, and a deadline can be given when discussing the flow path, so the flow path can be the complete path of a sum of capital data from entering the flow graph to staying at the deadline.
[0057] Step 206 , at least perform multiple truncation of the multiple flow paths from the start node to the end node to obtain multiple outgoing sub-paths. In some embodiments, step 206 may be performed by the outgoing path truncation module 1030 .
[0058] Truncation refers to cutting off a part of the flow path and discarding it. A subpath refers to a path obtained by truncating the flow path, in which the number of nodes and edges is less than that of the original flow path.
[0059] The destination subpath refers to the subpath obtained by cutting from the starting node of the flow path to the ending node. The destination subpath can be used to represent the subpath where the funds in the flow path go from any node other than the ending node to the ending node of the flow path. For example, see Figure 4 , Figure 4 In Figure 400, assuming that path 410 is a flow path that needs to be truncated, the path ABCDEFI indicates that a certain amount of fund data starts from node A, flows between multiple nodes, and finally stays at node I.
[0060] For each flow path, the processing device may sequentially cut off and discard the front part of each node from the next node of the start node to the previous node of the end node in the flow path to obtain multiple initial destination sub-paths. Figure 4 , first, the front of each node (including B, C, D, E, F nodes) from the next node (B node) of the A node (starting node) to the previous node (F node) of the ending node (I node) is cut off and discarded in turn, and each time it is cut off and discarded, an initial destination sub-path can be obtained. For example, by cutting off the nodes in the above example, initial destination sub-path 411, initial destination sub-path 412, initial destination sub-path 413, initial destination sub-path 414 and initial destination sub-path 415 can be obtained. By cutting off multiple flow paths respectively in the described manner, multiple initial destination sub-paths of multiple flow paths can be obtained.
[0061] In some embodiments, the processing device may directly use the initial destination sub-path as the destination sub-path.
[0062] In some embodiments, the processing device may merge similar destination sub-paths in multiple initial destination sub-paths of multiple flow paths to obtain the multiple destination sub-paths. For example, for some analysis scenarios, the initial destination sub-paths in the minimum analysis time span or time period (such as one day, one week, or one month, etc.) may be merged to effectively reduce the storage space of the path while meeting the analysis time granularity requirements.
[0063] A similar destination sub-path refers to a path that has at least the same nodes and edges that reflect the same flow direction. That is, the nodes of the similar destination sub-paths are the same and the directions of the edges between the nodes (including the order between the nodes) are the same. In some embodiments, the data of similar destination sub-paths may be the same or different. For example, the difference between multiple similar destination sub-paths may be that the amount of funds is different or the time when the transaction is generated is different. In some embodiments, similar destination sub-paths also require the same scenario, for example, the method of fund transaction is the same (for example, all are transfers, recharges), etc. For example, assuming that multiple similar destination sub-paths can be represented as EFI, in multiple similar destination sub-paths, in addition to the same nodes and edges, the scenarios of the paths must also be the same, for example, the scenario between EF is transfers, and the scenario between FI is recharges. Then in similar destination sub-paths, EF needs to be a transfer and FI needs to be a recharge.
[0064] The merging includes union or summing the data corresponding to similar destination sub-paths. Union may refer to using the data of different similar destination sub-paths as the data of the merged destination sub-path at the same time. For example, when the data is information related to a person or a vehicle, the identity identifiers of the person or vehicle may be unioned, and the data of the destination sub-path obtained by the union is information related to multiple persons or multiple vehicles. Summing refers to summing the data of different similar sub-paths. For example, the data corresponding to multiple similar destination sub-paths are 30 yuan, 20 yuan, and 10 yuan respectively, then the data of the merged destination sub-path is 30+20+10=60 yuan.
[0065] In some embodiments, when the data is funds, a union can also be obtained. For example, assuming there are three similar destination sub-paths FI (similar destination sub-paths can be obtained by truncating different circulation paths), and the data of the three similar destination sub-paths are 30 yuan, 20 yuan, and 10 yuan respectively, then the union can refer to the data of the merged destination sub-paths as "30 yuan, 20 yuan, and 10 yuan". In some embodiments, the destination sub-path obtained by the union can also retain the transaction scenario of the data, such as the transaction method, etc. In this case, the data of the merged destination sub-path can be "transfer of 30 yuan on January 1, 2021, recharge of 20 yuan on January 2, 2021, and consumption of 10 yuan on January 3, 2021".
[0066] See also Figure 6 , Figure 6 FIG. 1 is an exemplary schematic diagram of similar path merging according to some embodiments of this specification. Figure 6 As shown, in the diagram 600, subpath 610, subpath 620 and subpath 630 are similar subpaths. It can be understood that the similar path can represent the initial destination subpath. The data of subpath 610 is the amount of 10 yuan, the data of subpath 620 is the amount of 20 yuan, and the data of subpath 630 is the amount of 30 yuan. After merging them, the destination subpath 640 can be obtained, and the data of the path is the amount of 60 yuan.
[0067] It is not difficult to understand that the merged destination sub-path has the same nodes and edges reflecting the same flow path as the original initial destination sub-path, and the data of the merged destination sub-path can be the union or sum of the data of the original initial destination sub-path.
[0068] It should be noted that, in the sub-path obtained by truncation, the first node can be called the head node, and the head node may be the starting node (as defined in the relevant description of step 204) or may not be the starting node. For example, the head nodes in the destination sub-path are not the starting nodes, and the head nodes in the source sub-path are all starting nodes. Similarly, in the sub-path obtained by truncation, the last node can be called the tail node, and the tail node may be the termination node (as defined in the relevant description of step 204) or may not be the termination node. For example, the tail nodes in the destination sub-path are all termination nodes, and the tail nodes in the source sub-path are not termination nodes. In the above example, the circulation path 410 can be used to query or analyze the destination of the funds of the A node. In the destination sub-path obtained by truncating the circulation path, the head node correspondingly becomes the other nodes that the funds of the A node pass through during the circulation, such as, the B node, the C node, etc., and the corresponding destination sub-path can be used to represent the destination of the funds of other nodes in the path. For example, the destination sub-path 411 can be used to represent the destination of the funds of the B node, and the destination sub-path 412 can be used to represent the destination of the funds of the C node. Therefore, when you need to analyze all the paths from node B through node C to node I, you can first select the initial candidate path with the head node as node B from each flow path and its destination sub-path, and then select the candidate path passing through node C from the initial candidate path as the query result. Compared with traversing the entire graph, this can greatly improve the query efficiency.
[0069] Step 208 , at least perform multiple truncation of the multiple flow paths from the end node to the start node multiple times to obtain multiple source sub-paths. In some embodiments, step 208 may be performed by the source path truncation module 1040 .
[0070] The source subpath refers to the subpath obtained by cutting from the end node of the flow path to the start node. The source subpath can be used to represent the subpath where any node other than the start node in the flow path receives funds from the start node of the flow path. For example, see Figure 5 , Figure 5 It is an exemplary schematic diagram of source truncation shown in some embodiments of the present specification. In Figure 500, assuming that path 510 is a circulation path that needs to be truncate, the path ABCDEFI indicates that the funds of node I enter from node A, pass through multiple nodes, and finally stay. It can be understood that this circulation path can also be used to represent the source of funds of each node after the starting node of the circulation path. For example, by looking at the circulation path 510 and each source sub-path obtained by truncation, it can be easily known that the source of funds of each node after the starting node in the path (B, C, D, E, F, I node) is the starting node A. For each circulation path, the processing device can sequentially truncate and discard the rear part of each node from the previous node of the terminating node to the next node of the starting node in the circulation path to obtain multiple initial source sub-paths. For example, see Figure 5 , first, the rear part of each node (including B, C, D, E, F nodes) from the previous node (F node) of the I node (termination node) to the next node (B node) of the starting node (A node) is truncated and discarded in sequence, and each truncation and discarding can obtain an initial source subpath. For example, according to the nodes in the above example, the initial source subpath 511, the initial source subpath 512, the initial source subpath 513, the initial source subpath 514 and the initial source subpath 515 can be obtained. By truncating multiple flow paths respectively in the described manner, multiple initial source subpaths of multiple flow paths can be obtained.
[0071] In some embodiments, the processing device may directly use the initial source subpath as the source subpath. In some embodiments, the processing device may merge similar destination subpaths in multiple initial source subpaths of multiple flow paths to obtain the multiple source subpaths. Similar source subpaths have at least the same nodes and edges reflecting the same flow direction, and the merging includes obtaining the union or sum of the data corresponding to the similar source subpaths.
[0072] For more details about similar source sub-paths and merging of similar source sub-paths, please refer to the relevant description of similar destination sub-paths in step 206 above. Their similar conditions and merging methods are similar and can be referenced to each other, so they will not be repeated here.
[0073] In this embodiment, the flow path is truncated and split in the above manner, which not only has high efficiency in path splitting, but also can quickly and accurately query the destination or source of funds of multiple nodes, which not only improves query efficiency but also makes the query more flexible. In addition, by merging similar sub-paths obtained by splitting, the amount of data can be effectively reduced, reducing the pressure on data storage.
[0074] Step 210 , the plurality of flow paths, the plurality of destination sub-paths and the plurality of source sub-paths are distributedly stored on a plurality of storage devices for query. In some embodiments, step 210 may be performed by the path storage module 1050 .
[0075] In some embodiments, the processing device may store the multiple flow paths obtained from the data flow graph and the multiple destination sub-paths and multiple source sub-paths obtained after truncation on multiple storage devices in a distributed manner according to preset storage rules.
[0076] The preset storage rule may be to partition the storage space of multiple storage devices, and store the multiple flow paths, multiple destination sub-paths, and multiple source sub-paths in the corresponding intervals. In some embodiments, the processing device may partition the storage space of multiple storage devices according to time partitioning, target classification partitioning, target population partitioning, etc. Time partitioning may refer to partitioning the storage space according to time spans, for example, partitioning by hours, days, weeks, etc., and one time period corresponds to one partition. Target classification partitioning may be partitioning according to the category of data corresponding to the path, for example, dividing funds into large funds, medium funds, and small funds, which correspond to different partitions respectively. Target population partitioning may be partitioning according to the gender of a person, for example, one partition for males and one partition for females. It should be understood that partitions on a storage device may refer to physical partitions on a storage medium, such as data of the same partition is stored in the same storage page in a storage medium; partitions of a storage device may also refer to logical partitions, such as data of the same partition logically belongs to the same partition, but is not necessarily stored in the same physical partition of the storage medium when actually stored.
[0077] See also Figure 7 , Figure 7 This is an exemplary schematic diagram of distributed storage according to time partitions as shown in some embodiments of this specification. In Figure 700, taking partitioning by day as an example, each storage device can have multiple time partitions, such as partition 710, partition 720, partition 730, partition 740, etc. T represents the time of a certain day, then partition 710 can be the partition corresponding to T-1, partition 720 can be the partition corresponding to T, partition 730 can be the partition corresponding to T+1, and partition 740 can be the time partition of T+2, ...
[0078] When the processing device stores the multiple flow paths, multiple destination sub-paths and multiple source sub-paths in a distributed manner on multiple storage devices, it can divide the aforementioned paths (including flow paths and various sub-paths) based on the truncation method of the flow paths and time partitions, and then store the results of the division in the corresponding time partitions of the multiple storage devices respectively. For example, for destination truncation, the multiple flow paths and the multiple destination sub-paths are stored together according to the division results; for source truncation, the multiple flow paths and the multiple source sub-paths are stored together according to the storage division results.
[0079] In some embodiments, when storing multiple circulation paths and multiple destination sub-paths based on time partitions, the paths whose times related to the starting nodes or head nodes in the multiple circulation paths and the multiple destination sub-paths belong to the same time period can be stored in the same time partition on one or more storage devices. The time related to the starting node or head node can be the time when the transaction related to the starting node or head node occurs, or the time when the starting node or head node receives the fund data of the corresponding circulation path, or the time when the starting node or head node transfers the fund data of the corresponding circulation path to its downstream node, etc. For example, assume that ABC is the circulation path and BC is the destination sub-path. Then, when storing, the time related to the starting node or head node of the flow path ABC and the destination sub-path BC, such as the time of occurrence of the transaction related to the starting node or head node (for example, the time when the funds are traded from node A to node B, and the time when the funds are traded from node B to node C), the corresponding partition, and corresponding storage can be performed. For example, if the time related to the starting node or head node of the path is January 1, 2021, then the corresponding partition is 710; if the time related to the starting node or head node of the path is January 2, 2021, then the corresponding partition is 720; if the time related to the starting node or head node of the path is January 3, 2021, then the corresponding partition is 730. In some embodiments, the processing device can store all the paths divided into the same partition randomly or according to certain rules (for example, store others after one is full or store them evenly in multiple partitions) in the same partition corresponding to multiple storage spaces.
[0080] In some embodiments, when storing multiple flow paths and multiple source sub-paths, the multiple flow paths and the paths whose times related to the termination nodes or tail nodes in the multiple source sub-paths belong to the same time period can be stored in the same time partition on one or more storage devices. Continuing with the above example, the time related to the termination node or tail node of the flow path ABC and the source sub-path AB, such as the time when the transaction related to the termination node or tail node occurs (for example, the time when the funds are traded from node A to node C, and the time when the funds are traded from node A to node B), if the time is January 1, 2021, it corresponds to partition 710, if the time is January 2, 2021, it corresponds to partition 720, and if the time is January 3, 2021, it corresponds to partition 730.
[0081] In some embodiments, it is also possible to partition the storage space of the storage device in advance. Instead, after the flow path, destination sub-path, and source sub-path are divided according to time partitions, the paths in each partition can be stored in one or more storage devices in a distributed storage manner, and the paths in each partition naturally form logical time partitions on the storage device. Figure 7 As shown, the paths divided into partition 710 are stored in storage devices 1, 2, ..., M, and the paths divided into partitions 720, 730, 740, etc. are distributed and stored in storage devices 1, 2, ..., M in the same manner. It should be noted that the processing device can store the paths in the partitions in any manner, for example, randomly, evenly, or in a time sequence.
[0082] After the data is stored, the user can load the paths corresponding to one or more partitions from one or more storage devices through the processing device and query them. For more information about query, see Fig. 9 And the related instructions will not be repeated here.
[0083] In some embodiments, the plurality of flow paths, the plurality of destination sub-paths, and the plurality of source sub-paths are stored after being encoded and / or compressed. Encoding may refer to expressing the path in a coding form such as a vector, for example, encoding information such as nodes of the path into a vector. Compression may refer to compressing the path data, and through encoding and / or compression, the space occupied during storage can be effectively reduced.
[0084] The storage and analysis of data flow data may be continuous. In some embodiments, data flow data may be collected in a preset time period, and the existing data flow graph may be augmented based on the data flow data acquired in a new time period. The time period may be one day, one week, one month, etc.
[0085] Exemplarily, the processing device may update the path according to the method described in the following embodiments.
[0086] In some embodiments, the processing device may obtain newly added data flow data. The newly added data flow data includes nodes and edges between nodes. In some embodiments, the newly added data flow data may include transaction data of the next date of the current date. For example, funds staying in the termination node of the flow path are transferred to a new node through transactions on the next date.
[0087] The processing device may update the multiple flow paths, the multiple destination sub-paths, and the multiple source sub-paths based on the newly added data flow data.
[0088] In some embodiments, the funds staying in the terminal node of the circulation path are all transferred to the new node on the next date. Correspondingly, the updating method can include adding one or more new nodes respectively after the terminal nodes of one or more existing circulation paths and one or more existing destination subpaths. When a new node is added after the terminal node of the circulation path, the destination truncation and source truncation can be performed with reference to step 206 and step 208, and the destination subpath and source subpath for the newly added node are obtained. For example, there is a circulation path ABC, its destination subpath BC and source subpath AB, and the fund data of the circulation path all flows through the D node on the next date, and finally stays at the E node, so after the terminal node of the existing circulation path and its destination subpath, the D node and the E node are respectively added, and the circulation path ABCDE and the destination subpath BCDE are obtained. In addition, it is also necessary to perform destination truncation and source truncation for the circulation path with the added D and E nodes, and the destination subpaths CDE and DE and the source subpaths ABCD and ABC for the newly added node are obtained. After the update, the original flow path ABC, its destination sub-path BC and source sub-path AB are expanded into flow path ABCDE, destination sub-paths BCDE, CDE, DE, and source sub-paths ABCD, ABC, AB.
[0089] In some embodiments, the funds staying in the termination node of the circulation path may also be partially transferred to a new node on the next date. Accordingly, the updating method may include splitting one or more existing circulation paths, one or more existing destination sub-paths, and one or more existing source sub-paths based on data. The splitting includes decomposing the data of the original path (for example, splitting the amount 50 into 30 and 20), and adding one or more nodes after the termination node of the split partial path, respectively, and for the split circulation path with nodes added after the termination node, adding its corresponding destination sub-path and source sub-path.
[0090] like Figure 8 , assuming that the data of the circulation path 810 is an amount of 50 yuan, and the transaction time related to its starting node is T, at T+1, the termination node I of the circulation path 810 generates a new transaction, in which the amount of 30 yuan flows through the X node and stays at the Y node, that is, a new path IXY (820) is formed, and its data is an amount of 30 yuan. When updating the data flow graph based on the flow data of T+1, the original circulation path 810 can be split first to obtain the path 811 with data of 30 yuan and the circulation path 812 with data of 20 yuan. Add the X node and the Y node after the termination node of the split path 811 to obtain the circulation path 830 with data of 30 yuan. The destination sub-path and the source sub-path of the original circulation path 810 can be split and processed in the same way as above, respectively, to obtain the destination sub-path and the source sub-path of the circulation path 812 with data of 20 yuan, and the partial destination sub-path and the partial source sub-path of the circulation path 830 with data of 30 yuan. Afterwards, the split flow path 830 is subjected to destination truncation and source truncation according to step 206 and step 208 to obtain destination sub-paths and source sub-paths for the newly added nodes X and Y, and then all destination sub-paths and source sub-paths of the flow path 830 are obtained.
[0091] Continue to refer to Figure 8 At T+2, the end node I of the circulation path 812 generates a new transaction and forms a new path IUV (840). The circulation path 812 plus the new path 840 can obtain the path 850. Since all the funds in the end node I flow to the newly added path IUV, it can be processed according to the first update method, which will not be repeated here.
[0092] In some embodiments, on the next date, a new flow path appears, such as a certain amount of funds outside the data flow diagram enters through node H and stays at node K through node G. Accordingly, the processing device can directly add a new flow path HGK and its corresponding destination sub-path and source sub-path.
[0093] Fig. 9 is an exemplary flow chart of a data query method according to some embodiments of this specification. In some embodiments, process 900 may be executed by a processing device (such as a query server having a signal connection with a storage device cluster). For example, process 900 may be stored in a storage device (such as a built-in storage unit of a processing device or an external storage device) in the form of a program or instruction, and the program or instruction may implement process 900 when executed. Process 900 may include the following operations.
[0094] Step 902 , obtaining a query request. In some embodiments, step 902 may be performed by the query request obtaining module 1110 .
[0095] The query request can be initiated by a user who needs to analyze the flow data. Specifically, the query request can be initiated by the user end to the processing device. The query request can include description information or matching conditions of the path that the user wants to query. For example, path nodes, edges, data, data flow relationships, etc.
[0096] In some embodiments, the query request may include a path matching condition, which describes multiple nodes in the path to be queried and the data flow relationship between them. The path to be queried is the path that the user wants to query. The data flow relationship may include data flow scenarios (for example, transfer, recharge, consumption, data flow time, etc.) and data flow directions (for example, from which node the transaction is made to which node). Exemplarily, the path matching condition may be "payment node: node A; collection node: node B".
[0097] In some embodiments, the query request may further include a tag item indicating a destination analysis or a source analysis. The tag item may be in any pre-set form, for example, "1" indicates a destination, "2" indicates a source, etc. The tag item may be used to instruct the processing device to obtain the path to be queried in the corresponding flow path and destination sub-path or source sub-path when obtaining the query request.
[0098] Step 904 , based on the query request, obtain one or more candidate paths from the data flow paths and / or sub-paths in one or more storage devices. In some embodiments, step 904 may be performed by the path acquisition module 1120 .
[0099] A candidate path refers to a path that matches the query request and is obtained from one or more storage devices according to the query request. The candidate path may include a flow path, a destination sub-path and / or a source sub-path.
[0100] In some embodiments, the flow paths and / or sub-paths in one or more storage devices may be obtained by processing the data processing method as described in the embodiments of this specification.
[0101] In some embodiments, the processing device can obtain the flow path and / or sub-path matching the query request in each storage device based on the query request. For example, in the query request, the user can specify the starting node of the path to be queried, the next node of the starting node, the data flow relationship between the two nodes, or the ending node, the previous node of the ending node, and the data flow relationship between the two nodes. The processing device can match the paths in each storage device based on the nodes, edges, and data flow relationships. If the nodes, edges, and data flow relationships all match, it can be determined as a candidate path and obtained.
[0102] Exemplarily, the processing device may obtain one or more candidate paths from the flow paths and / or sub-paths in one or more storage devices based on the marking items in the query request and the path matching conditions in the manner described in the embodiments below.
[0103] When the marking item in the query request indicates destination analysis, one or more candidate paths satisfying the path matching condition are obtained from the flow paths and destination sub-paths in one or more storage devices respectively.
[0104] When the tag item in the query request indicates source analysis, one or more candidate paths satisfying the path matching condition are obtained from the flow paths and source sub-paths in one or more storage devices respectively.
[0105] At this time, the candidate paths obtained by the processing device from one or more storage devices not only meet the path matching condition in the query request, but also correspond to the marking item.
[0106] In some embodiments, the tag item in the query request is "1", and the path matching condition includes "payment nodes: A, C, E, payment nodes: B, F". The payment node refers to the starting node or head node of a path, that is, the source of data of the nodes on a path. For example, see Figure 4 , the starting node A of the flow path 410 in the figure is the payment node, and the head node B of the destination sub-path 411 is also the payment node. The payment node can be a downstream node of the payment node, such as the node B in the flow path 410, or the node C in the destination sub-path 411.
[0107] The processing device may extract one or more initial candidate paths whose starting node or head node is the same as the payment node from the flow paths and destination sub-paths in one or more storage devices. Figure 4 , if the payment nodes in the query request are nodes A, C, and E, then the payment nodes are compared with Figure 4By matching the starting node or the head node of the path in , it can be found that the flow path 410, the destination sub-path 412 and the destination sub-path 414 are the initial candidate paths.
[0108] The processing device can obtain the one or more candidate paths from the one or more initial candidate paths based on the other nodes specified by the path matching condition and the data flow relationship between them. For example, the path matching condition also specifies that the collection nodes are node B and node F. By matching the path matching condition with the initial candidate path, it can be known that the flow path 410 and the destination sub-path 414 in the initial candidate path meet the conditions, then the candidate path obtained from the initial candidate path is the flow path 410 and the destination sub-path 414.
[0109] In some embodiments, the marking item in the query request is "2", and the path matching conditions include "receiving nodes: C, E, payment node: D".
[0110] The processing device may first extract one or more initial candidate paths whose termination node or tail node is the same as the payment receiving node from the data flow paths and source sub-paths in one or more storage devices. Figure 5 , the source sub-path 512 and the source sub-path 514 can be matched to be the initial candidate paths.
[0111] The processing device may obtain the one or more candidate paths from the one or more initial candidate paths based on other nodes specified by the path matching condition and the data flow relationship between them. For example, the path matching condition may also specify that the payment node is the D node. By matching the path matching condition with the initial candidate path, it can be known that the source sub-path 512 in the initial candidate path is obtained, and the candidate path obtained from the initial candidate path is the source sub-path 512.
[0112] It can be seen that the above method is used to perform path query, avoiding traversing all graph nodes, and effectively improving query efficiency.
[0113] In some embodiments, the user can also specify an interest time span in the query request. The interest time span refers to the time period when the data in the path to be queried flows in the flow path. For example, the interest time span is from May 18 to May 20, 2021. Accordingly, the processing device queries each storage device for the paths that flow within this interest time span and meet other conditions in the query request. Specifically, the processing device can determine one or more time periods involved based on the interest time span, and then determine the corresponding time partitions in one or more storage devices. For example, if the interest time span is T-T+1, then the time periods involved include T and T+1. As described above, Figure 7The time period of partition 710 is T-1, the time period of partition 720 is T, and the time period of partition 730 is T+1. Based on the time span of interest, the corresponding time partitions in one or more storage devices can be determined as partition 720 and partition 730.
[0114] The processing device may obtain one or more initial candidate paths from the corresponding time partitions in one or more storage devices based on other conditions in the query request, such as path matching conditions. For example, the processing device may obtain the initial candidate paths from the storage devices corresponding to partitions 720 and 730. The acquisition method can refer to the relevant description above and will not be repeated here.
[0115] In some embodiments, the nodes or edges of the paths stored by the storage device, including the flow paths and their sub-paths, involve multiple time periods, so the processing device can also truncate the one or more initial candidate paths based on the time span of interest to obtain the portion of the one or more initial candidate paths that belongs to the time span of interest. For example, if the time span of an initial path includes the time period from T to T+10, the processing device can truncate and discard the partial path corresponding to the time period from T+2 to T+10 from the initial candidate path based on the time span of interest, and the remaining portion after truncation is the portion of the initial candidate path that belongs to the time span of interest.
[0116] The processing device may directly use the portion of one or more initial candidate paths that belongs to the time span of interest as one or more candidate paths.
[0117] Step 906 , aggregating the one or more candidate paths to obtain the path to be queried. In some embodiments, step 906 may be performed by the path processing module 1130 .
[0118] In some embodiments, the processing device may obtain the one or more candidate paths from the one or more storage devices. Figure 7 , the processing device can obtain the candidate paths corresponding to partition 720 and partition 730 from storage devices 1, 2, ..., M respectively.
[0119] The summary process may include one or more of merging, decompression, and decoding. Merging may refer to finding the union or sum of the data corresponding to similar sub-paths in the candidate path. For example, step 904 truncates the initial candidate path based on the time span of interest, and similar sub-paths may exist in the remaining path after truncation, which can then be merged. For more information about merging and similar paths, please refer to the relevant description of step 206, which will not be repeated here. Decompression may refer to restoring the compressed path data as described in step 210 to the state before compression. Decoding may refer to restoring the encoded data to a plain text state using the inverse algorithm of the encoding algorithm. For example, the nodes, edges, data and other information of the path represented by a vector are decoded into a plain text state that the user can understand.
[0120] It should be noted that the above description of each process is only for example and explanation, and does not limit the scope of application of this specification. For those skilled in the art, various modifications and changes can be made to the process under the guidance of this specification. However, these modifications and changes are still within the scope of this specification. For example, changes to the process steps of this specification, such as adding a pre-processing step and a storage step, etc.
[0121] Fig.10 is an exemplary module diagram of a data processing system according to some embodiments of this specification. Fig.10 As shown, the system 1000 may include a data flow graph acquisition module 1010 , a flow path acquisition module 1020 , a destination path truncation module 1030 , a source path truncation module 1040 , and a path storage module 1050 .
[0122] The data flow graph acquisition module 1010 can be used to acquire a data flow graph.
[0123] Data can be an abstract reference to certain things, such as funds, phone charges, traffic, people, vehicles, etc.
[0124] The data flow graph is a data structure that uses nodes to correspond to data, and the edges between nodes reflect the flow information of data between nodes. In some embodiments, the edges between nodes can also represent the scenario of data flow between nodes.
[0125] In some embodiments, the data flow graph acquisition module 1010 can obtain the data flow graph by reading from a storage device, a database, calling a data interface, or constructing a data flow graph based on nodes and edges.
[0126] The flow path acquisition module 1020 can be used to acquire the flow path of the same data from the start node to the end node from the data flow graph, and then obtain multiple flow paths corresponding to different data.
[0127] The flow path refers to the path formed by the nodes that a certain amount of funds passes through when it flows in the data flow graph and the edges connecting these nodes.
[0128] In some embodiments, the data is funds, and the node may include an account for storing funds, wherein the portion of the transferred-in funds and the transferred-out funds of the same node that meet preset conditions are determined to be the same data, and the data of the flow path is the intersection of the same data of each node on the flow path. The preset conditions include last-in-first-out and equal amounts.
[0129] In some embodiments, the flow path acquisition module 1020 may first determine the same data in the incoming data and outgoing data of the node. After the same data in the node is determined, the next node of the data flow path may be determined based on the intersection of the same data between the nodes, thereby determining a flow path.
[0130] In some embodiments, the flow path acquisition module 1020 can extract the nodes that are the intersection of the same data in the flow graph and the edges connecting these nodes based on one or more identical data, one or more starting nodes and one or more ending nodes in the data flow graph, and obtain multiple flow paths corresponding to different data.
[0131] The destination path truncation module 1030 may be used to perform multiple truncation of at least a plurality of flow paths from the start node to the end node for multiple times to obtain a plurality of destination sub-paths.
[0132] In some embodiments, the destination path truncation module 1030 can, for each flow path, truncate and discard the front part of each node from the next node of the starting node to the previous node of the ending node in the flow path in turn, to obtain multiple initial destination sub-paths; and then obtain multiple initial destination sub-paths of the multiple flow paths; merge similar destination sub-paths in the multiple initial destination sub-paths of the multiple flow paths, and then obtain the multiple destination sub-paths; wherein similar destination sub-paths have at least the same nodes and edges reflecting the same flow direction, and the merging includes taking the union or sum of the data corresponding to the similar destination sub-paths.
[0133] The source path truncation module 1040 may be configured to perform multiple truncation operations on at least a plurality of flow paths from the end node to the start node for multiple times to obtain a plurality of source sub-paths.
[0134] In some embodiments, the source path truncation module 1040 may, for each flow path, sequentially truncate and discard the rear of each node from the previous node of the terminating node to the next node of the starting node in the flow path to obtain multiple initial source sub-paths; and further obtain multiple initial source sub-paths of the multiple flow paths;
[0135] Similar source sub-paths in multiple initial source sub-paths of multiple flow paths are merged to obtain the multiple source sub-paths; wherein the similar source sub-paths have at least the same nodes and edges reflecting the same flow direction, and the merging includes obtaining the union or sum of the data corresponding to the similar source sub-paths.
[0136] The path storage module 1050 may be used to store the multiple flow paths, multiple destination sub-paths, and multiple source sub-paths in a distributed manner on multiple storage devices for query.
[0137] In some embodiments, the path storage module 1050 may store the multiple flow paths obtained from the data flow graph and the multiple destination sub-paths and multiple source sub-paths obtained after truncation on multiple storage devices in a distributed manner according to preset storage rules.
[0138] In some embodiments, the storage device has multiple time partitions. The path storage module 1050 can store the multiple flow paths and the paths whose time associated with the start nodes in the multiple destination sub-paths belongs to the same time period in the same time partition on one or more storage devices; and store the multiple flow paths and the paths whose time associated with the end nodes in the multiple source sub-paths belongs to the same time period in the same time partition on one or more storage devices.
[0139] In some embodiments, the path storage module 1050 may store multiple flow paths, multiple destination sub-paths, and multiple source sub-paths after encoding and / or compression.
[0140] Fig.11 is an exemplary module diagram of a data query system according to some embodiments of this specification. Fig.11 As shown, the system 1100 may include a query request acquisition module 1110 , a path acquisition module 1120 , and a path processing module 1130 .
[0141] The query request acquisition module 1110 may be used to acquire a query request.
[0142] The query request can be initiated by a user who needs to analyze the flow data. Specifically, the query request can be initiated by the user end to the processing device. The query request can include description information or matching conditions of the path that the user wants to query. For example, path nodes, edges, data, data flow relationships, etc.
[0143] In some embodiments, the query request further includes a tag item indicating destination analysis or source analysis.
[0144] The path acquisition module 1120 may be configured to acquire one or more candidate paths from data flow paths and / or sub-paths in one or more storage devices based on the query request.
[0145] In some embodiments, the path acquisition module 1120 may acquire, in each storage device based on the query request, a data flow path and / or sub-path that matches the query request.
[0146] In some embodiments, the query request also includes a tag item indicating a destination analysis or a source analysis. The path acquisition module 1120 can acquire one or more candidate paths that meet the path matching condition from the data flow path and the destination sub-path in one or more storage devices respectively when the tag item in the query request indicates a destination analysis; and acquire one or more candidate paths that meet the path matching condition from the data flow path and the source sub-path in one or more storage devices respectively when the tag item in the query request indicates a source analysis.
[0147] In some embodiments, the path matching condition includes that the source node path acquisition module 1120 can extract one or more initial candidate paths whose starting node is the same as the source node from the data flow path and destination sub-path in one or more storage devices; based on other nodes specified by the path matching condition and the data flow relationship between them, obtain the one or more candidate paths from the one or more initial candidate paths.
[0148] In some embodiments, the path matching condition includes a destination node; the path acquisition module 1120 can extract one or more initial candidate paths whose termination nodes are the same as the destination node from the data flow paths and source sub-paths in one or more storage devices; based on other nodes specified by the path matching condition and the data flow relationship between them, the one or more candidate paths are acquired from the one or more initial candidate paths.
[0149] In some embodiments, the query request also includes an interest time span; the path acquisition module 1120 can determine one or more time periods involved in the interest time span based on the interest time span, and then determine the corresponding time partitions in one or more storage devices; obtain one or more initial candidate paths from the corresponding time partitions in the one or more storage devices based on the path matching conditions; truncate the one or more initial paths based on the interest time span to obtain the part of one or more initial paths belonging to the interest time span; and use the part of one or more initial paths belonging to the interest time span as one or more candidate paths.
[0150] The path processing module 1130 may be used to aggregate the one or more candidate paths to obtain the path to be queried.
[0151] In some embodiments, the aggregation process includes one or more of merging, decompressing, and decoding.
[0152] The path processing module 1130 may obtain the one or more candidate paths from the one or more storage devices.
[0153] For a detailed description of each module of the system shown above, please refer to the flowchart section of this specification, for example, Figures 2 to 9 Related instructions.
[0154] It should be understood that Fig.10 and Fig.11 The system and its modules shown can be implemented in various ways. For example, in some embodiments, the system and its modules can be implemented by hardware, software or a combination of software and hardware. Among them, the hardware part can be implemented using dedicated logic; the software part can be stored in a memory and executed by an appropriate instruction execution system, such as a microprocessor or a dedicated design hardware. Those skilled in the art will understand that the above methods and systems can be implemented using computer executable instructions and / or included in a processor control code, such as a carrier medium such as a disk, CD or DVD-ROM, a programmable memory such as a read-only memory (firmware), or a data carrier such as an optical or electronic signal carrier. Such code is provided on the system and its modules of this specification. Not only can the hardware circuits such as ultra-large-scale integrated circuits or gate arrays, semiconductors such as logic chips, transistors, or programmable hardware devices such as field programmable gate arrays, programmable logic devices, etc. be implemented, it can also be implemented with software such as executed by various types of processors, and it can also be implemented by a combination of the above hardware circuits and software (for example, firmware).
[0155] It should be noted that the above description of the data processing system and its modules is only for convenience of description and cannot limit this specification to the scope of the embodiments. It is understandable that for those skilled in the art, after understanding the principle of the system, it is possible to arbitrarily combine the modules without deviating from this principle, or to form a subsystem connected with other modules. For example, in some embodiments, the data flow graph acquisition module 1010, the flow path acquisition module 1020, the destination path truncation module 1030, the source path truncation module 1040 and the path storage module 1050 can be different modules in a system, or a module can realize the functions of two or more modules mentioned above. For example, the destination path truncation module 1030 and the source path truncation module 1040 can be two modules, or a module can have both the destination truncation and source truncation functions. For example, each module can share a storage module, or each module can have its own storage module. Such variations are all within the protection scope of this specification.
[0156] The beneficial effects that may be brought about by the embodiments of this specification include but are not limited to: (1) extracting the flow path from the data flow graph composed of massive data flow data, and truncating and partitioning the flow path, which can effectively improve the efficiency of data query and reduce the data storage pressure to a certain extent; (2) performing path splitting and / or data partitioning based on the minimum granularity of analysis to meet flexible and changeable query methods and improve the user experience. It should be noted that different embodiments may produce different beneficial effects. In different embodiments, the beneficial effects that may be produced may be any one or a combination of the above, or any other possible beneficial effects.
[0157] The basic concepts have been described above. Obviously, for those skilled in the art, the above detailed disclosure is only for example and does not constitute a limitation of this specification. Although not explicitly stated here, those skilled in the art may make various modifications, improvements and corrections to this specification. Such modifications, improvements and corrections are suggested in this specification, so such modifications, improvements and corrections still belong to the spirit and scope of the exemplary embodiments of this specification.
[0158] At the same time, this specification uses specific words to describe the embodiments of this specification. For example, "one embodiment", "an embodiment", and / or "some embodiments" refer to a certain feature, structure or characteristic related to at least one embodiment of this specification. Therefore, it should be emphasized and noted that "one embodiment" or "an embodiment" or "an alternative embodiment" mentioned twice or more in different positions in this specification does not necessarily refer to the same embodiment. In addition, certain features, structures or characteristics in one or more embodiments of this specification can be appropriately combined.
[0159] In addition, it will be understood by those skilled in the art that various aspects of this specification may be illustrated and described by a number of patentable categories or situations, including any new and useful process, machine, product or combination of substances, or any new and useful improvements thereto. Accordingly, various aspects of this specification may be performed entirely by hardware, entirely by software (including firmware, resident software, microcode, etc.), or by a combination of hardware and software. The above hardware or software may be referred to as "data blocks", "modules", "engines", "units", "components" or "systems". In addition, various aspects of this specification may be represented as a computer product located in one or more computer-readable media, which includes computer-readable program code.
[0160] A computer storage medium may include a propagated data signal containing computer program code, for example, in baseband or as part of a carrier wave. The propagated signal may be in a variety of forms, including electromagnetic, optical, etc., or a suitable combination. A computer storage medium may be any computer-readable medium other than a computer-readable storage medium, which can be connected to an instruction execution system, device or apparatus to communicate, propagate or transmit the program for use. The program code on the computer storage medium may be transmitted via any suitable medium, including radio, cable, fiber optic cable, RF, or similar media, or any combination of the above media.
[0161] The computer program code required for the operation of each part of this specification can be written in any one or more programming languages, including object-oriented programming languages such as Java, Scala, Smalltalk, Eiffel, JADE, Emerald, C++, C#, VB.NET, Python, etc., conventional procedural programming languages such as C language, Visual Basic, Fortran 2003, Perl, COBOL 2002, PHP, ABAP, dynamic programming languages such as Python, Ruby and Groovy, or other programming languages. The program code can be run entirely on the user's computer, or run on the user's computer as an independent software package, or run partially on the user's computer and partially on a remote computer, or run entirely on a remote computer or server. In the latter case, the remote computer can be connected to the user's computer through any network form, such as a local area network (LAN) or a wide area network (WAN), or connected to an external computer (e.g., via the Internet), or in a cloud computing environment, or used as a service such as software as a service (SaaS).
[0162] In addition, unless explicitly stated in the claims, the order of the processing elements and sequences described in this specification, the use of alphanumeric characters, or the use of other names are not intended to limit the order of the processes and methods of this specification. Although the above disclosure discusses some invention embodiments that are currently considered useful through various examples, it should be understood that such details are only for illustrative purposes, and the attached claims are not limited to the disclosed embodiments. On the contrary, the claims are intended to cover all modifications and equivalent combinations that are consistent with the essence and scope of the embodiments of this specification. For example, although the system components described above can be implemented by hardware devices, they can also be implemented only by software solutions, such as installing the described system on an existing server or mobile device.
[0163] Similarly, it should be noted that in order to simplify the description disclosed in this specification and thus help understand one or more embodiments of the invention, in the above description of the embodiments of this specification, multiple features are sometimes combined into one embodiment, figure or description thereof. However, this disclosure method does not mean that the features required by the subject matter of this specification are more than the features mentioned in the claims. In fact, the features of the embodiments are less than all the features of the single embodiment disclosed above.
[0164] In some embodiments, numbers describing the number of components and attributes are used. It should be understood that such numbers used in the description of the embodiments are modified by the modifiers "about", "approximately" or "substantially" in some examples. Unless otherwise specified, "about", "approximately" or "substantially" indicate that the numbers are allowed to vary by ±20%. Accordingly, in some embodiments, the numerical parameters used in the specification and claims are approximate values, which may change according to the required features of individual embodiments. In some embodiments, the numerical parameters should take into account the specified significant digits and adopt the general method of retaining digits. Although the numerical domains and parameters used to confirm the breadth of their range in some embodiments of this specification are approximate values, in specific embodiments, the setting of such numerical values is as accurate as possible within the feasible range.
[0165] Each patent, patent application, patent application publication, and other materials, such as articles, books, specifications, publications, documents, etc., cited in this specification are hereby incorporated by reference in their entirety. Except for application history documents that are inconsistent with or conflicting with the contents of this specification, documents that limit the broadest scope of the claims of this specification (currently or later attached to this specification) are also excluded. It should be noted that if the descriptions, definitions, and / or use of terms in the materials attached to this specification are inconsistent or conflicting with the contents described in this specification, the descriptions, definitions, and / or use of terms in this specification shall prevail.
[0166] Finally, it should be understood that the embodiments described in this specification are only used to illustrate the principles of the embodiments of this specification. Other variations may also fall within the scope of this specification. Therefore, as an example and not a limitation, alternative configurations of the embodiments of this specification may be considered consistent with the teachings of this specification. Accordingly, the embodiments of this specification are not limited to the embodiments explicitly introduced and described in this specification.
Claims
1. A data processing method, the method comprising: Obtain a data flow graph; the data flow graph includes nodes and edges, wherein data flows between nodes, and the edges between nodes reflect the flow direction of data between nodes; Obtaining a flow path of the same data from a starting node to an ending node from the data flow graph, thereby obtaining multiple flow paths corresponding to different data; At least a plurality of flow paths are sequentially cut from the starting node to the ending node to obtain a plurality of destination sub-paths; At least a plurality of flow paths are sequentially cut from the end node to the start node to obtain a plurality of source sub-paths; The multiple flow paths, the multiple destination sub-paths and the multiple source sub-paths are distributed and stored on multiple storage devices for query.
2. According to the method of claim 1, the at least multiple flow paths are cut off multiple times from the starting node to the ending node to obtain multiple destination sub-paths, including: For each flow path, the front part of each node from the next node of the starting node to the previous node of the ending node in the flow path is sequentially truncated and discarded to obtain multiple initial destination sub-paths; thereby obtaining multiple initial destination sub-paths of the multiple flow paths; The multiple initial destination sub-paths of the multiple flow paths are used as the multiple destination sub-paths, or similar destination sub-paths in the multiple initial destination sub-paths of the multiple flow paths are merged to obtain the multiple destination sub-paths; wherein the similar destination sub-paths have at least the same nodes and edges reflecting the same flow direction, and the merging includes obtaining the union or sum of the data corresponding to the similar destination sub-paths.
3. The method according to claim 1, wherein the at least multiple flow paths are cut multiple times from the end node to the start node to obtain multiple source sub-paths, comprising: For each flow path, the rear part of each node from the previous node of the end node to the next node of the start node in the flow path is sequentially cut off and discarded to obtain multiple initial source sub-paths; thereby obtaining multiple initial source sub-paths of the multiple flow paths; The multiple initial source sub-paths of the multiple flow paths are used as the multiple source sub-paths, or similar source sub-paths in the multiple initial source sub-paths of the multiple flow paths are merged to obtain the multiple source sub-paths; wherein similar source sub-paths have at least the same nodes and edges reflecting the same flow direction, and the merging includes obtaining the union or sum of the data corresponding to the similar source sub-paths.
4. The method according to claim 1, wherein the storage device has multiple time partitions; wherein the multiple flow paths, multiple destination sub-paths, and multiple source sub-paths are distributed and stored on multiple storage devices, comprising: storing the paths whose start nodes or head nodes are related to the same time period in the multiple flow paths and the multiple destination sub-paths in the same time partition on one or more storage devices; The paths whose time associated with the termination nodes or tail nodes in the plurality of flow paths and the plurality of source sub-paths belongs to the same time period are stored in the same time partition on one or more storage devices.
5. The method according to claim 1, wherein the data includes financial data, the node corresponds to an account for storing funds, and wherein: The parts of the incoming funds data and the outgoing funds data of the same node that meet the preset conditions are determined to be the same data, and the data of the flow path is the intersection of the same data in the incoming funds data and the outgoing funds data of each node on the flow path.
6. The method according to claim 5, wherein the preset conditions include last-in-first-out and equal amounts.
7. According to the method of claim 1, multiple flow paths, multiple destination sub-paths, and multiple source sub-paths are stored after being encoded and / or compressed.
8. The method according to claim 1, further comprising: Get the newly added data flow data; The newly added data flow data includes nodes and edges between nodes; The multiple flow paths, the multiple destination sub-paths, and the multiple source sub-paths are updated based on the newly added data flow data.
9. The method according to claim 8, wherein the updating comprises one or more of the following: Add one or more nodes after the termination nodes of one or more existing flow paths and one or more existing destination sub-paths, and for the flow paths with nodes added after the termination nodes, add destination sub-paths and source sub-paths for the newly added nodes; The one or more existing flow paths, the one or more existing destination sub-paths, and the one or more existing source sub-paths are split based on data, and one or more nodes are added after the termination nodes of the split partial paths, and for the split flow paths with nodes added after the termination nodes, destination sub-paths and source sub-paths for the newly added nodes are added; the splitting includes decomposing the data of the original path; In addition, a new flow path and its corresponding destination sub-path and source sub-path are added.
10. A data processing system, the system comprising: A data flow graph acquisition module is used to acquire a data flow graph; the data flow graph includes nodes and edges, wherein data flows between nodes, and the edges between nodes reflect the flow direction of data between nodes; A flow path acquisition module, used to acquire the flow path of the same data from the starting node to the ending node from the data flow graph, so as to obtain multiple flow paths corresponding to different data; A destination path truncation module, used to sequentially truncate at least a plurality of flow paths from a starting node to an ending node to obtain a plurality of destination sub-paths; A source path truncation module, used to sequentially truncate at least a plurality of flow paths from the end node to the start node to obtain a plurality of source sub-paths; The path storage module is used to store the multiple flow paths, multiple destination sub-paths and multiple source sub-paths in a distributed manner on multiple storage devices for query.
11. A data processing device, comprising at least one storage medium and at least one processor, wherein the at least one storage medium is used to store computer instructions; and the at least one processor is used to execute the computer instructions to implement the method according to any one of claims 1 to 9.
12. A data query method, the method comprising: Obtaining a query request; wherein the query request includes a path matching condition, and the path matching condition describes a plurality of nodes in a path to be queried and a data flow relationship between the nodes; Based on the query request, one or more candidate paths are obtained from the flow paths and / or sub-paths in the one or more storage devices respectively; wherein the flow paths and / or sub-paths in the one or more storage devices are obtained by the processing method according to any one of claims 1 to 9; The one or more candidate paths are aggregated to obtain the path to be queried.
13. The method according to claim 12, wherein the query request further comprises a tag item indicating destination analysis or source analysis; The acquiring one or more candidate paths from the flow paths and / or sub-paths in one or more storage devices based on the query request includes: When the tag item in the query request indicates destination analysis, one or more candidate paths satisfying the path matching condition are obtained from the flow paths and destination sub-paths in one or more storage devices respectively; When the tag item in the query request indicates source analysis, one or more candidate paths satisfying the path matching condition are obtained from the flow paths and source sub-paths in one or more storage devices respectively.
14. The method according to claim 13, wherein the path matching condition includes a payment node; The acquiring one or more candidate paths satisfying the path matching condition from the flow paths and destination sub-paths in one or more storage devices includes: Extracting one or more initial candidate paths whose starting node or head node is the same as the payment node from the flow paths and destination sub-paths in one or more storage devices; Based on other nodes specified by the path matching condition and data flow relationships therebetween, the one or more candidate paths are obtained from the one or more initial candidate paths.
15. The method according to claim 13, wherein the path matching condition includes a payment receiving node; and obtaining one or more candidate paths satisfying the path matching condition from the flow paths and source sub-paths in one or more storage devices comprises: Extracting one or more initial candidate paths whose terminating node or tail node is the same as the payment receiving node from the flow paths and source sub-paths in one or more storage devices; Based on other nodes specified by the path matching condition and data flow relationships therebetween, the one or more candidate paths are obtained from the one or more initial candidate paths.
16. The method according to claim 12, wherein the query request further includes a time span of interest; The acquiring one or more candidate paths from the flow paths and / or sub-paths in one or more storage devices based on the query request includes: Based on the time span of interest, determining one or more time periods involved therein, and further determining corresponding time partitions in one or more storage devices; Acquire one or more initial candidate paths from corresponding time partitions in one or more storage devices based on the path matching condition; truncating the one or more initial paths based on the time span of interest to obtain a portion of the one or more initial paths that belongs to the time span of interest; The portion of the one or more initial paths that belongs to the time span of interest is used as one or more candidate paths.
17. The method according to claim 12, wherein the aggregation process comprises one or more of the following: merging, decompression, and decoding.
18. A data query system, comprising: A query request acquisition module, used to acquire a query request; wherein the query request includes a path matching condition, and the path matching condition describes a plurality of nodes in a path to be queried and a data flow relationship between the nodes; A path acquisition module, configured to acquire one or more candidate paths from the flow paths and / or sub-paths in one or more storage devices based on the query request; wherein the flow paths and / or sub-paths in the one or more storage devices are acquired by the processing method according to any one of claims 1 to 9; The path processing module is used to aggregate the one or more candidate paths to obtain the path to be queried.
19. A data query device, comprising at least one storage medium and at least one processor, wherein the at least one storage medium is used to store computer instructions; and the at least one processor is used to execute the computer instructions to implement the method according to any one of claims 12 to 17.
