A communication protocol dynamic adaptation method and device

By constructing a Markov decision process model and a Byzantine fault-tolerant consensus optimization model, the network environment and node behavior are dynamically evaluated, the problem of adaptive adjustment of the communication protocol is solved, and the adaptive capability and system robustness of the communication protocol in the Internet of Things environment are improved.

CN118945195BActive Publication Date: 2025-09-12WUHAN HEXIAN TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411173350.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-26
Publication Date
2025-09-12
Estimated Expiration
2044-08-26

AI Technical Summary

Technical Problem

Existing technologies are unable to effectively implement adaptive adjustment of communication protocols, resulting in the need for large amounts of data training and the inability to meet the dynamic changes in the IoT environment.

Method used

Construct a Markov decision process model and a Byzantine fault-tolerant consensus optimization model, dynamically evaluate the network environment status and node behavior through a dual-duel deep Q network model, build a Byzantine dynamic adaptive consensus protocol framework, and adjust the configuration parameters and communication protocols of terminal devices.

Benefits of technology

It improves the adaptability of communication protocols, enhances the robustness and security of the system, optimizes the energy consumption and performance of terminal devices, and ensures the timeliness, stability and security of communications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118945195B_ABST
    Figure CN118945195B_ABST
Patent Text Reader

Abstract

The present invention proposes a method and apparatus for dynamic communication protocol adaptation, which relates to the field of communication technology. The method comprises: obtaining proxy information data from a terminal device, wherein the proxy information data includes multiple intelligent consensus nodes, a network environment state, and execution action information of each intelligent consensus node; constructing a Markov decision process model based on the proxy information data, wherein the Markov decision process model includes a state space formed by integrating the network environment state with multiple intelligent consensus nodes, an action space formed by integrating the network environment state with all execution action information, and a reward function; constructing a Byzantine fault-tolerant consensus optimization model based on a dual-duel deep Q network model, the state space, the action space, and the reward function; and constructing a Byzantine dynamic adaptive consensus protocol framework based on the Byzantine fault-tolerant consensus optimization model at different stages to dynamically adjust the configuration parameters of the terminal device according to changes in the Internet of Things environment and dynamically adapt the communication protocol currently used by the terminal device. The present invention helps to improve the adaptability of the Byzantine dynamic adaptive consensus protocol framework.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of communication technology, and in particular to a method and device for dynamic adaptation of a communication protocol. Background Art

[0002] In modern communication systems, communication protocols are the foundation for device interoperability. With the development of the Internet of Things and 5G technologies, a variety of communication protocols have emerged to meet the needs of different scenarios. Currently, common communication protocols include TCP / IP, HTTP, MQTT, and CoAP. To meet diverse communication needs, the industry has adopted a variety of technical solutions. Multi-protocol stack integration technology allows devices to support multiple protocols, improving device adaptability. Protocol conversion gateways, as intermediary devices, can convert between different protocols, enabling interconnection and interoperability across heterogeneous networks.

[0003] The Chinese patent with announcement number CN113162986B discloses a method and system for automatic adaptation of parallel access protocols for multiple types of Internet of Things. The above method includes: when receiving an access request from a terminal device, obtaining identification data of the terminal device; and configuring access parameters for the terminal device based on the identification data. However, the above scheme can only judge the stability of the terminal that has been connected and alternately access to achieve protocol replacement or directly configure the newly connected terminal device with adjustable bandwidth, which requires the neural network model to be trained and converged with a large amount of data in advance, and the automatic protocol adaptation method cannot meet the adaptive adjustment of the communication protocol. Therefore, it is very necessary to provide a method and device for dynamic adaptation of the communication protocol to reduce the system signal-to-noise ratio and improve the adaptive ability of the Byzantine dynamic adaptive consensus protocol framework. Summary of the Invention

[0004] In view of this, the present invention proposes a method and apparatus for dynamic communication protocol adaptation. By constructing a Markov decision process model and a Byzantine fault-tolerant consensus optimization model, it is possible to dynamically evaluate the network environment status and the behavior of each node, thereby improving the adaptive capability of the consensus protocol framework.

[0005] The present invention provides a communication protocol dynamic adaptation method, the method comprising:

[0006] Obtaining proxy information data from a terminal device, wherein the proxy information data includes multiple intelligent consensus nodes, network environment status, and execution action information of each intelligent consensus node;

[0007] Constructing a Markov decision process model based on the agent information data, the Markov decision process model including a state space formed by integrating the network environment state and the plurality of intelligent consensus nodes, an action space formed by integrating the network environment state and all executed action information, and a reward function;

[0008] Based on the dual-duel deep Q network model, the state space, the action space, and the reward function, a Byzantine fault-tolerant consensus optimization model is constructed;

[0009] According to the Byzantine fault-tolerant consensus optimization model at different stages, a Byzantine dynamic adaptive consensus protocol framework is constructed to dynamically adjust the configuration parameters of the terminal device according to changes in the Internet of Things environment and dynamically adapt the communication protocol currently used by the terminal device.

[0010] Based on the above technical solution, preferably, the expressions of the state space and the action space are respectively:

[0011] S t =[B m ,T m ,L I ,G] t

[0012] in

[0013] Among them, S t represents the state space of the Byzantine fault-tolerant consensus optimization model at the tth epoch, B m Indicates the maximum block size, T m Indicates the maximum value of the block interval, L I represents the candidate node list of intelligent consensus nodes, G represents the Byzantine fault tolerance rate, A represents the action space of the Byzantine fault tolerance consensus optimization model, C represents the consensus committee matrix, ICN k Represents the kth intelligent consensus node in the Byzantine fault-tolerant consensus optimization model.

[0014] Based on the above technical solution, preferably, the reward function includes:

[0015]

[0016] Among them, R t (S t , A) represents the reward function, x i Indicates the location coordinates of the i-th smart consensus node, x j Indicates the location coordinates of the j-th smart consensus node, represents the coordinate mean of all smart consensus nodes, β represents the degree of dispersion of smart consensus nodes, T tr Indicates the verification time and transmission time of a single block in the consensus process, T vt Indicates the verification time of a single block in the consensus process, T mrepresents the maximum value of the block interval, μ represents the preset ratio parameter of the block verification time to the block interval, N represents the total number of candidate nodes, P represents the probability of the candidate node having Byzantine faults, and n represents the number of smart consensus nodes finally selected in the Byzantine fault-tolerant consensus optimization model.

[0017] More preferably, the block transmission time and verification time of a single block in the consensus process are expressed as:

[0018]

[0019] Where Y represents the total number of blocks in the Byzantine fault-tolerant consensus optimization model, p represents the p-th intelligent consensus node in the Byzantine fault-tolerant consensus optimization model, γ represents the CPU cycle used to verify the digital signature, η represents the CPU cycle used to generate and verify the message verification code, CR cp Indicates the computing resources owned by the master node, CR ci represents the computing resources owned by the replica node, PT represents the maximum tolerable delay of the Byzantine fault-tolerant consensus optimization model, and R cp,ci R represents the data transmission rate between the smart consensus node cp and the smart consensus node ci, cj,ci R represents the data transmission rate between smart consensus node cj and smart consensus node ci, ci,cj Indicates the data transmission rate between smart consensus node ci and smart consensus node cj.

[0020] More preferably, the Byzantine fault-tolerant consensus optimization model includes a centralized training layer and a decentralized decision-making layer connected in sequence, the centralized training layer includes a master node, and the decentralized decision-making layer includes multiple replica nodes and multiple intelligent consensus nodes, wherein:

[0021] The master node is used to obtain a Byzantine fault-tolerant consensus optimization model based on the dual-duel deep Q network training, and send the Byzantine fault-tolerant consensus optimization model to the replica node;

[0022] The replica node is used to determine whether the received Byzantine fault-tolerant consensus optimization model structures are the same, and send the Byzantine fault-tolerant consensus optimization model with the same structure to the smart consensus node;

[0023] The intelligent consensus node is used to generate a corresponding optimization plan based on the received Byzantine fault-tolerant consensus optimization model, and dynamically adjust the parameters of the Byzantine fault-tolerant consensus optimization model according to the optimization welfare function to output the same optimization plan as the other intelligent consensus nodes.

[0024] More preferably, the expression of the optimized welfare function is:

[0025]

[0026] Where W represents the optimized welfare function, ω1 represents the weight coefficient corresponding to the smart consensus node score, represents the scoring function of the smart consensus node at the t+1th epoch, F ij represents the score assigned by the i-th smart consensus node to the smart consensus node at the j-th position coordinate at the t+1-th epoch, ω2 represents the weight coefficient corresponding to the block size scoring function, represents the scoring function of the block size at the t+1th epoch, ω3 represents the weight coefficient corresponding to the scoring function of the block interval time, represents the scoring function assigned to the block interval time by the i-th smart consensus node, N represents the total number of candidate nodes, and n represents the number of smart consensus nodes finally selected in the Byzantine fault-tolerant consensus optimization model.

[0027] More preferably, the method further comprises:

[0028] Obtaining the utility function output by each intelligent consensus node in the Byzantine fault-tolerant consensus optimization model;

[0029] Determine whether the utility function in each smart consensus node meets the Nash equilibrium conditions;

[0030] If the utility function in each intelligent consensus node meets the Nash equilibrium condition, the current Byzantine fault-tolerant consensus optimization model is output to generate the corresponding optimization plan.

[0031] More preferably, the method further comprises:

[0032] Obtaining the utility function output by each intelligent consensus node in the Byzantine fault-tolerant consensus optimization model;

[0033] Determine whether the utility function in each smart consensus node meets the Nash equilibrium conditions;

[0034] If the utility function in each intelligent consensus node meets the Nash equilibrium condition, the current Byzantine fault-tolerant consensus optimization model is output to generate the corresponding optimization plan.

[0035] In a second aspect of the present application, a communication protocol dynamic adaptation device based on the Internet of Things is provided, wherein the communication protocol dynamic adaptation device includes a data acquisition module, a model building module, and a protocol matching module connected in sequence, wherein:

[0036] The data acquisition module is used to obtain agent information data in the terminal device, wherein the agent information data includes multiple intelligent consensus nodes, network environment status, and execution action information of each intelligent consensus node;

[0037] The model construction module is used to construct a Markov decision process model based on the agent information data, wherein the Markov decision process model includes a state space formed by integrating the network environment state and the plurality of intelligent consensus nodes, an action space formed by integrating the network environment state and all execution action information, and a reward function. Based on the dual-duel deep Q network model, the state space, the action space, and the reward function, a Byzantine fault-tolerant consensus optimization model is constructed;

[0038] The protocol matching module is used to construct a Byzantine dynamic adaptive consensus protocol framework based on the Byzantine fault-tolerant consensus optimization model at different stages, so as to dynamically adjust the configuration parameters of the terminal device according to changes in the Internet of Things environment and dynamically adapt the communication protocol currently used by the terminal device.

[0039] In a third aspect of the present application, an electronic device is provided, comprising a processor, a memory, a user interface and a network interface, wherein the memory is used to store instructions, the user interface and the network interface are used to communicate with other devices, and the processor is used to execute the instructions stored in the memory.

[0040] The present invention provides a method and device for dynamic adaptation of communication protocols, which have the following advantages over the prior art:

[0041] Beneficial effects:

[0042] (1) By constructing a Markov decision process model and a Byzantine fault-tolerant consensus optimization model, the network environment status and the behavior of each node can be dynamically evaluated, and the configuration parameters and communication protocols of the terminal can be adjusted according to the changes, thereby improving the adaptability of the Byzantine dynamic adaptive consensus protocol framework. At the same time, the Byzantine fault-tolerant consensus optimization model is used to eliminate and optimize malicious nodes or faulty nodes in the IoT environment, thereby improving the robustness and security of the system. In addition, the communication protocol parameters are dynamically adjusted according to the resource status and environmental changes of the terminal, thereby optimizing the energy consumption and performance of the terminal device, thereby improving the overall efficiency of the Byzantine dynamic adaptive consensus protocol framework, and ensuring the timeliness, stability and security of communication between terminals.

[0043] (2) By introducing a hierarchical design of master nodes, replica nodes, and intelligent consensus nodes into the Byzantine fault-tolerant consensus optimization model, it is possible to effectively cope with Byzantine faults and interference from malicious nodes, thereby improving the fault tolerance of the Byzantine fault-tolerant consensus optimization model. At the same time, the intelligent consensus node can dynamically adjust parameters according to the received optimization model to adapt to different IoT environment changes, thereby enhancing the adaptability of the model. Moreover, multiple intelligent consensus nodes run the Byzantine fault-tolerant consensus optimization model in parallel, generating a unified optimization solution through mutual verification and consensus, thus realizing distributed collaborative optimization. In addition, the Byzantine fault-tolerant consensus optimization model can easily increase or decrease the number of intelligent consensus nodes to adapt to the application needs of IoT of different scales and meet the needs of dynamic evolution of the system. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0045] Figure 1 A three-dimensional diagram of a communication protocol dynamic adaptation method provided by the present invention;

[0046] Figure 2 A schematic diagram of the structure of the communication protocol dynamic adaptation device provided by the present invention;

[0047] Figure 3 This is a schematic structural diagram of the electronic device provided by the present invention.

[0048] Explanation of the accompanying drawings: 1. Communication protocol dynamic adaptation device; 11. Data acquisition module; 12. Model building module; 13. Protocol matching module; 2. Electronic device; 21. Processor; 22. Communication bus; 23. User interface; 24. Network interface; 25. Memory. DETAILED DESCRIPTION

[0049] The following will be combined with the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.

[0050] The following is combined with Figure 1-3 This application is described in further detail.

[0051] refer to Figure 1, the present application provides a communication protocol dynamic adaptation method, the above method steps include S1-S4.

[0052] Step S1: Obtain proxy information data in the terminal device, wherein the proxy information data includes multiple intelligent consensus nodes, network environment status, and execution action information of each intelligent consensus node.

[0053] In this step, the blockchain network collects information about the Intelligent Consensus Nodes (ICNs) participating in the Practical Byzantine Fault Tolerance (PBFT) mechanism. This information typically includes node ID, geographic location, computing resources, and network bandwidth. This information can be obtained from the records regularly reported by the ICNs. The network environment status can be monitored and collected by monitoring key environmental indicators that affect PBFT consensus performance, such as network topology, node mobility, communication latency, and node failure rate. These key environmental indicators can be obtained using IoT monitoring devices and network probing tools. The execution action information of each ICN can be obtained by recording the specific actions taken by each ICN during the PBFT consensus process, such as the proposed block size, block interval, and node election. This specific behavioral information can be extracted from the blockchain's historical records and consensus logs.

[0054] IoT monitoring devices and network detection tools can use sensor devices, network detection tools, edge computing devices and central management platforms, among which,

[0055] Sensing devices can use temperature sensors, humidity sensors, light sensors, and sound sensors to monitor environmental physical indicators, or use position sensors, acceleration sensors, etc. to monitor the location and movement status of nodes, or use power consumption sensors, voltage sensors, etc. to monitor the computing resource status of nodes; network detection tools can use the monitoring functions of network devices such as routers and switches to obtain network topology, bandwidth utilization, and latency indicators, or use the network sniffing tool Wireshark to analyze network traffic and obtain communication status between nodes, or use network diagnostic tools ping or traceroute to test connectivity and latency between nodes; edge computing devices can use gateway devices and edge servers to collect and summarize terminal device status information, or pre-process and analyze raw data through edge computing to provide richer environmental status information; the central management platform can use an Internet of Things platform or cloud management system to centrally manage and monitor the entire Internet of Things system, or obtain global network environment status data through an API interface.

[0056] Step S2: construct a Markov decision process model based on the agent information data. The Markov decision process model includes a state space formed by integrating the network environment state and multiple intelligent consensus nodes, an action space formed by integrating the network environment state and all execution action information, and a reward function.

[0057] In this step, the network environment status information (such as network topology, node location, resource utilization, etc.) and the intelligent consensus node information (such as node ID, geographical location, computing resources, etc.) are integrated into a comprehensive state description. The above state description constitutes the state space S of the Markov decision process model. t The network environment status information and the execution action information of the intelligent consensus node (such as block size, block interval, node election, etc.) are integrated into a set of optional actions. The above action set constitutes the action space A of the Markov decision process model. According to the performance objectives of the PBFT consensus protocol, such as throughput, latency, and security, the corresponding reward function R is designed.

[0058] In this embodiment, the expressions of the state space and action space are respectively:

[0059] S t =[B m ,T m ,L I ,G] t

[0060] in

[0061] Among them, S t represents the state space of the Byzantine fault-tolerant consensus optimization model at the tth epoch, B m Indicates the maximum block size, T m Indicates the maximum value of the block interval, L I Represents the candidate node list of the smart consensus node, and |L I |=N, G represents the Byzantine fault tolerance rate, A represents the action space of the Byzantine fault tolerance consensus optimization model, C represents the consensus committee matrix, ICN k Represents the kth smart consensus node in the Byzantine fault-tolerant consensus optimization model.

[0062] In this embodiment, the reward function includes:

[0063]

[0064] Among them, R t (S t , A) represents the reward function, x i Indicates the location coordinates of the i-th smart consensus node, xj Indicates the location coordinates of the j-th smart consensus node, represents the coordinate mean of all smart consensus nodes, β represents the degree of dispersion of smart consensus nodes, T tr Indicates the verification time and transmission time of a single block in the consensus process, T vt Indicates the verification time of a single block in the consensus process, T m represents the maximum value of the block interval, μ represents the preset ratio parameter of the block verification time to the block interval, N represents the total number of candidate nodes, P represents the probability of the candidate node having Byzantine faults, and n represents the number of smart consensus nodes finally selected in the Byzantine fault-tolerant consensus optimization model.

[0065] To quantify the degree of dispersion of smart consensus nodes, the Gini coefficient can be used to evaluate them. The Gini coefficient is a widely used inequality measure in social science and economics, often used to assess the degree of inequality in income or resource distribution. Its value range is between [0, 1], with values ​​closer to 0 indicating more equal distribution. Assuming that smart consensus nodes are randomly distributed in a two-dimensional area, the reward function can be expressed as:

[0066] In this embodiment, the block transmission time and verification time of a single block during the consensus process are expressed as:

[0067]

[0068]

[0069] Where Y represents the total number of blocks in the Byzantine fault-tolerant consensus optimization model, p represents the p-th intelligent consensus node in the Byzantine fault-tolerant consensus optimization model, γ represents the CPU cycle used to verify the digital signature, η represents the CPU cycle used to generate and verify the message verification code, and CR cp Indicates the computing resources owned by the master node, CR ci represents the computing resources owned by the replica node, PT represents the maximum tolerable delay of the Byzantine fault-tolerant consensus optimization model, and R cp,ci R represents the data transmission rate between the smart consensus node cp and the smart consensus node ci, cj,ci R represents the data transmission rate between smart consensus node cj and smart consensus node ci, ci,cj Indicates the data transmission rate between smart consensus node ci and smart consensus node cj.

[0070] Here, t1 represents the data block transmission time in the pre-preparation phase of the Byzantine fault-tolerant consensus optimization model, t2 represents the data block transmission time in the preparation phase of the Byzantine fault-tolerant consensus optimization model, and t3 represents the data block transmission time in the submission phase of the Byzantine fault-tolerant consensus optimization model.

[0071] Step S3: Based on the dual-duel deep Q network model, state space, action space, and reward function, a Byzantine fault-tolerant consensus optimization model is constructed.

[0072] In this step, an action value function is constructed to represent the expected cumulative reward obtained by taking action a in state s. The action value function guides the intelligent consensus nodes in selecting the optimal Byzantine Fault Tolerant consensus optimization model parameter configuration. Since the dual-duel deep Q network model generally includes two networks (an evaluation network and a target network), the evaluation network is responsible for generating action value predictions, and the target network is responsible for generating action value targets. By alternating between updating the two networks, the convergence and stability of the action value function are improved.

[0073] In this embodiment, the Byzantine fault-tolerant consensus optimization model includes a centralized training layer and a decentralized decision-making layer connected in sequence. The centralized training layer includes a master node, and the decentralized decision-making layer includes multiple replica nodes and multiple intelligent consensus nodes.

[0074] The master node is used to obtain the Byzantine fault-tolerant consensus optimization model based on the dual-duel deep Q network training and send the Byzantine fault-tolerant consensus optimization model to the replica node;

[0075] The replica node is used to determine whether the received Byzantine fault-tolerant consensus optimization model structure is the same, and send the Byzantine fault-tolerant consensus optimization model with the same structure to the smart consensus node;

[0076] The intelligent consensus node is used to generate a corresponding optimization plan based on the received Byzantine fault-tolerant consensus optimization model, and dynamically adjust the parameters of the Byzantine fault-tolerant consensus optimization model according to the optimization welfare function to output the same optimization plan as the other intelligent consensus nodes.

[0077] By introducing a hierarchical design of master nodes, replica nodes, and intelligent consensus nodes into the Byzantine fault-tolerant consensus optimization model, we can effectively cope with Byzantine failures and interference from malicious nodes, thereby improving the fault tolerance of the Byzantine fault-tolerant consensus optimization model. At the same time, intelligent consensus nodes can dynamically adjust parameters according to the received optimization model to adapt to different IoT environment changes, thereby enhancing the adaptability of the model. Moreover, multiple intelligent consensus nodes run the Byzantine fault-tolerant consensus optimization model in parallel, generating a unified optimization solution through mutual verification and consensus, thus realizing distributed collaborative optimization. In addition, the Byzantine fault-tolerant consensus optimization model can conveniently increase or decrease the number of intelligent consensus nodes to adapt to the application needs of IoT of different scales and meet the needs of dynamic system evolution.

[0078] The expression of the optimized welfare function is:

[0079]

[0080] Among them, W represents the optimized welfare function, ω1 represents the weight coefficient corresponding to the smart consensus node score, represents the scoring function of the smart consensus node at the t+1th epoch, F ij represents the score assigned by the i-th smart consensus node to the smart consensus node at the j-th position coordinate at the t+1-th epoch, ω2 represents the weight coefficient corresponding to the block size scoring function, represents the scoring function of the block size at the t+1th epoch, ω3 represents the weight coefficient corresponding to the scoring function of the block interval time, represents the scoring function assigned to the block interval time by the i-th smart consensus node, and ω1+ω2+ω3=1, N represents the total number of candidate nodes, and n represents the number of smart consensus nodes finally selected in the Byzantine fault-tolerant consensus optimization model.

[0081] In one example, after constructing the state space, action space, and reward function, the master node of the Byzantine fault-tolerant consensus optimization model trains the objective function of the Byzantine fault-tolerant consensus optimization model, namely the action value function Q, by simulating the dynamic changes of the IoT environment. m (s t , a t ).

[0082] The action value function can be expressed as:

[0083]

[0084] a m =argmaxQ m (s t+1 ,a t )

[0085] Among them, μ represents the future reward discount factor, R t+1 Indicates that in the current state s t Take action a t After that, the reward obtained in the next epoch t+1 is s t+1 Indicates that in the current state s t Take action a t After that, the Byzantine fault-tolerant consensus optimization model moves to the next state, where argmax() represents the function that finds the maximum parameter of the function.

[0086] This step also includes steps S31 to S33.

[0087] Step S31, obtaining the utility function output by each intelligent consensus node in the Byzantine fault-tolerant consensus optimization model.

[0088] Step S32: Determine whether the utility function in each smart consensus node satisfies the Nash equilibrium condition.

[0089] In this step, the utility function is expressed as:

[0090]

[0091] in, represents the utility function of the i-th smart consensus node, Represents the optimization suggestion submitted by the i-th smart consensus node, represents the set of optimization suggestions submitted by all smart consensus nodes except the i-th smart consensus node, R base represents the basic reward parameter, R c () represents the consistency reward function, α represents the weight coefficient corresponding to the consistency reward function, W represents the optimized welfare function, R s () represents the consensus reward function, θ represents the weight coefficient corresponding to the consensus reward function, A t+1 Represents the set of optimization suggestions submitted by all smart consensus nodes, P d () represents the bias function, and λ represents the weight coefficient corresponding to the bias function.

[0092] Step S33: If the utility function in each intelligent consensus node meets the Nash equilibrium condition, the current Byzantine fault-tolerant consensus optimization model is output to generate a corresponding optimization solution.

[0093] In this step, considering the utility function To ensure that the PBFT optimization decision game is in a Nash equilibrium state, each smart consensus node must hold the following inequality:

[0094]

[0095] Assume that the global optimal solution is a * =1. Therefore U i (1, a -i ) and U i (0, a -i ) can be expressed as:

[0096]

[0097] To ensure that Ui(1, a -i )>Ui(1,a -i ), the following inequality must be satisfied:

[0098] α×R c (1,W ) >λ×P q (0 ) -θ×(R s (1,A t+1 )-R s (0,A t+1 ))

[0099] In one example, when the change in the network environment state triggers the conditions for dynamic adaptation, the i-th smart consensus node in the current epoch uses the blockchain global state information as the input parameter of the Byzantine fault-tolerant consensus optimization model to generate the corresponding optimization suggestion function

[0100] The optimization suggestion function can be expressed as:

[0101]

[0102] Among them, t represents the current era, POM No-Sto represents the Byzantine fault-tolerant consensus optimization model under the non-random strategy, c represents the set of nodes participating in the Byzantine fault-tolerant consensus, b m Indicates the data capacity of each block in the Byzantine fault-tolerant consensus optimization model, t m Indicates the time interval for generating new blocks in the Byzantine fault-tolerant consensus optimization model, l i represents the intelligent consensus node in the Byzantine fault tolerance consensus optimization model, g represents any one of the Byzantine fault tolerance rate set, and the above model is based on the current state S t The non-randomness of this selection can reduce uncertainty by providing consistent and predictable outputs, thus facilitating the uniformity of optimal decision making.

[0103] The i-th smart consensus node calculates and obtains the optimization suggestion function After that, the corresponding commitment value must be calculated and submitted in advance to prevent other smart consensus nodes from prematurely recognizing the optimization proposal. Specifically, the i-th smart consensus node generates a random number ri and Connect to get the function

[0104] Subsequently, the i-th smart consensus node uses a secure hash function to calculate the encrypted commitment and obtains:

[0105]

[0106] Among them, h s Indicates that the i-th intelligent consensus node generates the optimization solution a i t+1 The current state S used t , h m Represents POM in the Byzantine Fault Tolerant consensus optimization model No-Sto After completing the encryption commitment, the i-th smart consensus node will commit the value Commit i Submit to the blockchain smart contract. Once the smart contract receives the proposed commitment from more than 2 / 3 of the smart consensus nodes, it will require all participating smart consensus nodes to make their commitments public. Specifically, this process includes each smart consensus node transmitting Commit to the blockchain network. i If the two commitment values ​​output by any two smart consensus nodes are equal, the optimization proposal of the i-th smart consensus node is considered valid. This hash-based commitment scheme ensures that malicious smart consensus nodes cannot preemptively identify the optimization proposals of other smart consensus nodes, thereby reducing the risk of manipulation.

[0107] The Byzantine Fault Tolerant consensus optimization model is in a centralized training phase. The parameters of the Byzantine Fault Tolerant consensus optimization model are trained on the master node and then validated in a simulated blockchain-IoT environment. After training is complete, the master node shares the optimized model with all smart consensus nodes through a blockchain transaction. Specifically, the master node publishes the hash address of the Byzantine Fault Tolerant consensus optimization model on-chain, allowing other smart consensus nodes to use this hash address to download the corresponding model from a distributed storage system (such as IPFS). This ensures that all honest smart consensus nodes have the same Byzantine Fault Tolerant consensus optimization model, enabling them to generate relatively consistent PBFT optimization proposals as the blockchain-IoT environment undergoes dynamic changes.

[0108] Step S4: Based on the Byzantine fault-tolerant consensus optimization model at different stages, a Byzantine dynamic adaptive consensus protocol framework is constructed to dynamically adjust the configuration parameters of the terminal device according to changes in the IoT environment and dynamically adapt the communication protocol currently used by the terminal device.

[0109] In this step, the Byzantine dynamic adaptive consensus protocol framework includes a Byzantine fault-tolerant consensus optimization model in the initialization phase, normal operation phase, dynamic adaptive phase, and iterative optimization phase, wherein:

[0110] During the initialization phase, the PBFT master node uses the Byzantine fault-tolerant consensus optimization model trained in step S3 to evaluate the current IoT environment and generate the parameter configuration of the initial Byzantine fault-tolerant consensus optimization model. The master node distributes the parameters of the optimization model to other replica nodes through blockchain transactions to ensure that all honest smart consensus nodes have the same Byzantine fault-tolerant consensus optimization model.

[0111] During the normal operation phase, all candidate nodes among the smart consensus nodes that wish to join the next round of consensus committee matrix regularly submit declaration information containing information such as location and resource status to the blockchain network. The above information is recorded in the global information of the blockchain, which helps to alleviate the incomplete information problem faced by the Byzantine fault-tolerant consensus optimization model in the Internet of Things environment.

[0112] During the dynamic adaptation phase, when the current Byzantine Fault Tolerant consensus optimization model's parameter configuration fails to adapt to changes in the IoT environment, the dynamic adaptation process is triggered. This phase is divided into two sub-phases: Optimality Seeking Phase: The intelligent consensus nodes in the current round input the environmental state and use the Byzantine Fault Tolerant consensus optimization model to generate an optimization solution, including configurations such as consensus committee members, block size, and block interval. Optimization Decision Consensus Phase: The Borda-count-based PBFT optimization decision consensus mechanism ensures consistent optimization decisions even in environments with incomplete information.

[0113] During the iterative optimization phase, the master node of the Byzantine Fault Tolerant consensus optimization model iteratively trains the model based on the latest data and feedback, and synchronizes the updated model to other replica nodes. This continuously optimizes the accuracy and reliability of the Byzantine Fault Tolerant consensus optimization model, enabling it to better adapt to changes in the IoT environment.

[0114] In one example, the Byzantine dynamic adaptive consensus protocol framework constructs the PBFT consensus committee into a multi-agent system through Markov game, that is, the Byzantine dynamic adaptive consensus protocol framework can be expressed as a parameter matrix (n, S, A1, A2, ..., A n ,T,ξ,R1,R2,...,R n ), where n represents the number of smart consensus nodes, S represents the network environment status, including block size, block interval, consensus committee, candidate nodes of smart consensus nodes, and node failure rate information, A1, A2, ..., A nrepresents the execution action of the smart consensus node, T represents the state transition function, ξ represents the future reward discount factor, R1, R2, ..., R n Represents the reward received by the smart consensus node after executing an action. A state transition function T can be established based on the dynamic nature of the IoT environment to describe the probability distribution of the current state s transitioning to the next state s' after taking action a. The state transition function can be modeled using historical data or derived based on a physical model.

[0115] By constructing a Markov decision process model and a Byzantine fault-tolerant consensus optimization model, it is possible to dynamically evaluate the network environment status and the behavior of each node, and adjust the terminal configuration parameters and communication protocols according to the changes, thereby improving the adaptability of the Byzantine dynamic adaptive consensus protocol framework. At the same time, the Byzantine fault-tolerant consensus optimization model is used to eliminate and optimize malicious nodes or faulty nodes in the Internet of Things environment, thereby improving the robustness and security of the system. In addition, the communication protocol parameters are dynamically adjusted according to the resource status of the terminal and environmental changes, thereby optimizing the energy consumption and performance of the terminal device, thereby improving the overall efficiency of the Byzantine dynamic adaptive consensus protocol framework to ensure the timeliness, stability and security of communication between terminals.

[0116] Based on the above method, the embodiment of the present application discloses a communication protocol dynamic adaptation device, referring to Figure 2 The communication protocol dynamic adaptation device 1 includes a data acquisition module 11, a model building module 12 and a protocol matching module 13 connected in sequence, wherein:

[0117] The data acquisition module 11 is used to obtain agent information data in the terminal device, wherein the agent information data includes multiple intelligent consensus nodes, network environment status, and execution action information of each intelligent consensus node;

[0118] The model construction module 12 is used to construct a Markov decision process model based on the agent information data. The Markov decision process model includes a state space formed by integrating the network environment state and multiple intelligent consensus nodes, an action space formed by integrating the network environment state and all execution action information, and a reward function. Based on the dual-duel deep Q network model, the state space, the action space, and the reward function, a Byzantine fault-tolerant consensus optimization model is constructed;

[0119] The protocol matching module 13 is used to construct a Byzantine dynamic adaptive consensus protocol framework based on the Byzantine fault-tolerant consensus optimization model at different stages, so as to dynamically adjust the configuration parameters of the terminal device according to the changes in the Internet of Things environment and dynamically adapt the communication protocol currently used by the terminal device.

[0120] In an example, the expressions for state space and action space are:

[0121] S t =[B m ,T m ,L I ,G] t

[0122] in

[0123] Among them, S t represents the state space of the Byzantine fault-tolerant consensus optimization model at the tth epoch, B m Indicates the maximum block size, T m Indicates the maximum value of the block interval, L I represents the candidate node list of the intelligent consensus node, G represents the Byzantine fault tolerance rate, A represents the action space of the Byzantine fault tolerance consensus optimization model, C represents the consensus committee matrix, ICN k Represents the kth smart consensus node in the Byzantine fault-tolerant consensus optimization model.

[0124] In one example, the reward function includes:

[0125]

[0126] Among them, R t (S t , A) represents the reward function, x i Indicates the location coordinates of the i-th smart consensus node, x j Indicates the location coordinates of the j-th smart consensus node, represents the coordinate mean of all smart consensus nodes, β represents the degree of dispersion of smart consensus nodes, T tr Indicates the verification time and transmission time of a single block in the consensus process, T vt Indicates the verification time of a single block in the consensus process, T m represents the maximum value of the block interval, μ represents the preset ratio parameter of the block verification time to the block interval, N represents the total number of candidate nodes, P represents the probability of the candidate node having Byzantine faults, and n represents the number of smart consensus nodes finally selected in the Byzantine fault-tolerant consensus optimization model.

[0127] In one example, the expressions for the block transmission time and verification time of a single block in the consensus process are:

[0128]

[0129] Where Y represents the total number of blocks in the Byzantine fault-tolerant consensus optimization model, p represents the p-th intelligent consensus node in the Byzantine fault-tolerant consensus optimization model, γ represents the CPU cycle used to verify the digital signature, η represents the CPU cycle used to generate and verify the message verification code, and CR cp Indicates the computing resources owned by the master node, CR ci represents the computing resources owned by the replica node, PT represents the maximum tolerable delay of the Byzantine fault-tolerant consensus optimization model, and R cp,ci R represents the data transmission rate between the smart consensus node cp and the smart consensus node ci, cj,ci R represents the data transmission rate between smart consensus node cj and smart consensus node ci, ci,cj Indicates the data transmission rate between smart consensus node ci and smart consensus node cj.

[0130] In one example, a Byzantine fault-tolerant consensus optimization model includes a centralized training layer and a decentralized decision layer connected in sequence, wherein the centralized training layer includes a master node, and the decentralized decision layer includes multiple replica nodes and multiple intelligent consensus nodes, wherein:

[0131] The master node is used to obtain the Byzantine fault-tolerant consensus optimization model based on the dual-duel deep Q network training and send the Byzantine fault-tolerant consensus optimization model to the replica node;

[0132] The replica node is used to determine whether the received Byzantine fault-tolerant consensus optimization model structure is the same, and send the Byzantine fault-tolerant consensus optimization model with the same structure to the smart consensus node;

[0133] The intelligent consensus node is used to generate a corresponding optimization plan based on the received Byzantine fault-tolerant consensus optimization model, and dynamically adjust the parameters of the Byzantine fault-tolerant consensus optimization model according to the optimization welfare function to output the same optimization plan as the other intelligent consensus nodes.

[0134] In one example, the expression for the optimal welfare function is:

[0135]

[0136] Among them, W represents the optimized welfare function, ω1 represents the weight coefficient corresponding to the smart consensus node score, represents the scoring function of the smart consensus node at the t+1th epoch, F ij represents the score assigned by the i-th smart consensus node to the smart consensus node at the j-th position coordinate at the t+1-th epoch, ω2 represents the weight coefficient corresponding to the block size scoring function, represents the scoring function of the block size at the t+1th epoch, ω3 represents the weight coefficient corresponding to the scoring function of the block interval time, Represents the scoring function assigned to the block interval by the i-th smart consensus node.

[0137] In one example, the model building module 12 is used to obtain the utility function output by each intelligent consensus node in the Byzantine fault-tolerant consensus optimization model; determine whether the utility function in each intelligent consensus node satisfies the Nash equilibrium condition; if the utility function in each intelligent consensus node satisfies the Nash equilibrium condition, then output the current Byzantine fault-tolerant consensus optimization model to generate a corresponding optimization plan.

[0138] In one example, the utility function is expressed as:

[0139]

[0140] in, represents the utility function of the i-th smart consensus node, Represents the optimization suggestion submitted by the i-th smart consensus node, represents the set of optimization suggestions submitted by all smart consensus nodes except the i-th smart consensus node, R base represents the basic reward parameter, R c () represents the consistency reward function, α represents the weight coefficient corresponding to the consistency reward function, W represents the optimized welfare function, R s () represents the consensus reward function, θ represents the weight coefficient corresponding to the consensus reward function, A t+1 Represents the set of optimization suggestions submitted by all smart consensus nodes, P d () represents the bias function, and λ represents the weight coefficient corresponding to the bias function.

[0141] See Figure 3 , is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 3 As shown, the electronic device 2 may include: at least one processor 21 , at least one network interface 24 , a user interface 23 , a memory 25 , and at least one communication bus 22 .

[0142] The communication bus 22 is used to realize the connection and communication between these components.

[0143] The user interface 23 may include a display screen (Display) and a camera (Camera). Optionally, the user interface 23 may also include a standard wired interface and a wireless interface.

[0144] The network interface 24 may optionally include a standard wired interface or a wireless interface (such as a WI-FI interface).

[0145] The processor 21 may include one or more processing cores. The processor 21 utilizes various interfaces and lines to connect various parts of the entire server. By running or executing instructions, programs, code sets, or instruction sets stored in the memory 25, and calling data stored in the memory 25, the processor 21 performs various server functions and processes data. Optionally, the processor 21 may be implemented in at least one hardware form selected from digital signal processing (DSP), field programmable gate array (FPGA), and programmable logic array (PLA). The processor 21 may integrate one or a combination of a central processing unit (CPU), a graphics processing unit (GPU), and a modem. The CPU primarily processes the operating system, user interface, and application programs; the GPU is responsible for rendering and drawing the content to be displayed on the display screen; and the modem is used to handle wireless communications. It is understood that the modem may not be integrated into the processor 21 and may be implemented separately on a single chip.

[0146] Among them, the memory 25 may include a random access memory (Random Access Memory, RAM) and may also include a read-only memory (Read-Only Memory). Optionally, the memory 25 includes a non-transitory computer-readable storage medium (non-transitory computer-readable storage medium). The memory 25 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 25 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned various method embodiments, etc.; the data storage area may store data involved in the above-mentioned various method embodiments, etc. The memory 25 may also optionally be at least one storage device located away from the aforementioned processor 21. As Figure 3 As shown, the memory 25 as a computer storage medium may include an operating system, a network communication module, a user interface module, and an application program based on the method for dynamic adaptation of the communication protocol of the Internet of Things.

[0147] exist Figure 3In the electronic device 2 shown, the user interface 23 is mainly used to provide an input interface for the user and obtain data input by the user; and the processor 21 can be used to call the application program stored in the memory 25 for the dynamic adaptation method of the communication protocol based on the Internet of Things. When executed by one or more processors, the electronic device executes one or more methods in the above-mentioned embodiments.

[0148] A computer-readable storage medium stores instructions, which, when executed by one or more processors, cause the computer to execute one or more methods in the above-mentioned embodiments.

[0149] It should be noted that for the aforementioned method embodiments, for simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that this application is not limited by the order of the actions described, because according to this application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required for this application.

[0150] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0151] In the several embodiments provided in this application, it should be understood that the disclosed devices can be implemented in other ways. For example, the device embodiments described above are merely schematic, such as the division of units, which is only a logical function division. In actual implementation, there may be other division methods, such as 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 mutual coupling or direct coupling or communication connection shown or discussed can be through some service interface, and the indirect coupling or communication connection of devices or units can be electrical or other forms.

[0152] Units described as separate components may or may not be physically separate, and components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.

[0153] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0154] 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 memory. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a memory and includes several instructions for enabling a computer device (which can be a personal computer, server or network device, etc.) to execute all or part of the steps of the various embodiments of the present application. The aforementioned memory includes various media that can store program codes, such as USB flash drives, mobile hard drives, magnetic disks or optical disks.

[0155] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A communication protocol dynamic adaptation method, characterized in that: The method comprises: Obtaining proxy information data from a terminal device, wherein the proxy information data includes multiple intelligent consensus nodes, network environment status, and execution action information of each intelligent consensus node; Constructing a Markov decision process model based on the agent information data, the Markov decision process model including a state space formed by integrating the network environment state and the plurality of intelligent consensus nodes, an action space formed by integrating the network environment state and all executed action information, and a reward function; Based on the dual-duel deep Q network model, the state space, the action space, and the reward function, a Byzantine fault-tolerant consensus optimization model is constructed, wherein the dual-duel deep Q network model includes an evaluation network and a target network, the evaluation network is responsible for generating action value predictions, and the target network is responsible for generating action value targets. The expected cumulative reward obtained by taking action a in state s is represented by constructing an action value function, and the action value function is used to guide the intelligent consensus node to select the optimal Byzantine fault-tolerant consensus optimization model parameter configuration. The master node in the Byzantine fault-tolerant consensus optimization model is used to obtain a Byzantine fault-tolerant consensus optimization model according to the dual-duel deep Q network training and send the Byzantine fault-tolerant consensus optimization model to the replica node; The reward function includes: ; in, S t Indicates that the Byzantine fault-tolerant consensus optimization model is in the t The state space at epochs, A represents the action space of the Byzantine fault-tolerant consensus optimization model, R t (S t ,A) represents the reward function, x i Indicates the i The location coordinates of the smart consensus nodes, x j Indicates the j The location coordinates of the smart consensus nodes, Represents the coordinate mean of all smart consensus nodes, β Indicates the degree of dispersion of smart consensus nodes. T tr Indicates the verification time and transmission time of a single block in the consensus process. T vt Indicates the verification time of a single block in the consensus process, T m Indicates the maximum value of the block interval time, μ Indicates the preset ratio parameter of block verification time and block interval time. N represents the total number of candidate nodes, P represents the probability that a candidate node has a Byzantine fault, n Indicates the number of smart consensus nodes that are finally selected in the Byzantine Fault Tolerant consensus optimization model; The block transmission time and verification time of a single block in the consensus process are expressed as: ; ; in, B m represents the maximum block size, Y represents the total number of blocks in the Byzantine fault-tolerant consensus optimization model, p Indicates the first p Smart consensus nodes, γ represents the CPU cycles used to verify the digital signature, η Indicates the CPU cycles used to generate and verify the message verification code, CR cp Indicates the computing resources owned by the master node, CR ci Indicates the computing resources owned by the replication node. PT represents the maximum tolerable delay of the Byzantine fault tolerant consensus optimization model, R cp,ci Represents a smart consensus node cp To smart consensus node ci The data transfer rate between R cj,ci Represents a smart consensus node cj To smart consensus node ci The data transfer rate between R ci,cj Represents a smart consensus node ci To smart consensus node cj Data transfer rate between According to the Byzantine fault-tolerant consensus optimization model in different stages, a Byzantine dynamic adaptive consensus protocol framework is constructed to dynamically adjust the configuration parameters of the terminal device according to changes in the Internet of Things environment and dynamically adapt the communication protocol currently used by the terminal device; the Byzantine dynamic adaptive consensus protocol framework includes Byzantine fault-tolerant consensus optimization models in the initialization stage, normal operation stage, dynamic adaptive stage and iterative optimization stage respectively, wherein, During the initialization phase, the PBFT master node uses the Byzantine Fault Tolerance consensus optimization model trained in step S3 to evaluate the current IoT environment and generate the initial Byzantine Fault Tolerance consensus optimization model parameter configuration. The master node distributes the optimization model parameters to other replica nodes through blockchain transactions. During the normal operation phase, all candidate nodes among the smart consensus nodes that wish to join the next round of the consensus committee matrix regularly submit declaration information containing location and resource status information to the blockchain network; In the dynamic adaptation phase, when the parameter configuration of the current Byzantine fault-tolerant consensus optimization model cannot adapt to changes in the IoT environment, the dynamic adaptation process is triggered; During the iterative optimization phase, the master node of the Byzantine fault-tolerant consensus optimization model iteratively trains the Byzantine fault-tolerant consensus optimization model based on the latest data and feedback, and synchronizes the updated model to other replica nodes.

2. The method according to claim 1, wherein The expressions of the state space and the action space are respectively: ; ; in, S t represents the state space of the Byzantine fault-tolerant consensus optimization model at the tth epoch, B m Indicates the maximum block size. T m Indicates the maximum value of the block interval time, L I Represents the candidate node list of the smart consensus node, G represents the Byzantine fault tolerance rate, A represents the action space of the Byzantine fault-tolerant consensus optimization model, C represents the consensus committee matrix, ICN k Indicates the first k Smart consensus nodes.

3. The method according to claim 1, wherein The Byzantine fault-tolerant consensus optimization model includes a centralized training layer and a decentralized decision-making layer connected in sequence, wherein the centralized training layer includes a master node, and the decentralized decision-making layer includes multiple replica nodes and multiple intelligent consensus nodes, wherein: The master node is used to obtain a Byzantine fault-tolerant consensus optimization model based on the dual-duel deep Q network training, and send the Byzantine fault-tolerant consensus optimization model to the replica node; The replica node is used to determine whether the received Byzantine fault-tolerant consensus optimization model structures are the same, and send the Byzantine fault-tolerant consensus optimization model with the same structure to the smart consensus node; The intelligent consensus node is used to generate a corresponding optimization plan based on the received Byzantine fault-tolerant consensus optimization model, and dynamically adjust the parameters of the Byzantine fault-tolerant consensus optimization model according to the optimization welfare function to output the same optimization plan as the other intelligent consensus nodes.

4. The method according to claim 3, wherein The expression of the optimized welfare function is: ; in, W represents the optimized welfare function, ω 1 represents the weight coefficient corresponding to the smart consensus node score, represents the scoring function of the smart consensus node at the t+1th epoch, F ij represents the score assigned by the i-th smart consensus node to the smart consensus node at the j-th position coordinate at the t+1-th epoch, ω 2 represents the weight coefficient corresponding to the block size scoring function, represents the scoring function of the block size at the t+1th epoch, ω 3 represents the weight coefficient corresponding to the block interval scoring function, represents the scoring function assigned to the block interval by the i-th smart consensus node, N represents the total number of candidate nodes, n Indicates the number of smart consensus nodes that are finally selected in the Byzantine Fault Tolerant consensus optimization model.

5. The method according to claim 3, wherein The method further comprises: Obtaining the utility function output by each intelligent consensus node in the Byzantine fault-tolerant consensus optimization model; Determine whether the utility function in each smart consensus node meets the Nash equilibrium conditions; If the utility function in each intelligent consensus node meets the Nash equilibrium condition, the current Byzantine fault-tolerant consensus optimization model is output to generate the corresponding optimization plan.

6. The method according to claim 5, wherein The expression of the utility function is: ; in, Indicates the i The utility function of a smart consensus node, Indicates the i Optimization suggestions submitted by smart consensus nodes, Indicates that except i The set of optimization suggestions submitted by all smart consensus nodes except the smart consensus nodes, R base represents the basic reward parameter, R c (·) represents the consistency reward function, α represents the weight coefficient corresponding to the consistency reward function, W represents the optimized welfare function, R s (·) represents the consensus reward function, θ represents the weight coefficient corresponding to the consensus reward function, A t+1 Represents the set of optimization suggestions submitted by all smart consensus nodes. P q (·) represents a bias function, and λ represents a weight coefficient corresponding to the bias function.

7. A communication protocol dynamic adaptation device based on the Internet of Things, characterized in that: The communication protocol dynamic adaptation device comprises a data acquisition module (11), a model construction module (12) and a protocol matching module (13) connected in sequence, wherein: The data acquisition module (11) is used to obtain agent information data in the terminal device, wherein the agent information data includes multiple intelligent consensus nodes, network environment status and execution action information of each intelligent consensus node; The model construction module (12) is used to construct a Markov decision process model based on the agent information data, the Markov decision process model includes a state space formed by integrating the network environment state and multiple smart consensus nodes, an action space formed by integrating the network environment state and all execution action information, and a reward function. Based on the dual-duel deep Q network model, the state space, the action space, and the reward function, a Byzantine fault-tolerant consensus optimization model is constructed, wherein the dual-duel deep Q network model includes an evaluation network and a target network, the evaluation network is responsible for generating action value predictions, and the target network is responsible for generating action value targets. The expected cumulative reward obtained by taking action a in state s is represented by constructing an action value function, and the action value function is used to guide the smart consensus node to select the optimal Byzantine fault-tolerant consensus optimization model parameter configuration. The master node in the Byzantine fault-tolerant consensus optimization model is used to obtain a Byzantine fault-tolerant consensus optimization model according to the dual-duel deep Q network training, and send the Byzantine fault-tolerant consensus optimization model to the replica node; The reward function includes: ; in, S t Indicates that the Byzantine fault-tolerant consensus optimization model is in the t The state space at epochs, A represents the action space of the Byzantine fault-tolerant consensus optimization model, R t (S t ,A) represents the reward function, x i Indicates the i The location coordinates of the smart consensus nodes, x j Indicates the j The location coordinates of the smart consensus nodes, Represents the coordinate mean of all smart consensus nodes, β Indicates the degree of dispersion of smart consensus nodes. T tr Indicates the verification time and transmission time of a single block in the consensus process. T vt Indicates the verification time of a single block in the consensus process, T m Indicates the maximum value of the block interval time, μ Indicates the preset ratio parameter of block verification time and block interval time. N represents the total number of candidate nodes, P represents the probability that a candidate node has a Byzantine fault, n Indicates the number of smart consensus nodes that are finally selected in the Byzantine Fault Tolerant consensus optimization model; The block transmission time and verification time of a single block in the consensus process are expressed as: ; ; in, B m represents the maximum block size, Y represents the total number of blocks in the Byzantine fault-tolerant consensus optimization model, p Indicates the first p Smart consensus nodes, γ represents the CPU cycles used to verify the digital signature, η Indicates the CPU cycles used to generate and verify the message verification code, CR cp Indicates the computing resources owned by the master node, CR ci Indicates the computing resources owned by the replication node. PT represents the maximum tolerable delay of the Byzantine fault tolerant consensus optimization model, R cp,ci Represents a smart consensus node cp To smart consensus node ci The data transfer rate between R cj,ci Represents a smart consensus node cj To smart consensus node ci The data transfer rate between R ci,cj Represents a smart consensus node ci To smart consensus node cj Data transfer rate between The protocol matching module (13) is used to construct a Byzantine dynamic adaptive consensus protocol framework based on the Byzantine fault-tolerant consensus optimization model at different stages, so as to dynamically adjust the configuration parameters of the terminal device according to changes in the Internet of Things environment and dynamically adapt the communication protocol currently used by the terminal device; The Byzantine dynamic adaptive consensus protocol framework includes a Byzantine fault-tolerant consensus optimization model in the initialization phase, normal operation phase, dynamic adaptive phase, and iterative optimization phase, among which: During the initialization phase, the PBFT master node uses the Byzantine Fault Tolerance consensus optimization model trained in step S3 to evaluate the current IoT environment and generate the initial Byzantine Fault Tolerance consensus optimization model parameter configuration. The master node distributes the optimization model parameters to other replica nodes through blockchain transactions. During the normal operation phase, all candidate nodes among the smart consensus nodes that wish to join the next round of the consensus committee matrix regularly submit declaration information containing location and resource status information to the blockchain network; In the dynamic adaptation phase, when the parameter configuration of the current Byzantine fault-tolerant consensus optimization model cannot adapt to changes in the IoT environment, the dynamic adaptation process is triggered; During the iterative optimization phase, the master node of the Byzantine fault-tolerant consensus optimization model iteratively trains the Byzantine fault-tolerant consensus optimization model based on the latest data and feedback, and synchronizes the updated model to other replica nodes.

8. An electronic device, characterized in that: The electronic device comprises a processor (21), a memory (25), a user interface (23) and a network interface (24), wherein the memory (25) is used to store instructions, the user interface (23) and the network interface (24) are used to communicate with other devices, and the processor (21) is used to execute the instructions stored in the memory (25) so that the electronic device executes the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • A method and system for automatic adaptation of multiple types of IoT parallel access protocols

    CN113162986B

  • Online dynamic adaptive practical Byzantine consensus protocol implementation method

    CN116722986A