Information processing method and device, equipment and storage medium

By extending SQL to generate a federated learning programming language, identifying keywords and generating target code, and utilizing heterogeneous hardware to perform heterogeneous computing, the problems of data communication and computing performance in federated learning are solved, and efficient multi-participant joint data learning is achieved.

CN114490705BActive Publication Date: 2026-02-06WEBANK (CHINA)
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202011273309.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-11-13
Publication Date
2026-02-06
Estimated Expiration
2040-11-13

AI Technical Summary

Technical Problem

Traditional SQL methods cannot solve data communication problems in federated learning, resulting in low computational performance and poor efficiency, and thus failing to achieve information processing in federated learning.

Method used

By extending the structured query language to generate a federated learning programming language, keywords are identified and target code is generated. Heterogeneous computing is performed using heterogeneous hardware to realize federated learning operations between the local area and other participants.

Benefits of technology

It improves the computational performance and efficiency of federated learning, solves information processing problems, and enables joint data learning among multiple participants.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114490705B_ABST
    Figure CN114490705B_ABST
Patent Text Reader

Abstract

The application discloses an information processing method, device and equipment and a storage medium. The method comprises the following steps: acquiring a first code, wherein the first code is generated based on a structured query language; obtaining a to-be-executed operation for representing an interaction between a local place and other participants in the first code by identifying a keyword in the first code for representing the local place and / or the other participants; generating a target code for indicating a federated learning operation between the local place and the other participants according to the to-be-executed operation, wherein the target code comprises a calculation logic for executing the federated learning; and performing calculation of the federated learning according to the calculation logic. The application can solve the information processing problem in the federated learning, and thus realizes the federated learning.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of information processing, and in particular to an information processing method, device, equipment and storage medium. BACKGROUND

[0002] With the development of computer technology, more and more scenarios are applied to federated learning. In the scenario of federated learning, there are two or more data owners, i.e. multiple institutions. Through federated learning, multiple institutions can effectively help multiple institutions to use data and machine learning modeling under the requirements of user privacy protection, data security and certain rules.

[0003] In traditional data statistics and analysis, since the data is in the same party, the problem of which party the data is in does not need to be considered when accessing, and the access to data is less affected by the permission, and generally clear text or near clear text data can be obtained. However, in federated learning, data is distributed in different data owners, and traditional SQL cannot solve the data communication problem in federated learning, and in federated learning, computation is generally performed on CPU, which has low performance and poor efficiency. Therefore, the data analysis code written in the traditional SQL mode is no longer applicable in the scenario of federated learning, and cannot solve the information processing problem in federated learning, and thus federated learning cannot be implemented. SUMMARY

[0004] The main purpose of the present application is to provide an information processing method, device, equipment and storage medium, which aims to solve the problem of information processing in federated learning, and to implement federated learning.

[0005] To achieve the above purpose, the present application provides an information processing method, comprising:

[0006] obtaining a first code, the first code being generated based on a structured query language;

[0007] By identifying the keywords in the first code for representing the local party and / or other participating parties, the to-be-executed operation in the first code for representing the interaction between the local party and other participating parties is obtained;

[0008] According to the to-be-executed operation, a target code for indicating the federated learning operation between the local party and other participating parties is generated, and the target code includes a calculation logic for executing federated learning;

[0009] According to the calculation logic, the calculation of federated learning is performed.

[0010] In a possible implementation, the operation to be executed for the local party to interact with the other parties in the first code is obtained by identifying the keyword in the first code for representing the local party and / or the other parties, comprising:

[0011] The keyword in the first code is identified, and if the keyword for representing the corresponding operation of the local party and / or the other parties exists in the keyword for representing the operation to be executed, it is determined that the operation to be executed is contained in the first code.

[0012] In a possible implementation,

[0013] The operation to be executed comprises the operation of set operation, the operation of selection, the operation of projection and the operation of renaming; the keyword in the first code is identified, and if the keyword for representing the corresponding operation of the local party and / or the other parties exists in the keyword for representing the operation to be executed, it is determined that the operation to be executed is contained in the first code, comprising:

[0014] The keyword in the first code is identified, and if the keyword for indicating that the local party and / or the other parties perform the operation by a preset algorithm exists before the keyword for representing the set operation, it is determined that the operation of set operation for supporting the execution of federated learning is contained in the first code;

[0015] If the keyword for indicating the party performing the selection operation with the local party exists before the keyword for representing the selection operation, it is determined that the operation of selection for supporting the execution of federated learning is contained in the first code;

[0016] If the keyword for indicating the party performing the projection operation with the local party exists in the keyword for representing the projection operation, it is determined that the operation of projection for supporting the execution of federated learning is contained in the first code;

[0017] If the keyword for indicating the local party and / or the party performing the renaming operation exists in the keyword for representing the renaming operation, it is determined that the operation of renaming for supporting the execution of federated learning is contained in the first code.

[0018] In a possible implementation,

[0019] The target code for indicating the local party to perform the federated learning operation with the other parties is generated according to the operation to be executed, comprising:

[0020] The operation of set operation, the operation of selection, the operation of projection and the operation of renaming in the operation to be executed are identified;

[0021] The operation, selection operation, projection operation and renaming operation of the set operation are analyzed respectively to obtain intermediate code;

[0022] The intermediate code is optimized to generate the target code.

[0023] In a possible implementation manner,

[0024] The first code comprises optimizer hint information; and the optimization of the intermediate code to generate the target code comprises:

[0025] According to an object indicated for optimization in the optimizer hint information, at least one of the following optimizations is performed on the intermediate code: target optimization, data reading mode optimization, query optimization, set operation sequence optimization, set operation optimization, parallel computing mode optimization, multi-party secure computing optimization, optimization of heterogeneous hardware for performing heterogeneous computing, and communication mode optimization, to generate the target code.

[0026] In a possible implementation manner, the computing logic comprises identification of heterogeneous hardware for performing heterogeneous computing; and the performing of the computation of federated learning according to the computing logic comprises:

[0027] According to the identification of the heterogeneous hardware, a first computing operation for performing heterogeneous computing on the heterogeneous hardware is determined;

[0028] The first computing operation is performed through a matched backend for performing federated learning.

[0029] In a possible implementation manner, the computing logic further comprises algorithm operation; and the performing of the computation of federated learning according to the computing logic further comprises:

[0030] According to the algorithm operation, a second computing operation for performing operation in each stage of federated learning is determined, and the second computing operation comprises at least one of the following: set operation, parallel computing and multi-party secure computing;

[0031] The second computing operation is performed through the backend.

[0032] In a possible implementation manner,

[0033] The computing logic further comprises data owner and communication rule; and the performing of the computation of federated learning according to the computing logic further comprises:

[0034] According to the data owner and the communication rule, a third computing operation for performing cross-site communication between a local party and other participating parties in federated learning is determined;

[0035] The third computing operation is performed through the backend.

[0036] The application also provides an information processing device, which comprises:

[0037] An acquisition module is configured to acquire a first code, which is generated based on a structured query language;

[0038] An identification module is configured to obtain, by identifying a keyword in the first code for representing a local place and / or other participants, a to-be-executed operation in the first code for representing the local place interacting with the other participants;

[0039] A compilation module is configured to generate, according to the to-be-executed operation, a target code for instructing the local place to perform a federated learning operation with the other participants, the target code comprising a calculation logic for performing the federated learning;

[0040] An execution module is configured to perform, according to the calculation logic, a calculation of the federated learning.

[0041] The application also provides an information processing device, which comprises a memory, a processor and an information processing program stored in the memory and executable on the processor, and the information processing program, when executed by the processor, implements the steps of the information processing method according to any one of the preceding embodiments.

[0042] The application also provides a computer readable storage medium, which stores an information processing program, and the information processing program, when executed by a processor, implements the steps of the information processing method according to any one of the preceding embodiments.

[0043] In the application, the first code is acquired, which is generated based on a structured query language, and then the to-be-executed operation in the first code for representing the local place interacting with the other participants is obtained by identifying a keyword in the first code for representing a local place and / or other participants, and then the target code for instructing the local place to perform a federated learning operation with the other participants is generated according to the to-be-executed operation, wherein the target code comprises a calculation logic for performing the federated learning, and then the calculation of the federated learning is performed according to the calculation logic, so that the local place and the other participants can jointly perform the federated learning operation by acquiring the first code generated based on the structured query language and compiling the first code to generate the target code comprising the calculation logic for performing the federated learning, thereby solving the information processing problem in the federated learning and achieving the federated learning. BRIEF DESCRIPTION OF DRAWINGS

[0044] Figure 1 An application scenario schematic diagram is provided for the embodiments of the application.

[0045] Figure 2 A flowchart of an information processing method provided for an embodiment of the present application is shown in the figure;

[0046] Figure 3 A flowchart of an information processing method provided for another embodiment of the present application is shown in the figure;

[0047] Figure 4 A structural diagram of an information processing device provided for an embodiment of the present application is shown in the figure;

[0048] Figure 5 A structural diagram of an information processing device provided for an embodiment of the present application is shown in the figure.

[0049] The implementation, functional features and advantages of the present application will be further described with reference to the embodiments and the accompanying drawings. DETAILED DESCRIPTION

[0050] Exemplary embodiments of the present disclosure will be described more fully hereinafter with reference to the accompanying drawings; however, they are not limited to the embodiments set forth herein but can be implemented in various forms. The embodiments are provided so that this disclosure will be thorough, and will fully convey the scope of the disclosure to those skilled in the art.

[0051] In traditional data statistics and analysis, since the data is in the same party, the problem of which party the data is in does not need to be considered when accessing, and the access data is less affected by the permission, and generally clear text or near clear text data can be obtained. However, in federated learning, data is distributed in different data owners, and computation is generally performed on CPU, which has low performance and poor efficiency. Therefore, the data analysis code written in the traditional SQL mode is no longer applicable in the federated learning scenario, and cannot solve the information processing problem in federated learning, and thus cannot implement federated learning.

[0052] For example, to obtain secure business data, a target model is trained through federated learning, and in the learning process, the user's input code needs to be compiled and then run to implement model training. However, in the entire compilation process, since the data analysis code written in the traditional SQL mode can only read local data, but the data that needs to be read in the federated learning process may or may not be in the local party, so only part of the operation may be allowed, and thus the entire compilation process cannot be completed, resulting in that the code cannot run normally, and thus the training of the federated learning model cannot be implemented.

[0053] Or, in the learning process, the training of the model is realized by CPU operation, but in the whole process, a plurality of operations such as convolution may be required, and the plurality of operations can be realized by other hardware, not limited to CPU execution. For example, in the context of image rendering, the single instruction multiple thread (SIMT) architecture of the graphics processing unit (GPU) will provide a better calculation mode, thereby achieving higher performance; when acceleration calculation is required, the field-programmable gate array (FPGA) / application specific integrated circuit (ASIC) can accelerate specific calculations at the hardware level, which may give the performance a quantitative improvement; in addition, for the problem of management and scheduling, the development cycle and difficulty of special hardware (such as GPU, FPGA, etc.) are greater than that of CPU, and CPU is good at management and scheduling, so CPU can be used for execution. Therefore, if the whole process is only executed in CPU, the performance of the whole process calculation will be low and the efficiency will be poor. Therefore, in federated learning, only executing calculation on CPU may result in low performance and poor efficiency of executing calculation, and heterogeneous computing of federated learning cannot be realized.

[0054] Therefore, because the data analysis code written in the traditional SQL mode is no longer applicable in the federated learning scenario, the information processing problem in federated learning cannot be solved, and federated learning cannot be realized.

[0055] To solve this problem, the technical concept of the present application is to extend the traditional structured query language to form a programming language suitable for federated learning, so that a compiler based on the federated learning programming language is designed to analyze and process the federated learning programming language, obtain the to-be-executed operation in the code for interaction, and then compile to obtain the target code containing the calculation logic for executing federated learning, and realize the federated learning of the local place and other participants through the back-end execution of the calculation logic, and solve the problem of information processing in federated learning.

[0056] Figure 1 An application scenario diagram is provided for the embodiments of the present application. As shown in FIG. 1, the application scenario diagram includes a federated learning system 100 and a federated learning system 200. The federated learning system 100 and the federated learning system 200 are connected through a network 300. Figure 1As shown, in order to solve the problem of information processing in federated learning, the federated learning programming language input by the user on the terminal device installed with the compiler supporting federated learning, i.e., the first code, carries data owner and operation permission code, etc. The first code is analyzed and processed by the front end of the compiler, and the to-be-executed operation for interaction is recognized, and then the to-be-executed operation is compiled into a computing logic target code for executing federated learning by the compiler, and then the computing logic is run by the back end (i.e., the framework applicable to federated learning) to realize the calculation of federated learning, and then the model training of federated learning is realized. Therefore, by processing the federated learning language input by the user, not only the performance of the execution calculation can be improved, but also the communication supporting federated learning can be realized.

[0057] Taking obtaining secure service data as an example, the federated learning programming language is obtained based on the extension of the structured query language (SQL) language, and the target model is trained by federated learning. In the learning process, different participants need to interact, so there is communication between the local and other participants. The data owner, corresponding data column, and operation permission, etc. can be marked in the federated learning programming language, and in the compilation process, it can be analyzed from the metadata (output code input by the user, i.e., federated learning programming language) which data belongs to which party and which operation belongs to which party. Then, where the local data and the data of other participants in federated learning need to be operated together, cross-site communication code will be generated. The cross-site communication code is used to realize the communication between the local and other participants, so that the target code generated by the compiler contains cross-site communication code, which can solve the communication problem in federated learning.

[0058] In addition, in the learning process, there may be multiple operations, and the implementation of multiple operations can be executed by specific heterogeneous hardware for calculation. By accessing heterogeneous hardware, target code is generated, and then the heterogeneous hardware can perform heterogeneous calculation according to the target code to realize heterogeneous calculation supporting federated learning, i.e., heterogeneous calculation based on federated learning of SQL language, which can improve the performance and efficiency of execution calculation. For example, GPU, FPGA, ASIC, network processor (Neural-network Processing Unit, NPU), etc. respectively provide corresponding calculation modes, which can be reasonably matched to make each hardware play to its strengths. Therefore, by processing the extended SQL language input by the user, the keywords or codes that can be used for executing heterogeneous calculation are recognized, and then the target code for realizing federated learning is compiled and generated, and then the result of federated learning is obtained by running to realize the joint learning of multiple participants.

[0059] The heterogeneous hardware can include at least three types, i.e., computing, storage, and communication.

[0060] Different functions are provided by different hardware, for example, in the context of image rendering, the SIMT architecture of the GPU can provide a more optimal computing mode, thereby achieving higher performance; the FPGA / ASIC can accelerate specific computing at the hardware level, which can give the performance an order of magnitude improvement; the CPU is good at management and scheduling, and different hardware can be used according to different computing scenarios.

[0061] Therefore, the present application obtains the extended sql language, and designs and implements a FateQL compiler, so that FateQL can achieve the expected function. Through the compiling and running processing of the extended sql language, the problem that the traditional sql language cannot implement information processing in federated learning is solved, and federated learning is implemented.

[0062] Some embodiments of the present application will be described in detail below with reference to the accompanying drawings. The embodiments described below and the features in the embodiments can be combined with each other without conflict.

[0063] Figure 2 A flowchart of an information processing method provided by an embodiment of the present application is shown. The execution subject of the method in the embodiment can be an information processing device, such as a terminal device or a server installed with a compiler. The terminal device or the server has an information processing function. The method in the embodiment can be implemented in software, hardware, or a combination of software and hardware. As shown in Figure 2 The method can include:

[0064] S201, obtaining a first code, the first code being generated based on a structured query language.

[0065] The first code can be a code based on an sql language extension input by a user. The extension of the sql language can include an extension of a keyword. Specifically, the extension of the keyword can include at least two aspects as follows:

[0066] 1) Original keywords with federal extensions. In Fate QL, this extension uses the same keywords as SQL-2003, but in the context of federal learning, it gives federal semantics. For example, using set operations, take join as an example, non-federal join operations are all join in local data; federal join operations will consider the ownership, physical location of the data to be joined, and whether cross-site communication is needed, etc.

[0067] Among them, there are many possibilities for such keywords, which correspond to the theoretical basis of SQL relation algebra:

[0068] For set operations (generally represent table operations). Take join in table operation as an example, which is traditionally the intersection of two different tables. In Fate QL (federal learning programming language), it may refer to a federal learning algorithm-based intersection. This federal intersection contains at most three aspects: one is calculation, which contains all the calculations to get the federal intersection, including federal learning algorithms; two is communication, which contains all the cross-federal site and intra-site communications covered in the intersection process; three is storage, which contains all the storage in the intersection process, including all volatile and non-volatile storage to achieve the goal of set operation.

[0069] For selection operations (generally represent filtering operations, where sentences, etc.). Take '>' in selection operation as an example. In order to get this greater condition, it contains three aspects: one is calculation, which contains all the calculations to get the comparison value of other participants or federated multi-party secure sharing with other participants, and all the calculations to get the calculation result; two is communication, which contains all the cross-federal site and intra-site communications in the selection operation process; three is storage, which contains all the storage in the selection operation process, including all volatile and non-volatile storage to achieve the goal of selection operation.

[0070] For projection operations (generally represent select operations). Take count in projection operation as an example, which contains similar three aspects as set and selection operations.

[0071] The projection operation allows users to define functions, i.e. udf functions. Such udf functions are also operations containing similar three aspects.

[0072] For renaming operations (generally represent alias operations). Like set and selection operations, it contains similar three aspects.

[0073] 2) New keywords. Based on SQL-2003, Fate QL defines more keywords to express special semantics in federal learning, such as considering the ownership, physical location of data, and whether cross-site communication is needed, etc.

[0074] Such keywords can have multiple possibilities, which correspond to the theoretical basis of SQL, relational algebra:

[0075] For set operations. Take the join of set operations as an example. The intersection can have many algorithms in federated learning, and Fate QL adds a keyword before join to express the selected algorithm, such as rsa (i.e. RSA encryption algorithm) join.

[0076] For selection operations. Take and in selection operations as an example. In the process of and, it can be indicated which party to perform and operation with, such as fed and.

[0077] For projection operations. Take count distinct in projection operations as an example. Fate QL can indicate which party to perform distinct in the process of count distinct, such as count fed distinct.

[0078] For renaming operations. Take the as keyword of renaming as an example. In addition to table names and column names, Fate QL also supports renaming parties in the renaming process.

[0079] In addition, some lexical elements are added to describe the content in federated learning, such as double back quotes (` `), which are used to express parties. In terms of syntax, Fate QL is compatible with the syntax of SQL-2003. For example, in the context of federated learning, Fate QL extends the table access function of SQL-2003 from "database.table name" to "party.database.table name", so that users can specify which party's data to perform federated learning calculation with. The expansion of structured query language can also add ordinary comments, and Fate QL is compatible with the comment method of SQL-2003. In addition, Fate QL supports prompting the compiler for optimization in a way close to comments. It can affect the compiler of Fate QL to optimize the execution plan without changing the semantics.

[0080] Since the obtained code is a language for federated learning based on structured query language, i.e. the first code, the first code can be compiled by a compiler for federated learning to obtain backend executable code.

[0081] S202, by identifying the keyword in the first code for representing the local party and / or other participating parties, obtaining the to-be-executed operation in the first code for representing the interaction between the local party and other participating parties.

[0082] In this embodiment, the first code can be used to support the operation of performing federated learning, because the first code contains keywords of the local place and / or other participants, such as, the local place can communicate with other participants across sites, or data encryption transmission, or information interaction keywords. By identifying these keywords, it can be determined that the first code involves corresponding operations of the local place and / or other participants, that is, the to-be-executed operation for interaction. Here, the interaction can be multi-participant communication interaction, or can indicate the interaction between the local place or other participants and other devices, which is not limited here.

[0083] S203, generating target code for indicating the local place and other participants to perform federated learning operation according to the to-be-executed operation.

[0084] The target code includes computing logic for performing federated learning.

[0085] In this embodiment, the code for representing the to-be-executed operation is compiled by using a specific federated learning compiler to generate target code containing computing logic for performing federated learning, that is, the SQL statement is converted into federated learning computing logic. Here, the target code is used to indicate the local place and other participants to perform federated learning operation.

[0086] S204, performing federated learning computing according to the computing logic.

[0087] In this embodiment, the computing logic can include but is not limited to data owner, heterogeneous hardware, algorithm operation, communication rule, etc. The computing logic is run by matching the back end of the running environment, and then the federated learning computing is realized.

[0088] In the embodiment of the application, by obtaining the first code generated based on the structured query language, and then identifying the keywords in the first code for representing the local place and / or other participants, the to-be-executed operation for representing the interaction between the local place and other participants in the first code is obtained, and then the target code for indicating the local place and other participants to perform federated learning operation is generated according to the to-be-executed operation. The target code includes computing logic for performing federated learning, and then the federated learning computing is performed according to the computing logic. Therefore, by obtaining the first code generated based on the structured query language and compiling the first code, the target code including the computing logic for performing federated learning is generated, and the local place and other participants can jointly perform federated learning operation by executing the computing logic, solving the information processing problem in federated learning, and then realizing federated learning.

[0089] Optionally, how to determine the to-be-executed operation can be realized by the following way:

[0090] identifying the keyword in the first code, if there is a keyword in the keyword for indicating the local party and / or other participating parties to perform corresponding operations in the keyword for indicating the operation to be performed, it is determined that the first code contains the operation to be performed.

[0091] In this embodiment, since the keyword is obtained based on the sql language extension and can support federated learning, and federated learning is participated by multiple participating parties, if the keyword indicating the local party and / or other participating parties to perform corresponding operations is identified in the keyword, it indicates that the first code contains the operation to be performed.

[0092] Specifically, the following steps can be implemented:

[0093] Step a1, identifying the keyword in the first code, if there is a keyword for indicating the local party and / or other participating parties to perform operation by a preset algorithm before the keyword for indicating set operation, it is determined that the first code contains the operation of set operation for supporting the execution of federated learning.

[0094] In this embodiment, if the first code is in the extension mode of aspect 1) in the above embodiment, the identification is based on the three categories of calculation, communication and storage to determine whether it conforms to the operation of set operation; if the first code is in the extension mode of another aspect 2) in the embodiment, the join of set operation is taken as an example. There are many algorithms for intersection in federated learning, and Fate QL adds a keyword before join to express the selected algorithm, such as rsa join. The preset algorithm here can be an encryption algorithm.

[0095] Step a2, if there is a keyword for indicating the participating party for selection operation with the local party before the keyword for indicating selection operation, it is determined that the first code contains the selection operation for supporting the execution of federated learning.

[0096] In this embodiment, if the first code is in the extension mode of aspect 1) in the above embodiment, the identification is based on the three categories of calculation, communication and storage to determine whether it conforms to the selection operation; if the first code is in the extension mode of another aspect 2) in the embodiment, and in the and operation, it can be indicated that and operation is performed with which participating party, such as fed and.

[0097] Step a3, if there is a keyword for indicating the participating party for projection operation with the local party in the keyword for indicating projection operation, it is determined that the first code contains the projection operation for supporting the execution of federated learning.

[0098] In this embodiment, if the first code is in the extension mode of aspect 1) in the above embodiment, it is determined whether the first code meets the projection operation based on the three categories of calculation, communication and storage; if the first code is in the extension mode of aspect 2) in the embodiment, taking the count distinct in the projection operation as an example. Fate QL can indicate which party to perform distinct in the process of count distinct, if count fed distinct.

[0099] Step a4, if there is a keyword in the keyword used to represent the renaming operation for indicating that the local party and / or the participant party perform the renaming operation, it is determined that the first code contains the renaming operation for supporting the execution of federated learning.

[0100] In this embodiment, if the first code is in the extension mode of aspect 1) in the above embodiment, it is determined whether the first code meets the projection operation based on the three categories of calculation, communication and storage; if the first code is in the extension mode of aspect 2) in the embodiment, taking the count distinct in the projection operation as an example. Fate QL can indicate which party to perform distinct in the process of count distinct, if count fed distinct.

[0101] Optionally, how to generate the target code through the compiler can be implemented through the following steps:

[0102] Step b1, identifying the set operation, selection operation, projection operation and renaming operation in the to-be-executed operation.

[0103] Step b2, analyzing the set operation, selection operation, projection operation and renaming operation respectively to obtain intermediate code.

[0104] Step b3, optimizing the intermediate code to generate the target code.

[0105] The first code includes at least one of the following: data owner, data column and data operation permission. The data owner can determine the participant party where the data is located, such as the local party or other participant party in federated learning, the data operation permission can determine the operation required or executable by the local party and other participant party, and the data column can be the data to be calculated or processed. In addition, the first code input by the user can also determine which code needs to be executed on the server and which code needs to be executed on the heterogeneous hardware, to support the heterogeneous computing of federated learning.

[0106] In practical applications, the information processing method is based on SQL code extension writing, target code is generated in the compiler compilation process, and then communication of different participants and access to different heterogeneous hardware for heterogeneous computing are implemented.

[0107] In this embodiment, the to-be-executed operation can at least include set operation, selection operation, projection operation and renaming operation. By identifying the to-be-executed operation, the first code containing the to-be-executed operation is subjected to lexical analysis to generate first lexical tokens; then the first lexical tokens are subjected to syntax analysis to generate an abstract syntax tree; and the abstract syntax tree is traversed to obtain the intermediate code FateQL operator (FQLOP) corresponding to the first code.

[0108] Specifically, for lexical analysis, the input is a federated learning programming language (FateQL) statement, the FateQL statement is converted into a lexical token supported by the federated learning programming language, and the output is the lexical token. This process can be performed by a front end of a compiler such as a lexical analyzer, and this process can not focus on whether the syntax is correct, but only performs conversion. Syntax correction and other operations can also be performed, which are not limited here.

[0109] For syntax analysis, the input is a token stream, and the token stream is converted into an abstract syntax tree according to the syntax of FateQL, and the output is the abstract syntax tree (ast). This process can be performed by a front end of a compiler such as a syntax analyzer. According to different analysis strategies, the abstract syntax tree can be generated from top to bottom or from bottom to top.

[0110] For the generation of intermediate code, the input can be an abstract syntax tree. By traversing the abstract syntax tree, the result of syntax analysis can be obtained, and the output is the intermediate code. In this embodiment, the FQLOP is defined and used as a representation form of the intermediate code.

[0111] Wherein, after the intermediate code is generated, the intermediate code can be optimized to improve the performance of the federated learning architecture. For example, by identifying the operations of the local party and the operations of other participants in the federated learning, a target code containing cross-site communication code is generated to implement the communication between the local party and other participants. Specifically, since the first code contains data owners, data columns, and data operation permissions, after the intermediate code is generated, how to translate the intermediate code into a code that can implement communication in federated learning through a compiler can be determined by accessing the first code, using data owners to determine the party where the data is located, and using data operation permissions to determine the data operation of the data columns corresponding to different participants. For example, in each stage of federated learning, if heterogeneous computing is required, the corresponding heterogeneous hardware is accessed. There are at least two solutions for accessing heterogeneous hardware: one is to access when implementing heterogeneous operators; the other is to access when implementing heterogeneous runtime. The process of compiling and generating target code in the process of accessing heterogeneous hardware.

[0112] Optionally, how to optimize the intermediate code to generate the target code can be achieved by the following steps:

[0113] According to the object indicated for optimization in the optimizer prompt information, at least one of the following optimizations is performed on the intermediate code: target optimization, data reading mode optimization, query optimization, set operation sequence optimization, set operation optimization, parallel computing mode optimization, multi-party secure computation optimization, heterogeneous hardware optimization for performing heterogeneous computing, and communication mode optimization, to generate the target code.

[0114] In practical applications, the compiler can be prompted by the prompter to perform optimization, including but not limited to the following optimizations: target optimization, data reading mode optimization, query optimization, set operation sequence optimization, set operation optimization, parallel computing mode optimization, multi-party secure computation optimization, heterogeneous hardware optimization for performing heterogeneous computing, and communication mode optimization.

[0115] Among them, for target optimization, it represents the overall target optimization of Fate QL, including but not limited to obtaining the first n rows of results, obtaining all results, reducing communication volume, improving security, etc.; for data reading mode, it represents the optimization of data reading mode and path, including but not limited to full table scan, index hint, skipping a certain range, sampling, etc.; for query optimization, it represents that the query plan should do / not do a certain type of optimization, including but not limited to not optimizing the execution plan, star operator optimization / not optimization, predicate pushdown optimization / not optimization, view merging / not merging, subquery rewriting / not rewriting, etc.; for set operation sequence optimization, it represents the optimization of set operation evaluation order, including but not limited to first table priority, sequential, local table priority, other federation participants priority, etc.; for set operation optimization mode, it represents the optimization mode of set operation, including but not limited to using / not using hash, using / not using merge, using / not using inner loop, etc.; for parallel optimization mode, it represents which part can use or not use parallel computing optimization, including but not limited to subquery parallelism, local / federation participant parallelism, local broadcast to all participants, other participant broadcast to local, data parallelism, no parallelism, etc.; for multi-party secure computation mode optimization, it represents which part needs to use which multi-party secure computation protocol optimization, including but not limited to homomorphic encryption, semi-homomorphic encryption, secret sharing, etc.; for heterogeneous hardware optimization, it represents which part can be placed in heterogeneous hardware computing optimization; communication mode optimization, it represents the communication protocol and optimization mode, including but not limited to whether to use https, whether to optimize with minimum communication volume, transmission buffer parameters, etc. It can also include Computing hook optimization, users can insert custom code before / after computing, extend functions according to needs, which solves the problem that some logic is difficult to express only with SQL, one of the use cases is the initialization work of federated computing, before computing, you may need to specify participants and roles, initialize the running environment, etc. For other optimizations, including but not limited to whether to cache intermediate results, define query statement blocks, use accurate number / estimated number, sampling method, etc.

[0116] Optionally, the computing logic can include the identification of heterogeneous hardware for performing heterogeneous computing, algorithm operation, and data owner and communication rules. How to perform federated learning computing according to the computing logic can be achieved through the following steps:

[0117] Step c1, according to the identification of the heterogeneous hardware, determine a first computing operation for performing heterogeneous computing on the heterogeneous hardware; perform the first computing operation through the matched backend for performing federated learning.

[0118] In this embodiment, the heterogeneous hardware includes but is not limited to GPU, NPU, FPGA, ASIC, RDMA, etc. According to the identification of the heterogeneous hardware, it can be determined by analyzing the target code which stage uses which heterogeneous hardware to perform the heterogeneous computing. For example, the calculation is placed in the same heterogeneous hardware. If multiple heterogeneous hardware (which may be the same type or different types) supports the same operation, that is, the heterogeneous computing (such as hardware 1 and hardware 2 support matrix multiplication), the optimizer of this strategy will distribute the calculation to the same hardware (such as hardware 1) for calculation and intermediate data storage, reducing the overhead of data copying between heterogeneous hardware when executing the target code. The intermediate data here can be the intermediate result generated in the process of heterogeneous computing. Different heterogeneous hardware can also be used. This strategy is opposite to the strategy of 1) above. Although reducing memory data copying can reduce the overhead, some calculations (such as modular exponentiation) take a very long time, and it may be distributed to another heterogeneous hardware again, which can reduce the total execution time. In this case, the system can generate an optimization scheme for execution in different hardware and notify the backend to execute, that is, to perform heterogeneous computing in different heterogeneous hardware.

[0119] Step c2, according to the algorithm operation, determining a second calculation operation for implementing the operation in each stage of federated learning, the second calculation operation including at least one of the following: set operation, parallel computing, multi-party secure computing; executing the second calculation operation through the backend.

[0120] In this embodiment, according to the set operation, parallel computing, multi-party secure computing, etc. in the target code, the corresponding stage in the federated learning is called and the backend is notified to execute.

[0121] Step c3, according to the data owner and the communication rule, determining a third calculation operation for implementing cross-site communication between the local party and other participants in federated learning; executing the third calculation operation through the backend.

[0122] In this embodiment, by identifying the data owner, it is determined which operations are executed in the local party and which operations are executed in other participants, and the performance of the overall architecture can be improved based on the optimizer prompt information for executing the optimized target code. For example, the optimizer prompt information here can be that at least two participants use a high-speed communication protocol for communication, and for this communication mode, the backend is notified to use the high-speed communication protocol for communication when executing the target code.

[0123] In combination Figure 3As shown, the user inputs the SQL language into the compiler, and the compiler performs compilation processing to generate and run the federated learning computing logic. This SQL enables the user to use the semantics of SQL to perform federated learning operations. Therefore, the user only needs to specify the data owner in the SQL to perform federated learning computing, and then use a dedicated SQL compiler to convert the SQL statement into federated learning computing logic. The user can specify the optimization target and logic in the optimizer prompt of the SQL. The compiler analyzes the optimizer prompt to generate federated learning computing logic that meets the user's rules. These computing logics include but are not limited to data owners, heterogeneous hardware, algorithm operations, communication rules, and the like. The user only needs to write SQL to implement these functions without writing specific codes.

[0124] Therefore, the present application can basically reuse the syntax of the conventional SQL and can maintain compatibility. The historical SQL-based analysis code basically does not need to be modified too much, and the optimization prompt can be used to change the behavior in the federated learning communication process, and the running efficiency, accuracy, and the like can be optimized according to different requirements.

[0125] Figure 4 A structural schematic diagram of an information processing apparatus provided by an embodiment of the present application is shown in FIG. 1. As shown in the figure, the information processing apparatus can include: Figure 4

[0126] The acquisition module 401 is configured to acquire a first code, and the first code is generated based on a structured query language;

[0127] The identification module 402 is configured to obtain a to-be-executed operation for interaction between the local party and other participating parties in the first code by identifying a keyword in the first code for representing the local party and / or the other participating parties;

[0128] The compilation module 403 is configured to generate a target code for indicating a federated learning operation of the local party and the other participating parties according to the to-be-executed operation, and the target code includes a computing logic for performing federated learning;

[0129] The execution module 404 is configured to perform the computing of federated learning according to the computing logic.

[0130] ​The information processing apparatus provided in the embodiment is configured with an acquisition module 401, an identification module 402, a compilation module 403, and an execution module 404, and is used to acquire a first code, the first code is generated based on a structured query language, then a keyword in the first code used to represent a local place and / or other participants is identified to obtain a to-be-executed operation in the first code used to represent the local place interacting with the other participants, and then a target code used to instruct the local place and the other participants to perform a federated learning operation is generated according to the to-be-executed operation, where the target code includes a calculation logic used to perform the federated learning, and then the calculation of the federated learning is performed according to the calculation logic, so that the local place and the other participants can jointly perform the federated learning operation by acquiring the first code generated based on the structured query language and compiling the first code to generate the target code including the calculation logic used to perform the federated learning, thereby solving the information processing problem in the federated learning and further implementing the federated learning.

[0131] The information processing apparatus provided in the embodiment can be used to implement the technical solutions provided in any of the preceding method embodiments, and has similar implementation principles and technical effects, which will not be described herein again.

[0132] In a possible implementation, the identification module is specifically configured to:

[0133] identify the keyword in the first code, and if the keyword used to represent the corresponding operation of the local place and / or the other participants exists in the keyword used to represent the to-be-executed operation, it is determined that the first code contains the to-be-executed operation.

[0134] In a possible implementation, the to-be-executed operation includes a set operation, a selection operation, a projection operation, and a renaming operation, and the identification module is specifically configured to:

[0135] identify the keyword in the first code, and if the keyword used to instruct the local place and / or the other participants to perform the operation through a preset algorithm exists before the keyword used to represent the set operation, it is determined that the first code contains the operation of the set operation used to support the execution of the federated learning;

[0136] if the keyword used to instruct the participant performing the selection operation with the local place exists before the keyword used to represent the selection operation, it is determined that the first code contains the selection operation used to support the execution of the federated learning;

[0137] if the keyword used to instruct the participant performing the projection operation with the local place exists in the keyword used to represent the projection operation, it is determined that the first code contains the projection operation used to support the execution of the federated learning;

[0138] If there is a keyword for indicating that the local and / or participant performs the renaming operation in the keyword for representing the renaming operation, it is determined that the first code contains the renaming operation for supporting the execution of the federated learning.

[0139] In a possible implementation, the compiling module is specifically used for:

[0140] identifying the set operation, the selection operation, the projection operation and the renaming operation in the to-be-executed operation;

[0141] analyzing the set operation, the selection operation, the projection operation and the renaming operation respectively to obtain intermediate code;

[0142] optimizing the intermediate code to generate the target code.

[0143] In a possible implementation, the compiling module is specifically used for:

[0144] performing at least one optimization on the intermediate code according to the object indicated by the optimizer prompt information, the at least one optimization including target optimization, data reading mode optimization, query optimization, set operation sequence optimization, set operation optimization, parallel computing mode optimization, multi-party secure computing optimization, optimization of heterogeneous hardware for performing heterogeneous computing, and communication mode optimization, to generate the target code.

[0145] In a possible implementation, the computing logic includes identification of heterogeneous hardware for performing heterogeneous computing; and the executing module is specifically used for:

[0146] determining, according to the identification of the heterogeneous hardware, a first computing operation for implementing the execution of the heterogeneous computing on the heterogeneous hardware;

[0147] performing the first computing operation through the matched backend for performing the federated learning.

[0148] In a possible implementation, the computing logic further includes algorithm operation; and the executing module is specifically used for:

[0149] determining, according to the algorithm operation, a second computing operation for implementing the operation in each stage of the federated learning, the second computing operation including at least one of set operation, parallel computing and multi-party secure computing;

[0150] performing the second computing operation through the backend.

[0151] In a possible implementation, the computing logic further includes data owner and communication rule; and the executing module is specifically used for:

[0152] determine, according to the data owner and the communication rule, a third computing operation for enabling the local site to communicate with other participants across sites in federated learning;

[0153] perform the third computing operation through the backend.

[0154] The information processing device provided by any of the foregoing embodiments can be used to implement the technical solutions of any of the foregoing method embodiments, and has similar implementation principles and technical effects, which will not be described here again.

[0155] Figure 5 A structural schematic diagram of an information processing device provided by an embodiment of the present application is shown in FIG. 1. Figure 5 As shown in the figure, the device can include a memory 501, a processor 502, and an information processing program stored in the memory 501 and executable on the processor 502, wherein the information processing program, when executed by the processor 502, implements the steps of the information processing method according to any of the foregoing embodiments.

[0156] Optionally, the memory 501 can be independent or integrated with the processor 502.

[0157] The implementation principles and technical effects of the device provided by the embodiment can be referred to the foregoing embodiments, which will not be described here again.

[0158] The present application also provides a computer readable storage medium, which stores an information processing program, wherein the information processing program, when executed by a processor, implements the steps of the information processing method according to any of the foregoing embodiments.

[0159] In several embodiments provided by the present application, it should be understood that the disclosed device and method can be implemented in other ways. For example, the device embodiments described above are only schematic. The division of the modules is only a logical function division. There can be another division manner in actual implementation, for example, a plurality of modules can be combined or integrated into another system, or some features can be ignored or not executed.

[0160] The integrated modules implemented in the form of software function modules can be stored in a computer readable storage medium. The software function modules stored in the storage medium include a plurality of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform some steps of the methods described in the various embodiments of the present application.

[0161] It should be appreciated that the above processor can be a central processing unit (CPU), and can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method disclosed in the application can be directly embodied as hardware processor execution, or a combination of hardware and software modules in the processor.

[0162] The memory can include a high-speed RAM memory, and can also include a non-volatile storage NVM, for example at least one disk memory, and can also be a U disk, a mobile hard disk, a read-only memory, a magnetic disk or an optical disk, etc.

[0163] The above storage medium can be realized by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk or optical disk. The storage medium can be any available medium that can be accessed by a general-purpose or special-purpose computer.

[0164] An exemplary storage medium is coupled to the processor, so that the processor can read information from the storage medium, and can write information to the storage medium. Of course, the storage medium can also be an integral part of the processor. The processor and the storage medium can be located in an application specific integrated circuit (ASIC). Of course, the processor and the storage medium can also exist as discrete components in an electronic device or a host device.

[0165] It should be noted that in this paper, the term "include", "contain" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed, or includes elements inherent to such process, method, article or device. Without more limitations, the element defined by the statement "including a" does not exclude the presence of another identical element in the process, method, article or device including the element.

[0166] The above-mentioned embodiment numbers of the application are only for description, and do not represent the advantages and disadvantages of the embodiments.

[0167] Through the description of the above embodiments, those skilled in the art can clearly understand that the above-mentioned example methods can be realized by means of software and a necessary general hardware platform, and of course, can also be realized by hardware, but in many cases, the former is a better embodiment. Based on such understanding, the technical solutions of the present application can be embodied in the form of a software product, which is stored in a storage medium (such as a ROM / RAM, a magnetic disk, or an optical disc) and includes a plurality of instructions for causing an end device (which can be a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the methods described in the various embodiments of the present application.

[0168] The above is only a preferred embodiment of the present application, and does not limit the patent scope of the present application, and any equivalent structure or equivalent flow transformation made by using the content of the specification and drawings of the present application, or directly or indirectly applied to other related technical fields, are also included in the patent protection scope of the present application.

Claims

1. An information processing method characterized by comprising: The method comprises: obtaining a first code, the first code being generated based on a structured query language; the first code comprising code based on a sql language extension; the sql language extension comprising an extension of a keyword; the extension of the keyword comprising a federal extension of an original keyword; the federal extension of the original keyword giving a federal semantic in the context of federated learning; obtaining, by identifying the keyword in the first code for representing the local party and / or other participants, an operation to be executed in the first code for representing the local party interacting with other participants; generating, according to the operation to be executed, target code for instructing the local party to perform a federated learning operation with other participants, the target code comprising a calculation logic for performing federated learning; performing calculation of federated learning according to the calculation logic; wherein the calculation logic comprises identification of heterogeneous hardware for performing heterogeneous calculation; and performing calculation of federated learning according to the calculation logic comprises: determining, according to the identification of the heterogeneous hardware, a first calculation operation for implementing the heterogeneous calculation performed on the heterogeneous hardware; performing the first calculation operation through a matched backend for performing federated learning; wherein the calculation logic further comprises algorithm operation; and performing calculation of federated learning according to the calculation logic further comprises: determining, according to the algorithm operation, a second calculation operation for implementing operation in each stage of federated learning, the second calculation operation comprising at least one of set operation, parallel calculation, and multi-party secure calculation; performing the second calculation operation through the backend; wherein the calculation logic further comprises data owner and communication rule; and performing calculation of federated learning according to the calculation logic further comprises: determining, according to the data owner and communication rule, a third calculation operation for implementing cross-site communication between the local party and other participants in federated learning; performing the third calculation operation through the backend.

2. The method of claim 1, wherein, The operation to be executed in the first code for representing the local party interacting with other participants comprises: identifying the keyword in the first code, and if there is a keyword for representing the corresponding operation of the local party and / or other participants in the keyword for representing the operation to be executed, it is determined that the first code contains the operation to be executed.

3. The method of claim 2, wherein, The operation to be executed comprises set operation, selection operation, projection operation, and renaming operation; and the operation to be executed in the first code for representing the local party interacting with other participants comprises: identifying the keyword in the first code, and if there is a keyword for indicating that the local party and / or other participants perform operation through a preset algorithm before the keyword for representing set operation, it is determined that the first code contains an operation for supporting set operation for performing federated learning. If there is a keyword for indicating a participant performing a selection operation with the local party before a keyword for representing a selection operation, it is determined that the first code contains a selection operation for supporting the execution of federated learning; If there is a keyword for indicating a participant performing a projection operation with the local party in a keyword for representing a projection operation, it is determined that the first code contains a projection operation for supporting the execution of federated learning; If there is a keyword for indicating that the local party and / or a participant perform a renaming operation in a keyword for representing a renaming operation, it is determined that the first code contains a renaming operation for supporting the execution of federated learning.

4. The method of claim 3, wherein, The generating, according to the to-be-executed operation, of target code for indicating that the local party performs a federated learning operation with other participants includes: identifying a set operation, a selection operation, a projection operation, and a renaming operation in the to-be-executed operation; analyzing the set operation, the selection operation, the projection operation, and the renaming operation respectively to obtain intermediate code; optimizing the intermediate code to generate the target code.

5. The method of claim 4, wherein, The first code includes optimizer hint information; and the optimizing the intermediate code to generate the target code includes: optimizing the intermediate code according to an object indicated by the optimizer hint information for optimization in at least one of the following aspects: target optimization, data reading mode optimization, query optimization, set operation sequence optimization, set operation optimization, parallel computing mode optimization, multi-party secure computation optimization, optimization of heterogeneous hardware for performing heterogeneous computing, and communication mode optimization, to generate the target code.

6. An information processing apparatus, characterized by comprising: The apparatus includes: an obtaining module configured to obtain a first code, the first code being generated based on a structured query language; the first code including code based on an sql language extension; the sql language extension including an extension of a keyword; the extension of the keyword including a federated extension of an original keyword; the federated extension of the original keyword giving a federated semantic in a context of federated learning; an identifying module configured to obtain, by identifying a keyword for representing the local party and / or other participants in the first code, to-be-executed operations for representing interactions between the local party and other participants in the first code; a compiling module configured to generate, according to the to-be-executed operations, target code for indicating that the local party performs a federated learning operation with other participants, the target code including computing logic for performing federated learning; an executing module configured to perform, according to the computing logic, a computation of federated learning; wherein the computing logic includes an identification of heterogeneous hardware for performing heterogeneous computing; and the executing module is specifically configured to: determine, according to the identification of the heterogeneous hardware, a first computing operation for performing heterogeneous computing on the heterogeneous hardware; perform the first computing operation through a matched backend for performing federated learning. wherein the computing logic further includes an algorithm operation; and the executing module is further specifically configured to: perform, according to the algorithm operation, a computation of federated learning. According to the algorithm operation, a second computing operation for implementing an operation performed in each stage of federated learning is determined, the second computing operation including at least one of: set operation, parallel computing, multi-party secure computing; The second computing operation is executed through the backend; The computing logic further includes data ownership and communication rules; in the execution of the federated learning in the computing aspect according to the computing logic, the execution module is further specifically configured to: According to the data ownership and the communication rules, a third computing operation for implementing cross-site communication between the local and other participants in the federated learning is determined; The third computing operation is executed through the backend.

7. An information processing apparatus, characterized by comprising: The information processing device includes a memory, a processor, and an information processing program stored on the memory and executable on the processor, and the information processing program implements the steps of the information processing method according to any one of claims 1 to 5 when executed by the processor.

8. A computer-readable storage medium, characterized in that, The computer readable storage medium stores an information processing program, and the information processing program implements the steps of the information processing method according to any one of claims 1 to 5 when executed by the processor.

Citation Information

Patent Citations

  • Longitudinal federation learning method, device, system for improving safety, and storage medium

    CN110704860A