Data query method, system, and apparatus

CN119149583BActive Publication Date: 2026-10-23ALIBABA CLOUD COMPUTING CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310709314.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-14
Publication Date
2026-10-23
Estimated Expiration
2043-06-14

AI Technical Summary

Technical Problem

[0003]然而,当获取的数据量很大,或接收到的数据查询请求为多个的情况下,上述方案并不能保证数据的查询的高效性,因此,亟需一种高效的数据查询方法

Benefits of technology

[0011]本说明书一个实施例提供的数据查询方法,从数据源获取数据;基于多方处理模式对所述数据进行处理并采样,生成所述数据对应的样本,所述多方处理模式是多方参与同一指定计算的处理模式;响应于接收到数据查询请求,根据所述数据查询请求选择样本;利用选择的样本进行查询计算,得到查询结果;将所述查询结果返回给客户端。通过多方处理模式对获取的数据进行处理并采样,生成数据对应的多个样本,实现在接收到数据查询请求的时候,可以基于该数据查询请求在生成的多个样本中选择样本,并利用选择的样本进行查询计算,得到查询结果,从而实现在减少数据冗余及缩短通信时长的基础上,提升数据查询的效率,以及用户的查询满意度。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119149583B_ABST
    Figure CN119149583B_ABST
Patent Text Reader

Abstract

Embodiments of the present specification provide a data query method, system and device, wherein the data query method comprises: obtaining data from a data source; processing and sampling the data based on a multi-party processing mode to generate samples corresponding to the data, the multi-party processing mode being a processing mode in which multiple parties participate in the same specified calculation; in response to receiving a data query request, selecting a sample according to the data query request; performing query calculation using the selected sample to obtain a query result; and returning the query result to a client. By processing and sampling the obtained data based on the multi-party processing mode to generate multiple samples corresponding to the data, when a data query request is received, a sample can be selected from the generated multiple samples based on the data query request, and query calculation is performed using the selected sample to obtain a query result, without the need to perform query calculation based on all data, thereby improving the efficiency of data query.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This specification relates to the field of computer technology, and in particular to a data query method. One or more embodiments of this specification also relate to a data query system, a data query device, a computing device, a computer-readable storage medium, and a computer program. Background Technology

[0002] With the continuous development of computer technology, the amount of data generated by enterprises and individual users is exploding. Improving the efficiency of data querying amidst massive amounts of data has gradually become a research focus. Currently, data querying is based on the server-side processing of all acquired data. When a data query request is received, in order to obtain the data corresponding to that request, the server typically performs query processing on all acquired data according to the query request, thereby obtaining the query results, which are then returned to the client.

[0003] However, when the amount of data acquired is large, or when multiple data query requests are received, the above solution cannot guarantee the efficiency of data query. Therefore, there is an urgent need for an efficient data query method. Summary of the Invention

[0004] In view of this, embodiments of this specification provide a data query method. One or more embodiments of this specification also relate to a data query system, a data query device, a computing device, a computer-readable storage medium, and a computer program, to address the technical deficiencies existing in the prior art.

[0005] According to a first aspect of the embodiments of this specification, a data query method is provided, comprising: obtaining data from a data source; processing and sampling the data based on a multi-party processing mode to generate samples corresponding to the data, wherein the multi-party processing mode is a processing mode in which multiple parties participate in the same specified calculation; in response to receiving a data query request, selecting samples according to the data query request; performing query calculations using the selected samples to obtain query results; and returning the query results to a client.

[0006] According to a second aspect of the embodiments of this specification, a data query system is provided, comprising: a data source, at least one client, and at least two servers; the data source being configured to provide data to the at least two servers; the client being configured to send a data query request to the at least two servers, receive query results returned by the at least two servers, and generate multi-party query results using the query results returned by the at least two servers; the at least two servers being configured to process the data query request according to the data query method provided in any embodiment of this specification.

[0007] According to a third aspect of the embodiments of this specification, a data query apparatus is provided, comprising: a data acquisition module configured to acquire data from a data source; a sample generation module configured to process and sample the data based on a multi-party processing mode to generate samples corresponding to the data, wherein the multi-party processing mode is a processing mode in which multiple parties participate in the same specified calculation; a sample selection module configured to select samples according to the data query request in response to receiving a data query request; a query execution module configured to perform query calculations using the selected samples to obtain query results; and a result return module configured to return the query results to a client.

[0008] According to a fourth aspect of the embodiments of this specification, a computing device is provided, including: a memory and a processor; the memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions, wherein the computer-executable instructions, when executed by the processor, implement the steps of the above-described data query method.

[0009] According to a fifth aspect of the embodiments of this specification, a computer-readable storage medium is provided that stores computer-executable instructions, which, when executed by a processor, implement the steps of the data query method described above.

[0010] According to a sixth aspect of the embodiments of this specification, a computer program is provided, wherein when the computer program is executed in a computer, it causes the computer to perform the steps of the above-described data query method.

[0011] This specification provides a data query method according to one embodiment, which involves acquiring data from a data source; processing and sampling the data based on a multi-party processing mode to generate samples corresponding to the data, wherein the multi-party processing mode is a processing mode in which multiple parties participate in the same specified calculation; in response to receiving a data query request, selecting samples according to the data query request; performing query calculations using the selected samples to obtain query results; and returning the query results to the client. By processing and sampling the acquired data through a multi-party processing mode to generate multiple samples corresponding to the data, when a data query request is received, samples can be selected from the multiple generated samples based on the data query request, and query calculations can be performed using the selected samples to obtain query results. This improves the efficiency of data query and user query satisfaction while reducing data redundancy and shortening communication time. Attached Figure Description

[0012] Figure 1 This is a scenario diagram illustrating a data query method provided in one embodiment of this specification;

[0013] Figure 2 This is an architecture diagram of a data query system provided in one embodiment of this specification;

[0014] Figure 3 This is a flowchart illustrating a data query method provided in one embodiment of this specification;

[0015] Figure 4 This is a flowchart illustrating an offline stage data processing method provided in one embodiment of this specification;

[0016] Figure 5 This is a flowchart illustrating an online stage data processing method provided in one embodiment of this specification;

[0017] Figure 6 This is a schematic diagram of a data query interface provided in one embodiment of this specification;

[0018] Figure 7 This is a schematic diagram of the structure of a data query device provided in one embodiment of this specification;

[0019] Figure 8 This is a structural block diagram of a computing device provided in one embodiment of this specification. Detailed Implementation

[0020] Many specific details are set forth in the following description to provide a full understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar extensions without departing from the spirit of this specification. Therefore, this specification is not limited to the specific implementations disclosed below.

[0021] The terminology used in one or more embodiments of this specification is for the purpose of describing particular embodiments only and is not intended to be limiting of the one or more embodiments of this specification. The singular forms “a,” “described,” and “the” as used in one or more embodiments of this specification and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items.

[0022] It should be understood that although the terms first, second, etc., may be used to describe various information in one or more embodiments of this specification, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, first may also be referred to as second without departing from the scope of one or more embodiments of this specification, and similarly, second may also be referred to as first. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to a determination."

[0023] Furthermore, it should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in one or more embodiments of this specification are all information and data authorized by the user or fully authorized by all parties. Moreover, the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation entry points are provided for users to choose to authorize or refuse.

[0024] First, the terms and concepts used in one or more embodiments of this specification will be explained.

[0025] MPC (Secure Multi-party Computation): refers to a model in which multiple parties jointly compute a common function, requiring each party to receive a specified computation result without obtaining any other related information.

[0026] MASQUE (Multi-party Approximate Secure Query Processing): The multi-party secure computation-based approximate query system provided in the embodiments of this specification allows users to complete approximate queries by balancing query accuracy and query response time while ensuring data security.

[0027] Batchsampling: refers to a sampling method that generates a set of samples.

[0028] Offline-Online Mode: A working mode used to execute offline tasks when idle and online tasks when a query arrives.

[0029] Circuit: A directed graph in which nodes are also called "gates", corresponding to inputs, outputs, logical operations, or arithmetic operations.

[0030] With the continuous development of computer technology, the amount of data generated by enterprises or individual users is growing explosively. In order to improve the efficiency of data query in massive amounts of data, the current data query methods are based on data obtained from the data source. That is, when a data query request arrives, all the data obtained from the data source is processed based on the data query request to obtain the query results and return the query results to the client.

[0031] However, when the amount of data obtained from the data source is large, receiving a data query request can lead to problems such as high computational load, data redundancy, and prolonged data communication time due to the need to process a large amount of data. This reduces the efficiency of data querying and the user's query experience. Similarly, when multiple data query requests are received, they need to be queued because each request is based on all the data obtained from the data source. That is, only after processing all the data to obtain the first query result can the processing continue to obtain the second query result, and so on. When there are multiple data query requests, each request requires processing all the data before a result can be obtained, resulting in high computational load and long communication time, thus reducing data query efficiency and user satisfaction.

[0032] To address the aforementioned issues, this specification provides a data query method. Specifically, it involves acquiring data from a data source; processing and sampling the data based on a multi-party processing mode to generate samples corresponding to the data, where the multi-party processing mode involves multiple parties participating in the same specified calculation; responding to a received data query request, selecting samples according to the request; performing query calculations using the selected samples to obtain query results; and returning the query results to the client. By processing and sampling the acquired data using a multi-party processing mode to generate multiple samples corresponding to the data, upon receiving a data query request, a sample can be selected from the generated samples based on the request, and query calculations can be performed using the selected sample to obtain query results, eliminating the need to perform query calculations based on all data, thereby improving the efficiency of data querying.

[0033] This specification provides a data query method, and also relates to a data query system, a data query device, a computing device, and a computer-readable storage medium, which will be described in detail in the following embodiments.

[0034] See Figure 1 , Figure 1This is a scenario diagram illustrating a data query method provided in one embodiment of this specification. In this scenario, according to the data query method provided in this embodiment, multiple parties can jointly compute a common function for data querying in an offline-online mode through a multi-party secure computation (MPC) service. This means that a single computation generates multiple samples (i.e., batch sampling). Multi-party secure computation refers to a model where multiple parties jointly compute a common function, requiring each party to obtain a specified computation result without receiving any other related information. As a mainstream data secure computation scheme, it incurs significant computational and communication overhead. Therefore, this embodiment proposes an approximate query system (MASQUE), which reduces data computation and communication overhead by performing multi-party secure computation in an offline-online mode. This system samples the data source offline, generating multiple samples, and parses the data query request online, using the samples to provide approximate query results. This system employs an efficient non-replacement sampling method to reduce computational errors. Furthermore, the multiple samples generated in a single offline computation can answer multiple queries, thereby improving query efficiency.

[0035] like Figure 1 As shown, this data query method is applied to querying shopping mall data. It should be noted that the data query method provided in this embodiment can be applied to scenarios beyond just querying shopping mall data. It can also be used to query enterprise data, institutional data, internet traffic data, etc., depending on actual needs. This embodiment does not impose any limitations on these scenarios. The data query scenario provided in this embodiment uses shopping mall data as an example, specifically querying data from a shopping mall data warehouse.

[0036] like Figure 1 As shown in the diagram, the scenario of this data query method includes: a data warehouse 102, a server 104, and a user 106. The data warehouse 102 is used to send data to the server; the server 104 is used to store and compute the data obtained from the data warehouse 102 and return the query results to the user 106. In this embodiment, there are at least two servers 104, and these servers are independent of each other, with each server obtaining independent data from the data warehouse 102; the user 106 is used to send data query requests to the server 104 and receive the query results returned by the server 104.

[0037] The interaction between data warehouse 102, server 104, and user 106 is implemented based on an approximate query system. This system reduces the amount of data computation and communication by performing multi-party secure computation in an offline-online mode. In the offline phase, the system samples the data obtained from the data warehouse to generate multiple samples. In the online phase, it parses the data query request and uses the samples to provide approximate query results.

[0038] Specifically, server 104 stores and performs calculations on data obtained from data warehouse 102 based on an offline-online mode. Taking the storage and calculation of data obtained by one server 104 as an example, the interaction between data warehouse 102 and server 104 is implemented in offline mode. After obtaining data from data warehouse 102, the obtained data is processed and sampled based on a multi-party processing mode to generate samples corresponding to the data. The interaction between user 106 and server 104 is implemented in online mode. In response to receiving a data query request sent by user 106, server 104 switches from offline to online, selects samples according to the data query request, performs query calculations using the selected samples, obtains the query results, and finally returns the query results to user 106. It should be noted that the query results returned to user 106 are sent to user 106 separately by each independent server. User 106 processes the query results sent by each server 104 to obtain the final query result.

[0039] This specification provides a scenario diagram of a data query method based on multi-party secure computation. The method processes and samples the acquired data using a multi-party processing mode, generating multiple samples corresponding to the data. When a data query request is received, a sample can be selected from the generated samples based on the request, and the selected sample is used to perform query calculations to obtain the query result. This improves data query efficiency and user satisfaction while reducing data redundancy and shortening communication time. Furthermore, the approximate query system uses an efficient non-replacement random sampling method to reduce calculation errors. Multiple samples generated in the offline stage can answer multiple queries, thereby improving query efficiency.

[0040] See Figure 2 , Figure 2 This is an architecture diagram of a data query system provided in one embodiment of this specification. The data query system includes: a data source 202, at least one client 206, and at least two servers 204.

[0041] The data source 202 is used to provide data to the at least two servers;

[0042] The client 206 is configured to send data query requests to the at least two servers, receive query results returned by the at least two servers, and generate multi-party query results using the query results returned by the at least two servers.

[0043] The at least two servers 204 are used to process data query requests according to the data query method provided in any embodiment of this specification.

[0044] Specifically, at least two servers 204 are used to obtain data from data source 202. The obtained data is secretly shared by data source 202 with the at least two servers 204, and the at least two servers 204 are not colluding with each other. The data is processed and sampled based on a multi-party processing mode, generating samples corresponding to the data. The multi-party processing mode is a processing mode in which multiple parties participate in the same specified calculation. In response to receiving a data query request sent by client 206, samples are selected according to the data query request. Query calculations are performed using the selected samples to obtain query results. The query results are then returned to client 206. It should be noted that the target query result returned to client 206 is returned by at least two non-colluding servers 204.

[0045] Client 206 is also used to receive query results sent by at least two servers 204.

[0046] Data source 202 is also used to send data to at least two servers 204.

[0047] In this system, data source 202 and server 204, as well as client 206 and server 204, are connected via a network. The network provides the communication link between data source 202 and server 204, and between client 206 and server 204. The network can include various connection types, such as wired or wireless communication links, or fiber optic cables. Data transmitted by data source 202 may require encoding, transcoding, compression, or other processing before being published to server 204.

[0048] Client 206 can be a browser, an app (application), a web application such as an H5 (HyperText Markup Language 5) application, a lightweight application (also known as a mini-program), or a cloud application, etc. Client 100 can be developed based on the software development kit (SDK) of the corresponding service provided by the server, such as based on a real-time communication (RTC) SDK. Client 100 can be deployed in electronic devices and depends on the device to run or on certain apps on the device. Electronic devices may have a display screen and support information browsing, such as personal mobile terminals such as mobile phones, tablets, and personal computers. Various other types of applications can also be configured in electronic devices, such as human-computer interaction applications, model training applications, text processing applications, web browser applications, shopping applications, search applications, instant messaging tools, email clients, social media platform software, etc.

[0049] Server 204 can include servers providing various services, such as servers providing communication services to multiple clients, servers supporting backend training of models used on clients, and servers processing data sent by clients. It should be noted that server 204 can be implemented as a distributed server cluster composed of multiple servers, or as a single server. The server can also be a server in a distributed system, or a server integrated with blockchain. The server can also be a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms, or an intelligent cloud computing server or intelligent cloud host with artificial intelligence technology.

[0050] It should be noted that the architecture diagram of the data query system provided in the embodiments of this specification uses two servers as an example, such as... Figure 2As shown, the server-side participants include two non-colluding servers. These two servers typically do not own the data; they only provide storage and secure computation services. The data source secretly shares its data with these two participants. Because they are not colluding, the individual data they each receive is meaningless. The two participants can use the MPC protocol to process and sample the data. When a client submits a query, the servers perform computations on the data and secretly share the results back to the recipients. Throughout this process, only the recipient receives the computation results; no other information is leaked, thus ensuring data security. Furthermore, by having at least two servers process the data, processing time is reduced, thereby improving data query efficiency.

[0051] The solution in the embodiments of this specification processes and samples the acquired data through a multi-processing mode, generating multiple samples corresponding to the data. When a data query request is received, the query result can be obtained by using the selected samples generated based on the multiple samples generated by the data query request, without having to perform the query calculation based on all the data, thereby improving the efficiency of data query.

[0052] See Figure 3 , Figure 3 This is a flowchart of a data query method provided in one embodiment of this specification, which specifically includes the following steps:

[0053] Step 302: Obtain data from the data source.

[0054] In this context, the data source can be understood as the data owner that sends data to multiple servers, such as a server that stores the data or a data warehouse.

[0055] In one or more embodiments of this specification, the data obtained from the data source is based on the data source's allocation of all its data. It should be noted that there are at least two servers obtaining data from the data source. These at least two servers are independent of each other, performing their respective calculations through a computing protocol, and the computational and communication loads of these at least two servers after obtaining the data are equivalent. In this embodiment, the example used is two servers as participants processing and sampling the data.

[0056] Step 304: Process and sample the data based on the multi-party processing mode to generate samples corresponding to the data. The multi-party processing mode is a processing mode in which multiple parties participate in the same specified calculation.

[0057] In one or more embodiments of this specification, after acquiring the data, it is further necessary to process and sample the data based on a multi-processing mode to generate data and corresponding samples.

[0058] Among them, the multi-party processing mode can be understood as a processing mode based on the participation of multiple servers to perform the same specified calculation on the received data.

[0059] In practical applications, data is processed and sampled based on a multi-processing model, generating multiple samples corresponding to the data. The specific number of samples is selected according to the actual situation, and the embodiments in this specification do not impose any limitations on this.

[0060] The process of sampling data can utilize efficient non-replacement random sampling methods. Non-replacement random sampling is a method where, when selecting individuals, each selected individual is not returned to the population for subsequent selections. With non-replacement random sampling, the total number of units in the population gradually decreases during the sampling process, and the probability of each unit being selected varies sequentially. For example, suppose there are one thousand data points that need to be divided into ten samples. Therefore, each sample includes one hundred data points. These one hundred data points are selected using non-replacement random sampling. In the first data sampling, the first data point is randomly selected from the one thousand data points and added to the sample. In the second data sampling, the second data point is randomly selected from the remaining nine hundred and ninety-nine data points and added to the sample. This process continues until one hundred data points have been sampled, generating the first sample.

[0061] In practice, the acquired data is processed based on the preset sample requirements in the multi-party processing mode, thereby combining the scattered data according to the preset sample requirements so that subsequent sampling can be performed based on this combined data. It should be noted that the generated multiple samples are independent of each other, and after receiving a query request, all multiple independent samples can be used to perform query calculations.

[0062] For example, suppose there are n rows of data obtained from the data source, and the preset sample size is s rows per sample, where the value of s is less than the value of n. Then, by repeating the calculation n / s times on the n rows of data obtained from the data source, that is, each calculation randomly selects s ​​data points between 1 and n. It should be noted that the values ​​between 1 and n constitute the position information of the data to be sampled. Finally, the s position information points are concatenated to obtain n / s samples, and the size of each sample is s. Taking workplace salary data as an example, suppose there are 20,000 rows of randomly obtained workplace salary data, and the preset sample size of workplace salary data is known to be 500 rows per sample. Then, by performing 40 calculations on the 20,000 rows of data, that is, each calculation selects 500 data points between 10,000 and 20,000, a total of 40 workplace salary data samples can be obtained, and each workplace salary data sample contains 500 data points.

[0063] The method for processing and sampling data using a multi-processing mode provided in the embodiments of this specification can obtain multiple independent samples through a single calculation. This enables the system to respond to a user's data query request based on one sample, and then respond to other data query requests based on other samples, thereby improving query efficiency and enhancing user satisfaction.

[0064] In one or more embodiments of this specification, data processing and sampling based on a multi-party processing mode are performed by processing and sampling data based on preset query content types and preset query precision in the multi-party processing mode, thereby obtaining corresponding samples. The specific implementation method is as follows:

[0065] The process of processing and sampling the data based on a multi-party processing model to generate samples corresponding to the data includes:

[0066] Based on the preset query content type in the multi-party processing mode, data with the same query content type are merged to obtain the data set corresponding to the query content type;

[0067] Based on the preset query precision in the multi-party processing mode, the data set corresponding to the query content type is sampled to generate a sample that corresponds to the query content type and meets the query precision.

[0068] The multi-party processing mode is consistent with the multi-party processing mode in the above data query method, and will not be described in detail in the embodiments of this specification.

[0069] The query content type can be understood as the type of data content that determines the data query request, such as employee salaries, mall sales, mall foot traffic, etc.

[0070] Query precision can be understood as the requirement for determining the accuracy of the data corresponding to a data query request. For example, query precision can be used to determine the number of data rows in the selected sample. The higher the data query precision, the more data rows are selected in the sample.

[0071] In practical implementation, the data processing based on the multi-party processing mode is based on the preset query content type in the multi-party processing mode. Data with the same query content type are merged to obtain a data set corresponding to the query content type. Here, the data content type can be workplace salary data, shopping mall sales data, or tourist attraction data. The specific query content type should be determined according to the actual situation, and this embodiment does not limit it here. The data sampling based on the multi-party processing mode is based on the preset query precision in the multi-party processing mode. The data set corresponding to the query content type is sampled to generate a sample that corresponds to the query content type and meets the query precision. Here, the query precision is determined according to the actual situation of the data query requests received subsequently, and this embodiment does not limit it here.

[0072] In practical applications, before receiving a data query request from a client, the server will estimate the data query requests that the client may send based on the actual meaning of the data obtained from the data source, process the obtained data based on the estimated query content type, obtain a data set corresponding to the estimated query content type, and sample the data set corresponding to the estimated query content type based on the possible query accuracy.

[0073] For example, taking shopping mall data as an example, suppose the estimated query content type is: one is to query the purchase quantity information of a customer who buys a certain product, and the other is to query the total price of a certain type of product purchased by a customer. Then, according to the estimated query content type, a data set corresponding to the query content type can be obtained. The data set includes customer information, product information, and order information, as shown in Tables 1-3. Table 1 refers to customer information, Table 2 refers to product information, and Table 3 refers to order information.

[0074] Table 1

[0075]

[0076] Table 2

[0077]

[0078] Table 3

[0079]

[0080] After obtaining the datasets in Tables 1-3, the datasets are first denormalized and sampled based on preset query content types and preset query content precision to obtain a flat table, as shown in Table 4. Then, based on preset query types, Table 4 is sampled multiple times to generate the corresponding sample pool. For example, when the preset data query content type is the total price of goods purchased by customers, Table 4 is stratified and sampled by customer according to this preset query content type; when the preset data query content type is the total sales volume of goods, Table 4 is stratified and sampled by goods according to this preset query content type; when the preset query content precision is 150, multiple sets of samples of size 150 are generated from the obtained n rows of data.

[0081] Table 4

[0082]

[0083]

[0084] See Figure 4 , Figure 4 This is a flowchart illustrating an offline data processing method according to one embodiment of this specification. Figure 4 As shown, Table (Secret Sharing) 4-1 can be understood as obtaining data from the data source, where the data obtained from the data source is secretly shared by the data source with the server in the form of a table; Denormalization 4-2 can be understood as the process of concatenating the obtained Table 4-1 according to the estimated query content type; Flattened Table 4-3 can be understood as the table obtained by concatenating Table 4-1 through Denormalization 4-2; Autofill and Sample Generation 4-4 can be understood as generating samples by automatically filling the obtained Flattened Table 4-3; Sample Pool 4-5 can be understood as obtaining a sample set including samples and hierarchical samples based on the generated samples.

[0085] In another embodiment, the step of the server processing and sampling data based on a multi-party processing mode to obtain corresponding samples may include: sampling data based on a preset query content type in the multi-party processing mode to obtain corresponding samples. It should be noted that, assuming the user does not specify the query precision, the system can automatically select an appropriate precision. This appropriate precision can be determined by inputting historical query precision or by inputting the query content type.

[0086] In another embodiment, the step of the server processing and sampling data based on the multi-party processing mode to obtain corresponding samples may include: sampling data based on the association between preset query keywords and tables in the multi-party processing mode to obtain corresponding samples.

[0087] In another embodiment, the step of the server processing and sampling data based on a multi-party processing mode to obtain corresponding samples may include: sampling the data based on preset query content types and query grouping information in the multi-party processing mode to obtain corresponding samples. By using query content types and grouping information, the selected samples will be more refined, and the results will be better.

[0088] This embodiment of the specification processes and samples the acquired data by estimating the type of query content and the accuracy of the query, thereby generating multiple samples. When multiple data query requests are received subsequently, query results can be returned for multiple data query requests, thereby reducing the time spent on data queries and improving query efficiency and user satisfaction.

[0089] Step 306: In response to receiving a data query request, select a sample according to the data query request.

[0090] In one or more embodiments of this specification, after processing and sampling the data to generate samples corresponding to the data, in response to receiving a data query request, it is necessary to select a sample corresponding to the data query request from the samples.

[0091] In one or more embodiments of this specification, a data query task can be completed by receiving at least one data query request, selecting a sample according to the data query request, and obtaining the target query result corresponding to the data query request.

[0092] In one or more embodiments of this specification, upon receiving a data query request, the sample selected according to the data query request is obtained from the sample pool, and the specific implementation method is as follows:

[0093] The samples are multiple, and after generating the samples corresponding to the data, the method further includes:

[0094] Place the sample into the sample pool;

[0095] The step of selecting samples according to the data query request includes:

[0096] Based on the data query request, a sample is selected from the sample pool.

[0097] The sample pool can be understood as a set of samples obtained by sampling data sets corresponding to the same query content type based on a preset query content type and a preset query precision.

[0098] In practice, after processing and sampling the data based on a multi-processing model to generate a sample corresponding to the data, the sample is placed in a sample pool so that when a data query request is received subsequently, the sample can be selected according to the data query request.

[0099] The embodiments in this specification, by placing samples into a sample pool, can shorten the query time and improve the query efficiency when performing data queries on data query requests.

[0100] In one or more embodiments of this specification, in response to receiving a data query request, the selection of samples based on the data query request is achieved based on the query content type and query precision determined by the data query request. The specific implementation method is as follows:

[0101] The step of responding to a received data query request and selecting a sample according to the data query request includes:

[0102] In response to receiving a data query request, determine the query content type and query precision corresponding to the data query request;

[0103] Based on the query content type and query precision corresponding to the data query request, samples are selected from the sample pool.

[0104] The query content type, query precision, and sample pool are consistent with those in the above data query method, and will not be repeated here in the embodiments of this specification.

[0105] In practice, in response to receiving a data query request, samples are selected based on the relevant information in the data query request. Specifically, in response to receiving a data query request, the query content type and query precision corresponding to the data query request are determined, and then, based on the determined query content type and query precision, the corresponding samples are selected from the sample pool.

[0106] In practical applications, upon receiving a data query request, the query content type is first determined based on the request, and the corresponding data set is determined. Then, the query precision is determined based on the query request, and the number of samples from the sample pool corresponding to the query content type is determined.

[0107] For example, taking shopping mall data as an example, suppose the received data query request is "calculate the total price of the educational products purchased by customers" and the query precision is "150". Then, based on the data query request, we can first determine that the query content type is shopping mall data type. Then, we select a sample of size 150, stratified by customer, from the sample pool corresponding to Table 4 to answer the query.

[0108] In this embodiment of the specification, upon receiving a data query request, the query content type and query precision are determined based on the data query request, and samples are selected from the sample pool according to the determined query content type and query precision, which can reduce sample query time and improve query efficiency.

[0109] In one or more embodiments of this specification, after selecting samples from the sample pool according to the received data query request, data in the samples that is irrelevant to the data query request will be deleted based on the query conditions carried in the data query request. The specific implementation method is as follows:

[0110] The step of responding to receiving a data query request and selecting a sample according to the data query request further includes:

[0111] Based on the query conditions carried in the data query request, delete data in the selected sample that is irrelevant to the data query request.

[0112] The query conditions carried in a data query request can be understood as being used to compare the data in the sample related to the data query request to determine whether the data in the sample related to the data query request includes data that matches the data query request. For example, when the data query request is "calculate the average salary of employees in city A", the query conditions carried in the data query request are: city A, salary. Therefore, when selecting a sample according to the data query request, data in the selected sample that is not related to "city A" and "salary" can be deleted.

[0113] In practice, based on the query conditions carried in the data query request—that is, the query conditions related to the data query request—irrelevant data in the obtained samples can be deleted, retaining only the data relevant to the data query request. In practical applications, the data based on samples selected from the sample pool includes data relevant to the data query request and data irrelevant to the data query request. Therefore, when performing calculations on the data query request based on the samples, it is necessary to delete data irrelevant to the data query request; that is, to perform denormalization processing on the normalized stored data. It should be noted that normalization is one of the principles of relational database design. It guides the database system to store information in scattered tables according to the entities corresponding to the information, and then join them through queries when needed. Denormalization is the process of re-associating these tables into a large table through join operations.

[0114] Continuing with the previous example, based on the received data query request being "calculate the total price of educational products purchased by customer (Xiaomei)," it can be known that the data query content type corresponding to the data query request is shopping mall data, and the data query content type is educational products in the shopping mall data. Therefore, it can be known that the data structure corresponding to this data query content type is "customer name," "product type," "purchase quantity," and "product price." Based on this, the flat table (Table 4) is processed, that is, according to the data structure corresponding to the data query content type, the data content related to the data query request is determined, and the data content unrelated to the data query request is deleted. As shown in Table 4, the data contained in Table 4 includes: "Order ID", "Customer ID", "Product ID", "Purchase Quantity", "Purchase Time", "Customer Name", "Customer Points", "Customer Attributes", "Product Type", "Product Name", and "Product Price". Among them, the data content related to the data query request is: "Customer Name", "Product Type", "Purchase Quantity", and "Product Price". It can be seen that the data content in the flat table (Table 4) that is not related to the data query request is: "Order ID", "Customer ID", "Product ID", "Purchase Time", "Customer Points", "Customer Attributes", and "Product Name". Therefore, after deleting the data that is not related to the data query request from the flat table (Table 4), we can obtain the flat table in Table 5, that is, the flat table (after deleting irrelevant data).

[0115] Table 5

[0116]

[0117]

[0118] Based on the above example, in practical applications, in response to receiving a data query request, after selecting samples according to the data query request, it is necessary to perform a denormalization operation on the normalized stored data set to obtain a list corresponding to the data query request and thus obtain the query results.

[0119] This embodiment of the specification reduces the computational load during the data query process, improves the accuracy of the data query, and enhances the efficiency of the data query by deleting data from the selected sample that is irrelevant to the data query request based on the query conditions carried in the data query request.

[0120] Step 308: Perform query calculations using the selected samples to obtain the query results.

[0121] In one or more embodiments of this specification, after selecting a sample in response to receiving a data query request, it is further necessary to perform query calculations using the selected sample to obtain the query results.

[0122] In one or more embodiments of this specification, query calculations are performed using selected samples to obtain query results. This is based on the logic circuit used for querying, and the specific implementation is as follows:

[0123] The process of using selected samples to perform query calculations and obtain query results includes:

[0124] Based on the analysis of the data query requests, the logic circuit used for querying is determined;

[0125] The selected sample is queried and calculated using the logic circuit used for querying, and the query result is obtained.

[0126] The logic circuit used for querying can be understood as a circuit used to perform logical calculations on the data related to the data query request in the selected sample. For example, the logic circuit used for querying here can be a summation logic circuit, an average value logic circuit, or a median logic circuit. The specific logic circuit should be determined according to the logical calculations performed on the data related to the data query request. This embodiment does not limit it here.

[0127] In practice, the process begins by analyzing the data query request to determine its computational logic. Based on this logic, a specific logic circuit is then used to perform the query calculation on the selected sample, yielding the query result. It's important to note that once the logic circuit is determined based on the computational logic, its execution flow remains fixed and is independent of the data input.

[0128] In one or more embodiments of this specification, a query calculation is performed on the selected sample using a logic circuit for querying, including but not limited to summing or averaging the sample data, to obtain the query result. The specific implementation method is as follows:

[0129] The process of performing query calculations on the selected samples through the logic circuit used for querying to obtain query results includes:

[0130] When the query calculation type of the data query request is summation, the logic circuit used for querying is a summation logic circuit. The selected sample is summed based on the summation logic circuit to obtain the query result.

[0131] When the query calculation type of the data query request is to calculate the average value, the logic circuit used for querying is a mean logic circuit. The mean value is calculated on the selected sample based on the mean logic circuit to obtain the query result.

[0132] The query calculation type can be understood as the type of data calculation logic used to determine the data query request. For example, when the data query request is "calculate the average salary of all employees", the query calculation type is "calculate the average"; when the data query request is "calculate the total salary of employees in city A", the query calculation type is "sum".

[0133] In the embodiments of this specification, the calculation of the query result is a complex process. The query result is calculated using circuitry. The selection of the logic circuit is determined based on the query calculation type of the data query request. This specification provides two query calculation types: summation and averaging. When the query calculation type of the data query request is summation, the logic circuit used for the query is a summation logic circuit. The selected samples are summed based on the summation logic circuit to obtain the query result. It should be noted that the query result here is the summation result of the selected sample data. If summing all data is required, the obtained query result needs to be multiplied by the number of samples to obtain an approximate summation query result for all data. When the query calculation type of the data query request is averaging, the logic circuit used for the query is an averaging logic circuit. The selected samples are averaged based on the averaging logic circuit to obtain the query result. It should be noted that the query calculation type based on the data query request here can not only be to sum or average the selected samples, but also other calculation methods that perform logical calculations on the selected samples, such as finding the maximum value, minimum value, or median. The specific calculation can be determined according to actual needs, and the embodiments in this specification do not limit it here.

[0134] Specifically, the calculation of the selected sample based on the logic circuit used for querying is determined by the protocol. For example, according to a possible multi-party processing protocol, the steps of the server calculating the selected sample based on the logic circuit used for querying may include: after one server receives the selected sample, it first encrypts the sample data, generating two ciphertexts for each gate of the logic circuit; another server uses an unintentional transmission protocol to select ciphertexts for each gate; then, both servers execute their respective logic circuits, thereby obtaining a portion of the query result. Each server then returns a portion of its query result to the client, which locally sums the received data to obtain the final query result. In this embodiment, the servers can exchange data. After the data exchange is completed, the local logic circuit is executed to perform the data query. After multiple rounds of data exchange, each server calculates its own query result and returns it to the client.

[0135] Continuing with the previous example, based on the received data query request being "calculate the total price of the educational toys Xiaomei purchased," we can determine that the data query content type is shopping mall data, and the query calculation type is summing the prices of the educational toys Xiaomei purchased. Since the query calculation type is summation, we can determine that the logic circuit used for the query is a summation logic circuit. This circuit sums the selected shopping mall sales samples; that is, one of the samples selected from the data in Table 5 is input into the logic circuit to obtain the summation query result of the prices of the educational toys Xiaomei purchased in that sample. Finally, the query result of the total price of the educational toys Xiaomei purchased in that sample is multiplied by the number of samples to obtain the query result of the total price of the educational toys Xiaomei purchased in all samples.

[0136] In another embodiment, in response to the received data query request "calculate the aggregated salary information of all employees," where the aggregated salary information includes calculating the average salary of all employees and calculating the maximum salary of all employees, it can be determined that the data query content type of this data query request is workplace salary data, and the query calculation type is summing the salaries of all employees and calculating the maximum salary of all employees. Therefore, it can be determined that the logic circuit used for the query is a summation logic circuit and a maximum value logic circuit. Based on the summation logic circuit, the selected workplace salary sample is summed to obtain the query result of the sum of salaries of all employees; based on the maximum value logic circuit, the selected workplace salary sample is maximized to obtain the query result of the maximum salary of all employees. Finally, the query result is determined based on the query result of the sum of salaries of all employees and the query result of the maximum salary.

[0137] This specification describes an embodiment that constructs a logic circuit under MPC (Multi-Process Logic). This allows for the approximate calculation of query results for selected samples. First, the query content type and query calculation type of the data query request are determined, and then the logic circuit used for the query is identified. Based on this logic circuit, the selected samples are used for query calculation. This reduces the amount of data computation during data processing, reduces data redundancy, thereby improving data query efficiency and enhancing user query satisfaction.

[0138] In one or more embodiments of this specification, after selecting samples from the sample pool based on the received data query request, performing query calculations using the selected samples, and obtaining the query results, the noise values ​​of the samples are added to the query results. The specific implementation method is as follows:

[0139] Before returning the query results to the client, the process also includes:

[0140] To obtain the noise value for the query results;

[0141] Add the noise value to the query result.

[0142] The noise value can be understood as a random number generated by a random distribution determined by the preset requirements of the data source and the query structure. The query structure refers to the construction method of the specified data (such as specified data rows and / or specified data columns) involved in the query request.

[0143] Differential privacy is an information protection method, unlike MPC. It applies to the computation results and aims to reduce speculation about the input data based on the computation results. The protection method is generally to generate random numbers based on a specific distribution, which is called noise.

[0144] In practice, the query results are used to infer data from the selected input sample. Specifically, a Gaussian distribution is generated based on the data's uniform distribution. This is achieved by performing calculations on the uniformly generated random numbers to obtain a final Gaussian random number (i.e., a noise value). Finally, this Gaussian random number is added to the query results. It should be noted that this addition of a noise value to the query results is only done when the received data query request includes differential privacy requirements in its query conditions.

[0145] In practical applications, the role submitting the query in our system may differ from that of the data owner. Therefore, the data owner may be concerned about privacy breaches in the query results and thus require differential privacy protection for the computational results. For simple data processing (such as calculating average wages or statistically analyzing customer attribute ratios), adding Gaussian noise to the data analysis results can make the data analysis mechanism meet the constraints of differential privacy. However, constructing differential privacy protection for complex deep learning systems that require multiple rounds of training is much more difficult.

[0146] The embodiments in this specification firstly achieve privacy protection of the query results by adding noise values ​​to the query results, thereby avoiding privacy leaks and ensuring data security to the greatest extent.

[0147] Step 310: Return the query results to the client.

[0148] In one or more embodiments of this specification, after performing query calculations using selected samples and obtaining query results, it is further necessary to return the query results to the client.

[0149] It should be noted that the query results returned to the client can be either the result obtained by processing the data query request, or the result obtained by processing the data query request and then adding noise to determine the result.

[0150] When the client receives query results from at least two servers, it integrates these results to generate a multi-source query result. This integration process can be understood as merging or filtering, depending on the query calculation type of the data query request. For example, if the query calculation type is summation, the integration process involves summation; if the query calculation type is finding the maximum value, the integration process involves finding the maximum value in the query results; and if the query calculation type is finding the union of sets that meet certain conditions, the integration process involves merging the query results.

[0151] In one or more embodiments of this specification, the multi-party processing mode is a multi-party secure computation mode; the steps from the step of selecting a sample according to the data query request in response to receiving the data query request to the steps before returning the query result to the client are executed based on the multi-party secure computation mode.

[0152] In another embodiment of this specification, if a data query request is received while data is being acquired from a data source, on the one hand, the offline phase can be allowed to process and sample the acquired data to generate samples corresponding to the data before returning the query results to the client based on the data query request; on the other hand, if the received data query request is an urgent task, the current offline phase of processing and sampling the acquired data and generating samples corresponding to the data can be paused first. The acquired data can be processed using a precise calculation method to obtain the query results, which are then returned to the client. Once the task of returning the query results to the client is completed and the server is in an idle state, the acquired data can be processed and sampled to generate samples corresponding to the data.

[0153] See Figure 5 , Figure 5 This is a flowchart illustrating an online stage data processing method provided in one embodiment of this specification. For example... Figure 5 As shown, the specific steps include:

[0154] Step 502: Request data to validate and authorize the query.

[0155] The request to verify and authorize the query can be understood as verifying and authorizing the data query request after receiving it.

[0156] Step 504: Take a suitable sample from the sample pool.

[0157] Taking a suitable sample from the sample pool can be understood as determining the query content and query precision corresponding to the data query request based on the data query request, and then selecting a sample from the sample pool.

[0158] Step 506: Remove useless attribute columns using the projection operator.

[0159] In this context, removing useless attribute columns through the projection operator can be understood as deleting data from the selected sample that is irrelevant to the data query request based on the query conditions carried by the data query request.

[0160] Step 508: Construct the query circuit.

[0161] The construction of the query circuit can be understood as determining the logic circuit used for querying based on the analysis of the data query request; and then using the logic circuit used for querying to perform query calculations on the selected samples to obtain the query results.

[0162] Step 510: Inject differential privacy noise (optional).

[0163] Injecting differential privacy noise can be understood as obtaining noise values ​​from the query results and then adding those noise values ​​to the query results.

[0164] Step 512: Execute the query circuit and obtain the secret sharing of the calculation results.

[0165] The secret sharing process, which executes the query circuit and obtains the calculation result, can be understood as executing the logic circuit used for querying, obtaining the query result, and returning the query result to the client.

[0166] It should be noted that the implementation methods of steps 502-512 are the same as those of steps 302-310 above, and will not be described again in the embodiments of this specification.

[0167] The solution implemented in this specification involves processing and sampling the acquired data using a multi-processing mode to generate multiple samples corresponding to the data. When a data query request is received, the system can use the multiple samples generated from the data query request to perform query calculations based on the selected samples, thereby obtaining the query results. This improves the efficiency of data queries and enhances user query satisfaction.

[0168] See Figure 6 , Figure 6 This is a schematic diagram of a data query interface provided in one embodiment of this specification. The data query interface is divided into a data query request input interface and a data query result display interface. The data query request input interface includes a data query request input box, an "OK" control, and a "Cancel" control. The data query result display interface includes a data query result display box.

[0169] The user enters at least one data query request in the data query request input box displayed on the client side, and clicks the "OK" control. The server receives the data query request sent by the client, analyzes the query content type and query precision of the at least one data query request, selects samples corresponding to the query content type from the sample pool, determines the logic circuit used for querying, performs query calculations on the selected samples through the query circuit, obtains the query results, and sends the target query results to the client. The client displays the target query results in the data query results display box.

[0170] In practical applications, users can interact with controls in various ways, including clicking, double-clicking, touching, hovering, swiping, long-pressing, voice control, or shaking. The specific method chosen depends on the actual situation, and this specification does not impose any limitations on this.

[0171] Corresponding to the above method embodiments, this specification also provides embodiments of a data query device. Figure 7 This is a schematic diagram of the structure of a data query device provided in one embodiment of this specification. Figure 7 As shown, the device includes:

[0172] Data acquisition module 702 is configured to acquire data from a data source;

[0173] The sample generation module 704 is configured to process and sample the data based on a multi-party processing mode to generate samples corresponding to the data. The multi-party processing mode is a processing mode in which multiple parties participate in the same specified calculation.

[0174] The sample selection module 706 is configured to select samples according to the data query request in response to receiving the data query request;

[0175] The query execution module 708 is configured to perform query calculations using the selected sample to obtain query results.

[0176] The result return module 710 is configured to return the query results to the client.

[0177] Optionally, the multi-party processing mode is a multi-party secure computation mode; from the step of selecting samples according to the data query request in response to receiving the data query request, to the step of returning the query result to the client, the multi-party secure computation mode is used for execution.

[0178] Optionally, the sample generation module 704 is further configured to merge data with the same query content type based on the preset query content type in the multi-party processing mode to obtain a data set corresponding to the query content type; and to sample the data set corresponding to the query content type based on the preset query precision in the multi-party processing mode to generate a sample that corresponds to the query content type and meets the query precision.

[0179] Optionally, the sample selection module 706 is further configured to, in response to receiving a data query request, determine the query content type and query precision corresponding to the data query request; and select samples from the sample pool based on the query content type and query precision corresponding to the data query request.

[0180] Optionally, the sample selection module 706 is further configured to have multiple samples, and after generating the sample corresponding to the data, it further includes: placing the sample into a sample pool; the step of selecting a sample according to the data query request includes: selecting a sample from the sample pool according to the data query request.

[0181] Optionally, the sample selection module 706 is further configured to delete data in the selected samples that is irrelevant to the data query request based on the query conditions carried in the data query request.

[0182] Optionally, the query execution 708 module is further configured to determine the logic circuit for querying based on the analysis of the data query request; and to perform query calculations on the selected sample through the logic circuit for querying to obtain the query result.

[0183] Optionally, the query execution 708 module is further configured such that when the query calculation type of the data query request is summation, the logic circuit used for querying is a summation logic circuit, and the selected samples are summed based on the summation logic circuit to obtain the query result; when the query calculation type of the data query request is average calculation, the logic circuit used for querying is a mean logic circuit, and the selected samples are mean calculated based on the mean logic circuit to obtain the query result.

[0184] Optionally, before the query execution module 708, it is further configured to obtain a noise value as a query result; and add the noise value to the query result.

[0185] The solution in the embodiments of this specification processes and samples the acquired data through a multi-processing mode, generating multiple samples corresponding to the data. When a data query request is received, the query result can be obtained by using the selected samples generated based on the multiple samples generated by the data query request, without having to perform the query calculation based on all the data, thereby improving the efficiency of data query.

[0186] The above is an illustrative scheme of a data query device according to this embodiment. It should be noted that the technical solution of this data query device and the technical solution of the data query method described above belong to the same concept. For details not described in detail in the technical solution of the data query device, please refer to the description of the technical solution of the data query method described above.

[0187] Figure 8 A structural block diagram of a computing device 800 according to one embodiment of this specification is shown. The components of the computing device 800 include, but are not limited to, a memory 810 and a processor 820. The processor 820 is connected to the memory 810 via a bus 830, and a database 850 is used to store data.

[0188] The computing device 800 also includes an access device 840, which enables the computing device 800 to communicate via one or more networks 860. Examples of these networks include Public Switched Telephone Network (PSTN), Local Area Network (LAN), Wide Area Network (WAN), Personal Area Network (PAN), or combinations of communication networks such as the Internet. The access device 840 may include one or more of any type of wired or wireless network interface (e.g., a network interface card (NIC)), such as an IEEE 802.11 Wireless Local Area Network (WLAN) wireless interface, a Wi-MAX (Worldwide Interoperability for Microwave Access) interface, an Ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a Bluetooth interface, or a Near Field Communication (NFC) interface.

[0189] In one embodiment of this specification, the above-described components of the computing device 800 and Figure 8Other components, not shown, can also be connected to each other, for example, via a bus. It should be understood that... Figure 8 The block diagram of the computing device shown is for illustrative purposes only and is not intended to limit the scope of this specification. Those skilled in the art can add or replace other components as needed.

[0190] The computing device 800 can be any type of stationary or mobile computing device, including mobile computers or mobile computing devices (e.g., tablet computers, personal digital assistants, laptop computers, notebook computers, netbooks, etc.), mobile phones (e.g., smartphones), wearable computing devices (e.g., smartwatches, smart glasses, etc.) or other types of mobile devices, or stationary computing devices such as desktop computers or personal computers (PCs). The computing device 800 can also be a mobile or stationary server.

[0191] The processor 820 is used to execute the following computer-executable instructions, which, when executed by the processor, implement the steps of the above-described data query method.

[0192] The above is an illustrative scheme of a computing device according to this embodiment. It should be noted that the technical solution of this computing device and the technical solution of the data query method described above belong to the same concept. For details not described in detail in the technical solution of the computing device, please refer to the description of the technical solution of the data query method described above.

[0193] An embodiment of this specification also provides a computer-readable storage medium storing computer-executable instructions that, when executed by a processor, implement the steps of the above-described data query method.

[0194] The above is an illustrative scheme of a computer-readable storage medium according to this embodiment. It should be noted that the technical solution of this storage medium and the technical solution of the data query method described above belong to the same concept. For details not described in detail in the technical solution of the storage medium, please refer to the description of the technical solution of the data query method described above.

[0195] An embodiment of this specification also provides a computer program, wherein when the computer program is executed in a computer, it causes the computer to perform the steps of the above-described data query method.

[0196] The above is an illustrative example of a computer program according to this embodiment. It should be noted that the technical solution of this computer program and the technical solution of the data query method described above belong to the same concept. Details not described in detail in the technical solution of the computer program can be found in the description of the technical solution of the data query method described above.

[0197] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.

[0198] The computer instructions include computer program code, which may be in the form of source code, object code, executable file, or certain intermediate forms. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording media, USB flash drive, portable hard drive, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in the computer-readable medium may be appropriately added or removed according to the requirements of patent practice. For example, in some regions, according to patent practice, computer-readable media may not include electrical carrier signals and telecommunication signals.

[0199] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments in this specification are not limited to the described order of actions, because according to the embodiments in this specification, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in this specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to the embodiments in this specification.

[0200] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0201] The preferred embodiments disclosed above are merely illustrative of this specification. The optional embodiments do not exhaustively describe all details, nor do they limit the invention to the specific implementations described. Clearly, many modifications and variations can be made based on the embodiments described herein. These embodiments are selected and specifically described in this specification to better explain the principles and practical applications of the embodiments, thereby enabling those skilled in the art to better understand and utilize this specification. This specification is limited only by the claims and their full scope and equivalents.

Claims

1. A data query method, applied to at least one of at least two servers, wherein the at least two servers are used to retrieve data from a data source, wherein, The acquired data is secretly shared by the data source with the at least two servers, and the at least two servers do not collude with each other. The method includes: Data is retrieved from the data source during the offline phase; The data is processed and sampled based on the preset query content type and preset query precision in the multi-party processing mode, generating multiple independent samples corresponding to the data, and the samples are placed into a sample pool. The multi-party processing mode is a multi-party secure computation mode, which is a processing mode in which multiple parties participate in the same specified computation. In response to receiving a data query request during the online phase, samples are selected from the sample pool according to the data query request; The selected sample is used to perform query calculations to obtain the query results; The query results are returned to the client.

2. The method according to claim 1, from the step of receiving a data query request in the online phase and selecting a sample from the sample pool according to the data query request, to the step of returning the query result to the client, is executed based on the multi-party secure computation mode.

3. The method according to claim 1 or 2, wherein processing and sampling the data based on a preset query content type and preset query precision in the multi-party processing mode to generate multiple independent samples corresponding to the data includes: Based on the preset query content type in the multi-party processing mode, data with the same query content type are merged to obtain the data set corresponding to the query content type; Based on the preset query precision in the multi-party processing mode, the data set corresponding to the query content type is sampled to generate a sample that corresponds to the query content type and meets the query precision.

4. The method according to claim 1 or 2, wherein the step of responding to receiving a data query request during the online phase and selecting samples from the sample pool according to the data query request includes: In response to receiving a data query request, determine the query content type and query precision corresponding to the data query request; Based on the query content type and query precision corresponding to the data query request, a sample is selected.

5. The method according to claim 1 or 2, further comprising, after receiving a data query request in the online phase and selecting a sample from the sample pool according to the data query request: Based on the query conditions carried in the data query request, delete data from the selected sample that is irrelevant to the data query request.

6. The method according to claim 1 or 2, wherein the step of performing query calculations using selected samples to obtain query results includes: Based on the analysis of the data query requests, the logic circuit used for querying is determined; The selected sample is queried and calculated using the logic circuit used for querying, and the query result is obtained.

7. The method according to claim 6, wherein the step of performing query calculations on the selected sample through the query logic circuit to obtain query results includes: When the query calculation type of the data query request is summation, the logic circuit used for querying is a summation logic circuit. The selected sample is summed based on the summation logic circuit to obtain the query result. When the query calculation type of the data query request is to calculate the average value, the logic circuit used for querying is a mean logic circuit. The mean value is calculated on the selected sample based on the mean logic circuit to obtain the query result.

8. The method according to claim 1 or 2, further comprising, before returning the query result to the client: To obtain the noise value for the query results; Add the noise value to the query result.

9. A data query system, comprising: A data source, consisting of at least one client and at least two servers; The data source is used to provide data to the at least two servers; The client is configured to send data query requests to the at least two servers, receive query results returned by the at least two servers, and generate multi-party query results using the query results returned by the at least two servers. The at least two servers are used to obtain data from the data source, wherein the obtained data is secretly shared by the data source with the at least two servers, and the at least two servers do not collude with each other, and process the data query request according to the data query method as described in any one of claims 1 to 8.

10. A data query device, comprising: The data acquisition module is configured to acquire data from the data source during the offline phase; The sample generation module is configured to process and sample the data based on the preset query content type and preset query precision in the multi-party processing mode, generate multiple independent samples corresponding to the data, and put the samples into the sample pool. The multi-party processing mode is a multi-party secure computation mode, which is a processing mode in which multiple parties participate in the same specified computation. The sample selection module is configured to select samples from the sample pool in response to receiving a data query request during the online phase, based on the data query request. The query execution module is configured to perform query calculations using the selected samples and obtain the query results; The result return module is configured to return the query results to the client.

11. A computing device, comprising: Memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions, which, when executed by the processor, implement the steps of the data query method according to any one of claims 1 to 8.

12. A computer-readable storage medium storing computer-executable instructions that, when executed by a processor, implement the steps of the data query method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Multi-dimensional dynamic sampling method for approximate query in cloud computing environment

    CN108256028A