Data query method, system and device

The multi-party data query method addresses inefficiencies in large data scenarios by generating samples for collaborative processing, enhancing query efficiency and user satisfaction through reduced calculation and communication times.

CN119149583AActive Publication Date: 2024-12-17ALIBABA CLOUD COMPUTING CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202310709314.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-06-14
Publication Date
2024-12-17
Estimated Expiration
2043-06-14

AI Technical Summary

Technical Problem

Existing data query methods are inefficient when dealing with large amounts of data or multiple queries, leading to increased calculation and communication times, reducing user satisfaction.

Method used

A data query method utilizing a multi-party processing mode where multiple parties collaborate to generate samples from acquired data, allowing for efficient query calculations based on selected samples rather than all data, employing techniques like multi-party secure computing and approximate query systems.

Benefits of technology

Improves data query efficiency by reducing redundancy and communication time while maintaining data security, enabling faster query results and enhanced user satisfaction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119149583A_ABST
    Figure CN119149583A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a data query method, system and device. The data query method comprises the steps of obtaining data from a data source; processing and sampling the data based on a multi-party processing mode, and generating a sample 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 a received data query request, selecting a sample according to the data query request; performing query calculation by utilizing the selected sample to obtain a query result; and returning the query result to the client. According to the method, the acquired data is processed and sampled in a multi-party processing mode, and the plurality of samples corresponding to the data are generated, so that when the data query request is received, the sample can be selected from the plurality of generated samples based on the data query request, and the selected sample is utilized to perform query calculation to obtain the query result; and query calculation based on all data is not needed, so that the data query efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of this specification relate to the field of computer technology, and more particularly 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 Art

[0002] With the continuous development of computer technology, the amount of data generated by enterprises or individual users has exploded. How to improve the efficiency of data query in massive data has gradually become a research focus. At present, the query of data is based on the server processing all the acquired data. When a data query request is received, in order to obtain the data corresponding to the data query request, the query processing is often performed on all the acquired data according to the data query request, so as to obtain the query result and return it to the client.

[0003] However, when the amount of data obtained is large, or when multiple data query requests are received, the above solution cannot guarantee the efficiency of data query. Therefore, an efficient data query method is urgently needed. Summary of the invention

[0004] In view of this, an embodiment of this specification provides 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 solve the technical defects existing in the prior art.

[0005] According to a first aspect of an embodiment of the present specification, a data query method is provided, comprising: 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 a client.

[0006] According to a second aspect of an embodiment of the present specification, a data query system is provided, comprising: a data source, 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 used 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 process data query requests according to the data query method provided in any embodiment of the present specification.

[0007] According to a third aspect of the embodiments of this specification, a data query device is provided, including: 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 respond to receiving a data query request and select a sample according to the data query request; a query execution module, configured to perform query calculation using the selected sample to obtain a query result; and a result return module, configured to return the query result to the client.

[0008] According to the 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, which, when executed by the processor, implement the steps of the above-mentioned data query method.

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

[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, the computer is caused to execute the steps of the above-mentioned data query method.

[0011] A data query method provided by an embodiment of the present specification obtains data from a data source; processes and samples 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, selects a sample according to the data query request; performs query calculation using the selected sample to obtain a query result; and returns the query result to the client. The acquired data is processed and sampled through a multi-party processing mode to generate multiple samples corresponding to the data, so that 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, thereby improving the efficiency of data query and the user's query satisfaction on the basis of reducing data redundancy and shortening communication time. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] Figure 1 It is a scene diagram of a data query method provided by an embodiment of this specification;

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

[0014] Figure 3 is a flow chart of a data query method provided by an embodiment of this specification;

[0015] Figure 4 is a flow chart of an offline data processing method provided by an embodiment of this specification;

[0016] Figure 5 is a flow chart of an online data processing method provided by an embodiment of this specification;

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

[0018] Figure 7 It is a structural schematic diagram of a data query device provided by an embodiment of this specification;

[0019] Figure 8 It is a structural block diagram of a computing device provided by an embodiment of this specification. DETAILED DESCRIPTION

[0020] Many specific details are described in the following description to facilitate 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 generalizations without violating the connotation of this specification, so this specification is not limited to the specific implementation disclosed below.

[0021] The terms used in one or more embodiments of this specification are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of this specification. The singular forms of "a", "said" and "the" used in one or more embodiments of this specification and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" 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, this information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0023] In addition, 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, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0024] First, the terms involved in one or more embodiments of this specification are explained.

[0025] MPC (Secure Multi-party Computation): refers to a model in which multiple parties jointly calculate a common function, requiring each party to obtain the specified calculation result without obtaining any other relevant information.

[0026] MASQUE (Multi-party Approximate Secure QUEry processing): An approximate query system under multi-party secure computing provided in the embodiments of this specification allows users to complete approximate queries by making a trade-off between query accuracy and query response time while ensuring data security.

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

[0028] Offline-online mode: A working mode used to perform offline tasks when idle and online tasks when queries arrive.

[0029] Circuit: A directed graph in which nodes, called gates, correspond 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 has exploded. In order to improve the efficiency of data query in massive data, the current data query method is based on the 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 result, and then return the query result to the client.

[0031] However, in the case where the amount of data obtained from the data source is large, when a data query request is received, since a large amount of data needs to be processed, there are problems such as large data calculation amount, data redundancy, and prolonged data communication time, which will reduce the efficiency of data query and the user's query experience; or in the case of receiving multiple data query requests, since multiple data query requests need to be queuing, and each data query request is based on all the data obtained from the data source, that is, after obtaining the first query result corresponding to the first data query request based on the processing of all the data, the second query result corresponding to the second data query request can be obtained based on the processing of all the data, and so on. When there are multiple data query requests, each time a data query request is received, it is necessary to process all the data before the query result can be obtained. Therefore, it will cause problems such as large data calculation amount and long communication time, thereby reducing the data query efficiency and the user's data query satisfaction.

[0032] In order to solve the above problems, an embodiment of this specification provides a data query method. Specifically, data is obtained from a data source; the data is processed and sampled based on a multi-party processing mode to generate samples corresponding to the data, and 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, a sample is selected according to the data query request; query calculation is performed using the selected sample to obtain a query result; and the query result is returned to the client. The obtained data is processed and sampled through a multi-party processing mode to generate multiple samples corresponding to the data, so that 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 the data, thereby improving the efficiency of data query.

[0033] In this specification, a data query method is provided. This specification also relates to a data query system, a data query device, a computing device, and a computer-readable storage medium, which are described in detail one by one in the following embodiments.

[0034] See also Figure 1 , Figure 1It is a scene diagram of a data query method provided by an embodiment of this specification. In this scenario, according to the data query method provided by the embodiment of this specification, a common function can be jointly calculated by multiple participants provided by a multi-party secure computing (i.e., MPC) service in an offline-online mode to perform data query, that is, one calculation to generate multiple samples (i.e., Batch sampling). Among them, multi-party secure computing refers to a model in which multiple participants jointly calculate a common function, requiring each participant to obtain a specified calculation result without obtaining any other relevant information. As a mainstream data security computing solution, due to its large computing and communication overhead, the embodiment of this specification proposes an approximate query system (i.e., MASQUE), that is, by performing multi-party secure computing in an offline-online mode to reduce the amount of data calculation and communication, wherein the system samples the data source in the offline stage to generate multiple samples, parses the data query request in the online stage, and uses sampling to give approximate query results. The system uses an efficient non-replacement sampling method to reduce calculation errors. In addition, multiple samples generated by one calculation in the offline stage can answer multiple queries, thereby improving query efficiency.

[0035] like Figure 1 As shown, the scenario of the data query method is applied to the query of shopping mall data. It should be noted that the scenario in which the data query method provided in this embodiment can be applied is not limited to the query of shopping mall data, but can also be the query of enterprise data, the query of institution data, the query of Internet traffic data, etc., which can be determined according to actual needs. This embodiment does not limit it here. The data query scenario provided in this embodiment takes shopping mall data as an example, that is, querying the data in the shopping mall data warehouse as an example.

[0036] like Figure 1 As shown, the scenario diagram of the 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 calculate the data obtained from the data warehouse 102, and return the query result to the user 106. The server 104 provided in this embodiment is at least two servers, and at least two servers do not collude with each other, and the data obtained from the data warehouse 102 are independent of each other; the user 106 is used to send a data query request to the server 104, and receive the query result returned by the server 104.

[0037] The interaction among the data warehouse 102, the server 104, and the user 106 is realized based on an approximate query system, that is, by performing multi-party secure computing in an offline-online mode to reduce the amount of data computing and communication. The system samples the data obtained from the data warehouse in the offline stage to generate multiple samples, parses the data query request in the online stage, and uses sampling to give approximate query results.

[0038] Specifically, the server 104 stores and calculates the data obtained from the data warehouse 102 based on the offline-online mode, and takes the storage and calculation of the obtained data by one of the servers 104 as an example. Based on the offline-online mode, the interaction between the data warehouse 102 and the server 104 is implemented in the offline mode. After obtaining the data from the data warehouse 102, the obtained data is processed and sampled based on the multi-party processing mode to generate samples corresponding to the data; the interaction between the user 106 and the server 104 is implemented in the online mode. In response to receiving the data query request sent by the user 106, the server 104 changes from the offline stage to the online stage, and selects samples according to the data query request, and then uses the selected samples to perform query calculations to obtain query results, and finally returns the query results to the user 106. It should be noted that the query results returned to the user 106 are sent to the user 106 by each server that does not collude with each other. The user 106 obtains the final query result by processing the query results sent by each server 104.

[0039] The embodiment of the present specification provides a scenario diagram of a data query method based on multi-party secure computing, which processes and samples the acquired data through a multi-party processing mode to generate multiple samples corresponding to the data, so that when a data query request is received, a sample can be selected from the multiple generated samples based on the data query request, and the selected sample can be used to perform query calculations to obtain query results, thereby improving the efficiency of data query and the user's query satisfaction on the basis of reducing data redundancy and shortening communication time. The approximate query system uses an efficient random sampling method without replacement to reduce calculation errors. Multiple samples generated by calculation at one time in the offline stage can answer multiple queries, thereby improving query efficiency.

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

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

[0042] The client 206 is used to send a data query request to the at least two servers, receive the query results returned by the at least two servers, and generate a multi-party query result 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 a data source 202, wherein the obtained data is secretly shared by the data source 202 to at least two servers 204, and at least two servers 204 do not collude with each other; the data is processed and sampled based on a multi-party processing mode to generate samples corresponding to the data, and 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 a client 206, a sample is selected according to the data query request; query calculation is performed using the selected sample to obtain a query result; and the query result is returned to the client 206. It should be noted that the target query result returned to the client 206 here is returned by at least two servers 204 that do not collude with each other.

[0045] The client 206 is further configured to receive query results sent by at least two servers 204 .

[0046] The data source 202 is also used to send data to at least two service ends 204 .

[0047] The data source 202 and the server 204, and the client 206 and the server 204 are connected via a network. The network provides a medium for a communication link between the data source 202 and the server 204, and between the client 206 and the server 204. The network may include various connection types, such as wired or wireless communication links or optical fiber cables, etc. The data transmitted by the data source 202 may need to be encoded, transcoded, compressed, etc. before being published to the server 204.

[0048] The client 206 can be a browser, an APP (Application), or a web application such as an H5 (HyperText Markup Language 5, Hypertext Markup Language Version 5) application, or a light application (also known as a mini-program, a lightweight application) or a cloud application, etc. The client 100 can be based on the software development kit (SDK, Software Development Kit) of the corresponding service provided by the server, such as based on the real-time communication (RTC, Real Time Communication) SDK development and acquisition. The client 100 can be deployed in an electronic device, and needs to rely on the device to run or some APPs in the device to run. For example, the electronic device can have a display screen and support information browsing, such as a personal mobile terminal such as a mobile phone, a tablet computer, a personal computer, etc. Various other types of applications can also be configured in the electronic device, such as human-computer dialogue applications, model training applications, text processing applications, web browser applications, shopping applications, search applications, instant messaging tools, mailbox clients, social platform software, etc.

[0049] The server 204 may include servers that provide various services, such as servers that provide communication services to multiple clients, servers for background training that provide support for models used on clients, and servers that process data sent by clients. It should be noted that the server 204 can be implemented as a distributed server cluster consisting of multiple servers, or as a single server. The server can also be a server of a distributed system, or a server combined with a blockchain. The server can also be a cloud server for basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content distribution networks (CDN, Content Delivery Network), 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 takes two server ends as an example. Figure 2As shown in the figure, the participants on the server side include two non-colluding servers, where the two non-colluding servers usually do not own the data and only provide storage and secure computing services. The data source shares the data secretly with the two participants. Since the two do not collude, the individual data they receive is meaningless. The two participants can use the MPC protocol to organize and sample the data. When the client submits a query, the server calculates the data and returns the secret sharing of the results to the receiver. In the whole process, only the receiver gets the calculation result, and no other information will be leaked, thereby ensuring the security of the data. In addition, by processing the data by at least two servers, the time consumption of data processing is reduced, thereby improving the efficiency of data query.

[0051] By applying the solution of the embodiments of this specification, the acquired data is processed and sampled through a multi-party processing mode to generate multiple samples corresponding to the data. When a data query request is received, query calculations can be performed using the selected samples based on the multiple samples generated by the data query request to obtain query results, without the need to perform query calculations based on all the data, thereby improving the efficiency of data query.

[0052] See also Figure 3 , Figure 3 This is a flow chart of a data query method provided by an embodiment of this specification, which specifically includes the following steps:

[0053] Step 302: Acquire data from a data source.

[0054] The data source may be understood as a data owner that is used to send data to multiple servers, for example, a server that stores data, a data warehouse, etc.

[0055] In one or more embodiments of this specification, the data obtained from the data source is realized based on the data source distributing all its data. It should be noted that there are at least two servers that obtain data from the data source, and the at least two servers are independent of each other, and each of them realizes its own calculation through a calculation protocol, and the at least two servers have equal calculation and communication volume after obtaining the data. Among them, the embodiments of this specification take two servers as participants to process and sample data as an example.

[0056] Step 304: 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.

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

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

[0059] In actual application, data is processed and sampled based on a multi-party processing mode, and multiple samples corresponding to the generated data are generated. The specific number of samples is selected according to actual conditions, and the embodiments of this specification do not impose any limitation on this.

[0060] The process of sampling data can use an efficient random sampling method without replacement. Random sampling without replacement is a sampling method that does not put the individuals drawn back into the population for the next draw when drawing individuals one by one. When using the random sampling method without replacement, the number of units in the population gradually decreases during the sampling process, and the probability of each unit in the population being drawn is different. For example, suppose there are one thousand data that need to be divided into ten samples. Therefore, each sample includes one hundred data, where the one hundred data sampled in each sample are realized by the random sampling method without replacement, that is, when sampling the first data, the first data is randomly selected from the one thousand data and added to the sample; when sampling the second data, the second data is randomly selected from the nine hundred and ninety-nine data except the first data and added to the sample; and so on, until the sampling of one hundred data is completed and the first sample is generated.

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

[0062] Exemplarily, assuming that there are n rows of data obtained from the data source, and the preset sample size is that each sample includes s rows, where the value of s is less than the value of n, then the n rows of data obtained from the data source are calculated repeatedly n / s times, that is, each calculation randomly obtains s data 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, and finally the s obtained position information are connected to obtain n / s samples, and the size of each sample is s. Taking workplace salary data as an example, assuming that there are 20,000 rows of randomly obtained workplace salary data, and it is known that the preset sample size of workplace salary data is that each sample includes 500 rows, then by performing 40 calculations on the obtained 20,000 rows of data, that is, each calculation obtains 500 data between 10,000 and 20,000, then a total of 40 workplace salary data samples can be obtained, and each workplace salary data sample includes 500 data.

[0063] The method for processing and sampling data through a multi-party processing mode provided in the embodiments of this specification can obtain multiple independent samples through one calculation, so that when a data query request from a user is subsequently received, after answering one data query request based on one sample, it is also possible to answer multiple other data query requests based on other samples, thereby improving query efficiency while enhancing user query satisfaction.

[0064] In one or more embodiments of this specification, data is processed and sampled based on the multi-party processing mode, and data is processed and sampled based on the query content type and the query accuracy preset in the multi-party processing mode, so as to obtain corresponding samples. The specific implementation method is as follows:

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

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

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

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

[0069] The query content type can be understood as the type of data content used to determine the data query request corresponding to the request, for example, employee salary, mall sales, mall traffic, etc.

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

[0071] In specific implementation, the processing of data based on the multi-party processing mode is based on the query content type preset in the multi-party processing mode, and the data with the same query content type is merged to obtain a data set corresponding to the query content type, wherein the data content type here can be workplace salary data, shopping mall sales data, or scenic spot tourist data. The determination of the specific query content type should be based on the actual situation, and the embodiments of this specification do not limit it here. The sampling of data based on the multi-party processing mode is based on the query accuracy preset in the multi-party processing mode, and the data set corresponding to the query content type is sampled, thereby generating a sample corresponding to the query content type and meeting the query accuracy, wherein the query accuracy here is based on the actual situation of the data query request received subsequently, and the embodiments of this specification do not limit it here.

[0072] In actual applications, before receiving a data query request sent by a client, the server will estimate the data query request that the client may send based on the actual meaning of the data obtained from the data source, and process the obtained data based on the estimated query content type to 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] Exemplarily, taking shopping mall data as an example, assume that the estimated query content types are: one is to query the purchase quantity information of customers who purchased a certain product, and the other is to query the total price of a certain type of product purchased by a customer. Then, based on the estimated query content type, a data set corresponding to the query content type can be obtained, and the data set includes customer information, product information, and order information, as shown in Tables 1-3, where 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 data sets of Tables 1 to 3, firstly, based on the preset query content type and the preset query content precision, the data sets are denormalized and sampled to obtain a flat table, as shown in Table 4, and then based on the preset query type, Table 4 is sampled multiple times, that is, a sample pool corresponding to the data is generated. For example, when the preset data query content type is the total price of the goods purchased by the customer, Table 4 is stratified and sampled by customer according to the preset query content type; when the preset data query content type is the total sales volume of the goods, Table 4 is stratified and sampled by goods according to the preset query content type; when the preset query content precision is 150, multiple groups of samples of size 150 are generated from the obtained n rows of data.

[0081] Table 4

[0082]

[0083]

[0084] See also Figure 4 , Figure 4 FIG. 1 is a flow chart of an offline data processing method provided by an embodiment of this specification. Figure 4 As shown, table (secret sharing) 4-1 can be understood as obtaining data from a data source, wherein the data obtained from the data source is secretly shared with the server by the data source in the form of a table; denormalization 4-2 can be understood as the process of splicing the obtained table 4-1 according to the estimated query content type; flat table 4-3 can be understood as a table obtained by splicing the obtained table 4-1 through denormalization 4-2; automatic filling, generating sample 4-4 can be understood as generating samples by automatically filling the obtained flat table 4-3; sample pool 4-5 can be understood as obtaining a sample set including samples and stratified samples based on the generated samples.

[0085] In another embodiment, the step of processing and sampling the data based on the multi-party processing mode to obtain the corresponding sample by the server may include: sampling the data based on the query content type preset in the multi-party processing mode to obtain the corresponding sample. It should be noted that, assuming that the user has not determined the query accuracy, the system can select a suitable accuracy by itself, wherein the suitable accuracy here can be determined by inputting the historical query accuracy or by inputting the query content type.

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

[0087] In another embodiment, the server processes and samples the data based on the multi-party processing mode to obtain the corresponding sample. The step of obtaining the corresponding sample may include: sampling the data based on the query content type and query grouping information preset in the multi-party processing mode to obtain the corresponding sample. By querying the content type and grouping information, the selected sample will be more refined and the obtained effect will be better.

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

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

[0090] In one or more embodiments of the present specification, after processing and sampling the data to generate samples corresponding to the data, further, 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 the present specification, at least one data query request may be received, and samples may be selected according to the data query request to complete a data query task and obtain a 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 sample is multiple, and after generating the sample corresponding to the data, the method further includes:

[0094] placing the sample into a sample pool;

[0095] The selecting a sample according to the data query request includes:

[0096] Selecting a sample from the sample pool according to the data query request.

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

[0098] In a specific implementation, after the data is processed and sampled based on a multi-party processing mode and a sample corresponding to the data is generated, the sample is placed in a sample pool so that after a data query request is subsequently received, the sample is selected according to the data query request.

[0099] The embodiments of the present specification can shorten the query time and improve the query efficiency when performing data query on a data query request by placing samples into a sample pool.

[0100] In one or more embodiments of the present specification, in response to receiving a data query request, selecting a sample according to the data query request is implemented based on the query content type and query accuracy determined by the data query request, and the specific implementation method is as follows:

[0101] In response to receiving the data query request, selecting a sample according to the data query request includes:

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

[0103] A sample is selected from the sample pool based on the query content type and query accuracy corresponding to the data query request.

[0104] Among them, the query content type, query accuracy and sample pool are consistent with the query content type, query accuracy and sample pool in the above-mentioned data query method, and are not elaborated here in the embodiment of this specification.

[0105] In a specific implementation, in response to receiving a data query request, a sample is selected based on relevant information of the data query request. Specifically, first, in response to receiving the data query request, a query content type and a query accuracy corresponding to the data query request are determined, and then a corresponding sample is selected from a sample pool based on the determined query content type and query accuracy.

[0106] In actual applications, after receiving a data query request, the query content type is first determined based on the data query request, and the data set corresponding to the query content type is determined. Then, the query accuracy is determined based on the data query request, and the number of samples of the data set corresponding to the query content type selected in the sample pool is determined.

[0107] For example, taking shopping mall data as an example, assuming that the received data query request is "calculate the total price of customers purchasing educational products" and the query accuracy is "150", then firstly, according to the data query request, it can be determined that the query content type is the shopping mall data type, and then a sample of size 150 stratified by customers is selected from the sample pool corresponding to Table 4 to answer the query.

[0108] When a data query request is received, the embodiments of the present specification determine the query content type and query accuracy according to the data query request, and select samples from the sample pool according to the determined query content type and query accuracy, which can reduce sample query time and improve query efficiency.

[0109] In one or more embodiments of the present specification, after selecting a sample from a sample pool according to a received data query request, data in the sample that is not related to the data query request is deleted based on the query condition carried by the data query request. The specific implementation method is as follows:

[0110] After the step of selecting a sample according to the data query request in response to receiving the data query request, the step further includes:

[0111] According to the query condition carried in the data query request, data irrelevant to the data query request is deleted from the selected samples.

[0112] Among them, the query conditions carried by the data query request can be understood as being used to compare with 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 by the data query request are: city A, salary. Therefore, when selecting samples according to the data query request, data in the selected samples that are not related to "city A" and "salary" can be deleted.

[0113] During specific implementation, irrelevant data in the acquired samples can be deleted according to the query conditions carried by the data query request, that is, the query conditions related to the data query request, and only the data related to the data query request is retained. In practical applications, the data based on the samples selected from the sample pool includes data related to the data query request and data irrelevant to the data query request. Therefore, when calculating the data query request based on the sample, it is necessary to delete the data irrelevant to the data query request, that is, to perform denormalization on the normalized stored data. It should be noted that normalization is one of the principles of relational database design, which guides the database system to store information in scattered tables according to the entities corresponding to the information, and connect them through queries when needed. Denormalization is the process of re-associating these tables into a large table through a join operation.

[0114] Continuing with the above example, based on the received data query request being "calculate the total price of the customer (Xiao Mei) purchasing educational products", it can be seen 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, so it can be seen that the data structure corresponding to the 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 not related to the data query request is deleted. It can be seen from Table 4 that the data content 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 which 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 in the flat table (Table 4) that is not related to the data query request, the flat table of Table 5 can be obtained, that is, the flat table (after deleting irrelevant data).

[0115] Table 5

[0116]

[0117]

[0118] Based on the above example, in actual applications, in response to receiving a data query request, after selecting a sample 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 obtain a query result.

[0119] The embodiments of the present specification can reduce the amount of calculation in the data query process, improve the accuracy of data query, and enhance the efficiency of data query by deleting data in the selected samples that are not related to the data query request according to the query conditions carried by the data query request.

[0120] Step 308: Use the selected samples to perform query calculations to obtain query results.

[0121] In one or more embodiments of the present specification, after selecting samples according to the data query request in response to receiving the data query request, it is further necessary to perform query calculation using the selected samples to obtain query results.

[0122] In one or more embodiments of the present specification, query calculation is performed using selected samples to obtain query results, which are obtained by query calculation on the selected samples based on the logic circuit used for query. The specific implementation method is as follows:

[0123] The query calculation is performed using the selected samples to obtain the query result, including:

[0124] Based on the analysis of the data query request, determining a logic circuit for querying;

[0125] The query calculation is performed on the selected samples through the query logic circuit to obtain the query result.

[0126] Among them, the logic circuit used for query 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 query here can be a summation logic circuit, an average value logic circuit, or a median logic circuit. The specific method should be determined according to the logical calculation performed on the data related to the data query request, and this embodiment is not limited here.

[0127] In specific implementation, firstly, the calculation logic of the data query request is determined based on the analysis of the data query request, and the logic circuit used for query is determined according to the calculation logic, and then the selected samples are queried and calculated by the logic circuit used for query, so as to obtain the query result. It should be noted that after the logic circuit used for query is determined according to the calculation logic, the execution process of the logic circuit is fixed and has nothing to do with the data input.

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

[0129] The query calculation is performed on the selected sample by the query logic circuit to obtain the query result, including:

[0130] 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 a 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, and the mean calculation is performed on the selected samples based on the mean logic circuit to obtain the query result.

[0132] Among them, the query calculation type can be understood as the type of data calculation logic used to determine the corresponding data query request. For example, when the data query request is "calculate the average salary of all employees", the query calculation type is "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, wherein the calculation of the query result is obtained by using a circuit for calculation, and the selection of the logic circuit is determined based on the query calculation type of the data query request. The embodiments of this specification provide two types of query calculations, namely summation and averaging. When the query calculation type of the data query request is summation, the logic circuit used for query is a summation logic circuit, and 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 data of the selected samples. If it is necessary to sum all the data, it is also necessary to multiply the query result obtained by the number of samples to obtain an approximate summation query result of all the data; when the query calculation type of the data query request is averaging, the logic circuit used for query is an averaging logic circuit, and the average value of the selected samples is calculated 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 is not only to sum or average the selected samples, but also other calculation methods for performing logical calculations on the selected samples, such as maximum value, minimum value or median, etc. The specific calculation method can be determined according to actual needs and is not limited in the embodiments of this specification.

[0134] Specifically, the calculation of the selected sample based on the logic circuit used for query is determined according to the protocol. For example, according to a possible multi-party processing protocol, the step of the server calculating the selected sample based on the logic circuit used for query may include: after a server obtains the selected sample, the server first performs an encryption operation on the sample data, and the encryption operation generates two ciphertexts for each gate of the logic circuit. The other server uses the oblivious transfer protocol to select ciphertexts for each gate. Then the two servers each use the logic circuit to execute, so that both parties obtain a part of the query result respectively, and then both parties return a part of the query result to the client respectively, and the client locally sums the received data accordingly to obtain the final query result. In this embodiment, data exchange operations can be performed between each server. After the data exchange is completed, the local logic circuit is executed to realize data query. After multiple rounds of data exchange operations, each server calculates the query result and returns it to the client.

[0135] Continuing with the above example, based on the received data query request being "calculate the total price of Xiaomei's purchases of educational products", it can be determined that the data query content type of the data query request is mall data, and the query calculation type is to sum the prices of Xiaomei's purchases of educational products. Based on the query calculation type of the data query request being summation, it can be determined that the logic circuit used for the query is a summation logic circuit, and the selected mall sales samples are summed through the summation logic circuit, 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 price of Xiaomei's purchases of educational products in the sample, and finally the query result of the total price of Xiaomei's purchases of educational products in the sample is multiplied by the number of samples to obtain the query result of the total price of Xiaomei's purchases of educational products in all samples.

[0136] In another embodiment, in response to the received data query request of "calculating the salary aggregation information of all employees", the salary aggregation information here includes calculating the average salary of all employees and calculating the maximum salary of all employees. Therefore, it can be determined that the data query content type of the data query request is workplace salary data, and the query calculation type is to sum the salaries of all employees and calculate the maximum salary of all employees. Therefore, it can be determined that the logic circuit used for the query is a summing logic circuit and a maximum value logic circuit. Based on the summing logic circuit, the selected workplace salary samples are summed to obtain the query result of the sum of all employees' salaries; based on the maximum value logic circuit, the selected workplace salary samples are 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 all employees' salaries and the query result of the maximum salary.

[0137] The embodiments of this specification construct a logic circuit under MPC to achieve approximate calculation of query results for selected samples, first determine the query content type and query calculation type of the data query request, determine the logic circuit used for query, and then perform query calculation on the selected samples based on the logic circuit used for query, which can reduce the amount of data calculation in the data processing process and reduce data redundancy, thereby improving data query efficiency and enhancing user query satisfaction.

[0138] In one or more embodiments of the present specification, after selecting a sample from a sample pool according to a received data query request, and performing query calculation using the selected sample to obtain a query result, the noise value of the sample is added to the query result based on the query result. The specific implementation method is as follows:

[0139] Before returning the query result to the client, the method further includes:

[0140] To query the results, get the noise value;

[0141] The noise value is added 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, wherein 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 a means of information protection. Different from MPC, it acts on the calculation results and aims to reduce the speculation of input data through the calculation results. The protection method is generally to generate random numbers based on a specific distribution, which is called noise.

[0144] In specific implementation, the data in the selected sample is inferred through the query result, that is, according to the data in the selected sample, a Gaussian distribution is generated according to the uniform distribution of the data, specifically, some calculations are performed on the uniform random number generated by the uniform distribution to obtain the final Gaussian random number (i.e., the noise value), and finally, the Gaussian random number is added to the query result. It should be noted that the noise value is added to the query result here when the query condition carried by the received data query request includes a differential privacy requirement.

[0145] In practical applications, in our system, the role of submitting queries may be different from the data owner, so the data owner may be concerned about the privacy leakage of the query results, and thus require differential privacy protection for the calculation results. For simple data processing processes (such as calculating the average salary, counting the proportion of customer attributes), by adding Gaussian noise to the data analysis results, the data analysis mechanism can meet the constraints of differential privacy. However, for complex deep learning systems that require multiple rounds of training, it is more difficult to build differential privacy protection.

[0146] The embodiments of this specification firstly increase the noise value on the query results, thereby realizing the privacy protection of the query results and avoiding the privacy leakage of the query results, thereby ensuring the security of the data to the greatest extent.

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

[0148] In one or more embodiments of the present specification, after query calculation is performed using the selected samples to obtain the query results, it is further necessary to return the query results to the client.

[0149] It should be noted that the query result returned to the client can be, on the one hand, a query result obtained by processing the data query request, or on the other hand, a query result determined after adding a noise value based on the query result obtained by processing the data query request.

[0150] When the client receives query results returned by at least two servers, the client generates multiple query results by integrating the received query results. The integration process can be understood as merging or filtering, etc., which is specifically determined according to the query calculation type of the data query request. For example, when the query calculation type is summation, the integration process refers to summation. For another example, when the query calculation type is maximum value, the integration process refers to maximum value of the query results. For another example, when the query calculation type is to query the union that meets the conditions, the integration process refers to merging the query results.

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

[0152] In another embodiment of the present specification, if a data query request is received while data is being acquired from a data source, on the one hand, the acquired data can be processed and sampled in the offline stage to generate samples corresponding to the data before the query result is returned 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 stage can be paused to process and sample the acquired data to generate samples corresponding to the data, the acquired data can be processed by precise calculation methods to obtain query results, and the query results can be returned to the client, and when 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 also Figure 5 , Figure 5 1 is a flow chart of an online data processing method provided by an embodiment of this specification. Figure 5 As shown, the specific steps include:

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

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

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

[0157] Among them, taking a suitable sample from the sample pool can be understood as determining the query content and query accuracy corresponding to the data query request according to the data query request, and selecting a sample from the sample pool.

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

[0159] Among them, removing useless attribute columns through the projection operator can be understood as deleting data irrelevant to the data query request in the selected samples according to the query conditions carried by the data query request.

[0160] Step 508: construct a query circuit.

[0161] Among them, constructing the query circuit can be understood as determining the logic circuit used for query based on the analysis of the data query request; performing query calculation on the selected samples through the logic circuit used for query to obtain the query result.

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

[0163] Among them, injecting differential privacy noise can be understood as querying the result, obtaining the noise value; and adding the noise value to the query result.

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

[0165] Among them, executing the query circuit and obtaining the secret sharing of the calculation result can be understood as executing the logic circuit for query, obtaining the query result, and returning the query result to the client.

[0166] It should be noted that the implementation of step 502 to step 512 is the same as the implementation of step 302 to step 310 described above, and will not be described in detail in the embodiments of this specification.

[0167] By applying the solution of the embodiments of this specification, the acquired data is processed and sampled through a multi-party processing mode to generate multiple samples corresponding to the data. When a data query request is received, query calculations can be performed based on the multiple samples generated by the data query request using the selected samples to obtain query results, thereby improving the efficiency of data query and the user's query satisfaction.

[0168] See also Figure 6 , Figure 6 This is a schematic diagram of a data query interface provided by an embodiment of the present 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 inputs at least one data query request through the data query request input box displayed by the client, clicks the "OK" control, and the server receives the data query request sent by the client, analyzes the query content type and query accuracy of at least one data query request, selects samples corresponding to the query content type from the sample pool, and determines the logic circuit for query. Through the logic circuit for query, query calculation is performed on the selected sample to obtain the query result, and the target query result is sent to the client. The client displays the target query result in the data query result display box.

[0170] In actual applications, users can operate controls by clicking, double-clicking, touching, hovering the mouse, sliding, long pressing, voice control, or shaking, etc. The selection is based on actual conditions, and the embodiments of this specification do not impose any limitations on this.

[0171] Corresponding to the above method embodiment, this specification also provides a data query device embodiment, Figure 7 Schematic diagram of a data query device provided by an embodiment of this specification. Figure 7 As shown, the device comprises:

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

[0173] A 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, wherein 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 a sample 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 calculation using the selected samples to obtain query results;

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

[0177] Optionally, the multi-party processing mode is a multi-party secure computing mode; starting from the step of selecting a sample according to the data query request in response to receiving the data query request, to the step before returning the query result to the client, the multi-party secure computing mode is executed based on the multi-party secure computing mode.

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

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

[0180] Optionally, the sample selection module 706 is further configured so that the sample is multiple, and after generating the sample corresponding to the data, it also includes: putting the sample into a sample pool; the selecting the sample according to the data query request includes: selecting the sample from the sample pool according to the data query request.

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

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

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

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

[0185] By applying the solution of the embodiments of this specification, the acquired data is processed and sampled through a multi-party processing mode to generate multiple samples corresponding to the data. When a data query request is received, query calculations can be performed using the selected samples based on the multiple samples generated by the data query request to obtain query results, without the need to perform query calculations based on all the data, thereby improving the efficiency of data query.

[0186] The above is a schematic scheme of a data query device of this embodiment. It should be noted that the technical scheme of the data query device and the technical scheme of the above data query method belong to the same concept, and the details not described in detail in the technical scheme of the data query device can be referred to the description of the technical scheme of the above data query method.

[0187] Figure 8 The block diagram of a computing device 800 according to an embodiment of the present 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 that enables the computing device 800 to communicate via one or more networks 860. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 840 may include one or more of any type of network interface (e.g., a network interface card (NIC)) that is wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a world-wide interoperability for microwave access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, and a near field communication (NFC).

[0189] In one embodiment of the present specification, the above components of the computing device 800 and Figure 8Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Figure 8 The computing device structure block diagram shown is only for the purpose of illustration, 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 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or a personal computer (PC). The computing device 800 may also be a mobile or stationary server.

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

[0192] The above is a schematic scheme of a computing device of this embodiment. It should be noted that the technical scheme of the computing device and the technical scheme of the above data query method belong to the same concept, and the details not described in detail in the technical scheme of the computing device can be referred to the description of the technical scheme of the above data query method.

[0193] An embodiment of the present specification further provides a computer-readable storage medium storing computer-executable instructions, which can implement the steps of the above-mentioned data query method when executed by a processor.

[0194] The above is a schematic scheme of a computer-readable storage medium of this embodiment. It should be noted that the technical scheme of the storage medium and the technical scheme of the above data query method belong to the same concept, and the details not described in detail in the technical scheme of the storage medium can be referred to the description of the technical scheme of the above data query method.

[0195] An embodiment of the present specification further provides a computer program, wherein when the computer program is executed in a computer, the computer is caused to execute the steps of the above-mentioned data query method.

[0196] The above is a schematic scheme of a computer program of this embodiment. It should be noted that the technical scheme of the computer program and the technical scheme of the above data query method belong to the same concept, and the details of the technical scheme of the computer program that are not described in detail can be found in the description of the technical scheme of the above data query method.

[0197] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

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

[0199] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the embodiments of this specification are not limited by the order of the actions described, because according to the embodiments of this specification, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the embodiments of this specification.

[0200] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0201] The preferred embodiments of this specification disclosed above are only used to help explain this specification. The optional embodiments do not describe all the details in detail, nor do they limit the invention to only the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of the embodiments of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the embodiments of this specification, so that technicians in the relevant technical field can well understand and use this specification. This specification is only limited by the claims and their full scope and equivalents.

Claims

1. A data query method, applied to a server, comprising: Get data from the 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 a sample according to the data query request; Use the selected samples to perform query calculations and obtain query results; The query result is returned to the client.

2. According to the method described in claim 1, the multi-party processing mode is a multi-party secure computing mode; starting from the step of selecting a sample according to the data query request in response to receiving the data query request, to the step before returning the query result to the client, it is executed based on the multi-party secure computing mode.

3. The method according to claim 1 or 2, wherein the processing and sampling of the data based on the multi-party processing mode to generate samples corresponding to the data comprises: Based on the query content type preset in the multi-party processing mode, merge the data with the same query content type to obtain a data set corresponding to the query content type; Based on the query accuracy preset in the multi-party processing mode, the data set corresponding to the query content type is sampled to generate a sample corresponding to the query content type and meeting the query accuracy.

4. The method according to claim 1 or 2, wherein in response to receiving a data query request, selecting a sample according to the data query request comprises: In response to receiving a data query request, determining a query content type and a query accuracy corresponding to the data query request; A sample is selected based on the query content type and query accuracy corresponding to the data query request.

5. The method according to claim 1 or 2, wherein in response to receiving a data query request, after selecting a sample according to the data query request, the method further comprises: According to the query condition carried in the data query request, data irrelevant to the data query request is deleted from the selected samples.

6. The method according to claim 1 or 2, wherein the step of performing query calculation using the selected samples to obtain query results comprises: Based on the analysis of the data query request, determining a logic circuit for querying; The query calculation is performed on the selected samples through the query logic circuit to obtain the query result.

7. The method according to claim 6, wherein the query calculation is performed on the selected sample by the query logic circuit to obtain the query result, comprising: 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 a 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, and the mean calculation is performed on the selected samples based on the mean logic circuit to obtain the query result.

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

9. A data query system, comprising: Data source, at least one client and at least two servers; The data source is used to provide data to the at least two service terminals; The client is used to send a data query request to the at least two servers, receive query results returned by the at least two servers, and generate a multi-party query result using the query results returned by the at least two servers; The at least two servers are used to process the data query request according to the data query method according to any one of claims 1 to 8.

10. A data query device, comprising: A data acquisition module is configured to acquire data from a data source; A sample generation module is 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, in response to receiving a data query request, select a sample according to the data query request; A query execution module is configured to perform query calculation using the selected samples to obtain query results; The result returning module is configured to return the query result 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. When the computer-executable instructions are executed by the processor, the steps of the data query method according to any one of claims 1 to 8 are implemented.

12. A computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions, 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

  • Privacy-protecting multi-party joint data statistics method and device

    CN112395633A

  • Data query method and device and multi-party security database

    CN113868295A

  • Online approximate query method based on machine learning model sample generation

    CN114722088A

  • Identification of Contact Mode for Contacting Parties to Maximize the Probability of Achieving a Desired Outcome

    US20120158412A1