WO2022062337A1 - Method and device for data aggregation, terminal device, and computer-readable storage medium - Google Patents

Method and device for data aggregation, terminal device, and computer-readable storage medium Download PDF

Info

Publication number
WO2022062337A1
WO2022062337A1 PCT/CN2021/081963 CN2021081963W WO2022062337A1 WO 2022062337 A1 WO2022062337 A1 WO 2022062337A1 CN 2021081963 W CN2021081963 W CN 2021081963W WO 2022062337 A1 WO2022062337 A1 WO 2022062337A1
Authority
WO
WIPO (PCT)
Prior art keywords
node
data
target
directed acyclic
acyclic graph
Prior art date
Application number
PCT/CN2021/081963
Other languages
French (fr)
Chinese (zh)
Inventor
吴健成
Original Assignee
广州华多网络科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 广州华多网络科技有限公司 filed Critical 广州华多网络科技有限公司
Publication of WO2022062337A1 publication Critical patent/WO2022062337A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24553Query execution of query operations

Definitions

  • the present application relates to the technical field of data processing, and in particular, to a data aggregation method, a terminal device and a computer-readable storage medium.
  • a data aggregation method, a terminal device and a computer-readable storage medium are provided in the embodiments of the present application, so as to overcome the need to reconfigure all data when adding functional modules in the page display in the prior art, resulting in low R&D efficiency and high development cost.
  • the problem is provided in the embodiments of the present application, so as to overcome the need to reconfigure all data when adding functional modules in the page display in the prior art, resulting in low R&D efficiency and high development cost.
  • an embodiment of the present application provides a data aggregation method, which includes:
  • the business data aggregation parameters include business data identifiers and target data fields;
  • the model is constructed based on pre-acquired various business data and the conversion relationship between various business data;
  • the target data fields are combined to obtain aggregated data, and the aggregated data is used for display on the page.
  • an embodiment of the present application provides a data aggregation apparatus, and the apparatus includes:
  • a parameter acquisition module for acquiring business data aggregation parameters;
  • the business data aggregation parameters include a business data identifier and a target data field;
  • a graph model obtaining module configured to obtain a directed acyclic graph model corresponding to the business data identifier
  • a node determination module configured to determine a start node and a target node in the directed acyclic graph model according to the service data identifier; wherein the directed acyclic graph model is based on pre-acquired multiple service data and The transformation relationship between various business data is constructed;
  • a shortest path selection module configured to select the shortest path between the start node and the target node from the directed acyclic graph model according to a dynamic path planning method
  • a target data field search module configured to search according to the shortest path, and find the target data field in the data field of the target node
  • the aggregated data obtaining module is used for combining the target data fields to obtain aggregated data, and the aggregated data is used for displaying on the page.
  • embodiments of the present application provide a terminal device, including: a memory; one or more processors coupled to the memory; and one or more application programs, wherein the one or more application programs are stored In the memory and configured to be executed by one or more processors, one or more application programs are configured to execute the data aggregation method provided by the above first aspect.
  • an embodiment of the present application provides a computer-readable storage medium, where a program code is stored in the computer-readable storage medium, and the program code can be invoked by a processor to execute the data aggregation method provided in the first aspect.
  • a data aggregation method, device, terminal device, and storage medium provided by the embodiments of the present application acquire service data aggregation parameters, wherein the service data aggregation parameters include a service data identifier and a target data field; and obtain corresponding directed data according to the service data identifier.
  • Acyclic graph model, and the starting node and target node are determined in the directed acyclic graph model; the directed acyclic graph model is constructed according to the pre-acquired various business data and the conversion relationship between various business data; Then select the shortest path between the starting node and the target node from the directed acyclic graph model according to the dynamic path planning method; search according to the shortest path, and find the target data field in the data field of the target node; combined to get aggregated data.
  • the directed acyclic graph model of the present application is used to represent the conversion relationship between various business data. As long as the starting node and the target node are known, it is possible to determine from one business data (that is, the business data corresponding to the starting node) to the starting node.
  • All conversion methods of another business data that is, the business data corresponding to the target node
  • select the best conversion method through the shortest path you can quickly find or search for another business data through the A target data field existing in business data, the target data fields are combined to obtain aggregated data, the aggregated data can be displayed on the page of the network platform to achieve a certain function, this method can be used when the webpage needs to add function modules.
  • the conversion method of business data quickly combines the function module without modifying a large amount of data and related program codes, thereby improving R&D efficiency and greatly reducing development costs.
  • FIG. 1 is a schematic diagram of an application scenario of a data aggregation method provided by an embodiment of the present application
  • FIG. 2 is a schematic flowchart of a method provided by an embodiment of the present application.
  • FIG. 3 is a schematic structural diagram of a directed acyclic graph model provided by an embodiment of the present application.
  • FIG. 4 is a visual interface diagram of aggregated data display provided by an embodiment of the present application.
  • FIG. 5 is a schematic flowchart of a directed acyclic graph model construction process provided by an embodiment of the present application.
  • FIG. 6 is a visual interface diagram of a newly added node provided by an embodiment of the present application.
  • FIG. 7 is a visual interface diagram of a newly added edge provided by an embodiment of the present application.
  • FIG. 8 is a visual interface diagram of node management provided by an embodiment of the present application.
  • FIG. 9 is a visual interface diagram of edge management provided by an embodiment of the present application.
  • FIG. 11 is a schematic diagram of combining sub-target data fields provided in an embodiment of the application.
  • FIG. 12 is a schematic diagram of a process of providing business data aggregation in an embodiment of the application.
  • FIG. 13 is a schematic structural diagram of a data aggregation apparatus provided in an embodiment of the present application.
  • FIG. 14 is a schematic structural diagram of a terminal device provided in an embodiment of the application.
  • FIG. 15 is a schematic structural diagram of a computer-readable storage medium provided in an embodiment of the present application.
  • FIG. 1 shows a schematic diagram of an application scenario of the data aggregation method provided by the embodiment of the present application.
  • the application scenario includes the terminal device 100 provided by the embodiment of the present application.
  • the terminal device 100 may be various types of display screens.
  • Electronic equipment such as the structural diagrams of 102, 104, 106 and 108
  • the computer equipment can be at least one of a desktop computer, a portable computer, a laptop computer, a tablet computer, etc. kind.
  • the terminal device 100 can install and run related application programs for obtaining business data aggregation parameters.
  • the user can set relevant information about business data aggregation, such as business data and other information, on the visual interface of the terminal device 100.
  • the set information is obtained, and the business data aggregation parameters are obtained according to the obtained information.
  • the user can set the relevant information of the service data and the conversion relationship between the service data on the visual interface of the terminal device 100, and the terminal device 100 can obtain the relevant information according to the user's setting of the service data and the conversion relationship between the service data
  • the transformation relationship between business data (including business data identifiers, data types, data fields, etc.) and business data, and a directed acyclic graph model is constructed according to the business data and the transformation relationship between business data.
  • the terminal device 100 may also be provided with at least one kind of database for storing the directed acyclic graph model and the like.
  • the terminal device 100 may generally refer to one of multiple terminal devices, and this embodiment only takes the terminal device 100 as an example for illustration. Those skilled in the art may know that the number of the above-mentioned terminal devices may be more or less. For example, the above-mentioned terminal devices may be only a few, or the above-mentioned terminal devices may be dozens or hundreds, or more, and the embodiments of the present application do not limit the number and type of the terminal devices.
  • the terminal device 100 may be used to execute a data aggregation method provided in this embodiment of the present application.
  • the application scenario includes, in addition to the terminal device 100 provided in the embodiment of the present application, a server, where a network is set between the server and the terminal device.
  • a network is a medium used to provide a communication link between an end device and a server.
  • a network may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
  • the server may be a server cluster composed of multiple servers.
  • the terminal device interacts with the server through the network to receive or send messages and the like.
  • the server may be a server that provides various services.
  • the server may be used to perform steps other than visual display (eg, aggregated data display) in the data aggregation method provided in the embodiments of the present application.
  • steps other than visual display eg, aggregated data display
  • some steps may be executed on the terminal device, and some steps may be executed on the server, which is not limited herein.
  • module A requires operators to configure through merchant ID, store ID or product SKU, and needs to display product name, product image, product market price, product discount price, product sales, and product inventory on the module. Then it needs to be implemented through the following data acquisition logic:
  • Module B requires operators to configure through merchant ID, store ID, and product SKU. It is necessary to display product pictures, product discount prices, and product rebate points on the module. Then it needs to be implemented through the following data acquisition logic:
  • FIG. 2 shows a schematic flowchart of a data aggregation method provided by an embodiment of the present application. The method is applied to the terminal device in FIG. 1 as an example for description, including the following steps:
  • Step S110 obtaining business data aggregation parameters;
  • the business data aggregation parameters include business data identifiers and target data fields;
  • e-commerce business includes business data, store data, commodity data, sellerid, sku, etc.; live broadcast business Including live channel data, live room data, live content data, etc.; entertainment business includes program data, hosting data, etc.; entertainment business includes anchord, guildld, etc.
  • data between different services may overlap, for example, merchant data, store data, commodity data, live broadcast channel data, live broadcast room data, and live broadcast content data can be stored between e-commerce business and live broadcast business.
  • the business data can be various, and specifically can be set or customized by the business user or user according to actual needs.
  • the business data aggregation parameters refer to some information related to the business data aggregation process, which may include business data identifiers and target data fields; business data identifiers are information used to identify business data, and the identifiers are mainly used for indexing business data. , it is convenient to determine the directed acyclic graph model and the starting node and the target node, wherein the service data identifier is unique, that is, one service data identifier can only be used to identify one service data.
  • the service data identification can be in various forms, and can be formed by a combination of characters (such as letters and numbers, etc.).
  • the target data field refers to the required field that needs to be obtained from the target node.
  • the data aggregation method may further include receiving a service data aggregation request, where the service data aggregation request is mainly used to transmit service data aggregation parameters; the terminal device responds to the data Aggregate requests to obtain business data aggregation parameters.
  • the sending object of the service data aggregation request may be a peripheral system or other devices.
  • the terminal device can obtain business data aggregation parameters through a visual interface.
  • the terminal device can obtain business data and required data during business data aggregation according to the newly added task interface. Fields, etc., to determine information such as business data identifiers, target data fields, and so on.
  • a data aggregation task can correspond to a new task interface, and the new task interface can provide multiple sub-interfaces based on different setting objects, which together constitute the new task interface, and the multiple sub-interfaces can be based on confirmation operations. of consecutive initiation relationships. That is, after the content of one sub-interface is set, the user can trigger the display of the next sub-interface through manual operation on the sub-interface.
  • the newly added task interface may include multiple sub-interfaces such as a business data setting interface, a required data field setting interface, etc.
  • the newly added task interface may also include other sub-interfaces, which are not limited in this embodiment of the present application .
  • the newly added task interface may include a business data and required data field selection interface. There are many business data and required data field options on this interface. Users can directly select business data and required data fields on the corresponding interface.
  • Step S120 obtaining the directed acyclic graph model corresponding to the business data identifier, and determining the starting node and the target node in the directed acyclic graph model according to the business data identifier; It is constructed by different types of business data and the conversion relationship between various business data;
  • a directed acyclic graph is also known as a DAG graph.
  • DAG graph In graph theory, if a directed graph starts from any vertex and cannot return to the point through several edges, the graph is a DAG. Because a point in a directed graph goes through two routes to another point, it may not form a cycle, so a directed acyclic graph may not be converted into a tree, but any directed tree is a directed acyclic graph.
  • the directed acyclic graph model is a pre-built DAG graph structure.
  • the DAG graph structure is constructed according to the related business data in a business and the conversion relationship between these business data; the construction process of the DAG graph structure can be expressed as It is a visual DAG.
  • There are many paths in the DAG each path has several nodes, each node corresponds to a kind of business data, and the edge between each node represents the business of the two nodes corresponding to the edge.
  • Data can be transformed, that is, one kind of business data can be queried or searched for another kind of business data.
  • a kind of business data includes business data name (corresponding to the node name in the node), business data identifier (corresponding to the node identifier in the node), data type (referring to the integer type, floating point type, etc., which are often said in computer languages, such as string , number, object, array, etc.), data fields (that is, what specific data is stored).
  • the conversion relationship can be a direct conversion relationship and an indirect conversion relationship; two nodes that are directly connected have a direct conversion relationship; two nodes are connected through other nodes, indicating that the two nodes have an indirect conversion relationship.
  • a direct relationship indicates that the business data corresponding to the two nodes can be directly converted
  • an indirect relationship indicates that the business data corresponding to the two nodes can be converted through an intermediate state. For example, if A is connected to B, it means that A and B have a direct connection relationship, and A can be directly converted into B; A is connected to B through C, which means that A and C have an indirect connection relationship, and A can be converted into C (intermediate state) first and then converted into B.
  • the conversion relationship can be expressed as a conversion method or a conversion algorithm.
  • an e-commerce business is used as an example to illustrate the construction process of a directed acyclic graph model, wherein the business data included in the e-commerce business includes uid, commodity, and horizontally drawn commodity. , selection, channel, double-column live room and Datong column live room; according to the conversion relationship between these business data, a directed acyclic graph model can be constructed.
  • the result is shown in Figure 3, where each node in the figure corresponds to a kind of business data (for the convenience of display, the business data identifier is usually used to represent the node in the directed acyclic graph model).
  • uid has a direct conversion relationship with channel number, commodity id, double-column live room, and Chase bar live room, and uid and Chase bar live room can also be indirectly connected, uid and horizontally drawn products and selections have both Indirect connection relationship.
  • uid user identification
  • the system will automatically give the user a uid value.
  • the e-commerce business mentioned in the embodiment is only used to illustrate the structure of the DAG model, and the DAG model is not limited to only be used in e-commerce business, but also for entertainment. business, live broadcast, etc.
  • the DAG model is determined according to the conversion relationship between business data and business data, it can be seen that the DAG model is related to different businesses, that is, different businesses correspond to different DAG models.
  • the corresponding directed acyclic graph model can be determined according to the business data identifier.
  • the nodes of the DAG model include business data identifiers, when data aggregation is required, the starting node and the target node are determined according to the business data identifiers of the business data aggregation parameters.
  • the business data identifiers have at least Two, used to determine the starting node and the target node, respectively.
  • the directed acyclic graph model only reflects the transformation relationship between nodes, and is used to represent the transformation relationship between various business data in a certain business.
  • the actual conversion path can be determined only after the start node, end node, etc. are specified through service aggregation parameters in the specific service data aggregation process.
  • the DAG model can be stored in the storage device (such as a database) of the terminal device, or in the server or other devices; when the terminal device needs to use the DAG model, it can be stored from the storage device, obtained from a server or other device.
  • Step S130 selecting the shortest path between the start node and the target node from the directed acyclic graph model according to the dynamic path planning method
  • a dynamic path planning method is used to determine the shortest path. As shown in Figure 3, for example, to realize the conversion of uid to double-column live room, you can directly convert uid to double-column live room, or you can first convert uid to channel number and then convert to double-column live room according to the channel number , we need to determine which of the two conversion paths is the shortest path.
  • the path is the shortest path by calculating the conversion from uid to channel number and then according to the channel number to double-column live room, select the conversion method corresponding to the path to complete Business data conversion from uid to double-column live broadcast room.
  • Step S140 searching according to the shortest path, and finding the target data field in the data field of the target node;
  • the conversion from the service data of the starting node to the service data of the target node can be realized according to the shortest path. Then search according to the conversion path to find the target data field in the data field of the target node.
  • the path from uid to channel number and then converted to double-column live room according to the channel number is the shortest path, that is, the conversion path of uid-channel number-double-column live room is formed.
  • searching for the target data field first find the channel number according to the uid, then find the double-column live room according to the channel number, and then find the target data field in the double-column live room.
  • it is usually necessary to assign a value to the uid to find the target data field, for example, uid 123456.
  • step S150 the target data fields are combined to obtain aggregated data, and the aggregated data is used for display on the page.
  • the target data field usually includes more than one data field, so these data fields need to be combined to obtain aggregated data.
  • the aggregated data is used to display on the page to achieve a certain function.
  • the store id in the store information, the target data field of the store level, and the live broadcast room number in the live broadcast room information can be used.
  • live broadcast title and broadcast cover and other target data fields are combined to obtain aggregated data and display it on the visualization page of the terminal device (as shown in the result preview in Figure 4).
  • business data aggregation parameters are obtained, wherein the business data aggregation parameters include a business data identifier and a target data field; a corresponding directed acyclic graph model is obtained according to the business data identifier, and the In the ring graph model, the starting node and the target node are determined; the directed acyclic graph model is constructed according to the pre-acquired various business data and the conversion relationship between various business data, in which each of the directed acyclic graph model.
  • the node represents a kind of business data
  • the edge of the directed acyclic graph model represents the conversion relationship between the two connected business data
  • the business data includes business data identifiers and data fields; and then according to the dynamic path planning method from the directed acyclic graph
  • the shortest path between the start node and the target node is selected in the model; the search is performed according to the shortest path, and the target data field is found in the data field of the target node; the target data fields are combined to obtain aggregated data.
  • the directed acyclic graph model of the present application is used to represent the conversion relationship between different types of business data.
  • the starting node and the target node are known, it is possible to determine from one type of business data (that is, the business data corresponding to the starting node) to the starting node. All conversion methods of another business data (that is, the business data corresponding to the target node), and then select the best conversion method through the shortest path. According to the best conversion method, you can quickly find or search for another business data through the A target data field existing in business data, the target data fields are combined to obtain aggregated data, the aggregated data can be displayed on the page of the network platform to achieve a certain function, this method can be used when the webpage needs to add function modules.
  • the conversion method of business data quickly combines the function module without modifying a large amount of data and related program codes, thereby improving R&D efficiency and greatly reducing development costs.
  • the method for constructing a directed acyclic graph model includes:
  • Step S210 acquiring a variety of business data and conversion relationships between various business data
  • various service data and conversion relationships between various service data may be obtained from other peripheral systems or other devices; for example, service users use other peripheral systems or other devices to interact with terminal devices , which converts various business data and the conversion relationship between various business data.
  • the type and quantity of business data and the conversion relationship between various business data can be preset or defined by business users.
  • business data related to e-commerce business can be selected, such as merchant id, store id, commodity sku, commodity Detailed information (product name, product image, product discount price, product sales, product inventory, etc.), and the conversion relationship between business data, such as merchant id-store id-product sku-product details, store id-product sku- Product details, etc.
  • "-" indicates that the business data before and after has a conversion relationship.
  • Sku stock keeping unit
  • Sku is the basic unit of stock in and out measurement, which can be in pieces, boxes, trays, etc.
  • sku This is a necessary method for the logistics management of the large chain supermarket DC (distribution center). At present, it has been extended to the abbreviation of the unified product number, and each product has a unique sku number.
  • sku refers to a product, and each product has a sku, which is convenient for e-commerce brands to identify the product.
  • the terminal device may acquire the service data and the conversion relationship between each service data through a visual interface. For example, it is used to log in to the visual interface of the terminal device, and add new nodes (as shown in Figure 6) and new edges (as shown in Figure 7) on the visual interface to obtain business data and the relationship between each business data. conversion relationship.
  • a new node can be added by entering the node name, node data type, node identifier, node data type and node data field on the new node interface, where the node data type can include string, number, object, etc. Filter from these types.
  • the node data field includes field type and field content.
  • the content of the node data field that is, which fields are included
  • the type of the field and the restrictions of the field can be standardized through schema.
  • the node data fields can be set via json schema.
  • the node data field can be empty, that is, not every node has a node data field; it can be determined according to the node data type, for example, when the node data type is string and number, the node data field can be empty; and the node data type is object, the node data field cannot be empty.
  • node data type, node ID, node data type and node data fields on the visual interface click the "Save” button to complete the addition of the current new node. Click “Cancel” to cancel the current new node.
  • the service data can be acquired according to the relevant information of the newly added node (ie, the node name, the node data type, the node identifier, and the node data field).
  • the addition of all nodes can be completed, and corresponding business data can be obtained.
  • the new edge can be input by entering the relevant information of a node (usually represented by a node identifier, such as uid) at the starting point on the new connection interface, and inputting the relevant information identifier of another node at the end position (usually using Node identifiers, such as sid), weights and conversion rules, and then click the "Save” button to complete the addition of the current new edge, and click "Cancel” to cancel the current new edge.
  • the newly added edge currently represents the conversion relationship between the node uid and the node sid, and the conversion relationship includes a conversion weight of 5 and a conversion rule.
  • the conversion weight can be a preset value, and business users can determine a reasonable value based on comprehensive consideration of parameters such as load and RPC time-consuming when different nodes are converted. Transformation weights can be positive or negative.
  • the conversion weight between any two nodes can be a fixed value or a variable value; for example, the time consumed by the conversion between two nodes can be checked regularly, and then the conversion weight can be adjusted according to the length of time consumed. update etc.
  • the conversion relationship between business data can be obtained according to the related information of the newly added edge (ie, the starting node, the target node, and the conversion relationship).
  • Step S220 taking each kind of business data as a node, and setting edges between corresponding nodes according to the conversion relationship between various business data;
  • Step S230 setting a weight for each edge to construct a directed acyclic graph model.
  • the DAG model can be displayed on the visual interface of the terminal device, and business users can view the DAG model by logging into the corresponding APP or web page and entering the management platform (such as dashboard).
  • the DAG model can be modified and updated by adding new nodes, adding edges, node management and edge management, so as to facilitate the business data of a certain business.
  • the directed acyclic graph model is adjusted in time to facilitate later data aggregation.
  • the step of searching the target data field in the data field of the target node includes:
  • the target data field is among the multiple target nodes.
  • the data field is usually in the form of key-value. In the process of extracting the data field, the value is extracted when the key is known, that is, the value is found by the key.
  • the data field may be a structure with a multi-layer structure and multiple fields, an algorithm is required to traverse the structure to find the value corresponding to the key when extracting the field.
  • the path search method is a path parsing method, which parses the path into an abstract syntax tree, and then traverses the abstract syntax tree to obtain the required data fields.
  • the abstract syntax tree is obtained by using the path parsing method for each shortest path, and then the sub-target data field can be obtained by traversing the abstract syntax tree.
  • the steps include:
  • Jsonpath is Stefan Goessner's path parsing method for json. Jsonpath can first parse this json data into an abstract syntax tree, and then perform traversal in the tree to obtain sub-target data fields. Jsonpathde parsing is very powerful, it can use a regular expression-like syntax to get the desired content, and it can support multiple coding languages, such as Javascript, python, PHP, and java.
  • the service data identifiers include initial state service data identifiers and final state service data identifiers; the start node is the initial state node, and the target node is the final state node; the nodes of the directed acyclic graph model include the initial state node, Intermediate state nodes and final state nodes; one of the initial state nodes corresponds to one or more intermediate state nodes and one or more final state nodes;
  • the initial state business data identifier find any node other than the most terminal node in the directed acyclic graph model, and determine it as the initial state node;
  • the node that has a direct or indirect conversion relationship with the initial state node is determined as the final state node;
  • the node that is located between the initial state node and the final state node, and has a direct or indirect conversion relationship with the initial state node or the final state node, is determined. is an intermediate node.
  • the business data aggregation process is divided into two parts: data conversion and combination, as shown in Figure 12.
  • the data conversion refers to converting one kind of business data into another kind of business data. If the initial service data before conversion is recorded as the initial state, and the target service data obtained after conversion is recorded as the final state (such as A, B, and C), then the services involved in the conversion process between the initial service data and the target service data are recorded as the final state.
  • the data is in the intermediate state (eg A1, A2, B1).
  • the uid needs to be converted into a double-column live room, then the uid is the initial state, the double-column live room is the final state, and the channel number between the uid and the double-column live room is the intermediate state.
  • its form is not fixed.
  • the process from the initial state to the intermediate state to the final state is called data conversion
  • the process of combining the final state to obtain the final data is called data combination.
  • the connection relationship (or transformation relationship) between nodes and nodes is the data transformation process.
  • which nodes correspond to the initial state, which nodes correspond to the intermediate state, and which nodes correspond to the final state can only be determined when specific business data is aggregated, that is, it is usually determined according to business data aggregation parameters.
  • the specific process is: determine the starting node, the target node and all paths from the starting node to the target node from the directed acyclic graph model according to the business data aggregation parameters; where the starting node corresponds to the initial state, the target node corresponds to the final state, and the starting node corresponds to the final state.
  • Other nodes on all paths from the start node to the target node correspond to intermediate states.
  • the nodes in the DAG model represent business data, the nodes can also be divided into initial state nodes, intermediate state nodes and final state nodes.
  • the initial state node, intermediate state node and final state node are not fixed; the number of initial state nodes is usually one, the initial state node corresponds to one or more intermediate state nodes, and the initial state node corresponds to one or more final state nodes state node.
  • the initial state node is any node other than the most terminal node in the directed acyclic graph model; the initial state node is determined according to the initial state service data identification; the final state node is located downstream of the initial state node and has a direct relationship with the initial state node. or indirect conversion relationship; the final state node is determined according to the final state service data identifier; the intermediate state node is located between the initial state node and the final state node, and has a direct or indirect conversion relationship with the initial state node or the final state node node.
  • the initial state node is usually the start node
  • the final state node is usually the target node.
  • the initial state node is any node other than the end node in the DAG model, that is, the initial state node cannot be the end node in the DAG model, because the end node cannot perform business data conversion.
  • the initial state node can usually be any node of the directed acyclic graph model; and the final node can be any one or more nodes downstream of the initial state node; and between the initial state node and the final state node Nodes on all paths between are intermediate nodes.
  • the initial state node and the final state node are determined according to the initial state service data identifier and the final state service data identifier.
  • the step of selecting the shortest path between the start node and the target node from the directed acyclic graph model by the dynamic path planning method includes:
  • selecting the shortest path between the starting node and the target node is usually to calculate the total weight value of all paths between the initial state node and the final state node. The smaller the total weight value is, the shorter the path is. Find the total weight value. The path with the smallest value is the shortest path.
  • the steps of calculating the total weight value of each path according to the weights of each edge of the path, and selecting the path corresponding to the smallest total weight value as the shortest path include:
  • Dijkstra's algorithm is used to select the shortest path by taking the weight of each edge as a positive value.
  • the Dijkstra algorithm is a greedy algorithm, which is a method for quickly determining the shortest path. But in the process of using Dijkstra algorithm, its weight value cannot be negative. In this example, if the Dijkstra algorithm is used to calculate the total weight value of each path, the weight value of each edge can only take a positive value.
  • the Floyd algorithm may be used to select the shortest path.
  • Floyd's algorithm is an algorithm for solving the shortest path between any two points, which can correctly handle the shortest path problem of directed graph or negative weight.
  • the algorithm used in determining the shortest path is not limited to the Dijkstra algorithm or the Floyd algorithm mentioned in this embodiment. According to the technical teachings of the present invention, those skilled in the art can also use other algorithms for shortest path planning.
  • steps in the flowcharts of FIG. 2 and FIG. 5 are sequentially displayed according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, the execution of these steps is not strictly limited to the order, and these steps may be performed in other orders. Moreover, at least a part of the steps in FIG. 2 and FIG. 5 may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but may be executed at different times. These sub-steps or stages are completed. The order of execution of the steps is not necessarily sequential, but may be performed alternately or alternately with other steps or at least part of sub-steps or stages of other steps.
  • a data aggregation method is described in detail in the above-mentioned embodiments disclosed in this application.
  • the above-mentioned method disclosed in this application can be implemented by various forms of equipment. Therefore, this application also discloses a data aggregation device corresponding to the above-mentioned method, which is given below. Specific embodiments are described in detail.
  • FIG. 13 is a data aggregation apparatus disclosed in an embodiment of the present application, which mainly includes:
  • the parameter acquisition module 130 is used for acquiring service data aggregation parameters;
  • the service data aggregation parameters include service data identifiers and target data fields;
  • the graph model obtaining module 132 is configured to obtain a directed acyclic graph model corresponding to the business data identifier
  • the node determination module 134 is used to determine the starting node and the target node in the directed acyclic graph model according to the service data identification; wherein, the directed acyclic graph model is based on the pre-acquired multiple service data and various service data. The conversion relationship between them is constructed;
  • the shortest path selection module 136 is used for selecting the shortest path between the starting node and the target node from the directed acyclic graph model according to the dynamic path planning method;
  • the target data field search module 138 is used to search according to the shortest path, and find the target data field in the data field of the target node;
  • the aggregated data obtaining module 1310 is configured to combine target data fields to obtain aggregated data, and the aggregated data is used for display on the page.
  • it also includes:
  • the data and relationship acquisition module is used to acquire various business data and conversion relationships between various business data
  • the node and edge setting module is used to take each business data as a node, and set edges between corresponding nodes according to the conversion relationship between various business data;
  • the weight setting module is used to set the weight for each edge
  • the number of target nodes is multiple;
  • the target data field search module further includes a sub-target data field search module and a sub-target data field combination module: the shortest path selection module is also used to select the starting node and each shortest path between target nodes;
  • the sub-target data field search module is used to search each shortest path by using the path search method, and find the sub-target data field from the data field of each target node;
  • the sub-target data field combining module is used for combining the sub-target data fields to obtain the target data fields.
  • the sub-target data field search module also includes a path parsing module and a traversal module: a path parsing module, for using the jsonpath method to perform path parsing on the data fields of each of the target nodes to form a tree structure;
  • the traversal module is used for traversing the tree structure to obtain sub-target data fields.
  • the service data identifiers include initial state service data identifiers and final state service data identifiers; the start node is the initial state node, and the target node is the final state node; the nodes of the directed acyclic graph model include the initial state node, Intermediate state nodes and final state nodes; one of the initial state nodes corresponds to one or more intermediate state nodes, and one or more final state nodes; also includes:
  • the initial state node determination module is used to find any node other than the most terminal node in the directed acyclic graph model according to the initial state service data identification, and determine it as the initial state node;
  • the final state node determination module is used to find the node in the directed acyclic graph model that is downstream of the initial state node and has a direct or indirect conversion relationship with the initial state node according to the final state node, and determines it as the final state node;
  • the intermediate state node determination module is used for determining a node located between the initial state node and the final state node and having a direct or indirect conversion relationship with the initial state node or the final state node as an intermediate state node.
  • it also includes:
  • All path selection modules are used to filter out all paths between the initial state node and the final state node from the directed acyclic graph model according to the initial state node, the intermediate state node and the final state node;
  • the total weight calculation module is used to calculate the total weight value of each path according to the weight of each edge of the path;
  • the shortest path selection module is also used to select the path corresponding to the smallest total weight value as the shortest path.
  • the shortest path selection module is further configured to adopt the Dijkstra algorithm to calculate the total weight value of each path by taking the weight of each edge as a positive value.
  • Each module in the above apparatus may be implemented in whole or in part by software, hardware and combinations thereof.
  • the above modules may be embedded in or independent of the processor in the terminal device in the form of hardware, or may be stored in the memory in the terminal device in the form of software, so that the processor can call and execute operations corresponding to the above modules.
  • FIG. 14 shows a structural block diagram of a terminal device provided by an embodiment of the present application.
  • the terminal device 140 may be a computer device.
  • the terminal device 140 in the present application may include one or more of the following components: a processor 142, a memory 144, and one or more application programs, wherein one or more application programs may be stored in the memory 142 and configured to be executed by a Executed by or multiple processors 144, one or more application programs are configured to execute the methods described in the foregoing method embodiments applied to terminal devices, and may also be configured to execute methods described in the foregoing method embodiments applied to data aggregation. method described.
  • Processor 144 may include one or more processing cores.
  • the processor 144 uses various interfaces and lines to connect various parts of the entire terminal device 140, and executes by running or executing the instructions, programs, code sets or instruction sets stored in the memory 142, and calling the data stored in the memory 142.
  • the processor 144 may adopt at least one of a digital signal processing (Digital Signal Processing, DSP), a Field-Programmable Gate Array (Field-Programmable Gate Array, FPGA), and a Programmable Logic Array (Programmable Logic Array, PLA).
  • DSP Digital Signal Processing
  • FPGA Field-Programmable Gate Array
  • PLA Programmable Logic Array
  • the processor 144 may integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a reporting verifier (Graphics Processing Unit, GPU) for buried point data, a modem, and the like.
  • CPU Central Processing Unit
  • GPU Graphics Processing Unit
  • the CPU mainly handles the operating system, user interface and application programs, etc.
  • the GPU is used for rendering and drawing of the display content
  • the modem is used to handle wireless communication. It can be understood that, the above-mentioned modem may not be integrated into the processor 134, and is implemented by a communication chip alone.
  • the memory 142 may include random access memory (Random Access Memory, RAM), or may include read-only memory (Read-Only Memory). Memory 142 may be used to store instructions, programs, codes, sets of codes, or sets of instructions.
  • the memory 142 may include a stored program area and a stored data area, wherein the stored program area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.) , instructions for implementing the following method embodiments, and the like.
  • the storage data area may also store data and the like created by the terminal device 140 in use.
  • FIG. 14 is only a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the terminal equipment to which the solution of the present application is applied.
  • the specific terminal device may be Include more or fewer components than shown in the figures, or combine certain components, or have a different arrangement of components.
  • the terminal device provided in the embodiments of the present application is used to implement the corresponding data aggregation method in the foregoing method embodiments, and has the beneficial effects of the corresponding method embodiments, which will not be repeated here.
  • FIG. 15 shows a structural block diagram of a computer-readable storage medium provided by an embodiment of the present application.
  • the computer-readable storage medium 150 stores program codes, and the program codes can be called by the processor to execute the methods described in the above data aggregation method embodiments, or can be invoked by the processor to execute the data aggregation method embodiments described above. Methods.
  • the computer readable storage medium 150 may be an electronic memory such as flash memory, EEPROM (Electrically Erasable Programmable Read Only Memory), EPROM, hard disk, or ROM.
  • the computer-readable storage medium 150 includes a non-transitory computer-readable storage medium.
  • the computer-readable storage medium 150 has storage space for program code 152 for performing any of the method steps in the above-described methods. These program codes can be read from or written to one or more computer program products.
  • the program code 152 may be compressed, for example, in a suitable form.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

A method and device for data aggregation, a terminal device, and a computer-readable storage medium. The method comprises: acquiring a service data aggregation parameter; the service data aggregation parameter comprising a service data identifier and target data fields; acquiring a directed acyclic graph model corresponding to the service data identifier, determining a starting node and a target node in the directed acyclic graph model on the basis of the service data identifier; selecting from the directed acyclic graph model the shortest path between the starting node and the target node on the basis of a dynamic path planning method; searching on the basis of the shortest path, looking for the target data fields in data fields of the target node; and combining the target data fields to produce aggregated data, the aggregated data being used for displaying on a page. The method allows, when a webpage needs to add a functional module, the functional module to be assembled quickly on the basis of a conversion scheme for service data, obviates the need to modify a large amount of data and program codes, thus increasing research and development efficiency.

Description

数据聚合方法、装置、终端设备和计算机可读存储介质Data aggregation method, apparatus, terminal device and computer-readable storage medium
本申请要求于2020年09月28日提交中国专利局、申请号为202011041479.5、发明名称为“数据聚合方法、装置、终端设备和计算机可读存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application with the application number 202011041479.5 and the invention titled "Data Aggregation Method, Apparatus, Terminal Equipment and Computer-readable Storage Medium" filed with the China Patent Office on September 28, 2020, the entire content of which is Incorporated herein by reference.
技术领域technical field
本申请涉及数据处理技术领域,具体涉及一种数据聚合方法、终端设备和计算机可读存储介质。The present application relates to the technical field of data processing, and in particular, to a data aggregation method, a terminal device and a computer-readable storage medium.
背景技术Background technique
对于网络平台而言,网页显示非常重要,例如电商平台的首页等页面会根据不同的节日显示不同内容。为了丰富网页显示能力以及显示形式,需要对网页不断进行更新。其中,在网页更新过程中,通常需要不断地增加更多的功能模块。但即便是同一类功能模块(例如都是要展示商品的模块),其展示的数据字段等也不完全相同,并且运营配置的方式也是多种多样的。可见,对于网络平台而言,每增加一个功能模块,都需要对相关的所有数据进行重新配置;即便是在原来的功能模块上进行微调,也需要修改大量的数据和相关程序代码,从而造成研发效率低,开发成本高。For online platforms, web page display is very important. For example, pages such as the homepage of an e-commerce platform will display different content according to different festivals. In order to enrich the display capability and display form of the webpage, the webpage needs to be continuously updated. Among them, in the process of updating the webpage, it is usually necessary to continuously add more functional modules. However, even for the same type of functional modules (for example, modules that display products), the data fields displayed are not exactly the same, and the operation and configuration methods are also various. It can be seen that for the network platform, every time a functional module is added, all related data needs to be reconfigured; even if the original functional module is fine-tuned, a large amount of data and related program codes need to be modified, resulting in R&D. Low efficiency and high development cost.
发明内容SUMMARY OF THE INVENTION
有鉴于此,本申请实施例中提供了一种数据聚合方法、终端设备和计算机可读存储介质,以克服现有技术在页面显示增加功能模块需要重新配置所有数据造成研发效率低,开发成本高的问题。In view of this, a data aggregation method, a terminal device and a computer-readable storage medium are provided in the embodiments of the present application, so as to overcome the need to reconfigure all data when adding functional modules in the page display in the prior art, resulting in low R&D efficiency and high development cost. The problem.
第一方面,本申请实施例提供了一种数据聚合方法,该方法包括:In a first aspect, an embodiment of the present application provides a data aggregation method, which includes:
获取业务数据聚合参数;所述业务数据聚合参数包括业务数据标识和目标数据字段;Obtain business data aggregation parameters; the business data aggregation parameters include business data identifiers and target data fields;
获取与所述业务数据标识对应的有向无环图模型,并根据所述业务数据标识在所述有向无环图模型中确定起始节点和目标节点;其中,所述有 向无环图模型是根据预先获取的多种业务数据以及各种业务数据之间的转换关系构建的;Obtain a directed acyclic graph model corresponding to the business data identifier, and determine a start node and a target node in the directed acyclic graph model according to the business data identifier; wherein, the directed acyclic graph The model is constructed based on pre-acquired various business data and the conversion relationship between various business data;
根据动态路径规划法从所述有向无环图模型中选择所述起始节点与所述目标节点之间最短路径;Selecting the shortest path between the starting node and the target node from the directed acyclic graph model according to the dynamic path planning method;
根据所述最短路径进行搜索,在所述目标节点的数据字段中查找所述目标数据字段;Search according to the shortest path, and find the target data field in the data field of the target node;
将所述目标数据字段进行组合,得到聚合数据,所述聚合数据用于在页面上进行显示。The target data fields are combined to obtain aggregated data, and the aggregated data is used for display on the page.
第二方面,本申请实施例提供了一种数据聚合装置,该装置包括:In a second aspect, an embodiment of the present application provides a data aggregation apparatus, and the apparatus includes:
参数获取模块,用于获取业务数据聚合参数;所述业务数据聚合参数包括业务数据标识和目标数据字段;a parameter acquisition module for acquiring business data aggregation parameters; the business data aggregation parameters include a business data identifier and a target data field;
图模型获取模块,用于获取与所述业务数据标识对应的有向无环图模型;A graph model obtaining module, configured to obtain a directed acyclic graph model corresponding to the business data identifier;
节点确定模块,用于根据所述业务数据标识在所述有向无环图模型中确定起始节点和目标节点;其中,所述有向无环图模型是根据预先获取的多种业务数据以及各种业务数据之间的转换关系构建的;A node determination module, configured to determine a start node and a target node in the directed acyclic graph model according to the service data identifier; wherein the directed acyclic graph model is based on pre-acquired multiple service data and The transformation relationship between various business data is constructed;
最短路径选择模块,用于根据动态路径规划法从所述有向无环图模型中选择所述起始节点与所述目标节点之间最短路径;a shortest path selection module, configured to select the shortest path between the start node and the target node from the directed acyclic graph model according to a dynamic path planning method;
目标数据字段查找模块,用于根据所述最短路径进行搜索,在所述目标节点的数据字段中查找所述目标数据字段;a target data field search module, configured to search according to the shortest path, and find the target data field in the data field of the target node;
聚合数据得到模块,用于将所述目标数据字段进行组合,得到聚合数据,所述聚合数据用于在页面上进行显示。The aggregated data obtaining module is used for combining the target data fields to obtain aggregated data, and the aggregated data is used for displaying on the page.
第三方面,本申请实施例提供了一种终端设备,包括:存储器;一个或多个处理器,与所述存储器耦接;一个或多个应用程序,其中,一个或多个应用程序被存储在存储器中并被配置为由一个或多个处理器执行,一个或多个应用程序配置用于执行上述第一方面提供的数据聚合方法。In a third aspect, embodiments of the present application provide a terminal device, including: a memory; one or more processors coupled to the memory; and one or more application programs, wherein the one or more application programs are stored In the memory and configured to be executed by one or more processors, one or more application programs are configured to execute the data aggregation method provided by the above first aspect.
第四方面,本申请实施例提供了一种计算机可读取存储介质,计算机可读取存储介质中存储有程序代码,程序代码可被处理器调用执行上述第一方面提供的数据聚合方法。In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, where a program code is stored in the computer-readable storage medium, and the program code can be invoked by a processor to execute the data aggregation method provided in the first aspect.
本申请实施例提供的一种数据聚合方法、装置、终端设备及存储介质,获取业务数据聚合参数,其中业务数据聚合参数包括业务数据标识和目标数据字段;根据业务数据标识来获取相应的有向无环图模型,并在有向无环图模型中确定起始节点和目标节点;有向无环图模型是根据预先获取的多种业务数据以及各种业务数据之间的转换关系构建的;然后根据动态路径规划法从有向无环图模型中选出起始节点与目标节点之间最短路径;根据最短路径进行搜索,在目标节点的数据字段中查找目标数据字段;将目标数据字段进行组合,得到聚合数据。本申请的采用有向无环图模型来表示多种业务数据之间的转换关系,只要知道起始节点和目标节点就可以确定出从一种业务数据(即起始节点对应的业务数据)到另一种业务数据(即目标节点对应的业务数据)的所有转换方式,然后通过最短路径来选择最佳转换方式,根据最佳的转换方式可以快速地通过一种业务数据来查找或搜索到另一种业务数据中存在的目标数据字段,将目标数据字段进行组合得到聚合数据,该聚合数据可以在网络平台的页面上进行显示来实现某一功能,该方法可以在网页需要增加功能模块时根据业务数据的转换方式快速组合出该功能模块,并不需要修改大量的数据和相关程序代码,从而提高研发效率,大大降低开发成本。A data aggregation method, device, terminal device, and storage medium provided by the embodiments of the present application acquire service data aggregation parameters, wherein the service data aggregation parameters include a service data identifier and a target data field; and obtain corresponding directed data according to the service data identifier. Acyclic graph model, and the starting node and target node are determined in the directed acyclic graph model; the directed acyclic graph model is constructed according to the pre-acquired various business data and the conversion relationship between various business data; Then select the shortest path between the starting node and the target node from the directed acyclic graph model according to the dynamic path planning method; search according to the shortest path, and find the target data field in the data field of the target node; combined to get aggregated data. The directed acyclic graph model of the present application is used to represent the conversion relationship between various business data. As long as the starting node and the target node are known, it is possible to determine from one business data (that is, the business data corresponding to the starting node) to the starting node. All conversion methods of another business data (that is, the business data corresponding to the target node), and then select the best conversion method through the shortest path. According to the best conversion method, you can quickly find or search for another business data through the A target data field existing in business data, the target data fields are combined to obtain aggregated data, the aggregated data can be displayed on the page of the network platform to achieve a certain function, this method can be used when the webpage needs to add function modules. The conversion method of business data quickly combines the function module without modifying a large amount of data and related program codes, thereby improving R&D efficiency and greatly reducing development costs.
附图说明Description of drawings
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据提供的附图获得其他的附图。In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the accompanying drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are only It is an embodiment of the present application. For those of ordinary skill in the art, other drawings can also be obtained according to the provided drawings without any creative effort.
图1为本申请实施例提供的数据聚合方法的应用场景示意图;FIG. 1 is a schematic diagram of an application scenario of a data aggregation method provided by an embodiment of the present application;
图2为本申请一个实施例提供的方法的流程示意图;2 is a schematic flowchart of a method provided by an embodiment of the present application;
图3为本申请一个实施例提供的有向无环图模型的结构示意图;3 is a schematic structural diagram of a directed acyclic graph model provided by an embodiment of the present application;
图4为本申请一个实施例提供的聚合数据显示的可视化界面图;FIG. 4 is a visual interface diagram of aggregated data display provided by an embodiment of the present application;
图5为本申请一个实施例提供的有向无环图模型构建过程的流程示意图;5 is a schematic flowchart of a directed acyclic graph model construction process provided by an embodiment of the present application;
图6为本申请一个实施例提供的新增节点的可视化界面图;FIG. 6 is a visual interface diagram of a newly added node provided by an embodiment of the present application;
图7为本申请一个实施例提供的新增边的可视化界面图;FIG. 7 is a visual interface diagram of a newly added edge provided by an embodiment of the present application;
图8为本申请一个实施例提供的节点管理的可视化界面图;FIG. 8 is a visual interface diagram of node management provided by an embodiment of the present application;
图9为本申请一个实施例提供的边管理的可视化界面图;FIG. 9 is a visual interface diagram of edge management provided by an embodiment of the present application;
图10为申请一个实施例提供的有向无环图模型可视化界面图;10 is a directed acyclic graph model visualization interface diagram provided by an embodiment of the application;
图11为本申请一个实施例中提供的子目标数据字段进行组合的示意图;11 is a schematic diagram of combining sub-target data fields provided in an embodiment of the application;
图12为本申请一个实施例中提供业务数据聚合过程的示意图;12 is a schematic diagram of a process of providing business data aggregation in an embodiment of the application;
图13为本申请一个实施例中提供的数据聚合装置的结构示意图;13 is a schematic structural diagram of a data aggregation apparatus provided in an embodiment of the present application;
图14为本申请一个实施例中提供的终端设备的结构示意图;FIG. 14 is a schematic structural diagram of a terminal device provided in an embodiment of the application;
图15为本申请一个实施例中提供的计算机可读存储介质的结构示意图。FIG. 15 is a schematic structural diagram of a computer-readable storage medium provided in an embodiment of the present application.
具体实施方式detailed description
下面将对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The technical solutions in the embodiments of the present application will be clearly and completely described below. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
为了更详细说明本申请,下面结合附图对本申请提供的一种数据聚合方法、装置、终端设备和计算机存储介质,进行具体地描述。In order to describe the present application in more detail, a data aggregation method, apparatus, terminal device and computer storage medium provided by the present application will be specifically described below with reference to the accompanying drawings.
请参考图1,图1示出了本申请实施例提供的数据聚合方法的应用场景的示意图,该应用场景包括本申请实施例提供的终端设备100,终端设备100可以是具有显示屏的各种电子设备(如102、104、106和108的结构图),包括但不限于智能手机和计算机设备,其中计算机设备可以是台式计算机、便携式计算机、膝上型计算机、平板电脑等设备中的至少一种。终端设备100可以安装并运行用于业务数据聚合参数获取的相关应用程序,用户可以通过在终端设备100的可视化界面上设置业务数据聚合的相关信息,如业务数据等信息,终端设备100可以对用户设置的信息进行获取,并根据获取到的信息来进行业务数据聚合参数的获取等。另外,用户 可以通过在终端设备100的可视化界面上设置业务数据、业务数据之间的转换关系的相关信息,终端设备100可以根据用户设置业务数据、业务数据之间的转换关系的相关信息来获取业务数据(其中包括业务数据标识、数据类型、数据字段等)和业务数据之间的转换关系,并根据业务数据和业务数据之间的转换关系来构建有向无环图模型。此外,该终端设备100还可以设置有至少一种数据库,用于存储有向无环图模型等。终端设备100可以泛指多个终端设备中的一个,本实施例仅以终端设备100来举例说明。本领域技术人员可以知晓,上述终端设备的数量可以更多或更少。比如上述终端设备可以仅为几个,或者上述终端设备为几十个或几百个,或者更多数量,本申请实施例对终端设备的数量和类型不加以限定。终端设备100可以用来执行本申请实施例中提供的一种数据聚合方法。Please refer to FIG. 1. FIG. 1 shows a schematic diagram of an application scenario of the data aggregation method provided by the embodiment of the present application. The application scenario includes the terminal device 100 provided by the embodiment of the present application. The terminal device 100 may be various types of display screens. Electronic equipment (such as the structural diagrams of 102, 104, 106 and 108), including but not limited to smart phones and computer equipment, wherein the computer equipment can be at least one of a desktop computer, a portable computer, a laptop computer, a tablet computer, etc. kind. The terminal device 100 can install and run related application programs for obtaining business data aggregation parameters. The user can set relevant information about business data aggregation, such as business data and other information, on the visual interface of the terminal device 100. The set information is obtained, and the business data aggregation parameters are obtained according to the obtained information. In addition, the user can set the relevant information of the service data and the conversion relationship between the service data on the visual interface of the terminal device 100, and the terminal device 100 can obtain the relevant information according to the user's setting of the service data and the conversion relationship between the service data The transformation relationship between business data (including business data identifiers, data types, data fields, etc.) and business data, and a directed acyclic graph model is constructed according to the business data and the transformation relationship between business data. In addition, the terminal device 100 may also be provided with at least one kind of database for storing the directed acyclic graph model and the like. The terminal device 100 may generally refer to one of multiple terminal devices, and this embodiment only takes the terminal device 100 as an example for illustration. Those skilled in the art may know that the number of the above-mentioned terminal devices may be more or less. For example, the above-mentioned terminal devices may be only a few, or the above-mentioned terminal devices may be dozens or hundreds, or more, and the embodiments of the present application do not limit the number and type of the terminal devices. The terminal device 100 may be used to execute a data aggregation method provided in this embodiment of the present application.
在一种可选的实施方式中,该应用场景包括本申请实施例提供的终端设备100之外,还可以包括服务器,其中服务器与终端设备之间设置有网络。网络用于在终端设备和服务器之间提供通信链路的介质。网络可以包括各种连接类型,例如有线、无线通信链路或者光纤电缆等等。In an optional implementation manner, the application scenario includes, in addition to the terminal device 100 provided in the embodiment of the present application, a server, where a network is set between the server and the terminal device. A network is a medium used to provide a communication link between an end device and a server. A network may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
应该理解,终端设备、网络和服务器的数目仅仅是示意性的。根据实现需要,可以具有任意数目的终端设备、网络和服务器。比如服务器可以是多个服务器组成的服务器集群等。其中,终端设备通过网络与服务器交互,以接收或发送消息等。服务器可以是提供各种服务的服务器。其中服务器可以用来执行本申请实施例中提供的一种数据聚合方法中除了可视化显示(例如聚合数据显示)之外的步骤。此外,终端设备在执行本申请实施例中提供的一种数据聚合方法时,可以将一部分步骤在终端设备执行,一部分步骤在服务器执行,在这里不进行限定。It should be understood that the numbers of terminal devices, networks and servers are merely exemplary. There can be any number of terminal devices, networks and servers according to implementation needs. For example, the server may be a server cluster composed of multiple servers. The terminal device interacts with the server through the network to receive or send messages and the like. The server may be a server that provides various services. The server may be used to perform steps other than visual display (eg, aggregated data display) in the data aggregation method provided in the embodiments of the present application. In addition, when the terminal device executes the data aggregation method provided in the embodiment of the present application, some steps may be executed on the terminal device, and some steps may be executed on the server, which is not limited herein.
对于网络平台而言,网页显示非常重要,例如电商平台的首页等页面会根据不同的节日显示不同内容。在一件首页的研发过程中,为了丰富首页的内容和展示样式,产品通常都会不断的提出更多的模块。但即便是都要展示商品的模块,不同模块要展示的数据字段也是有出入的。同时,运营配置的方式也是多种多样的。为了便于理解,下面给出举例进行说明。For online platforms, web page display is very important. For example, pages such as the homepage of an e-commerce platform will display different content according to different festivals. In the development process of a homepage, in order to enrich the content and display style of the homepage, the product usually proposes more modules. But even in modules that need to display products, the data fields to be displayed by different modules are different. At the same time, there are various ways of operating the configuration. For ease of understanding, examples are given below for illustration.
例如,模块A要求允许运营人员通过商家ID、店铺ID或商品SKU 进行配置,需要在模块上展示商品名称、商品图片、商品市场价、商品折扣价、商品销量、商品库存。那么需要通过以下数据获取逻辑实现:For example, module A requires operators to configure through merchant ID, store ID or product SKU, and needs to display product name, product image, product market price, product discount price, product sales, and product inventory on the module. Then it needs to be implemented through the following data acquisition logic:
①商家ID-->list<店铺ID>-->list<商品SKU>-->list<商品详情>-->list<视图数据A>① Merchant ID-->list<Store ID>-->list<Product SKU>-->list<Product Details>-->list<View Data A>
②店铺ID-->list<商品SKU>-->list<商品详情>-->list<视图数据A>②Store ID-->list<Product SKU>-->list<Product Details>-->list<View Data A>
③商品SKU-->商品详情-->视图数据A③Product SKU-->Product Details-->View Data A
模块B要求允许运营人员通过商家ID、店铺ID、商品SKU进行配置,需要在模块上展示商品图片、商品折扣价、商品返利点数。那么需要通过以下数据获取逻辑实现:Module B requires operators to configure through merchant ID, store ID, and product SKU. It is necessary to display product pictures, product discount prices, and product rebate points on the module. Then it needs to be implemented through the following data acquisition logic:
①商家ID-->list<店铺ID>-->list<商品SKU>-->list<商品详情>-->list<视图数据B>① Merchant ID-->list<Store ID>-->list<Product SKU>-->list<Product Details>-->list<View Data B>
②店铺ID-->list<商品SKU>-->list<商品详情>-->list<视图数据B>②Store ID-->list<Product SKU>-->list<Product Details>-->list<View Data B>
③商品SKU-->商品详情-->视图数据B③Product SKU-->Product Details-->View Data B
将上述的每一条数据获取和转换的链路称为一个Fetcher,可以看出每次增加一种模块,都需要添加很多Fetcher,而Fetcher的逻辑大多相似,造成研发需要编写很多重复性代码,效率较低。而且在现实场景中数据获取与转换过程远比这上述案例的结构复杂,通常情况下不仅需要获取商品的数据,而且需要直播间、店铺、分销等信息,在这个过程中需要进行多次RPC调用,冗余代码会更多且开发难度较大,其中RPC,即远程调用,是指指跨进程的调用,或跨网络的调用。Calling each of the above data acquisition and conversion links as a Fetcher, it can be seen that each time a module is added, a lot of Fetchers need to be added, and the logic of Fetchers is mostly similar, resulting in the need to write a lot of repetitive code for R&D, efficiency lower. Moreover, the data acquisition and conversion process in the real scene is far more complicated than the structure of the above case. Usually, not only the data of the product needs to be obtained, but also the information of the live broadcast room, store, distribution and so on. In this process, multiple RPC calls are required. , the redundant code will be more and the development is more difficult, among which RPC, that is, remote call, refers to the call across the process, or the call across the network.
基于此,本申请实施例中提供了一种数据聚合方法。请参阅图2,图2示出了本申请实施例提供的一种数据聚合方法的流程示意图,以该方法应用于图1中的终端设备为例进行说明,包括以下步骤:Based on this, an embodiment of the present application provides a data aggregation method. Please refer to FIG. 2. FIG. 2 shows a schematic flowchart of a data aggregation method provided by an embodiment of the present application. The method is applied to the terminal device in FIG. 1 as an example for description, including the following steps:
步骤S110,获取业务数据聚合参数;业务数据聚合参数包括业务数据标识和目标数据字段;Step S110, obtaining business data aggregation parameters; the business data aggregation parameters include business data identifiers and target data fields;
一般来说,不同的业务都有与该业务相匹配的数据,即不同业务具有与之对应的数据类型,例如电商业务包括有商家数据、店铺数据、商品数据、sellerid、sku等;直播业务包括直播频道数据、直播间数据、直播内容数据等;娱乐业务包括节目数据、主持数据等;娱乐业务包括anchord、 guildld等。另外,不同业务之间的数据可能存在交叉,如电商业务与直播业务之间可以存商家数据、店铺数据、商品数据、直播频道数据、直播间数据、直播内容数据。可见,业务数据可以是多种多样的,具体地可以通过业务使用方或用户根据实际需求进行设置或自定义。Generally speaking, different businesses have data matching the business, that is, different businesses have corresponding data types. For example, e-commerce business includes business data, store data, commodity data, sellerid, sku, etc.; live broadcast business Including live channel data, live room data, live content data, etc.; entertainment business includes program data, hosting data, etc.; entertainment business includes anchord, guildld, etc. In addition, data between different services may overlap, for example, merchant data, store data, commodity data, live broadcast channel data, live broadcast room data, and live broadcast content data can be stored between e-commerce business and live broadcast business. It can be seen that the business data can be various, and specifically can be set or customized by the business user or user according to actual needs.
其中,业务数据聚合参数是指与业务数据聚合过程相关的一些信息,可以包括业务数据标识、目标数据字段;业务数据标识是用于对业务数据进行标识的信息,该标识主要用于索引业务数据,便于确定有向无环图模型以及起始节点、目标节点,其中业务数据标识是唯一的,即一个业务数据标识只能用于标识一个业务数据。业务数据标识的形式可以是多种的,可以是由字符(例如字母和数字等)组合形成。Among them, the business data aggregation parameters refer to some information related to the business data aggregation process, which may include business data identifiers and target data fields; business data identifiers are information used to identify business data, and the identifiers are mainly used for indexing business data. , it is convenient to determine the directed acyclic graph model and the starting node and the target node, wherein the service data identifier is unique, that is, one service data identifier can only be used to identify one service data. The service data identification can be in various forms, and can be formed by a combination of characters (such as letters and numbers, etc.).
目标数据字段是指需要从目标节点中获取的所需的字段。The target data field refers to the required field that needs to be obtained from the target node.
在一种可选的实施方式中,在获取业务数据聚合参数的步骤之前,数据聚合方法还可以包括接收业务数据聚合请求,业务数据聚合请求主要用于传递业务数据聚合参数;终端设备响应于数据聚合请求,从而获取业务数据聚合参数。其中该业务数据聚合请求的发送对象可以是外围系统或者其他设备。In an optional embodiment, before the step of acquiring service data aggregation parameters, the data aggregation method may further include receiving a service data aggregation request, where the service data aggregation request is mainly used to transmit service data aggregation parameters; the terminal device responds to the data Aggregate requests to obtain business data aggregation parameters. The sending object of the service data aggregation request may be a peripheral system or other devices.
在另一种可选的实施方式中,终端设备可以通过可视化界面来进行业务数据聚合参数的获取,例如,终端设备可以根据新增任务界面来获取到业务数据聚合时的业务数据、所需数据字段等从而来确定业务数据标识、目标数据字段等信息。In another optional implementation manner, the terminal device can obtain business data aggregation parameters through a visual interface. For example, the terminal device can obtain business data and required data during business data aggregation according to the newly added task interface. Fields, etc., to determine information such as business data identifiers, target data fields, and so on.
其中,一个数据聚合任务可以对应一个新增任务界面,该新增任务界面可以基于各个不同的设置对象提供多个子界面,共同构成该新增任务界面,该多个子界面之间可以是基于确认操作的连续启动关系。也即是,当一个子界面的内容被设置完成后,可以由用户在该子界面上通过手动操作,来触发下一个子界面的显示。例如,该新增任务界面可以包括业务数据设置界面、所需数据字段设置界面等多个子界面,可选地,该新增任务界面还可以包括其他子界面,本申请实施例对此不加以限定。用户可以在可视化界面上根据自己的需求,填写应用需要聚合的业务数据、所需数据字段等。另外,新增任务界面可以包括业务数据、所需数据字段选择界面,该 界面上有诸多业务数据、所需数据字段选项,用户可以直接在相应界面上直接选择业务数据、所需数据字段。Among them, a data aggregation task can correspond to a new task interface, and the new task interface can provide multiple sub-interfaces based on different setting objects, which together constitute the new task interface, and the multiple sub-interfaces can be based on confirmation operations. of consecutive initiation relationships. That is, after the content of one sub-interface is set, the user can trigger the display of the next sub-interface through manual operation on the sub-interface. For example, the newly added task interface may include multiple sub-interfaces such as a business data setting interface, a required data field setting interface, etc. Optionally, the newly added task interface may also include other sub-interfaces, which are not limited in this embodiment of the present application . On the visual interface, users can fill in the business data and required data fields that the application needs to aggregate according to their needs. In addition, the newly added task interface may include a business data and required data field selection interface. There are many business data and required data field options on this interface. Users can directly select business data and required data fields on the corresponding interface.
步骤S120,获取与业务数据标识对应的有向无环图模型,并根据业务数据标识在有向无环图模型中确定起始节点和目标节点;其中,有向无环图模型是根据预先获取的不同种类业务数据以及各种业务数据之间的转换关系构建的;Step S120, obtaining the directed acyclic graph model corresponding to the business data identifier, and determining the starting node and the target node in the directed acyclic graph model according to the business data identifier; It is constructed by different types of business data and the conversion relationship between various business data;
有向无环图又称为DAG图,在图论中,如果一个有向图从任意顶点出发无法经过若干条边回到该点,则该图是一个DAG。因为有向图中一个点经过两种路线到达另一个点未必形成环,因此有向无环图未必能转化成树,但任何有向树均为有向无环图。A directed acyclic graph is also known as a DAG graph. In graph theory, if a directed graph starts from any vertex and cannot return to the point through several edges, the graph is a DAG. Because a point in a directed graph goes through two routes to another point, it may not form a cycle, so a directed acyclic graph may not be converted into a tree, but any directed tree is a directed acyclic graph.
有向无环图模型是一个预先构建的DAG图结构,该DAG图结构是根据一个业务中相关的业务数据、以及这些业务数据之间的转换关系构建的;其中DAG图结构的构建过程可以表示为一个可视化的DAG,该DAG中有很多条路径,每个路径上有若干个节点,每个节点对应于一种业务数据,每个节点之间的边表示该边对应的两个节点的业务数据可以进行转换,即通过一种业务数据可以查询或搜索到另一种业务数据。一种业务数据包括业务数据名称(在节点中就对应节点名称)、业务数据标识(在节点中就对应节点标识)、数据类型(是指计算机语言中常说的整数型、浮点型等例如string、number、object、array等)、数据字段(即存储有哪些具体的数据)。The directed acyclic graph model is a pre-built DAG graph structure. The DAG graph structure is constructed according to the related business data in a business and the conversion relationship between these business data; the construction process of the DAG graph structure can be expressed as It is a visual DAG. There are many paths in the DAG, each path has several nodes, each node corresponds to a kind of business data, and the edge between each node represents the business of the two nodes corresponding to the edge. Data can be transformed, that is, one kind of business data can be queried or searched for another kind of business data. A kind of business data includes business data name (corresponding to the node name in the node), business data identifier (corresponding to the node identifier in the node), data type (referring to the integer type, floating point type, etc., which are often said in computer languages, such as string , number, object, array, etc.), data fields (that is, what specific data is stored).
其中,转换关系可以是直接转换关系和间接转换关系;直接相连的两个节点具有直接转换关系;两个节点通过其他节点相连表示这两个节点有间接转换关系。有直接关系表示这两个节点对应的业务数据可以直接进行转换,有间接关系表示这两个节点对应的业务数据可以通过中间态进行转换。例如A与B相连,表示A与B有直接连接关系,A可以直接转换成B;A通过C与B相连,表示A与C有间接连接关系,A可以先转换成C(中间态)再转换成B。另外,转换关系可以表示为转换方式或转换算法。Among them, the conversion relationship can be a direct conversion relationship and an indirect conversion relationship; two nodes that are directly connected have a direct conversion relationship; two nodes are connected through other nodes, indicating that the two nodes have an indirect conversion relationship. A direct relationship indicates that the business data corresponding to the two nodes can be directly converted, and an indirect relationship indicates that the business data corresponding to the two nodes can be converted through an intermediate state. For example, if A is connected to B, it means that A and B have a direct connection relationship, and A can be directly converted into B; A is connected to B through C, which means that A and C have an indirect connection relationship, and A can be converted into C (intermediate state) first and then converted into B. In addition, the conversion relationship can be expressed as a conversion method or a conversion algorithm.
为了便于理解,给出一个详细的实施例;该实施例中以电商业务为例来说明有向无环图模型的构建过程,其中电商业务包括的业务数据有uid、商品、横划商品、选品、频道、双栏直播间以及大通栏直播间;根据这些 业务数据之间的转换关系可以构建出有向无环图模型。其结果如图3所示,图中的每一个节点都对应一种业务数据(为了显示的方便,在有向无环图模型中通常用业务数据标识来表示节点)。从图3可知,uid与频道号、商品id、双栏直播间、大通栏直播间具有直接转换关系,uid与大通栏直播间也可以是间接连接关系,uid与横划商品、选品都有间接连接关系。其中,uid(user identification)用户身份证明,通常情况下用户在注册网络平台后,系统会自动地给用户一个uid的数值。In order to facilitate understanding, a detailed example is given; in this example, an e-commerce business is used as an example to illustrate the construction process of a directed acyclic graph model, wherein the business data included in the e-commerce business includes uid, commodity, and horizontally drawn commodity. , selection, channel, double-column live room and Datong column live room; according to the conversion relationship between these business data, a directed acyclic graph model can be constructed. The result is shown in Figure 3, where each node in the figure corresponds to a kind of business data (for the convenience of display, the business data identifier is usually used to represent the node in the directed acyclic graph model). As can be seen from Figure 3, uid has a direct conversion relationship with channel number, commodity id, double-column live room, and Chase bar live room, and uid and Chase bar live room can also be indirectly connected, uid and horizontally drawn products and selections have both Indirect connection relationship. Among them, uid (user identification) user identity certificate, usually after the user registers the network platform, the system will automatically give the user a uid value.
需要说明的是,实施例中提到的电商业务仅仅只是为了用来说明有向无环图模型的结构,有向无环图模型并不限于只能使用在电商业务,也可以是娱乐业务、直播业务等。It should be noted that the e-commerce business mentioned in the embodiment is only used to illustrate the structure of the DAG model, and the DAG model is not limited to only be used in e-commerce business, but also for entertainment. business, live broadcast, etc.
由于有向无环图模型是根据业务数据和业务数据之间的转换关系确定的,可见有向无环图模型跟不同的业务有关,即不同业务对应不同的有向无环图模型。在需要进行数据聚合时,可以根据业务数据标识来确定相应的有向无环图模型。由于有向无环图模型的节点中包括业务数据标识这一信息,那么在需要进行数据聚合时,就根据业务数据聚合参数的业务数据标识来确定起始节点和目标节点,业务数据标识至少有两个,分别用来确定起始节点和目标节点。可选地,目标节点可以是多个,那么业务数据标识数量也要相应增加。Since the DAG model is determined according to the conversion relationship between business data and business data, it can be seen that the DAG model is related to different businesses, that is, different businesses correspond to different DAG models. When data aggregation is required, the corresponding directed acyclic graph model can be determined according to the business data identifier. Since the nodes of the DAG model include business data identifiers, when data aggregation is required, the starting node and the target node are determined according to the business data identifiers of the business data aggregation parameters. The business data identifiers have at least Two, used to determine the starting node and the target node, respectively. Optionally, there may be multiple target nodes, and the number of service data identifiers should also be increased accordingly.
此外,还需要说明的是,有向无环图模型只是反映了节点到节点之间的转换关系,用来表示某一业务中各业务数据之间的转换关系。只有在具体的业务数据聚合过程中,通过业务聚合参数来指定起始节点、终点节点等之后才能确定实际转换路径。In addition, it should also be noted that the directed acyclic graph model only reflects the transformation relationship between nodes, and is used to represent the transformation relationship between various business data in a certain business. The actual conversion path can be determined only after the start node, end node, etc. are specified through service aggregation parameters in the specific service data aggregation process.
另外,有向无环图模型可以保存在终端设备的存储装置(例如数据库)中,也可以保存在服务器或者其他设备中;在终端设备需要使用有向无环图模型时,可以从存储装置,服务器或其他设备中获取。In addition, the DAG model can be stored in the storage device (such as a database) of the terminal device, or in the server or other devices; when the terminal device needs to use the DAG model, it can be stored from the storage device, obtained from a server or other device.
步骤S130,根据动态路径规划法从有向无环图模型中选择起始节点与目标节点之间最短路径;Step S130, selecting the shortest path between the start node and the target node from the directed acyclic graph model according to the dynamic path planning method;
具体地,对应任意两个节点而言,他们之间可能存在1条或多条路径,也可能不存在路径。如果想把一个节点对应的业务数据转换成另一个节点 对应的业务数据,需要在这两个节点之间找到一条最短路径,然后执行这条最短路径的边即可完成数据转换。在本实施例中,采用动态路径规划法来确定最短路径。如图3所示,例如要实现uid到双栏直播间的转换,可以通过uid到双栏直播间的直接转换,也可以是先从uid转换成频道号再根据频道号转换成双栏直播间,我们需要确定这两条转换路径那一条是最短路径,如果通过计算从uid转换成频道号再根据频道号转换成双栏直播间这个路径为最短路径,就选择该路径对应的转换方法来完成从uid到双栏直播间的业务数据转换。Specifically, for any two nodes, there may be one or more paths between them, or there may be no path. If you want to convert the business data corresponding to one node to the business data corresponding to another node, you need to find a shortest path between the two nodes, and then execute the edge of the shortest path to complete the data conversion. In this embodiment, a dynamic path planning method is used to determine the shortest path. As shown in Figure 3, for example, to realize the conversion of uid to double-column live room, you can directly convert uid to double-column live room, or you can first convert uid to channel number and then convert to double-column live room according to the channel number , we need to determine which of the two conversion paths is the shortest path. If the path is the shortest path by calculating the conversion from uid to channel number and then according to the channel number to double-column live room, select the conversion method corresponding to the path to complete Business data conversion from uid to double-column live broadcast room.
步骤S140,根据最短路径进行搜索,在目标节点的数据字段中查找目标数据字段;Step S140, searching according to the shortest path, and finding the target data field in the data field of the target node;
在得到最短路径后,根据最短路径可以实现从起始节点的业务数据到目标节点的业务数据的转换。然后根据转换路径进行搜索,在目标节点的数据字段中查找目标数据字段。After the shortest path is obtained, the conversion from the service data of the starting node to the service data of the target node can be realized according to the shortest path. Then search according to the conversion path to find the target data field in the data field of the target node.
紧接上面的例子,如图3所示,从uid转换成频道号再根据频道号转换成双栏直播间这个路径为最短路径,即形成uid-频道号-双栏直播间这个转换路径,在进行目标数据字段查找时,首先是根据uid找到频道号,再根据频道号找到双栏直播间,然后在双栏直播间中来查找目标数据字段。在具体的实施过程中,通常需要给uid赋一个值才能找到目标数据字段,例如uid=123456。Immediately after the above example, as shown in Figure 3, the path from uid to channel number and then converted to double-column live room according to the channel number is the shortest path, that is, the conversion path of uid-channel number-double-column live room is formed. When searching for the target data field, first find the channel number according to the uid, then find the double-column live room according to the channel number, and then find the target data field in the double-column live room. In a specific implementation process, it is usually necessary to assign a value to the uid to find the target data field, for example, uid=123456.
步骤S150,将目标数据字段进行组合,得到聚合数据,聚合数据用于在页面上进行显示。In step S150, the target data fields are combined to obtain aggregated data, and the aggregated data is used for display on the page.
具体地,目标数据字段通常包括不只一个数据字段,所以需要将这些数据字段进行组合,才能得到聚合数据。其中,聚合数据用于在页面上进行显示,从而来实现某种功能,如图4所示,可以将店铺信息中的店铺id、店铺等级的目标数据字段,以及直播间信息中的直播间号、直播标题和开播封面等目标数据字段进行组合,得到聚合数据并显示在终端设备的可视化页面中(如图4中的结果预览)。Specifically, the target data field usually includes more than one data field, so these data fields need to be combined to obtain aggregated data. Among them, the aggregated data is used to display on the page to achieve a certain function. As shown in Figure 4, the store id in the store information, the target data field of the store level, and the live broadcast room number in the live broadcast room information can be used. , live broadcast title and broadcast cover and other target data fields are combined to obtain aggregated data and display it on the visualization page of the terminal device (as shown in the result preview in Figure 4).
本申请实施例提供的数据聚合方法,获取业务数据聚合参数,其中业务数据聚合参数包括业务数据标识和目标数据字段;根据业务数据标识来 获取相应的有向无环图模型,并在有向无环图模型中确定起始节点和目标节点;有向无环图模型是根据预先获取的多种业务数据以及各种业务数据之间的转换关系构建的,其中有向无环图模型的每个节点表示一种业务数据,有向无环图模型的边表示相连的两种业务数据之间的转换关系;业务数据包括业务数据标识和数据字段;然后根据动态路径规划法从有向无环图模型中选出起始节点与目标节点之间最短路径;根据最短路径进行搜索,在目标节点的数据字段中查找目标数据字段;将目标数据字段进行组合,得到聚合数据。本申请的采用有向无环图模型来表示不同种类业务数据之间的转换关系,只要知道起始节点和目标节点就可以确定出从一种业务数据(即起始节点对应的业务数据)到另一种业务数据(即目标节点对应的业务数据)的所有转换方式,然后通过最短路径来选择最佳转换方式,根据最佳的转换方式可以快速地通过一种业务数据来查找或搜索到另一种业务数据中存在的目标数据字段,将目标数据字段进行组合得到聚合数据,该聚合数据可以在网络平台的页面上进行显示来实现某一功能,该方法可以在网页需要增加功能模块时根据业务数据的转换方式快速组合出该功能模块,并不需要修改大量的数据和相关程序代码,从而提高研发效率,大大降低开发成本。In the data aggregation method provided by the embodiment of the present application, business data aggregation parameters are obtained, wherein the business data aggregation parameters include a business data identifier and a target data field; a corresponding directed acyclic graph model is obtained according to the business data identifier, and the In the ring graph model, the starting node and the target node are determined; the directed acyclic graph model is constructed according to the pre-acquired various business data and the conversion relationship between various business data, in which each of the directed acyclic graph model. The node represents a kind of business data, and the edge of the directed acyclic graph model represents the conversion relationship between the two connected business data; the business data includes business data identifiers and data fields; and then according to the dynamic path planning method from the directed acyclic graph The shortest path between the start node and the target node is selected in the model; the search is performed according to the shortest path, and the target data field is found in the data field of the target node; the target data fields are combined to obtain aggregated data. The directed acyclic graph model of the present application is used to represent the conversion relationship between different types of business data. As long as the starting node and the target node are known, it is possible to determine from one type of business data (that is, the business data corresponding to the starting node) to the starting node. All conversion methods of another business data (that is, the business data corresponding to the target node), and then select the best conversion method through the shortest path. According to the best conversion method, you can quickly find or search for another business data through the A target data field existing in business data, the target data fields are combined to obtain aggregated data, the aggregated data can be displayed on the page of the network platform to achieve a certain function, this method can be used when the webpage needs to add function modules. The conversion method of business data quickly combines the function module without modifying a large amount of data and related program codes, thereby improving R&D efficiency and greatly reducing development costs.
请参照图5,在一个实施例中,有向无环图模型构建方法包括:Referring to FIG. 5, in one embodiment, the method for constructing a directed acyclic graph model includes:
步骤S210,获取多种业务数据和各种业务数据之间的转换关系;Step S210, acquiring a variety of business data and conversion relationships between various business data;
在一种可选的实施方式中,多种业务数据和各种业务数据之间的转换关系可以从其他外围系统或者其他设备中获取;例如业务用户利用其他外围系统或者其他设备与终端设备进行交互,将多种业务数据和各种业务数据之间的转换关系。其中业务数据的种类、数量等以及各种业务数据之间的转换关系可以是业务用户预先设置或定义的,例如可以选择电商业务相关的业务数据,如商家id、店铺id、商品sku、商品详细信息(商品名称、商品图片、商品折扣价、商品销量、商品库存等),以及业务数据之间的转换关系,如商家id-店铺id-商品sku-商品详细信息,店铺id-商品sku-商品详细信息等。其中,“-”表示前后的业务数据具有转换关系。In an optional implementation manner, various service data and conversion relationships between various service data may be obtained from other peripheral systems or other devices; for example, service users use other peripheral systems or other devices to interact with terminal devices , which converts various business data and the conversion relationship between various business data. The type and quantity of business data and the conversion relationship between various business data can be preset or defined by business users. For example, business data related to e-commerce business can be selected, such as merchant id, store id, commodity sku, commodity Detailed information (product name, product image, product discount price, product sales, product inventory, etc.), and the conversion relationship between business data, such as merchant id-store id-product sku-product details, store id-product sku- Product details, etc. Among them, "-" indicates that the business data before and after has a conversion relationship.
sku(stock keeping unit)库存量单位,即库存进出计量的基本单元, 可以是以件,盒,托盘等为单位。sku这是对于大型连锁超市DC(配送中心)物流管理的一个必要的方法。当下已经被引申为产品统一编号的简称,每种产品均对应有唯一的sku号。而对于电商而言,sku是指一款商品,每款都有出现一个sku,便于电商品牌识别商品。Sku (stock keeping unit) is the basic unit of stock in and out measurement, which can be in pieces, boxes, trays, etc. sku This is a necessary method for the logistics management of the large chain supermarket DC (distribution center). At present, it has been extended to the abbreviation of the unified product number, and each product has a unique sku number. For e-commerce, sku refers to a product, and each product has a sku, which is convenient for e-commerce brands to identify the product.
在另一种可选的实施方式中,终端设备可以通过可视化界面来获取业务数据和各业务数据之间的转换关系。例如用于可以通过登录终端设备的可视化界面,在可视化界面上新增节点(如图6所示)和新增边(如图7所示)的方式来获取业务数据和各业务数据之间的转换关系。In another optional implementation manner, the terminal device may acquire the service data and the conversion relationship between each service data through a visual interface. For example, it is used to log in to the visual interface of the terminal device, and add new nodes (as shown in Figure 6) and new edges (as shown in Figure 7) on the visual interface to obtain business data and the relationship between each business data. conversion relationship.
请参照图6,新增节点可以通过在新增节点界面上输入节点名称、节点数据类型、节点标识、节点数据类型和节点数据字段,其中节点数据类型可以包括string、number、object等,可以直接从这几种类型中筛选。节点数据字段包括字段类型、字段内容。可选的,可以通过schema来规范节点数据字段内容(即包括哪些字段)、字段的类型,以及字段的限制等。在一种可选的实施方式中,可以通过json schema来设置节点数据字段。Referring to Figure 6, a new node can be added by entering the node name, node data type, node identifier, node data type and node data field on the new node interface, where the node data type can include string, number, object, etc. Filter from these types. The node data field includes field type and field content. Optionally, the content of the node data field (that is, which fields are included), the type of the field, and the restrictions of the field can be standardized through schema. In an optional implementation, the node data fields can be set via json schema.
此外,节点数据字段可以为空,即并不是每一个节点都有节点数据字段;可以根据节点数据类型确定,例如节点数据类型为string和number时,节点数据字段可以为空;而节点数据类型为object时,节点数据字段不能为空。In addition, the node data field can be empty, that is, not every node has a node data field; it can be determined according to the node data type, for example, when the node data type is string and number, the node data field can be empty; and the node data type is object, the node data field cannot be empty.
在可视化界面上输入节点名称、节点数据类型、节点标识、节点数据类型和节点数据字段之后,点击“保存”按钮即可完成当前新增节点的增加。点击“取消”即可取消当前新增节点。当完成一个新增节点之后,就可以根据新增节点的相关信息(即节点名称、节点数据类型、节点标识和节点数据字段)来获取该业务数据。采用上述的方法依次类推,可以完成所有节点新增,并获取相应的业务数据。在完成所有新增节点之外,还可以对所有新增节点进行管理。如图8所示,所有新增节点可以在一个界面上进行显示,并且显示各节点的相关信息,此时可以对这些新增节点进行编辑处理,例如修改节点名称、节点数据类型、节点标识和节点数据字段;也可以是删除新增节点。After entering the node name, node data type, node ID, node data type and node data fields on the visual interface, click the "Save" button to complete the addition of the current new node. Click "Cancel" to cancel the current new node. After a new node is added, the service data can be acquired according to the relevant information of the newly added node (ie, the node name, the node data type, the node identifier, and the node data field). By using the above methods and so on, the addition of all nodes can be completed, and corresponding business data can be obtained. In addition to completing all new nodes, you can also manage all new nodes. As shown in Figure 8, all new nodes can be displayed on one interface, and the relevant information of each node can be displayed. At this time, these new nodes can be edited, such as modifying the node name, node data type, node ID and Node data field; it can also be to delete a new node.
请参照图7,新增边可以通过在新增变连接界面上的起点位置输入一 个节点的相关信息(通常用节点标识表示,例如uid)、终点位置输入另一个节点的相关信息标识(通常用节点标识表示,例如sid)、权重和转换规则,之后点击“保存”按钮即可完成当前新增边的增加,点击“取消”即可取消当前新增边。当前新增边表示节点uid与节点sid的转换关系,其中转换关系中包括转换权重为5、转换规则。Referring to Figure 7, the new edge can be input by entering the relevant information of a node (usually represented by a node identifier, such as uid) at the starting point on the new connection interface, and inputting the relevant information identifier of another node at the end position (usually using Node identifiers, such as sid), weights and conversion rules, and then click the "Save" button to complete the addition of the current new edge, and click "Cancel" to cancel the current new edge. The newly added edge currently represents the conversion relationship between the node uid and the node sid, and the conversion relationship includes a conversion weight of 5 and a conversion rule.
转换权重可以是一个预设值,业务用户可以根据不同节点转换时负载、RPC耗时等参数综合考虑来确定一个合理的值。转换权重可以是正值,也可以是负值。对于任意两个节点之间的转换权重可以是固定值,也可以是变化值;例如可以定时检查两个节点之间转换所消耗的时间,然后根据所消耗的时间的长短来对转换权重来进行更新等。当完成一个新增边之后,就可以根据新增边的相关信息(即起始节点、目标节点以及转换关系)来获取业务数据之间的转换关系。采用上述的方法依次类推,可以完成所有边新增,并获取相应的业务数据。在完成所有新增边之外,还可以对所有新增边进行管理。如图9所示,所有新增边可以在一个界面上进行显示,并且显示各边的相关信息,此时可以对这些新增边进行编辑处理,例如修改起始节点、目标节点、转换关系;也可以是删除新增边。The conversion weight can be a preset value, and business users can determine a reasonable value based on comprehensive consideration of parameters such as load and RPC time-consuming when different nodes are converted. Transformation weights can be positive or negative. The conversion weight between any two nodes can be a fixed value or a variable value; for example, the time consumed by the conversion between two nodes can be checked regularly, and then the conversion weight can be adjusted according to the length of time consumed. update etc. After a new edge is added, the conversion relationship between business data can be obtained according to the related information of the newly added edge (ie, the starting node, the target node, and the conversion relationship). By using the above methods and so on, the addition of all edges can be completed, and corresponding business data can be obtained. In addition to completing all new edges, you can also manage all new edges. As shown in Figure 9, all newly added edges can be displayed on one interface, and the relevant information of each edge can be displayed. At this time, these newly added edges can be edited, such as modifying the start node, target node, and conversion relationship; You can also delete new edges.
步骤S220,以每一种业务数据为节点,并根据各种业务数据之间的转换关系在对应的节点之间设置边;Step S220, taking each kind of business data as a node, and setting edges between corresponding nodes according to the conversion relationship between various business data;
步骤S230,对每一条边设置权重,构建有向无环图模型。Step S230, setting a weight for each edge to construct a directed acyclic graph model.
具体的,在获得了所有业务数据和业务数据对应的转换关系之后,以每一个业务数据为节点,以各业务数据之间的转换关系在对应的节点之间设置边,并对边设置相应的权重,从而构建有向无环图模型。其结果如图10所示,有向无环图模型可以在终端设备的可视化界面中显示,业务用户可以通过登录相应的APP或网页进入管理平台(例如dashboard)来查看有向无环图模型。此外,在有向无环图模型构建完成之后,还可以通过新增节点、新增边、节点管理以及边管理来对有向无环图模型进行修改更新,以便于在某一业务的业务数据发生改变时及时调整有向无环图模型,从而方便后期的数据聚合。Specifically, after obtaining all the business data and the conversion relationship corresponding to the business data, take each business data as a node, set edges between the corresponding nodes based on the conversion relationship between the business data, and set corresponding edges to the edges. weights to build a directed acyclic graph model. The result is shown in Figure 10. The DAG model can be displayed on the visual interface of the terminal device, and business users can view the DAG model by logging into the corresponding APP or web page and entering the management platform (such as dashboard). In addition, after the DAG model is constructed, the DAG model can be modified and updated by adding new nodes, adding edges, node management and edge management, so as to facilitate the business data of a certain business. When changes occur, the directed acyclic graph model is adjusted in time to facilitate later data aggregation.
在一些实施例中,目标节点的数量为多个;在目标节点的数据字段中 查找目标数据字段的步骤中包括:In some embodiments, the number of target nodes is multiple; the step of searching the target data field in the data field of the target node includes:
选择出起始节点与每一个目标节点之间最短路径;采用路径搜索方法对每一个最短路径进行搜索,从每一个目标节点的数据字段中查找子目标数据字段;将子目标数据字段进行组合,得到目标数据字段。Select the shortest path between the starting node and each target node; use the path search method to search for each shortest path, and find the sub-target data field from the data field of each target node; combine the sub-target data fields, Get the target data field.
具体的,当目标节点的数量为多个时,即一个起始节点对应多个目标节点,并且目标数据字段在多个目标节点之中。此时,需要先选择出起始节点与每一个目标节点之间最短路径,然后对每一个最短路径进行搜索,从每一个目标节点的数据字段中查找子目标数据字段,从而将子目标数据字段进行组合,得到目标数据字段。另外,由于数据字段通常是key-value的形式。在对数据字段进行提取过程是在已知key的情况下去提取value,即通过key找到value。同时由于数据字段可能是具有多层结构的且包含多个字段的结构体,因此在进行字段提取时需要一种算法去遍历结构体,找到key对应的value。Specifically, when the number of target nodes is multiple, that is, one start node corresponds to multiple target nodes, and the target data field is among the multiple target nodes. At this time, it is necessary to first select the shortest path between the starting node and each target node, then search for each shortest path, and find the sub-target data field from the data field of each target node, so as to convert the sub-target data field into the sub-target data field. Combine to get the target data field. In addition, since the data field is usually in the form of key-value. In the process of extracting the data field, the value is extracted when the key is known, that is, the value is found by the key. At the same time, since the data field may be a structure with a multi-layer structure and multiple fields, an algorithm is required to traverse the structure to find the value corresponding to the key when extracting the field.
其中,路径搜索方法是一种路径解析方法,将路径解析成抽象语法树,再去抽象语法树中进行遍历就可以获得所需的数据字段。在本实施例中,将每一个最短路径采用路径解析方法得到抽象语法树,再去抽象语法树中进行遍历就可以获得子目标数据字段。Among them, the path search method is a path parsing method, which parses the path into an abstract syntax tree, and then traverses the abstract syntax tree to obtain the required data fields. In this embodiment, the abstract syntax tree is obtained by using the path parsing method for each shortest path, and then the sub-target data field can be obtained by traversing the abstract syntax tree.
为了便于理解,给出一个详细实施例。如图11所示,例如以seller_id(其中seller_id的取值为1451672)作为起始节点,分别以店铺数据、频道数据和公会数据作为目标节点;先分别找出seller_id分别到店铺数据、频道数据和公会数据之间的最短路径,将这些最短路径转换成抽象语法树,再去遍历抽象语法树从而从店铺数据中查找到“store_name”:“万幸翡翠”的子目标数据字段;从频道数据中查找到“channel_name:“翡翠捡漏”的子目标数据字段;从公会数据中查找到“channel_id”:“121594”和“guile_name:“飞龙公会”的子目标数据字段。然后将查找到的这些子目标数据字段进行组合,从而得到目标数据字。For ease of understanding, a detailed example is given. As shown in Figure 11, for example, take seller_id (where the value of seller_id is 1451672) as the starting node, and take store data, channel data and guild data as target nodes respectively; first find out the seller_id respectively to store data, channel data and The shortest paths between guild data, convert these shortest paths into abstract syntax trees, and then traverse the abstract syntax trees to find "store_name" from the store data: the sub-target data field of "Lucky Emerald"; search from the channel data Go to the sub-target data field of "channel_name: "Emerald Pickup"; find the sub-target data fields of "channel_id": "121594" and "guile_name: "Flying Dragon Guild" from the guile data. The sub-target data fields found are then combined to obtain the target data word.
在一个可选的实施方式中,在采用路径搜索方法对每一个最短路径进行搜索,从每一个目标节点的数据字段中查找与目标数据字段对应的子目标数据字段的步骤中,包括:In an optional embodiment, in the step of searching for each shortest path by using a path search method, and searching for a sub-target data field corresponding to the target data field from the data field of each target node, the steps include:
采用jsonpath方法对每一个目标节点的数据字段进行路径解析,形成树结构;遍历树结构得到子目标数据字段。Use the jsonpath method to parse the data field of each target node to form a tree structure; traverse the tree structure to obtain sub-target data fields.
具体而言,Jsonpath是Stefan Goessner json的路径解析方法。Jsonpath可以将这个json数据先解析成抽象语法树,然后去树中执行遍历,即可获得子目标数据字段。Jsonpathde解析功能非常强大,可以采用类似正则表达式的语法来获取所需的内容,并且可以支持多种编码语言,如Javascript、python、PHP以及java等。Specifically, Jsonpath is Stefan Goessner's path parsing method for json. Jsonpath can first parse this json data into an abstract syntax tree, and then perform traversal in the tree to obtain sub-target data fields. Jsonpathde parsing is very powerful, it can use a regular expression-like syntax to get the desired content, and it can support multiple coding languages, such as Javascript, python, PHP, and java.
在一个实施例中,业务数据标识包括最初态业务数据标识和最终态业务数据标识;起始节点为最初态节点,目标节点为最终态节点;有向无环图模型的节点包括最初态节点、中间态节点和最终态节点;其中一个最初态节点对应一个或多个中间态节点,以及一个或多个最终态节点;In one embodiment, the service data identifiers include initial state service data identifiers and final state service data identifiers; the start node is the initial state node, and the target node is the final state node; the nodes of the directed acyclic graph model include the initial state node, Intermediate state nodes and final state nodes; one of the initial state nodes corresponds to one or more intermediate state nodes and one or more final state nodes;
根据最初态业务数据标识,查找有向无环图模型中最末端节点之外的任意节点,确定为最初态节点;根据最终态节点,查找有向无环图模型中位于最初态节点下游,且与最初态节点有直接或间接转换关系的节点,确定为最终态节点;将位于最初态节点和最终态节点之间,且与最初态节点或最终态节点有直接或间接转换关系的节点,确定为中间态节点。According to the initial state business data identifier, find any node other than the most terminal node in the directed acyclic graph model, and determine it as the initial state node; The node that has a direct or indirect conversion relationship with the initial state node is determined as the final state node; the node that is located between the initial state node and the final state node, and has a direct or indirect conversion relationship with the initial state node or the final state node, is determined. is an intermediate node.
具体的,业务数据聚合过程分为数据转换和组合两个部分,如图12所示。其中,数据转换是指将一种业务数据转换成另一种业务数据。如果将转换前的起始业务数据记为最初态、转换后得到的目标业务数据记为最终态(例如A、B和C),那么起始业务数据与目标业务数据转换过程中涉及到的业务数据则为中间态(例如A1、A2、B1)。如图3所示,例如需要将uid转换成双栏直播间,那么uid为最初态,双栏直播间为最终态,uid与双栏直播间之间的频道号为中间态。对于一个业务数据而言,其形态并不是固定的。如图3所示,例如想将uid转换成双栏直播间item,那么以uid作为最初态、以双栏直播间item为最终态、uid与双栏直播间item之间的频道号为中间态;也可以是以uid作为最初态、以双栏直播间为最终态,此时并没有中间态。此外,如果想将uid转换成频道号,那么以uid作为最初态、频道号为最终态。Specifically, the business data aggregation process is divided into two parts: data conversion and combination, as shown in Figure 12. The data conversion refers to converting one kind of business data into another kind of business data. If the initial service data before conversion is recorded as the initial state, and the target service data obtained after conversion is recorded as the final state (such as A, B, and C), then the services involved in the conversion process between the initial service data and the target service data are recorded as the final state. The data is in the intermediate state (eg A1, A2, B1). As shown in Figure 3, for example, the uid needs to be converted into a double-column live room, then the uid is the initial state, the double-column live room is the final state, and the channel number between the uid and the double-column live room is the intermediate state. For a business data, its form is not fixed. As shown in Figure 3, for example, if you want to convert the uid into a double-column live room item, then take the uid as the initial state, the double-column live room item as the final state, and the channel number between the uid and the double-column live room item as the intermediate state ; It can also take the uid as the initial state and the double-column live room as the final state. At this time, there is no intermediate state. In addition, if you want to convert the uid to the channel number, then use the uid as the initial state and the channel number as the final state.
如果将从最初态到中间态到最终态的过程称为数据转换,那么将最终 态进行组合得到最终数据的过程即为数据组合。对于有向无环图模型而言,由于节点表示的是业务数据,那么节点与节点的连接关系(或转换关系)即为数据转换过程。但是哪些节点对应的最初态、哪些节点对应的是中间态以及哪些节点对应的是最终态需要对具体的业务数据进行聚合时才能确定,即通常是要根据业务数据聚合参数来确定。具体过程为:据业务数据聚合参数从有向无环图模型中确定起始节点、目标节点以及起始节点到目标节点的所有路径;其中起始节点对应最初态、目标节点对应最终态,起始节点到目标节点的所有路径上的其他节点对应中间态。此外,由于有向无环图模型中的节点表示业务数据,那么节点也可以分为最初态节点、中间态节点和最终态节点。其中,最初态节点、中间态节点和最终态节点也并不是固定的;最初态节点的数量通常是一个,最初态节点对应一个或多个中间态节点,以及最初态节点对应一个或多个最终态节点。If the process from the initial state to the intermediate state to the final state is called data conversion, then the process of combining the final state to obtain the final data is called data combination. For the directed acyclic graph model, since the nodes represent business data, the connection relationship (or transformation relationship) between nodes and nodes is the data transformation process. However, which nodes correspond to the initial state, which nodes correspond to the intermediate state, and which nodes correspond to the final state can only be determined when specific business data is aggregated, that is, it is usually determined according to business data aggregation parameters. The specific process is: determine the starting node, the target node and all paths from the starting node to the target node from the directed acyclic graph model according to the business data aggregation parameters; where the starting node corresponds to the initial state, the target node corresponds to the final state, and the starting node corresponds to the final state. Other nodes on all paths from the start node to the target node correspond to intermediate states. In addition, since the nodes in the DAG model represent business data, the nodes can also be divided into initial state nodes, intermediate state nodes and final state nodes. Among them, the initial state node, intermediate state node and final state node are not fixed; the number of initial state nodes is usually one, the initial state node corresponds to one or more intermediate state nodes, and the initial state node corresponds to one or more final state nodes state node.
最初态节点为有向无环图模型中最末端节点之外的任意节点;最初态节点是根据最初态业务数据标识确定的;最终态节点为位于最初态节点下游,且与最初态节点有直接或间接转换关系的节点;最终态节点是根据最终态业务数据标识确定的;中间态节点为位于最初态节点与最终态节点之间,且与最初态节点或最终态节点有直接或间接转换关系的节点。The initial state node is any node other than the most terminal node in the directed acyclic graph model; the initial state node is determined according to the initial state service data identification; the final state node is located downstream of the initial state node and has a direct relationship with the initial state node. or indirect conversion relationship; the final state node is determined according to the final state service data identifier; the intermediate state node is located between the initial state node and the final state node, and has a direct or indirect conversion relationship with the initial state node or the final state node node.
此外,最初态节点通常为起始节点,最终态节点通常为目标节点。最初态节点为有向无环图模型中最末端节点之外的任意节点,即最初态节点不能是位于有向无环图模型中最末端节点,由于最末端节点无法进行业务数据转换。除最末端节点之外,最初态节点通常可以为有向无环图模型任意的节点;而最终节点可以是最初态节点下游的任意一个或多个节点;而在最初态节点和最终态节点之间的所有路径上的节点为中间态节点。In addition, the initial state node is usually the start node, and the final state node is usually the target node. The initial state node is any node other than the end node in the DAG model, that is, the initial state node cannot be the end node in the DAG model, because the end node cannot perform business data conversion. Except for the most terminal node, the initial state node can usually be any node of the directed acyclic graph model; and the final node can be any one or more nodes downstream of the initial state node; and between the initial state node and the final state node Nodes on all paths between are intermediate nodes.
在实际的数据聚合过程中,最初态节点和最终态节点是根据最初态业务数据标识和最终态业务数据标识来确定的。In the actual data aggregation process, the initial state node and the final state node are determined according to the initial state service data identifier and the final state service data identifier.
在一些实施例中,动态路径规划法从有向无环图模型中选择出起始节点与目标节点之间最短路径的步骤中,包括:In some embodiments, the step of selecting the shortest path between the start node and the target node from the directed acyclic graph model by the dynamic path planning method includes:
根据最初态节点、中间态节点和最终态节点从有向无环图模型中筛选出最初态节点与最终态节点之间所有的路径;根据路径的各边的权重计算 每一条路径的总权重值,并选择最小的总权重值对应的路径为最短路径。Screen out all paths between the initial state node and the final state node from the directed acyclic graph model according to the initial state node, intermediate state node and final state node; calculate the total weight value of each path according to the weight of each edge of the path , and select the path corresponding to the smallest total weight value as the shortest path.
具体的,选择出起始节点与目标节点之间最短路径通常是计算出最初态节点与最终态节点之间所有路径的总权重值,其中总权重值越小表示路径越短,找出总权重值最小的路径即为最短路径。Specifically, selecting the shortest path between the starting node and the target node is usually to calculate the total weight value of all paths between the initial state node and the final state node. The smaller the total weight value is, the shorter the path is. Find the total weight value. The path with the smallest value is the shortest path.
在一个实施例中,根据路径的各边的权重计算每一条路径的总权重值,并选择最小的总权重值对应的路径为最短路径的步骤中,包括:In one embodiment, the steps of calculating the total weight value of each path according to the weights of each edge of the path, and selecting the path corresponding to the smallest total weight value as the shortest path include:
采用Dijkstra算法,将每条边的权重都取正值来选择最短路径。Dijkstra's algorithm is used to select the shortest path by taking the weight of each edge as a positive value.
具体的,Dijkstra算法为一种贪心算法,是一种快速地确定最短路径的方法。但Dijkstra算法在使用的过程中,其权重值不能为负值。在本实例中,若采用Dijkstra算法进行计算每一条路径的总权重值的过程中,每条边的权重值都只能取正值。Specifically, the Dijkstra algorithm is a greedy algorithm, which is a method for quickly determining the shortest path. But in the process of using Dijkstra algorithm, its weight value cannot be negative. In this example, if the Dijkstra algorithm is used to calculate the total weight value of each path, the weight value of each edge can only take a positive value.
在一种可选实施方式中,可以采用Floyd算法来选择最短路径。In an alternative embodiment, the Floyd algorithm may be used to select the shortest path.
Floyd算法,弗洛伊德算法是解决任意两点间的最短路径的一种算法,可以正确处理有向图或负权的最短路径问题。Floyd's algorithm, Floyd's algorithm is an algorithm for solving the shortest path between any two points, which can correctly handle the shortest path problem of directed graph or negative weight.
应当理解,在最短路径确定采用的算法不限于本实施例中提到的Dijkstra算法或Floyd算法,根据本发明的技术启示,本领域技术人员还可以采用其他算法来进行最短路径规划。It should be understood that the algorithm used in determining the shortest path is not limited to the Dijkstra algorithm or the Floyd algorithm mentioned in this embodiment. According to the technical teachings of the present invention, those skilled in the art can also use other algorithms for shortest path planning.
应该理解的是,虽然图2以及图5的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以以其它的顺序执行。而且图2以及图5中的至少一部分步骤可以包括多个子步骤或者多个阶段,这些子步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些子步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或者其它步骤的子步骤或者阶段的至少一部分轮流或者交替地执行。It should be understood that although the steps in the flowcharts of FIG. 2 and FIG. 5 are sequentially displayed according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, the execution of these steps is not strictly limited to the order, and these steps may be performed in other orders. Moreover, at least a part of the steps in FIG. 2 and FIG. 5 may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but may be executed at different times. These sub-steps or stages are completed. The order of execution of the steps is not necessarily sequential, but may be performed alternately or alternately with other steps or at least part of sub-steps or stages of other steps.
上述本申请公开的实施例中详细描述了一种数据聚合方法,对于本申请公开的上述方法可采用多种形式的设备实现,因此本申请还公开了对应上述方法的数据聚合装置,下面给出具体的实施例进行详细说明。A data aggregation method is described in detail in the above-mentioned embodiments disclosed in this application. The above-mentioned method disclosed in this application can be implemented by various forms of equipment. Therefore, this application also discloses a data aggregation device corresponding to the above-mentioned method, which is given below. Specific embodiments are described in detail.
请参阅图13,为本申请实施例公开的一种数据聚合装置,主要包括:Please refer to FIG. 13 , which is a data aggregation apparatus disclosed in an embodiment of the present application, which mainly includes:
参数获取模块130,用于获取业务数据聚合参数;业务数据聚合参数包括业务数据标识和目标数据字段;The parameter acquisition module 130 is used for acquiring service data aggregation parameters; the service data aggregation parameters include service data identifiers and target data fields;
图模型获取模块132,用于获取与业务数据标识对应的有向无环图模型;The graph model obtaining module 132 is configured to obtain a directed acyclic graph model corresponding to the business data identifier;
节点确定模块134,用于根据业务数据标识在有向无环图模型中确定起始节点和目标节点;其中,有向无环图模型是根据预先获取的多种业务数据以及各种业务数据之间的转换关系构建的;The node determination module 134 is used to determine the starting node and the target node in the directed acyclic graph model according to the service data identification; wherein, the directed acyclic graph model is based on the pre-acquired multiple service data and various service data. The conversion relationship between them is constructed;
最短路径选择模块136,用于根据动态路径规划法从有向无环图模型中选择起始节点与目标节点之间最短路径;The shortest path selection module 136 is used for selecting the shortest path between the starting node and the target node from the directed acyclic graph model according to the dynamic path planning method;
目标数据字段查找模块138,用于根据最短路径进行搜索,在目标节点的数据字段中查找目标数据字段;The target data field search module 138 is used to search according to the shortest path, and find the target data field in the data field of the target node;
聚合数据得到模块1310,用于将目标数据字段进行组合,得到聚合数据,聚合数据用于在页面上进行显示。The aggregated data obtaining module 1310 is configured to combine target data fields to obtain aggregated data, and the aggregated data is used for display on the page.
在一个实施例中,还包括:In one embodiment, it also includes:
数据及关系获取模块,用于获取多种业务数据和各种业务数据之间的转换关系;The data and relationship acquisition module is used to acquire various business data and conversion relationships between various business data;
节点及边设置模块,用于以每一种业务数据为节点,并根据各种业务数据之间的转换关系在对应的节点之间设置边;The node and edge setting module is used to take each business data as a node, and set edges between corresponding nodes according to the conversion relationship between various business data;
权重设置模块,用于对每一条边设置权重;The weight setting module is used to set the weight for each edge;
有向无环图模型构建模块,用于构建有向无环图模型。DAG model building block for building DAG models.
在一个实施例中,目标节点的数量为多个;目标数据字段查找模块还包括子目标数据字段查找模块和子目标数据字段组合模块:最短路径选择模块,还用于选择出起始节点与每一个目标节点之间最短路径;In one embodiment, the number of target nodes is multiple; the target data field search module further includes a sub-target data field search module and a sub-target data field combination module: the shortest path selection module is also used to select the starting node and each shortest path between target nodes;
子目标数据字段查找模块,用于采用路径搜索方法对每一个最短路径进行搜索,从每一个目标节点的数据字段中查找子目标数据字段;The sub-target data field search module is used to search each shortest path by using the path search method, and find the sub-target data field from the data field of each target node;
子目标数据字段组合模块,用于将子目标数据字段进行组合,得到目标数据字段。The sub-target data field combining module is used for combining the sub-target data fields to obtain the target data fields.
在一个实施例中,子目标数据字段查找模块还包括路径解析模块和遍历模块:路径解析模块,用于采用jsonpath方法对每一个所述目标节点的 数据字段进行路径解析,形成树结构;In one embodiment, the sub-target data field search module also includes a path parsing module and a traversal module: a path parsing module, for using the jsonpath method to perform path parsing on the data fields of each of the target nodes to form a tree structure;
遍历模块,用于遍历所述树结构得到子目标数据字段。The traversal module is used for traversing the tree structure to obtain sub-target data fields.
在一个实施例中,业务数据标识包括最初态业务数据标识和最终态业务数据标识;起始节点为最初态节点,目标节点为最终态节点;有向无环图模型的节点包括最初态节点、中间态节点和最终态节点;其中一个最初态节点对应一个或多个中间态节点,以及一个或多个最终态节点;还包括:In one embodiment, the service data identifiers include initial state service data identifiers and final state service data identifiers; the start node is the initial state node, and the target node is the final state node; the nodes of the directed acyclic graph model include the initial state node, Intermediate state nodes and final state nodes; one of the initial state nodes corresponds to one or more intermediate state nodes, and one or more final state nodes; also includes:
最初态节点确定模块,用于根据最初态业务数据标识,查找有向无环图模型中最末端节点之外的任意节点,确定为最初态节点;The initial state node determination module is used to find any node other than the most terminal node in the directed acyclic graph model according to the initial state service data identification, and determine it as the initial state node;
最终态节点确定模块,用于根据最终态节点,查找有向无环图模型中位于最初态节点下游,且与最初态节点有直接或间接转换关系的节点,确定为最终态节点;The final state node determination module is used to find the node in the directed acyclic graph model that is downstream of the initial state node and has a direct or indirect conversion relationship with the initial state node according to the final state node, and determines it as the final state node;
中间态节点确定模块,用于将位于最初态节点和最终态节点之间,且与最初态节点或最终态节点有直接或间接转换关系的节点,确定为中间态节点。The intermediate state node determination module is used for determining a node located between the initial state node and the final state node and having a direct or indirect conversion relationship with the initial state node or the final state node as an intermediate state node.
在一个实施例中,还包括:In one embodiment, it also includes:
所有路径选择模块,用于根据最初态节点、中间态节点和最终态节点从有向无环图模型中筛选出最初态节点与最终态节点之间所有的路径;All path selection modules are used to filter out all paths between the initial state node and the final state node from the directed acyclic graph model according to the initial state node, the intermediate state node and the final state node;
总权重计算模块,用于根据路径的各边的权重计算每一条路径的总权重值;The total weight calculation module is used to calculate the total weight value of each path according to the weight of each edge of the path;
最短路径选择模块,还用于选择最小的总权重值对应的路径为最短路径。The shortest path selection module is also used to select the path corresponding to the smallest total weight value as the shortest path.
在一个实施例中,最短路径选择模块,还用于采用Dijkstra算法,将每条边的权重都取正值来计算每一条所述路径的总权重值。In one embodiment, the shortest path selection module is further configured to adopt the Dijkstra algorithm to calculate the total weight value of each path by taking the weight of each edge as a positive value.
关于数据聚合装置的具体限定可以参见上文中对于方法的限定,在此不再赘述。上述装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于终端设备中的处理器中,也可以以软件形式存储于终端设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。For the specific limitation of the data aggregation apparatus, reference may be made to the limitation on the method above, which will not be repeated here. Each module in the above apparatus may be implemented in whole or in part by software, hardware and combinations thereof. The above modules may be embedded in or independent of the processor in the terminal device in the form of hardware, or may be stored in the memory in the terminal device in the form of software, so that the processor can call and execute operations corresponding to the above modules.
请参考图14,图14其示出了本申请实施例提供的一种终端设备的结 构框图。该终端设备140可以是计算机设备。本申请中的终端设备140可以包括一个或多个如下部件:处理器142、存储器144以及一个或多个应用程序,其中一个或多个应用程序可以被存储在存储器142中并被配置为由一个或多个处理器144执行,一个或多个应用程序配置用于执行上述应用于终端设备的方法实施例中所描述的方法,也可以配置用于执行上述应用于数据聚合的方法实施例中所描述的方法。Please refer to FIG. 14. FIG. 14 shows a structural block diagram of a terminal device provided by an embodiment of the present application. The terminal device 140 may be a computer device. The terminal device 140 in the present application may include one or more of the following components: a processor 142, a memory 144, and one or more application programs, wherein one or more application programs may be stored in the memory 142 and configured to be executed by a Executed by or multiple processors 144, one or more application programs are configured to execute the methods described in the foregoing method embodiments applied to terminal devices, and may also be configured to execute methods described in the foregoing method embodiments applied to data aggregation. method described.
处理器144可以包括一个或者多个处理核。处理器144利用各种接口和线路连接整个终端设备140内的各个部分,通过运行或执行存储在存储器142内的指令、程序、代码集或指令集,以及调用存储在存储器142内的数据,执行终端设备140的各种功能和处理数据。可选地,处理器144可以采用数字信号处理(Digital Signal Processing,DSP)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)、可编程逻辑阵列(Programmable LogicArra y,PL A)中的至少一种硬件形式来实现。处理器144可集成中央处理器(Cen tralProcessing Unit,CPU)、埋点数据的上报验证器(Graphics Processing Unit,GPU)和调制解调器等中的一种或几种的组合。其中,CPU主要处理操作系统、用户界面和应用程序等;GPU用于负责显示内容的渲染和绘制;调制解调器用于处理无线通信。可以理解的是,上述调制解调器也可以不集成到处理器134中,单独通过一块通信芯片进行实现。 Processor 144 may include one or more processing cores. The processor 144 uses various interfaces and lines to connect various parts of the entire terminal device 140, and executes by running or executing the instructions, programs, code sets or instruction sets stored in the memory 142, and calling the data stored in the memory 142. Various functions of the terminal device 140 and processing data. Optionally, the processor 144 may adopt at least one of a digital signal processing (Digital Signal Processing, DSP), a Field-Programmable Gate Array (Field-Programmable Gate Array, FPGA), and a Programmable Logic Array (Programmable Logic Array, PLA). A form of hardware implementation. The processor 144 may integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a reporting verifier (Graphics Processing Unit, GPU) for buried point data, a modem, and the like. Among them, the CPU mainly handles the operating system, user interface and application programs, etc.; the GPU is used for rendering and drawing of the display content; the modem is used to handle wireless communication. It can be understood that, the above-mentioned modem may not be integrated into the processor 134, and is implemented by a communication chip alone.
存储器142可以包括随机存储器(Random Access Memory,RAM),也可以包括只读存储器(Read-Only Memory)。存储器142可用于存储指令、程序、代码、代码集或指令集。存储器142可包括存储程序区和存储数据区,其中,存储程序区可存储用于实现操作系统的指令、用于实现至少一个功能的指令(比如触控功能、声音播放功能、图像播放功能等)、用于实现下述各个方法实施例的指令等。存储数据区还可以存储终端设备140在使用中所创建的数据等。The memory 142 may include random access memory (Random Access Memory, RAM), or may include read-only memory (Read-Only Memory). Memory 142 may be used to store instructions, programs, codes, sets of codes, or sets of instructions. The memory 142 may include a stored program area and a stored data area, wherein the stored program area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.) , instructions for implementing the following method embodiments, and the like. The storage data area may also store data and the like created by the terminal device 140 in use.
本领域技术人员可以理解,图14中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的终端设备的限定,具体的终端设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。Those skilled in the art can understand that the structure shown in FIG. 14 is only a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the terminal equipment to which the solution of the present application is applied. The specific terminal device may be Include more or fewer components than shown in the figures, or combine certain components, or have a different arrangement of components.
综上,本申请实施例提供的终端设备用于实现前述方法实施例中相应的数据聚合方法,并具有相应的方法实施例的有益效果,在此不再赘述。To sum up, the terminal device provided in the embodiments of the present application is used to implement the corresponding data aggregation method in the foregoing method embodiments, and has the beneficial effects of the corresponding method embodiments, which will not be repeated here.
请参阅图15,其示出了本申请实施例提供的一种计算机可读取存储介质的结构框图。该计算机可读取存储介质150中存储有程序代码,程序代码可被处理器调用执行上述数据聚合方法实施例中所描述的方法,也可以被处理器调用执行上述数据聚合方法实施例中所描述的方法。Please refer to FIG. 15 , which shows a structural block diagram of a computer-readable storage medium provided by an embodiment of the present application. The computer-readable storage medium 150 stores program codes, and the program codes can be called by the processor to execute the methods described in the above data aggregation method embodiments, or can be invoked by the processor to execute the data aggregation method embodiments described above. Methods.
计算机可读取存储介质150可以是诸如闪存、EEPROM(电可擦除可编程只读存储器)、EPROM、硬盘或者ROM之类的电子存储器。可选地,计算机可读取存储介质150包括非瞬时性计算机可读介质(non-transitory computer-readable storage medium)。计算机可读取存储介质150具有执行上述方法中的任何方法步骤的程序代码152的存储空间。这些程序代码可以从一个或者多个计算机程序产品中读出或者写入到这一个或者多个计算机程序产品中。程序代码152可以例如以适当形式进行压缩。The computer readable storage medium 150 may be an electronic memory such as flash memory, EEPROM (Electrically Erasable Programmable Read Only Memory), EPROM, hard disk, or ROM. Optionally, the computer-readable storage medium 150 includes a non-transitory computer-readable storage medium. The computer-readable storage medium 150 has storage space for program code 152 for performing any of the method steps in the above-described methods. These program codes can be read from or written to one or more computer program products. The program code 152 may be compressed, for example, in a suitable form.
在本说明书的描述中,参考术语“一个实施例”、“一些实施例”、“示例”、“具体示例”、或“一些示例”等的描述意指结合该实施例或示例描述的具体特征、结构、材料或者特点包含于本申请的至少一个实施例或示例中。在本说明书中,对上述术语的示意性表述不必须针对的是相同的实施例或示例。而且,描述的具体特征、结构、材料或者特点可以在任一个或多个实施例或示例中以合适的方式结合。此外,在不相互矛盾的情况下,本领域的技术人员可以将本说明书中描述的不同实施例或示例以及不同实施例或示例的特征进行结合和组合。In the description of this specification, description with reference to the terms "one embodiment," "some embodiments," "example," "specific example," or "some examples", etc., mean specific features described in connection with the embodiment or example , structure, material or feature is included in at least one embodiment or example of the present application. In this specification, schematic representations of the above terms are not necessarily directed to the same embodiment or example. Furthermore, the particular features, structures, materials or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, those skilled in the art may combine and combine the different embodiments or examples described in this specification, as well as the features of the different embodiments or examples, without conflicting each other.
对所公开的实施例的上述说明,使本领域专业技术人员能够实现或使用本申请。对这些实施例的多种修改对本领域的专业技术人员来说将是显而易见的,本文中所定义的一般原理可以在不脱离本申请的精神或范围的情况下,在其它实施例中实现。因此,本申请将不会被限制于本文所示的这些实施例,而是要符合与本文所公开的原理和新颖特点相一致的最宽的范围。The above description of the disclosed embodiments enables any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, this application is not intended to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

  1. 一种数据聚合方法,其特征在于,所述方法包括:A data aggregation method, characterized in that the method comprises:
    获取业务数据聚合参数;所述业务数据聚合参数包括业务数据标识和目标数据字段;Obtain business data aggregation parameters; the business data aggregation parameters include business data identifiers and target data fields;
    获取与所述业务数据标识对应的有向无环图模型,并根据所述业务数据标识在所述有向无环图模型中确定起始节点和目标节点;其中,所述有向无环图模型是根据预先获取的多种业务数据以及各种业务数据之间的转换关系构建的;Obtain a directed acyclic graph model corresponding to the business data identifier, and determine a start node and a target node in the directed acyclic graph model according to the business data identifier; wherein, the directed acyclic graph The model is constructed based on pre-acquired various business data and the conversion relationship between various business data;
    根据动态路径规划法从所述有向无环图模型中选择所述起始节点与所述目标节点之间最短路径;Selecting the shortest path between the starting node and the target node from the directed acyclic graph model according to the dynamic path planning method;
    根据所述最短路径进行搜索,在所述目标节点的数据字段中查找所述目标数据字段;Search according to the shortest path, and find the target data field in the data field of the target node;
    将所述目标数据字段进行组合,得到聚合数据,所述聚合数据用于在页面上进行显示。The target data fields are combined to obtain aggregated data, and the aggregated data is used for display on the page.
  2. 根据权利要求1所述的方法,其特征在于,所述有向无环图模型的构建方法包括:The method according to claim 1, wherein the method for constructing the directed acyclic graph model comprises:
    获取多种业务数据和各种业务数据之间的转换关系;Obtain a variety of business data and the conversion relationship between various business data;
    以每一种所述业务数据为节点,并根据各种所述业务数据之间的转换关系在对应的节点之间设置边;Taking each kind of the business data as a node, and setting edges between the corresponding nodes according to the conversion relationship between the various kinds of business data;
    对每一条所述边设置权重,构建所述有向无环图模型。A weight is set for each of the edges, and the directed acyclic graph model is constructed.
  3. 根据权利要求1所述的方法,其特征在于,所述目标节点的数量为多个;在所述目标节点的数据字段中查找所述目标数据字段的步骤中包括:The method according to claim 1, wherein the number of the target nodes is multiple; the step of searching the target data field in the data field of the target node comprises:
    选择出所述起始节点与每一个所述目标节点之间最短路径;selecting the shortest path between the start node and each of the target nodes;
    采用路径搜索方法对每一个最短路径进行搜索,从每一个所述目标节点的数据字段中查找子目标数据字段;Use the path search method to search each shortest path, and find the sub-target data field from the data field of each described target node;
    将所述子目标数据字段进行组合,得到所述目标数据字段。The sub-target data fields are combined to obtain the target data fields.
  4. 根据权利要求3所述的方法,其特征在于,采用路径搜索方法对每一个最短路径进行搜索,从每一个所述目标节点的数据字段中查找与所述目标数据字段对应的子目标数据字段的步骤中,包括:The method according to claim 3, wherein a path search method is used to search each shortest path, and the data fields of the sub-target data fields corresponding to the target data fields are searched from the data fields of each of the target nodes. steps, including:
    采用jsonpath方法对每一个所述目标节点的数据字段进行路径解析,形成树结构;Use jsonpath method to perform path analysis on the data field of each described target node to form a tree structure;
    遍历所述树结构得到子目标数据字段。Traverse the tree structure to obtain sub-target data fields.
  5. 根据权利要求1-4任一项所述的方法,其特征在于,所述业务数据标识包括最初态业务数据标识和最终态业务数据标识;所述起始节点为最初态节点,所述目标节点为最终态节点;The method according to any one of claims 1 to 4, wherein the service data identifier includes an initial state service data identifier and a final state service data identifier; the starting node is an initial state node, and the target node is the final state node;
    所述有向无环图模型的节点包括最初态节点、中间态节点和最终态节点;其中一个所述最初态节点对应一个或多个所述中间态节点,以及一个或多个所述最终态节点;The nodes of the directed acyclic graph model include an initial state node, an intermediate state node and a final state node; wherein one of the initial state nodes corresponds to one or more of the intermediate state nodes, and one or more of the final state nodes node;
    根据所述最初态业务数据标识,查找所述有向无环图模型中最末端节点之外的任意节点,确定为所述最初态节点;According to the initial state service data identifier, find any node other than the most terminal node in the directed acyclic graph model, and determine it as the initial state node;
    根据所述最终态节点,查找所述有向无环图模型中位于所述最初态节点下游,且与所述最初态节点有直接或间接转换关系的节点,确定为所述最终态节点;According to the final state node, find a node in the directed acyclic graph model that is located downstream of the initial state node and has a direct or indirect conversion relationship with the initial state node, and determines it as the final state node;
    将位于所述最初态节点和所述最终态节点之间,且与所述最初态节点或最终态节点有直接或间接转换关系的节点,确定为所述中间态节点。A node located between the initial state node and the final state node and having a direct or indirect conversion relationship with the initial state node or the final state node is determined as the intermediate state node.
  6. 根据权利要求5所述的方法,其特征在于,根据动态路径规划法从所述有向无环图模型中选择出所述起始节点与所述目标节点之间最短路径的步骤中,包括:The method according to claim 5, wherein the step of selecting the shortest path between the start node and the target node from the directed acyclic graph model according to a dynamic path planning method comprises:
    根据所述最初态节点、所述中间态节点和所述最终态节点从所述有向无环图模型中筛选出所述最初态节点与所述最终态节点之间所有的路径;Filter out all paths between the initial state node and the final state node from the directed acyclic graph model according to the initial state node, the intermediate state node and the final state node;
    根据所述路径的各边的权重计算每一条所述路径的总权重值,并选择最小的总权重值对应的所述路径为最短路径。The total weight value of each of the paths is calculated according to the weights of each edge of the path, and the path corresponding to the smallest total weight value is selected as the shortest path.
  7. 根据权利要求6所述所述的方法,其特征在于,根据所述路径的各边的权重计算每一条所述路径的总权重值,并选择最小的总权重值对应的所述路径为最短路径的步骤中,包括:The method according to claim 6, wherein the total weight value of each path is calculated according to the weight of each edge of the path, and the path corresponding to the smallest total weight value is selected as the shortest path steps, including:
    采用Dijkstra算法,将每条所述边的权重都取正值来选择所述最短路径。Using Dijkstra's algorithm, the shortest path is selected by taking the weight of each of the edges as positive values.
  8. 一种数据聚合装置,其特征在于,所述装置包括:A data aggregation device, characterized in that the device comprises:
    参数获取模块,用于获取业务数据聚合参数;所述业务数据聚合参数包括业务数据标识和目标数据字段;a parameter acquisition module for acquiring business data aggregation parameters; the business data aggregation parameters include a business data identifier and a target data field;
    图模型获取模块,用于获取与所述业务数据标识对应的有向无环图模型;A graph model obtaining module, configured to obtain a directed acyclic graph model corresponding to the business data identifier;
    节点确定模块,用于根据所述业务数据标识在所述有向无环图模型中确定起始节点和目标节点;其中,所述有向无环图模型是根据预先获取的多种业务数据以及各种业务数据之间的转换关系构建的;A node determination module, configured to determine a start node and a target node in the directed acyclic graph model according to the service data identifier; wherein the directed acyclic graph model is based on pre-acquired multiple service data and The transformation relationship between various business data is constructed;
    最短路径选择模块,用于根据动态路径规划法从所述有向无环图模型中选择所述起始节点与所述目标节点之间最短路径;a shortest path selection module, configured to select the shortest path between the start node and the target node from the directed acyclic graph model according to a dynamic path planning method;
    目标数据字段查找模块,用于根据所述最短路径进行搜索,在所述目标节点的数据字段中查找所述目标数据字段;a target data field search module, configured to search according to the shortest path, and find the target data field in the data field of the target node;
    聚合数据得到模块,用于将所述目标数据字段进行组合,得到聚合数据,所述聚合数据用于在页面上进行显示。The aggregated data obtaining module is used for combining the target data fields to obtain aggregated data, and the aggregated data is used for displaying on the page.
  9. 一种终端设备,其特征在于,包括:A terminal device, characterized in that it includes:
    存储器;一个或多个处理器,与所述存储器耦接;一个或多个应用程序,其中,一个或多个应用程序被存储在存储器中并被配置为由一个或多个处理器执行,一个或多个应用程序配置用于执行如权利要求1-7任一项所述的方法。memory; one or more processors coupled to the memory; one or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the one or more processors, a or a plurality of application programs configured to perform the method of any of claims 1-7.
  10. 一种计算机可读存储介质,其特征在于,所述计算机可读取存储介质中存储有程序代码,所述程序代码可被处理器调用执行如权利要求1-7任一项所述的方法。A computer-readable storage medium, characterized in that the computer-readable storage medium stores program codes, and the program codes can be invoked by a processor to execute the method according to any one of claims 1-7.
PCT/CN2021/081963 2020-09-28 2021-03-22 Method and device for data aggregation, terminal device, and computer-readable storage medium WO2022062337A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011041479.5 2020-09-28
CN202011041479.5A CN112115171B (en) 2020-09-28 2020-09-28 Data aggregation method, device, terminal equipment and computer readable storage medium

Publications (1)

Publication Number Publication Date
WO2022062337A1 true WO2022062337A1 (en) 2022-03-31

Family

ID=73796853

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/081963 WO2022062337A1 (en) 2020-09-28 2021-03-22 Method and device for data aggregation, terminal device, and computer-readable storage medium

Country Status (2)

Country Link
CN (1) CN112115171B (en)
WO (1) WO2022062337A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117435200A (en) * 2023-12-21 2024-01-23 粤港澳大湾区数字经济研究院(福田) Homomorphic encryption service code translation method, device, equipment and readable storage medium
CN118097087A (en) * 2024-04-29 2024-05-28 中国石油大学(华东) Method, device, equipment and medium for marking layout of component sizes of engineering drawing

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112115171B (en) * 2020-09-28 2023-11-21 广州华多网络科技有限公司 Data aggregation method, device, terminal equipment and computer readable storage medium
CN112698971B (en) * 2020-12-30 2023-08-18 平安科技(深圳)有限公司 Parameter conversion method, device, equipment and medium based on rule engine
CN113220945B (en) * 2021-04-28 2024-05-31 广州宸祺出行科技有限公司 Method and system for field retrieval and path display of data blood edges
CN115438101B (en) * 2022-10-13 2023-06-06 中国兵器工业计算机应用技术研究所 Data feature construction system and method based on feature morphology and data relationship

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100161651A1 (en) * 2008-12-23 2010-06-24 Business Objects, S.A. Apparatus and Method for Processing Queries Using Oriented Query Paths
CN102541875A (en) * 2010-12-16 2012-07-04 北京大学 Access method, device and system for relational node data of directed acyclic graph
CN110717076A (en) * 2019-09-06 2020-01-21 平安科技(深圳)有限公司 Node management method, node management device, computer equipment and storage medium
CN111221508A (en) * 2019-11-14 2020-06-02 腾讯科技(深圳)有限公司 Business path design method, design device, electronic device and storage medium
CN112115171A (en) * 2020-09-28 2020-12-22 广州华多网络科技有限公司 Data aggregation method and device, terminal equipment and computer-readable storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100161651A1 (en) * 2008-12-23 2010-06-24 Business Objects, S.A. Apparatus and Method for Processing Queries Using Oriented Query Paths
CN102541875A (en) * 2010-12-16 2012-07-04 北京大学 Access method, device and system for relational node data of directed acyclic graph
CN110717076A (en) * 2019-09-06 2020-01-21 平安科技(深圳)有限公司 Node management method, node management device, computer equipment and storage medium
CN111221508A (en) * 2019-11-14 2020-06-02 腾讯科技(深圳)有限公司 Business path design method, design device, electronic device and storage medium
CN112115171A (en) * 2020-09-28 2020-12-22 广州华多网络科技有限公司 Data aggregation method and device, terminal equipment and computer-readable storage medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117435200A (en) * 2023-12-21 2024-01-23 粤港澳大湾区数字经济研究院(福田) Homomorphic encryption service code translation method, device, equipment and readable storage medium
CN117435200B (en) * 2023-12-21 2024-04-16 粤港澳大湾区数字经济研究院(福田) Homomorphic encryption service code translation method, device, equipment and readable storage medium
CN118097087A (en) * 2024-04-29 2024-05-28 中国石油大学(华东) Method, device, equipment and medium for marking layout of component sizes of engineering drawing

Also Published As

Publication number Publication date
CN112115171B (en) 2023-11-21
CN112115171A (en) 2020-12-22

Similar Documents

Publication Publication Date Title
WO2022062337A1 (en) Method and device for data aggregation, terminal device, and computer-readable storage medium
US11276097B1 (en) Canonical order management system
US20210096708A1 (en) Methods and apparatuses for dynamically generating mobile application layouts using client- independent configuration
US8856160B2 (en) Product options framework and accessories
CN103036954B (en) Mobile message paradigmatic system and method thereof based on GIS
US20160063595A1 (en) Automatically Pre-Customizing Product Recommendations for Purchase
CN112100550A (en) Page construction method and device
US20140164895A1 (en) Systems and methods for managing spreadsheet models
US10380133B2 (en) Information landscape modeling, analysis and validation
CN104102670A (en) Performance indicator analytical framework
US20190392349A1 (en) Simplified product configuration using table-based rules, rule conflict resolution through voting, and efficient model compilation
CN110955652A (en) System and method for data display
CN110019835A (en) Resource method of combination, device and electronic equipment
US20230205551A1 (en) System for custom validations and scripts for mobile applications
CN112214210A (en) Logistics business rule engine and configuration method, device, equipment and storage medium thereof
CN108491408B (en) Activity information processing method and device, electronic equipment and storage medium
CN115630923A (en) Business examination processing method and device and computer readable storage medium
US11531651B1 (en) Dynamic data schema service
CN117454278A (en) Method and system for realizing digital rule engine of standard enterprise
CN115017185A (en) Data processing method, device and storage medium
CN113010744A (en) Graph data generation method and device, server and storage medium
US11340918B2 (en) Knowledge engine auto-generation of guided flow experience
CN115983220B (en) Report generation method and device and electronic equipment
CN117540712A (en) Form creation method, device, equipment and storage medium
CN113885853A (en) Operation method, device and equipment of business analysis model

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21870726

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21870726

Country of ref document: EP

Kind code of ref document: A1