CN-115145784-B - Running environment monitoring method of distributed transaction submission protocol
Abstract
The disclosure relates to an operation environment monitoring method of a distributed transaction commit protocol, and belongs to the technical field of distributed transaction processing. The system environment of each participant is maintained by using the RLSM robustness level state machine, the state maintained by the state machine can be dynamically adjusted by inputting different parameters so as to track the environment of each participant in real time, and a coordinator can determine the system environment level based on the state of the participant corresponding to the RLSM, thereby breaking the fixed assumption of the system environment when the prior distributed transaction is submitted, enabling the distributed transaction submission to dynamically adjust the submission protocol according to the system environment, and improving the efficiency of distributed transaction processing. The automatic adjustment of the RLSM state of the participant is further realized by setting the current protocol and the result setting thereof through the setting state machine input. The input parameters are not fixed when the state machine is further set to be in a reduced level, but are learned based on the execution result of the history submission protocol through reinforcement learning, so that the method is more in line with the distributed transaction processing environment and improves the transaction processing efficiency.
Inventors
- Pan Hexiang
- LI YAOMING
- CHEN GANG
- HUANG MINGJUN
- ZHANG MEIHUI
Assignees
- 北京理工大学
- 北京理工大学
Dates
- Publication Date
- 20260421
- Application Date
- 20220419
- Priority Date
- 20220419
Claims (6)
- 1. An operation environment monitoring method of distributed transaction submitting protocol includes coordinator And a number of participants of distributed transaction T The method is characterized in that: Maintaining a robustness level state machine RLSM for each participant, respectively; The RLSM comprises three states, namely a no-fault level, a breakdown fault level and a network fault level, which respectively represent three fault levels of the environment in which the distributed transaction is submitted; The RLSM transitions between three states according to the input difference; According to The RLSM status of each participant in (a) determines the context level Wherein For no fault level, crashed fault level or network fault level, said For determining the distributed transaction Submitted protocol ; The initial state of the RLSM is a fault-free level; The input is Or (b) , Indicating a crash fault, Indicating a network failure and, Representing a robust reduced transition from a crashed failure level, i.e. said RLSM at crashed failure level, in succession After the sub-fault-free execution, the state is reduced to a fault-free level; representing a transition from a reduced robustness of the network failure level, i.e. said RLSM at the network failure level, in succession After the sub-fault-free execution, the state is reduced to a fault-free level; The RLSM transitions the process between three states according to different inputs: If an input is received when the RLSM is in a failure-free level Then the robustness improvement is transferred to the breakdown fault level, if the input is received Then the robustness improvement is transferred to the network fault level; if an input is received when the RLSM is in a crashed fault level Then the robustness improvement is transferred to the network failure level, if the input is received Then the robustness reduction is transferred to a failure-free level; If an input is received when the RLSM is at a network failure level Then the robustness reduction is transferred to a failure-free level; the input is according to the The said Results of execution of (a) Is determined by the following principle: If said Checking the fault-free level protocol Whether or not the result in (a) can tell the existence of a malignant network failure, if so, input Adjusting the said For network failure level, otherwise, checking the said Whether the participant represented by itself has a malignant crash fault, if present, input Adjusting the said Is a crash fault level; If said To crash the fault level protocol, the Whether or not the result in (a) can tell the existence of a malignant network failure, if so, input Adjusting the said Checking the number of successive fault-free executions if the number reaches the said level Input is then ; If said For network failure level protocols, checking the number of consecutive failure-free executions if the number reaches said number Input is then ; The said Based on the following Obtained by reinforcement learning, said Based on the following Obtained by reinforcement learning.
- 2. The method according to claim 1, wherein the step of Is said The RLSM state grade corresponding to the participant with the worst system environment is the no-fault grade, the breakdown fault grade and the network fault grade from good to bad.
- 3. The method according to claim 1, characterized in that: if the judging condition of the malignant breakdown fault is that For no fault level protocol or crashed fault level protocol, then check If the result of the missing participant exists, judging that a malignant breakdown fault occurs on the missing participant; Judging condition of the malignant network fault if Is a fault-free level protocol, and if no malignant crash fault is detected, then checking If there is a conflict, determining that a malignant network failure has occurred between the participants, if there is If it is a crash fault level protocol, then If there is a conflict, it is determined that a malignant network failure has occurred between the participants.
- 4. The method of claim 1, wherein the reinforcement learning is performed by a reinforcement learning optimizer, the reinforcement learning optimizer comprising a collector, a decision maker and a learner, wherein, The collector receives and buffers the If said Different from the last cached environmental level, the buffer is emptied, and the average throughput of the system during the buffer is buffered And said Sending the result to the decision maker and the reset instruction to the learner, if The same environmental level as the last time, and the buffer is full, the buffer is emptied, and the average throughput of the system during the buffer period of the buffer is obtained And said Sending the two to a decision maker together; the decision making device is provided with a counter and stores parameters , Representing the need for strong chemical practices The initial value of the counter is 1; The initial value is k, k is a real number and is different from the value appearing in the operation process of the decision maker, and the decision maker receives Number pairs, judgment: If it is For the fault-free level, the counter is decremented by 1, if the counter is 0, decision is made, otherwise, the process is exited; If it is If the fault level is not the fault level, resetting; The decision includes the following: If it is If not k, triggering the corresponding RLSM transfer, i.e. setting the input of the RLSM as ; If it is K, send to learner And obtain a feedback number And a feedback decision to be sent back together If (1) If 0, triggering corresponding RLSM transfer, and setting the counter to 1, otherwise, setting the counter to 1 If it is successfully received Then set up Is that ; The reset includes the following: If it is If k is, setting a counter to be 1; If it is If not, setting the counter as ; A learner for adjusting the reinforcement learning model to the initial state if receiving the reset instruction from the collector, and for receiving the data from the decision maker Then by Training reinforcement learning model as return and feeding back decision numbers of model Feedback to decision-making device, if the training of reinforcement learning model is completed, converting its decision-making scheme into digital value And fed back to the decision maker.
- 5. The method of claim 1, wherein the reinforcement learning is performed by a reinforcement learning optimizer, the reinforcement learning optimizer comprising a collector, a decision maker and a learner, wherein, The collector receives and buffers the If said Different from the last cached environmental level, the buffer is emptied, and the average throughput of the system during the buffer is buffered And said Sending the result to the decision maker and the reset instruction to the learner, if The same environmental level as the last time, and the buffer is full, the buffer is emptied, and the average throughput of the system during the buffer period of the buffer is obtained And said Sending the two to a decision maker together; the decision making device is provided with a counter and stores parameters , Representing the need for strong chemical practices The initial value of the counter is 1; The initial value is k, k is a real number and is different from the value appearing in the operation process of the decision maker, and the decision maker receives Number pairs, judgment: If it is For the fault-free level, the counter is decremented by 1, if the counter is 0, decision is made, otherwise, the process is exited; If it is If the fault level is not the fault level, resetting; The decision includes the following: If it is If not k, triggering corresponding RLSM transfer, i.e. setting the The input of the RLSM corresponding to each participant is ; If it is K, send to learner And obtain a feedback number And a feedback decision to be sent back together If (1) If 0, triggering corresponding RLSM transfer, and setting the counter to 1, otherwise, setting the counter to 1 If it is successfully received Then set up Is that ; The reset includes the following: If it is If k is, setting a counter to be 1; If it is If not, setting the counter as ; A learner for adjusting the reinforcement learning model to the initial state if receiving the reset instruction from the collector, and for receiving the data from the decision maker Then by Training reinforcement learning model as return and feeding back decision numbers of model Feedback to decision-making device, if the training of reinforcement learning model is completed, converting its decision-making scheme into digital value And fed back to the decision maker.
- 6. The method of claim 4 or 5, wherein the reinforcement learning model is a q-learning model.
Description
Running environment monitoring method of distributed transaction submission protocol Technical Field The disclosure relates to the technical field of distributed transaction processing, in particular to an operation environment monitoring method of a distributed transaction submission protocol. Background Transactions are widely used in databases to store important information, which integrates a series of key operations for users and ensures four properties (atomicity, consistency, isolation, durability) of ACID. Of these four attributes, atomicity ensures that operations in a transaction occur simultaneously, but implementation of this property also introduces additional overhead into databases, particularly distributed databases. In a distributed database, data is split and distributed across different nodes to achieve horizontal expansion. This presents a new challenge to guaranteeing the atomicity of transactions-all participating nodes need to commit or rollback a transaction to stay consistent. The problem of distributed transaction commitment arises from this and is receiving extensive attention from the industry as well as from academia. However, to our knowledge, existing distributed transaction commit protocols all suffer from a fundamental shortcoming, namely their fixed assumption about the system environment (node behavior and network connection behavior). This defect limits further increases in the efficiency of the distributed database. Disclosure of Invention The present disclosure aims to overcome or partially overcome the above technical problems, and provides an environment detection method for distributed transaction submission, which enables a coordinator to comprehensively grasp a system environment and to timely change a distributed transaction submission protocol according to environmental changes, thereby improving the efficiency of a distributed database. In a first aspect, an embodiment of the present disclosure provides a method for monitoring a running environment of a distributed transaction commit protocol, including a coordinatorAnd a number of participants of a transaction T, Maintaining a robustness level state machine RLSM for each participant, respectively; The RLSM comprises three states, namely a no-fault level, a breakdown fault level and a network fault level, which respectively represent three fault levels of the environment in which the distributed transaction is submitted; The RLSM transitions between three states according to the input difference; According to The RLSM status of each participant in (a) determines the context levelWhereinFor no fault level, crashed fault level or network fault level, saidFor determining the distributed transactionSubmitted protocol。 In a second aspect, embodiments of the present disclosure provide an electronic device, including: A memory; Processor, and A computer program; wherein the computer program is stored in the memory and configured to be executed by the processor to implement the method of the first aspect. In a third aspect, embodiments of the present disclosure provide a computer-readable storage medium, on which a computer program is stored, which when executed by a processor implements the method of the first aspect. The beneficial effects are that: According to the method, the system environment of each participant is maintained by using the RLSM robustness level state machine, the state maintained by the state machine can be dynamically adjusted by inputting different parameters so as to track the environment of each participant in real time, a coordinator can determine the system environment level based on the state of the participant corresponding to the RLSM, the fixed assumption of the system environment when the existing distributed transaction is submitted is broken, and the distributed transaction submitting can dynamically adjust the submitting protocol according to the system environment, so that the efficiency of distributed transaction processing is improved. Furthermore, by setting the state machine input to be set together by the current distributed transaction commit protocol and the execution result thereof, the automatic adjustment of the state of the RLSM state machine of the participant can be realized, that is, the state of the participant is dynamically determined by the execution result of the previous commit protocol, and the current state of the participant determines the commit protocol to be adopted when the next distributed transaction is committed. Furthermore, the input parameters when the state machine is set to be in a lower level are not fixed, but are learned based on the execution result of the history submission protocol through reinforcement learning, so that the method and the device are more in line with the distributed transaction processing environment and the distributed transaction processing efficiency is improved. Drawings The accompanying drawings, which are incorporated i