Protocol switching management method and device, electronic equipment and storage medium
By setting up standardized interfaces and dynamic protocol adaptation algorithms in the server management system, combining hybrid data synchronization and hierarchical storage, the problems of high protocol switching error rate and inconsistent synchronization are solved, efficient and secure protocol dynamic adaptation and collaborative work are achieved, and operation and maintenance efficiency and data consistency are improved.
Patent Information
- Application Number
- CN202510577024.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-06
- Publication Date
- 2025-09-05
AI Technical Summary
In the prior art, the error judgment rate during protocol switching is high, and the real-time load changes cannot be dynamically adapted to the problem of protocol rigidity, resulting in low operation and maintenance efficiency and inconsistency in data synchronization.
By setting up a standardized application program interface, configuring the first communication protocol and the second communication protocol, obtaining their communication performance index data, building a communication protocol scoring model, and adjusting dynamic weight parameters in real time through reinforcement learning algorithms, dynamically selecting the optimal protocol for switching, and combining hybrid data synchronization and hierarchical storage architecture, dynamic adaptation and collaborative work of the protocol are achieved.
It significantly reduces the protocol error switching rate, from 38% to below 5%, improves operation and maintenance efficiency, supports seamless switching in high concurrency scenarios, meets the low latency requirements of 5G URLLC scenarios, and ensures data consistency and security.
Smart Images

Figure CN120602568A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a protocol switching management method, device, electronic device, and storage medium. Background Art
[0002] With the rapid development of cloud computing, edge computing, and 5G technologies, modern data centers are increasingly demanding real-time, reliable, and intelligent server management. As a core component for server hardware management, the baseboard management controller (BMC) faces key challenges in terms of protocol compatibility and data synchronization efficiency. Traditional management protocols, such as IPMI, struggle to support high-concurrency O&M operations due to their low bandwidth (≤1Gbps) and poor scalability. While the modern Redfish protocol supports high throughput and flexible scalability, it still relies on IPMI for scenarios like firmware upgrades and secure erase, leading to protocol fragmentation and fragmented O&M processes. Existing technologies use fixed-rule protocol switching, selecting between IPMI and Redfish based on timed switching or simple threshold judgments (such as network latency thresholds). This results in a high protocol switching misjudgment rate (>38%), an inability to dynamically adapt to real-time load changes, and protocol rigidity. Summary of the Invention
[0003] The present application provides a protocol switching management method, device, electronic device and storage medium to at least solve the problems in the related art of high misjudgment rate during protocol switching, inability to dynamically adapt to real-time load changes, and protocol rigidity.
[0004] This application provides a protocol switching management method, including:
[0005] Setting a standardized application program interface, configuring a first communication protocol and a second communication protocol in the standardized application program interface;
[0006] Acquire communication performance indicator data of the first communication protocol and the second communication protocol, and construct a communication protocol scoring model based on the communication performance indicators and their corresponding dynamic weight parameters;
[0007] Setting the dynamic weight parameters corresponding to the communication performance indicators to be adjusted in real time through a reinforcement learning algorithm;
[0008] Obtaining a first communication protocol score and a second communication protocol score respectively through the communication protocol scoring model, and comparing the first communication protocol score with the second communication protocol score to obtain a comparison result;
[0009] The switching state of the first communication protocol or the second communication protocol is controlled according to the current communication protocol information and the comparison result.
[0010] The present application also provides a protocol switching management device, which includes:
[0011] A unified management interface layer module, configured to set a standardized application program interface and configure a first communication protocol and a second communication protocol in the standardized application program interface;
[0012] a status monitoring module, configured to obtain communication performance indicator data of the first communication protocol and the second communication protocol, and construct a communication protocol scoring model based on the communication performance indicators and their corresponding dynamic weight parameters;
[0013] A dynamic weight parameter adjustment module is used to set the dynamic weight parameters corresponding to the communication performance indicators and adjust them in real time through a reinforcement learning algorithm;
[0014] a weight calculation module, configured to obtain a first communication protocol score and a second communication protocol score respectively through the communication protocol scoring model, and compare the first communication protocol score with the second communication protocol score to obtain a comparison result;
[0015] A dynamic routing decision module is used to control the switching state of the first communication protocol or the second communication protocol according to the current communication protocol information and the comparison result.
[0016] The present application also provides an electronic device, comprising: a memory for storing a computer program; and a processor for implementing the steps of any of the above-mentioned protocol switching management methods when executing the computer program.
[0017] The present application also provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned protocol switching management methods are implemented.
[0018] The present application also provides a computer program product, including a computer program, which implements the steps of any of the above-mentioned protocol switching management methods when executed by a processor.
[0019] Through this application, a standardized application program interface is set up to shield the differences in underlying protocols and support unified access of multiple protocols. Through the dynamic protocol adaptation algorithm, it dynamically adapts to real-time load changes, dynamically selects the optimal protocol, improves management efficiency, and realizes dynamic adaptation and collaborative work of protocols in server management scenarios, avoiding erroneous switching of protocols due to temporary congestion of communication protocols, thereby improving operation and maintenance efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0021] Figure 1 This is an application environment diagram of the protocol switching management method in one embodiment of the present application;
[0022] Figure 2 This is a flowchart of a protocol switching management method in one embodiment of the present application;
[0023] Figure 3 This is a logic diagram of a protocol switching management method in one embodiment of the present application;
[0024] Figure 4 This is a flow chart of a hybrid data synchronization mode as a real-time synchronization mode in an embodiment of the present application;
[0025] Figure 5 This is a flow chart of a hybrid data synchronization method in a batch synchronization method in one embodiment of the present application;
[0026] Figure 6 This is a flow chart of a dual-protocol hot standby mechanism in one embodiment of the present application;
[0027] Figure 7 This is a structural block diagram of a protocol switching management device in one embodiment of the present application;
[0028] Figure 8 This is a diagram of the internal structure of a computer device in one embodiment of the present application. DETAILED DESCRIPTION
[0029] The following will be combined with the accompanying drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0030] It should be noted that, in the description of this application, the terms "comprises," "includes," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. The terms "first," "second," etc., in this application are used to distinguish similar objects, and are not used to describe a particular order or sequence.
[0031] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.
[0032] Traditional BMC management solutions only support a single protocol (such as IPMI or Redfish) and are not adaptable to mixed-protocol scenarios. The IPMI protocol has low bandwidth (≤1Gbps) and poor scalability, making it difficult to support high-concurrency operations (such as large-scale cluster configurations). Meanwhile, the Redfish protocol still relies on IPMI for scenarios like firmware upgrades and secure erase, resulting in protocol fragmentation and fragmented operations.
[0033] IPMI protocol: Low-level hardware management based on binary commands, supporting basic functions such as sensor monitoring and power control, but lacks adaptability to modern cloud-native environments.
[0034] Redfish protocol: A JSON-based RESTful interface that supports fine-grained resource management and automated operations and maintenance. However, it requires high computing power from the embedded BMC and has poor compatibility with older devices.
[0035] The existing technology uses fixed rules to control protocol switching, and selects the IPMI protocol or Redfish protocol through timed switching or simple threshold judgment (such as network delay threshold). Its core process is as follows: Protocol detection: Determine whether the Redfish protocol is reachable through heartbeat detection; Static switching: If the Redfish protocol is unreachable, switch to the IPMI protocol; Data synchronization: Use a polling mechanism (such as pulling data every 5 seconds) to synchronize the status information of the IPMI protocol and the Redfish protocol.
[0036] The shortcomings of existing technologies are as follows: high switching misjudgment rate (>38%): fixed thresholds cannot dynamically adapt to real-time load changes. For example, in high-concurrency scenarios, short-term congestion of the Redfish protocol may cause inadvertent switching to the IPMI protocol, which in turn reduces efficiency; low synchronization efficiency: the polling mechanism occupies 40%-50% of the bandwidth and cannot meet the low latency requirements of 5G URLLC scenarios (≤1ms); data consistency risks: key status changes (such as hardware failures) may be missed during the polling interval, resulting in response delays >150ms and a missed detection rate >12%.
[0037] Data synchronization is inefficient. Existing technologies use pure event-triggered data synchronization, which only triggers data synchronization by subscribing to resource change events (such as temperature exceeding the limit) through the Redfish protocol's EventService. The process is as follows: Event monitoring: The Redfish end registers an event listener and subscribes to resource update events; Passive synchronization: Pull IPMI protocol data after the event is triggered; Conflict handling: Relying on manual intervention to resolve data conflicts between protocols.
[0038] The shortcomings of existing technologies are: high missed detection rate: relying solely on event triggers may ignore non-event data changes (such as slow sensor drift), with a missed detection rate of >12%; lack of automatic repair: manual intervention is required when data is lost or conflicted, resulting in high operation and maintenance costs; insufficient real-time performance: the event processing link delay is >150ms, which cannot meet real-time control requirements.
[0039] Moreover, the data of the IPMI protocol and the Redfish protocol adopt a hybrid data management method, and the monitoring data (time series) and configuration data (relational) are mixed and stored in the traditional relational database, resulting in low query efficiency (average delay > 500ms) and high-frequency write bottlenecks.
[0040] This application aims to solve the three core pain points of traditional BMC technology, namely protocol rigidity, inefficient synchronization, and chaotic storage. The protocol switching management method provided by this application can be applied to Figure 1 In the application environment shown in the figure, the system architecture includes a unified management interface layer, a protocol intelligent switching engine, a hybrid data synchronization service, and a fault recovery and security module.
[0041] Unified Management Interface Layer: Provides a standardized API, shields underlying protocol differences, and supports unified access across multiple protocols. It also supports OAuth 2.0 authentication and RBAC permission control. Submodules: Common Data Model (CDM): Abstracts operations into unified objects, adapting to different protocol commands. Protocol Adapter: Automatically converts commands to Redfish or IPMI based on the request type.
[0042] Protocol Intelligent Switching Engine: Dynamically selects the optimal protocol to improve management efficiency. Submodules: Weight Calculation Module: Calculates protocol weights based on real-time network latency, BMC load, and heartbeat status. Status Monitoring Module: Collects protocol health metrics (such as Redfish protocol response time and IPMI protocol CPU utilization).
[0043] Hybrid Data Synchronization Service: Enables efficient synchronization and consistency assurance of multi-protocol data. Submodules: Real-time Synchronization Module: Triggers instant data pull through event subscriptions (response time ≤ 1ms). Batch Synchronization Module: Compares data versions daily, transmitting only the difference fields (reducing bandwidth usage by 50%).
[0044] Fault Recovery and Security Module: Ensures protocol switching reliability and communication security. Submodule: Dual-protocol hot standby: If the Redfish protocol fails, the IPMI protocol takes over within 0.8 seconds. Hardware-level encryption: TPM 2.0 stores AES-256 keys and encrypts IPMI protocol communications.
[0045] This application proposes an innovative solution of dynamic protocol adaptation + hybrid data synchronization + hierarchical storage architecture. Its technical background is deeply rooted in the industry trends of data center intelligence, edge computing real-time and hybrid cloud management. By integrating the efficient data interaction capabilities of Redfish and the hardware underlying monitoring advantages of IPMI (Intelligent Platform Management Interface), it realizes the dynamic adaptation and collaborative work of protocols in server management scenarios. The system automatically selects the optimal protocol through an intelligent switching mechanism, and designs a hybrid data synchronization method, combining real-time push and event triggering (strategy) to ensure efficient integration and consistent storage of hardware status, alarm logs and configuration information in a multi-protocol environment. The data storage architecture adopts a hierarchical design. A comprehensive breakthrough in protocol switching accuracy, synchronization bandwidth occupancy and query efficiency is achieved.
[0046] Specifically, such as Figure 2 、 Figure 3 As shown, an embodiment of the present application provides a protocol switching management method, comprising the following steps:
[0047] Step S1, setting a standardized application program interface, and configuring a first communication protocol and a second communication protocol in the standardized application program interface;
[0048] Step S2: Acquire communication performance indicator data of the first communication protocol and the second communication protocol, and construct a communication protocol scoring model based on the communication performance indicators and their corresponding dynamic weight parameters;
[0049] Step S3, setting the dynamic weight parameters corresponding to the communication performance indicators and adjusting them in real time through the reinforcement learning algorithm;
[0050] Step S4, respectively obtaining a first communication protocol score and a second communication protocol score through a communication protocol scoring model, and comparing the first communication protocol score and the second communication protocol score to obtain a comparison result;
[0051] Step S5: controlling the switching state of the first communication protocol or the second communication protocol according to the current communication protocol information and the comparison result.
[0052] Among them, the preset number of times is preferably 3 times. If the second communication protocol score is lower than the first communication protocol score for 3 consecutive times, the protocol switching is triggered, and the switching time is ≤0.5 seconds.
[0053] Preferably, the first communication protocol is the IPMI protocol, and the second communication protocol is the Redfish protocol. This application sets a standardized application programming interface, shields the differences in the underlying protocols, supports unified access to multiple protocols, and dynamically adapts to real-time load changes through a dynamic protocol adaptation algorithm. It dynamically selects the optimal protocol to improve management efficiency, realizes dynamic protocol adaptation and collaborative work in server management scenarios, avoids erroneous protocol switching due to temporary congestion of the communication protocol, and improves operation and maintenance efficiency.
[0054] In this embodiment, obtaining communication performance indicator data of the first communication protocol and the second communication protocol, and constructing a communication protocol scoring model based on the communication performance indicators and their corresponding dynamic weight parameters includes:
[0055] Set communication performance indicators including average network latency, processor load idle rate, and heartbeat detection success rate;
[0056] Set the corresponding dynamic weight parameters for the average network delay, processor load idle rate, and heartbeat detection success rate;
[0057] According to the average network delay, processor load idle rate, heartbeat detection success rate and their dynamic weight parameters, a communication protocol scoring model is constructed through weighted summation.
[0058] Among them, the average network delay, processor load idle rate, and heartbeat detection success rate are protocol health indicators, which can provide comprehensive feedback on the health of the protocol.
[0059] In this embodiment, setting the dynamic weight parameters corresponding to the communication performance indicators to be adjusted in real time by using a reinforcement learning algorithm includes:
[0060] The state space is defined as a triplet, which includes the average network delay, the processor load idle rate, and the heartbeat detection success rate;
[0061] Set the action space as the incremental adjustment of the values of the dynamic weight parameters corresponding to the average network delay, processor load idle rate, and heartbeat detection success rate, and limit the step size of each incremental adjustment time step;
[0062] The Q-value table is regularly updated based on historical switching data. Through the ε-greedy strategy, random exploration is performed with probability ε, and the action with the largest current Q-value is selected with probability 1-ε to determine the values of the dynamic weight parameters corresponding to the average network delay, processor load idle rate, and heartbeat detection success rate. The Q-value table includes the status of communication performance indicators and their corresponding actions.
[0063] The step size of each time step is limited to ±0.1 steps, and the Q-Table is updated every 24 hours based on historical switching data. The ε-greedy strategy is used to balance exploration and utilization, ensuring that the weight parameters dynamically adapt to the network environment.
[0064] The Q-value table is a key component of the Q-Learning algorithm, used to store and update the estimated value of each state-action pair. The Q-value table (Q-Table) has the dimensions of the number of states S multiplied by the number of actions A. Each element in the table represents the expected reward of taking an action in the current state. The Q-value table is a two-dimensional array whose rows represent different states and columns represent all possible actions in that state. The value of each cell represents the expected reward (i.e., Q-value) of taking the corresponding action in that state. Q-Learning continuously iterates and updates this table, gradually approximating the optimal policy.
[0065] In this embodiment, the Q value table is updated regularly based on historical switching data. The ε-greedy strategy is used to randomly explore with probability ε, and the action with the largest current Q value is selected with probability 1-ε. The values of the dynamic weight parameters corresponding to the average network delay, the processor load idle rate, and the heartbeat detection success rate are determined as follows:
[0066] Use historical switching data to update the Q value table, initialize the values of the dynamic weight parameters and the greed coefficient ε corresponding to the average network delay, processor load idle rate, and heartbeat detection success rate, and set each state-action to a corresponding Q value. The Q value stores the cumulative reward value of taking action a in state s;
[0067] Observe the communication performance indicator data of the first communication protocol and the second communication protocol at the current time t, obtain the difference ΔQ(s,a) before and after the Q value update, and determine whether the Q value table converges based on the difference ΔQ(s,a) before and after the Q value update;
[0068] If ΔQ(s,a) is less than the convergence condition, the Q value table is determined to meet the convergence condition and the action with the largest Q value is selected;
[0069] If ΔQ(s,a) is greater than the convergence judgment condition, it is determined that the Q value table does not meet the convergence condition, then according to the state s at the current time t t , select the action a with the largest Q value according to the probability 1-ε t , calculate the reward r t , according to the selected action a t The upper and lower switching thresholds are used to adjust the initialization network average delay, processor load idle rate, and the dynamic weight parameter values corresponding to the heartbeat detection success rate, and obtain system status feedback. According to the status s at time t+1 t+1 Update the Q value table.
[0070] Among them, the Q value function is updated as follows:
[0071] Q(s t ,a t )←Q(s t ,a t)+α[r t +γmaxQ(s t+1 ,a t )-Q(s t ,a t )];
[0072] Where α represents the learning rate, γ represents the discount factor, Q(s t ,a t ) indicates that the current time t is in state s t The action value of taking action a t Then it reaches state s at time t+1 t+1 And get reward t+1 , then find the value in the Q value table that can make the state s t+1 Take the action a with the highest value and obtain Q(s t+1 ,a), for Q(s t ,a t )renew.
[0073] like Figure 3 As shown, in this embodiment, obtaining the first communication protocol score and the second communication protocol score through the communication protocol scoring model includes:
[0074] intermittently sending full packet injection requests, measuring round-trip delays and calculating average network delays corresponding to the first communication protocol and the second communication protocol;
[0075] Monitor processor load, obtain processor utilization in real time, and calculate processor load idle rate based on processor utilization;
[0076] Perform heartbeat detection on the first communication protocol and the second communication protocol respectively, count the heartbeat success rates and calculate the heartbeat success rates of the first communication protocol and the second communication protocol;
[0077] Obtain the average network delay corresponding to the second communication protocol, record it as Dr, obtain the processor load idle rate corresponding to the second communication protocol, record it as Lr, and obtain the heartbeat success rate corresponding to the second communication protocol, record it as Hr;
[0078] Obtain the average network delay corresponding to the first communication protocol, record it as Di, obtain the processor load idle rate corresponding to the first communication protocol, record it as Li, and obtain the heartbeat success rate corresponding to the first communication protocol, record it as Hi;
[0079] Obtain the values of the dynamic weight parameters of the average network delay, the processor load idle rate, and the heartbeat detection success rate corresponding to the second communication protocol, which are recorded as α1, β1, and γ1 respectively;
[0080] Obtain the values of the dynamic weight parameters of the average network delay, the processor load idle rate, and the heartbeat detection success rate corresponding to the first communication protocol, which are recorded as α2, β2, and γ2 respectively;
[0081] Calculate the second communication protocol score corresponding to the second communication protocol based on the communication protocol scoring model by Wr=α1·(1 / Dr)+β1·Lr+γ1·Hr;
[0082] The first communication protocol score corresponding to the first communication protocol is calculated based on the communication protocol score model by Wi=α2·(1 / Di)+β2·Li+γ2·Hi.
[0083] The network delay is measured by ICMP Ping, which measures the round-trip time (RTT) in milliseconds (ms). The network delay detection method is to send a full packet injection (ICMP Ping) request to the first communication protocol and the second communication protocol every 200ms and calculate the average network delay. The formula for calculating the average network delay is: RTT k is the round trip delay of the kth sampling network delay, 1≤k≤n, n is the number of sampling network delays, preferably n=5.
[0084] The load idle rate is calculated as 1-CPU utilization, where the CPU utilization is obtained via the first communication instruction "tool sensor get "CPU Utilization". The formula for calculating the processor load idle rate is: L = 1-U. If U = 70%, then L = 30%.
[0085] The heartbeat success rate is, for example, the success rate of the most recent 10 heartbeat detections, where heartbeat success rate = number of successes / total number of times × 100%. If the second communication succeeded 8 times and the first communication succeeded 10 times in the most recent 10 heartbeat detection results, then Hr = 8 / 10 = 80%, and Hi = 10 / 10 = 100%.
[0086] In this embodiment, controlling the switching state of the first communication protocol or the second communication protocol according to the current communication protocol information and the comparison result includes:
[0087] In response to the current communication protocol being the first communication protocol, if the score of the first communication protocol is lower than the score of the second communication protocol for a consecutive preset number of times, then switching the first communication protocol to the second communication protocol, otherwise maintaining the first communication protocol;
[0088] In response to the current communication protocol being the second communication protocol, when the second communication protocol score is lower than the first communication protocol score for a preset number of consecutive times, the second communication protocol is switched to the first communication protocol; otherwise, the second communication protocol is maintained.
[0089] Protocol switching determination: If Wi < Wr three consecutive times, trigger the first communication protocol to switch to the second communication protocol. If Wr < Wi three consecutive times, trigger the second communication protocol to switch to the first communication protocol, update the routing table, and notify the management software.
[0090] Adopting the method of calculating the scores of the second communication protocol and the first communication protocol can solve the problem of protocol rigidity, and dynamic protocol adaptation significantly improves the operation and maintenance efficiency. Through the dynamic protocol adaptation algorithm, the protocol scores are calculated based on multi-dimensional real-time metrics such as network latency, BMC load idle rate, and heartbeat success rate, enabling intelligent switching. The protocol mis-switching rate is reduced from >38% in the prior art to <5%. The switching time is ≤0.5 seconds, supporting seamless switching in high-concurrency scenarios (such as a cluster of thousands of servers).
[0091] In the communication protocol scoring model, the communication protocol score calculation formula W = α·(1 / D) + β·L + γ·H based on network latency (D), load idle rate (L), and heartbeat success rate (H), where α ∈ [0.4, 0.6], β ∈ [0.2, 0.4], γ ∈ [0.1, 0.3], and the real-time metric acquisition data, including ICMP Ping network latency detection, CPU utilization monitoring, and heartbeat success rate statistics.
[0092] In addition, the dynamic weight parameters of network latency (D), load idle rate (L), and heartbeat success rate (H) are related to the communication capabilities of the corresponding servers and are adjusted in real time through a reinforcement learning algorithm based on Q-Learning. Therefore, in this embodiment, according to the values of the network average latency, processor load idle rate, heartbeat detection success rate, and their dynamic weight parameters, the scores of the first communication protocol and the second communication protocol are calculated respectively by weighted summation, including:
[0093] Set the values of the dynamic weight parameters of the network average latency, processor load idle rate, and heartbeat detection success rate corresponding to the second communication protocol to be the same as the values of the dynamic weight parameters of the network average latency, processor load idle rate, and heartbeat detection success rate corresponding to the first communication protocol.
[0094] This can reduce the separate adjustment of the values of the dynamic weight parameters corresponding to the two protocols respectively, reducing the computing power requirements.
[0095] As Figure 3 shown, in this embodiment, switching to the first communication protocol includes:
[0096] When responding to switching to the first communication protocol, trigger the instruction to switch to the first communication protocol;
[0097] When responding to receiving the instruction to switch to the first communication protocol, pre-load the session key of the first communication protocol into the shared memory;
[0098] Migrate the unfinished request to the first communication protocol by interrupting and redirecting the migration request, and update the routing table.
[0099] Among them, the interrupt redirection technology (Interrupt Redirect) is used to ensure seamless migration of unfinished requests.
[0100] In this embodiment, setting a standardized application program interface, and configuring the first communication protocol and the second communication protocol in the standardized application program interface includes:
[0101] When configuring the first communication protocol, the IP address and default port of the first communication protocol are set, encrypted communication is enabled, a dynamic key is used as the authentication key, and a hash algorithm is used for key derivation;
[0102] When configuring the second communication protocol, the resource locator of the second communication service is set, the authentication authority model is configured, and the subscription address of the event service is set.
[0103] Specifically, the first communication protocol interface parameter configuration:
[0104] IP address and port: Set the IP address and default port for primary communication and enable SSL / TLS1.3 encrypted communication.
[0105] Authentication key: Generates a 16-byte dynamic key (such as 0x120x340x56...) and uses the SHA-256 hash algorithm for key derivation.
[0106] Sensor polling: Configure the first communication sensor polling interval to 1 second and set the CPU utilization alarm threshold to 75% (triggering protocol switching condition).
[0107] Specifically, the second communication protocol interface parameter configuration:
[0108] RESTfulAPI endpoint: Define the second communication service URL as https: / / <BMC_IP> / redfish / v1, enable OAuth2.0 authentication, and configure the RBAC permission model (such as administrator and operator roles).
[0109] Event subscription: Set the EventService subscription address to / redfish / v1 / EventService, the heartbeat detection interval to 200ms, and the timeout threshold to 500ms.
[0110] In this embodiment, the protocol switching management method further includes:
[0111] Performing hybrid data synchronization on first communication data received based on the first communication protocol and second communication data received based on the second communication protocol, wherein the hybrid data synchronization mode includes a real-time synchronization mode and a batch synchronization mode;
[0112] In response to the hybrid data synchronization mode being a real-time synchronization mode, the event service (EventService) of the second communication protocol is subscribed to through a long connection of the protocol (WebSocket), the event type (such as TemperatureExceeded, PowerStateChange) is registered, and the event triggering condition is set. When the event triggering condition is met, the second communication protocol pushes a text format event message;
[0113] In response to an event being triggered, calling the first communication protocol within a limited time to obtain binary data corresponding to the event, parsing the binary data into a text format conversion event message, and performing a data consistency check between the text format conversion event message and the text format event message;
[0114] In response to the hybrid data synchronization mode being batch synchronization, a full data comparison task is set to be started during idle time. The comparison data is divided into blocks of preset storage capacity (4KB). The file backup (Rsync) algorithm is used to identify the difference fields and the blocks where the difference fields are located. At the same time, the event logs of the real-time synchronization mode are compared.
[0115] The block where the difference field is located is obtained as the changed block, the data of the changed block is compressed to form a difference file, the difference file is transmitted through the Hypertext Transfer Protocol Secure (HTTPS), and the cyclic redundancy check (CRC32) method is used to verify the data integrity of the sender and the receiver; when the data verification result of the sender is equal to the data verification result of the receiver, the verification is judged to be passed, and the storage content is updated according to the difference file; when the data verification result of the sender is not equal to the data verification result of the receiver, the verification is judged to be failed, and the difference file is transmitted using the breakpoint resume method.
[0116] A hybrid data synchronization mechanism is used to optimize bandwidth and response time, combining event-triggered real-time synchronization with batch differential transmission to achieve low-latency, high-integrity data synchronization.
[0117] For example, the event triggering condition is: when the CPU temperature exceeds a threshold (such as 85° C.), the second communication protocol pushes a text format event message.
[0118] Within 1ms of the event being triggered, the first communication command, ipmitool sensor get "CPU Temp," was called to obtain real-time data. Data was retrieved within 1ms of the event being triggered, with a response latency of ≤1ms and a missed detection rate reduced from over 12% to less than 2%.
[0119] Data conversion: Parse the first communication binary data into text format (JSON format) to match the SensorData object of the Common Data Model (CDM).
[0120] The data consistency verification methods include:
[0121] Obtaining a hash value of the second communication data and a hash value of the first communication data using a hash algorithm, and comparing the hash value of the second communication data with the hash value of the first communication data;
[0122] When the hash value of the second communication data is equal to the hash value of the first communication data, writing the data into storage;
[0123] When the hash value of the second communication data is not equal to the hash value of the first communication data, an alarm is triggered and synchronization is retried.
[0124] The hash algorithm is SHA-256. The maximum number of synchronization retries is 3.
[0125] This embodiment supports the extremely low latency requirements (≤1ms) of 5G URLLC scenarios while ensuring data consistency (SHA-256 hash check).
[0126] For example, if the idle time is 2:00 a.m. every day, the comparison task is started at 2:00 a.m. every day, the data is divided into 4KB blocks, the Rsync algorithm is used to identify the difference fields, and the event log of the real-time synchronization module is compared at the same time to ensure the data integrity of unprocessed events.
[0127] Differential file generation: Only the changed blocks are transmitted, and the compression algorithm uses LZ4 compression with a compression rate greater than 50%.
[0128] The daily full-volume comparison uses the Rsync algorithm and LZ4 compression, reducing the amount of transmitted data by at least 50% and bandwidth usage to 20%-30%.
[0129] In this embodiment, the protocol switching management method further includes:
[0130] Classify the stored data into time series data and configuration data, and store the time series data and configuration data in layers;
[0131] In response to storing time series data, multiple shards are generated based on the timestamp and the segment storage duration, the shards are written to the buffer in batches, and the time series index (TSI) is enabled;
[0132] In response to storing configuration data, a binary tree index (B-Tree) is created for the server ID and firmware version fields of the configuration data, and hot data is cached through the database (Redis);
[0133] When querying time series data, enable materialized view display for the queried time series data;
[0134] The dual-protocol hot standby mechanism is set to detect whether the second communication protocol fails by means of a heartbeat detection timeout period, and switch to the first communication protocol in response to a failure of the second communication protocol.
[0135] Among them, time series data storage (InfluxDB):
[0136] Sharding strategy: InfluxDB's sharding strategy was set to generate a shard every hour (ShardDuration=1h) based on timestamps, with Time Series Indexing (TSI) enabled. For high-frequency queries (such as "CPU average over the past hour"), pre-computed materialized views were used with a 1-minute aggregation granularity, reducing query latency from 500ms to <50ms.
[0137] Write optimization: Batch write buffer (Buffer Size = 10,000 records) and enable Time Series Index (TSI).
[0138] Query downsampling: Aggregates 1-second granularity data into 1-minute averages, reducing query load by 80%.
[0139] Among them, configure the data storage (PostgreSQL):
[0140] Index optimization: Create binary tree (B-Tree) indexes for the ServerID and FirmwareVersion fields, reducing query latency from 500ms to 50ms.
[0141] Cache acceleration: Cache hot data through Redis (LRU strategy, cache hit rate > 95%).
[0142] The unified query API provides a RESTful interface: GET / api / data?type=metric&server=1, which supports joint query of time series and configuration data.
[0143] Pre-calculation optimization: Enable materialized views for high-frequency queries (such as "CPU average in the past hour").
[0144] The time series data (InfluxDB) and configuration data (PostgreSQL) are physically separated to optimize storage and query efficiency.
[0145] Time series data: Write throughput increased to 120,000 records / second, and query latency decreased from over 500ms to less than 50ms (through time slicing and downsampling).
[0146] Configuration data: B-Tree indexes and Redis cache reduce query latency to 50ms, with a cache hit rate >95%.
[0147] This embodiment supports the fine-grained monitoring requirements of new hardware such as GPU / FPGA, and improves scalability by 200%.
[0148] In addition, the protocol switching management method also includes: fault recovery and security assurance.
[0149] like Figure 6 As shown in the figure, the dual-protocol hot standby mechanism includes:
[0150] Heartbeat detection enhancement: When a Redfish failure occurs, the heartbeat detection interval is shortened from 200ms to 50ms, and the judgment timeout period is 150ms.
[0151] IPMI takeover process: Activates the IPMI session within 0.8 seconds and synchronizes the OAuth token and session key through shared memory.
[0152] State synchronization: Use distributed locks (such as Redis Lock) to ensure atomic operations during protocol switching and avoid data conflicts.
[0153] Among them, hardware-level encryption implementation methods include:
[0154] Key management: The TPM 2.0 chip stores the AES-256 master key. The session key used for HMAC-SHA256 signatures is derived from this master key and is dynamically generated through the key negotiation mechanism of the SSL / TLS 1.3 protocol.
[0155] IPMI communication encryption uses SSL / TLS 1.3, with key negotiation using the ECDHE-RSA algorithm. Session keys are derived using the HMAC-SHA256 algorithm in compliance with NIST SP 800-108. Input parameters include a master key, a context tag (such as 'IPMI_Key'), and a counter. During key rotation, the old key is encrypted and archived using the sealed storage feature of TPM 2.0 to ensure a seamless transition. IPMI communication uses SSL / TLS 1.3, with key negotiation using the ECDHE-RSA algorithm with a 4096-bit key length. The certificate chain is verified in real time using OCSP.
[0156] The data integrity protection method is to add an HMAC-SHA256 signature to the transmitted data to prevent tampering: Signature = HMAC-SHA256 (Data, Key).
[0157] Dual-protocol hot standby mechanism (IPMI takes over within 0.8 seconds when Redfish fails) and hardware-level encryption (TPM 2.0 stores AES-256 keys) ensure system reliability.
[0158] In the event of a Redfish failure, the heartbeat detection interval is shortened to 50ms, and the fault determination time is ≤150ms. IPMI communication uses SSL / TLS 1.3 encryption with a 24-hour key rotation cycle, and data integrity is protected by HMAC-SHA256 signatures. Distributed locks (such as Redis Lock) ensure switch atomicity and prevent data conflicts.
[0159] In the above-mentioned protocol switching management method, a standardized application program interface is set up to shield the differences in the underlying protocols and support unified access of multiple protocols. Through the dynamic protocol adaptation algorithm, it dynamically adapts to real-time load changes and dynamically selects the optimal protocol to improve management efficiency. It realizes dynamic adaptation and collaborative work of protocols in server management scenarios, avoids erroneous switching of protocols due to temporary congestion of communication protocols, and improves operation and maintenance efficiency.
[0160] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method.
[0161] In one embodiment, see Figure 1 ,like Figure 7 As shown, a protocol switching management device 10 is provided, including: a unified management interface layer module 1, a status monitoring module 2, a dynamic weight parameter adjustment module 3, a weight calculation module 4, and a dynamic routing decision module 5.
[0162] The unified management interface layer module 1 is used to set up a standardized application program interface, and configure the first communication protocol and the second communication protocol in the standardized application program interface.
[0163] The status monitoring module 2 is used to obtain communication performance indicator data of the first communication protocol and the second communication protocol, and to construct a communication protocol scoring model based on the communication performance indicators and their corresponding dynamic weight parameters.
[0164] The dynamic weight parameter adjustment module 3 is used to set the dynamic weight parameters corresponding to the communication performance indicators and perform real-time adjustments through the reinforcement learning algorithm.
[0165] The weight calculation module 4 is used to obtain the first communication protocol score and the second communication protocol score through the communication protocol scoring model respectively, and compare the first communication protocol score and the second communication protocol score to obtain a comparison result.
[0166] The dynamic routing decision module 5 is used to control the switching state of the first communication protocol or the second communication protocol according to the current communication protocol information and the comparison result.
[0167] In this embodiment, obtaining communication performance indicator data of the first communication protocol and the second communication protocol, and constructing a communication protocol scoring model based on the communication performance indicators and their corresponding dynamic weight parameters includes:
[0168] Set communication performance indicators including average network latency, processor load idle rate, and heartbeat detection success rate;
[0169] Set the corresponding dynamic weight parameters for the average network delay, processor load idle rate, and heartbeat detection success rate;
[0170] According to the average network delay, processor load idle rate, heartbeat detection success rate and their dynamic weight parameters, a communication protocol scoring model is constructed through weighted summation.
[0171] In this embodiment, setting the dynamic weight parameters corresponding to the communication performance indicators to be adjusted in real time by using a reinforcement learning algorithm includes:
[0172] The state space is defined as a triplet, which includes the average network delay, the processor load idle rate, and the heartbeat detection success rate;
[0173] Set the action space as the incremental adjustment of the values of the dynamic weight parameters corresponding to the average network delay, processor load idle rate, and heartbeat detection success rate, and limit the step size of each incremental adjustment time step;
[0174] The Q-value table is regularly updated based on historical switching data. Through the ε-greedy strategy, random exploration is performed with probability ε, and the action with the largest current Q-value is selected with probability 1-ε to determine the values of the dynamic weight parameters corresponding to the average network delay, processor load idle rate, and heartbeat detection success rate. The Q-value table includes the status of communication performance indicators and their corresponding actions.
[0175] In this embodiment, obtaining the first communication protocol score and the second communication protocol score through the communication protocol scoring model includes:
[0176] intermittently sending full packet injection requests, measuring round-trip delays and calculating average network delays corresponding to the first communication protocol and the second communication protocol;
[0177] Monitor processor load, obtain processor utilization in real time, and calculate processor load idle rate based on processor utilization;
[0178] Perform heartbeat detection on the first communication protocol and the second communication protocol respectively, count the heartbeat success rates and calculate the heartbeat success rates of the first communication protocol and the second communication protocol;
[0179] Obtain the average network delay corresponding to the second communication protocol, record it as Dr, obtain the processor load idle rate corresponding to the second communication protocol, record it as Lr, and obtain the heartbeat success rate corresponding to the second communication protocol, record it as Hr;
[0180] Obtain the average network delay corresponding to the first communication protocol, record it as Di, obtain the processor load idle rate corresponding to the first communication protocol, record it as Li, and obtain the heartbeat success rate corresponding to the first communication protocol, record it as Hi;
[0181] Obtain the values of the dynamic weight parameters of the average network delay, the processor load idle rate, and the heartbeat detection success rate corresponding to the second communication protocol, which are recorded as α1, β1, and γ1 respectively;
[0182] Obtain the values of the dynamic weight parameters of the average network delay, the processor load idle rate, and the heartbeat detection success rate corresponding to the first communication protocol, which are recorded as α2, β2, and γ2 respectively;
[0183] Calculate the second communication protocol score corresponding to the second communication protocol based on the communication protocol scoring model by Wr=α1·(1 / Dr)+β1·Lr+γ1·Hr;
[0184] The first communication protocol score corresponding to the first communication protocol is calculated based on the communication protocol score model by Wi=α2·(1 / Di)+β2·Li+γ2·Hi.
[0185] In this embodiment, controlling the switching state of the first communication protocol or the second communication protocol according to the current communication protocol information and the comparison result includes:
[0186] In response to the current communication protocol being the first communication protocol, if the score of the first communication protocol is lower than the score of the second communication protocol for a consecutive preset number of times, then switching the first communication protocol to the second communication protocol, otherwise maintaining the first communication protocol;
[0187] In response to the current communication protocol being the second communication protocol, when the second communication protocol score is lower than the first communication protocol score for a preset number of consecutive times, the second communication protocol is switched to the first communication protocol; otherwise, the second communication protocol is maintained.
[0188] In this embodiment, switching to the first communication protocol includes:
[0189] In response to switching to the first communication protocol, triggering an instruction to switch to the first communication protocol;
[0190] In response to receiving the instruction to switch to the first communication protocol, preloading the first communication protocol session key into the shared memory;
[0191] Migrate the unfinished request to the first communication protocol by interrupting and redirecting the migration request, and update the routing table.
[0192] In this embodiment, setting a standardized application program interface, and configuring the first communication protocol and the second communication protocol in the standardized application program interface includes:
[0193] When configuring the first communication protocol, the IP address and default port of the first communication protocol are set, encrypted communication is enabled, a dynamic key is used as the authentication key, and a hash algorithm is used for key derivation;
[0194] When configuring the second communication protocol, the resource locator of the second communication service is set, the authentication authority model is configured, and the subscription address of the event service is set.
[0195] In this example, see Figure 1 ,like Figure 7 As shown, the protocol switching management device 10 further includes a hybrid data synchronization service module 6, which is used to:
[0196] Performing hybrid data synchronization on first communication data received based on the first communication protocol and second communication data received based on the second communication protocol, wherein the hybrid data synchronization mode includes a real-time synchronization mode and a batch synchronization mode;
[0197] In response to the hybrid data synchronization mode being a real-time synchronization mode, the event service (EventService) of the second communication protocol is subscribed to through a long connection of the protocol (WebSocket), the event type (such as TemperatureExceeded, PowerStateChange) is registered, and the event triggering condition is set. When the event triggering condition is met, the second communication protocol pushes a text format event message;
[0198] In response to an event being triggered, calling the first communication protocol within a limited time to obtain binary data corresponding to the event, parsing the binary data into a text format conversion event message, and performing a data consistency check between the text format conversion event message and the text format event message;
[0199] In response to the hybrid data synchronization mode being batch synchronization, a full data comparison task is set to be started during idle time. The comparison data is divided into blocks of preset storage capacity (4KB). The file backup (Rsync) algorithm is used to identify the difference fields and the blocks where the difference fields are located. At the same time, the event logs of the real-time synchronization mode are compared.
[0200] The block where the difference field is located is obtained as the changed block, the data of the changed block is compressed to form a difference file, the difference file is transmitted through the Hypertext Transfer Protocol Secure (HTTPS), and the cyclic redundancy check (CRC32) method is used to verify the data integrity of the sender and the receiver; when the data verification result of the sender is equal to the data verification result of the receiver, the verification is judged to be passed, and the storage content is updated according to the difference file; when the data verification result of the sender is not equal to the data verification result of the receiver, the verification is judged to be failed, and the difference file is transmitted using the breakpoint resume method.
[0201] In this example, see Figure 1 ,like Figure 7 As shown, the protocol switching management device 10 further includes a hierarchical storage architecture module 7, which is used to:
[0202] Classify the stored data into time series data and configuration data, and store the time series data and configuration data in layers;
[0203] In response to storing time series data, multiple shards are generated based on the timestamp and the segment storage duration, the shards are written to the buffer in batches, and the time series index (TSI) is enabled;
[0204] In response to storing configuration data, a binary tree index (B-Tree) is created for the server ID and firmware version fields of the configuration data, and hot data is cached through the database (Redis);
[0205] When querying time series data, enable materialized view display for the queried time series data;
[0206] The dual-protocol hot standby mechanism is set to detect whether the second communication protocol fails by means of a heartbeat detection timeout period, and switch to the first communication protocol in response to a failure of the second communication protocol.
[0207] In the above-mentioned protocol switching management device, a standardized application program interface is set up to shield the differences in the underlying protocols and support unified access of multiple protocols. Through the dynamic protocol adaptation algorithm, it dynamically adapts to real-time load changes and dynamically selects the optimal protocol to improve management efficiency. It realizes dynamic adaptation and collaborative work of protocols in server management scenarios, avoids erroneous switching of protocols due to temporary congestion of communication protocols, and improves operation and maintenance efficiency.
[0208] For the description of the features in the embodiment corresponding to the protocol switching management device, please refer to the relevant description of the embodiment corresponding to the protocol switching management method, and no further details will be given here.
[0209] An embodiment of the present application further provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any of the above-mentioned protocol switching management method embodiments.
[0210] In one embodiment, the electronic device may be a server, and its internal structure diagram may be as follows: Figure 8 As shown. The electronic device includes a processor, a memory, a network interface and a database connected via a system bus. The processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The database of the electronic device is used to store protocol switching management data. The network interface of the electronic device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a protocol switching management method is implemented.
[0211] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored. The computer program is configured to execute the steps of any of the above-mentioned protocol switching management method embodiments when running.
[0212] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.
[0213] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps in any of the above-mentioned protocol switching management method embodiments are implemented.
[0214] An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of any of the above-mentioned protocol switching management method embodiments are implemented.
[0215] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0216] The above is a detailed introduction to a protocol switching management method, device, electronic device, and storage medium provided by the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only intended to help understand the method and core ideas of the present application. It should be pointed out that, for those skilled in the art, without departing from the principles of the present application, several improvements and modifications may be made to the present application, and these improvements and modifications also fall within the scope of protection of the claims of the present application.
Claims
1. A protocol switching management method, characterized in that: include: Setting a standardized application program interface, configuring a first communication protocol and a second communication protocol in the standardized application program interface; Acquire communication performance indicator data of the first communication protocol and the second communication protocol, and construct a communication protocol scoring model based on the communication performance indicators and their corresponding dynamic weight parameters; Setting the dynamic weight parameters corresponding to the communication performance indicators to be adjusted in real time through a reinforcement learning algorithm; Obtaining a first communication protocol score and a second communication protocol score respectively through the communication protocol scoring model, and comparing the first communication protocol score with the second communication protocol score to obtain a comparison result; The switching state of the first communication protocol or the second communication protocol is controlled according to the current communication protocol information and the comparison result.
2. The protocol switching management method according to claim 1, wherein: The acquiring of communication performance indicator data of the first communication protocol and the second communication protocol, and constructing a communication protocol scoring model according to the communication performance indicators and their corresponding dynamic weight parameters includes: Setting the communication performance indicators to include average network delay, processor load idle rate, and heartbeat detection success rate; Setting corresponding dynamic weight parameters corresponding to the average network delay, the processor load idle rate, and the heartbeat detection success rate; A communication protocol scoring model is constructed by weighted summation according to the average network delay, the processor load idle rate, the heartbeat detection success rate and their dynamic weight parameters.
3. The protocol switching management method according to claim 2, wherein: The setting of the dynamic weight parameter corresponding to the communication performance indicator to be adjusted in real time by using a reinforcement learning algorithm includes: The state space is defined as a triplet, wherein the triplet includes an average network delay, a processor load idle rate, and a heartbeat detection success rate; Setting the action space as incremental adjustment of the values of the dynamic weight parameters corresponding to the network average delay, processor load idle rate, and heartbeat detection success rate, and limiting the step size of each incremental adjustment time step; The Q value table is regularly updated according to historical switching data, and the ε-greedy strategy is used to randomly explore with probability ε, and the action with the largest current Q value is selected with probability 1-ε to determine the values of the dynamic weight parameters corresponding to the average network delay, processor load idle rate, and heartbeat detection success rate, wherein the Q value table includes the status of communication performance indicators and their corresponding actions.
4. The protocol switching management method according to claim 3, wherein: The method of regularly updating the Q value table according to the historical switching data, randomly exploring with probability ε through the ε-greedy strategy, and selecting the action with the largest current Q value with probability 1-ε to determine the values of the dynamic weight parameters corresponding to the average network delay, the processor load idle rate, and the heartbeat detection success rate includes: using the historical switching data to update the Q value table, initializing the values of the dynamic weight parameters corresponding to the average network delay, the processor load idle rate, and the heartbeat detection success rate and the greedy coefficient ε, setting each state-action to correspond to a Q value, and the Q value saving the cumulative reward value of taking action a in state s; Observe the communication performance indicator data of the first communication protocol and the second communication protocol at the current time t, obtain the difference ΔQ(s,a) before and after the Q value update, and determine whether the Q value table converges based on the difference ΔQ(s,a) before and after the Q value update; If ΔQ(s,a) is less than the convergence condition, the Q value table is determined to meet the convergence condition and the action with the largest Q value is selected; If ΔQ(s,a) is greater than the convergence judgment condition, it is determined that the Q value table does not meet the convergence condition, then according to the state s at the current time t t , select the action a with the largest Q value according to the probability 1-ε t , calculate the reward r t , according to the selected action a t The upper and lower switching thresholds are used to adjust the initialization network average delay, processor load idle rate, and the dynamic weight parameter values corresponding to the heartbeat detection success rate, and obtain system status feedback. According to the status s at time t+1 t+1 Update the Q value table.
5. The protocol switching management method according to claim 2, wherein: Acquiring the first communication protocol score and the second communication protocol score by using the communication protocol scoring model includes: intermittently sending full packet injection requests, measuring round-trip delays and calculating average network delays corresponding to the first communication protocol and the second communication protocol; Monitor the processor load, obtain the processor utilization in real time, and calculate the processor load idle rate based on the processor utilization; Performing heartbeat detection on the first communication protocol and the second communication protocol respectively, counting the heartbeat success rates and calculating the heartbeat success rates of the first communication protocol and the second communication protocol; Obtain the average network delay corresponding to the second communication protocol, record it as Dr, obtain the processor load idle rate corresponding to the second communication protocol, record it as Lr, and obtain the heartbeat success rate corresponding to the second communication protocol, record it as Hr; Obtain the average network delay corresponding to the first communication protocol, record it as Di, obtain the processor load idle rate corresponding to the first communication protocol, record it as Li, and obtain the heartbeat success rate corresponding to the first communication protocol, record it as Hi; Obtain the values of the dynamic weight parameters of the average network delay, the processor load idle rate, and the heartbeat detection success rate corresponding to the second communication protocol, which are recorded as α1, β1, and γ1 respectively; Obtain the values of the dynamic weight parameters of the average network delay, processor load idle rate, and heartbeat detection success rate corresponding to the first communication protocol, which are recorded as α2, β2, and γ2 respectively; Calculate a second communication protocol score corresponding to the second communication protocol based on the communication protocol scoring model by Wr=α1·(1 / Dr)+β1·Lr+γ1·Hr; Based on the communication protocol scoring model, a first communication protocol score corresponding to the first communication protocol is calculated by Wi=α2·(1 / Di)+β2·Li+γ2·Hi.
6. The protocol switching management method according to claim 1, wherein: The controlling the switching state of the first communication protocol or the second communication protocol according to the current communication protocol information and the comparison result includes: In response to the current communication protocol being the first communication protocol, if the score of the first communication protocol is lower than the score of the second communication protocol for a consecutive preset number of times, switching the first communication protocol to the second communication protocol; otherwise, maintaining the first communication protocol; In response to the current communication protocol being the second communication protocol, when the second communication protocol score is lower than the first communication protocol score for a preset number of consecutive times, the second communication protocol is switched to the first communication protocol; otherwise, the second communication protocol is maintained.
7. The protocol switching management method according to claim 1, wherein: The protocol switching management method further includes: Performing hybrid data synchronization on first communication data received based on the first communication protocol and second communication data received based on the second communication protocol, wherein the hybrid data synchronization mode includes a real-time synchronization mode and a batch synchronization mode; In response to the hybrid data synchronization mode being a real-time synchronization mode, subscribing to an event service of a second communication protocol through a protocol long connection, registering an event type, setting an event triggering condition, and when the event triggering condition is met, the second communication protocol pushes a text format event message; In response to an event being triggered, calling the first communication protocol within a limited time to obtain binary data corresponding to the event, parsing the binary data into a text format conversion event message, and performing a data consistency check between the text format conversion event message and the text format event message; In response to the hybrid data synchronization mode being a batch synchronization mode, a full data comparison task is started during idle time, the comparison data is segmented into blocks of preset storage capacity, a file backup algorithm is used to identify difference fields and the blocks where the difference fields are located, and event logs of the real-time synchronization mode are compared at the same time; Obtaining the block where the difference field is located as the changed block, compressing the data of the changed block to form a difference file, transmitting the difference file via the Hypertext Transfer Protocol (HTTP), and verifying the data integrity of the sending end and the receiving end using a cyclic redundancy check method; when the data verification result of the sending end is equal to the data verification result of the receiving end, it is determined that the verification has passed, and the storage content is updated according to the difference file; when the data verification result of the sending end is not equal to the data verification result of the receiving end, it is determined that the verification has failed, and the difference file is transmitted using a breakpoint resume method; Classifying the stored data into time series data and configuration data, and storing the time series data and the configuration data in layers; in response to storing the time series data, generating multiple shards for the time series data according to the timestamp and the segmented storage duration, writing the shards into a buffer in batches, and enabling time series indexing; In response to storing the configuration data, creating a binary tree index for the server ID and firmware version fields of the configuration data, and caching hotspot data through a database; When querying time series data, enable materialized view display for the queried time series data; The dual-protocol hot standby mechanism is set to detect whether the second communication protocol fails by means of a heartbeat detection timeout period, and switch to the first communication protocol in response to the failure of the second communication protocol.
8. A protocol switching management device, characterized in that: include: A unified management interface layer module, configured to set a standardized application program interface and configure a first communication protocol and a second communication protocol in the standardized application program interface; a status monitoring module, configured to obtain communication performance indicator data of the first communication protocol and the second communication protocol, and construct a communication protocol scoring model based on the communication performance indicators and their corresponding dynamic weight parameters; A dynamic weight parameter adjustment module is used to set the dynamic weight parameters corresponding to the communication performance indicators and adjust them in real time through a reinforcement learning algorithm; a weight calculation module, configured to obtain a first communication protocol score and a second communication protocol score respectively through the communication protocol scoring model, and compare the first communication protocol score with the second communication protocol score to obtain a comparison result; A dynamic routing decision module is used to control the switching state of the first communication protocol or the second communication protocol according to the current communication protocol information and the comparison result.
9. An electronic device, characterized in that: include: memory for storing computer programs; A processor, configured to implement the steps of the protocol switching management method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, the steps of the protocol switching management method according to any one of claims 1 to 7 are implemented.