Blockchain-based federal processing method, device, equipment and storage medium
By using blockchain-based federated processing methods in federated learning systems, samples alignment and random sorting are performed, the difficulty in model performance evaluation caused by data security in federated learning is solved, and higher evaluation reliability and data utilization are achieved. Rate.
Patent Information
- Application Number
- CN202210531118.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-16
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2042-05-16
AI Technical Summary
In the federated learning system, multiple participants need to jointly conduct model training, but due to data security considerations, data cannot be directly exchanged, which makes it difficult to evaluate the model performance.
Using a blockchain-based federated processing method, local target data sets are generated through sample alignment and random sorting, and model evaluation is performed with target data sets of other participants.
Improve the reliability of model performance evaluation, ensure alignment between data sets of each participant, avoid data waste, and improve data utilization.
Smart Images

Figure CN114841372B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of artificial intelligence technology, and in particular to the field of blockchain technology and machine learning technology. Background Art
[0002] In a federated learning system, multiple parties jointly train models. Each party holds a portion of data, namely training samples. For data security reasons, these data cannot be exchanged directly. In supervised machine learning, model evaluation requires dividing the existing data set into a test set and a training set. Under the premise of data security of each party, it is very important to evaluate model performance. Summary of the invention
[0003] The present invention provides a blockchain-based federal processing method, apparatus, device, and storage medium.
[0004] According to one aspect of the present disclosure, a blockchain-based federated processing method is provided, the method comprising:
[0005] Align the local samples of the local participants with other samples of other participants in the federated task to obtain the local basic data set of the federated task;
[0006] Based on a pre-consensus sorting algorithm, the local basic data set is randomly sorted according to the task identification information of the federated task in the blockchain to obtain a local target data set of the federated task;
[0007] The local target dataset and other target datasets of other participants are used to perform model evaluation on the federated task.
[0008] According to another aspect of the present disclosure, a blockchain-based federated processing device is provided, the device comprising:
[0009] A basic data set determination module is used to perform sample alignment between the local samples of the local participant and other samples of other participants in the federated task to obtain the local basic data set of the federated task;
[0010] A target data set determination module is used to randomly sort the local basic data set based on a pre-consensus sorting algorithm according to the task identification information of the federated task in the blockchain to obtain a local target data set of the federated task;
[0011] A model evaluation module is used to use the local target data set and other target data sets of other participants to perform model evaluation on the federated task.
[0012] According to another aspect of the present disclosure, there is provided an electronic device, the electronic device comprising:
[0013] at least one processor; and
[0014] a memory communicatively connected to the at least one processor; wherein,
[0015] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the blockchain-based federal processing method described in any embodiment of the present disclosure.
[0016] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable a computer to execute the blockchain-based federal processing method described in any embodiment of the present disclosure.
[0017] According to the technology of the present disclosure, the reliability of model performance evaluation can be improved.
[0018] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.
[0020] Figure 1 is a flowchart of a blockchain-based federated processing method provided according to an embodiment of the present disclosure;
[0021] Figure 2 is a flowchart of another blockchain-based federated processing method provided according to an embodiment of the present disclosure;
[0022] Figure 3 is a flowchart of another blockchain-based federal processing method provided according to an embodiment of the present disclosure;
[0023] Figure 4 It is a structural diagram of a blockchain-based federated processing device provided according to an embodiment of the present disclosure;
[0024] Figure 5 It is a block diagram of an electronic device used to implement the blockchain-based federated processing method of the embodiment of the present disclosure. DETAILED DESCRIPTION
[0025] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0026] Figure 1 This is a flowchart of a blockchain-based federated processing method provided according to an embodiment of the present disclosure. This method is applicable to the situation of how to evaluate a model, and is particularly applicable to the situation of how to evaluate a model in a federated learning scenario. This method can be executed by a blockchain-based federated processing device, which can be implemented in software and / or hardware, and can be integrated into an electronic device that carries a blockchain-based federated processing function, specifically, an electronic device of any participant in the model evaluation. Figure 1 As shown, the blockchain-based federated processing method of this embodiment may include:
[0027] S101, aligning the local samples of the local participant with other samples of other participants in the federated task to obtain a local basic data set of the federated task.
[0028] In this embodiment, a federated task refers to a task that requires the participation of multiple parties to complete the model evaluation. The so-called local samples may include data such as local users, local user characteristics (attributes) of the local participants. Other samples may include data such as other users of other participants, other user characteristics (attributes), etc. The so-called local basic data set refers to the local sample data of the local participant and the users of other participants who are the same but the user characteristics are not exactly the same, that is, the data that intersects between the local participant and the other participants, which may include user ID and user characteristics (or attributes) of at least one dimension; the local basic data set can be used for subsequent participation in federated tasks.
[0029] The so-called sample alignment is one of the important steps in vertical federated learning technology. The samples in vertical federated learning belong to different participants, and the coverage of the samples of each participant is different. The sample ID of the participant is not suitable for direct intersection calculation. Sample alignment is to obtain the intersection of the sample ID of the participant without leaking the sample ID (Identity Document) of the participant. For example, the sample ID set is signed, randomly disturbed, etc. to obtain a privacy set, and the intersection is calculated based on the privacy set to ensure that the ID cannot be cracked.
[0030] Exemplarily, based on the Private Set Intersection (PSI) technology, the local samples of the local participants can be aligned with other samples of other participants in the federal task to obtain the local basic data of the federal task.
[0031] S102, based on a pre-consensus sorting algorithm, randomly sort the local basic data set according to the task identification information of the federated task in the blockchain to obtain the local target data set of the federated task.
[0032] In this embodiment, the task identification information refers to information used to uniquely identify the task, which can exist in the form of numbers, letters, etc. For example, the UUID (Universally Unique IDentifier) algorithm can be used to generate the task identification information of the federated task. The so-called local target data set refers to a data set that is randomly shuffled from the local basic data set.
[0033] The so-called pre-consensus sorting algorithm refers to the consistent sorting algorithm adopted by all parameter parties of the federated task.
[0034] Specifically, the task identification information of the federated task in the blockchain can be used as a perturbation parameter, and the data in the local basic data set can be randomly sorted based on a pre-consensus sorting algorithm to obtain the local target data set of the federated task. This ensures that the data order in the local target data set is consistent with the data order in other target data sets of other participants, thereby achieving sample alignment between the target data sets of each participant.
[0035] S103, using the local target dataset and other target datasets of other participants to perform model evaluation on the federated task.
[0036] For example, based on different model evaluation methods, such as cross-validation or leave-one-out method, the model of the federated task can be evaluated using a local target dataset and other target datasets of other participants.
[0037] The technical solution of the disclosed embodiment is to obtain the local basic data set of the federated task by aligning the local samples of the local participants with other samples of other participants in the federated task, and then randomly sort the local basic data set according to the task identification information of the federated task in the blockchain based on the sorting algorithm reached in advance, to obtain the local target data set of the federated task, and then use the local target data set and other target data sets of other participants to evaluate the model of the federated task. In the above technical solution, in the federated learning scenario, each participant adds random perturbations to the data set in the same way, so that the verification set has randomness, improves the reliability of the model performance evaluation, and aligns the data sets of each participant, avoids data waste, and improves data utilization.
[0038] Based on the above embodiments, as an optional method of the present disclosure, the task identification information is determined in the following manner: based on the task requirement information of the federated task, the local identification information of the local participants and other identification information of other participants, the task description information of the federated task is determined; the summary information of the task description information is determined, and the summary information is used as the task identification information.
[0039] Among them, task requirement information refers to information such as the required computing power and required samples required to complete the federated task. The so-called local identifier is used to uniquely identify the local participant. The so-called other identifier information is used to uniquely identify other participants. The so-called task description information refers to information used to describe the federated task.
[0040] Exemplarily, based on preset rules, the task description information of the federated task can be determined according to the task requirement information of the federated task, the local identification information of the local participant, and other identification information of other participants. For example, the task requirement information of the federated task, the local identification of the local participant, and other identification information of other participants can be concatenated to obtain the task description information of the federated task. Afterwards, a hash algorithm can be used to sign the task description information to obtain summary information of the task description information, and the summary information is used as the task identification information.
[0041] It can be understood that determining the task identification information through the task description information makes the task identification information more reasonable.
[0042] On the basis of the above embodiments, as an optional method of the present disclosure, task requirement information of the federated task can also be obtained from the blockchain; whether to participate in the execution of the federated task is determined based on the local samples and local computing power of the local participants; in the case of participating in the execution, a participation execution message of the federated task is sent to the blockchain network to update the task status of the federated task according to the participation execution message.
[0043] Among them, local computing power refers to the computing resources that local participants can use to execute federated tasks. The so-called participation execution message refers to the message confirming that they can participate in the execution of federated tasks. The so-called task status refers to the status of the federated task.
[0044] Specifically, the local participant can obtain the task requirement information of the federal task from the blockchain, and then compare the local sample of the local participant with the requirement sample in the task requirement information, and compare the local computing power of the local participant with the requirement computing power in the task requirement information. According to the comparison result, it is determined whether the local participant participates in the federal task. If the local participant can participate in the execution of the federal task, a participation execution message of the federal task is sent to the blockchain network. Correspondingly, the smart contract in the blockchain network can automatically update the task status of the federal task according to the participation execution message, for example, switching the task status to the startup status.
[0045] It is understandable that before the model is evaluated, the blockchain is used to determine the parties that can participate in the federal task, so as to prevent the parties that are incapable of performing the federal task from participating in the execution of the federal task, thereby ensuring the execution efficiency of the federal task; at the same time, it ensures that the entire chain is auditable, self-provable, and trustworthy.
[0046] Figure 2 This is a flowchart of another blockchain-based federated processing method provided according to an embodiment of the present disclosure. Based on the above embodiment, this embodiment further optimizes "based on a pre-consensus sorting algorithm, randomly sorting the local basic data set according to the task identification information of the federated task in the blockchain to obtain the local target data set of the federated task" and provides an optional implementation plan. Figure 2 As shown, the blockchain-based federated processing method of this embodiment may include:
[0047] S201, aligning the local samples of the local participant with other samples of other participants in the federated task to obtain a local basic data set of the federated task.
[0048] S202: When there are at least two rounds of model evaluation, determine the evaluation round of this round of model evaluation.
[0049] Specifically, when there are at least two rounds of model evaluation, the evaluation round of this round of model evaluation is determined from the blockchain network.
[0050] S203, based on a pre-consensus sorting algorithm, randomly sort the local basic data set according to the task identification information and evaluation round of the federated task in the blockchain to obtain the local target data set of the federated task in this round of model evaluation.
[0051] Specifically, the task identification information and evaluation rounds of the federated task in the blockchain can be used as perturbation parameters, and based on a pre-consensus sorting algorithm, the data in the local basic data set can be randomly sorted to obtain the local target data set of the federated task.
[0052] It should be noted that in the case of only one round of model evaluation, the task identification information of the federated task in the blockchain can be used as the perturbation parameter, and the data in the local basic data set can be randomly sorted based on the pre-consensus sorting algorithm to obtain the local target data set of the federated task.
[0053] S204, using the local target dataset and other target datasets of other participants to perform model evaluation on the federated task.
[0054] Specifically, for each round of model evaluation, the local target dataset corresponding to the round of model evaluation and other target datasets of other participants are used to perform model evaluation on the federated task.
[0055] The technical solution of the disclosed embodiment is to obtain the local basic data set of the federated task by aligning the local samples of the local participants with other samples of other participants in the federated task, and then determine the evaluation round of this round of model evaluation when there are at least two rounds of model evaluation, and based on the sorting algorithm reached in advance, randomly sort the local basic data set according to the task identification information and evaluation round of the federated task in the blockchain, to obtain the local target data set of the federated task in this round of model evaluation, and then use the local target data set and other target data sets of other participants to perform model evaluation on the federated task. The above technical solution introduces evaluation rounds and performs multi-round evaluation on the federated task, which further improves the reliability of model evaluation.
[0056] On the basis of the above embodiments, as an optional method of the present disclosure, randomly sorting the local basic data set according to the task identification information and evaluation rounds of the federated tasks in the blockchain can also be: generating a random seed according to the task identification information and evaluation rounds of the federated tasks in the blockchain; using the random seed to create a random number generator; and using the random number generator to randomly sort the local basic data set.
[0057] Specifically, a random seed can be generated according to certain rules based on the task identification information and evaluation rounds of the federated tasks in the blockchain. For example, the task identification information and evaluation rounds of the federated tasks in the blockchain can be spliced, and the spliced result can be used as a random seed. Then, a random number generator can be created using the random seed; the random number generator can be used to obtain a new data sequence, and the new data sequence can be used to randomly sort the local basic data set.
[0058] It should be noted that in this round of evaluation, the random seeds of each participant are the same, and the random seeds in different rounds of evaluation are different.
[0059] It can be understood that the local basic data set is sorted by random seeds so that the obtained local target data set has randomness.
[0060] Figure 3 This is a flowchart of another blockchain-based federated processing method provided according to an embodiment of the present disclosure. Based on the above embodiment, the method of "using local target data sets and other target data sets of other participants to evaluate the model of federated tasks" is further optimized to provide an optional solution. Figure 3 As shown, the blockchain-based federated processing method of this embodiment may include:
[0061] S301, aligning the local samples of the local participant with other samples of other participants in the federated task to obtain a local basic data set of the federated task.
[0062] S302, based on a pre-consensus sorting algorithm, randomly sort the local basic data set according to the task identification information of the federated task in the blockchain to obtain the local target data set of the federated task.
[0063] S303: Based on a preset model evaluation method, the local target data set is divided into a local training set and a local validation set.
[0064] Specifically, the local target data set may be divided into a local training set and a local validation set based on a data set division method corresponding to a preset model evaluation method.
[0065] For example, if the leave-one-out model evaluation method is used, each time the model is evaluated, one piece of data can be selected from the local target data set as the local validation set, and the remaining data can be used as the local training set.
[0066] For example, if the cross-validation model evaluation method is used and the local target data set is divided into K subsets, then each time the model is evaluated, K-1 subsets are selected as local training sets and the remaining subsets are selected as local validation sets, where K is a positive integer.
[0067] It should be noted that other training sets and other validation sets are obtained by dividing other target data sets based on a model evaluation method, and the model evaluation method based on them is the same as the model evaluation method based on the local training set and the local validation set.
[0068] S304, using the local training set and other training sets of other participants to perform model training to obtain a federated task model.
[0069] For example, based on vertical federated learning, the local training set and other training sets of other participants are used to train the model to obtain the federated task model. During the distributed training process, multiple rounds of interaction will be carried out between the participants.
[0070] Specifically, the local participant uses the local training set to train the model in the local terminal to obtain local model parameters, and other participants use other training sets to train the model in other terminals to obtain other model parameters; each participant encrypts the model parameters using homomorphic encryption and forwards the encrypted model parameters to each other; accordingly, each participant decrypts the encrypted model parameters after receiving them, uses the decrypted model parameters to update the local model parameters, and retrains the model; and so on, until the entire training process converges and a federated task model is obtained.
[0071] S305, using the local validation set and other validation sets of other participants to evaluate the federated task model.
[0072] Specifically, the local participant uses the local verification set to evaluate the federated task model and obtains the local verification result. Other participants use other verification sets to evaluate the federated task model and obtain other verification results. After that, each participant transmits the verification result to the label holder. Correspondingly, the label holder obtains the evaluation result of the federated task model based on the verification result and the real label data corresponding to the verification result. During the verification process, each participant will have multiple rounds of interaction.
[0073] Among them, the label holder refers to the participant who owns the real label data corresponding to the verification result.
[0074] The technical solution of the disclosed embodiment is to obtain the local basic data set of the federal task by aligning the local samples of the local participants with other samples of other participants in the federal task, and then randomly sort the local basic data set according to the task identification information of the federal task in the blockchain based on the sorting algorithm reached in advance, to obtain the local target data set of the federal task, and then divide the local target data set into a local training set and a local verification set based on the preset model evaluation method, and use the local training set and other training sets of other participants to perform model training to obtain the federal task model, and use the local verification set and other verification sets of other participants to perform model evaluation on the federal task model. The above technical solution makes the training set and verification set random through sample alignment and random sorting, thereby ensuring the reliability of model evaluation.
[0075] Figure 41 is a schematic diagram of a blockchain-based federated processing device according to an embodiment of the present disclosure. This embodiment is applicable to the situation of how to evaluate a model, and is particularly applicable to the situation of how to evaluate a model in a federated learning scenario. The device can be implemented in software and / or hardware, and can be integrated into an electronic device that carries a blockchain-based federated processing function. Figure 4 As shown, the blockchain-based federated processing device 400 of this embodiment may include:
[0076] A basic data set determination module 401 is used to perform sample alignment on a local sample of a local participant and other samples of other participants in a federated task to obtain a local basic data set of the federated task;
[0077] The target data set determination module 402 is used to randomly sort the local basic data set according to the task identification information of the federated task in the blockchain based on the sorting algorithm reached in advance, so as to obtain the local target data set of the federated task;
[0078] The model evaluation module 403 is used to use the local target data set and other target data sets of other participants to perform model evaluation on the federated task.
[0079] The technical solution of the disclosed embodiment is to obtain the local basic data set of the federated task by aligning the local samples of the local participants with other samples of other participants in the federated task, and then randomly sort the local basic data set according to the task identification information of the federated task in the blockchain based on the sorting algorithm reached in advance, to obtain the local target data set of the federated task, and then use the local target data set and other target data sets of other participants to evaluate the model of the federated task. In the above technical solution, in the federated learning scenario, each participant adds random perturbations to the data set in the same way, so that the verification set has randomness, improves the reliability of the model performance evaluation, and aligns the data sets of each participant, avoids data waste, and improves data utilization.
[0080] Furthermore, the target data set determination module 402 includes:
[0081] An evaluation round determining unit, used to determine the evaluation round of the current round of model evaluation when there are at least two rounds of model evaluation;
[0082] The target data set determination unit is used to randomly sort the local basic data set based on the pre-consensus sorting algorithm according to the task identification information and evaluation round of the federated task in the blockchain, and obtain the local target data set of the federated task in this round of model evaluation.
[0083] Furthermore, the target data set determination unit is specifically used for:
[0084] Generate a random seed based on the task identification information and evaluation round of the federated task in the blockchain;
[0085] Create a random number generator using a random seed;
[0086] A random number generator is used to randomly sort the local basic data set.
[0087] Furthermore, the device also includes a task identification determination module, and the task identification determination module is used to:
[0088] Determine task description information of the federated task based on task requirement information of the federated task, local identification information of the local participant and other identification information of other participants;
[0089] Determine summary information of the task description information, and use the summary information as task identification information.
[0090] Furthermore, the model evaluation module 403 is specifically used for:
[0091] Based on the preset model evaluation method, the local target data set is divided into a local training set and a local validation set;
[0092] The local training set and other training sets of other participants are used to train the model to obtain the federated task model;
[0093] Use local validation sets and other validation sets from other participants to evaluate the federated task model;
[0094] Among them, other training sets and other validation sets are obtained by dividing other target data sets based on the model evaluation method.
[0095] Furthermore, the device also includes:
[0096] The task requirement information acquisition module is used to obtain the task requirement information of the federated task from the blockchain;
[0097] The task participation determination module is used to determine whether to participate in the execution of the federated task based on the local samples and local computing power of the local participants;
[0098] The execution participation information sending module is used to send the execution participation message of the federated task to the blockchain network in the case of execution participation, and is used to update the task status of the federated task according to the execution participation message.
[0099] In the technical solution disclosed herein, the acquisition, storage and application of samples involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0100] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
[0101] Figure 5 It is a block diagram of an electronic device used to implement the blockchain-based federated processing method of the embodiment of the present disclosure. Figure 5 A schematic block diagram of an example electronic device 500 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0102] like Figure 5 As shown, the electronic device 500 includes a computing unit 501, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 502 or a computer program loaded from a storage unit 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the electronic device 500 can also be stored. The computing unit 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0103] Multiple components in the electronic device 500 are connected to the I / O interface 505, including: an input unit 506, such as a keyboard, a mouse, etc.; an output unit 507, such as various types of displays, speakers, etc.; a storage unit 508, such as a disk, an optical disk, etc.; and a communication unit 509, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 509 allows the electronic device 500 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0104] The computing unit 501 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 501 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 501 performs the various methods and processes described above, such as a blockchain-based federal processing method. For example, in some embodiments, a blockchain-based federal processing method may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 508. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 500 via the ROM 502 and / or the communication unit 509. When the computer program is loaded into the RAM 503 and executed by the computing unit 501, one or more steps of the blockchain-based federal processing method described above may be performed. Alternatively, in other embodiments, the computing unit 501 may be configured to perform a blockchain-based federal processing method in any other appropriate manner (e.g., by means of firmware).
[0105] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0106] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0107] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0108] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0109] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0110] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.
[0111] Artificial intelligence is a discipline that studies how to use computers to simulate certain human thought processes and intelligent behaviors (such as learning, reasoning, thinking, planning, etc.). It includes both hardware-level and software-level technologies. Artificial intelligence hardware technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, and big data processing; artificial intelligence software technologies mainly include computer vision technology, speech recognition technology, natural language processing technology, machine learning / deep learning technology, big data processing technology, knowledge graph technology, and other major directions.
[0112] Cloud computing refers to a technology system that uses network access to elastically scalable shared physical or virtual resource pools. Resources can include servers, operating systems, networks, software, applications, and storage devices, and can be deployed and managed on demand and in a self-service manner. Cloud computing technology can provide efficient and powerful data processing capabilities for technical applications such as artificial intelligence and blockchain, as well as model training.
[0113] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0114] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A blockchain-based federated processing approach, where: The federated processing method is applied to vertical federated learning, including: Align the local samples of the local participants with other samples of other participants in the federated task to obtain the local basic data set of the federated task; Based on a pre-consensus sorting algorithm, the local basic data set is randomly sorted according to the task identification information of the federated task in the blockchain to obtain a local target data set of the federated task; Using the local target dataset and other target datasets of other participants to perform model evaluation on the federal task; The randomly sorting the local basic data set according to the task identification information of the federated task in the blockchain includes: Generate a random seed according to the task identification information of the federated task in the blockchain and the evaluation round; Creating a random number generator using the random seed; Using the random number generator to randomly sort the local basic data set; The task identification information is information used to uniquely identify a task.
2. The method according to claim 1, wherein: The pre-consensus-based sorting algorithm randomly sorts the local basic data set according to the task identification information of the federated task in the blockchain to obtain the local target data set of the federated task, including: If there are at least two rounds of model evaluation, determine the evaluation round of this round of model evaluation; Based on a pre-consensus sorting algorithm, the local basic data set is randomly sorted according to the task identification information of the federated task in the blockchain and the evaluation round to obtain the local target data set of the federated task in this round of model evaluation.
3. The method according to any one of claims 1 to 2, wherein: The task identification information is determined in the following manner: Determine task description information of the federated task according to task requirement information of the federated task, local identification information of the local participant and other identification information of the other participants; Determine summary information of the task description information, and use the summary information as the task identification information.
4. The method according to claim 1, wherein: The using the local target data set and other target data sets of other participants to perform model evaluation on the federated task includes: Based on a preset model evaluation method, dividing the local target data set into a local training set and a local validation set; The local training set and other training sets of other participants are used to perform model training to obtain a federal task model; Using the local validation set and other validation sets of other participants to perform model evaluation on the federated task model; The other training sets and the other validation sets are obtained by dividing the other target data sets based on the model evaluation method.
5. The method according to claim 1, further comprising: Obtain task requirement information of federated tasks from the blockchain; Determine whether to participate in executing the federal task based on the local samples and local computing power of the local participant; In the case of participating in execution, a participation execution message of the federated task is sent to the blockchain network, so as to update the task status of the federated task according to the participation execution message.
6. A blockchain-based federated processing device, wherein: The federated processing device is applied to vertical federated learning, including: A basic data set determination module is used to perform sample alignment between the local samples of the local participant and other samples of other participants in the federated task to obtain the local basic data set of the federated task; A target data set determination module is used to randomly sort the local basic data set based on a pre-consensus sorting algorithm according to the task identification information of the federated task in the blockchain to obtain a local target data set of the federated task; A model evaluation module, used to use the local target data set and other target data sets of other participants to perform model evaluation on the federated task; The target data set determination module includes a target data set determination unit, which is specifically used to: Generate a random seed according to the task identification information of the federated task in the blockchain and the evaluation round; Creating a random number generator using the random seed; Using the random number generator to randomly sort the local basic data set; The task identification information is information used to uniquely identify a task.
7. The device according to claim 6, wherein: The target data set determination module comprises: An evaluation round determining unit, used to determine the evaluation round of the current round of model evaluation when there are at least two rounds of model evaluation; The target data set determination unit is used to randomly sort the local basic data set based on a pre-consensus sorting algorithm according to the task identification information of the federated task in the blockchain and the evaluation round to obtain the local target data set of the federated task in this round of model evaluation.
8. The device according to any one of claims 6 to 7, wherein: The device also includes a task identification determination module, which is used to: Determine task description information of the federated task according to task requirement information of the federated task, local identification information of the local participant and other identification information of the other participants; Determine summary information of the task description information, and use the summary information as the task identification information.
9. The device according to claim 6, wherein: The model evaluation module is specifically used for: Based on a preset model evaluation method, dividing the local target data set into a local training set and a local validation set; The local training set and other training sets of other participants are used to perform model training to obtain a federal task model; Using the local validation set and other validation sets of other participants to perform model evaluation on the federated task model; The other training sets and the other validation sets are obtained by dividing the other target data sets based on the model evaluation method.
10. The device according to claim 6, further comprising: The task requirement information acquisition module is used to obtain the task requirement information of the federated task from the blockchain; A task participation determination module, used to determine whether to participate in executing the federated task according to the local samples and local computing power of the local participants; The execution participation information sending module is used to send the execution participation message of the federated task to the blockchain network in the case of execution participation, and to update the task status of the federated task according to the execution participation message.
11. An electronic device, comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the blockchain-based federated processing method described in any one of claims 1 to 5.
12. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause a computer to execute a blockchain-based federated processing method according to any one of claims 1-5.
13. A computer program product, comprising a computer program, which, when executed by a processor, implements the blockchain-based federated processing method according to any one of claims 1-5.