Backup node scheduling method and device, computer equipment, medium and program product

By obtaining performance metrics information of candidate backup nodes in the database cluster, using targeted and conditional filters, and combining metric evaluation weights to select backup nodes, the problem of inaccurate scheduling in traditional methods is solved, achieving efficient and secure backup node selection.

CN121542053APending Publication Date: 2026-02-17CHINA TELECOM CLOUD TECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202610064718.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-01-19
Publication Date
2026-02-17

AI Technical Summary

Technical Problem

Traditional backup node scheduling methods in database cluster environments can easily lead to backup tasks being assigned to nodes with poor performance or abnormal status, affecting backup efficiency and data security. Furthermore, offline learning-based methods cannot adapt to dynamically changing application scenarios, resulting in insufficient scheduling accuracy.

Method used

By acquiring performance metrics information of candidate backup nodes in the database cluster, targeted filters and conditional filters are used for screening. Performance evaluation scores are calculated by combining metric evaluation weights, the most suitable backup node is selected, and online reinforcement learning is used to optimize the weights to improve scheduling accuracy.

Benefits of technology

It enables the rapid and accurate selection of backup nodes in a database cluster environment, improving the success rate of backup tasks and data security, avoiding backup failures caused by insufficient resources and abnormal status, and ensuring the stability and efficiency of the backup process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121542053A_ABST
    Figure CN121542053A_ABST
Patent Text Reader

Abstract

The invention relates to a backup node scheduling method and device, computer equipment, a computer readable storage medium and a computer program product. The method comprises the following steps: acquiring performance index information of each candidate backup node in a database cluster; inputting the performance index information into a directional filter to obtain a positioning filtering result; wherein the directional filter is used for directly determining a target backup node; under the condition that the target backup node is not determined in the positioning filtering result, inputting the performance index information into a condition filter to obtain a candidate node list after condition screening; and calculating a performance evaluation score of each candidate backup node in the candidate node list according to the index evaluation weight, determining a target backup node according to the performance evaluation scores, and executing a backup task by adopting the target backup node. By adopting the method, the backup node scheduling accuracy in the database cluster environment can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of database technology, and in particular to a backup node scheduling method, apparatus, computer equipment, computer-readable storage medium, and computer program product. Background Technology

[0002] Databases, as the core of information storage, carry an enterprise's data assets, and backup and recovery are core components of enterprise data management. In a database cluster environment, the selection of backup nodes directly affects the execution efficiency of backup tasks and data security. Traditional backup node scheduling methods employ random strategies or simple state-based judgments for node selection.

[0003] However, the blind random selection of traditional random scheduling methods can easily lead to backup tasks being assigned to nodes with poor performance or abnormal status, resulting in a slow backup process, affecting the normal operation of database services, and may even cause backup tasks to fail, increasing the risk of data loss.

[0004] In response, machine learning-based scheduling methods in related technologies consider node performance factors to some extent. However, these methods generally employ offline learning models, requiring extensive pre-training with large amounts of historical data, resulting in significant upfront resource consumption. More importantly, offline models struggle to adapt to the dynamic changes in database cluster environments and the complexities of real-world application scenarios. When the status of nodes in the cluster changes or new nodes are added, the offline model cannot update its decision-making criteria in a timely manner, leading to insufficient accuracy in backup node scheduling. Summary of the Invention

[0005] Therefore, it is necessary to provide a backup node scheduling method, apparatus, computer equipment, computer-readable storage medium, and computer program product that can improve the accuracy of backup node scheduling in a database cluster environment, in order to address the above-mentioned technical problems.

[0006] Firstly, this application provides a backup node scheduling method, including:

[0007] Obtain performance metrics information for each candidate backup node in the database cluster;

[0008] The performance index information is input into the directional filter to obtain the location filtering result; wherein, the directional filter is used to directly determine the target backup node;

[0009] If the location filtering results do not identify the target backup node, the performance index information is input into the condition filter to obtain a list of candidate nodes after condition filtering.

[0010] Based on the evaluation weights of the indicators, the performance evaluation score of each candidate backup node in the candidate node list is calculated. The target backup node is determined based on the performance evaluation score, and the backup task is performed using the target backup node.

[0011] In one embodiment, the method further includes:

[0012] Collect backup effect data generated after the backup task is completed;

[0013] Based on the backup performance data and the performance evaluation score of the target backup node, the prediction error data is calculated;

[0014] The evaluation weights of the indicators are updated based on the prediction error data.

[0015] In one embodiment, the backup performance data includes the actual backup time and the actual backup data volume; the step of calculating the prediction error data based on the backup performance data and the performance evaluation score of the target backup node includes:

[0016] The actual reward value is calculated based on the actual backup time and the actual backup data volume.

[0017] Calculate the prediction error data between the actual reward value and the performance evaluation score of the target backup node.

[0018] In one embodiment, updating the indicator evaluation weights based on the prediction error data includes:

[0019] Based on the prediction error data and the performance index information of the target backup node, the update direction of the gradient descent algorithm is determined;

[0020] The update magnitude of the gradient descent algorithm is determined based on the learning rate parameter;

[0021] Based on the prediction error data, the update direction, and the update magnitude, the gradient descent algorithm is used to update each weight component in the indicator evaluation weights.

[0022] In one embodiment, the method further includes:

[0023] Obtain the historical gradient data and / or feature importance coefficients of each weight component;

[0024] The learning rate parameter corresponding to each weight component is adjusted based on the historical gradient data and / or feature importance coefficients.

[0025] In one embodiment, the step of calculating the performance evaluation score of each candidate backup node in the candidate node list based on the indicator evaluation weight, and determining the target backup node based on the performance evaluation score, includes:

[0026] The performance index information of each candidate backup node in the candidate node list is standardized to obtain standardized data.

[0027] The standardized data is linearly combined with the corresponding indicator evaluation weights to obtain the performance evaluation score of each candidate backup node.

[0028] The candidate backup nodes are sorted based on the performance evaluation scores to obtain a scoring sequence, and the candidate backup nodes are selected as target backup nodes according to the scoring sequence.

[0029] In one embodiment, selecting candidate backup nodes as target backup nodes based on the scoring sequence includes:

[0030] Obtain the exploration probability parameter and a random value within a preset range;

[0031] If the random value is less than the exploration probability parameter, a candidate backup node is randomly selected from the candidate node list as the target backup node.

[0032] When the random value is greater than or equal to the exploration probability parameter, candidate backup nodes are selected as target backup nodes according to the order of the scoring sequence.

[0033] In one embodiment, obtaining the exploration probability parameter includes:

[0034] The exploration probability parameter is calculated according to the number of times the backup task is executed, using an exponential decay function.

[0035] In one embodiment, the conditional filter is used to perform instance abnormal state filtering; the step of inputting the performance metric information into the conditional filter to obtain a candidate node list after conditional filtering includes:

[0036] Extract the instance service running status of the database instance on each of the candidate backup nodes from the performance indicator information;

[0037] Send a test query command to perform database connection tests on each of the candidate backup nodes and obtain the instance connection response status;

[0038] Remove candidate backup nodes whose instance service running status or instance connection response status is abnormal from the candidate node list.

[0039] In one embodiment, the database cluster includes a master node and at least one slave node, the candidate backup node is a slave node in the database cluster, and the conditional filter is used to perform synchronization delay filtering; the step of inputting the performance metric information into the conditional filter to obtain a candidate node list after conditional filtering includes:

[0040] Connect to the slave node database corresponding to each of the candidate backup nodes, and extract the replication connection status between the master node and the slave node from the performance indicator information;

[0041] If the replication connection is in a stopped state, the corresponding candidate backup node will be removed from the candidate node list.

[0042] When the replication connection is in catch-up or start state, continuously acquire the changes in the replay log position. If the replay log position remains unchanged within a preset time period, remove the corresponding candidate backup node from the candidate node list.

[0043] If the replication connection is in normal streaming replication status, the replay delay time is obtained. If the replay delay time exceeds a preset delay threshold, the corresponding candidate backup node is removed from the candidate node list.

[0044] In one embodiment, the conditional filter is used to perform disk space filtering; the step of inputting the performance metric information into the conditional filter to obtain a list of candidate nodes after conditional filtering includes:

[0045] Extract backup task configuration information from the performance metrics information; the backup task configuration information includes backup data type and data compression parameters; the backup data type includes at least one of full backup, incremental backup and differential backup.

[0046] Based on the data type of the backup, calculate the original data volume of the data to be backed up, and based on the original data volume and the data compression parameters, calculate the compressed data volume;

[0047] Obtain the remaining disk space of the server where each candidate backup node is located, and remove the corresponding candidate backup node from the candidate node list if the amount of compressed data exceeds the remaining disk space.

[0048] Secondly, this application also provides a backup node scheduling device, comprising:

[0049] The data acquisition module is used to acquire performance metrics information of each candidate backup node in the database cluster;

[0050] The first filtering module is used to input the performance index information into the directional filter to obtain the location filtering result; wherein, the directional filter is used to directly determine the target backup node;

[0051] The second filtering module is used to input the performance index information into the condition filter when the location filtering result does not determine the target backup node, so as to obtain a list of candidate nodes after condition filtering.

[0052] The node selection module is used to calculate the performance evaluation score of each candidate backup node in the candidate node list according to the indicator evaluation weight, determine the target backup node according to the performance evaluation score, and use the target backup node to perform the backup task.

[0053] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps described in the first aspect.

[0054] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the steps described in the first aspect.

[0055] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps described in the first aspect.

[0056] The aforementioned backup node scheduling method, apparatus, computer equipment, computer-readable storage medium, and computer program product, by acquiring performance index information of each candidate backup node in the database cluster, can comprehensively collect performance data affecting backup effectiveness. This overcomes the problem of traditional random scheduling methods lacking performance basis. Performance index information is input into a directional filter to obtain a location filtering result. The directional filter directly determines the target backup node, enabling rapid processing of scheduling scenarios with clearly defined requirements and avoiding unnecessary complex calculations. If the location filtering result does not determine the target backup node, performance index information is input into a condition filter to obtain a candidate node list after conditional filtering. The condition filter performs basic conditional filtering on the candidate nodes, pre-excluding nodes with abnormal status, substandard performance, or insufficient resources, ensuring that nodes entering the subsequent evaluation stage have basic backup execution capabilities. Based on the index evaluation weights, the performance evaluation score of each candidate backup node in the candidate node list is calculated. The target backup node is determined based on the performance evaluation score and used to execute the backup task. By introducing index evaluation weights, the importance of different performance indicators to the backup effect can be weighted for calculation, thereby achieving precise node selection based on quantitative evaluation and improving the accuracy of backup node scheduling in a database cluster environment. Attached Figure Description

[0057] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0058] Figure 1 This is an application environment diagram of the backup node scheduling method in one embodiment;

[0059] Figure 2 This is a flowchart illustrating a backup node scheduling method in one embodiment;

[0060] Figure 3 This is a flowchart illustrating the backup node scheduling method in another embodiment;

[0061] Figure 4 This is a flowchart illustrating step S208 of the backup node scheduling method in one embodiment;

[0062] Figure 5 This is a structural block diagram of a backup node scheduling device in one embodiment;

[0063] Figure 6 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0064] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0065] It should be noted that the terms "first," "second," etc., used in this application can be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish the first element from the second element. The terms "comprising" and "having," and any variations thereof, used in this application, are intended to cover non-exclusive inclusion. The term "multiple" used in this application refers to two or more. The term "and / or" used in this application refers to one of the embodiments, or any combination of multiple embodiments.

[0066] The backup node scheduling method provided in this application embodiment can be applied to, for example, Figure 1 In the application environment shown, terminal 102 communicates with server 104 via a network and can be used to collect data and send it to server 104. A data storage system can store the data that server 104 needs to process. The data storage system can be integrated onto server 104 or placed on a cloud or other network server. The data storage system can be used to store and back up data, and server 104 can be used to schedule backup nodes. Server 104 can also act as a node scheduling module in the data storage system. Terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, drones, low-altitude aircraft, IoT devices, and portable wearable devices. Server 104 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services.

[0067] In one exemplary embodiment, such as Figure 2 As shown, a backup node scheduling method is provided, which can be applied to... Figure 1 Taking server 104 as an example, the explanation includes the following steps S202 to S208. Wherein:

[0068] Step S202: Obtain the performance metrics information of each candidate backup node in the database cluster.

[0069] A database cluster can include one master node and at least one slave node, with candidate backup nodes being slave nodes within the cluster. A database cluster is a distributed system composed of multiple database instances, employing a master-slave replication architecture. This includes a master node handling read and write operations and multiple slave nodes handling read operations. Data synchronization and load balancing are achieved between these nodes via network connections. For example, a PostgreSQL cluster might contain one master node handling all write operations and three slave nodes sharing the read query load. Alternatively, a MySQL cluster might consist of a master server and multiple slave servers forming a replication topology.

[0070] In this context, candidate backup nodes refer to nodes within a database cluster capable of performing backup tasks. These are primarily slave nodes in the database cluster. Since slave nodes do not bear the main write operation load, they are more suitable for performing backup tasks without significantly impacting production operations. For example, in a five-node database cluster, the four slave nodes in addition to the master node can all serve as candidate backup nodes. These slave nodes may be distributed across different physical servers or virtualization environments. Performance metrics refer to various quantitative data reflecting the operating status and processing capabilities of candidate backup nodes, including but not limited to CPU-related parameters such as the number of CPU cores, CPU idle rate, CPU utilization, CPU clock speed, and CPU cache size; memory-related parameters such as total memory, available memory, used memory, memory utilization, swap space usage, and page fault rate; network bandwidth parameters such as total bandwidth, current bandwidth utilization, network latency, packet loss rate, and packet error rate; disk-related parameters such as disk space, available disk space, disk utilization, disk input / output (IO), and disk queue length; system load-related parameters such as average system load, number of processes, and number of zombie processes; temperature and power consumption-related parameters such as CPU temperature and system power consumption; and hardware health status such as hardware failures and battery status.

[0071] For example, server 104 can obtain comprehensive performance metrics information by establishing secure connection channels with each candidate backup node in the database cluster, using standardized database connection protocols and system monitoring interfaces. Server 104 can connect to the physical server or virtual machine environment where each candidate backup node resides through network management protocols and remote monitoring tools to establish a stable data transmission link to ensure the accuracy and real-time nature of performance data collection.

[0072] Regarding processor performance metrics acquisition, server 104 can log into the server system where the candidate backup nodes reside, and collect CPU core count information to assess parallel processing capabilities by executing system-level processor status query commands. It can also obtain CPU idle ratio and CPU utilization ratio to analyze the current computing load, collect CPU clock speed information to understand the processor's basic performance level, and obtain CPU cache size information to assess data processing efficiency. For example, during memory usage metric collection, server 104 can obtain the total memory capacity information of the candidate backup nodes to understand the total memory resources of the system, and calculate the memory utilization ratio to assess the level of memory resource scarcity.

[0073] During the network transmission metric collection phase, server 104 can monitor the network interface status of each candidate backup node, obtain network bandwidth capacity information to understand the node's maximum data transmission capacity, collect network bandwidth usage ratios to analyze the current network load level, measure network transmission latency to evaluate data transmission response speed, and collect data packet loss ratio and error packet rate to determine the stability and reliability of the network connection. Server 104 can also collect specific database performance metrics at the database instance level, including parameters reflecting the database's operating status such as the current number of database connections, active queries, lock wait status, and cache hit rate. Server 104 can obtain master-slave synchronization-related status information by querying database system tables and performance views, including replication connection status, write-ahead logging (WAL) location, and replication latency.

[0074] In some embodiments, server 104 can also employ a distributed monitoring agent deployment mode for performance metric collection. Server 104 can pre-deploy lightweight monitoring agents on each candidate backup node. These agents run continuously in the background and periodically collect various performance metric data from the local nodes. Server 104 can establish communication connections with these distributed monitoring agents to periodically pull or receive pushed performance data updates, thereby achieving centralized monitoring and data collection of the entire cluster environment. In this implementation, server 104 can set flexible data collection frequency and granularity, dynamically adjust monitoring accuracy according to the urgency and importance of backup tasks, and optimize network transmission efficiency through local caching and data compression technologies. Server 104 can also integrate intelligent preprocessing functions into the monitoring agents to directly perform preliminary statistical analysis and anomaly detection on the collected raw performance data, identifying performance bottlenecks or system anomalies that may affect the execution of backup tasks in advance.

[0075] For example, when server 104 performs performance metric collection in a PostgreSQL database cluster environment, it can connect to each slave node database instance through the standard PostgreSQL connection protocol and execute specific system query commands to obtain database running status information. Server 104 queries the PostgreSQL statistics view `pg_stat_activity` to obtain the current number of active connections and query execution status, and queries the `pg_stat_database` view to obtain database-level statistics, including performance metrics such as the number of transaction commits, rollbacks, and cache hit rate. Server 104 can query the PostgreSQL replication status view `pg_stat_replication` to obtain detailed information about master-slave synchronization, including the application name used to distinguish different replication streams, replication process status such as `streaming` (normal streaming replication), `startup` (started state), `catchup` (catching up state), or `stopping` (stopped state), replay WAL position `replay_lsn`, and replay latency `replay_lag`, etc., which are master-slave synchronization metrics. Server 104 can obtain server hardware performance data by executing Linux system commands. The `lscpu` command collects detailed processor parameters such as CPU architecture, number of cores, number of threads, and clock speed. The `htop` command monitors CPU utilization and load distribution in real time. The `free` command obtains total memory, used memory, available memory, cache and swap partition usage. The `iostat` command monitors disk I / O performance, including read / write speed, I / O wait time, and disk utilization. Server 104 can use network monitoring tools such as `netload` and `bmon` to obtain network performance data such as network bandwidth usage, network latency, and packet transmission statistics. The `df` command obtains disk space usage information, including total capacity, used space, and available space. The `uptime` command obtains the system average load value. The `ps` command tracks the number of running processes and resource usage. Server 104 can use the `lm-sensors` tool to obtain hardware temperature information such as CPU and motherboard temperatures, and the `powertop` tool to monitor system power consumption and power management status, ensuring that the collected performance metrics cover all dimensions affecting the effectiveness of backup tasks.

[0076] Step S204: Input the performance index information into the orientation filter to obtain the positioning filtering result.

[0077] The targeted filter is used to directly determine the target backup node. It is a decision-making module for backup scheduling scenarios with clearly defined requirements. Its main function is to directly determine the target backup node based on preset conditions, thereby skipping the complex multi-dimensional evaluation process and achieving fast and accurate node location. For example, the targeted filter can handle direct requirements such as users explicitly specifying backups from the primary database, specifying a specific backup instance, or specifying a specific backup node.

[0078] The location filtering result may be a clearly specified target backup node identifier, or it may be an empty result indicating that no node matching the specified conditions was found. The target backup node refers to the backup node that will perform subsequent backup tasks.

[0079] For example, server 104 can input the aforementioned performance metric information into the targeted filter module. The targeted filter parses the backup configuration parameters and user-specified settings contained in the performance metric information to identify whether there is an explicit requirement to specify a backup node. Server 104 can check whether a flag for forced backup from the master database is set in the backup configuration. When the flag is true, the targeted filter can directly identify the master node in the database cluster as the target backup node and generate a location filtering result containing the master node identifier.

[0080] In some embodiments, server 104 can also employ intelligent priority matching for targeted filtering. Server 104 can establish a multi-level priority system for specified requirements within the targeted filter, sorting different types of specified requirements according to their priority. Server 104 can process the highest priority direct node specified requirements, and then process specified requirements at different levels, such as specific instance specified requirements and master database backup specified requirements, in sequence. When multiple different types of specified requirements exist, server 104 can make decisions according to priority order, with higher priority requirements overriding lower priority requirements. Server 104 can integrate intelligent conflict detection instructions into the targeted filter. When logical conflicts are detected among multiple specified requirements, the system can automatically generate a conflict report and handle them according to a preset conflict resolution strategy. Server 104 can also incorporate historical preference learning functionality into the targeted filter, recording user selection preferences in similar backup scenarios. When encountering ambiguous specified requirements, the system can make intelligent inferences and suggestions based on historical preferences.

[0081] For example, when performing targeted filtering in a PostgreSQL database cluster environment, server 104 can extract the user's specified requirements settings from the backup task's configuration information. Server 104 checks the `specified_master_backup` field in the backup configuration parameters. When this field is true, it indicates that the user requires backups to be performed from the master database. The targeted filter immediately identifies the master node in the database cluster and determines it as the target backup node, without considering the master node's current load or other performance metrics. Server 104 can also check the `specified_backup_instance` field in the configuration. When this field contains a specific instance identifier, the targeted filter searches for the corresponding node in the candidate backup node list based on the instance identifier. For example, when the specified instance identifier is `postgres_slave_002`, it finds the slave node identified as `postgres_slave_002` and determines it as the target backup node. Server 104 checks the `specified_backup_node` field. When this field contains a specific node identifier or IP address, the targeting filter directly locates the specified server node. For example, when the specified node is 192.168.1.105, the system verifies whether the server corresponding to this IP address is in the candidate backup node list and is in an available state. When the verification passes, Server 104 can generate a location filtering result containing complete information about the target node, including the node IP address, database port number, instance name, and other identifying information, and sets the processing status to "Successfully Detected Target Backup Node". When the verification process finds that the specified node is unavailable or does not exist, Server 104 can generate an empty location filtering result, set the processing status to "Failed to Detect Target Backup Node", and record the specific reason for the failure for subsequent troubleshooting reference.

[0082] Step S206: If the location filtering results do not identify the target backup node, input the performance index information into the condition filter to obtain a list of candidate nodes after condition filtering.

[0083] Conditional filters can be used to perform filtering for instance anomalies, master-slave synchronization delays, and disk space limitations. A conditional filter is a multi-level filtering module used to select candidate nodes that meet basic backup requirements. Its main function is to remove candidate nodes from the list based on multiple criteria, including instance status checks, master-slave synchronization verification, and storage space assessment. For example, a conditional filter can ensure that the database instance on the candidate node is running normally, the master-slave synchronization delay is within an acceptable range, and there is sufficient disk storage space.

[0084] Instance anomaly filtering involves checking the running status of database instances on candidate backup nodes, including verifying instance service running status and instance connection response status to ensure that the database instances can provide services normally. Master-slave synchronization delay filtering involves checking the data synchronization status between master and slave nodes in the database cluster, including evaluating synchronization performance indicators such as replication connection status, replay log position changes, and replay latency, to ensure the timeliness and consistency of slave node data. Disk space filtering involves evaluating the storage capacity of the servers hosting candidate backup nodes, calculating the expected size of the backup data and comparing it with available disk space to ensure sufficient storage space to complete the backup task.

[0085] For example, server 104 can check the status of the above location filtering results. When the location filtering results show that the target backup node could not be determined, server 104 can activate the condition filter to systematically filter the performance indicator information. Server 104 can design the condition filter as a multi-level sequential processing architecture, which can perform instance abnormal status filtering, master-slave synchronization delay filtering, and disk space sufficiency filtering. Each layer of filtering will check and update the candidate node list, and any one of the above filtering methods can be executed, or all of them can be executed sequentially.

[0086] For example, server 104 can extract the instance service running status of the database instance on each candidate backup node from the performance indicator information; send test query commands to perform database connection tests on each candidate backup node to obtain the instance connection response status; and remove candidate backup nodes with abnormal instance service running status or instance connection response status from the candidate node list. Server 104 can extract the database instance running status information of each candidate backup node from the performance indicator information, including the running status of the database process, the availability of the service listening port, the correctness of the instance configuration, and other status parameters. Server 104 can perform active database connection tests on each candidate backup node, verifying the instance's connection response capability by establishing a standard database connection and sending a simple test query command, and recording response status indicators such as connection establishment time, query response time, and connection stability. Server 104 can analyze the instance service running status and instance connection response status, and when it finds that the database instance of a candidate backup node is in a stopped state, connection timeout, abnormal response, or service unavailability, it can immediately remove the node from the candidate node list.

[0087] For example, server 104 can connect to the slave node database corresponding to each candidate backup node, extract the replication connection status between the master node and the slave node from the performance indicator information; if the replication connection status is stopped, remove the corresponding candidate backup node from the candidate node list; if the replication connection status is catching up or starting, continuously obtain the change of the replay log position, and if the replay log position remains unchanged within a preset time period, remove the corresponding candidate backup node from the candidate node list; if the replication connection status is normal streaming replication, obtain the replay delay time, and if the replay delay time exceeds a preset delay threshold, remove the corresponding candidate backup node from the candidate node list.

[0088] Server 104 can connect to the slave node database instances corresponding to each candidate backup node and obtain detailed master-slave synchronization status data by querying the replication status view and statistics of the database system. Server 104 can extract replication connection status information and identify the replication connection status between each slave node and the master node, including different connection status types such as normal streaming replication (indicating normal data synchronization), start status (indicating the replication process is initializing), catch-up status (indicating the slave node is catching up with the master node's data changes), and stopped status (indicating the replication connection has been interrupted). Server 104 can process replication connections in the stopped state. When it finds that the replication connection status of a candidate backup node is stopped, it indicates that the data synchronization between the slave node and the master node has been interrupted, and data consistency and timeliness cannot be guaranteed. Server 104 can remove this node from the candidate node list. Server 104 can continuously monitor replication connections in catch-up or startup states. It tracks the recovery progress of the replication process by periodically obtaining replay log position information. When the replay log position remains unchanged within a preset monitoring period, it indicates that the replication process may have encountered a fault or anomaly and cannot recover normally. Server 104 can also remove such nodes from the candidate list. Server 104 can also evaluate the replay latency of slave nodes in normal streaming replication state, obtain the latency of the slave node replaying the master node's transaction log, and compare the latency with the system's preset latency threshold. When the latency exceeds the acceptable threshold, it indicates that the slave node's data synchronization is significantly lagging, which may affect the timeliness of backup data. Server 104 can remove such high-latency nodes from the candidate list.

[0089] For example, server 104 can extract backup task configuration information from performance metrics information; the backup task configuration information includes backup data type and data compression parameters; the backup data type includes at least one of full backup, incremental backup, and differential backup; based on the backup data type, the original data volume of the data to be backed up is calculated, and based on the original data volume and data compression parameters, the compressed data volume is calculated; the remaining disk space of the server where each candidate backup node is located is obtained, and if the compressed data volume exceeds the remaining disk space, the corresponding candidate backup node is removed from the candidate node list. Server 104 can extract the configuration information of the backup task and the storage status data of each candidate backup node from the performance metrics information. Server 104 can analyze the backup data type settings in the backup task configuration information to identify whether the current backup task is a full backup, incremental backup, or differential backup, as different backup types will generate different data volume requirements. Server 104 can calculate the original data volume of the data to be backed up based on the backup data type. For a full backup, the complete data size of the entire database needs to be calculated; for an incremental backup, the amount of data that has changed since the last backup needs to be estimated; and for a differential backup, the cumulative size of all changed data since the last full backup needs to be calculated. Server 104 can obtain data compression parameters from the backup task configuration, including compression algorithm types such as gzip, zstd, and lz4, as well as compression level settings. Based on the compression efficiency factor of different compression algorithms and the compression ratio corresponding to the compression level, it calculates the expected data size after compression. The basic range for the compression ratio can be 1-9. The database size can be obtained through Linux commands, and the compressed size can be calculated using the following formula:

[0090]

[0091] in, Indicates the size after compression. Indicates the original size. This represents the baseline compression ratio, indicating the compression performance of the selected standard algorithm. Representing compression algorithms The efficiency factor, if This indicates that the algorithm compresses better than the benchmark algorithm, if This indicates poor compression performance. Server 104 can obtain information on the remaining disk space of the servers where each candidate backup node is located, including detailed storage capacity data such as the total capacity of the data storage partition, used space, and available space. Server 104 can compare the calculated compressed data volume with the remaining disk space of each candidate node. When the compressed data volume exceeds the remaining disk space of a candidate node, it indicates that the node cannot provide enough storage space to complete the backup task, and server 104 removes such nodes with insufficient storage space from the candidate node list.

[0092] In some embodiments, server 104 can design the condition filter as a multi-threaded concurrent processing architecture, performing various condition checks on different candidate backup nodes simultaneously, thus shortening the overall filtering processing time through parallel processing. Server 104 can employ intelligent load balancing during parallel processing, dynamically allocating processing threads based on the complexity and resource consumption of different check items to ensure efficient utilization of system resources. Server 104 can also integrate caching into the condition filter, locally caching frequently accessed performance indicator data and check results to avoid redundant network communication and database query operations. Server 104 can incorporate intelligent prediction functionality into the condition filter, building predictive models based on historical node performance data and failure modes to identify potential problem candidate nodes in advance and prioritize their inspection and processing. Server 104 can also implement dynamic threshold adjustment, dynamically adjusting the strictness of various filtering conditions based on the urgency of the current backup task and system load, providing greater flexibility in node selection while ensuring backup quality.

[0093] Through the systematic conditional filtering process described above, this step ensures that all candidate nodes entering the subsequent performance evaluation stage possess the basic conditions and necessary capabilities to execute backup tasks. Compared to traditional methods that may assign backup tasks to nodes with abnormal states or insufficient resources, this step effectively prevents the possibility of backup task execution failure through rigorous condition checks across multiple dimensions, including instance status, master-slave synchronization, and storage space. This significantly improves the success rate and reliability of backup tasks. By considering detailed factors such as data compression effects and sufficient storage space safety margin, this step ensures the security and stability of the backup process, avoiding backup interruptions or system anomalies caused by insufficient storage space. The multi-level screening mechanism of the conditional filter also improves the scientific nature and accuracy of the overall scheduling decision.

[0094] Step S208: Calculate the performance evaluation score of each candidate backup node in the candidate node list according to the indicator evaluation weight, determine the target backup node according to the performance evaluation score, and use the target backup node to perform the backup task.

[0095] Among them, the indicator evaluation weight refers to the quantitative coefficient of the importance of various performance indicators obtained by the online reinforcement learning module through continuous learning and optimization. It reflects the degree of influence and contribution value of different performance indicators on the execution effect of backup tasks. For example, the importance coefficients of indicators such as CPU utilization weight, memory availability weight, network bandwidth weight, disk I / O performance weight, and system load weight.

[0096] For example, server 104 can obtain the current performance evaluation weight vector from the online reinforcement learning module. This weight vector contains the importance coefficients corresponding to each performance indicator, and the dynamic weight values ​​can be obtained through feedback from the execution effects of historical backup tasks and iterative optimization of the reinforcement learning algorithm. Server 104 can perform performance indicator standardization on each node in the candidate node list after conditional filtering. This can be done by calculating the mean and standard deviation of each performance indicator across all candidate nodes, and using the Z-score standardization method to convert performance indicators with different dimensions and numerical ranges into uniform standardized values, thus eliminating the influence of differences in dimensions between different parameters.

[0097]

[0098] in, It is the original value of the j-th influencing parameter, corresponding to the various evaluation indicators collected; It is the mean of the j-th parameter across all nodes; It is the standard deviation of the j-th parameter across all nodes; These are the standardized feature values. After obtaining the feature values, the comprehensive score for each backup node can be calculated using a linear combination, as shown in the following formula:

[0099]

[0100] in, Weight vector , The standardized feature vector of node i Let i be the predicted score for node i. To account for the number of influencing parameters, server 104 can perform a linear combination operation on the standardized performance index vector of each candidate backup node and the corresponding index evaluation weight vector. The performance evaluation score of each candidate node is calculated by multiplying each item and then summing the results. This score comprehensively reflects the node's overall performance in multiple dimensions such as CPU performance, memory resources, network capabilities, storage performance, and system load.

[0101] Furthermore, server 104 can employ a greedy strategy to balance exploration and utilization during the target backup node determination process. An exploration probability parameter is set as a strategy control factor to balance the selection decision between random exploration and optimal utilization. Server 104 can generate a random value between zero and one as the basis for strategy judgment. When the random value is less than the exploration probability parameter, a candidate backup node is randomly selected from the candidate node list as the target backup node to explore the performance of unknown nodes. When the random value is greater than or equal to the exploration probability parameter, the candidate backup node with the highest performance evaluation score is selected as the target backup node to utilize the known best selection strategy. Server 104 can dynamically adjust the exploration probability parameter according to the number of times the backup task is executed, following an exponential decay function. In the early training stage, a high exploration probability is maintained to discover the true performance of each candidate backup node and the optimal combination of indicator weights. As the training progresses, the exploration probability is gradually reduced, and in the later training stage, the exploration probability is decayed to a lower value so that the algorithm focuses more on utilizing the learned best strategy to select the backup node with the best performance.

[0102] After determining the target backup node, server 104 can select the appropriate backup tool software and configure the backup execution parameters according to the backup task configuration information. Server 104 can select the corresponding dedicated backup tool according to the database type. For PostgreSQL databases, pg_basebackup can be selected for basic backup, pgBackRest for enterprise-level backup management, or pg_dump for logical backup. For MySQL databases, mysqldump can be selected for logical backup, PerconaXtra Backup for physical backup, or MySQL Enterprise Backup for enterprise-level backup. For Oracle databases, RMAN (Recovery Manager) can be selected for full backup and recovery, or Oracle Data Pump for data migration backup.

[0103] Next, server 104 can initiate a backup process on the target backup node and continuously monitor the backup execution status, recording status information such as backup start time, current progress percentage, and estimated completion time. Server 104 can monitor the resource usage of the target backup node, including CPU utilization, memory consumption, disk I / O load, and network bandwidth usage, ensuring that the backup process does not excessively impact the normal operation of the production environment. Server 104 can collect performance data during the backup execution process, including total backup time, data transfer rate, and actual backup data volume, recording detailed error information and status when errors or anomalies occur during the backup process for problem diagnosis and fault recovery. After the backup task is completed, server 104 can verify the integrity and availability of the backup files, ensuring that the backup data can be used for subsequent recovery operations, and simultaneously pass the backup execution performance data to the online reinforcement learning module for weight updates and policy optimization.

[0104] In some embodiments, server 104 can incorporate multiple optimization objectives into the performance evaluation score calculation, considering not only backup speed optimization but also minimizing the impact of system load, rationalizing network bandwidth usage, and maximizing storage space utilization. Server 104 can employ the concept of Pareto optimality to establish a multi-objective evaluation model, seeking a comprehensive optimal solution that performs well across all objective dimensions, avoiding significant performance losses that might result from optimizing a single metric. Server 104 can also integrate a dynamic weight adjustment mechanism into the performance evaluation, adjusting the weight allocation of various metrics in real time based on environmental factors such as current system load, business priority, and backup window time, achieving a more flexible and adaptive node selection strategy.

[0105] In the aforementioned backup node scheduling method, by acquiring the performance index information of each candidate backup node in the database cluster, comprehensive performance data affecting backup effectiveness can be collected. This addresses the problem of traditional random scheduling methods lacking performance basis. The performance index information is input into a directional filter to obtain the location filtering result. The directional filter is used to directly determine the target backup node, which can quickly handle scheduling scenarios with clearly specified requirements and avoid unnecessary complex calculation processes. If the location filtering result does not determine the target backup node, the performance index information is input into a condition filter to obtain a candidate node list after conditional filtering. The condition filter performs basic conditional filtering on the candidate nodes, which can pre-exclude nodes with abnormal status, substandard performance, or insufficient resources, ensuring that the nodes entering the subsequent evaluation stage all have basic backup execution capabilities. Based on the index evaluation weight, the performance evaluation score of each candidate backup node in the candidate node list is calculated. The target backup node is determined based on the performance evaluation score and the target backup node is used to execute the backup task. By introducing index evaluation weight, the importance of different performance indicators to the backup effect can be weighted and calculated, thereby achieving accurate node selection based on quantitative evaluation and improving the accuracy of backup node scheduling in the database cluster environment.

[0106] In one exemplary embodiment, such as Figure 3 As shown, the above method may further include steps S302 to S306. Wherein:

[0107] Step S302: Collect backup effect data generated after the backup task is completed.

[0108] Backup performance data can include actual backup time and actual backup data volume, as well as performance metrics across multiple dimensions such as backup transfer rate, resource usage, and number of errors. Actual backup time refers to the total time consumed from the start of the backup task to its complete completion, including the cumulative time consumed at each stage, such as data reading time, compression processing time, network transmission time, and disk write time. Actual backup data volume refers to the actual amount of data processed and transferred by the backup task, including the original data size and the final backup file size after compression. This metric reflects the workload and data processing efficiency of the backup task.

[0109] For example, when server 104 performs performance data collection after the PostgreSQL database backup task is completed, it first extracts detailed backup execution information from the execution log of the pg_basebackup tool. Server 104 reads the backup log file and obtains the backup start time as 9:30:15 AM and the backup end time as 11:28:42 AM, calculating the actual backup time to be 1 hour, 58 minutes, and 27 seconds, or 7107 seconds. Server 104 extracts data processing statistics from the backup log, obtaining the original database size scanned as 520GB, the actual backup data volume as 518GB, and the backup file size after removing temporary files and gzip compression as 198GB, calculating the compression ratio to be approximately 38%, which meets the expected compression effect. Server 104 collects transmission performance data during the backup process, including network performance indicators such as an average transmission rate of 74.2MB / s, a peak transmission rate of 156MB / s, an average network latency of 12ms during transmission, and a packet loss rate of 0.02%. Server 104 can collect resource usage data of the target backup node during backup using system monitoring tools. This includes detailed data on CPU utilization (rising from an initial 15% to a peak of 82% and then stabilizing at around 65%), memory usage (increasing from an initial 4.2GB to a peak of 8.7GB), average disk I / O read speed of 145MB / s, and average network bandwidth usage of 592Mbps. Server 104 can also record and assess the impact of the backup process on the production environment, including quantitative indicators of load impact such as an average 18% increase in database query response time, a decrease of approximately 12% in concurrent connection processing capacity, and a decrease of approximately 25% in CPU availability for other system processes. Server 104 can collect reliability data during backup execution, recording reliability-related effects such as 0 network connection interruptions, 0 disk read errors, 100% data verification pass rate, and no need for retry operations. Finally, Server 104 can perform quality verification of backup files, confirming file integrity through MD5 checksums, verifying recoverability through sample data recovery tests, and confirming that backup quality meets expected standards through data consistency checks. Server 104 organizes all the collected backup performance data into structured data records, including core performance indicators such as actual backup time of 7107 seconds, actual backup data volume of 198GB after compression, and average transfer rate of 74.2MB / s.

[0110] Through the aforementioned backup performance data collection process, accurate, complete, and multi-dimensional backup execution feedback information is provided for the online reinforcement learning module. Compared with the traditional method's lack of systematic performance feedback, this step ensures that the learning algorithm can obtain sufficient training information through comprehensive data collection, providing a reliable data foundation for subsequent prediction error calculation and weight optimization. The multi-dimensional collection of performance data also enhances the learning algorithm's ability to understand complex backup scenarios, enabling the weight update process to comprehensively consider multiple factors such as backup efficiency, system load impact, and reliability.

[0111] Step S304: Calculate prediction error data based on backup effect data and the performance evaluation score of the target backup node.

[0112] Among them, the prediction error data refers to the error quantification index calculated by comparing the actual execution effect of the backup task with the expected effect based on the performance evaluation score, which reflects the level of model prediction accuracy under the current weight configuration.

[0113] For example, server 104 can calculate the actual reward value based on the actual backup time and the actual backup data volume. The larger the actual reward value, the better the backup performance. It can also calculate the prediction error data between the actual reward value and the performance evaluation score of the target backup node.

[0114] For example, server 104 can calculate the actual reward value based on the actual backup time and the actual backup data volume. The ratio of backup data volume to backup time is used as a quantitative indicator of backup efficiency. In calculating the actual reward value, the consistency of data units needs to be considered. The backup data volume can be uniformly converted to standard units such as GB, and the backup time can be uniformly converted to standard time units such as seconds, ensuring the accuracy and comparability of the calculation results. Server 104 can obtain the prediction error value by subtracting the performance evaluation score from the actual reward value. A positive error indicates that the actual effect is better than the expected prediction, while a negative error indicates that the actual effect is worse than the expected prediction. The absolute value of the error reflects the degree of model prediction deviation.

[0115] In some embodiments, server 104 can employ a multi-level reward value calculation strategy to enhance the accuracy of prediction errors. Server 104 can establish a composite reward function that includes multiple sub-objectives, considering not only backup speed efficiency but also system resource utilization efficiency, backup quality assurance, and minimization of environmental impact, calculating a comprehensive actual reward value through a weighted combination. Server 104 can also dynamically adjust rewards, adjusting the weight allocation of reward calculation based on dynamic factors such as current business needs, system status, and time windows, so that the reward value can better reflect the performance priority in the current scenario.

[0116] Through the aforementioned prediction error calculation process, model prediction accuracy evaluation based on objective effect feedback is achieved, providing accurate error guidance signals for weight optimization of online reinforcement learning algorithms. Compared to the lack of real-time feedback mechanisms in traditional machine learning methods, this step, through comparative analysis of actual results and expected predictions, can promptly identify deviations and shortcomings in model predictions, pointing out specific optimization directions for model improvement.

[0117] Step S306: Update the indicator evaluation weights based on the prediction error data.

[0118] Gradient descent is an optimization algorithm that determines the direction and magnitude of parameter updates by calculating the gradient of the objective function with respect to the parameters. This gradient is used to adjust the weight vector based on the prediction error to minimize the error. The update direction refers to the direction of weight parameter adjustment, determined by the product of the prediction error and the corresponding node's performance metric. Positive errors lead to increased weights, while negative errors lead to decreased weights. The update magnitude refers to the step size of the weight parameter adjustment, controlled by the learning rate. A larger learning rate results in a larger adjustment step size but may cause oscillations, while a smaller learning rate results in a smaller adjustment step size but slower convergence.

[0119] For example, server 104 can determine the update direction of gradient descent algorithm based on prediction error data and performance index information of target backup node; determine the update magnitude of gradient descent algorithm based on learning rate parameter; and update each weight component in index evaluation weight using gradient descent algorithm based on prediction error data, update direction and update magnitude.

[0120] Furthermore, server 104 can also obtain historical gradient data and / or feature importance coefficients for each weight component; and adjust the learning rate parameters corresponding to each weight component based on the historical gradient data and / or feature importance coefficients.

[0121] For example, the server can obtain the standardized performance index vector of the target backup node, calculate the gradient vector, and multiply the prediction error data element-wise with the standardized performance index vector of the target node to obtain the gradient value corresponding to each weight component. The positive or negative sign of the gradient value indicates the direction of weight adjustment, and the absolute value reflects the intensity of the adjustment requirement. The server 104 can determine the update magnitude of the gradient descent algorithm according to a preset learning rate parameter. The learning rate parameter controls the step size of each weight update, and a suitable balance needs to be found between convergence speed and stability. The server 104 can perform the weight vector update operation. For example, the server 104 can update the weight vector according to the backup duration. Compared to the actual backup size Through formula Receive the actual reward and calculate the prediction error. This measures the difference between the predicted score and the actual performance, guiding weight adjustments. Finally, gradient descent is used to adjust the weights so that the predicted score is closer to the actual reward. The weight update formula is:

[0122]

[0123] in, The learning rate is used to control the update step size. For prediction error, To select nodes, a standardized feature vector is used. Server 104 can introduce AdaGrad and perform differential learning on feature importance based on it. The learning rate update formula is as follows:

[0124]

[0125] in, The initial learning rate determines the initial step size for weight updates; The cumulative sum of squared gradients is the sum of the squared gradients from the beginning to the current time step. This parameter can monotonically increase with time, causing the learning rate to gradually decay. , which is the product of the prediction error and the eigenvector; A smoothing constant to prevent division by zero and ensure minimum importance; The weights for feature importance are calculated using the following formula:

[0126]

[0127] This represents the absolute value of the current weight of the j-th feature parameter; the larger the value, the more important the feature. It is a smoothing constant, which can effectively prevent extreme values ​​of importance weights. This adaptive learning rate algorithm allows important features to receive a larger learning rate, converges quickly, and adjusts the learning speed according to real-time changes in importance, while changes in minor parameters do not excessively affect the learning of important parameters.

[0128] Through the aforementioned weight update process, the online reinforcement learning module can continuously improve and optimize the weight configuration based on the actual execution results of the backup task. Compared with the limitations of traditional offline machine learning methods where fixed weights cannot adapt to environmental changes, this step achieves the model's adaptive ability to changes in data distribution and environmental conditions through a dynamic weight adjustment mechanism. This significantly improves the accuracy and adaptability of backup node selection. The differentiated learning rate adjustment based on feature importance solves the convergence efficiency problem caused by using the same learning rate for all parameters in traditional methods. This allows important features to converge quickly while avoiding the impact of random fluctuations in minor features on overall stability.

[0129] In one exemplary embodiment, such as Figure 4 As shown, step S208 may include steps S402 to S406. Wherein:

[0130] Step S402: Standardize the performance index information of each candidate backup node in the candidate node list to obtain standardized data.

[0131] For example, when server 104 performs performance metric standardization on three candidate backup nodes in a PostgreSQL database cluster environment, it first collects the raw performance metric data of each node. Server 104 obtains the following raw data for node A: CPU utilization 65%, memory availability 70%, network latency 12 milliseconds, disk I / O speed 150 MB / s, and system load 0.8; for node B: CPU utilization 45%, memory availability 85%, network latency 8 milliseconds, disk I / O speed 180 MB / s, and system load 0.6; and for node C: CPU utilization 80%, memory availability 60%, network latency 15 milliseconds, disk I / O speed 120 MB / s, and system load 1.2. Server 104 calculates the statistical characteristics of various indicators, including: CPU utilization (mean 63.33%, standard deviation 17.64%), memory availability (mean 71.67%, standard deviation 12.58%), network latency (mean 11.67 milliseconds, standard deviation 3.51 milliseconds), disk I / O speed (mean 150 MB / s, standard deviation 30 MB / s), and system load (mean 0.867, standard deviation 0.306), etc.

[0132] Next, standardization can be performed on node A: CPU utilization is standardized to 0.095, memory availability to -0.133, network latency to 0.094, disk I / O speed to 0, and system load to -0.219. Similarly, standardization is performed on nodes B and C. Furthermore, server 104 can reverse the processing of negative metrics. Since network latency and system load are negative metrics where lower values ​​indicate better performance, server 104 multiplies the standardized results of these two metrics by -1 for reverse processing. Server 104 obtains the final standardized data matrix, ensuring that all metrics follow the unified semantic direction that higher values ​​indicate better performance. Server 104 verifies the quality of the standardized data, checking whether the mean of the standardized values ​​for each metric is close to 0 and whether the standard deviation is close to 1, confirming the correctness of the standardization process, and then passes the standardized data matrix to the next step for performance evaluation score calculation.

[0133] Step S404: Perform a linear combination operation on the standardized data and the corresponding indicator evaluation weights to obtain the performance evaluation score of each candidate backup node.

[0134] For example, when server 104 performs performance evaluation score calculation on three candidate backup nodes in a PostgreSQL database cluster environment, it first obtains the current weight vector configuration from the online reinforcement learning module. Server 104 obtains a weight vector containing five components, corresponding to the importance coefficients of various indicators such as CPU utilization weight 0.2, memory availability weight 0.15, network latency weight 0.1, disk I / O performance weight 0.25, and system load weight 0.3. The sum of the weight components is 1.0, which meets the normalization requirement. Server 104 obtains the normalized data matrix obtained in step S402, including the normalized vectors of node A (0.095, -0.133, -0.094, 0, 0.219), node B (-1.040, 1.060, 1.045, 1.000, 0.873), and node C (0.945, -0.927, -0.951, -1.000, -1.092). Server 104 can perform linear combination operations on node A to obtain a comprehensive evaluation score.

[0135] Through the aforementioned linear combination operation, multi-dimensional performance index information is integrated into a unified comprehensive performance evaluation score. Compared to the limitations of traditional methods that rely on a single index or subjective judgment for node selection, this step achieves node performance ranking based on scientific quantitative analysis through weighted multi-index comprehensive evaluation, ensuring the objectivity and accuracy of the selection decision. The simplicity and efficiency of the linear combination operation also ensure the response speed of real-time scheduling decisions, while the weight configuration optimized by online reinforcement learning enables the comprehensive evaluation to continuously adapt to changes in the environment and task requirements.

[0136] Step S406: Sort each candidate backup node based on the performance evaluation score to obtain a scoring sequence, and select the candidate backup node as the target backup node according to the scoring sequence.

[0137] For example, server 104 can obtain exploration probability parameters and random values ​​within a preset range; when the random value is less than the exploration probability parameters, a candidate backup node is randomly selected from the candidate node list as the target backup node; when the random value is greater than or equal to the exploration probability parameters, the candidate backup node is selected as the target backup node according to the order of the scoring sequence.

[0138] Furthermore, server 104 can calculate the exploration probability parameter according to the exponential decay function based on the number of times the backup task is executed.

[0139] In some embodiments, server 104 can employ more complex selection strategies to enhance the intelligence of decision-making. Server 104 can introduce a soft-maximum selection strategy, calculating the probability distribution of node selection based on performance evaluation scores. Nodes with better performance receive a higher probability of selection, but the selection is not absolutely certain. This strategy can utilize optimal nodes while maintaining a certain degree of randomness. Server 104 can also implement an upper confidence bound selection strategy, comprehensively considering the node's performance evaluation score and the uncertainty of selection, prioritizing nodes with higher performance potential or fewer explorations, achieving a more intelligent balance between exploration and utilization.

[0140] For example, when server 104 performs sorting and selection on three candidate backup nodes in a PostgreSQL database cluster environment, it first sorts the nodes based on their performance evaluation scores. Server 104 obtains the performance evaluation scores of each node, including 0.056 for node A, 0.568 for node B, and -0.623 for node C. These scores are then sorted from highest to lowest, resulting in a score sequence of node B (0.568), node A (0.056), and node C (-0.623). Server 104 records detailed sorting information, confirming that node B, ranked first, is the current optimal choice, node A, ranked second, is the second-best choice, and node C, ranked third, is the worst performing choice. Server 104 can then execute an ε-greedy strategy for target node selection. Assuming this is the 25th backup task execution, the initial exploration probability is 0.3, and the decay coefficient is 0.98. Server 104 calculates the current exploration probability parameter to be 0.183. Server 104 generates a random number, assuming the generated random number is 0.156. Since 0.156 is less than the exploration probability of 0.183, the system decides to execute the exploration strategy. Server 104 randomly selects from 3 candidate nodes. Assuming the random selection algorithm returns node C, although node C has the lowest performance evaluation score, the selection of the exploration strategy can collect data on the actual performance of this node in the current environment, providing diverse training samples for model learning.

[0141] Server 104 can record the complete decision-making process, including the current exploration probability parameter (0.183), the generated random value (0.156), the exploration strategy adopted, the selected target node C, and detailed information such as the scoring sequence at the time of decision: node B (first), node A (second), node C (third), etc. Server 104 updates the strategy usage statistics, recording this decision as an exploration strategy use and updating the cumulative number of times the exploration strategy has been used, providing statistical basis for subsequent strategy effect analysis and parameter optimization. Server 104 prepares to pass the information of the selected target backup node C to subsequent backup execution steps, while simultaneously collecting complete contextual information of this selection decision for future weight updates and strategy optimization, forming a complete learning loop from node selection to effect feedback.

[0142] Through the aforementioned sorting and intelligent selection process, this step enables efficient decision-making using the current best performance evaluation results while maintaining the ability to search for better solutions through an exploration strategy. Compared to the local optima problem that may result from the greedy strategy of simply selecting the highest-scoring node in traditional methods, this step ensures the continuous learning and optimization capabilities of the scheduling strategy through the balance between exploration and utilization using an ε-greedy strategy, avoiding the risk of premature convergence to a local optimum. The exponential decay mechanism of the exploration probability achieves a reasonable transition from exploration-oriented to utilization-oriented, providing ample exploration opportunities to discover the optimal strategy in the early stages of training, and focusing on utilizing the learned best choices to ensure execution efficiency in the later stages of training.

[0143] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps. It is understood that the steps in different embodiments can be freely combined as needed, and all non-contradictory solutions formed by such combinations are within the scope of protection of this application.

[0144] Based on the same inventive concept, this application also provides a backup node scheduling apparatus for implementing the backup node scheduling method described above. The solution provided by this apparatus is similar to the implementation described in the above method; therefore, the specific limitations in one or more backup node scheduling apparatus embodiments provided below can be found in the limitations of the backup node scheduling method described above, and will not be repeated here.

[0145] In one exemplary embodiment, such as Figure 5 As shown, a backup node scheduling device is provided, including: a data acquisition module 502, a first filtering module 504, a second filtering module 506, and a node selection module 508, wherein:

[0146] Data acquisition module 502 is used to acquire performance index information of each candidate backup node in the database cluster;

[0147] The first filtering module 504 is used to input performance index information into the directional filter to obtain the location filtering result; wherein, the directional filter is used to directly determine the target backup node;

[0148] The second filtering module 506 is used to input performance index information into the condition filter when the location filtering result does not determine the target backup node, so as to obtain a list of candidate nodes after condition filtering.

[0149] The node selection module 508 is used to calculate the performance evaluation score of each candidate backup node in the candidate node list according to the indicator evaluation weight, determine the target backup node according to the performance evaluation score, and use the target backup node to perform the backup task.

[0150] In one embodiment, the apparatus further includes: a weight update module, configured to collect backup performance data generated after the backup task is completed; calculate prediction error data based on the backup performance data and the performance evaluation score of the target backup node; and update the indicator evaluation weights based on the prediction error data.

[0151] In one embodiment, the backup performance data includes the actual backup time and the actual backup data volume; the weight update module is specifically used to calculate the actual reward value based on the actual backup time and the actual backup data volume; and to calculate the prediction error data between the actual reward value and the performance evaluation score of the target backup node.

[0152] In one embodiment, the weight update module is further configured to determine the update direction of the gradient descent algorithm based on the prediction error data and the performance index information of the target backup node; determine the update magnitude of the gradient descent algorithm based on the learning rate parameter; and update each weight component in the weight evaluation index using the gradient descent algorithm based on the prediction error data, update direction, and update magnitude.

[0153] In one embodiment, the weight update module is further configured to: obtain historical gradient data and / or feature importance coefficients for each weight component; and adjust the learning rate parameter corresponding to each weight component based on the historical gradient data and / or feature importance coefficients.

[0154] In one embodiment, the node selection module 508 is specifically used to standardize the performance index information of each candidate backup node in the candidate node list to obtain standardized data; perform linear combination operation on the standardized data and the corresponding index evaluation weight to obtain the performance evaluation score of each candidate backup node; sort each candidate backup node based on the performance evaluation score to obtain a scoring sequence, and select the candidate backup node as the target backup node according to the scoring sequence.

[0155] In one embodiment, the node selection module 508 is further configured to obtain the exploration probability parameter and a random value within a preset range; when the random value is less than the exploration probability parameter, a candidate backup node is randomly selected from the candidate node list as the target backup node; when the random value is greater than or equal to the exploration probability parameter, the candidate backup node is selected as the target backup node according to the order of the scoring sequence.

[0156] In one embodiment, the node selection module 508 is further configured to calculate the exploration probability parameter according to the number of times the backup task is executed, based on an exponential decay function.

[0157] In one embodiment, the conditional filter is used to perform instance abnormal state filtering; the second filtering module 506 is specifically used to extract the instance service running status of the database instance on each candidate backup node from the performance indicator information; send a test query command to perform database connection test on each candidate backup node to obtain the instance connection response status; and remove the candidate backup nodes with abnormal instance service running status or instance connection response status from the candidate node list.

[0158] In one embodiment, the database cluster includes a master node and at least one slave node. The candidate backup node is a slave node in the database cluster. The conditional filter is used to perform synchronization delay filtering. The second filtering module 506 is specifically used to connect to the slave node databases corresponding to each candidate backup node, extract the replication connection status between the master node and the slave node from the performance indicator information; when the replication connection status is stopped, the corresponding candidate backup node is removed from the candidate node list; when the replication connection status is catching up or starting, the changes in the replay log position are continuously obtained, and when the replay log position remains unchanged within a preset time period, the corresponding candidate backup node is removed from the candidate node list; when the replication connection status is normal streaming replication, the replay delay time is obtained, and when the replay delay time exceeds a preset delay threshold, the corresponding candidate backup node is removed from the candidate node list.

[0159] In one embodiment, a conditional filter is used to perform disk space filtering; the second filtering module 506 is specifically used to extract backup task configuration information from performance indicator information; the backup task configuration information includes backup data type and data compression parameters; the backup data type includes at least one of full backup, incremental backup and differential backup; based on the backup data type, the original data volume of the data to be backed up is calculated, and based on the original data volume and data compression parameters, the compressed data volume is calculated; the remaining disk space of the server where each candidate backup node is located is obtained, and if the compressed data volume exceeds the remaining disk space, the corresponding candidate backup node is removed from the candidate node list.

[0160] Each module in the aforementioned backup node scheduling device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.

[0161] In one exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 6 As shown, this computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and databases. The internal memory provides the environment for the operating system and computer programs stored in the non-volatile storage media to run. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. When the computer program is executed by the processor, it implements a backup node scheduling method.

[0162] Those skilled in the art will understand that Figure 6 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0163] In one embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above method embodiments.

[0164] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above method embodiments.

[0165] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.

[0166] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.

[0167] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0168] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A backup node scheduling method, characterized in that, The method includes: Obtain performance metrics information for each candidate backup node in the database cluster; The performance index information is input into the directional filter to obtain the location filtering result; wherein, the directional filter is used to directly determine the target backup node; If the location filtering results do not identify the target backup node, the performance index information is input into the condition filter to obtain a list of candidate nodes after condition filtering. Based on the evaluation weights of the indicators, the performance evaluation score of each candidate backup node in the candidate node list is calculated. The target backup node is determined based on the performance evaluation score, and the backup task is performed using the target backup node.

2. The method according to claim 1, characterized in that, The method further includes: Collect backup effect data generated after the backup task is completed; Based on the backup performance data and the performance evaluation score of the target backup node, the prediction error data is calculated; The evaluation weights of the indicators are updated based on the prediction error data.

3. The method according to claim 2, characterized in that, The backup performance data includes the actual backup time and the actual backup data volume; the calculation of prediction error data based on the backup performance data and the performance evaluation score of the target backup node includes: The actual reward value is calculated based on the actual backup time and the actual backup data volume. Calculate the prediction error data between the actual reward value and the performance evaluation score of the target backup node.

4. The method according to claim 2, characterized in that, The step of updating the indicator evaluation weights based on the prediction error data includes: Based on the prediction error data and the performance index information of the target backup node, the update direction of the gradient descent algorithm is determined; The update magnitude of the gradient descent algorithm is determined based on the learning rate parameter; Based on the prediction error data, the update direction, and the update magnitude, the gradient descent algorithm is used to update each weight component in the indicator evaluation weights.

5. The method according to claim 4, characterized in that, The method further includes: Obtain the historical gradient data and / or feature importance coefficients of each weight component; The learning rate parameter corresponding to each weight component is adjusted based on the historical gradient data and / or feature importance coefficients.

6. The method according to claim 1, characterized in that, The step of calculating the performance evaluation score of each candidate backup node in the candidate node list based on the indicator evaluation weight, and determining the target backup node based on the performance evaluation score, includes: The performance index information of each candidate backup node in the candidate node list is standardized to obtain standardized data. The standardized data is linearly combined with the corresponding indicator evaluation weights to obtain the performance evaluation score of each candidate backup node. The candidate backup nodes are sorted based on the performance evaluation scores to obtain a scoring sequence, and the candidate backup nodes are selected as target backup nodes according to the scoring sequence.

7. The method according to claim 6, characterized in that, The step of selecting candidate backup nodes as target backup nodes based on the scoring sequence includes: Obtain the exploration probability parameter and a random value within a preset range; If the random value is less than the exploration probability parameter, a candidate backup node is randomly selected from the candidate node list as the target backup node. When the random value is greater than or equal to the exploration probability parameter, candidate backup nodes are selected as target backup nodes according to the order of the scoring sequence.

8. The method according to claim 7, characterized in that, The acquisition of exploration probability parameters includes: The exploration probability parameter is calculated according to the number of times the backup task is executed, using an exponential decay function.

9. The method according to any one of claims 1 to 8, characterized in that, The conditional filter is used to perform instance abnormal state filtering; the step of inputting the performance indicator information into the conditional filter to obtain a candidate node list after conditional filtering includes: Extract the instance service running status of the database instance on each of the candidate backup nodes from the performance indicator information; Send a test query command to perform database connection tests on each of the candidate backup nodes and obtain the instance connection response status; Remove candidate backup nodes whose instance service running status or instance connection response status is abnormal from the candidate node list.

10. The method according to any one of claims 1 to 8, characterized in that, The database cluster includes one master node and at least one slave node. The candidate backup node is a slave node in the database cluster. The conditional filter is used to perform synchronization delay filtering. The performance metric information is input into the conditional filter to obtain a list of candidate nodes after conditional filtering, including: Connect to the slave node database corresponding to each of the candidate backup nodes, and extract the replication connection status between the master node and the slave node from the performance indicator information; If the replication connection is in a stopped state, the corresponding candidate backup node will be removed from the candidate node list. When the replication connection is in catch-up or start state, continuously acquire the changes in the replay log position. If the replay log position remains unchanged within a preset time period, remove the corresponding candidate backup node from the candidate node list. If the replication connection is in normal streaming replication status, the replay delay time is obtained. If the replay delay time exceeds a preset delay threshold, the corresponding candidate backup node is removed from the candidate node list.

11. The method according to any one of claims 1 to 8, characterized in that, The conditional filter is used to perform disk space filtering; the process of inputting the performance metric information into the conditional filter to obtain a list of candidate nodes after conditional filtering includes: Extract backup task configuration information from the performance metrics information; the backup task configuration information includes backup data type and data compression parameters; the backup data type includes at least one of full backup, incremental backup and differential backup. Based on the data type of the backup, calculate the original data volume of the data to be backed up, and based on the original data volume and the data compression parameters, calculate the compressed data volume; Obtain the remaining disk space of the server where each candidate backup node is located, and remove the corresponding candidate backup node from the candidate node list if the amount of compressed data exceeds the remaining disk space.

12. A backup node scheduling device, characterized in that, The device includes: The data acquisition module is used to acquire performance metrics information of each candidate backup node in the database cluster; The first filtering module is used to input the performance index information into the directional filter to obtain the location filtering result; wherein, the directional filter is used to directly determine the target backup node; The second filtering module is used to input the performance index information into the condition filter when the location filtering result does not determine the target backup node, so as to obtain a list of candidate nodes after condition filtering. The node selection module is used to calculate the performance evaluation score of each candidate backup node in the candidate node list according to the indicator evaluation weight, determine the target backup node according to the performance evaluation score, and use the target backup node to perform the backup task.

13. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 11.

14. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 11.

15. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 11.

Citation Information

Patent Citations

  • Processing method for data backup in cluster and cluster

    CN119356941A

  • Method for backing up data, electronic equipment and computer program product

    CN119440907A

  • Database node switching method, device and equipment based on hardware fault

    CN119544472A

  • Multi-system redundant computer processing method and system and electronic equipment

    CN120386667A

  • Data backup method and device based on distributed database and storage medium

    CN120631658A