Business data query methods, devices, servers, storage media and products

By generating multiple data structures and query execution tasks, and utilizing the first and second nodes to query multiple data sources in parallel, the problem of low query efficiency in existing technologies is solved, enabling rapid acquisition of advertising business data.

CN117076487BActive Publication Date: 2026-05-26TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
TENCENT TECHNOLOGY (SHENZHEN) CO LTD
Filing Date
2022-05-10
Publication Date
2026-05-26

AI Technical Summary

Technical Problem

Existing technologies require querying multiple data sources multiple times when querying advertising business data, resulting in low query efficiency.

Method used

By receiving query requests containing multiple query fields and data source identifiers, multiple data structures and query execution tasks are generated. The first and second nodes are used to query multiple data sources in parallel, and the business sub-data is aggregated to obtain the final business data.

Benefits of technology

Parallel queries were implemented when querying advertising business data, which shortened query time and improved query efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117076487B_ABST
    Figure CN117076487B_ABST
Patent Text Reader

Abstract

This application provides a method, apparatus, server, storage medium, and product for querying business data, belonging to the field of Internet technology. The method first parses the query request to obtain multiple query statements. Based on these multiple query statements, multiple data structures are generated. Based on these data structures, multiple query execution tasks are generated. Through the first and second nodes of the multiple query execution tasks, multiple data sources are queried in parallel. The multiple business sub-data obtained from the multiple data sources are summarized to obtain the business data, which is then returned to the terminal. This method can query multiple data sources in parallel based on multiple query fields, thus shortening the query time and improving query efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of Internet technology, and in particular to a method, apparatus, server, storage medium and product for querying business data. Background Technology

[0002] Because Online Transaction Processing (OLTP) supports real-time data querying and boasts high query speeds, it can be applied in advertising scenarios to retrieve business data for users. Currently, advertising business data is typically obtained from data providers through data sources. However, this data often originates from multiple data providers. Therefore, when querying business data, it's necessary to first query multiple data sources and then retrieve the business data from the corresponding data providers based on those data sources.

[0003] In related technologies, when querying business data for advertisements, only one query field can be entered at a time, and one query field corresponds to one data source. Therefore, when querying multiple data sources, multiple inputs and multiple queries are required to retrieve multiple data sources and ultimately obtain the final business data. However, because this method requires multiple queries to obtain the final business data, it takes a long time, resulting in low query efficiency. Summary of the Invention

[0004] This application provides a method, apparatus, server, storage medium, and product for querying business data, which can improve the efficiency of business data querying. The technical solution is as follows:

[0005] On the one hand, a method for querying business data is provided, the method including:

[0006] The terminal receives a query request, which is used to query business data of a target content item. The query request includes multiple query fields and multiple data source identifiers. Each data source identifier corresponds to at least one query field, and the query field is used to query the corresponding business sub-data through the data source.

[0007] The query request is parsed to obtain multiple query statements. Each query statement corresponds to a data source, and each query statement includes the identifier of the data source and at least one corresponding query field.

[0008] Based on the multiple query statements, multiple data structures are generated, with one data structure corresponding to one query statement. The data structures are used to store the query information used to obtain the business sub-data.

[0009] Based on the multiple data structures, multiple query execution tasks are generated. Each query execution task includes a first node and a second node. The first node is used to determine the type of business sub-data to be queried based on the query information. The second node associated with the first node is used to obtain the business sub-data through the data source based on the type of the business sub-data.

[0010] The multiple query execution tasks are executed in parallel using the first and second nodes of the multiple query execution tasks;

[0011] The business data is obtained by aggregating multiple business sub-data obtained from the multiple data sources and then returning the business data to the terminal.

[0012] On the other hand, a business data query device is provided, the device comprising:

[0013] A receiving module is used to receive a query request from a terminal. The query request is used to query business data of a target content item. The query request includes multiple query fields and identifiers of multiple data sources. An identifier of a data source corresponds to at least one query field, and the query field is used to query the corresponding business sub-data through the data source.

[0014] The parsing module is used to parse the query request to obtain multiple query statements. Each query statement corresponds to a data source, and the query statement includes the identifier of the data source and at least one corresponding query field.

[0015] The first generation module is used to generate multiple data structures based on the multiple query statements. Each query statement corresponds to one data structure, and the data structure is used to store the query information used to obtain the business sub-data.

[0016] The second generation module is used to generate multiple query execution tasks based on the multiple data structures. Each query execution task includes a first node and a second node. The first node is used to determine the type of business sub-data to be queried based on the query information. The second node associated with the first node is used to obtain the business sub-data through the data source based on the type of the business sub-data.

[0017] The query module is used to perform parallel queries on the multiple data sources through the first and second nodes of the multiple query execution tasks.

[0018] The aggregation module is used to aggregate multiple business sub-data obtained from the multiple data sources to obtain business data, and return the business data to the terminal.

[0019] In one possible implementation, the second generation module is configured to generate multiple first nodes based on multiple query information in the multiple data structures; generate multiple second nodes based on multiple data sources matched by the multiple query information; and generate multiple query execution tasks based on the multiple first nodes and the multiple second nodes.

[0020] In another possible implementation, the second generation module is used to determine a first node and a second node that have a relationship; and to generate the query execution task based on the first node and the second node that have a relationship.

[0021] In another possible implementation, the second generation module is used to associate the first node and the second node that have a relationship to obtain the query execution task; or, to determine a plurality of second nodes that have a relationship; to associate the plurality of second nodes and the first node and the second node that have a relationship to obtain the query execution task; wherein, one of the plurality of second nodes that have a relationship is a parent node, and the other second nodes are child nodes, and the second node that is the parent node is used to obtain business sub-data based on the data obtained by the other second nodes that are child nodes.

[0022] In another possible implementation, the query module is used to determine the types of the multiple business sub-data through multiple first nodes in the multiple query execution tasks, wherein the first node is used to send the types of the business sub-data to the second nodes associated with it; based on the types of the multiple business sub-data, the multiple data sources are queried in parallel through multiple second nodes associated with the multiple first nodes.

[0023] In another possible implementation, the first generation module is configured to determine the configuration information of the multiple data sources based on the identifiers of the multiple data sources in the multiple query statements, wherein one identifier of a data source corresponds to one configuration information; obtain multiple structure information from the configuration information of the multiple data sources, wherein one configuration information corresponds to one structure information, and the structure information is used to indicate the method used to generate the data structure; and generate the multiple data structures based on the multiple query fields and the multiple structure information.

[0024] On the other hand, a server is provided, the server including a processor and a memory, the memory being used to store at least one computer program, the at least one computer program being loaded and executed by the processor to implement the business data query method in the embodiments of this application.

[0025] On the other hand, a computer-readable storage medium is provided, wherein at least one computer program is stored in the computer-readable storage medium, and the at least one computer program is loaded and executed by a processor to implement the business data query method as described in the embodiments of this application.

[0026] On the other hand, a computer program product is provided, the computer program product including computer program code stored in a computer-readable storage medium, a server processor reading the computer program code from the computer-readable storage medium, the processor executing the computer program code, causing the server to execute the business data query method described in any of the above implementations.

[0027] The beneficial effects of the technical solutions provided in this application are:

[0028] This application provides a method for querying business data. When querying business data, this method generates multiple data structures based on multiple query fields, and then generates multiple query execution tasks based on these data structures. Through the first and second nodes of these multiple query execution tasks, multiple data sources are queried in parallel. Finally, the multiple business sub-data obtained from the multiple data sources are summarized to obtain the business data, which is then returned to the terminal. Therefore, this method can query multiple data sources in parallel based on multiple query fields, thus shortening the query time and improving query efficiency. Attached Figure Description

[0029] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0030] Figure 1 This is a schematic diagram of the implementation environment of a business data query method provided in an embodiment of this application;

[0031] Figure 2 This is a flowchart of a business data query method provided in an embodiment of this application;

[0032] Figure 3 This is a flowchart of a business data query method provided in an embodiment of this application;

[0033] Figure 4 This is a schematic diagram illustrating how multiple related second nodes query data through multiple data sources, as provided in an embodiment of this application.

[0034] Figure 5 This is a schematic diagram of a data query framework provided in an embodiment of this application;

[0035] Figure 6 This is a schematic diagram of the structure of a business data query device provided in an embodiment of this application;

[0036] Figure 7 This is a structural block diagram of a server provided in an embodiment of this application. Detailed Implementation

[0037] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.

[0038] The terms "first," "second," "third," and "fourth," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or apparatuses.

[0039] It should be noted that all information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.), and signals involved in this application have been authorized by the user or fully authorized by all parties, and the collection, use, and processing of related data must comply with the relevant laws, regulations, and standards of the relevant countries and regions. For example, the query fields, business data, business sub-data, and query information involved in this application were all obtained with full authorization.

[0040] The following is an explanation of the terms used in this application.

[0041] Data source: The device or original media that provides business data. The data source can obtain business data from the data provider, which can be a database or a third-party service.

[0042] Query execution task: The specific execution steps for querying business data.

[0043] Parser: A module that transforms query requests into query statements that can be interpreted by the query generator.

[0044] Query Task Generator: A module that generates query execution tasks based on query statements.

[0045] Query executor: The module specifically responsible for executing query tasks.

[0046] The following describes the implementation environment involved in this application:

[0047] See Figure 1 , Figure 1 This is a schematic diagram illustrating the implementation environment of the business data query method provided in this application embodiment. The implementation environment includes a terminal 101 and a server 102, which can be connected wirelessly or via a wired network. In this application embodiment, the method can be applied to scenarios with high real-time data requirements, such as advertising and ticketing scenarios.

[0048] This explanation uses the application of this method in an advertising delivery scenario as an example. As the business complexity of advertising delivery systems increases, the data that needs to be loaded on a single page becomes increasingly complex. This requires filtering, sorting, and displaying business data from multiple different data sources and dimensions. For example, when querying business data, it's necessary to obtain real-time data on ad review progress and delivery performance, and this data often comes from multiple different data providers. Since data is generally obtained from data providers through data sources, retrieving business data requires first querying multiple data sources and then obtaining data from multiple data providers through these queries.

[0049] In this embodiment, the advertising delivery system includes a terminal 101 and a server 102. The process by which a user queries the business data of an advertisement through the advertising delivery system can be as follows: In response to a user-triggered query operation, the terminal 101 sends a query request to the server 102. Based on the query request, the server 102 queries multiple data sources in parallel, summarizes the multiple sub-data items obtained from the queries, obtains the business data, and returns the business data to the terminal 101. The terminal 101 then displays the business data. When querying business data, the user can input multiple query fields. The server 102 can then query multiple data sources in parallel based on these multiple query fields, shortening the query time and thus improving query efficiency.

[0050] Terminal 101 can be at least one of the following: mobile phone, tablet computer, PC (Personal Computer) device, intelligent voice interaction device, and vehicle terminal. Server 102 can be at least one of the following: a single server, a server cluster consisting of multiple servers, a cloud server, a cloud computing platform, and a virtualization center.

[0051] Figure 2 This is a flowchart illustrating a business data query method provided in an embodiment of this application, executed by the server. See also... Figure 2 The method includes:

[0052] 201. The server receives the query request from the terminal.

[0053] This query request is used to query business data of a target content item. The query request includes multiple query fields and identifiers of multiple data sources. Each data source identifier corresponds to at least one query field, and the query field is used to query the corresponding business sub-data through the data source.

[0054] In this embodiment, a user can submit a target content item via a terminal. After submitting the target content item, the user can also query the business data of that target content item via the terminal. When querying business data, in response to the query operation, the terminal sends a query request to the server, and the server queries the business data based on the query request.

[0055] The target content item can be a food advertisement, shopping advertisement, video advertisement, etc., and this embodiment of the application does not specifically limit it. The business data can be data such as the review progress and delivery effect of the target content item, and this is not specifically limited.

[0056] 202. The server parses the query request and obtains multiple query statements.

[0057] Each query statement corresponds to a data source, and the query statement includes the identifier of the data source and at least one corresponding query field. The query field can be the review progress of the target content item, the delivery effect, etc., where the delivery effect can be reflected by the number of clicks or views.

[0058] 203. The server generates multiple data structures based on multiple query statements.

[0059] Each query statement corresponds to a data structure, which is used to store the query information used to retrieve business sub-data.

[0060] 204. The server generates multiple query execution tasks based on multiple data structures.

[0061] A query execution task includes a first node and a second node. The first node is used to determine the type of business sub-data to be queried based on the query information, and the second node associated with the first node is used to obtain the business sub-data from the data source based on the type of business sub-data.

[0062] The number of first nodes can be one or more, and the number of second nodes can be one or more, without any specific limitation.

[0063] 205. The server performs parallel queries on multiple data sources through the first and second nodes of the multiple query execution task.

[0064] Since multiple query execution tasks are executed simultaneously, and these multiple query execution tasks correspond to multiple data sources, the query process involves querying multiple data sources in parallel.

[0065] Furthermore, a single query execution task may require querying multiple data sources. Therefore, for multiple query execution tasks, the query process involves parallel mixed queries on multiple data sources. For example, the first query execution task may need to query multiple first data sources, and the second query execution task may need to query multiple second data sources. Since some of the first and second data sources may share the same data source, the server uses the first and second nodes within the multiple query execution tasks to perform parallel mixed queries on the data sources.

[0066] 206. The server will aggregate multiple business sub-data obtained from multiple data sources to obtain business data, and then return the business data to the terminal.

[0067] The server aggregates multiple business sub-data and returns them to the terminal, which then displays the business data returned by the server to meet the user's query needs.

[0068] This application provides a method for querying business data. When querying business data, this method generates multiple data structures based on multiple query fields, and then generates multiple query execution tasks based on these data structures. Through the first and second nodes of these multiple query execution tasks, multiple data sources are queried in parallel. Finally, the multiple business sub-data obtained from the multiple data sources are summarized to obtain the business data, which is then returned to the terminal. Therefore, this method can query multiple data sources in parallel based on multiple query fields, thus shortening the query time and improving query efficiency.

[0069] Figure 3 This is a flowchart illustrating a business data query method provided in an embodiment of this application, executed by a terminal and a server. See also... Figure 3 The method includes:

[0070] 301. The terminal sends a query request to the server.

[0071] This query request is used to query business data of a target content item. The query request includes multiple query fields and identifiers of multiple data sources. Each data source identifier corresponds to at least one query field, and the query field is used to query the corresponding business sub-data through the data source.

[0072] In this step, in response to the triggered query operation, the terminal obtains multiple input query fields, determines the identifiers of multiple data sources corresponding to these multiple query fields, and sends a query request to the server.

[0073] In this implementation, the terminal displays a query interface, which includes multiple query input boxes for entering multiple query fields. The terminal retrieves these query fields and, based on a pre-stored correspondence between the query fields and data source identifiers, determines the identifiers of the multiple data sources corresponding to these query fields.

[0074] After the terminal determines the identifiers of the multiple data sources corresponding to the multiple query fields, for any data source identifier, the terminal can add the data source identifier to the beginning of the query field name as a prefix. For example, if the query field is product_id and the identifier of the corresponding data source is product_service, then the identifier of the data source is displayed as a prefix before the query field name, resulting in product_service.product_id. Finally, the terminal adds the identifiers of the multiple data sources to the beginning of the multiple query field names and then sends a query request to the server. In this query request, the identifiers of the multiple data sources are placed before their corresponding query field names.

[0075] In this embodiment, the target content item can be a food advertisement, shopping advertisement, video advertisement, etc., without specific limitations. Furthermore, the business data can be data such as the review progress and campaign performance of the target content item, without specific limitations. Additionally, the query field can be any field used to query business data. For example, the query field can be a sorting field used to determine the sorting of the business data to be queried, or a filtering field used to filter out business data that does not meet the conditions. Of course, the query field can also be other fields, which will not be listed here.

[0076] In this embodiment of the application, adding the identifiers of multiple data sources before multiple query fields can reduce the logical complexity of subsequent server parsing and improve parsing efficiency.

[0077] 302. The server receives the query request, parses the query request, and obtains multiple query statements.

[0078] The server includes a parser and a query task generator. The parser is a module that converts query requests into query statements that the query generator can interpret, while the query task generator is a module that generates query execution tasks based on the query statements.

[0079] The parser parses the query request, generates multiple query statements according to the identifiers of different data sources, and then sends the multiple query statements to the query task generator. Each query statement corresponds to a data source, and the query statement includes the identifier of the data source and at least one corresponding query field.

[0080] 303. The server generates multiple data structures based on multiple query statements.

[0081] Each query statement corresponds to a data structure, which is used to store the query information used to retrieve business sub-data. Each data structure stores at least one query information.

[0082] The query task generator receives multiple query statements from the parser. Based on the identifiers of multiple data sources in the query statements, it determines the configuration information of these data sources, retrieves multiple structure information from their configuration information, and generates multiple data structures based on multiple query fields and the structure information. Each data source identifier corresponds to one configuration information, and each configuration information corresponds to one structure information, which indicates the method used to generate the data structures.

[0083] In this implementation, the configuration information of the data source includes structure information. The query task generator can directly obtain the structure information from the configuration information of the data source corresponding to the query statement, and generate the data structure through the structure information.

[0084] The data source configuration information also includes the data source identifier, data source access driver, data source interface, and cache switch. The data source access driver is used to drive the data source to retrieve data from the data provider through the data source interface. The cache switch is used to enable or disable caching. When caching is enabled, data retrieved from the data provider can be stored in the cache, allowing the server to quickly retrieve data from the cache. Furthermore, the data provider can be a database or a third-party service; there are no specific limitations.

[0085] In this embodiment, multiple data structures are generated based on the configuration information of the data source. Subsequently, multiple query execution tasks can be generated through these multiple data structures to query multiple data sources in parallel, thereby shortening the query time and improving query efficiency.

[0086] 304. The server generates multiple first nodes based on multiple query information in multiple data structures.

[0087] This query information is used to represent the information used to obtain business sub-data.

[0088] The first node is used to determine the type of business sub-data to be queried based on the query information. One query information corresponds to one first node. Therefore, the server can generate multiple first nodes that match the number of query information.

[0089] The type of business sub-data is used to indicate the purpose of the business sub-data. For example, the type of business sub-data can be business sub-data used for sorting, or business sub-data used for pagination, or business sub-data used for aggregation, or business sub-data used for other purposes, without specific limitations.

[0090] 305. The server generates multiple second nodes based on multiple data sources that match multiple query information.

[0091] The second node is used to retrieve business sub-data from the data source based on the type of business sub-data. Different query information may need to query the same data source or different data sources. Therefore, the server can determine multiple data sources that match the multiple query information based on the pre-stored correspondence between query information and data sources, and generate multiple second nodes that match the number of multiple data sources.

[0092] 306. The server generates multiple query execution tasks based on multiple first nodes and multiple second nodes.

[0093] This step can be achieved through the following steps (1) to (2), including:

[0094] (1) The server determines the first and second nodes that have an association relationship.

[0095] As can be seen from steps 304 and 305, both the first node and the second node are generated based on the query information. Therefore, the query task generator will determine the first node and the second node generated based on the same query information as having a relationship.

[0096] (2) The server generates a query execution task based on the first and second nodes that have a relationship.

[0097] Step (2) can be implemented in any of the following ways.

[0098] In the first implementation, the query task generator directly associates the first and second nodes that have a relationship to obtain the query execution task.

[0099] In this implementation, the second node can directly obtain business sub-data from the data source without relying on data obtained from other nodes.

[0100] In the second implementation, the query task generator identifies multiple second nodes that have a relationship, associates the multiple second nodes, and associates the first node and second node that have a relationship to obtain the query execution task.

[0101] In this context, one of the multiple related second nodes is the parent node, and the other second nodes are the child nodes. The parent second node is used to obtain business sub-data based on the data obtained from the other child second nodes.

[0102] In this implementation, when the business sub-data that the second node needs to obtain depends on the data obtained by other second nodes, that is, the second node needs to obtain other data first, and can only obtain its corresponding business sub-data based on other data, in this case, the query task generator takes the second node as the parent node and the other second nodes as the child nodes of the parent node.

[0103] It's important to note that a parent node may have single-level or multi-level child nodes. If a parent node's child nodes can directly retrieve data from a data source, then the parent node has single-level child nodes. If a parent node's child nodes depend on their next-level child nodes for data, then the parent node has multi-level child nodes. Regardless of whether the parent node has single-level or multi-level child nodes, the parent node and these child nodes are all related nodes. Based on this, when the query task generator associates the first and second nodes with a relationship, it also associates the corresponding second nodes of these related nodes, thus generating the query execution task.

[0104] In this embodiment, a query execution task includes a root query executor. The query execution task is a tree structure, with the root query executor being the top node of the tree structure. The first node and the second node are both nodes within the tree structure. Specifically, a first node represents a primary key query executor, and a second node represents a data query executor. The primary key query executor determines the type of the corresponding business sub-data based on the query information and sends the type of the retrieved business sub-data to the data query executor. The data query executor, based on the type of business sub-data sent by the primary key query executor, retrieves the business sub-data from the data source corresponding to that type of business sub-data.

[0105] In this embodiment, the query task generator generates multiple query execution tasks through steps (1) and (2) above. The server generates multiple query execution tasks based on the association between the first node and the second node, or based on the association between the first node and the second node and the association between multiple second nodes. Through these multiple query execution tasks, multiple data sources are queried in parallel, shortening the query time and thus improving the query efficiency.

[0106] 307. The server performs parallel queries on multiple data sources through the first and second nodes of the multiple query execution task.

[0107] This step can be achieved through the following steps (1) to (2), including:

[0108] (1) The server determines the type of multiple business sub-data by executing multiple first nodes in multiple query tasks.

[0109] Multiple first nodes can determine the types of multiple business sub-data corresponding to multiple query information based on the correspondence between query information and business sub-data types, and then send the types of multiple business sub-data to multiple second nodes associated with them.

[0110] (2) The server queries multiple data sources in parallel through multiple second nodes associated with multiple first nodes, based on the types of multiple business sub-data.

[0111] If step (2) in step 306 is implemented using the first method, the server can directly determine multiple data sources that match the types of multiple business sub-data through multiple second nodes associated with multiple first nodes, and then query multiple data sources in parallel to obtain multiple business sub-data, wherein each type of business sub-data corresponds to one data source.

[0112] In this implementation, there is no dependency between the multiple second nodes. In this case, the multiple second nodes execute in parallel when querying data, without waiting for each other's execution results. For any second node, after the second node obtains its corresponding business sub-data, it can first store the business sub-data. When multiple second nodes have all obtained their corresponding business sub-data, the server executes step 308.

[0113] If step (2) in step 306 is implemented in the second way, since multiple query execution tasks are executed at the same time, the server can also perform parallel queries on multiple data sources through multiple second nodes associated with multiple first nodes.

[0114] However, for a query execution task, serial queries may occur during the query process. This will be explained in detail below.

[0115] If a query execution task contains multiple related second nodes, where one of these related second nodes is a parent node and the others are child nodes, and the parent node has one or more levels of child nodes, then the server first queries the data source through the lowest-level child node. After the lowest-level child node obtains the data, it sends the obtained data to its next-level child node. The next-level child node then queries the data source based on the obtained data, and so on, until the parent node obtains the data sent by its next-level child node and retrieves the business sub-data based on this data.

[0116] In this implementation, the number of levels in a multi-level child node can be one or more. Here, we will only illustrate this with an example where the number of levels is two, meaning the parent node includes two levels of child nodes. For clarity, we will refer to the two levels of child nodes as the first-level child node and the second-level child node, respectively. The first-level child node is the next level child node of the parent node, and the second-level child node is the child node of the first-level child node, i.e., the lowest level node.

[0117] In this implementation, the number of child nodes at the same level can be one or more. If both the first-level and second-level child nodes are one, the first-level child node needs to query the data source based on the data obtained from the second-level child node. Therefore, this query process is sequential.

[0118] See Figure 4 , Figure 4 This represents multiple related second nodes, with the topmost second node being the parent node. This parent node has five child nodes. The two leftmost child nodes are related, and the second child node depends on data obtained by the first child node. Therefore, after the first child node retrieves data from the data source, it sends the retrieved data to the second child node. The second child node then retrieves the data and returns it to its parent node. Thus, the data query process for the two leftmost child nodes is sequential.

[0119] If there is one first-level child node and multiple second-level child nodes, the first-level child node waits for all the second-level child nodes to obtain the data, processes the multiple data, queries the data source based on the processed data, and then sends the queried data to the parent node.

[0120] Although the query process between a second-level child node and a first-level child node is sequential, there are no relationships between multiple second-level child nodes. Therefore, multiple second-level child nodes can still query multiple data sources in parallel. (See also...) Figure 4 The three child nodes on the right are not related to each other. Therefore, they can query multiple data sources simultaneously and return the retrieved data to their parent node. Thus, the data querying process for the three child nodes on the right is parallel. The parent node, based on the data retrieved by the two child nodes on the left and the three child nodes on the right, sends its retrieved data to its parent node or to the server.

[0121] In this embodiment of the application, regardless of how step (2) in step 306 is implemented, the server can perform parallel queries on multiple data sources, shorten the query time, and thus improve query efficiency.

[0122] See Figure 5 , Figure 5 This application provides a query framework for querying business data. This framework is a native Golang framework and includes a parser, a query task generator, a query executor, and multiple data sources. Through a unified multi-data source query framework, execution plans are dynamically generated based on different query scenarios. A single query entry point is used for unified management and maintenance. Parallel query capabilities improve the parallelism of data queries, reduce repetitive access work, and lower business complexity. Furthermore, unified configuration for managing multiple data sources improves project code maintainability. Additionally, as can be seen from this query framework, this method queries multiple data sources in parallel using the native Golang framework, without relying on other clients or services.

[0123] It's important to note that in step 303, the structure information is retrieved from the data source's configuration information to generate the data structure. During data structure generation, a data source object is also generated based on the structure information; this object is used to retrieve data. Furthermore, the data source configuration information includes data query methods, with each query method corresponding to one data source. Therefore, the server can query the data source using these methods. Accordingly, based on the identifiers of multiple data sources, the server calls multiple data query methods from the configuration information of multiple data sources. Using these multiple query methods, the server queries multiple data sources in parallel through multiple data source objects to retrieve data.

[0124] The data query method is predefined and can be either the Fetch method or other methods; there are no specific restrictions on it.

[0125] In this embodiment of the application, multiple query execution tasks include multiple top nodes. These multiple top nodes summarize the data sent by their child nodes to obtain multiple business sub-data, and then output the multiple business sub-data to the server.

[0126] In this embodiment, the server uses a parser to convert multiple input query fields into query statements, and then uses a query task generator to generate multiple query execution tasks based on the query statements and data source configuration information. By leveraging Golang's multi-coroutine feature, multiple data sources are queried in parallel, thereby improving the parallelism of backend business processes, shortening query time, and increasing query efficiency. Furthermore, the unified configuration of the data source also reduces maintenance costs.

[0127] It should be noted that the server can obtain data from the data provider through the data source. Therefore, the process of the server querying the data source is the process of obtaining data from the data provider through the data source.

[0128] In this embodiment, the advertising delivery system can also access new data sources. For ease of distinction, the aforementioned data sources are referred to as the first data source, and the newly accessed data source is referred to as the second data source. If the second data source is included among the multiple data sources corresponding to multiple query fields in a query request, the server parses the multiple query requests to obtain multiple query statements. These multiple query statements include the identifiers of the second data source and the identifiers of multiple first data sources. Based on these multiple query statements, multiple query execution tasks are generated. Through the first and second nodes in the multiple query execution tasks, queries are performed in parallel on the second data source and the multiple first data sources. Then, the multiple business sub-data obtained from the queries are input to the server. The number of second data sources can be one or more, and there is no specific limitation on this.

[0129] 308. The server will aggregate multiple business sub-data obtained from multiple data sources to obtain business data, and then return the business data to the terminal.

[0130] The server can directly aggregate multiple business sub-data to obtain business data, or it can process multiple business sub-data to obtain business data and then return the business data to the terminal.

[0131] 309. The terminal receives and displays the service data.

[0132] The terminal receives business data sent by the server and displays the business data corresponding to multiple query fields on the query interface.

[0133] Since the business data comprises multiple sub-data items, the terminal can display these sub-data items in multiple areas, with different sub-data items displayed in different areas. Alternatively, the terminal can sort the multiple sub-data items and then display them sequentially from top to bottom. Of course, the terminal can also display multiple sub-data items in other ways, without specific limitations.

[0134] This application provides a method for querying business data. When querying business data, this method generates multiple data structures based on multiple query fields, and then generates multiple query execution tasks based on these data structures. Through the first and second nodes of these multiple query execution tasks, multiple data sources are queried in parallel. Finally, the multiple business sub-data obtained from the multiple data sources are summarized to obtain the business data, which is then returned to the terminal. Therefore, this method can query multiple data sources in parallel based on multiple query fields, thus shortening the query time and improving query efficiency.

[0135] Figure 6 This is a schematic diagram of the structure of a business data query device provided according to an embodiment of this application.

[0136] See Figure 6 The device includes:

[0137] The receiving module 601 is used to receive a query request from the terminal. The query request is used to query the business data of the target content item. The query request includes multiple query fields and multiple data source identifiers. One data source identifier corresponds to at least one query field, and the query field is used to query the corresponding business sub-data through the data source.

[0138] The parsing module 602 is used to parse the query request to obtain multiple query statements. Each query statement corresponds to a data source, and the query statement includes the identifier of the data source and at least one corresponding query field.

[0139] The first generation module 603 is used to generate multiple data structures based on multiple query statements. One query statement corresponds to one data structure. The data structure is used to store the query information used to obtain business sub-data.

[0140] The second generation module 604 is used to generate multiple query execution tasks based on multiple data structures. A query execution task includes a first node and a second node. The first node is used to determine the type of business sub-data to be queried based on query information. The second node associated with the first node is used to obtain business sub-data through the data source based on the type of business sub-data.

[0141] The query module 605 is used to perform parallel queries on multiple data sources through the first and second nodes in a multi-query execution task.

[0142] The aggregation module 606 is used to aggregate multiple business sub-data obtained from multiple data sources to obtain business data, and then return the business data to the terminal.

[0143] In one possible implementation, the second generation module 604 is used to generate multiple first nodes based on multiple query information in multiple data structures; generate multiple second nodes based on multiple data sources matched by multiple query information; and generate multiple query execution tasks based on the multiple first nodes and multiple second nodes.

[0144] In another possible implementation, the second generation module 604 is used to determine the first node and the second node that have a relationship; and to generate a query execution task based on the first node and the second node that have a relationship.

[0145] In another possible implementation, the second generation module 604 is used to associate the first node and the second node that have a relationship to obtain a query execution task; or, to determine multiple second nodes that have a relationship; to associate the multiple second nodes and the first node and the second node that have a relationship to obtain a query execution task; wherein, one of the multiple second nodes that have a relationship is a parent node, and the other second nodes are child nodes, and the second node that is the parent node is used to obtain business sub-data based on the data obtained by the other second nodes that are child nodes.

[0146] In another possible implementation, the query module 605 is used to determine the types of multiple business sub-data through multiple first nodes in multiple query execution tasks, and the first node is used to send the types of business sub-data to the second nodes associated with it; based on the types of multiple business sub-data, multiple data sources are queried in parallel through multiple second nodes associated with multiple first nodes.

[0147] In another possible implementation, the first generation module 603 is used to determine the configuration information of multiple data sources based on the identifiers of multiple data sources in multiple query statements, with one data source identifier corresponding to one configuration information; to obtain multiple structure information from the configuration information of multiple data sources, with one configuration information corresponding to one structure information, and the structure information is used to indicate the method used to generate the data structure; and to generate multiple data structures based on multiple query fields and through the multiple structure information.

[0148] This application provides a business data query device. When querying business data, this device can generate multiple data structures based on multiple query fields, and then generate multiple query execution tasks based on these data structures. Through the first and second nodes of these multiple query execution tasks, multiple data sources are queried in parallel. Finally, the multiple business sub-data obtained from the multiple data sources are summarized to obtain the business data, which is then returned to the terminal. Therefore, this device can query multiple data sources in parallel based on multiple query fields, thus shortening the query time and improving query efficiency.

[0149] Figure 7 This is a schematic diagram of a server structure according to an embodiment of this application. The server 700 can vary significantly due to different configurations or performance. It may include one or more Central Processing Units (CPUs) 701 and one or more memories 702. The memories 702 are used to store executable program code, and the processors 701 are configured to execute the executable program code to implement the business data query methods provided in the various method embodiments described above. Of course, the server 700 may also have wired or wireless network interfaces, a keyboard, and input / output interfaces for input and output. The server 700 may also include other components for implementing device functions, which will not be elaborated here.

[0150] This application also provides a computer-readable storage medium storing at least one piece of program code, which is loaded and executed by a processor to implement the business data query method of any of the above implementations.

[0151] This application also provides a computer program product, which includes computer program code. The computer program code is stored in a computer-readable storage medium. The processor of the computer device reads the computer program code from the computer-readable storage medium and executes the computer program code, causing the computer device to execute the business data query method of any of the above implementations.

[0152] In some embodiments, the computer program product involved in the present application can be deployed and executed on a computer device, or on multiple computer devices located in one location, or on multiple computer devices distributed in multiple locations and interconnected through a communication network. Multiple computer devices distributed in multiple locations and interconnected through a communication network can form a blockchain system.

[0153] The above are merely optional embodiments of this application and are not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.

Claims

1. A method for querying business data, characterized in that, The method includes: The terminal receives a query request, which is used to query business data of a target content item. The query request includes multiple query fields and multiple data source identifiers. Each data source identifier corresponds to at least one query field, and the query field is used to query the corresponding business sub-data through the data source. The query request is parsed to obtain multiple query statements. Each query statement corresponds to a data source, and each query statement includes the identifier of the data source and at least one corresponding query field. Based on the multiple query statements, multiple data structures are generated, with one data structure corresponding to one query statement. The data structures are used to store the query information used to obtain the business sub-data. Based on the multiple data structures, multiple query execution tasks are generated. Each query execution task includes a first node and a second node. The first node is used to determine the type of business sub-data to be queried based on the query information. The second node associated with the first node is used to obtain the business sub-data through the data source based on the type of the business sub-data. The multiple query execution tasks are executed in parallel using the first and second nodes of the multiple query execution tasks; The business data is obtained by aggregating the multiple business sub-data obtained from the multiple data sources and then returning the business data to the terminal. The generation of multiple query execution tasks based on the multiple data structures includes: Based on multiple query information in the multiple data structures, multiple first nodes are generated, with one query information corresponding to one first node; Multiple second nodes are generated based on multiple data sources matched with the multiple query information; Based on the plurality of first nodes and the plurality of second nodes, the plurality of query execution tasks are generated.

2. The method according to claim 1, characterized in that, The generation of the plurality of query execution tasks based on the plurality of first nodes and the plurality of second nodes includes: Identify the first and second nodes that have a relationship; The query execution task is generated based on the first and second nodes that have a relationship.

3. The method according to claim 2, characterized in that, The process of generating the query execution task based on the first and second nodes with the existing relationship includes: The query execution task is obtained by associating the first and second nodes that have a relationship; or... Identify multiple second nodes that are related; associate the multiple second nodes and associate the related first and second nodes to obtain the query execution task; In this context, one of the multiple related second nodes is the parent node, and the other second nodes are the child nodes. The parent second node is used to obtain business sub-data based on the data obtained from the other child second nodes.

4. The method according to claim 1, characterized in that, The step of querying the multiple data sources in parallel through the first and second nodes of the multiple query execution tasks includes: The types of the multiple business sub-data are determined through multiple first nodes in the multiple query execution tasks, and the first node is used to send the types of the business sub-data to the second node associated with it; Based on the types of the multiple business sub-data, the multiple data sources are queried in parallel through multiple second nodes associated with the multiple first nodes.

5. The method according to claim 1, characterized in that, Based on the multiple query statements, multiple data structures are generated, including: Based on the identifiers of multiple data sources in the multiple query statements, the configuration information of the multiple data sources is determined, with one data source identifier corresponding to one configuration information; Multiple structure information is obtained from the configuration information of the multiple data sources, with one configuration information corresponding to one structure information. The structure information is used to indicate the method used to generate the data structure. Based on the multiple query fields, the multiple data structures are generated using the multiple structure information.

6. A business data query device, characterized in that, The device includes: A receiving module is used to receive a query request from a terminal. The query request is used to query business data of a target content item. The query request includes multiple query fields and identifiers of multiple data sources. An identifier of a data source corresponds to at least one query field, and the query field is used to query the corresponding business sub-data through the data source. The parsing module is used to parse the query request to obtain multiple query statements. Each query statement corresponds to a data source, and the query statement includes the identifier of the data source and at least one corresponding query field. The first generation module is used to generate multiple data structures based on the multiple query statements. Each query statement corresponds to one data structure, and the data structure is used to store the query information used to obtain the business sub-data. The second generation module is used to generate multiple query execution tasks based on the multiple data structures. Each query execution task includes a first node and a second node. The first node is used to determine the type of business sub-data to be queried based on the query information. The second node associated with the first node is used to obtain the business sub-data through the data source based on the type of the business sub-data. The query module is used to perform parallel queries on the multiple data sources through the first and second nodes of the multiple query execution tasks. The aggregation module is used to aggregate multiple business sub-data obtained from the multiple data sources to obtain business data, and return the business data to the terminal; The second generation module is used to generate multiple first nodes based on multiple query information in the multiple data structures, with one query information corresponding to one first node; generate multiple second nodes based on multiple data sources matched by the multiple query information; and generate multiple query execution tasks based on the multiple first nodes and the multiple second nodes.

7. The apparatus according to claim 6, characterized in that, The second generation module is used for: Identify the first and second nodes that have a relationship; The query execution task is generated based on the first and second nodes that have a relationship.

8. The apparatus according to claim 7, characterized in that, The second generation module is used for: The query execution task is obtained by associating the first and second nodes that have a relationship; or... Identify multiple second nodes that are related; associate the multiple second nodes and associate the related first and second nodes to obtain the query execution task; In this context, one of the multiple related second nodes is the parent node, and the other second nodes are the child nodes. The parent second node is used to obtain business sub-data based on the data obtained from the other child second nodes.

9. The apparatus according to claim 6, characterized in that, The query module is used for: The types of the multiple business sub-data are determined through multiple first nodes in the multiple query execution tasks, and the first node is used to send the types of the business sub-data to the second node associated with it; Based on the types of the multiple business sub-data, the multiple data sources are queried in parallel through multiple second nodes associated with the multiple first nodes.

10. The apparatus according to claim 6, characterized in that, The first generation module is used for: Based on the identifiers of multiple data sources in the multiple query statements, the configuration information of the multiple data sources is determined, with one data source identifier corresponding to one configuration information; Multiple structure information is obtained from the configuration information of the multiple data sources, with one configuration information corresponding to one structure information. The structure information is used to indicate the method used to generate the data structure. Based on the multiple query fields, the multiple data structures are generated using the multiple structure information.

11. A server, characterized in that, The server includes a processor and a memory, the memory being used to store at least one computer program, the at least one computer program being loaded by the processor and executed as the business data query method according to any one of claims 1 to 5.

12. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store at least one computer program for executing the business data query method according to any one of claims 1 to 5.

13. A computer program product, characterized in that, The computer program product includes computer program code stored in a computer-readable storage medium. The server's processor reads the computer program code from the computer-readable storage medium and executes the computer program code, causing the server to perform the business data query method as described in any one of claims 1 to 5.