A Method and Device for Processing Drilling Rig Data Based on Federated Learning and Blockchain

By adopting the three-layer verification process of federated learning and blockchain technology in the data processing of subsea drilling rigs, the problems of data security and privacy protection are solved, and efficient and secure processing and storage of subsea drilling rigs are achieved.

CN120068092BActive Publication Date: 2025-07-01HUNAN UNIV OF SCI & TECH SANYA RES INST
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510526959.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-04-25
Publication Date
2025-07-01
Estimated Expiration
2045-04-25

AI Technical Summary

Technical Problem

During the data processing of subsea drilling rigs, data security and privacy protection issues have not been effectively solved, making it difficult to achieve efficient model training and optimization while ensuring data privacy and security.

Method used

Using a method based on federated learning and blockchain, a three-layer verification process is carried out by introducing verification roles and leadership nodes as blockchain nodes: initial verification of local model parameters of the drilling rig node, re-verification and verification of global model parameters generated by the leadership node to ensure data security and privacy protection.

Benefits of technology

Blockchain technology ensures the security of the data of the submarine drilling rig, prevents potential malicious behaviors of rig nodes, verification nodes and leadership nodes, and improves the overall security and reliability of the data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120068092B_ABST
    Figure CN120068092B_ABST
Patent Text Reader

Abstract

The present application relates to a method and device for processing drill rig data based on federated learning and blockchain. In this method, verification roles and leader nodes are introduced as blockchain nodes. The verification nodes verify the local model parameters uploaded by the drill rig nodes, which can prevent potential malicious behaviors of the drill rig nodes. In addition, the mutual restraint among the verification nodes is used to prevent potential malicious behaviors of the verification nodes with respect to the local model parameters. Finally, the next global model parameters generated by the leader node are also verified, which can prevent potential malicious behaviors of the leader node with respect to the content of the published block. This method uses blockchain technology to realize the uploading and storage of the model parameters of the federated learning participated by the drill rig nodes using their respective subsea drill rig data. Moreover, through the above three-layer verification mechanism, the security of the subsea drill rig data can be effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the technical field of subsea drill data processing, and in particular to a drill data processing method and device based on federated learning and blockchain. Background Art

[0002] In an intelligent subsea drill optimization system, the subsea drill and related equipment generate a large amount of real-time data, which involves various important parameters during the drilling process (such as weight on bit, rotary speed, torque, mud flow rate, vibration, etc.). By deeply processing and analyzing the collected raw data through machine learning model technology, more accurate and efficient data utilization can be achieved, effectively improving the drill efficiency, extending the equipment life, reducing unplanned downtime, and lowering the overall operating cost. However, in the process of processing drill data, some challenges are still faced, especially the issues of data security and privacy protection have not been effectively solved. Therefore, how to achieve efficient model training and optimization on the premise of ensuring data privacy and security has become a difficult problem to be solved urgently in the field of subsea drilling. Summary of the Invention

[0003] The following is an overview of the subject matter described in detail in this article. This overview is not intended to limit the scope of protection of the claims.

[0004] The main purpose of the embodiments of the present application is to propose a drill data processing method and device based on federated learning and blockchain.

[0005] To achieve the above object, a first aspect of the embodiments of the present application provides a drill data processing method based on federated learning and blockchain, which is applied to a first verification node in a drill data processing system. The drill data processing system includes: a leader node, a plurality of verification nodes, and a plurality of drill nodes; the first verification node is any one of the verification nodes; both the leader node and the verification node are blockchain nodes;

[0006] The method includes:

[0007] Receiving local model parameters obtained by a first drill node training a local model based on current global model parameters and local data of the first drill node; wherein, the first drill node is the drill node that maintains a communication connection with the first verification node;

[0008] Perform an initial verification on the local model parameters of the first drilling rig node based on the current global model parameters. After the initial verification passes, send the local model parameters of the first drilling rig node to at least one second verification node, so that the at least one second verification node performs a re-verification on the local model parameters of the first drilling rig node based on the current global model parameters. After the re-verification passes, upload the local model parameters of the first drilling rig node to the blockchain; the second verification node is the remaining verification nodes among the multiple verification nodes other than the first verification node;

[0009] Send the local model parameters of the first drilling rig node to the current leader node, so that the current leader node updates the global model based on the received local model parameters corresponding to the drilling rig nodes to obtain the next global model parameters; verify the next global model parameters, and after the verification passes, make the current leader node package the local model parameters and the next global model parameters into a transaction and publish it in the block of the blockchain; wherein, the received local model parameters corresponding to the drilling rig nodes at least include the local model parameters of the first drilling rig node.

[0010] A method for processing drilling rig data based on federated learning and blockchain provided by this application has at least the following beneficial effects:

[0011] This method uses blockchain technology to realize the upload and storage of the model parameters of federated learning, ensuring the security of subsea drilling rig data; this method also introduces verification roles and leader nodes as blockchain nodes. The verification nodes verify the local model parameters uploaded by the corresponding drilling rig nodes, effectively preventing potential malicious behaviors of the drilling rig nodes, and also effectively preventing malicious behavior operations of the verification nodes on the local model parameters through the mutual restraint between the verification roles. Only after both verifications pass is the verification node allowed to go on-chain; finally, the generation of the next global model parameters by the leader node is also verified, effectively preventing potential malicious behaviors of the leader node on the local model parameters. Only after the verification passes is the next global model parameter reasonable data and is also allowed to be stored on-chain; through the above three-layer verification process, the security of subsea drilling rig data can be improved.

[0012] In some embodiments, the step of sending the local model parameters of the first drilling rig node to the current leader node, so that the current leader node updates the global model based on the received local model parameters corresponding to the drilling rig nodes to obtain the next global model parameters; verify the next global model parameters, and after the verification passes, make the current leader node package the local model parameters and the next global model parameters into a transaction and publish it in the block of the blockchain includes:

[0013] When the current leader node has completed the release of a preset number of blocks in the blockchain, determine candidate leader nodes; wherein, the candidate leader nodes are the verification nodes selected from the multiple verification nodes;

[0014] Send the local model parameters of the first drilling rig node to the current leader node, so that the current leader node generates a set of local model parameters; wherein, the set of local model parameters includes the local model parameters corresponding to the received drilling rig nodes, and the local model parameters of the received drilling rig nodes at least include the local model parameters of the first drilling rig node;

[0015] Receive the first broadcast message from the current leader node; wherein, the first broadcast message at least includes the set of local model parameters, the next global model parameters obtained by the current leader node based on the set of local model parameters and using an asynchronous method to update the global model, and the information to be verified of the candidate leader nodes;

[0016] Update the global model based on the set of local model parameters to obtain the global model parameters to be verified, verify the next global model parameters based on the global model parameters to be verified, and verify the information to be verified of the candidate leader nodes, and after both verifications pass, broadcast a verification passed message to the current leader node;

[0017] When receiving the second broadcast message from the current leader node, use the candidate leader node as the leader node for the next block release in the blockchain, and make the current leader node package the local model parameters of the first drilling rig node and the next global model parameters into a transaction and release it in the block of the blockchain; wherein, the second broadcast message includes the verification passed messages of a preset number of the verification nodes.

[0018] In some embodiments, the current leader node updates the global model based on the local model parameters corresponding to the received drilling rig nodes to obtain the next global model parameters, including:

[0019] The current leader node determines the sample weight of the local data of the first drilling rig node and determines the training time for generating the local model parameters of the first drilling rig node;

[0020] The current leader node determines the aggregation weight of the first drilling rig node participating in model aggregation based on the sample weight and the training time;

[0021] The current leading node updates the global model asynchronously based on the aggregated weights corresponding to the received drilling rig nodes and the corresponding local model parameters to obtain the next global model parameters.

[0022] In some embodiments, the calculation formula for the aggregated weight of the first drilling rig node includes:

[0023] ;

[0024] ;

[0025] where is the aggregated weight of the first drilling rig node, is a hyperparameter, is the sample weight of the first drilling rig node, is the training time of the first drilling rig node, is the number of drilling rig nodes participating in the global model aggregation; is the base number determining the attenuation rate.

[0026] In some embodiments, the initial verification of the local model parameters of the first drilling rig node based on the current global model parameters includes:

[0027] Training the local model parameters of the first drilling rig node based on the local data of the first verification node to obtain the local model parameters to be verified;

[0028] Calculating the similarity between the current global model parameters and the local model parameters to be verified;

[0029] In the case where the similarity is less than the threshold, the initial verification passes.

[0030] In some embodiments, the calculation method of the similarity includes:

[0031] ;

[0032] where is the local model parameter to be verified, is the current global model parameter, is the parameter index, is the dimension of the global model, is the similarity.

[0033] In some embodiments, the second verification node re-verifies the local model parameters of the first drilling rig node based on the current global model parameters, including:

[0034] The second verification node trains the local model parameters of the first drilling rig node based on the local data of the second verification node to obtain local model parameters to be verified;

[0035] The second verification node calculates the similarity between the current global model parameters and the local model parameters to be verified;

[0036] When the similarity is less than the threshold, the second verification node passes the verification again.

[0037] To achieve the above object, a second aspect of the embodiments of the present application provides a drilling rig data processing device based on federated learning and blockchain. The device includes:

[0038] A data receiving module, configured to receive the local model parameters obtained by the first drilling rig node in the drilling rig data processing system through training the local model based on the current global model parameters and the local data of the first drilling rig node; wherein, the drilling rig data processing system includes: a leader node, a plurality of verification nodes, and a plurality of drilling rig nodes; both the leader node and the verification nodes are blockchain nodes;

[0039] A data verification module, configured to initially verify the local model parameters of the first drilling rig node based on the current global model parameters, and after the initial verification passes, send the local model parameters of the first drilling rig node to at least one second verification node, so as to perform a re-verification on the local model parameters of the first drilling rig node by the at least one second verification node based on the current global model parameters, and after the re-verification passes, upload the local model parameters of the first drilling rig node to the blockchain; the second verification node is the remaining verification nodes among the plurality of verification nodes except the first verification node;

[0040] A data uploading module, configured to send the local model parameters of the first drilling rig node to the current leader node, so that the current leader node updates the global model based on the local model parameters corresponding to the received drilling rig nodes to obtain the next-step global model parameters; verify the next-step global model parameters, and after the verification passes, enable the current leader node to package the local model parameters and the next-step global model parameters into a transaction and publish it in the block of the blockchain; wherein, the local model parameters corresponding to the received drilling rig nodes at least include the local model parameters of the first drilling rig node.

[0041] To achieve the above object, a third aspect of the embodiments of the present application provides an electronic device, including: at least one control processor and a memory communicatively connected to the at least one control processor; the memory stores instructions executable by the at least one control processor, and when the instructions are executed by the at least one control processor, the at least one control processor is enabled to execute the above-described method for processing drilling rig data based on federated learning and blockchain.

[0042] To achieve the above object, a fourth aspect of the embodiments of the present application provides a computer-readable storage medium storing computer-executable instructions for causing a computer to execute the above-described method for processing drilling rig data based on federated learning and blockchain.

[0043] It can be understood that the beneficial effects of the above second to fourth aspects compared with the related art are the same as those of the above first aspect compared with the related art. For relevant descriptions, reference can be made to the relevant descriptions in the above first aspect, and details will not be elaborated herein. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] To more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the embodiments or the related art descriptions. Obviously, the following-described drawings are only some embodiments of the embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0045] Figure 1 is a schematic flowchart of an embodiment of the method for processing drilling rig data based on federated learning and blockchain provided by the present application;

[0046] Figure 2 is a schematic diagram of an embodiment of the drilling rig data processing system provided by the present application;

[0047] Figure 3 is a schematic structural diagram of an embodiment of the device for processing drilling rig data based on federated learning and blockchain provided by the present application;

[0048] Figure 4 is a schematic structural diagram of an embodiment of the electronic device provided by the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0049] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0050] As Figure 1, this application provides an embodiment, that is, a method for processing drilling rig data based on federated learning and blockchain. This method is applied to the first verification node in the drilling rig data processing system, where the drilling rig data processing system includes:

[0051] 1) Multiple drilling rig nodes, each drilling rig node has a local model and local data. The drilling rig node can obtain the latest global model parameters from the nearest (mutually connected) verification node. The drilling rig node can also train locally based on the local data and global model parameters to obtain local model parameters, and upload the local model parameters to the nearest verification node.

[0052] 2) Multiple verification nodes, the verification nodes are connected to the drilling rig nodes and the leader node, and the multiple verification nodes are interconnected. The verification node can receive the latest global model parameters from the leader node and distribute the latest global model parameters to the corresponding drilling rig nodes, and can receive the local model parameters uploaded by the corresponding drilling rig nodes, verify the local model parameters, verify the local model parameters received by other verifiers, and upload the verified local model parameters to the chain; the first verification node is any one of the nodes.

[0053] 3) Leader node, the leader node has a global model. The leader node selects a verification node from multiple verification nodes to generate, which is used to verify the local model parameters uploaded by the verification node, and, update the global model asynchronously to obtain new global model parameters, and distribute the new global model parameters to the corresponding verification nodes, and, upload the uploaded local model parameters and the new global model parameters to the chain

[0054] The method for processing drilling rig data based on federated learning and blockchain includes the following steps S110 to S130:

[0055] Step S110, the first verification node receives the local model parameters obtained by the first drilling rig node training the local model based on the current global model parameters and the local data of the first drilling rig node.

[0056] In this step, the first drilling rig node is the drilling rig node that maintains a communication connection with the first verification node. The current global model parameters are the parameters obtained from training the global model. Assuming that the global model needs to be trained rounds, then the current global model can be the global model parameters obtained after the round of training. Step S110 describes the preliminary process of the round of training. The first drilling rig node has local data and a local model, and can train the local model through the current global model parameters and local data to obtain local model parameters.

[0057] It should be noted that the global model parameters are obtained based on the model training in the leader node. Then, the first drilling rig node can obtain (download) the current global model parameters from the leader node or from the first verification node. Here, the first verification node obtains them from the leader node.

[0058] Step S120: The first verification node initially verifies the local model parameters of the first drilling rig node based on the current global model parameters. After the initial verification passes, it sends the local model parameters of the first drilling rig node to at least one second verification node, so that at least one second verification node can re-verify the local model parameters of the first drilling rig node based on the current global model parameters. After the re-verification passes, the local model parameters of the first drilling rig node are uploaded to the blockchain.

[0059] In this step, two verification processes are added:

[0060] To prevent the first drilling rig node from being a malicious node and performing malicious operations (such as tampering) on the data, the first verification process is added, that is, the first verification node initially verifies the local model parameters of the first drilling rig node based on the current global model parameters. After the first verification node verifies the data, it can be determined whether the first drilling rig node performs malicious operations on the data.

[0061] To prevent the first verification node from being a malicious node and performing malicious operations on the data, the second verification process is added, that is, the first verification node sends the local model parameters of the first drilling rig node to at least one second verification node, so that at least one second verification node can re-verify the local model parameters of the first drilling rig node based on the current global model parameters. After the second verification node verifies the data, only after the verification passes can the first verification node publish the local model parameters of the first drilling rig node to the blockchain.

[0062] Whether it is the first verification or the second verification, the verification node has the current global model parameters. Then, relevant data and the current global model parameters can be used for similar training to obtain relevant parameters. Furthermore, the relevant parameters and the verification object (that is, the local model parameters of the first drilling rig node) are compared, and then based on the comparison result, it is determined whether there are malicious behaviors such as tampering.

[0063] In some embodiments, the second verification process is verified by at least one second verification node. The more second verification nodes there are, the higher the reliability of the verification. Moreover, only after at least one second verification node re-verifies the local model parameters of the first drilling rig node based on the current global model parameters and the re-verification passes, is the first verification node allowed to upload the local model parameters of the first drilling rig node.

[0064] In some embodiments, the first verification node packages the local model parameters of the first drilling rig node into a transaction and then uploads it to the blockchain. After uploading, the data will be securely stored, and the type of blockchain is not specifically limited here.

[0065] Step S130: The first verification node sends the local model parameters of the first drilling rig node to the current leader node, so that the current leader node updates the global model based on the received local model parameters corresponding to the drilling rig node to obtain the next global model parameters.

[0066] In addition, the first verification node verifies the next global model parameters, and after the verification passes, it enables the current leader node to package the local model parameters and the next global model parameters into a transaction and publish it in the block of the blockchain.

[0067] In this step, the leader node has a global model, which can update the global model using the received data to obtain the latest global model parameters. The leader node is composed of one node selected from multiple verification nodes. In this embodiment, any verification node can be used as the leader node. Therefore, the current leader node refers to the leader node in the current training round, and the leader node can be replaced. The leader node can also upload the latest global model parameters to the blockchain for storage.

[0068] The leader node can adopt synchronous or asynchronous model aggregation methods. Of course, as a preference, the asynchronous method can be used for model aggregation because due to various reasons such as the environment, the leader node cannot receive the local model parameters of all drilling rig nodes every time. Therefore, using asynchronous aggregation is more in line with the actual situation.

[0069] Moreover, after the leader node updates the global model based on the received local model parameters corresponding to the drilling rig node to obtain the next global model parameters, it also verifies the next global model parameters to avoid the risk that the leader node is a malicious node.

[0070] The method for processing drilling rig data based on federated learning and blockchain provided in this embodiment has at least the following beneficial effects:

[0071] This method uses blockchain technology to achieve the uploading and storage of the model parameters of federated learning, ensuring the security of the data of subsea drills. This method also introduces verification roles and leader nodes as blockchain nodes. The verification nodes verify the local model parameters uploaded by the corresponding drill nodes, effectively preventing potential malicious behaviors of the drill nodes. It also effectively prevents malicious operations of the verification nodes on the local model parameters through the mutual restraint between the verification roles. Only after passing the verification twice is the verification node allowed to upload to the chain. Finally, the leader node generates the verification of the next global model parameters, effectively preventing potential malicious behaviors of the leader node on the local model parameters. Only after passing the verification, the next global model parameters are reasonable data and are also allowed to be uploaded and stored. Through the above three-layer verification process, the security of the data of subsea drills can be improved.

[0072] Further, the content in step S130 includes the following steps S310 to S350:

[0073] Step S310, when the current leader node has completed the release of a preset number of blocks in the blockchain, determine candidate leader nodes; among them, the candidate leader nodes are verification nodes selected from multiple verification nodes.

[0074] To ensure the security of the data, during the entire training process of the global model, the leader node is not fixed, but any one of the multiple verification nodes may become the leader node.

[0075] Therefore, in this embodiment, it can be set that each leader node only processes the release of a preset number of blocks. When the previous leader node has completed the release of a preset number of blocks in the blockchain, the leader node can be replaced, so as to ensure the activity of the leader node.

[0076] In addition, in steps S310 to S350, the selection process of the next leader node and the verification of the next global model parameters of the current leader node are carried out simultaneously.

[0077] It should be noted that if a leader node has not completed the release of a preset number of blocks, there is no need to select the next leader node. However, regardless of whether the selection of the next leader node is involved, before the current leader node uploads the global model parameters aggregated by the model to the chain, verification is required.

[0078] Step S320, send the local model parameters of the first drill node to the current leader node, so that the current leader node generates a local model parameter set; among them, the local model parameter set includes the local model parameters corresponding to the received drill nodes, and the local model parameters of the received drill nodes at least include the local model parameters of the first drill node.

[0079] In steps S310 to S350, the leader node aggregates model parameters asynchronously. Therefore, during the current training process, the candidate leader node may receive the local model parameters of the corresponding drilling rig nodes sent by multiple verification nodes. After the candidate leader node receives the local model parameters of the first drilling rig node sent by the first verification node, it can organize all the received local model parameters to form a data set. The role of the data set is to conduct a public broadcast so that the verification nodes can verify the next global model parameters based on the data.

[0080] Step S330: Receive the first broadcast message from the current leader node; wherein, the first broadcast message at least includes a set of local model parameters, the next global model parameters obtained by the current leader node by asynchronously updating the global model based on the set of local model parameters, and the information to be verified of the candidate leader node.

[0081] Step S340: Update the global model based on the set of local model parameters to obtain the global model parameters to be verified, verify the next global model parameters based on the global model parameters to be verified, and verify the information to be verified of the candidate leader node. After both verifications pass, broadcast a verification passed message to the current leader node.

[0082] Of course, as one of the verification nodes, the first verification node will update the global model based on the set of local model parameters in the broadcast to obtain the global model parameters to be verified, and verify the next global model parameters based on the global model parameters to be verified, that is, whether the global model parameters to be verified generated by the first verification node are consistent with the next global model parameters generated by the candidate node. Only when they are consistent can it be proved that the current leader node has no potential malicious behavior.

[0083] In addition, the information to be verified of the candidate leader node includes but is not limited to the following: whether the signature of the candidate leader node is correct, whether the ID of the candidate leader node is correct, etc.

[0084] Step S350: In the case of receiving the second broadcast message from the current leader node, use the candidate leader node as the leader node for publishing the next block in the blockchain, and make the current leader node package the local model parameters of the first drilling rig node and the next global model parameters into a transaction and publish it in the block of the blockchain; wherein, the second broadcast message includes the verification passed messages of a preset number of verification nodes.

[0085] It should be noted that the verification nodes for verifying the next global model parameters generated by the current leader node and the information to be verified of the candidate leader nodes can be more than just the first verification node. There are other verification nodes that jointly conduct the verification. Only when a preset number of verification nodes have all verified and the verification is passed, will the current leader node broadcast the message of successful verification, thereby informing all verification nodes. Therefore, for the first verification node, the current leader node can package the local model parameters of the first drilling rig node and the next global model parameters into a transaction and publish it in the block of the blockchain.

[0086] In steps S310 to S350 provided in the embodiment, each leader node will be replaced after generating a number of new blocks. A new leader node will be selected from the verification nodes, which reduces the probability that the leader node will act maliciously. In addition, appropriately updating the leader node can enhance the reliability of the overall system and improve the applicability of the global model. Moreover, the selection process of the candidate leader node and the verification of the next global model parameters generated by the current leader node are carried out simultaneously, which can improve the block publishing efficiency while reducing the probability of the current leader acting maliciously.

[0087] Further, the current leader node in step S120 updates the global model based on the local model parameters corresponding to the received drilling rig nodes to obtain the next global model parameters, including the following steps S210 to S230:

[0088] Step S210, the current leader node determines the sample weight of the local data of the first drilling rig node and determines the training time for generating the local model parameters of the first drilling rig node.

[0089] Step S220, the current leader node determines the aggregation weight of the first drilling rig node participating in model aggregation based on the sample weight and the training time.

[0090] Step S230, the current leader node updates the global model asynchronously based on the aggregation weights corresponding to a number of drilling rig nodes and the corresponding local model parameters to obtain the next global model parameters.

[0091] In some embodiments, the sample weight of the local data of the first drilling rig node refers to the proportion of the local data of the first drilling rig node in the local data of all drilling rig nodes. The training time of the local model parameters of the first drilling rig node can be the difference between the moment when the drilling rig node downloads the latest global model and the moment when the drilling rig node uploads the local model parameters.

[0092] The current leading node determines the aggregation weight for the first drilling rig node to participate in model aggregation based on sample weights and training time, and then updates the global model asynchronously based on the aggregation weights corresponding to a number of drilling rig nodes and their corresponding local model parameters to obtain the global model parameters for the next step.

[0093] In this embodiment, appropriate weights are assigned based on the data volume of the training model (measured by the sample weights of local data) and obsolescence (measured by the generated training time), while eliminating the waiting time limit for federated learning aggregation and reducing the overall time cost of training.

[0094] Further, the initial verification of the local model parameters of the first drilling rig node based on the current global model parameters in step S120 includes:

[0095] Training the local model parameters of the first drilling rig node based on the local data of the first verification node to obtain the local model parameters to be verified;

[0096] Calculating the similarity between the current global model parameters and the local model parameters to be verified;

[0097] In the case where the similarity is less than the threshold, the initial verification passes.

[0098] Further, the second verification node in step S120 performs a re-verification of the local model parameters of the first drilling rig node based on the current global model parameters, including:

[0099] The second verification node trains the local model parameters of the first drilling rig node based on the local data of the second verification node to obtain the local model parameters to be verified;

[0100] The second verification node calculates the similarity between the current global model parameters and the local model parameters to be verified;

[0101] In the case where the similarity is less than the threshold, the second verification node's re-verification passes.

[0102] Whether it is the initial verification process or the re-verification process, the corresponding verification node can train the local model parameters based on local data to obtain the local model parameters to be verified, and then compare the similarity between the local model parameters to be verified and the received current global model parameters. Only when the similarity is within the threshold range is it considered to pass the verification.

[0103] As Figure 2 , for ease of understanding, an embodiment is provided, namely a method for processing drilling rig data based on federated learning and blockchain.

[0104] This method is applied in a drilling rig data processing system, and the system has:

[0105] The drilling rig data processing system consists of a leader node , a drilling rig node , and a verification node . The verification node and the leader node are both sea trial bases. Since sea trial bases are usually connected to high-speed networks, they have strong computing and storage capabilities. It should be noted that the data collected by the drilling rig node follows the independent and identically distributed (IID) principle.

[0106] In the round of federated learning process, first, the drilling rig node completes local model updates according to the current global model parameters obtained from the nearby verification node , and uploads the trained local model parameters to the verification node .

[0107] The verification node uses the local data of the verification node to verify the received local model parameters. After parallel verification by other verification nodes, the local model parameters are packaged into a transaction and sent to the blockchain.

[0108] The leader node is responsible for aggregating all legal parameters (such as all local model parameters received by the leader node that have not been maliciously processed) asynchronously to update the global model and create a new block , and records the transaction in this block.

[0109] The verification node verifies the block and reaches a consensus, and the new block will be added to the chain.

[0110] The drilling rig nodes that uploaded local models in the previous round receive the latest round of global model parameters to perform the next round of training, while the drilling rig nodes that did not upload local models in the previous round continue the previous training.

[0111] To eliminate the waiting time limit of synchronous aggregation in the dynamically changing drilling rig working environment, this embodiment adopts an asynchronous method for model aggregation. Local model verification is performed before aggregation, and appropriate weights are assigned according to the data volume and obsolescence of the training model during aggregation (see the introduction of subsequent embodiments for details) to improve the convergence speed of federated learning. In addition, the two processes of leader node selection and block verification are combined (see the introduction of subsequent embodiments for details), which reduces the probability of the leader node acting maliciously while improving the block publishing efficiency. The following is a detailed introduction:

[0112] In the In the global model training of the rounds, the rig node has a local data .

[0113] The goal of local training is to minimize the loss function , where is the local model parameter of the rig node .

[0114] The rig node uses the local data and the current global model parameters to train the local model, and its local model update is expressed as:

[0115] ;

[0116] where is the learning rate.

[0117] The verification node receives the local model parameters from the rig node and then uses its own local data to retrain the received local model parameters to obtain for evaluating its performance.

[0118] In this embodiment, the Euclidean metric formula is used to determine the correlation between the model parameters retrained by the verification node and the current latest global model :

[0119] ;

[0120] is the dimension of the model parameters, is the specific parameter index.

[0121] Here, a distance threshold is set, and , if the obtained Euclidean distance , it is considered that the local model parameters are highly correlated with the current global model update, that is, the verification node accepts this model update. After parallel verification by other verification nodes, the verification node packs the local model parameters into a transaction and sends it to the blockchain.

[0122] If , the verification node Rejects this local model update.

[0123] The sample weight represents the proportion of samples owned by a node among the total number of all learning nodes. In the round of training, the drill node 's sample weight is calculated by the ratio of the number of samples it owns to the total number of samples . The time for the drill node to perform local training is calculated by , where represents the moment when the latest global model in the round is downloaded, and represents the moment when the local model parameters in the round of global training are uploaded.

[0124] The model obsolescence reflects the computing power of the node to a certain extent. To ensure that nodes with a larger obsolescence have a smaller model weight and the decay process is relatively flat, an exponential function with a base less than 1 is selected here as the decay function of the model weight. The model obsolescence is expressed as:

[0125] ;

[0126] Among them, represents the current number of drill nodes participating in training, and is the base of the exponential function that determines the decay rate. When the exponential part is greater than zero, the model weight decreases as the exponential value increases, and is selected in the range of (0, 1).

[0127] In summary, the weight of the local model parameters uploaded by the drill node in the round of global aggregation is expressed as:

[0128] ;

[0129] Among them, is a hyperparameter representing the initial weight of the new local model in the global model. The current global model update is expressed as:

[0130] ;

[0131] In this embodiment, the current leader node will be replaced after generating several new blocks, and the system will select a new leader node from the verification nodes to reduce the probability that the leader node will act maliciously.

[0132] The following provides a set of pseudocode:

[0133] Table 1

[0134]

[0135] The consensus mechanism of the blockchain ensures that the block copies on all nodes are consistent with the original block. The verification node obtains the identity of the initial leader node by calculating where is the total number of verification nodes participating in federated learning, and is the genesis block. For example , then is elected as the publisher of the subsequent several blocks and is responsible for aggregating and generating the subsequent global model. The selection of each subsequent leader is also carried out through this formula; after the current leader node publishes a certain number of blocks, the current ID of the new leader node (i.e., the next leader node) is obtained using the same modulo operation, and whether it can become the new leader node needs to be verified by other verification nodes, and this process will be carried out simultaneously with the verification of the block content.

[0136] The election frequency of the current leader node is set to the reciprocal of the number of blocks to wait before electing a leader node. Assuming , this means that as long as 10 blocks are appended to the blockchain, a new leader node is elected in the same way. If is successfully elected as the new leader node, then is responsible for generating the global model from to .

[0137] The current leader node broadcasts the generated block to the set of verification nodes. The block content includes local model parameters, global model parameters, the current ID of the new leader node, etc. The verification rules are as follows:

[0138] 1) Whether the signature of the leader node is correct.

[0139] 2) Whether the current ID of the new leader node exists in the set of verification nodes.

[0140] 3) Whether the block message has been received before.

[0141] 4) Whether the block height in the message is consistent with the block height of this node.

[0142] 5) Whether the local model parameters are maliciously tampered with by the leader node.

[0143] 6) Whether the global model parameters are correctly calculated from the local model parameters within the block.

[0144] Only the block messages that meet the above conditions will be recognized by the verification nodes.

[0145] When the verification node recognizes that the received block message is valid, the verification node will enter the preparation state, encapsulate the preparation message and sign it. The preparation message will continue to be broadcast to the remaining verification nodes. When the cumulative number of successful verifications reaches (where the symbol represents the ceiling operation), the verification node will enter the submission state, then encapsulate and sign the confirmation message. Similarly, when the number of confirmation messages reaches the message is verified, and the verification result will be returned to the leader node that produced the block, indicating that the block can be uploaded to the blockchain, and a new leader node is selected to be responsible for publishing a certain number of subsequent blocks.

[0146] The following provides the pseudocode:

[0147] Table 2

[0148]

[0149] The method of this embodiment has at least the following beneficial effects:

[0150] (1) This method uses blockchain technology to realize the uploading and storage of the model parameters of federated learning, ensuring the security of the data of the subsea drill.

[0151] (2) The mechanism to prevent node misbehavior:

[0152] To prevent the drill nodes from uploading malicious model parameters, the verification nodes compare the local model parameters just uploaded by the drill nodes with the current global model parameters in terms of Euclidean distance. If the distance is within the threshold range, the verification passes, and the local model parameters are packaged as a transaction and sent to the blockchain network; otherwise, the model parameters are directly excluded from uploading.

[0153] To prevent a certain verification node from maliciously acting on data, other verification nodes take out the local model parameters in the transaction and also compare them with the current latest global model parameters in terms of Euclidean distance. After parallel verification by multiple verification nodes, if the distance is within the threshold range, it indicates that the verification node has no malicious local model parameters.

[0154] To prevent the leader node from acting maliciously, first, a leader node is selected from the verification nodes through a random algorithm to reduce the probability of the leader node acting maliciously. After aggregating the model, the leader node is responsible for publishing the block, and at this time, the block needs to be consensus-reached by the verification nodes before it can be added to the blockchain. Second, the verification nodes need to verify the block published in this round to prevent the leader node from acting maliciously. They download the local model parameters participating in the aggregation this time and the global model parameters recorded in the previous block from the transaction records on the blockchain. Finally, if the result of the global model parameters calculated is the same as the global model parameters in the block to be published, the verification passes, and the leader node can publish the block; otherwise, the block will not be published.

[0155] (3) During the process of global model aggregation, appropriate weights are assigned according to the data volume and obsolescence of the training model, eliminating the waiting time limit of federated learning synchronous aggregation while reducing the overall time cost of training.

[0156] Experiments have proved that the above-mentioned drilling rig data processing system significantly improves the learning efficiency, and at the same time, due to blockchain communication, an acceptable additional time cost is generated. Its efficient asynchronous method and blockchain anti-tampering mechanism improve security and reliability, reduce the total time cost, and demonstrate a strong ability to prevent malicious behavior, ensuring the robustness of the system.

[0157] As Figure 3 shown, an embodiment of the present application provides a drilling rig data processing device based on federated learning and blockchain. The device includes:

[0158] The data receiving module 1100 is used to receive the local model parameters obtained by the first drilling rig node in the drilling rig data processing system through training the local model based on the current global model parameters and the local data of the first drilling rig node; wherein, the drilling rig data processing system includes: a leader node, multiple verification nodes, and multiple drilling rig nodes; both the leader node and the verification nodes are blockchain nodes;

[0159] The data verification module 1200 is used to initially verify the local model parameters of the first drilling rig node based on the current global model parameters, and after the initial verification passes, send the local model parameters of the first drilling rig node to at least one second verification node to re-verify the local model parameters of the first drilling rig node based on the current global model parameters through at least one second verification node, and after the re-verification passes, upload the local model parameters of the first drilling rig node to the blockchain; the second verification node is the remaining verification nodes among the multiple verification nodes except the first verification node;

[0160] The data upload module 1300 is used to send the local model parameters of the first drilling rig node to the current leading node, so that the current leading node updates the global model based on the received local model parameters corresponding to the drilling rig nodes to obtain the next-step global model parameters; verify the next-step global model parameters, and after the verification passes, enable the current leading node to package the local model parameters and the next-step global model parameters into a transaction and publish it in the block of the blockchain; where the received local model parameters corresponding to the drilling rig nodes at least include the local model parameters of the first drilling rig node.

[0161] It should be noted that the drilling rig data processing device based on federated learning and blockchain provided in this embodiment is based on the same inventive concept as the above-mentioned drilling rig data processing method based on federated learning and blockchain. Therefore, the relevant content of the above-mentioned drilling rig data processing method based on federated learning and blockchain also applies to the content of the drilling rig data processing device based on federated learning and blockchain. Therefore, it will not be elaborated here.

[0162] Such as Figure 4 , this application embodiment also provides an electronic device, which includes:

[0163] At least one memory;

[0164] At least one processor;

[0165] At least one program;

[0166] The program is stored in the memory, and the processor executes at least one program to implement the above-mentioned drilling rig data processing method based on federated learning and blockchain in this disclosure.

[0167] The electronic device can be any intelligent terminal including a mobile phone, a tablet computer, a personal digital assistant (PDA), an in-vehicle computer, etc.

[0168] The electronic device of this application embodiment will be introduced in detail below.

[0169] The processor 1600 can be implemented by using a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, etc., and is used to execute relevant programs to implement the technical solutions provided in this application embodiment.

[0170] The memory 1700 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM), etc. The memory 1700 can store an operating system and other application programs. When implementing the technical solutions provided in the embodiments of this specification through software or firmware, the relevant program codes are stored in the memory 1700 and are called by the processor 1600 to execute the method for processing drilling rig data based on federated learning and blockchain in the embodiments of this application.

[0171] The input / output interface 1800 is used to implement information input and output;

[0172] The communication interface 1900 is used to implement communication interaction between this device and other devices. It can achieve communication through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).

[0173] The bus 2000 transmits information between various components of the device (such as the processor 1600, the memory 1700, the input / output interface 1800, and the communication interface 1900).

[0174] Among them, the processor 1600, the memory 1700, the input / output interface 1800, and the communication interface 1900 are communicatively connected to each other inside the device through the bus 2000.

[0175] The embodiments of this application also provide a storage medium, which is a computer-readable storage medium. The computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to cause a computer to execute the above-mentioned method for processing drilling rig data based on federated learning and blockchain.

[0176] As a non-transitory computer-readable storage medium, the memory can be used to store non-transitory software programs and non-transitory computer-executable programs. In addition, the memory can include high-speed random access memory, and can also include non-transitory memory, such as at least one disk storage device, a flash memory device, or other non-transitory solid-state storage devices.

[0177] In some embodiments, the memory optionally includes a memory remotely set relative to the processor, and these remote memories can be connected to the processor through a network. Examples of the above networks include, but are not limited to, the Internet, an enterprise intranet, a local area network, a mobile communication network, and combinations thereof.

[0178] The embodiments described in this application are for more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided by the embodiments of this application. As those skilled in the art know, with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of this application are equally applicable to similar technical problems.

[0179] Those skilled in the art can understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of this application, and may include more or fewer steps than those shown in the figures, or combine certain steps, or different steps.

[0180] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated, that is, they may be located in one place, or may be distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0181] Those of ordinary skill in the art can understand that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, and their appropriate combinations.

[0182] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of this application and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily need to be used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of this application described here can be implemented in an order other than those illustrated or described here. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products, or devices.

[0183] It should be understood that in this application, "at least one (item)" means one or more, and "a plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that there can be three relationships. For example, "A and / or B" can mean: only A exists, only B exists, and both A and B exist at the same time. Among them, A and B can be singular or plural. The character " / " generally represents an "or" relationship between the associated objects before and after. "At least one (item) of the following" or its similar expression refers to any combination of these items, including any combination of single item (item) or plural items (items). For example, at least one (item) of a, b, or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.

[0184] In several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of units is only a logical function division. In actual implementation, there can be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection between each other can be through some interfaces. The indirect coupling or communication connection of devices or units can be in electrical, mechanical or other forms.

[0185] The units described as separate components may or may not be physically separated. The components displayed as units may or may not be physical units, that is, they can be located in one place, or they can be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0186] In addition, each functional unit in each embodiment of this application can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.

[0187] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes multiple instructions for causing an electronic device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods of various embodiments of this application. The aforementioned storage medium includes: various media that can store programs, such as USB flash drives, mobile hard disks, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical discs.

[0188] The above is a specific description of the preferred implementation of the embodiments of this application. However, the embodiments of this application are not limited to the above-mentioned implementation manners. Those skilled in the art can also make various equivalent deformations or substitutions without departing from the spirit of the embodiments of this application. These equivalent deformations or substitutions are all included within the scope defined by the claims of the embodiments of this application.

Claims

1. A drilling rig data processing method based on federated learning and blockchain, characterized in that: A first verification node applied to a drilling rig data processing system, the drilling rig data processing system comprising: a leader node, a plurality of verification nodes and a plurality of drilling rig nodes; the first verification node is any one of the verification nodes; the leader node and the verification node are both blockchain nodes; The method comprises: Receiving local model parameters obtained by training a local model by a first drilling rig node based on current global model parameters and local data of the first drilling rig node; wherein the first drilling rig node is the drilling rig node that maintains a communication connection with the first verification node; The local model parameters of the first rig node are initially verified based on the current global model parameters, and after the initial verification is passed, the local model parameters of the first rig node are sent to at least one second verification node, so that the local model parameters of the first rig node are re-verified based on the current global model parameters by the at least one second verification node, and after the re-verification is passed, the local model parameters of the first rig node are uploaded to the blockchain; the second verification node is the remaining verification node among the multiple verification nodes except the first verification node; Sending the local model parameters of the first drilling rig node to the current leader node, so that the current leader node updates the global model based on the received local model parameters corresponding to the drilling rig node to obtain the global model parameters for the next step; verifying the global model parameters for the next step, and after the verification is passed, enabling the current leader node to package the local model parameters and the global model parameters for the next step into a transaction and publish it in the block of the blockchain; wherein the received local model parameters corresponding to the drilling rig node at least include the local model parameters of the first drilling rig node; The second verification node re-verifying the local model parameters of the first drilling rig node based on the current global model parameters includes: The second verification node trains the local model parameters of the first drilling rig node based on the local data of the second verification node to obtain the local model parameters to be verified; The second verification node calculates the similarity between the current global model parameters and the local model parameters to be verified; When the similarity is less than the threshold, the second verification node passes the verification again.

2. The drilling rig data processing method based on federated learning and blockchain according to claim 1, characterized in that: The sending of the local model parameters of the first drilling rig node to the current leader node, so that the current leader node updates the global model based on the received local model parameters corresponding to the drilling rig node to obtain the next step global model parameters; verifying the next step global model parameters, and after the verification is passed, enabling the current leader node to package the local model parameters and the next step global model parameters into a transaction and publish them in the block of the blockchain, including: When the current leader node has completed the release of a preset number of blocks in the blockchain, determining a candidate leader node; wherein the candidate leader node is the verification node selected from the multiple verification nodes; Sending the local model parameters of the first drilling rig node to the current leader node, so that the current leader node generates a local model parameter set; wherein the local model parameter set includes the local model parameters corresponding to the received drilling rig nodes, and the received local model parameters corresponding to the drilling rig nodes at least include the local model parameters of the first drilling rig node; Receive a first broadcast message from the current leader node; wherein the first broadcast message includes at least the local model parameter set, the next global model parameter obtained by the current leader node by updating the global model in an asynchronous manner based on the local model parameter set, and the to-be-verified information of the candidate leader node; Based on the local model parameter set, the global model is updated to obtain the global model parameters to be verified, and based on the global model parameters to be verified, the global model parameters of the next step are verified, and the information to be verified of the candidate leader node is verified, and after both verifications are passed, a verification pass message is broadcast to the current leader node; Upon receiving the second broadcast message of the current leading node, the candidate leading node is used as the leading node for publishing a block in the blockchain next time, and the current leading node packages the local model parameters of the first drilling rig node and the global model parameters of the next step into a transaction and publishes them in the block of the blockchain; wherein the second broadcast message includes verification pass messages of a preset number of the verification nodes.

3. The drilling rig data processing method based on federated learning and blockchain according to claim 2 is characterized in that: The current leader node updates the global model based on the received local model parameters corresponding to the drilling rig node to obtain the next step of global model parameters, including: The current leader node determines the sample weight of the local data of the first drilling rig node and determines the training time for generating the local model parameters of the first drilling rig node; The current leader node determines the aggregation weight of the first rig node participating in model aggregation based on the sample weight and the training time; The current leader node updates the global model in an asynchronous manner based on the received aggregation weights and local model parameters corresponding to the drilling rig nodes to obtain the global model parameters for the next step.

4. The drilling rig data processing method based on federated learning and blockchain according to claim 3 is characterized in that: The calculation formula of the aggregation weight of the first drilling rig node includes: ; ; in, is the aggregation weight of the first rig node, is a hyperparameter, is the sample weight of the first rig node, is the training time of the first rig node, is the number of rig nodes participating in the global model aggregation; It is the base number that determines the decay rate.

5. The drilling rig data processing method based on federated learning and blockchain according to claim 1, characterized in that: The initial verification of the local model parameters of the first drilling rig node based on the current global model parameters includes: Training the local model parameters of the first drilling rig node based on the local data of the first verification node to obtain the local model parameters to be verified; Calculating the similarity between the current global model parameters and the local model parameters to be verified; When the similarity is less than the threshold, the initial verification is passed.

6. The drilling rig data processing method based on federated learning and blockchain according to claim 5, characterized in that: The similarity is calculated by: ; in, are the local model parameters to be verified, is the current global model parameter, is the parameter index, is the dimension of the global model, For similarity.

7. A drilling rig data processing device based on federated learning and blockchain, characterized in that: The device comprises: A data receiving module, used for receiving local model parameters obtained by training a local model by a first rig node in a rig data processing system based on current global model parameters and local data of the first rig node; wherein the rig data processing system comprises: a leader node, a plurality of verification nodes and a plurality of rig nodes; the leader node and the verification node are both blockchain nodes; A data verification module, configured to perform an initial verification on the local model parameters of the first rig node based on the current global model parameters, and after the initial verification is passed, send the local model parameters of the first rig node to at least one second verification node, so that the local model parameters of the first rig node are re-verified by the at least one second verification node based on the current global model parameters, and after the re-verification is passed, upload the local model parameters of the first rig node to the blockchain; the second verification node is the verification node among the multiple verification nodes; A data uploading module is used to send the local model parameters of the first drilling rig node to the current leader node, so that the current leader node updates the global model based on the local model parameters corresponding to the received drilling rig node to obtain the global model parameters for the next step; verify the global model parameters for the next step, and after the verification is passed, enable the current leader node to package the local model parameters and the global model parameters for the next step into a transaction and publish it in the block of the blockchain; wherein the local model parameters corresponding to the received drilling rig node at least include the local model parameters of the first drilling rig node; The second verification node re-verifying the local model parameters of the first drilling rig node based on the current global model parameters includes: The second verification node trains the local model parameters of the first drilling rig node based on the local data of the second verification node to obtain the local model parameters to be verified; The second verification node calculates the similarity between the current global model parameters and the local model parameters to be verified; When the similarity is less than the threshold, the second verification node passes the verification again.

8. An electronic device, characterized in that: include: at least one control processor and a memory for communicatively coupling with the at least one control processor; The memory stores instructions that can be executed by the at least one control processor, and the instructions are executed by the at least one control processor so that the at least one control processor can execute the drilling rig data processing method based on federated learning and blockchain as described in any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the drilling rig data processing method based on federated learning and blockchain as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Federal learning method based on DAG block chain

    CN113919507A

  • Credit behavior evidence storage method and system based on block chain and federal learning

    CN115082180A