Data query method and apparatus, and device and storage medium

Through the multi-party database query method based on SQL, the problem of increased computational complexity and communication complexity in the data circulation process is solved, safe and efficient multi-party data query is realized, and the demand for collaborative data analysis is met.

WO2024181926A1PCT designated stage expired Publication Date: 2024-09-06LEMON INC(GB)
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/SG2024/050117
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-03-01
Filing Date
2024-03-01
Publication Date
2024-09-06

AI Technical Summary

Technical Problem

As the amount of data increases, the computational complexity and communication complexity of existing secure multi-party computing technology increases significantly during the data circulation process, making it difficult to meet the efficient needs of multi-party data collaborative analysis.

Method used

Adopt a multi-party database query method based on Structured Query Language (SQL) to obtain associated data attributes through data query requests, perform data sharding and aggregation, generate data shards for secure query results, and implement aggregation queries for multi-party secure computing process.

Benefits of technology

It reduces the computational complexity and communication complexity in multi-party scenarios, realizes safe, reliable and efficient data query, and meets the actual business needs of data collaborative analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure SG2024050117_06092024_PF_FP
    Figure SG2024050117_06092024_PF_FP
Patent Text Reader

Abstract

In the embodiments of the present disclosure, provided are a data query method and apparatus, and a device and a storage medium. The method comprises: a first device acquiring first data on the basis of a data query request, wherein the request indicates first data attributes to be classified and aggregated and at least a second data attribute and third data attribute for classification, and the first data at least comprises data associated with the second data attribute; and generating a third data fragment of a data query result on the basis of a first data fragment of the first data and a second data fragment of second data that is received from a second device, wherein the second data at least comprises data associated with the third data attribute, and the third data fragment comprises the following elements, which correspond to the first data attributes that are classified and aggregated at least on the basis of the second data attribute and third data attribute.
Need to check novelty before this filing date? Find Prior Art

Description

[0001]Data Query Method, Apparatus, Device, and Storage Medium This application claims priority to Chinese invention patent application No. 202310189039.1, filed on March 1, 2023, entitled "Data Query Method, Apparatus, Device, and Storage Medium," the entire contents of which are incorporated herein by reference. Technical Field: Example embodiments of the present disclosure generally relate to the field of computers, and more particularly to data query methods, apparatuses, devices, and storage media. Background: Data, as a factor of production, plays an increasingly important role in social life. Data flow and collaboration are prerequisites for data to realize greater value. Currently, different data are often controlled by different owners, and data silos are common. Therefore, it is necessary to achieve collaborative data analysis and maximize data value while ensuring data security for all parties. Secure multi-party computation (SMPC) technology is a common technique for solving data flow problems. However, as the amount of data increases, the computational and communication complexity of this technology increases significantly. SUMMARY OF THE INVENTION In a first aspect of the present disclosure, a data query method is provided. The method includes: obtaining, via a first device, first data based on a data query request, wherein the request indicates a first data attribute to be classified and aggregated, and at least a second data attribute and a third data attribute for classification, and the first data includes at least data associated with the second data attribute; and generating a third data shard representing a result of the data query based on a first data shard of the first data and a second data shard of second data received from a second device, wherein the second data includes at least data associated with the third data attribute, and the third data shard includes elements corresponding to the first data attribute to be classified and aggregated based on at least the second data attribute and the third data attribute.In a second aspect of the present disclosure, a data query apparatus is provided, comprising: a first device acquisition module configured to acquire first data based on a data query request, wherein the request indicates a first data attribute to be classified and aggregated, and at least a second data attribute and a third data attribute for classification, and the first data includes at least data associated with the second data attribute; and a first generation module configured to generate a third data slice representing a result of the data query based on a first data slice of the first data and a second data slice of second data received from a second device, wherein the second data includes at least data associated with the third data attribute, and the third data slice includes elements corresponding to the first data attribute to be classified and aggregated based on at least the second and third data attributes. In a third aspect of the present disclosure, an electronic device is provided. The device comprises at least one processing unit; and at least one memory coupled to the at least one processing unit and storing instructions for execution by the at least one processing unit. When executed by the at least one processing unit, the instructions cause the device to perform the method of the first aspect. In a fourth aspect of the present disclosure, a computer-readable storage medium is provided. The computer-readable storage medium stores a computer program that can be executed by a processor to implement the method of the first aspect. In a fifth aspect of the present disclosure, a computer program product is provided. The computer program product includes computer-executable instructions that, when executed by the processor, implement the method of the first aspect. It should be understood that the content described in this section is not intended to limit the key features or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS The above and other features, advantages, and aspects of the various embodiments of the present disclosure will become more apparent in conjunction with the accompanying drawings and with reference to the following detailed description.In the accompanying drawings, identical or similar reference numerals represent identical or similar elements, wherein: FIG1 illustrates a schematic diagram of an example environment in which embodiments of the present disclosure can be implemented; FIG2 illustrates a schematic diagram of a multi-party data query process according to some embodiments of the present disclosure; FIG3 illustrates a flow chart of a data query method according to some embodiments of the present disclosure; FIG4 illustrates a schematic block diagram of a data query apparatus according to some embodiments of the present disclosure; and FIG5 illustrates a block diagram of an electronic device that can be used to implement some embodiments of the present disclosure. DETAILED DESCRIPTION OF THE EMBODIMENTS Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the drawings illustrate some embodiments of the present disclosure, it should be understood that the present disclosure may be implemented in various forms and should not be construed as limited to the embodiments described herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of protection of the present disclosure. In describing the embodiments of the present disclosure, the term "including" and similar terms should be understood as open-ended, i.e., "including but not limited to." The term "based on" should be understood as "based at least in part on." The term "one embodiment" or "the embodiment" should be understood as "at least one embodiment." The term "some embodiments" should be understood as "at least some embodiments." The following may include other explicit and implicit definitions. The term "in response to" means that a corresponding event occurs or a condition is satisfied. It will be understood that the timing of executing a subsequent action executed in response to the event or condition is not necessarily strongly correlated with the time when the event occurs or the condition is satisfied. In some cases, the subsequent action may be executed immediately when the event occurs or the condition is satisfied; in other cases, the subsequent action may be executed some time after the event occurs or the condition is satisfied. It is understood that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and relevant provisions. It is understood that before using the technical solutions disclosed in each embodiment of this disclosure, the user shall be informed of the type, scope of use, and usage scenarios of the personal information involved in this disclosure in an appropriate manner in accordance with relevant laws and regulations, and the user's authorization shall be obtained.For example, in response to a user's active request, a prompt message may be sent to the user to clearly inform them that the requested operation will require the acquisition and use of their personal information. This allows the user to autonomously choose whether to provide their personal information to the electronic device, application, server, storage medium, or other software or hardware that performs the operations described herein, based on the prompt message. As an optional but non-limiting implementation, the prompt message may be sent to the user in response to the user's active request, for example, via a pop-up window. The pop-up window may present the prompt message in text format. Furthermore, the pop-up window may also contain a selection control for the user to select "Agree" or "Disagree" to provide their personal information to the electronic device. It should be understood that the above notification and user authorization process are merely illustrative and do not limit the implementation of the present disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of the present disclosure. As previously mentioned, since different data is often held by different owners, collaborative data analysis is necessary while ensuring the data security of all parties. Multi-party data joint analysis based on SMPC technology is a common approach to addressing data circulation issues and leveraging data value. However, as data volumes increase, the computational and communication complexity of this approach increases significantly. To meet practical business needs, an efficient federated query protocol needs to be designed. Multi-party database queries based on the Structured Query Language (SQL) have application value in many scenarios. In traditional database query scenarios, data in relational tables or other table formats is controlled by the same data owner, and traditional SQL query engines can be used for query analysis. However, in multi-party database query scenarios, relational tables (or data) are controlled by different data owners, requiring the design of a secure multi-party query protocol to complete query analysis while ensuring data security. The present disclosure proposes a data query solution for implementing aggregated queries on multi-party data. According to this solution, participants in a secure multi-party query can perform operations according to the proposed aggregated query protocol and, based on the data generated during the operations, infer information about other participants to obtain query results.This solution implements an aggregate query process based on multi-party secure computation, effectively solving the problem of joint query in multi-party scenarios. Some example implementations of the present disclosure will be discussed below with reference to Figures 1 and 2. Figure 1 shows a schematic diagram of an example environment 100 in which embodiments of the present disclosure can be implemented. Environment 100 may include multiple devices, such as a first device 105 and a second device 110. These devices can be of any type, including terminal devices and servers. Terminal devices may include, but are not limited to, mobile devices, fixed devices, or portable devices, including mobile phones, desktop computers, laptop computers, notebook computers, netbook computers, tablet computers, media computers, multimedia tablets, personal communication systems (PCS) devices, personal navigation devices, personal digital assistants (PDAs), audio / video players, digital cameras / camcorders, positioning devices, television receivers, radio receivers, e-book devices, all-in-one virtual reality (VR) devices, game consoles, gaming laptops, or any combination thereof, including accessories and peripherals for these devices, or any combination thereof. In some embodiments, the terminal device can also support any type of user interface (such as a "wearable" circuit). Servers may include, but are not limited to, mainframes, edge computing nodes, rack servers, router computers, server computers, personal computers, mainframe computers, laptop computers, tablet computers, desktop computers, and the like. In some embodiments, servers may be implemented as virtual machines, containers, or bare metal servers. Environment 100 may also include multiple databases, such as a first database 115 and a second database 120. First device 105 and second device 110 may obtain data from first database 115 and second database 120, respectively, and store the data in first database 115 and second database 120. The data stored in first database 115 and second database 120 may belong to different data owners. Accordingly, first device 105 and second device 110 may be associated with different data owners. First device 105 and second device 110 may communicate via wired and / or wireless means, for example, to transfer data and information. Communication in environment 100 may follow any appropriate communication protocol, and the scope of the present disclosure is not limited in this respect.It should be understood that FIG1 illustrates two devices 105 and 110 and their corresponding databases 115 and 120 for illustrative purposes only. In implementation, environment 100 may include multiple devices that can communicate with each other. Each device can retrieve data from one or more databases and store data in one or more different databases. It should also be understood that the structure and functionality of environment 100 are described for illustrative purposes only and do not imply any limitation on the scope of the present disclosure. For example, depending on the specific implementation, environment 100 may include more or fewer devices, units, modules, components, and / or parts. In environment 100, first device 105 and second device 110 may perform aggregated queries on multi-party data in response to a data query request. An example process for aggregated queries on multi-party data will be discussed below in conjunction with FIG2 . FIG2 illustrates a multi-party data query process 200 performed by first device 105 and second device 110 according to some embodiments of the present disclosure. As shown in FIG2 , at 205, first device 105 may, on behalf of a querying party or a computing party, retrieve first data based on a data query request. A data query request can originate from any data querying party, such as the data owner associated with the first device 105 or the second device 110, or another third party. This request can be implemented in any appropriate manner, for example, using a Structured Query Language (SQL) query statement. The data being queried can be any appropriate data, such as user data, and can originate from different data owners (e.g., the data owner associated with the first device 105 and the second device 110, as well as other data owners). The data being queried can have multiple attributes, each of which can have one or more values. The data query request indicates a first data attribute to be classified and aggregated (also referred to as a "data attribute to be aggregated" or "attribute to be aggregated"), as well as at least a second data attribute and a third data attribute to be used for the classification. The first data can be generated by the first device 105 based on data stored locally or on an associated device (such as the first database 115). In some embodiments, the first data can be generated by encrypting the stored data to further enhance data security.For example, based on the second data attribute indicated in the data query request, the first device 105 may retrieve data associated with the second data attribute locally or from the associated first database 115. Subsequently, the first data may be generated by performing single-bit encoding, such as one-hot encoding, on the stored data based on the value of the second data attribute. For example, the retrieved stored data may be in the form of a table (e.g., a relational table), where each column corresponds to an attribute of the queried data. This is shown in Table 1 below. Table 1. In Table 1, attribute 1 represents the second data attribute, and its values ​​include XY and XX. As an example, Table 1 also has an ID column. Based on the fact that attribute 1's values ​​include XY and XX, the data in Table 1 can be one-hot encoded, as shown in Table 2 below. Table 2 In Table 1, the value of attribute 1 of ID 1 is XY. Therefore, after one-hot encoding, for the row where ID 1 is located, the value of the column element corresponding to the value XY is 1, and the value of the column element corresponding to the value XX is 0, as shown in Table 2. This results in, for example, first data containing data related to attribute 1. In some embodiments, if the first device 105 locally or its associated devices maintain the first data attribute to be classified and aggregated, the first data may also include data associated with the first data attribute. At 210, the first device 105 secretly fragments the first data to obtain multiple data fragments of the first data, as shown in Table 3 below. Table 3 Wherein represents the shard representation of the variable. Any suitable data sharding method or algorithm currently known or developed in the future can be used here, and the scope of the present disclosure is not limited in this respect. The second device 110 can perform similar processing as the first device 105. As shown in Figure 2, at 215, the second device 110 obtains the second data based on the request for data query. The second data includes at least data associated with the third data attribute indicated by the request for data query. In some embodiments, the second data may also include relevant data of the first data attribute to be classified and aggregated. For example, the second device 110 can obtain relevant data of the third data attribute stored locally or in an associated device (e.g., the second database 120), as shown in Table 4 below. Table 4 In Table 4, attribute 2 represents a third data attribute, and its values ​​include AA, BB, and CC. As an example, the second data also includes data related to the attribute to be aggregated. The second data can be generated by performing one-bit effective encoding (e.g., one-hot encoding) on ​​the stored data based on the value of the third data attribute, as shown in Table 5 below. Table 5 In Table 4, the value of attribute 2 of ID 1 is AA. Therefore, after one-hot encoding, for the row where FD 1 is located, the value of the column element corresponding to the value AA is 1, the value of the column element corresponding to the value BB is 0, and the value of the column element corresponding to the value CC is 0, as shown in Table 5. This results in second data that may, for example, include attribute 2 and data related to the attribute to be aggregated. At 220, the second device 110 secretly fragments the second data to obtain multiple data fragments of the second data, as shown in Table 6 below. Table 6 At block 225, the first device 105 exchanges data shards with the second device 110. For example, the first device 105 may retain one data shard of the first data (referred to as the "first data shard") locally and send another data shard of the first data (referred to as the "fourth data shard") to the second device 110. Similarly, the second device 110 may retain one data shard of the second data (referred to as the "sixth data shard") locally and send another data shard of the second data (referred to as the "second data shard") to the first device 105. At block 230, the first device 105 generates a data shard of the data query result (referred to as the "third data shard") based on the retained first data shard of the first data and the second data shard of the second data received from the second device 110. The third data shard includes elements corresponding to the first data attribute that is classified and aggregated based on at least the second data attribute and the third data attribute. For example, at the first device 105, the first data fragment (for example, in the form of Table 3) and the second data fragment (for example, in the form of Table 6) may be concatenated into the form of the following Table 7: As shown in Table 7, during the splicing process, data alignment can be performed based on the ID. Any appropriate data alignment method can be used, and the scope of this disclosure is not limited in this respect. In some embodiments, to generate a third data shard of the data query result, the first device 105 can generate a data shard (referred to as the "seventh data shard") based on the first data shard of the first data and the second data shard of the second data, including the following elements: the elements correspond to multiple value combinations of the second data attribute and the third data attribute. Subsequently, by using each value combination as a classification, the first data attributes to be aggregated are classified and aggregated, thereby generating a third data shard. For example, the columns of the values ​​(e.g., XY, XX) of the first data attribute of the first data shard (e.g., Table 3) can be element-wise multiplied with the columns of the values ​​(e.g., AA, BB, CC) of the second attribute of the second data shard (e.g., Table 6), resulting in the data shards shown in the following Table 8: Table 8 Here, (XY, AA), (XY, BB), (XY, CC), (XX, AA), (XX, BB), and (XX, CC) represent various categories. Each category can then be multiplied by the attribute to be aggregated according to its corresponding element, and the multiplication results are summed to obtain a third data slice. In some embodiments, the third data slice may also include an element indicating whether the value of the aggregated first data attribute is empty for each category. For example, a count result for each category can be calculated to determine whether the category is empty. The resulting third data slice is shown in Table 9 below. Table 9 Here, <0> indicates that the classification is empty, and <1> indicates that the classification is not empty. At 235, the second device 110 generates a data slice of the data query result (referred to as the "fifth data slice") based on the fourth data slice of the first data received from the first device 105 and the retained sixth data slice of the second data. The fifth data slice includes the following elements, which correspond to the first data attributes that are classified and aggregated based on the fourth data slice of the first data and the sixth data slice of the second data. The fifth data slice can be generated by the second device 110 using similar operations as the first device 105, so the specific details are not repeated here. At 240, the first device 105 exchanges the data slice of the data query result with the second device 110. For example, the first device 105 sends the third data slice of the data query result to the second device 110 and receives the fifth data slice of the data query result from the second device 110. At 245, the first device 105 generates the data query result based on the third data slice and the fifth data slice. For example, the first device 105 may restore the final result based on the third data shard and the fifth data shard, and remove the rows classified as empty, thereby obtaining the final query result, as shown in Table 10. Table 10 Accordingly, the second device 110 can restore the final query result (not shown) based on the data shards of the query result generated locally and the data shards received from the first device 105. Its specific operation is similar to that of the first device 105, so it will not be repeated here. The aggregate query solution according to the embodiment of the present disclosure is simpler and more efficient, wherein the computational complexity and communication complexity of each party are significantly reduced, thereby achieving secure, reliable and efficient data query. An example algorithm flow is discussed below. In this example, the group by keyword in the SQL query statement is used to implement secure computing in a multi-party secure computing scenario. Without loss of generality, assume that there are two participants, P (for example, associated with the first device 105) and R (for example, associated with the second device 110), each of which has a corresponding relationship table. R and R are both data owners and computing parties, and they complete the joint query under the premise of ensuring privacy. There can be one or more data attributes for group by, and each attribute can belong to the participant P. Or P l oThe attributes of the group by are not the result of a joint computation between the participating parties. For example, they may not be the intermediate confidential data of a multi-party computation. In the setup phase, assume that the group by columns (attributes) of & and R are both single columns (attributes) and are aligned based on the identity (ID) column. After alignment, they contain N tuples (rows). Assume that R) has a relational table Z, and the group by columns group P by needs to be followed by ' Similarly, P] performs one-hot encoding on the column L\k^\ of the relational table R = (k"i). For example, the relational table can be reconstructed to obtain R = (sg, s:, ..., sg, "1) , is the list of values ​​after L[k^] is deduplicated, and nine represents the number of values. After one-hot encoding, A relational table 〈, = (〈Co〉, 〈cD, Agg(Uo), Agg(%), 〈f>) may be output, where for each tuple of S, the elements corresponding to c° and Ci represent the current classification (or 'category'), Agg(v0) and Agg(%) represent the aggregated values ​​under the current classification, and / ■ indicates whether the classification is empty. It should be understood that the calculation process of group by under two computing parties is described for the purpose of example only and does not imply any limitation, but the calculation process can be applied to the case of any number of computing parties. It should also be understood that the calculation process of each participant having only one group by attribute is described for the purpose of example only and does not imply any limitation, but the process can be applied to the case of any multiple data attributes. FIG3 shows a flowchart of an example data query method 300 according to some embodiments of the present disclosure. The method 300 can be implemented at the first device 105 or the second device 110. For ease of discussion, the method 300 will be described from the perspective of the first device 105. As shown in FIG3, in block 310, First device 105 obtains first data based on a data query request, wherein the request indicates a first data attribute to be classified and aggregated, as well as at least a second data attribute and a third data attribute for classification, and the first data includes at least data associated with the second data attribute. In block 320, first device 105 generates a third data shard representing the result of the data query based on a first data shard of the first data and a second data shard of the second data received from second device 110, wherein the second data includes at least data associated with the third data attribute, and the third data shard includes an element corresponding to the first data attribute classified and aggregated based on at least the second and third data attributes. In some embodiments, first device 105 may send a fourth data shard of the first data to second device 110. In some embodiments, first device 105 may receive a fifth data shard representing the result of the data query from second device 110, wherein the fifth data shard includes an element corresponding to the first data attribute classified and aggregated based on the fourth data shard of the first data and the sixth data shard of the second data. Furthermore, first device 105 may generate the result of the data query based on the third and fifth data shards.In some embodiments, the first device 105 may, based on a data query request, retrieve stored data associated with the second data attribute and generate first data by performing a single-bit encoding on the data based on the value of the second data attribute. In some embodiments, the first data may also include data associated with the first data attribute to be categorized and aggregated. In some embodiments, the first device 105 may generate a seventh data slice based on a first data slice of the first data and a second data slice of the second data, where the seventh data slice includes elements corresponding to multiple value combinations of the second data attribute and the third data attribute. The first device 105 may also categorize and aggregate the first data attribute using a value combination as a category to generate a third data slice. In some embodiments, the third data slice also includes an element indicating whether the value of the aggregated first data attribute is null for each category. In some embodiments, the first device 105 may send the third data slice to the second device 110 for the second device 110 to generate the data query results. It should be understood that the features and corresponding effects related to the operations of the first device 105 and the second device 110 discussed above with reference to Figures 1 and 2 are also applicable to method 300 and will not be repeated here. Figure 4 shows a schematic structural block diagram of a data query apparatus 400 according to some embodiments of the present disclosure. Apparatus 400 can be implemented in the first device 105 or the second device 110 in Figure 1. For ease of discussion, apparatus 400 will be described from the perspective of the first device 105. As shown in Figure 4, apparatus 400 includes an acquisition module 410 and a first generation module 415. Acquisition module 410 is configured to acquire first data based on a data query request from the first device, wherein the request indicates a first data attribute to be classified and aggregated, as well as at least a second data attribute and a third data attribute for classification, and the first data includes at least data associated with the second data attribute.The first generation module 415 is configured to generate a third data slice representing the result of the data query based on a first data slice of the first data and a second data slice of the second data received from the second device, wherein the second data includes at least data associated with the third data attribute, and the third data slice includes elements corresponding to the first data attribute classified and aggregated based on at least the second and third data attributes. In some embodiments, the apparatus 400 may further include a sending module configured to send a fourth data slice of the first data to the device. In some embodiments, the apparatus 400 may further include: a receiving module configured to receive a fifth data slice representing the result of the data query from the device, wherein the fifth data slice includes elements corresponding to the first data attribute classified and aggregated based on the fourth data slice of the first data and the sixth data slice of the second data; and a second generation module configured to generate the result of the data query based on the third and fifth data slices. In some embodiments, the acquisition module 410 may be further configured to: acquire stored data associated with the second data attribute based on a data query request; and generate first data by performing single-bit encoding on the data based on the value of the second data attribute. In some embodiments, the first data may also include data associated with the first data attribute to be categorized and aggregated. In some embodiments, the first generation module 410 may be further configured to: generate a seventh data slice based on the first data slice of the first data and the second data slice of the second data, wherein the seventh data slice includes elements corresponding to multiple value combinations of the second data attribute and the third data attribute; and categorize and aggregate the first data attribute using a value combination as a category to generate a third data slice. In some embodiments, the third data slice may also include an element indicating whether the value of the aggregated first data attribute is null for each category. In some embodiments, the sending module may be further configured to: send the third data slice to the second device so that the second device can generate the data query results. It should be understood that the features and corresponding effects related to the operation of the first device 105 and the second device 110 discussed above with reference to Figures 1 and 2 are also applicable to the apparatus 400 and will not be repeated here.Figure 5 shows a block diagram of an electronic device 500 in which one or more embodiments of the present disclosure may be implemented. For example, electronic device 500 may be used to implement a data query process according to embodiments of the present disclosure. The electronic device 500 shown in Figure 5 is merely exemplary and does not limit the functionality or scope of the embodiments described herein. As shown in Figure 5, electronic device 500 is in the form of a general-purpose electronic device. Components of electronic device 500 may include, but are not limited to, one or more processors or processing units 510, memory 520, storage device 530, one or more communication units 540, one or more input devices 550, and one or more output devices 560. Processing unit 510 may be a real or virtual processor and is capable of performing various processes according to programs stored in memory 520. In a multi-processor system, multiple processing units execute computer-executable instructions in parallel to enhance the parallel processing capabilities of electronic device 500. Electronic device 500 typically includes multiple computer storage media. Such media may be any available media accessible to electronic device 500, including, but not limited to, volatile and non-volatile media, and removable and non-removable media. Memory 520 may be volatile memory (e.g., registers, cache, random access memory (RAM)), non-volatile memory (e.g., read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory), or some combination thereof. Storage device 530 may be removable or non-removable media and may include machine-readable media such as a flash drive, a magnetic disk, or any other media that can be used to store information and / or data (e.g., training data for training) and accessed within electronic device 500. Electronic device 500 may further include additional removable / non-removable, volatile / non-volatile storage media. Although not shown in FIG. 5 , a magnetic disk drive for reading from or writing to a removable, non-volatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, non-volatile optical disk may be provided. In these cases, each drive may be connected to a bus (not shown) via one or more data media interfaces.Memory 520 may include a computer program product 525 having one or more program modules configured to perform various methods or actions of various embodiments of the present disclosure. Communication unit 540 enables communication with other electronic devices via a communication medium. Additionally, the functionality of the components of electronic device 500 may be implemented as a single computing cluster or multiple computing machines capable of communicating via a communication connection. Thus, electronic device 500 may operate in a networked environment using logical connections to one or more other servers, network personal computers (PCs), or other network nodes. Input device 550 may be one or more input devices, such as a mouse, keyboard, or trackball. Output device 560 may be one or more output devices, such as a display, speaker, or printer. Electronic device 500 may also communicate with one or more external devices (not shown) via communication unit 540 as needed, such as storage devices, display devices, or one or more devices that enable user interaction with electronic device 500, or any device that enables electronic device 500 to communicate with one or more other electronic devices (e.g., a network card, modem, etc.). Such communication can be performed via an input / output (I / O) interface (not shown). According to an exemplary implementation of the present disclosure, a computer-readable storage medium is provided, on which one or more computer instructions are stored. The one or more computer instructions are executed by a processor to implement the method described above. Various aspects of the present disclosure are described herein with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products implemented according to the present disclosure. It should be understood that each block in the flowcharts and / or block diagrams, as well as combinations of blocks in the flowcharts and / or block diagrams, can be implemented by computer-readable program instructions. These computer-readable program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine such that, when executed by the processing unit of the computer or other programmable data processing device, these instructions generate a device that implements the functions / actions specified in one or more blocks in the flowcharts and / or block diagrams.These computer-readable program instructions can also be stored in a computer-readable storage medium. These instructions cause a computer, programmable data processing device, and / or other device to operate in a specific manner. Thus, the computer-readable medium storing the instructions comprises an article of manufacture, which includes instructions for implementing various aspects of the functions / actions specified in one or more blocks in the flowcharts and / or block diagrams. The computer-readable program instructions can also be loaded onto a computer, other programmable data processing device, or other device, causing the computer, other programmable data processing device, or other device to execute a series of operational steps to generate a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing device, or other device to implement the functions / actions specified in one or more blocks in the flowcharts and / or block diagrams. The flowcharts and block diagrams in the accompanying drawings illustrate possible architectures, functions, and operations of various implementations of the systems, methods, and computer program products of the present disclosure. In this regard, each block in the flowcharts or block diagrams may represent a module, program segment, or portion of instructions, each of which contains one or more executable instructions for implementing the specified logical function. In some alternative implementations, the functions marked in the blocks may occur in a different order than that marked in the accompanying figures. For example, two consecutive blocks may actually be executed substantially in parallel, or they may sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flow charts, as well as combinations of blocks in the block diagrams and / or flow charts, may be implemented using a dedicated hardware-based system that performs the specified functions or actions, or may be implemented using a combination of dedicated hardware and computer instructions. Various implementations of the present disclosure have been described above. The above description is illustrative, not exhaustive, and is not intended to limit the disclosed implementations. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described implementations. The terminology used herein is selected to best explain the principles, practical applications, or improvements to existing technologies of the various implementations, or to enable others skilled in the art to understand the various implementations disclosed herein.

Claims

Claims 1. A data query method, comprising: Acquiring first data through a first device based on a data query request, wherein the request indicates a first data attribute to be classified and aggregated and at least a second data attribute and a third data attribute used for the classification, and the first data includes at least data associated with the second data attribute; and generating a third data slice of the result of the data query based on a first data slice of the first data and a second data slice of second data received from a second device, wherein the second data includes at least data associated with the third data attribute, and the third data slice includes the following elements, which correspond to the first data attribute that is classified and aggregated based on at least the second data attribute and the third data attribute.

2. The method according to claim 1, further comprising: Send a fourth data slice of the first data to the second device.

3. The method according to claim 2, further comprising: receiving a fifth data shard of the result of the data query from the second device, wherein the fifth data shard includes the following elements, the elements corresponding to the first data attributes classified and aggregated based on the fourth data shard of the first data and the sixth data shard of the second data; and generating the result of the data query based on the third data shard and the fifth data shard.

4. The method according to claim 1, wherein acquiring the first data comprises: Based on the request for the data query, acquiring stored data associated with the second data attribute; And generating the first data by performing one-bit effective encoding on the data based on the value of the second data attribute.

5. The method according to claim 1, wherein the first data also includes data associated with the first data attribute to be classified and aggregated.

6. The method according to claim 1, wherein the third data fragment packet is generated The invention relates to a method for generating a seventh data slice based on the first data slice of the first data and the second data slice of the second data, wherein the seventh data slice includes the following elements, and the elements correspond to multiple value combinations of the second data attribute and the third data attribute; and the first data attribute is classified and aggregated by taking one of the value combinations as a classification to generate the third data slice.

7. The method according to claim 1, wherein the third data fragment further includes an element indicating whether the value of the aggregated first data attribute is empty for each classification.

8. The method according to claim 1, further comprising: The third data slice is sent to the second device so that the second device can generate the result of the data query.

9. A data query device, comprising: An acquisition module is configured to acquire first data based on a data query request through a first device, wherein the request indicates a first data attribute to be classified and aggregated and at least a second data attribute and a third data attribute used for the classification, and the first data includes at least data associated with the second data attribute; and a first generation module is configured to generate a third data slice of the result of the data query based on a first data slice of the first data and a second data slice of the second data received from a second device, wherein the second data includes at least data associated with the third data attribute, and the third data slice includes the following elements, which correspond to the first data attribute that is classified and aggregated based on at least the second data attribute and the third data attribute.

10. The device according to claim 9, further comprising: The sending device is configured to send a fourth data slice of the first data to the second device.

11. The device according to claim 10, further comprising: A receiving device configured to receive the result of the data query from the second device. a fifth data slice of the result, wherein the fifth data slice includes the following elements, and the elements correspond to the first data attributes that are classified and aggregated based on the fourth data slice of the first data and the sixth data slice of the second data; and a second generating module, configured to generate the result of the data query based on the third data shard and the fifth data shard.

12. The apparatus according to claim 9, wherein the acquisition module is further configured to: based on the request of the data query, acquire the stored data associated with the second data attribute; and generate the first data by performing one-bit effective encoding on the data based on the value of the second data attribute.

13. The apparatus according to claim 9, wherein the first data further includes data associated with the first data attribute to be classified and aggregated.

14. The apparatus according to claim 9, wherein the first generating module is further configured to: generate a seventh data slice based on the first data slice of the first data and the second data slice of the second data, wherein the seventh data slice includes the following elements, and the elements correspond to multiple value combinations of the second data attribute and the third data attribute; and classify and aggregate the first data attributes by taking one of the value combinations as a classification to generate the third data slice.

15. The device according to claim 9, wherein the third data fragment further includes an element indicating whether the value of the aggregated first data attribute is empty for each classification.

16. The apparatus according to claim 9, wherein the sending module is further configured to: send the third data slice to the second device so that the second device generates the result of the data query.

17. An electronic device, comprising: at least one processing unit; and at least one memory coupled to the at least one processor a processing unit and storing instructions for execution by the at least one processing unit, wherein the instructions, when executed by the at least one processing unit, cause the device to perform the method according to any one of claims 1 to 8.

18. A computer-readable storage medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Data query method and device, equipment and storage medium

    CN118585542A

  • Data processing method and device and device for data processing

    CN112906904A

  • Privacy-protecting method and device for determining feature effective value of business data

    CN113407987A

  • Data query method and device based on privacy protection

    CN114090638A

  • Data processing method and device

    CN114726512A