Data query method and device based on federated learning, equipment and storage medium

By employing a federated learning-based data query method and leveraging the collaborative work of the first and second servers, secure and efficient cross-data source queries are achieved. This solves the problems of data leakage and high maintenance costs in existing technologies, and improves the security and convenience of data queries.

CN115576971BActive Publication Date: 2026-04-14TIANMIAN INFORMATION TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
TIANMIAN INFORMATION TECHNOLOGY (SHENZHEN) CO LTD
Filing Date
2022-09-28
Publication Date
2026-04-14

AI Technical Summary

Technical Problem

Existing technologies pose risks of data leakage and high operational costs when performing joint data analysis across data sources. In particular, existing methods cannot effectively protect user privacy and data security when accessing data from multiple sources.

Method used

A federated learning-based data query method is adopted. The first server receives query requests and generates query statements, distributes query content to the working nodes of each terminal, and performs calculations in conjunction with the hardware-level strong security isolation of the second server to generate data tables and return results, thus ensuring data security.

Benefits of technology

It achieves the goal of lowering the barrier to entry for users, improving the security and convenience of cross-data source queries, and reducing the risk of data leakage and operation and maintenance costs, all while protecting data security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115576971B_ABST
    Figure CN115576971B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of data processing, and discloses a data query method based on federated learning, which comprises the following steps: receiving a first query request of a first terminal to a second terminal and generating an execution task, sending a first query statement to the first terminal and a second query statement to the second terminal according to the execution task; receiving a second query request of the first terminal and a third query request of the second terminal, and distributing the query content of the second query request and the query content of the third query request to the working nodes of each terminal of the federated learning according to the execution task; receiving the query results returned by the working nodes and generating a result set by summarizing, sending the result set to a second server after encryption, calculating a data table, and returning the data table to the first terminal and the second terminal; and sending the query data to the first terminal according to the query data and the data synchronization request sent by the second terminal. The data query method improves the security and convenience of cross-data-source data query.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data processing technology, and in particular to a data query method, apparatus, device, and storage medium based on federated learning. Background Technology

[0002] Privacy computing is a technology and system in which two or more terminals perform collaborative computation, enabling them to perform joint machine learning and analysis on their data without disclosing their individual data. Therefore, there is a need for a technical solution that allows for cross-data source collaborative data analysis while protecting user privacy and ensuring data security.

[0003] Existing technical solutions typically employ two methods to achieve cross-data source access: one is for each terminal to request data access permissions from the other, which carries the risk of data leakage; the other is to use a closed domain approach, where data within the domain can be queried freely, but manual review is required when data leaves the domain, which incurs significant data maintenance and manual review costs. Summary of the Invention

[0004] In view of the above, it is necessary to provide a data query method based on federated learning to enable cross-data source querying while ensuring data security.

[0005] To achieve the above objectives, the present invention provides a data query method based on federated learning, applied to a first server, wherein the first server is communicatively connected to a second server and multiple terminals participating in federated learning, and the method includes:

[0006] Receive a first query request initiated by a first terminal to a second terminal, generate an execution task based on the first query request, generate a first query statement corresponding to the first terminal and a second query statement corresponding to the second terminal based on the execution task, return the first query statement to the first terminal, and send the second query statement to the second terminal;

[0007] Receive a second query request sent by the first terminal and a third query request sent by the second terminal, schedule the second query request and the third query request according to the execution task, and allocate the query content corresponding to the second query request and the query content corresponding to the third query request to the working nodes of each terminal participating in federated learning;

[0008] The system receives multiple query results returned by multiple working nodes, summarizes the multiple query results to generate a result set, encrypts the result set and sends it to the second server, calculates the result set to obtain a data table through the second server, and returns the data table to the first terminal and the second terminal.

[0009] The system receives query data and a data synchronization request sent by the second terminal, and sends the query data to the first terminal according to the data synchronization request.

[0010] Optionally, generating the execution task based on the first query request includes:

[0011] Parse the query statement of the first query request and generate a syntax tree, then traverse the syntax tree to generate a logical execution task;

[0012] The logic execution task is optimized and an execution task is generated based on the preset optimization logic.

[0013] Optionally, generating the first query statement for the first terminal and the second query statement for the second terminal based on the execution task includes:

[0014] Obtain the table information and query conditions of the first query request from the execution task;

[0015] A first query statement is constructed for the first terminal based on the table information and the query conditions;

[0016] Based on the table information and the query conditions, a second query statement is constructed for the second terminal.

[0017] Optionally, after receiving the first query statement, the first terminal generates a second query request based on the first query statement and sends it to the first server; after receiving the second query statement, the second terminal generates a third query request based on the second query statement and sends it to the first server.

[0018] Optionally, the step of scheduling the second query request and the third query request according to the execution task, and distributing the query content corresponding to the second query request and the query content corresponding to the third query request to the work nodes of each terminal participating in federated learning, includes:

[0019] Obtain the worker node information of each terminal participating in federated learning, including resource status and data volume;

[0020] The query content corresponding to the second query request and the query content corresponding to the third query request are split into multiple tasks based on the work node information;

[0021] The multiple tasks are assigned to the working nodes of each terminal according to the execution task.

[0022] Optionally, the result set includes a first dataset and a second dataset, wherein the first dataset contains the query results of the second query request and the unique identifier of the first terminal, and the second dataset contains the query results of the third query request and the unique identifier of the second terminal.

[0023] Optionally, the step of calculating the data table from the result set through the second server includes:

[0024] The second server traverses the first dataset and the second dataset in the result set, calculates the intersection of the first dataset and the second dataset, and generates a data table based on the intersection.

[0025] Furthermore, to achieve the above objectives, the present invention also provides a data query apparatus based on federated learning, the apparatus comprising:

[0026] The query processing module is configured to receive a first query request initiated by the first terminal to the second terminal, generate an execution task based on the first query request, generate a first query statement corresponding to the first terminal and a second query statement corresponding to the second terminal based on the execution task, return the first query statement to the first terminal, and send the second query statement to the second terminal.

[0027] The task scheduling module is used to receive a second query request sent by the first terminal and a third query request sent by the second terminal, schedule the second query request and the third query request according to the execution task, and allocate the query content corresponding to the second query request and the query content corresponding to the third query request to the working nodes of each terminal participating in federated learning.

[0028] The data aggregation module is used to receive multiple query results returned by multiple working nodes, aggregate the multiple query results to generate a result set, encrypt the result set and send it to the second server, calculate the result set to obtain a data table through the second server, and return the data table to the first terminal and the second terminal.

[0029] The data synchronization module is used to receive query data and data synchronization requests sent by the second terminal, and send the query data to the first terminal according to the data synchronization request.

[0030] Furthermore, to achieve the above objectives, the present invention also provides an electronic device, the electronic device comprising:

[0031] Memory, storing at least one computer program; and

[0032] The processor executes the program stored in the memory to implement the data query method based on federated learning described above.

[0033] In addition, to achieve the above objectives, the present invention also provides a computer-readable storage medium storing at least one computer program, which is executed by a processor in an electronic device to implement the above-described federated learning-based data query method.

[0034] This invention transforms cross-data source query requests into execution tasks through a first server to allocate and schedule the query content, thereby achieving distributed federated data analysis. Combined with the hardware-level strong security isolation and general computing environment provided by a second server, the data analysis results are summarized and calculated. This enables cross-data source querying while ensuring data security. Furthermore, terminals participating in federated learning only need to use query statements to perform queries, which lowers the user threshold and improves the security and convenience of cross-data source querying. Attached Figure Description

[0035] Figure 1 This is a flowchart of an embodiment of the data query method based on federated learning of the present invention;

[0036] Figure 2 This is a schematic diagram of an embodiment of the electronic device of the present invention;

[0037] Figure 3 This is a schematic diagram of an embodiment of the data query device based on federated learning of the present invention.

[0038] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0039] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without inventive effort are within the scope of protection of this invention.

[0040] It should be noted that the descriptions involving "first," "second," etc., in this invention are for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined with "first" or "second" may explicitly or implicitly include at least one of that feature. Furthermore, the technical solutions of the various embodiments can be combined with each other, but this must be based on the ability of those skilled in the art to implement them. If the combination of technical solutions is contradictory or impossible to implement, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection claimed by this invention.

[0041] like Figure 1 The diagram shown is a flowchart of an embodiment of the data query method based on federated learning according to the present invention. The data query method based on federated learning is applied to a first server and includes steps S1-S4.

[0042] S1. Receive a first query request initiated by the first terminal to the second terminal, generate an execution task based on the first query request, generate a first query statement corresponding to the first terminal and a second query statement corresponding to the second terminal based on the execution task, return the first query statement to the first terminal, and send the second query statement to the second terminal.

[0043] In one embodiment, the first query request is an SQL query statement, and the first server is a coordination server.

[0044] Specifically, the first server communicates with the second server and multiple terminals participating in federated learning, while the second server does not connect with the multiple terminals participating in federated learning; the first terminal requests data from the second terminal to the first server through a first query request.

[0045] In one embodiment, generating an execution task based on the first query request includes: parsing the query statement of the first query request and generating a syntax tree, traversing the syntax tree to generate a logical execution task, and optimizing the logical execution task based on preset optimization logic to generate an execution task.

[0046] Specifically, the first server generates a syntax tree by performing lexical analysis, syntactic analysis, and semantic analysis on the query statement, traverses the syntax tree starting from the root node to generate a logical execution task, and optimizes the logical execution task based on preset optimization logic including rule optimization logic (RBO) and cost optimization logic (CBO).

[0047] In one embodiment, generating a first query statement for a first terminal and a second query statement for a second terminal based on the execution task includes: obtaining table information and query conditions of the first query request from the execution task; constructing a first query statement for the first terminal based on the table information and the query conditions; and constructing a second query statement for the second terminal based on the table information and the query conditions.

[0048] Typically, the local data of the first terminal and the second terminal are not identical. For example, the first terminal stores a user information table, while the second terminal stores a user e-commerce purchase record table, but the users on the first terminal and the second terminal are not entirely the same. When the first terminal wants to query the total order amount of a user from the second terminal, directly allowing the first terminal to access the second terminal based on the query request would leak the second terminal's user list to the first terminal. Conversely, sending the user list requested by the first terminal to the second terminal for local querying would leak the first terminal's user list to the second terminal. In this embodiment, the first server constructs a query statement based on the table information and query conditions of the first query request that does not leak the information of the first terminal and the second terminal, in order to obtain the user list corresponding to the information queried by the first terminal, and the user list of the second terminal containing that information.

[0049] S2. Receive the second query request sent by the first terminal and the third query request sent by the second terminal, schedule the second query request and the third query request according to the execution task, and allocate the query content corresponding to the second query request and the query content corresponding to the third query request to the working nodes of each terminal participating in federated learning.

[0050] In one embodiment, after receiving the first query statement, the first terminal generates a second query request based on the first query statement and sends it to the first server; after receiving the second query statement, the second terminal generates a third query request based on the second query statement and sends it to the first server.

[0051] In one embodiment, scheduling the second query request and the third query request according to the execution task, and allocating the query content corresponding to the second query request and the query content corresponding to the third query request to the work nodes of each terminal participating in federated learning, includes: obtaining work node information of each terminal participating in federated learning, the work node information including resource status and data volume; splitting the query content corresponding to the second query request and the query content corresponding to the third query request into multiple tasks according to the work node information; and allocating the multiple tasks to the work nodes of each terminal according to the execution task.

[0052] In one embodiment, the working nodes of each terminal perform data queries to obtain query results based on the assigned tasks.

[0053] S3. Receive multiple query results returned by multiple working nodes, summarize the multiple query results to generate a result set, encrypt the result set and send it to the second server, calculate the result set to obtain a data table through the second server, and return the data table to the first terminal and the second terminal.

[0054] Specifically, the result set includes a first dataset and a second dataset. The first dataset contains the query results of the second query request and the unique identifier of the first terminal, and the second dataset contains the query results of the third query request and the unique identifier of the second terminal.

[0055] In one embodiment, the second server is a TEE (Trusted Execution Environment) server.

[0056] In one embodiment, encrypting the result set and sending it to the second server includes: the first server and the second server generating a symmetric key based on the Diffie-Hellman key exchange protocol; the first server encrypting the result set using the symmetric key and sending it to the second server.

[0057] In one embodiment, the step of obtaining a data table by calculating the result set through the second server includes: the second server traversing the first dataset and the second dataset in the result set, calculating the intersection of the first dataset and the second dataset, and generating a data table based on the intersection.

[0058] For example: The first terminal stores a user information table, and the second terminal stores a user e-commerce purchase record table. The first terminal queries the second terminal for the total order amount of the user. The first server obtains the user list corresponding to the information queried by the first terminal as the first dataset, and obtains the user list containing the information in the second terminal as the second dataset. Then, the second server iterates through and calculates the intersection of the first dataset and the second dataset to obtain the intersection of the user lists of the first terminal and the second terminal. This intersection is then returned as a data table to the first terminal and the second terminal. This data table only contains the user lists that are stored in both the first terminal and the second terminal, so it will not cause leakage of the user lists of the first terminal and the second terminal.

[0059] S4. Receive query data and data synchronization request sent by the second terminal, and send the query data to the first terminal according to the data synchronization request.

[0060] In one embodiment, after receiving the data table, the second terminal stores the data table in a cache, retrieves the corresponding data from the database based on the data table in the cache to generate query data, and generates a data synchronization request based on the query data.

[0061] In one embodiment, after receiving the data table, the first terminal stores the data table in a cache, and after receiving query data synchronized by the second terminal through the first server, verifies the query data through the data table.

[0062] As can be seen from the above embodiments, the data query method based on federated learning proposed in this invention transforms cross-data source data query requests into execution tasks through a first server to allocate and schedule query content, thereby achieving distributed federated data analysis. Combined with the hardware-level strong security isolation and general computing environment provided by the second server, the data analysis results are summarized and calculated. This enables cross-data source data querying while ensuring data security. Furthermore, the terminals participating in federated learning only need to use query statements to perform queries, which lowers the user application threshold and improves the security and convenience of cross-data source data querying.

[0063] like Figure 2 The diagram shown is a schematic representation of an embodiment of the electronic device of the present invention. The electronic device 1 is a device capable of automatically performing numerical calculations and / or information processing according to pre-set or stored instructions. The electronic device 1 can be a computer, a single network server, a server group consisting of multiple network servers, or a cloud based on cloud computing, which is a type of distributed computing consisting of a super virtual computer composed of a group of loosely coupled computers.

[0064] In this embodiment, the electronic device 1 includes, but is not limited to, a memory 11, a processor 12, and a network interface 13 that can be interconnected via a system bus. The memory 11 stores a data query program 10 based on federated learning, which can be executed by the processor 12. Figure 3 Only the electronic device 1, which includes components 11-13 and a federated learning-based data query program 10, is shown. Those skilled in the art will understand that... Figure 3 The structure shown does not constitute a limitation on the electronic device 1, and may include fewer or more components than shown, or combine certain components, or have different component arrangements.

[0065] The memory 11 includes RAM and at least one type of readable storage medium. The RAM provides a cache for the operation of the electronic device 1; the readable storage medium can be volatile or non-volatile. Specifically, the readable storage medium can be a storage medium such as flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the readable storage medium can be an internal storage unit of the electronic device 1, such as the hard disk of the electronic device 1; in other embodiments, the storage medium can also be an external storage device of the electronic device 1, such as a plug-in hard disk, smart media card (SMC), secure digital card (SD), flash card, etc., equipped on the electronic device 1. In this embodiment, the readable storage medium of the memory 11 mainly includes a program storage area and a data storage area. The program storage area is typically used to store the operating system and various application software installed on the electronic device 1, such as the code of the data query program 10 based on federated learning in one embodiment of the present invention. The data storage area can store data created based on the use of blockchain nodes, such as various types of data that have been output or will be output.

[0066] In some embodiments, processor 12 may be a central processing unit (CPU), controller, microcontroller, microprocessor, or other data processing chip. Processor 12 is typically used to control the overall operation of the electronic device 1, such as performing control and processing related to data interaction or communication with other devices. In this embodiment, processor 12 is used to run program code stored in memory 11 or process data, such as running a federated learning-based data query program 10.

[0067] The network interface 13 may include a wireless network interface or a wired network interface, which is used to establish a communication connection between the electronic device 1 and the client (not shown in the figure).

[0068] Optionally, the electronic device 1 may further include a user interface, which may include a display, an input unit such as a keyboard, and optionally, a standard wired interface or a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, or an organic light-emitting diode (OLED) touchscreen, etc. The display may also be appropriately referred to as a screen or display unit, used to display information processed in the electronic device 1 and to display a visual user interface.

[0069] In one embodiment of the present invention, when the federated learning-based data query program 10 is executed by the processor 12, it performs the following steps S1-S4.

[0070] S1. Receive a first query request initiated by the first terminal to the second terminal, generate an execution task according to the first query request, generate a first query statement corresponding to the first terminal and a second query statement corresponding to the second terminal according to the execution task, return the first query statement to the first terminal, and send the second query statement to the second terminal.

[0071] S2. Receive the second query request sent by the first terminal and the third query request sent by the second terminal, schedule the second query request and the third query request according to the execution task, and allocate the query content corresponding to the second query request and the query content corresponding to the third query request to the working nodes of each terminal participating in federated learning.

[0072] S3. Receive multiple query results returned by multiple working nodes, summarize the multiple query results to generate a result set, encrypt the result set and send it to the second server, calculate the result set to obtain a data table through the second server, and return the data table to the first terminal and the second terminal;

[0073] S4. Receive query data and data synchronization request sent by the second terminal, and send the query data to the first terminal according to the data synchronization request.

[0074] The specific operational steps implemented in steps S1-S4 above are largely the same as those in an embodiment of the data query method based on federated learning of the present invention, and will not be repeated here.

[0075] In other embodiments, the federated learning-based data query program 10 may be divided into one or more modules, which are stored in the memory 11 and executed by one or more processors (processor 12 in this embodiment) to complete the present invention. The module referred to in the present invention refers to a series of computer program instruction segments that can perform specific functions and are used to describe the execution process of the federated learning-based data query program 10 in the electronic device 1.

[0076] like Figure 3 The diagram shown is a schematic representation of an embodiment of the data query device based on federated learning according to the present invention.

[0077] In a first embodiment of the present invention, the data query device 10 based on federated learning includes a query processing module 110, a task scheduling module 120, a data aggregation module 130, and a data synchronization module 140, as exemplarily:

[0078] The query processing module 110 is configured to receive a first query request initiated by the first terminal to the second terminal, generate an execution task according to the first query request, generate a first query statement corresponding to the first terminal and a second query statement corresponding to the second terminal according to the execution task, return the first query statement to the first terminal, and send the second query statement to the second terminal.

[0079] The task scheduling module 120 is used to receive a second query request sent by the first terminal and a third query request sent by the second terminal, schedule the second query request and the third query request according to the execution task, and allocate the query content corresponding to the second query request and the query content corresponding to the third query request to the working nodes of each terminal participating in federated learning.

[0080] The data aggregation module 130 is used to receive multiple query results returned by multiple working nodes, aggregate the multiple query results to generate a result set, encrypt the result set and send it to the second server, calculate the result set to obtain a data table through the second server, and return the data table to the first terminal and the second terminal.

[0081] The data synchronization module 140 is used to receive query data and data synchronization request sent by the second terminal, and send the query data to the first terminal according to the data synchronization request.

[0082] The specific operation steps implemented by the query processing module 110, task scheduling module 120, data aggregation module 130 and data synchronization module 140 when they are executed are largely the same as those in the above embodiments, and will not be repeated here.

[0083] Furthermore, this invention also proposes a computer-readable storage medium, which can be volatile or non-volatile. Specifically, the computer-readable storage medium can be any one or any combination of several of the following: hard disk, multimedia card, SD card, flash memory card, SMC, read-only memory (ROM), erasable programmable read-only memory (EPROM), portable compact disk read-only memory (CD-ROM), USB memory, etc. The computer-readable storage medium stores a data query program 10 based on federated learning.

[0084] When the federated learning-based data query program 10 is executed by the processor, it performs the following operations:

[0085] A1. Receive a first query request initiated by a first terminal to a second terminal, generate an execution task based on the first query request, generate a first query statement corresponding to the first terminal and a second query statement corresponding to the second terminal based on the execution task, return the first query statement to the first terminal, and send the second query statement to the second terminal.

[0086] A2. Receive the second query request sent by the first terminal and the third query request sent by the second terminal, schedule the second query request and the third query request according to the execution task, and allocate the query content corresponding to the second query request and the query content corresponding to the third query request to the working nodes of each terminal participating in federated learning.

[0087] A3. Receive multiple query results returned by multiple working nodes, summarize the multiple query results to generate a result set, encrypt the result set and send it to the second server, calculate the result set to obtain a data table through the second server, and return the data table to the first terminal and the second terminal;

[0088] A4. Receive query data and data synchronization request sent by the second terminal, and send the query data to the first terminal according to the data synchronization request.

[0089] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0090] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, apparatus, article, or method. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, apparatus, article, or method that includes that element.

[0091] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of the present invention.

[0092] The above are merely preferred embodiments of the present invention and do not limit the scope of the patent. Any equivalent structural or procedural transformations made based on the description and drawings of the present invention, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of the present invention.

Claims

1. A data query method based on federated learning, applied to a first server, wherein the first server is communicatively connected to a second server and multiple terminals participating in federated learning, characterized in that, The method includes: Receive a first query request initiated by a first terminal to a second terminal, generate an execution task based on the first query request, generate a first query statement corresponding to the first terminal and a second query statement corresponding to the second terminal based on the execution task, return the first query statement to the first terminal, and send the second query statement to the second terminal; Receive a second query request generated and sent by the first terminal based on the first query statement and a third query request generated and sent by the second terminal based on the second query statement; schedule the second query request and the third query request according to the execution task; and allocate the query content corresponding to the second query request and the query content corresponding to the third query request to the working nodes of each terminal participating in federated learning. The system receives multiple query results returned by multiple working nodes, summarizes the multiple query results to generate a result set, encrypts the result set and sends it to the second server, calculates the result set to obtain a data table through the second server, and returns the data table to the first terminal and the second terminal. The system receives query data and a data synchronization request sent by the second terminal, and sends the query data to the first terminal according to the data synchronization request.

2. The data query method based on federated learning as described in claim 1, characterized in that, The step of generating an execution task based on the first query request includes: Parse the query statement of the first query request and generate a syntax tree, then traverse the syntax tree to generate a logical execution task; The logic execution task is optimized and an execution task is generated based on the preset optimization logic.

3. The data query method based on federated learning as described in claim 1, characterized in that, The step of generating a first query statement for the first terminal and a second query statement for the second terminal based on the execution task includes: Obtain the table information and query conditions of the first query request from the execution task; A first query statement is constructed for the first terminal based on the table information and the query conditions; Based on the table information and the query conditions, a second query statement is constructed for the second terminal.

4. The data query method based on federated learning as described in claim 1, characterized in that, After receiving the first query statement, the first terminal generates a second query request based on the first query statement and sends it to the first server; after receiving the second query statement, the second terminal generates a third query request based on the second query statement and sends it to the first server.

5. The data query method based on federated learning as described in claim 1, characterized in that, The step of scheduling the second query request and the third query request according to the execution task, and allocating the query content corresponding to the second query request and the query content corresponding to the third query request to the work nodes of each terminal participating in federated learning, includes: Obtain the worker node information of each terminal participating in federated learning, including resource status and data volume; The query content corresponding to the second query request and the query content corresponding to the third query request are split into multiple tasks based on the work node information; The multiple tasks are assigned to the working nodes of each terminal according to the execution task.

6. The data query method based on federated learning as described in claim 1, characterized in that, The result set includes a first dataset and a second dataset. The first dataset contains the query results of the second query request and the unique identifier of the first terminal. The second dataset contains the query results of the third query request and the unique identifier of the second terminal.

7. The data query method based on federated learning as described in claim 6, characterized in that, The step of obtaining a data table by calculating the result set through the second server includes: The second server traverses the first dataset and the second dataset in the result set, calculates the intersection of the first dataset and the second dataset, and generates a data table based on the intersection.

8. A data query device based on federated learning, applied to a first server, wherein the first server is communicatively connected to a second server and multiple terminals participating in federated learning, characterized in that, The device includes: The query processing module is used to receive a first query request initiated by a first terminal to a second terminal, generate an execution task according to the first query request, generate a first query statement corresponding to the first terminal and a second query statement corresponding to the second terminal according to the execution task, return the first query statement to the first terminal, and send the second query statement to the second terminal. The task scheduling module is used to receive the second query request generated and sent by the first terminal according to the first query statement and the third query request generated and sent by the second terminal according to the second query statement, schedule the second query request and the third query request according to the execution task, and allocate the query content corresponding to the second query request and the query content corresponding to the third query request to the working nodes of each terminal participating in federated learning. The data aggregation module is used to receive multiple query results returned by multiple working nodes, aggregate the multiple query results to generate a result set, encrypt the result set and send it to the second server, calculate the result set to obtain a data table through the second server, and return the data table to the first terminal and the second terminal. The data synchronization module is used to receive query data and data synchronization requests sent by the second terminal, and send the query data to the first terminal according to the data synchronization request.

9. An electronic device, characterized in that, The electronic device includes: At least one processor; and, A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the federated learning-based data query method as described in any one of claims 1 to 7.

10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the data query method based on federated learning as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Cross-domain data query method and device

    CN111190924A

  • Federal learning system and federal learning task processing method

    CN114462060A