Distributed e-commerce order processing method based on GRAFT-EWMA consensus algorithm

By adopting the GRAFT-EWMA consensus algorithm in a distributed e-commerce order processing system, combining the advantages of the Raft and PBFT algorithms, and introducing external supervisory nodes for real-time monitoring, the problems of high consensus latency, low throughput, and insufficient Byzantine fault tolerance in the existing system under high concurrency and dynamic network conditions are solved, achieving more efficient, secure, and reliable order processing.

CN119402238BActive Publication Date: 2025-09-19YANGZHOU UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411484050.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-23
Publication Date
2025-09-19
Estimated Expiration
2044-10-23

AI Technical Summary

Technical Problem

Existing distributed e-commerce order processing systems suffer from high consensus latency, low throughput, and insufficient Byzantine fault tolerance when faced with high concurrency and dynamic network conditions, affecting system performance and security.

Method used

A distributed e-commerce order processing method based on the GRAFT-EWMA consensus algorithm is adopted. By grouping and adjusting the weights of nodes, combining the advantages of Raft and PBFT algorithms, and introducing external supervisory nodes for real-time monitoring, the transparency and security of the consensus process are ensured.

Benefits of technology

It significantly reduces consensus latency, improves throughput, and enhances the system's robustness and Byzantine fault tolerance, enabling it to maintain efficient consensus processes and data consistency in a dynamically changing environment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119402238B_ABST
    Figure CN119402238B_ABST
Patent Text Reader

Abstract

The present invention discloses a distributed e-commerce order processing method based on the GRAFT-EWMA consensus algorithm, which clarifies the data consistency requirements of the e-commerce order processing system in a high-concurrency environment, defines the performance indicators of the system in combination with business scenarios; divides the nodes participating in the consensus into several groups, determines the number of nodes in each group, and counts the initial weight of each node; monitors the performance and stability of the nodes; adjusts the weights of the nodes in real time, and normalizes the different weights; groups the nodes participating in the consensus, and assigns master nodes and leader nodes to optimize the consensus process; introduces external supervision nodes, adopts a multi-level supervision strategy to monitor all participating nodes in real time; and regularly evaluates the performance of the e-commerce order processing system to ensure that an efficient consensus process and data consistency are maintained in a dynamically changing environment. The present invention improves the security and efficiency in large-scale distributed e-commerce systems and is particularly suitable for high-concurrency e-commerce environments.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of distributed systems, and in particular to a distributed e-commerce order processing method based on the GRAFT-EWMA consensus algorithm. Background Art

[0002] With the rapid development of distributed e-commerce, ensuring efficient and reliable order processing across multiple nodes under decentralized control has become a major challenge. Against this backdrop, consensus algorithms, as a crucial mechanism for achieving system consistency, are gaining increasing attention. Currently, the mainstream consensus algorithms include Raft and PBFT (Practical Byzantine Fault Tolerance). Raft, due to its high efficiency and simplicity, is widely used in small-scale e-commerce order processing systems, particularly in terms of low latency and high throughput. However, Raft lacks fault tolerance in the face of Byzantine faults and cannot effectively defend against attacks from malicious nodes, thus compromising the overall security of the system. In contrast, PBFT can tolerate the presence of Byzantine nodes, ensuring system security. However, it incurs high communication overhead and latency, leading to a sharp decline in system performance, particularly as the number of nodes increases. In e-commerce environments, this performance degradation can lead to delays in order processing, impacting user experience. To balance performance and security in distributed e-commerce order processing systems, hybrid consensus algorithms are gaining attention. By combining the strengths of Raft and PBFT, these algorithms can improve system performance while maintaining a certain level of Byzantine fault tolerance. However, existing hybrid consensus algorithms exhibit limitations when faced with dynamic network conditions and are unable to flexibly adapt to network fluctuations, resulting in unstable performance, especially in high-concurrency order processing scenarios.

[0003] As the number of nodes and order requests increases, the consensus latency of traditional algorithms (such as Raft and PBFT) increases significantly, affecting the system's response speed and processing efficiency. In addition, many algorithms face challenges in maintaining stability and consistency in the face of malicious nodes or network failures. To address these issues, this technical solution proposes a distributed e-commerce order processing system based on the GRAFT-EWMA algorithm. This solution tests the performance of the algorithm under different network conditions, node numbers, and load intensities to evaluate its consensus latency, throughput, and Byzantine fault tolerance in e-commerce order processing. Preliminary results show that in a 60-node network, the consensus latency of this method is approximately 200ms, which is 60% lower than Raft, while increasing throughput by 30%. This demonstrates the effectiveness of the algorithm in improving the efficiency of distributed e-commerce order processing systems and can provide faster consensus speeds and higher throughput as the number of nodes and order requests increase. Summary of the Invention

[0004] Purpose of the invention: The present invention provides a distributed e-commerce order processing method based on the GRAFT-EWMA consensus algorithm, aiming to improve the consistency management efficiency of the distributed e-commerce order processing system, reduce transaction processing delays, and enhance the robustness and anti-Byzantine fault tolerance of the system.

[0005] Technical solution: The distributed e-commerce order processing method based on the GRAFT-EWMA consensus algorithm described in the present invention specifically includes the following steps:

[0006] (1) Clarify the data consistency requirements of e-commerce order processing in a high-concurrency environment and define the performance indicators of the e-commerce order processing system based on business scenarios;

[0007] (2) Divide the nodes participating in the consensus into several groups, determine the number of nodes in each group, and calculate the initial weight of each node for weight analysis and adjustment;

[0008] (3) Monitor the performance and stability of nodes, evaluate the reliability of nodes through set measurement values, and provide data support for subsequent node weight adjustments;

[0009] (4) Adjust the node weights in real time based on the node’s stability and performance, and normalize different weights to ensure fairness;

[0010] (5) Group the nodes participating in the consensus and assign a master node and a leader node to each group to optimize the consensus process;

[0011] (6) Introducing external supervisory nodes and adopting a multi-level supervisory strategy to monitor all participating nodes in real time to ensure the transparency and security of the consensus process;

[0012] (7) Regularly evaluate the performance of the e-commerce order processing system and implement optimization measures to ensure efficient consensus processes and data consistency in a dynamically changing environment.

[0013] Furthermore, the performance indicators of the distributed e-commerce order processing system in step (1) include response time, throughput, and fault tolerance.

[0014] Furthermore, in step (2), the nodes participating in the consensus are divided into several groups, and the number of nodes in each group is determined as follows:

[0015] The number of groups required for PBFT consensus should be no less than four to provide sufficient redundant nodes to tolerate potential errors in the system; the number of Raft consensus nodes in each group should be no less than three to meet the requirements of the majority principle in the consensus process and ensure the normal operation of the system.

[0016] Furthermore, the implementation process of counting the initial weight of each node in step (2) is as follows:

[0017] Initialize the weight W0 for each node and periodically collect the observation value X of each node at time t t ; The node's performance is smoothed using the exponentially weighted moving average (EWMA) to calculate the node's weight; the calculation process of EWMA is as follows:

[0018] W t =αX t +(1-α)W t-1

[0019] Among them, W t is the weight of the node, X t is the observation value at time t, α is the smoothing coefficient, W t-1 is the weight value at the previous moment; at each time interval, the system collects the latest performance data of each node, calculates the node's weight, and updates the node's importance in the network;

[0020] Preprocess the initial node weight data, including removing invalid node data and adjusting the weight ratio of node groups to ensure that each group has a reasonable load distribution during the consensus process, optimize the overall performance of the system and improve consensus efficiency.

[0021] Furthermore, the implementation process of step (3) is as follows:

[0022] Perform weight updates to ensure timely responses to node changes and maintain system stability and consistency in a dynamic environment:

[0023]

[0024] The variance of node performance is calculated periodically using the following formula:

[0025]

[0026] in, is the variance of node performance, λ is the smoothing factor, and μ is the mean value of node performance data;

[0027] After calculating the node variance, the upper control limit UCL and the lower control limit LCL of the control chart are calculated using the following formula to determine their thresholds:

[0028]

[0029] Among them, L is the control limit parameter, which takes a value of 3. The actual measurement value is compared with the set threshold. If the measurement value of a node exceeds the threshold, the system will identify the node as a node with large performance fluctuations. The workload of the node with large performance fluctuations will then be adjusted to reduce its impact on the overall system performance, and it will be reallocated to other groups to reduce the impact on a single group.

[0030] Furthermore, the implementation process of step (4) is as follows:

[0031] If there is more than one node measurement value, use the following formula to calculate the EWMA value W for each performance measurement value t,j :

[0032] W t,j =α·X t,j +(1-α)·W t-1,j

[0033] Among them, X t,j represents the measured value of the jth performance at time t; combining different types of performance indicators, the EWMA value of each performance is normalized using the following formula:

[0034]

[0035] Each performance measure is assigned a weight γ by the following formula j , so that nodes with smaller variance and more stable performance receive higher weights:

[0036]

[0037] Use the following formula to combine the normalized EWMA values ​​to get the comprehensive weight W of each node: t :

[0038]

[0039] Furthermore, the implementation process of step (5) is as follows:

[0040] Rank the weights of the nodes from best to worst, and then group them using the following formula to ensure balanced performance of the nodes in each group:

[0041] G i =((i-1)mod k)+1

[0042] Among them, G iis the i-th group; each group is a Raft group, and the node with the best weight value is used as the leader in each group, and each leader constitutes a member of PBFT; after obtaining the comprehensive weight of all nodes, the system sorts the weights, and then sets the node with the best weight as the master node in PBFT. After that, the excellent nodes are placed in different groups in turn, and so on, so that in each Raft group, the leader node is the best node locally.

[0043] Furthermore, the implementation process of step (6) is as follows:

[0044] At the PBFT master accounting node level, ensure that the number of master accounting nodes satisfies n ≥ 3f + 1, where f is the number of Byzantine nodes. Master accounting nodes regularly record and verify system logs to ensure log accuracy. During system initialization, all PBFT master accounting nodes are elected according to algorithmic rules to ensure that they will not become Byzantine nodes.

[0045] When the possibility of a Byzantine node is detected, the PBFT master accounting node sends regular log reports to the external supervision node. The external supervision node verifies the validity of the events recorded in the system based on the log reports from the PBFT master accounting node and marks any suspicious nodes.

[0046] External supervisory nodes regularly collect log data from the PBFT master accounting node as the basis for verification. Through a regular external supervision mechanism, external supervisory nodes dynamically track and evaluate whether the Raft leader node exhibits Byzantine behavior.

[0047] After each election, the Raft leader node cross-verifies the election results with an external supervisory node. If the external supervisory node finds inconsistencies in the new leader node or abnormal logs in the Byzantine node, a new round of Raft leader election is immediately triggered and the Byzantine node is marked as a failed node.

[0048] The entire mechanism uses cyclical elections and supervision to ensure that the ultimately selected Leader node can pass the verification of external supervisory nodes, ensuring that its logs and behaviors meet the system consensus requirements, thereby reducing the impact of Byzantine nodes on the overall performance and security of the system.

[0049] During each round of supervision, the activity logs of the external monitoring nodes are compared with the logs of the PBFT master accounting node to ensure the correctness and consistency of the monitoring node operations and maintain the overall security and stability of the system.

[0050] Furthermore, the implementation process of step (7) is as follows:

[0051] Collect and record the key performance indicators of the system in real time, including consensus latency, node stability, and throughput; based on the collected data, identify abnormal patterns or trends through data analysis and issue timely alerts for intervention; and formulate corresponding optimization plans based on the results of performance evaluation.

[0052] Beneficial effects: Compared with the prior art, the present invention has the following beneficial effects:

[0053] The grouping mechanism proposed in this paper effectively improves the system's robustness in the face of failures and attacks, ensuring normal operation in the event of node failure or abnormality. The established supervisory node module can effectively monitor the behavior of key nodes, prevent Byzantine nodes from occupying the leader role for a long time, and ensure data correctness during the consensus process. Combining the advantages of Raft and PBFT, while ensuring security and stability, it significantly reduces consensus latency and increases throughput. By dynamically adjusting node weights and introducing a grouping mechanism, this method can effectively address consistency challenges in high-concurrency environments and ensure the security and reliability of data in distributed e-commerce order processing systems.

[0054] Simulation experiment results show that the present invention significantly improves the consistency maintenance efficiency of order processing when processing large-scale node networks, and has strong fault tolerance and throughput performance; this method not only achieves fast consistency in an environment without Byzantine failures, but also can effectively filter malicious nodes in the face of Byzantine node attacks, maintain system data consistency, and ensure the security and stability of distributed e-commerce order processing systems in complex network environments. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] Figure 1 This is a schematic diagram of the GRAFT-EWMA consensus algorithm framework proposed in this invention;

[0056] Figure 2 This is the flow chart of the GRAFT-EWMA consensus algorithm proposed in this invention;

[0057] Figure 3 This is a flow chart of introducing an external supervisory node proposed by the present invention;

[0058] Figure 4 This is a comparison chart of the consensus delay and consensus request of the present invention. DETAILED DESCRIPTION

[0059] The present invention will be further described in detail below with reference to the accompanying drawings.

[0060] like Figure 1 、 Figure 2The present invention proposes a distributed e-commerce order processing method based on the GRAFT-EWMA (Grouped Raft Anti-Byzantine Consensus Algorithm Based on Exponential Weighted Moving Average) consensus algorithm, comprising the following steps:

[0061] Step 1: Clarify the data consistency requirements of the e-commerce order processing system in a high-concurrency environment and define the system's performance indicators based on business scenarios.

[0062] Clarify the key consistency requirements of distributed e-commerce order processing systems in high-concurrency environments. For example, in order transactions or real-time inventory management scenarios, strong consistency is required to ensure that all nodes have access to the latest order and inventory data at the same time. E-commerce order processing systems manage user order information, including user ID, order ID, product details, order status, payment information, and logistics information. This system achieves high-concurrency processing capabilities through a distributed architecture, ensuring data consistency and reliability during order processing to meet the real-time and accuracy requirements of e-commerce platforms.

[0063] Based on the business scenario, define the system's performance indicators, including response time, throughput, fault tolerance, etc., and communicate with e-commerce system administrators and end users to understand their expectations for consistency management.

[0064] Based on the needs analysis, select an appropriate technology stack, including a distributed e-commerce system, programming language, and related frameworks that support the GRAFT-EWMA algorithm, ensuring efficient inter-node communication and data consistency management. Identify key data sets, including product inventory, customer information, and order data. During the system initialization phase, configure each node to handle the corresponding data set and establish basic network connectivity.

[0065] Step 2: Divide the nodes participating in the consensus into several groups, determine the number of nodes in each group, and calculate the initial weight of each node for subsequent weight analysis and adjustment.

[0066] To ensure the stability and security of the system, the number of groups and the number of nodes in each group must meet specific requirements. The number of groups required for PBFT consensus should be no less than 4 (k ≥ 4) to provide sufficient redundant nodes to tolerate potential errors in the system. At the same time, the number of Raft consensus nodes in each group should be no less than 3 (m ≥ 3) to meet the requirements of the majority principle in the consensus process, thereby ensuring the normal operation of the system. First, initialize the weight W0 of each node and periodically collect the observation value X of each node. tThe node's weight is calculated by smoothing the node's performance using an exponentially weighted moving average (EWMA). The calculation process of EWMA is as follows:

[0067] W t =αX t +(1-α)W t-1

[0068] Among them, W t is the weight of the node, X t is the observation value at time t, and α is the smoothing coefficient (range is between 0 and 1). t-1 is the weight value at the previous moment. At each time interval, the system collects the latest performance data of each node (such as response time and processing speed) and uses this formula to calculate the node's weight, updating the node's importance in the network. The EWMA calculation process continuously takes a weighted average of new observations. By applying exponential decay to historical data, this makes the average more sensitive to the latest data while maintaining a certain memory of historical data.

[0069] Preprocess the initial node weight data, including removing invalid node data and adjusting the weight ratio of node groups to ensure that each group has a reasonable load distribution during the consensus process, thereby optimizing the overall performance of the system and improving consensus efficiency.

[0070] The distributed e-commerce order processing system collects node weight statistics by collecting each node's processing capacity (the number of orders that can be processed per second), network latency (average response time with other nodes), and failure rate (the number of disconnections in the past week), ensuring that high-performance nodes receive higher priority in the consensus process.

[0071] Step 3: Monitor the performance and stability of the nodes, evaluate the reliability of the nodes through the set measurement values, and provide data support for subsequent node weight adjustments.

[0072] When calculating node weights, the system detects significant changes in node performance (such as a sudden increase or decrease in performance) using the following formula to adjust the weights. This allows the node weights to quickly reflect the latest performance status, allowing the system to quickly adapt to the new node state. Specifically, the formula updates the weights to ensure that node changes are promptly addressed, maintaining system stability and consistency in a dynamic environment.

[0073] W t =W t-1 +αX t -W t-1 )

[0074] The system periodically calculates the variance of node performance using the following formula:

[0075]

[0076] in, is the variance of node performance, λ is the smoothing factor, and μ is the average of node performance data. By calculating the variance, the system can assess node performance fluctuations, thereby identifying abnormally performing nodes and addressing them promptly to ensure overall system stability and optimize consensus efficiency.

[0077] After calculating the node variance, the upper control limit (UCL) and the lower control limit (LCL) of the control chart are calculated using the following formula to determine their thresholds:

[0078]

[0079] Where L is the control limit parameter, which is usually set to 3. UCL and LCL are used to monitor the stability of node performance and ensure that it operates within the preset range, so as to promptly detect and handle nodes with abnormal performance to maintain the normal operation of the system and improve consensus efficiency.

[0080] The actual measured value is compared with the set threshold. If the measured value of a node exceeds the threshold, the system will identify the node as having large performance fluctuations. The system will then adjust the workload of the node with large performance fluctuations to reduce its impact on the overall system performance and redistribute it to other groups to reduce the impact on a single group.

[0081] For example, when processing an order, the system determines the stability of the node. When processing an order, the system monitors the status of each node in real time. If a node's processing delay exceeds a preset threshold (for example, 200 milliseconds) or fails multiple times (for example, failing to respond three times in a row), the node is marked as unstable. The method automatically adjusts its weight to reduce its influence in the consensus.

[0082] Step 4: Adjust the node weights in real time based on the node’s stability and performance, and normalize the different weights to ensure fairness.

[0083] If there is more than one measurement value, use the following formula to calculate the EWMA value W for each performance measurement value t,j :

[0084] W t,j =α·X t,j +(1-α)·W t-1,j

[0085] Among them, X t,jrepresents the measured value of the jth performance at time t. By performing separate weighted average processing on different performance indicators, the system can more comprehensively reflect the comprehensive performance of the node, thereby improving its sensitivity and adaptability to changes in node status.

[0086] Combining different types of performance indicators, the EWMA values ​​of various performance indicators are normalized using the following formula:

[0087]

[0088] Each performance measure is assigned a weight γ by the following formula j , which can make nodes with smaller variance and more stable performance obtain higher weights:

[0089]

[0090] Use the following formula to combine the normalized EWMA values ​​to get the comprehensive weight W of each node: t :

[0091]

[0092] By normalizing the weights of the same node in different time periods, the comprehensive weight of each node is obtained, ensuring that the contribution of each node is fairly considered in the consensus process.

[0093] Step 5: Group the nodes participating in the consensus and assign a master node and a leader node to each group to optimize the consensus process; ensure that order requests can be processed in a timely manner and that the generated order records are consistent among all nodes.

[0094] Rank the weights of each node from best to worst, and then group them using the following formula to ensure balanced performance of nodes in each group and improve overall system performance:

[0095] G i =((i-1)mod k)+1

[0096] Among them, G iis the i-th group. Each group is a Raft group. Within each group, the leader with the highest weight is chosen. These leaders form the members of PBFT. Due to the high quality of the leaders, overall response speed and throughput are also excellent. Throughout the entire process, the GRAFT-EWMA algorithm leverages the strengths of both Raft and PBFT. After obtaining the combined weights of all nodes, the system sorts them by weight. The node with the highest weight is then designated as the master node in PBFT. These nodes are then assigned to different groups, and so on. This ensures that within each Raft group, the leader node is the best node locally, and that the overall quality of each Raft group is roughly the same. The algorithm also monitors and adjusts node performance, identifying and isolating abnormal nodes. In this algorithm, PBFT can better withstand Byzantine failures. In contrast, when the system load is low, Raft can temporarily shut down nodes in some Raft groups to conserve resources and reduce energy consumption, thereby enhancing overall system efficiency and stability.

[0097] Step 6, such as Figure 3 As shown in the figure, external supervisory nodes are introduced and a multi-level supervisory strategy is adopted to monitor all participating nodes in real time to ensure the transparency and security of the consensus process.

[0098] At the PBFT master accounting node level, ensure that the number of master accounting nodes satisfies n ≥ 3f + 1 (where f is the number of Byzantine nodes). Master accounting nodes regularly record and verify system logs to ensure log accuracy. During system initialization, all PBFT master accounting nodes are elected according to algorithmic rules to ensure that they will not become Byzantine nodes.

[0099] When the possibility of a Byzantine node is detected, the PBFT master accounting node sends regular log reports to the external supervision node. The external supervision node verifies the validity of the events recorded in the system based on the log reports of the PBFT master accounting node and marks any suspicious nodes.

[0100] External supervisory nodes regularly collect log data from the PBFT master accounting node as the basis for verification. Through this regular external supervision mechanism, external supervisory nodes can dynamically track and evaluate whether the Raft leader node exhibits Byzantine behavior.

[0101] After each election, the Raft leader node must cross-verify the election results with an external supervisory node. If the external supervisory node finds inconsistencies in the new leader node or abnormal logs in the Byzantine node, a new round of Raft leader election will be triggered immediately, and the Byzantine node will be marked as a failed node.

[0102] Through cyclical elections and supervision, the system ensures that the ultimately selected Leader node can pass the verification of external supervisory nodes, ensuring that its logs and behaviors meet the system consensus requirements, and reducing the impact of Byzantine nodes on the overall performance and security of the system.

[0103] During each round of supervision, the activity logs of the external monitoring nodes are compared with the logs of the PBFT master accounting node to ensure the correctness and consistency of the monitoring node operations and maintain the overall security and stability of the system.

[0104] Step 7: Regularly evaluate the performance of the e-commerce order processing system and implement necessary optimization measures to ensure efficient consensus and data consistency in a dynamically changing environment.

[0105] Real-time collection and recording of key performance indicators of the system, including consensus latency, node stability, throughput, etc.

[0106] Based on the collected data, through data analysis, abnormal patterns or trends are identified, such as a significant increase in node response time or fluctuations in data consistency, and timely alerts are issued for intervention;

[0107] Based on the results of the performance evaluation, we can formulate corresponding optimization plans. For example, if the consensus delay is found to be too high, we can consider adjusting the node weight distribution.

[0108] Through the above steps, the system is able to maintain optimal performance in a dynamically changing e-commerce environment, respond promptly to user needs, and enhance overall order processing capabilities and user experience. In a highly concurrent e-commerce order processing environment, the system successfully processed over 30,000 orders. Performance testing showed that with 60 nodes, the system's consensus latency was approximately 200 milliseconds, a 60% reduction compared to the traditional Raft algorithm. Ultimately, all order data was consistent within the distributed e-commerce order processing system, effectively preventing order conflicts caused by node failures or malicious behavior, thereby ensuring the operational efficiency of the e-commerce platform and improving the user experience.

[0109] Using an 11th Gen Inrel(R)Core(TM) i5-11400@2.60Hz server with 6 cores and 12 threads, we configured the gcc compiler and implemented the GRAFT-EWMA, Raft, and VSSB-Raft consensus algorithms in C++. We also implemented simulations of the node class, message passing mechanism, and consensus algorithm. By introducing the consensus request count and the number of consensus request nodes as variables, we evaluated the consensus latency of the Raft, VSSB-Raft, and GRAFT-EWMA consensus algorithms. Figure 4As shown in Figure 2, the consensus latency is compared under different numbers of nodes and different numbers of node requests. Specifically, the GRAFT-EWMA algorithm is able to provide faster consensus speed and lower latency as the number of nodes and consensus requests increase.

[0110] There are many methods and approaches to implement the technical solution of the present invention. The above is merely a preferred embodiment of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and such improvements and modifications should also be considered within the scope of protection of the present invention. Any components not specified in this embodiment may be implemented using existing technologies.

Claims

1. A distributed e-commerce order processing method based on the GRAFT-EWMA consensus algorithm, characterized in that: The following steps are involved: (1) Clarify the data consistency requirements of e-commerce order processing in a high-concurrency environment and define the performance indicators of the e-commerce order processing system based on business scenarios; (2) Divide the nodes participating in the consensus into several groups, determine the number of nodes in each group, and calculate the initial weight of each node for weight analysis and adjustment; (3) Monitor the performance and stability of nodes, evaluate the reliability of nodes through set measurement values, and provide data support for subsequent node weight adjustments; (4) Adjust the node weights in real time based on the node’s stability and performance, and normalize different weights to ensure fairness; (5) Group the nodes participating in the consensus and assign a master node and a leader node to each group to optimize the consensus process; (6) Introducing external supervisory nodes and adopting a multi-level supervisory strategy to monitor all participating nodes in real time to ensure the transparency and security of the consensus process; (7) Regularly evaluate the performance of the e-commerce order processing system and implement optimization measures to ensure efficient consensus processes and data consistency in a dynamically changing environment.

2. The distributed e-commerce order processing method based on the GRAFT-EWMA consensus algorithm according to claim 1 is characterized in that: The performance indicators of the distributed e-commerce order processing system in step (1) include response time, throughput, and fault tolerance.

3. The distributed e-commerce order processing method based on the GRAFT-EWMA consensus algorithm according to claim 1 is characterized in that: Step (2) divides the nodes participating in the consensus into several groups, and determines the number of nodes in each group as follows: The number of groups required for PBFT consensus should be no less than four to provide sufficient redundant nodes to tolerate potential errors in the system; the number of Raft consensus nodes in each group should be no less than three to meet the requirements of the majority principle in the consensus process and ensure the normal operation of the system.

4. The distributed e-commerce order processing method based on the GRAFT-EWMA consensus algorithm according to claim 1 is characterized in that: The implementation process of counting the initial weight of each node in step (2) is as follows: Initialize the weight W0 for each node and periodically collect the observation value X of each node at time t t ; The node's performance is smoothed using the exponentially weighted moving average (EWMA) to calculate the node's weight; the calculation process of EWMA is as follows: IN t =αX t +(1-α)W t-1 Among them, W t is the weight of the node, X t is the observation value at time t, α is the smoothing coefficient, W t-1 is the weight value at the previous moment; at each time interval, the system collects the latest performance data of each node, calculates the node's weight, and updates the node's importance in the network; Preprocess the initial node weight data, including removing invalid node data and adjusting the weight ratio of node groups to ensure that each group has a reasonable load distribution during the consensus process, optimize the overall performance of the system and improve consensus efficiency.

5. The distributed e-commerce order processing method based on the GRAFT-EWMA consensus algorithm according to claim 1 is characterized in that: The implementation process of step (3) is as follows: Perform weight updates to ensure timely responses to node changes and maintain system stability and consistency in a dynamic environment: W t =W t-1 +α(X t -W t-1 ); The variance of node performance is calculated periodically using the following formula: in, is the variance of node performance, λ is the smoothing factor, and μ is the mean value of node performance data; After calculating the node variance, the upper control limit UCL and the lower control limit LCL of the control chart are calculated using the following formula to determine their thresholds: Where L is the control limit parameter. The actual measurement value is compared with the set threshold. If the measurement value of a node exceeds the threshold, the system will identify the node as a node with large performance fluctuations. The system will then adjust the workload of the node with large performance fluctuations to reduce its impact on the overall system performance and redistribute it to other groups to reduce the impact on a single group.

6. The distributed e-commerce order processing method based on the GRAFT-EWMA consensus algorithm according to claim 1 is characterized in that: The implementation process of step (4) is as follows: If there is more than one node measurement value, use the following formula to calculate the EWMA value W for each performance measurement value t,j : W t,j =α·X t,j +(1-a)·W t-1,j Among them, X t,j represents the measured value of the jth performance at time t; combining different types of performance indicators, the EWMA value of each performance is normalized using the following formula: Each performance measure is assigned a weight γ by the following formula j , so that nodes with smaller variance and more stable performance receive higher weights: Use the following formula to combine the normalized EWMA values ​​to get the comprehensive weight W of each node: t :

7. The distributed e-commerce order processing method based on the GRAFT-EWMA consensus algorithm according to claim 1 is characterized in that: The implementation process of step (5) is as follows: Rank the weights of the nodes from best to worst, and then group them using the following formula to ensure balanced performance of the nodes in each group: G i =((i-1)mod k)+1 Among them, G i is the i-th group; each group is a Raft group, and the node with the best weight value is used as the leader in each group, and each leader constitutes a member of PBFT; after obtaining the comprehensive weight of all nodes, the system sorts the weights, and then sets the node with the best weight as the master node in PBFT. After that, the excellent nodes are placed in different groups in turn, and so on, so that in each Raft group, the leader node is the best node locally.

8. The distributed e-commerce order processing method based on the GRAFT-EWMA consensus algorithm according to claim 1 is characterized in that: The implementation process of step (6) is as follows: At the PBFT master accounting node level, ensure that the number of master accounting nodes satisfies n ≥ 3f + 1, where f is the number of Byzantine nodes. Master accounting nodes regularly record and verify system logs to ensure log accuracy. During system initialization, all PBFT master accounting nodes are elected according to algorithmic rules to ensure that they will not become Byzantine nodes. When the possibility of a Byzantine node is detected, the PBFT primary accounting node sends regular log reports to the external supervision node; External supervisory nodes confirm the validity of events recorded in the system based on the log reports of the PBFT master accounting node and mark any suspicious nodes; External supervisory nodes regularly collect log data from the PBFT master accounting node as the basis for verification. Through a regular external supervision mechanism, external supervisory nodes dynamically track and evaluate whether the Raft leader node exhibits Byzantine behavior. After each election, the Raft leader node cross-verifies the election results with an external supervisory node. If the external supervisory node finds inconsistencies in the new leader node or abnormal logs in the Byzantine node, a new round of Raft leader election is immediately triggered and the Byzantine node is marked as a failed node. The entire mechanism uses cyclical elections and supervision to ensure that the ultimately selected Leader node can pass the verification of external supervisory nodes, ensuring that its logs and behaviors meet the system consensus requirements, thereby reducing the impact of Byzantine nodes on the overall performance and security of the system. During each round of supervision, the activity logs of the external monitoring nodes are compared with the logs of the PBFT master accounting node to ensure the correctness and consistency of the monitoring node operations and maintain the overall security and stability of the system.

9. The distributed e-commerce order processing method based on the GRAFT-EWMA consensus algorithm according to claim 1 is characterized in that: The implementation process of step (7) is as follows: Real-time collection and recording of key performance indicators of the system, including consensus latency, node stability, and throughput. Based on the collected data, through data analysis, abnormal patterns or trends are identified and timely alerts are issued for intervention. According to the results of performance evaluation, formulate corresponding optimization plans.

10. The distributed e-commerce order processing method based on the GRAFT-EWMA consensus algorithm according to claim 5 is characterized in that: The control limit parameter L is set to 3.