A data query method and device, computer equipment and a storage medium

By pre-aggregating data and converting it into binary identifiers for integration, the problem of inefficient querying caused by multiple filtering processes is solved, enabling rapid acquisition of target identifier information and improving data query speed and user experience.

CN116662370BActive Publication Date: 2026-07-31BEIJING YOUZHUJU NETWORK TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING YOUZHUJU NETWORK TECH CO LTD
Filing Date
2023-06-09
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

In existing technologies, when users input multiple query conditions, they need to filter the database multiple times, resulting in low data query efficiency and reduced user experience.

Method used

By pre-aggregating multiple sets of data, multiple sets of target data corresponding to the first query condition are determined and converted into binary identifiers. The target identifier information is then quickly integrated using a computer, and the data is integrated using set operations.

Benefits of technology

It improves data query speed and enhances user experience, especially in the case of large amounts of data, enabling the rapid retrieval of target identification information that meets the criteria.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116662370B_ABST
    Figure CN116662370B_ABST
Patent Text Reader

Abstract

This disclosure provides a data query method, apparatus, computer device, and storage medium. The method includes: responding to a data query request, where the target query conditions carried in the data query request include a first query condition from a first preset query condition; determining multiple sets of first target data corresponding to the first query condition from multiple pre-aggregated sets of first data; for any set of first target data, determining a binary identifier corresponding to the identification information contained in that set of first target data; and, based on the first query condition, determining a target integration method corresponding to the multiple sets of first target data; and integrating the binary identifiers corresponding to the identification information contained in each set of first target data according to the target integration method to obtain target identification information corresponding to the target query condition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computer technology, and more specifically, to a data query method, apparatus, computer equipment, and storage medium. Background Technology

[0002] Typically, when users query data, they enter the conditions they want to query, and then the database filters out the data that meets the conditions based on the user's input.

[0003] In related technologies, if a user enters multiple conditions, the system typically filters some data from the database based on the first condition, then filters from the filtered data based on the second condition, and so on. If the user enters multiple conditions, multiple filtering processes are required. If the data contains a large amount of data, the efficiency of filtering the data is very low, which reduces the user experience. Summary of the Invention

[0004] This disclosure provides at least one data query method, apparatus, computer device, and storage medium.

[0005] In a first aspect, embodiments of this disclosure provide a data query method, including:

[0006] In response to a data query request, if the target query conditions carried in the data query request include the first query condition in the first preset query conditions, multiple sets of first target data corresponding to the first query condition are determined from multiple pre-aggregated sets of first data.

[0007] For any set of first target data, determine the binary identifier corresponding to the identification information contained in the set of first target data; and, based on the first query condition, determine the target integration method corresponding to the multiple sets of first target data.

[0008] The binary identifiers corresponding to the identifier information contained in each group of first target data are integrated according to the target integration method to obtain the target identifier information corresponding to the target query conditions.

[0009] In one possible implementation, the method further includes aggregating the plurality of sets of first data according to the following method:

[0010] Obtain initial data carrying at least one data tag;

[0011] For any set of data tags, based on the data tags carried by the initial data and each data tag contained in the data tag set, the initial data is aggregated to obtain aggregated data corresponding to the set of data tags; wherein, any set of data tags includes at least one data tag.

[0012] In one possible implementation, when the target query condition includes the second query condition in the second preset query condition, the step of integrating the binary identifiers corresponding to the identifier information contained in each group of first target data according to the target integration method to obtain the target identifier corresponding to the target query condition includes:

[0013] The binary identifiers corresponding to the identifier information contained in each group of first target data are integrated according to the target integration method described above.

[0014] Based on the second data corresponding to the second query condition, the target identifier information that satisfies the second query condition is determined from the identifier information contained in the integrated first target data.

[0015] In one possible implementation, any one of the pre-aggregated sets of first data is stored in array form.

[0016] In one possible implementation, the second data is stored in a target storage engine and a backup storage engine, respectively, and the storage method of the target storage engine is different from that of the backup storage engine;

[0017] The step of determining the target identifier information that satisfies the second query condition from the identifier information contained in the integrated first target data based on the second data corresponding to the second query condition includes:

[0018] Based on the second data stored in the target storage engine, determine the target identifier information that satisfies the second query condition from the identifier information contained in the integrated first target data; and,

[0019] In the event of a detected failure of the target storage engine, based on the second data stored in the backup storage engine, the target identification information that satisfies the second query condition is determined from the identification information contained in the integrated first target data.

[0020] In one possible implementation, when the target query conditions include multiple first query conditions, determining the target integration method corresponding to the multiple sets of first target data based on the first query conditions includes:

[0021] From the target query conditions, a first integration relationship is determined among the plurality of first query conditions; and, for any first query condition, a second integration relationship of the data under the preset first query condition is determined;

[0022] Based on the first integration relationship and the second integration relationship, the target integration method corresponding to the multiple sets of first target data is determined;

[0023] The target integration method includes set operation method.

[0024] In one possible implementation, after obtaining the target identifier information corresponding to the target query condition, the method further includes:

[0025] The quantity of the target identification information is determined and sent to the user terminal.

[0026] In one possible implementation, the target identification information is used to characterize the identification information of the user terminal to which the multimedia content is to be delivered;

[0027] After obtaining the target identifier information corresponding to the target query condition, the method further includes:

[0028] The multimedia content is delivered to the user terminal corresponding to the target identification information.

[0029] Secondly, embodiments of this disclosure also provide a data query device, comprising:

[0030] The first determining module is used to respond to a data query request and, when the target query conditions carried in the data query request include the first query condition in the first preset query conditions, determine multiple sets of first target data corresponding to the first query condition from multiple pre-aggregated sets of first data.

[0031] The second determining module is used to determine, for any set of first target data, the binary identifier corresponding to the identification information contained in the set of first target data; and, based on the first query condition, to determine the target integration method corresponding to the multiple sets of first target data.

[0032] The integration module is used to integrate the binary identifiers corresponding to the identifier information contained in each group of first target data according to the target integration method, so as to obtain the target identifier information corresponding to the target query conditions.

[0033] In one possible implementation, the device further includes an aggregation module, which is also configured to aggregate the plurality of sets of first data according to the following method:

[0034] Obtain initial data carrying at least one data tag;

[0035] For any set of data tags, based on the data tags carried by the initial data and each data tag contained in the data tag set, the initial data is aggregated to obtain aggregated data corresponding to the set of data tags; wherein, any set of data tags includes at least one data tag.

[0036] In one possible implementation, when the target query condition includes the second query condition in the second preset query condition, the integration module, when integrating the binary identifiers corresponding to the identifier information contained in each group of first target data according to the target integration method to obtain the target identifier corresponding to the target query condition, is used to:

[0037] The binary identifiers corresponding to the identifier information contained in each group of first target data are integrated according to the target integration method described above.

[0038] Based on the second data corresponding to the second query condition, the target identifier information that satisfies the second query condition is determined from the identifier information contained in the integrated first target data.

[0039] In one possible implementation, any one of the pre-aggregated sets of first data is stored in array form.

[0040] In one possible implementation, the second data is stored in a target storage engine and a backup storage engine, respectively, and the storage method of the target storage engine is different from that of the backup storage engine;

[0041] The integration module, when determining, based on the second data corresponding to the second query condition, the target identifier information in the integrated first target data that satisfies the second query condition, is used to:

[0042] Based on the second data stored in the target storage engine, determine the target identifier information that satisfies the second query condition from the identifier information contained in the integrated first target data; and,

[0043] In the event of a detected failure of the target storage engine, based on the second data stored in the backup storage engine, the target identification information that satisfies the second query condition is determined from the identification information contained in the integrated first target data.

[0044] In one possible implementation, when the target query conditions include multiple first query conditions, the second determining module, when determining the target integration method corresponding to the multiple sets of first target data based on the first query conditions, is used to:

[0045] From the target query conditions, a first integration relationship is determined among the plurality of first query conditions; and, for any first query condition, a second integration relationship of the data under the preset first query condition is determined;

[0046] Based on the first integration relationship and the second integration relationship, the target integration method corresponding to the multiple sets of first target data is determined;

[0047] The target integration method includes set operation method.

[0048] In one possible implementation, after obtaining the target identifier information corresponding to the target query condition, the device further includes a sending module, the sending module being configured to:

[0049] The quantity of the target identification information is determined and sent to the user terminal.

[0050] In one possible implementation, the target identification information is used to characterize the identification information of the user terminal to which the multimedia content is to be delivered;

[0051] After obtaining the target identifier information corresponding to the target query condition, the device further includes a delivery module, which is used to:

[0052] The multimedia content is delivered to the user terminal corresponding to the target identification information.

[0053] Thirdly, embodiments of this disclosure also provide a computer device, including: a processor, a memory, and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the computer device is running, the processor communicates with the memory via the bus, and when the machine-readable instructions are executed by the processor, the steps of the first aspect above, or any possible implementation of the first aspect, are performed.

[0054] Fourthly, embodiments of this disclosure also provide a computer-readable storage medium storing a computer program that, when executed by a processor, performs the steps of the first aspect or any possible implementation of the first aspect.

[0055] The data query method, apparatus, computer device, and storage medium provided in this disclosure, when the target query conditions carried in the data query request include a first query condition from a first preset query condition, can determine multiple sets of first target data corresponding to the first query condition from multiple pre-aggregated sets of first data. Since the multiple sets of first data are pre-aggregated data, multiple sets of first target data satisfying the first query condition can be quickly obtained. Then, for any set of first target data, the binary identifier corresponding to the identification information contained in that set of first target data is determined. Based on the first query condition, a target integration method corresponding to the multiple sets of first target data is determined. Finally, the binary identifiers corresponding to the identification information contained in each set of first target data can be integrated according to the target integration method to obtain target identifier information corresponding to the target query condition. Since computers have a fast processing speed for binary data, converting the first target data into binary identifiers for integration can quickly determine the target identifier information, thereby improving the data query speed.

[0056] To make the above-mentioned objects, features and advantages of this disclosure more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0057] To more clearly illustrate the technical solutions of the embodiments of this disclosure, the accompanying drawings used in the embodiments will be briefly described below. These drawings are incorporated in and constitute a part of this specification. They illustrate embodiments conforming to this disclosure and, together with the specification, serve to explain the technical solutions of this disclosure. It should be understood that the following drawings only show some embodiments of this disclosure and should not be considered as limiting the scope. Those skilled in the art can obtain other related drawings based on these drawings without creative effort.

[0058] Figure 1 A flowchart of a data query method provided by an embodiment of this disclosure is shown;

[0059] Figure 2 A schematic diagram of a storage engine provided in an embodiment of this disclosure is shown;

[0060] Figure 3 This diagram shows an overall flowchart of a data query method provided by an embodiment of the present disclosure;

[0061] Figure 4 A schematic diagram of the architecture of a data query device provided in an embodiment of this disclosure is shown;

[0062] Figure 5A schematic diagram of the structure of a computer device provided in an embodiment of this disclosure is shown. Detailed Implementation

[0063] To make the objectives, technical solutions, and advantages of the embodiments of this disclosure clearer, the technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this disclosure, and not all of them. The components of the embodiments of this disclosure described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this disclosure provided in the accompanying drawings is not intended to limit the scope of the claimed disclosure, but merely represents selected embodiments of this disclosure. All other embodiments obtained by those skilled in the art based on the embodiments of this disclosure without inventive effort are within the scope of protection of this disclosure.

[0064] Typically, when users query data, they enter the conditions they want to query, and then the database filters out the data that meets the conditions based on the user's input.

[0065] In related technologies, if a user enters multiple conditions, the system typically filters some data from the database based on the first condition, then filters from the filtered data based on the second condition, and so on. If the user enters multiple conditions, multiple filtering processes are required. If the data contains a large amount of data, the efficiency of filtering the data is very low, which reduces the user experience.

[0066] Based on the above research, this disclosure provides a data query method, apparatus, computer device, and storage medium. When the target query conditions carried in the data query request include the first query condition in the first preset query conditions, multiple sets of first target data corresponding to the first query condition can be determined from multiple pre-aggregated sets of first data. In this way, since the multiple sets of first data are pre-aggregated data, multiple sets of first target data that satisfy the first query condition can be quickly obtained. Then, for any set of first target data, the binary identifier corresponding to the identification information contained in the set of first target data is determined. And, based on the first query condition, the target integration method corresponding to the multiple sets of first target data is determined. Finally, the binary identifiers corresponding to the identification information contained in each set of first target data can be integrated according to the target integration method to obtain the target identifier information corresponding to the target query condition. Since the computer has a fast processing speed between binary data, converting the first target data into binary identifiers for integration can quickly determine the target identifier information, thereby improving the data query speed.

[0067] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.

[0068] In this document, the term "and / or" merely describes a relationship, indicating that three relationships can exist. For example, A and / or B can represent three cases: A alone, A and B simultaneously, and B alone. Furthermore, the term "at least one" in this document means any combination of at least two of any one or more elements. For example, including at least one of A, B, and C can mean including any one or more elements selected from the set consisting of A, B, and C.

[0069] It is understood that before using the technical solutions disclosed in the various embodiments of this disclosure, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in this disclosure in an appropriate manner in accordance with relevant laws and regulations, and user authorization should be obtained.

[0070] For example, upon receiving a user's active request, a prompt message is sent to the user to explicitly inform them that the requested operation will require the acquisition and use of the user's personal information. This allows the user to independently choose, based on the prompt message, whether to provide personal information to the computer device, application program, server, or storage medium, or other software or hardware performing the operations of this disclosed technical solution.

[0071] As an optional but non-limiting implementation, in response to a user's active request, sending a prompt message to the user can be done via a pop-up window, where the prompt message can be presented in text format. Furthermore, the pop-up window can also include a selection control allowing the user to choose "agree" or "disagree" to provide personal information to the computer device.

[0072] It is understood that the above notification and user authorization process are merely illustrative and do not constitute a limitation on the implementation of this disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of this disclosure.

[0073] To facilitate understanding of this embodiment, a data query method disclosed in this disclosure will first be described in detail. The execution subject of the data query method provided in this disclosure is generally a computer device with a certain computing power. This computer device may include, for example, a user terminal or a server. The user terminal may include a tablet computer, a personal computer, a smartphone, etc. In some possible implementations, this data query method can be implemented by a processor calling computer-readable instructions stored in memory.

[0074] See Figure 1The diagram shows a flowchart of a data query method provided in an embodiment of this disclosure. The method includes steps 101 to 103, wherein:

[0075] Step 101: In response to a data query request, if the target query conditions carried in the data query request include the first query condition in the first preset query conditions, determine multiple sets of first target data corresponding to the first query condition from multiple pre-aggregated sets of first data.

[0076] Step 102: For any set of first target data, determine the binary identifier corresponding to the identifier information contained in the set of first target data; and, based on the first query condition, determine the target integration method corresponding to the multiple sets of first target data.

[0077] Step 103: Integrate the binary identifiers corresponding to the identifier information contained in each group of first target data according to the target integration method to obtain the target identifier information corresponding to the target query conditions.

[0078] The following is a detailed explanation of the steps described above:

[0079] Regarding step 101,

[0080] The data query request can be generated in any data query scenario, such as in the scenario of delivering multimedia content (such as advertisements). The data query request can be a request to query the number of users who meet the conditions for delivering multimedia content. Or, the data query request can be a request to query students who meet the requirements such as grades, grades, and rankings. This disclosure does not limit this.

[0081] In one possible application scenario, the data query request is generated by the user client and then sent to the server for querying. Here, when generating the data query request, the user client can display multiple preset query conditions. Specifically, these preset query conditions can include, for example, basic attribute conditions registered during user registration, behavioral interest conditions such as reading, exercising, or playing games, and data group conditions (such as "XXX audience group") representing data with at least one common feature (common data tag). After at least one preset query condition is selected, a data query request corresponding to that preset query condition can be generated.

[0082] Here, the first preset query request is a request to query a certain preset category. The preset category may include the behavioral interest condition category and the data group condition category.

[0083] The pre-aggregated sets of first data may include identification information. For example, the identification information may be product identification information, such as a product code, or user identification information, such as a user identification (UID).

[0084] In one possible implementation, the pre-aggregated multiple sets of first data can be stored in a memory storage engine, such as RocksDB. This way, since memory storage offers faster data retrieval, storing the multiple sets of first data in memory allows for quick reading, improving data query speed. For example, as shown... Figure 2 The multiple sets of primary data shown, namely behavioral interest data and audience data, are stored in RocksDB.

[0085] In one possible implementation, any one of the pre-aggregated sets of first data is stored as an array. In a specific application scenario, if the data content of the multiple sets of first data is the identification information of multiple users, then for any one set of first data, the identification information of multiple users can be stored as an array.

[0086] For example, if a set of first data includes the UIDs of three users, then the set of first data can be [UID1, UID2, UID3], where UID1, UID2, and UID3 are the identification information of the three users, respectively. In practical applications, the array identifiers of each set of first data can be stored corresponding to each set of first data. For example, the first column in the storage space stores the array identifiers of each set of first data, and the second column can store each set of first data (array).

[0087] This method saves storage space by integrating each piece of data in the first set of data into a single data set (i.e., an array).

[0088] In one possible implementation, the multiple sets of first data can be aggregated according to the following method: First, initial data carrying at least one data tag is obtained; then, for any set of data tag groups, based on the data tags carried by the initial data and each data tag included in the data tag group, the initial data is aggregated to obtain aggregated data corresponding to the set of data tag groups; wherein, any set of data tag groups includes at least one data tag.

[0089] For example, when the initial data includes user identification information, the data tags may include: basic attribute tags, geographic location tags, behavioral interest tags, subscribed user tags, etc., wherein the basic attributes may be specific attributes registered by the user during registration, the geographic location may refer to the user's geographic location at the time of registration, or the geographic location where the user is when accessing the data, the behavioral interests are used to represent the user's interests and hobbies, for example, they may also be those registered by the user during registration, and the subscribed user is used to represent a user who has subscribed to / followed a certain content publisher.

[0090] Specifically, the data tag group can be a pre-set tag used to aggregate the first data. For any data tag group, the data in the initial data that all carry data tags that satisfy the data tag group (such as data carrying all data tags in the data tag group) can be aggregated to obtain the aggregated data corresponding to the data tag group.

[0091] For example, if the data tags carried by data tag group 1 include: tag 1 and tag 2, and the initial data includes: data 1 carrying tag 1 and tag 3, data 2 carrying tag 1 and tag 2, and data 3 carrying tag 1, tag 2 and tag 3, then data 2 and data 3 are aggregated into the data corresponding to data tag group 1.

[0092] This method can accurately aggregate multiple sets of initial data, allowing subsequent data to be quickly retrieved based on the initial query conditions, thus accelerating data retrieval.

[0093] In one possible implementation, the multiple sets of first data can be updated at preset update intervals. Specifically, each set of first data can have its own update interval set. Alternatively, the data tag group can include multiple data tag groups corresponding to different categories, such as behavioral interest categories and audience category categories. The first data group includes 5 data groups for audience category categories and 3 data groups for behavioral interest categories. Update intervals can be set for the aggregated data corresponding to each category's data tag group. For example, the aggregated data corresponding to the behavioral interest category's data tag group can be updated every other day, and the aggregated data corresponding to the audience category's data tag group can be updated every hour.

[0094] This method allows for real-time updates of multiple aggregated sets of primary data, improving the accuracy of data queries.

[0095] In one possible implementation, when determining multiple sets of first target data corresponding to the first query condition from multiple pre-aggregated sets of first data, the multiple sets of first target data corresponding to the first query condition can be determined based on the pre-set correspondence between each first preset query condition and the multiple sets of first data.

[0096] For example, if the first preset query condition "sports shoe orienteering group package" is set in advance, the first data corresponding to the first preset query condition includes data group 1 and data group 2, then when the first query condition is "sports shoe orienteering group package", data group 1 and data group 2 can be determined as multiple sets of first target data corresponding to the first query condition.

[0097] Regarding step 102,

[0098] Specifically, when determining the binary identifier corresponding to the identification information contained in the first target data, the data structure of the first target data can be converted into a bitmap structure, and the binary identifier can be, for example, 11010001.

[0099] Here, for any set of first target data, the step of determining the binary identifier corresponding to the identifier information contained in the set of first target data can be performed after step 101; or, it can be converted and stored in advance before performing step 101. In this case, multiple sets of binary identifiers corresponding to the first query condition can be directly queried in step 101.

[0100] When determining the target integration method corresponding to the multiple sets of first target data based on the first query condition, the target integration method corresponding to the first query condition can be determined based on a pre-set correspondence between each first preset query condition and each integration method. The target integration method can be used to integrate multiple binary data, and the target integration method can include set operations such as intersection, union, and complement.

[0101] In one possible implementation, when the target query conditions include multiple first query conditions, when determining the target integration method corresponding to the multiple sets of first target data based on the first query conditions, a first integration relationship between the multiple first query conditions can be determined from the target query conditions; and, for any first query condition, a second integration relationship of the data under the preset first query condition can be determined; then, based on the first integration relationship and the second integration relationship, the target integration method corresponding to the multiple sets of first target data can be determined.

[0102] The first integration relationship may include the set operation method, and the second integration relationship may also include the set operation method.

[0103] Specifically, the first integration relationship between each first query condition can be preset, or the data query request can carry the first integration relationship between each first query condition, that is, the user can select the first integration relationship between each first query condition. For example, if the first query condition includes "swimming" and "tourism-oriented population package", the user can select the first integration relationship between "swimming" and "tourism-oriented population package" as intersection, union or complement.

[0104] The second integration relationship can be determined based on the pre-set correspondence between each first preset query condition and each integration method, and the second integration relationship corresponding to the first query condition can be used for any first query condition to determine the integration method of the data corresponding to the first query condition in the multiple sets of first target data.

[0105] Regarding step 103,

[0106] For example, if the target integration method is the intersection of the first data group C and the first data group D, the first data group C includes 3 user identification information: 11010001, 10010000, 00000010, and the first data group D includes 4 user identification information: 11010101, 10010000, 00100010, then the intersection of the first data group C and the first data group D is 10010000, and 10010000 is the target identification information.

[0107] It is understandable that if a computer performs calculations directly on binary data, the calculation speed is faster. Therefore, by integrating and calculating multiple sets of binary identifiers, the speed of determining the target identifier is improved.

[0108] In one possible implementation, when the target query conditions include multiple first query conditions, when integrating the binary identifiers corresponding to the identifier information contained in each group of first target data according to the target integration method, the data under each first query condition can be integrated firstly according to the second integration relationship to obtain the integrated data corresponding to each first query condition. Then, the integrated data corresponding to each first query condition can be integrated according to the first integration relationship to obtain the target identifier information corresponding to the target query conditions.

[0109] In one possible implementation, when the target query condition includes the second query condition in the second preset query condition, when integrating the binary identifiers corresponding to the identifier information contained in each group of first target data according to the target integration method to obtain the target identifier corresponding to the target query condition, the binary identifiers corresponding to the identifier information contained in each group of first target data can be integrated firstly according to the target integration method; then, based on the second data corresponding to the second query condition, the target identifier information that satisfies the second query condition among the identifier information contained in the integrated first target data can be determined.

[0110] The second query condition can be a condition for querying specific attribute information. The second data includes multiple identification information, and each identification information in the second data corresponds to attribute information. When the identification information is user identification information, the attribute information may include, for example, the class, exam scores, etc.

[0111] It should be noted that the aforementioned attribute information can be obtained legally, such as information that the user fills in during registration and is legally obtained after the user's authorization.

[0112] In the second data, any identifier and its corresponding attribute information can be stored as a single data entry. In one possible implementation, the second data can be stored in a columnar storage database, such as within the ClickHouse engine, which can be encapsulated with the aforementioned RocksDB. For example, as shown... Figure 2 As shown, the second data (i.e. Figure 2 The demographic attribute data is stored in the Clickhouse engine. To ensure the accuracy of the second data, it can be updated at intervals corresponding to the update time, such as once a day.

[0113] Specifically, after integrating the binary identifiers corresponding to the identifier information contained in each group of first target data according to the target integration method, the identifier information contained in the integrated first target data can be queried in the second data to determine at least one data tag corresponding to the identifier information stored in the second data, and then the target identifier information whose at least one data tag corresponding to each identifier information stored in the second data satisfies the second query condition.

[0114] For example, after integrating the binary identifiers, a target identifier—identifier 1—is obtained. Then, identifier 1 can be queried in the second data to determine at least one data tag corresponding to identifier 1 in the second data. Then, it can be determined whether identifier 1 meets the second query condition based on the at least one data tag. For example, the at least one data tag includes: class A, exam score 95 points. If the second query condition includes: class A, exam score above 90 points, then the identifier information meets the second query condition, and the identifier information can be used as the target identifier information.

[0115] In one possible implementation, to prevent data retrieval failure due to storage engine malfunction, the second data can be backed up during storage. Specifically, the second data can be stored in both a target storage engine and a backup storage engine, with the target storage engine using a different storage method than the backup storage engine.

[0116] In practical applications, the target storage engine can be an engine with faster query speeds, and the backup storage engine can be an engine with more stable operation. For example, such as... Figure 2 As shown, the target storage engine can be the Clickhouse engine, the backup storage engine can be the Elasticsearch engine, and the second data (i.e. Figure 2 The demographic data is stored in both the Clickhouse engine and the Elasticsearch engine.

[0117] When determining the target identifier information that satisfies the second query condition among the identifier information contained in the integrated first target data based on the second data corresponding to the second query condition, the target identifier information that satisfies the second query condition among the identifier information contained in the integrated first target data can be determined based on the second data stored in the target storage engine; and, in the case of detecting a failure of the target storage engine, the target identifier information that satisfies the second query condition among the identifier information contained in the integrated first target data can be determined based on the second data stored in the backup storage engine.

[0118] Using this method, the first backup data can be obtained from the backup storage system when the target storage system fails, thus avoiding the inability to query data due to the failure of the target storage system.

[0119] In one possible application scenario, the data query request sent by the user terminal may only carry the second query condition. Therefore, after responding to the data query request, if the target query request carried by the data query request includes the second query condition but does not include the first query condition, the target identifier information that satisfies the second query condition can be determined from the identifier information contained in the second data corresponding to the second query condition.

[0120] In one possible application scenario, if the data query request is used to query the number of data that meet the targeting conditions, after obtaining the target identification information corresponding to the target query conditions, the quantity information of the target identification information can also be determined and sent to the user terminal.

[0121] In this way, by sending the queried quantity information to the user terminal after steps 101 to 103, it is possible to quickly count and query the number of data. In a specific application scenario, if the target identifier is the user identifier information of the multimedia content to be delivered, this method can be used to quickly determine the number of users covered by the delivered content.

[0122] In one possible application scenario, where the target identification information is used to characterize the identification information of the user terminal to which multimedia content is to be delivered, after obtaining the target identification information corresponding to the target query condition, the multimedia content can also be delivered to the user terminal corresponding to the target identification information.

[0123] In this way, after steps 101 to 103, the user terminals that need to be delivered can be quickly identified, thereby achieving rapid identification of the user terminals to be delivered and delivering multimedia content, thus improving the efficiency of multimedia content delivery.

[0124] Finally, as Figure 3 As shown, this disclosure also provides an overall flow of a data query method applied to a server, including the following steps A1 to A7:

[0125] A1. In response to a data query request, determine multiple sets of first target data corresponding to the first query condition from multiple pre-aggregated sets of first data in the memory storage engine; wherein, the target query condition carried by the data query request includes the first query condition in the first preset query condition and the second query condition in the second preset query condition.

[0126] A2. For any set of first target data, determine the binary identifier corresponding to the identifier information contained in the set of first target data; and, based on the first query condition, determine the target integration method corresponding to the multiple sets of first target data.

[0127] A3. Integrate the binary identifiers corresponding to the identifier information contained in each group of first target data according to the target integration method described above;

[0128] A4. Determine whether the target storage system is faulty;

[0129] If so, proceed to step A5;

[0130] If not, proceed to step A6;

[0131] A5. Based on the second data stored in the backup storage engine, determine the target identification information that satisfies the second query condition from the identification information contained in the integrated first target data;

[0132] After completing step A5, proceed to step A7;

[0133] A6. Based on the second data stored in the target storage engine, determine the target identification information that satisfies the second query condition from the identification information contained in the integrated first target data;

[0134] A7. Determine the quantity of the target identification information and send the quantity information to the user terminal.

[0135] The data query method provided in this embodiment, when the target query conditions carried in the data query request include the first query condition in the first preset query conditions, can determine multiple sets of first target data corresponding to the first query condition from multiple pre-aggregated sets of first data. Since the multiple sets of first data are pre-aggregated data, multiple sets of first target data satisfying the first query condition can be quickly obtained. Then, for any set of first target data, the binary identifier corresponding to the identification information contained in that set of first target data is determined. Based on the first query condition, the target integration method corresponding to the multiple sets of first target data is determined. Finally, the binary identifiers corresponding to the identification information contained in each set of first target data can be integrated according to the target integration method to obtain target identification information corresponding to the target query condition. Since computers have a fast processing speed for binary data, converting the first target data into binary identifiers for integration can quickly determine the target identification information, thereby improving the data query speed.

[0136] Those skilled in the art will understand that, in the above-described method of the specific implementation, the order in which each step is written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of each step should be determined by its function and possible internal logic.

[0137] Based on the same inventive concept, this disclosure also provides a data query device corresponding to the data query method. Since the principle of the device in this disclosure for solving the problem is similar to the data query method described above in this disclosure, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be described again.

[0138] Reference Figure 4 The diagram shown is an architectural schematic of a data query device provided in an embodiment of this disclosure. The device includes: a first determining module 401, a second determining module 402, and an integration module 403; wherein,

[0139] The first determining module 401 is used to respond to a data query request and, when the target query conditions carried in the data query request include the first query condition in the first preset query conditions, determine multiple sets of first target data corresponding to the first query condition from multiple pre-aggregated sets of first data.

[0140] The second determining module 402 is used to determine, for any set of first target data, the binary identifier corresponding to the identifier information contained in the set of first target data; and, based on the first query condition, to determine the target integration method corresponding to the multiple sets of first target data.

[0141] The integration module 403 is used to integrate the binary identifiers corresponding to the identifier information contained in each group of first target data according to the target integration method, so as to obtain the target identifier information corresponding to the target query conditions.

[0142] In one possible implementation, the device further includes an aggregation module 404, which is also configured to aggregate the plurality of sets of first data according to the following method:

[0143] Obtain initial data carrying at least one data tag;

[0144] For any set of data tags, based on the data tags carried by the initial data and each data tag contained in the data tag set, the initial data is aggregated to obtain aggregated data corresponding to the set of data tags; wherein, any set of data tags includes at least one data tag.

[0145] In one possible implementation, when the target query condition includes the second query condition in the second preset query condition, the integration module 403, when integrating the binary identifiers corresponding to the identifier information contained in each group of first target data according to the target integration method to obtain the target identifier corresponding to the target query condition, is used to:

[0146] The binary identifiers corresponding to the identifier information contained in each group of first target data are integrated according to the target integration method described above.

[0147] Based on the second data corresponding to the second query condition, the target identifier information that satisfies the second query condition is determined from the identifier information contained in the integrated first target data.

[0148] In one possible implementation, any one of the pre-aggregated sets of first data is stored in array form.

[0149] In one possible implementation, the second data is stored in a target storage engine and a backup storage engine, respectively, and the storage method of the target storage engine is different from that of the backup storage engine;

[0150] The integration module 403, when determining the target identifier information that satisfies the second query condition among the identifier information contained in the integrated first target data based on the second data corresponding to the second query condition, is used to:

[0151] Based on the second data stored in the target storage engine, determine the target identifier information that satisfies the second query condition from the identifier information contained in the integrated first target data; and,

[0152] In the event of a detected failure of the target storage engine, based on the second data stored in the backup storage engine, the target identification information that satisfies the second query condition is determined from the identification information contained in the integrated first target data.

[0153] In one possible implementation, when the target query conditions include multiple first query conditions, the second determining module 402, when determining the target integration method corresponding to the multiple sets of first target data based on the first query conditions, is used to:

[0154] From the target query conditions, a first integration relationship is determined among the plurality of first query conditions; and, for any first query condition, a second integration relationship of the data under the preset first query condition is determined;

[0155] Based on the first integration relationship and the second integration relationship, the target integration method corresponding to the multiple sets of first target data is determined;

[0156] The target integration method includes set operation method.

[0157] In one possible implementation, after obtaining the target identifier information corresponding to the target query condition, the device further includes a sending module 405, which is configured to:

[0158] The quantity of the target identification information is determined and sent to the user terminal.

[0159] In one possible implementation, the target identification information is used to characterize the identification information of the user terminal to which the multimedia content is to be delivered;

[0160] After obtaining the target identifier information corresponding to the target query conditions, the device further includes a delivery module 406, which is used for:

[0161] The multimedia content is delivered to the user terminal corresponding to the target identification information.

[0162] The processing flow of each module in the device and the interaction flow between each module can be referred to the relevant descriptions in the above method embodiments, and will not be detailed here.

[0163] Based on the same technical concept, this disclosure also provides a computer device. (See also...) Figure 5 The diagram shows the structure of a computer device 500 provided in this embodiment of the present disclosure, including a processor 501, a memory 502, and a bus 503. The memory 502 stores execution instructions and includes main memory 5021 and external memory 5022. The main memory 5021, also called internal memory, is used to temporarily store computational data in the processor 501 and data exchanged with external memory 5022 such as a hard disk. The processor 501 exchanges data with the external memory 5022 through the main memory 5021. When the computer device 500 is running, the processor 501 and the memory 502 communicate through the bus 503, causing the processor 501 to execute the following instructions:

[0164] In response to a data query request, if the target query conditions carried in the data query request include the first query condition in the first preset query conditions, multiple sets of first target data corresponding to the first query condition are determined from multiple pre-aggregated sets of first data.

[0165] For any set of first target data, determine the binary identifier corresponding to the identification information contained in the set of first target data; and, based on the first query condition, determine the target integration method corresponding to the multiple sets of first target data.

[0166] The binary identifiers corresponding to the identifier information contained in each group of first target data are integrated according to the target integration method to obtain the target identifier information corresponding to the target query conditions.

[0167] In one possible implementation, the method further includes, in the instructions executed by processor 501, aggregating the plurality of first data sets according to the following method:

[0168] Obtain initial data carrying at least one data tag;

[0169] For any set of data tags, based on the data tags carried by the initial data and each data tag contained in the data tag set, the initial data is aggregated to obtain aggregated data corresponding to the set of data tags; wherein, any set of data tags includes at least one data tag.

[0170] In one possible implementation, the instructions executed by processor 501, when the target query condition includes the second query condition in the second preset query condition, include the following: Integrating the binary identifiers corresponding to the identifier information contained in each group of first target data according to the target integration method to obtain the target identifier corresponding to the target query condition, includes:

[0171] The binary identifiers corresponding to the identifier information contained in each group of first target data are integrated according to the target integration method described above.

[0172] Based on the second data corresponding to the second query condition, the target identifier information that satisfies the second query condition is determined from the identifier information contained in the integrated first target data.

[0173] In one possible implementation, in the instructions executed by the processor 501, any one of the pre-aggregated sets of first data is stored in array form.

[0174] In one possible implementation, in the instructions executed by the processor 501, the second data is stored in the target storage engine and the backup storage engine respectively, and the storage method of the target storage engine is different from that of the backup storage engine.

[0175] The step of determining the target identifier information that satisfies the second query condition from the identifier information contained in the integrated first target data based on the second data corresponding to the second query condition includes:

[0176] Based on the second data stored in the target storage engine, determine the target identifier information that satisfies the second query condition from the identifier information contained in the integrated first target data; and,

[0177] In the event of a detected failure of the target storage engine, based on the second data stored in the backup storage engine, the target identification information that satisfies the second query condition is determined from the identification information contained in the integrated first target data.

[0178] In one possible implementation, when the target query conditions include multiple first query conditions, the step of determining the target integration method corresponding to the multiple sets of first target data based on the first query conditions in the instructions executed by the processor 501 includes:

[0179] From the target query conditions, a first integration relationship is determined among the plurality of first query conditions; and, for any first query condition, a second integration relationship of the data under the preset first query condition is determined;

[0180] Based on the first integration relationship and the second integration relationship, the target integration method corresponding to the multiple sets of first target data is determined;

[0181] The target integration method includes set operation method.

[0182] In one possible implementation, after obtaining the target identifier information corresponding to the target query condition, the method further includes the following steps in the instructions executed by processor 501:

[0183] The quantity of the target identification information is determined and sent to the user terminal.

[0184] In one possible implementation, the target identification information in the instructions executed by the processor 501 is used to characterize the identification information of the user terminal to which multimedia content is to be delivered.

[0185] After obtaining the target identifier information corresponding to the target query condition, the method further includes:

[0186] The multimedia content is delivered to the user terminal corresponding to the target identification information.

[0187] This disclosure also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the steps of the data query method described in the above method embodiments. The storage medium can be a volatile or non-volatile computer-readable storage medium.

[0188] This disclosure also provides a computer program product carrying program code. The program code includes instructions that can be used to execute the steps of the data query method described in the above method embodiments. For details, please refer to the above method embodiments, which will not be repeated here.

[0189] The aforementioned computer program product can be implemented through hardware, software, or a combination thereof. In one optional embodiment, the computer program product is specifically embodied in a computer storage medium; in another optional embodiment, the computer program product is specifically embodied in a software product, such as a software development kit (SDK), etc.

[0190] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems and devices described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. In the several embodiments provided in this disclosure, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Another point is that the displayed or discussed mutual coupling or direct coupling or communication connection may be through some communication interfaces; the indirect coupling or communication connection of devices or units may be electrical, mechanical, or other forms.

[0191] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0192] In addition, the functional units in the various embodiments of this disclosure can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0193] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a processor-executable, non-volatile, computer-readable storage medium. Based on this understanding, the technical solution of this disclosure, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this disclosure. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0194] Finally, it should be noted that the above-described embodiments are merely specific implementations of this disclosure, used to illustrate the technical solutions of this disclosure, and not to limit it. The protection scope of this disclosure is not limited thereto. Although this disclosure has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features, within the scope of the technology disclosed in this disclosure. Such modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this disclosure, and should all be covered within the protection scope of this disclosure. Therefore, the protection scope of this disclosure should be determined by the protection scope of the claims.

Claims

1. A data query method, characterized by, include: In response to a data query request, if the target query conditions carried in the data query request include the first query condition in the first preset query conditions, multiple sets of first target data corresponding to the first query condition are determined from multiple pre-aggregated sets of first data. For the first group of first target data in the plurality of first target data, determine the binary identifier corresponding to the identifier information contained in the first group of first target data; And, based on the first query condition, determine the target integration method corresponding to the multiple sets of first target data; The binary identifiers corresponding to the identifier information contained in each group of first target data are integrated according to the target integration method to obtain the target identifier information corresponding to the target query conditions. Where the target query conditions include multiple first query conditions, the step of determining the target integration method corresponding to the multiple sets of first target data based on the first query conditions includes: From the target query conditions, a first integration relationship is determined among the plurality of first query conditions; and, for the target first query condition among the plurality of first query conditions, a second integration relationship is determined for the data corresponding to the target first query condition; Based on the first integration relationship and the second integration relationship, the target integration method corresponding to the multiple sets of first target data is determined. The second integration relationship is determined based on the correspondence between each preset first query condition and each integration method.

2. The method of claim 1, wherein, The method further includes aggregating the multiple sets of first data according to the following method: Obtain initial data carrying at least one data tag; For the first group of data tags, based on the data tags carried by the initial data and each data tag included in the first group of data tags, the initial data is aggregated to obtain aggregated data corresponding to the first group of data tags; wherein, the first group of data tags includes at least one data tag.

3. The method of claim 1, wherein, When the target query condition includes the second query condition in the second preset query condition, the step of integrating the binary identifiers corresponding to the identifier information contained in each group of first target data according to the target integration method to obtain the target identifier corresponding to the target query condition includes: The binary identifiers corresponding to the identifier information contained in each group of first target data are integrated according to the target integration method described above. Based on the second data corresponding to the second query condition, the target identifier information that satisfies the second query condition is determined from the identifier information contained in the integrated first target data.

4. The method of claim 1, wherein, In the pre-aggregated multiple sets of first data, any one set of first data is stored in the form of an array.

5. The method of claim 3, wherein, The second data is stored in the target storage engine and the backup storage engine, respectively, and the storage method of the target storage engine is different from that of the backup storage engine; The step of determining the target identifier information that satisfies the second query condition from the identifier information contained in the integrated first target data based on the second data corresponding to the second query condition includes: Based on the second data stored in the target storage engine, determine the target identification information that satisfies the second query condition from the identification information contained in the integrated first target data; as well as, In the event of a failure of the target storage engine, based on the second data stored in the backup storage engine, the target identification information that satisfies the second query condition is determined from the identification information contained in the integrated first target data.

6. The method according to claim 1, characterized in that, The target integration method includes set operation method.

7. The method of claim 1, wherein, After obtaining the target identifier information corresponding to the target query condition, the method further includes: The quantity of the target identification information is determined and sent to the user terminal.

8. The method of claim 1, wherein, The target identification information is used to characterize the identification information of the user terminal to which the multimedia content is to be delivered; After obtaining the target identifier information corresponding to the target query condition, the method further includes: The multimedia content is delivered to the user terminal corresponding to the target identification information.

9. A data query apparatus, characterized by comprising: include: The first determining module is used to respond to a data query request and, when the target query conditions carried in the data query request include the first query condition in the first preset query conditions, determine multiple sets of first target data corresponding to the first query condition from multiple pre-aggregated sets of first data. The second determining module is used to determine the binary identifier corresponding to the identification information contained in the first group of first target data for the first group of first target data among the multiple groups of first target data; And, based on the first query condition, determine the target integration method corresponding to the multiple sets of first target data; The integration module is used to integrate the binary identifiers corresponding to the identifier information contained in each group of first target data according to the target integration method, so as to obtain the target identifier information corresponding to the target query conditions. Where the target query conditions include multiple first query conditions, determining the target integration method corresponding to the multiple sets of first target data based on the first query conditions includes: From the target query conditions, a first integration relationship is determined among the plurality of first query conditions; and, for the target first query condition among the plurality of first query conditions, a second integration relationship is determined for the data corresponding to the target first query condition; Based on the first integration relationship and the second integration relationship, the target integration method corresponding to the multiple sets of first target data is determined. The second integration relationship is determined based on the correspondence between each preset first query condition and each integration method.

10. A computer device, comprising: include: The computer device includes a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the computer device is running, the processor communicates with the memory via the bus. When the machine-readable instructions are executed by the processor, they perform the steps of the data query method as described in any one of claims 1 to 8.

11. A computer readable storage medium, characterized in that, The computer readable storage medium stores a computer program, and the computer program is run by the processor to execute the steps of the data query method according to any one of claims 1 to 8.