A data storage and processing system for a cloud platform

By designing an optimized distributed database system in the embedded system of the cloud platform, using dqlite database and improved Raft consensus algorithm, the problems of database performance and resource consumption in the embedded system are solved, and the system response time is reduced by optimizing the election process.

CN119597845BActive Publication Date: 2025-05-09BEIJING TIANHUA XINGHANG TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411684713.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-22
Publication Date
2025-05-09
Estimated Expiration
2044-11-22

AI Technical Summary

Technical Problem

Existing distributed database technologies are difficult to meet the requirements of performance, resource consumption and maintenance costs in embedded systems. At the same time, the Raft consensus algorithm may lead to an increase in system response time during the election process.

Method used

A cloud platform data storage and processing system is designed. By running the dqlite database on all physical machines and implementing the synchronization process of specified information, the candidate dqlite database obtains priority based on the number of log entries submitted in the most recent target time period and the latest index, and votes for the candidate dqlite database with the highest priority in the voting process.

Benefits of technology

By optimizing the election process, ensure that the new leader dqlite database has more submitted log entries and newer indexes, thereby reducing log synchronization time and reducing system response time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119597845B_ABST
    Figure CN119597845B_ABST
Patent Text Reader

Abstract

The present application relates to the field of electronic digital data processing technology, and in particular to a data storage and processing system for a cloud platform. It includes several physical machines of the cloud platform, each of which runs a dqlite and a virtual machine management center. The process of implementing the synchronization of specified information between dqlites includes the following steps: After a follower dqlite is transformed into a candidate dqlite, its priority is obtained according to the number of log entries submitted by it in the most recent target time period and the latest degree of index, and the priority is included in the voting request sent to other dqlites; if a dqlite receives a voting request sent by other dqlites, and has not voted for other dqlites, and there is a dqlite database corresponding to the voting request that has a voted identity, then the vote is cast for the dqlite that has the voted identity and the highest priority. The present invention can reduce the system response time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of electronic digital data processing, and in particular to a data storage and processing system for a cloud platform. Background Art

[0002] With the development of the Internet and cloud computing, distributed database technology has been widely used, while traditional centralized databases are gradually unable to meet the needs of large-scale and high concurrency. Most existing distributed database technologies are suitable for large-scale clusters and are not suitable for lightweight embedded scenarios. In embedded systems, performance, resource consumption, and maintenance costs have become key issues.

[0003] Although existing embedded databases (such as SQLite) can meet the resource constraints of embedded scenarios, they lack high availability and distributed capabilities. In practical applications, a lightweight, easy-to-manage distributed database is needed to solve data consistency, high availability, and scalability issues.

[0004] dqlite is a lightweight distributed SQLite database with the advantage of being lightweight. Combined with the existing Raft consensus algorithm, it can provide distributed high availability features and solve the single-node failure problem of traditional embedded databases. However, in the existing Raft consensus algorithm, each node will enter the candidate state and request votes from other nodes when there is no leader. The election process is based on the agreement of most nodes to determine the new leader. By default, all nodes have an equal chance to become leaders. However, such an election process may result in some nodes being selected as leaders, and these nodes may contain less log data, or their log progress is inconsistent with other nodes, which will result in additional log synchronization time after the election, resulting in increased system response time. Especially in the case of high concurrent requests, users will feel that the system response is slow. Summary of the invention

[0005] The present invention aims to provide a data storage and processing system for a cloud platform to reduce system response time.

[0006] According to the present invention, a data storage and processing system for a cloud platform is provided, the system comprising several physical machines of the cloud platform, each of which runs a dqlite database and a virtual machine management center, any virtual machine management center is used to manage all virtual machines running on the physical machine running the virtual machine management center, any dqlite database stores specified information of all virtual machines running on all physical machines included in the system, the specified information of any virtual machine includes startup parameters, startup status, configuration parameters of the virtual machine and identity information of the physical machine on which the virtual machine runs; the process of synchronizing the specified information between the dqlite databases running on all physical machines included in the system comprises the following steps:

[0007] S100, if a follower dqlite database does not receive a heartbeat message sent by a leading dqlite database within a first preset time period, the follower dqlite database is transformed into a candidate dqlite database, and the priority of the candidate dqlite database is obtained according to the number of log entries submitted by the candidate dqlite database in the most recent target time period and the latest degree of the index; the priority of the candidate dqlite database is positively correlated with the number of log entries submitted by the candidate dqlite database in the most recent target time period and the latest degree of the index.

[0008] S200, the candidate dqlite database sends a voting request to other dqlite databases; the voting request includes the priority of the candidate dqlite database.

[0009] S300, if a dqlite database receives a voting request sent by another dqlite database and the dqlite database has not voted for the other dqlite database, then determine whether the dqlite database corresponding to each voting request received has the identity to be voted, if there are more than or equal to 1 voting requests corresponding to the dqlite databases that have the identity to be voted, then cast the vote for the dqlite database that has the identity to be voted and has the highest priority.

[0010] S400: If a candidate dqlite database obtains votes from more than half of the dqlite databases, the candidate dqlite database is determined as a new leading dqlite database.

[0011] Compared with the prior art, the present invention has at least the following beneficial effects:

[0012] The present invention implements the storage of specified information of all virtual machines running on all physical machines included in the system based on dqlite; wherein, in the process of realizing the synchronization of specified information between dqlite databases running on all physical machines included in the system, if the following dqlite database is converted into a candidate dqlite database, then after the conversion, the candidate dqlite database does not directly send a voting request to other dqlite databases, but first obtains its own priority according to the number of log entries submitted by itself in the most recent target time period and the latest degree of index, and the priority is consistent with the number of log entries submitted by itself in the most recent target time period and the latest degree of index. The latest degree is positively correlated, that is, the more log entries a candidate dqlite database has submitted in the most recent target time period and the newer the index is, the higher the priority of the candidate dqlite database is; since the present invention gives priority to the candidate dqlite database with the highest priority in the voting link, the new leading dqlite database finally determined by the present invention has a large number of log entries submitted in the most recent target time period and a newer index, and the subsequent log synchronization based on the new leading dqlite database can reduce the number of logs that need to be retransmitted, thereby reducing the log synchronization time and achieving the purpose of reducing the system response time. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0014] Figure 1 A flowchart of the steps of a process for synchronizing specified information between dqlite databases running on all physical machines included in a cloud platform data storage and processing system provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0015] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0016] According to this embodiment, a data storage and processing system for a cloud platform is provided, the system includes several physical machines of the cloud platform, each physical machine runs a dqlite database and a virtual machine management center, any virtual machine management center is used to manage all virtual machines running on the physical machine running the virtual machine management center, any dqlite database stores specified information of all virtual machines running on all physical machines included in the system, the specified information of any virtual machine includes startup parameters, startup status, configuration parameters of the virtual machine and identity information of the physical machine on which the virtual machine runs.

[0017] In this embodiment, the number of physical machines of the cloud platform included in the system is greater than or equal to 2, each physical machine runs multiple virtual machines, and the number of virtual machines running on different physical machines may be the same or different.

[0018] Those skilled in the art know that any virtualization management center in the prior art falls within the protection scope of the present invention; as a preferred specific implementation, the virtual machine management center uses libvirt as the underlying virtualization management library.

[0019] In this embodiment, any dqlite database stores specified information of all virtual machines running on all physical machines included in the system. Therefore, when an abnormality occurs on a physical machine, the virtual machine running on the abnormal physical machine can be recovered based on the specified information about the virtual machine running on the physical machine to which the virtual machine running on the abnormal physical machine is migrated, stored in the dqlite database running on the physical machine to which the virtual machine running on the abnormal physical machine is migrated.

[0020] like Figure 1 As shown, the process of synchronizing the specified information between the dqlite databases running on all physical machines included in the system includes the following steps:

[0021] S100, if a follower dqlite database does not receive a heartbeat message sent by a leading dqlite database within a first preset time period, the follower dqlite database is transformed into a candidate dqlite database, and the priority of the candidate dqlite database is obtained according to the number of log entries submitted by the candidate dqlite database in the most recent target time period and the latest degree of the index; the priority of the candidate dqlite database is positively correlated with the number of log entries submitted by the candidate dqlite database in the most recent target time period and the latest degree of the index.

[0022] In this embodiment, the improved Raft consensus algorithm is used to implement the synchronization process of specified information among all dqlite databases running on physical machines included in the system. Herein, each dqlite database is regarded as a node, and the types of dqlite databases are divided into a leader dqlite database (i.e., leader), a follower dqlite database (i.e., follower), and a candidate dqlite database (i.e., candidate).

[0023] In this embodiment, the duration of the first preset time period is an empirical value. If the follower dqlite database does not receive the heartbeat message sent by the leader dqlite database within the first preset time period, then this follower dqlite database is transformed into a candidate dqlite database; if the follower dqlite database receives the heartbeat message sent by the leader dqlite database within the first preset time period, then the timing is restarted, and it continues to be judged whether the heartbeat message sent by the leader dqlite database is received within the first preset time period.

[0024] In this embodiment, the duration of the target time period is an empirical value; optionally, the duration of the target time period is 5 minutes.

[0025] As a preferred specific implementation manner, the priority of the candidate dqlite database satisfies the following conditions: y = w1×q’ + w2×t’, where y is the priority of a certain candidate dqlite database, w1 is the weight of the preset number of log entries, w2 is the weight of the latest degree of the index of the preset log entries, 0 < w1 < 1, 0 < w2 < 1, w1 + w2 = 1, q’ is the result after normalizing q, q is the number of log entries that have been committed by this candidate dqlite database within the most recent target time period, t’ is the result after normalizing t, t is the latest degree of the index of the log entries that have been committed by this candidate dqlite database within the most recent target time period, t = ∑ q i=1 d i / q, d i is the time interval between the submission time of the i-th log entry submitted by this candidate dqlite database within the most recent target time period and the start time of the most recent target time period, and the value range of i is from 1 to q. Among them, the larger the value of t, the greater the latest degree of the index of the committed log entries, that is, the newer the committed log entries.

[0026] In this embodiment, w1 and w2 are empirical values. Optionally, w1 = w2 = 0.5, or w1 = 0.4, w2 = 0.6, or w1 = 0.6, w2 = 0.4.

[0027] S200, the candidate dqlite database sends a voting request to other dqlite databases; the voting request includes the priority of the candidate dqlite database.

[0028] As a specific implementation method, the voting request not only includes the priority of the candidate dqlite database, but also includes the current term number, the identity information of the candidate dqlite database, the index of the last log entry and the term number of the last log entry. Thus, the dqlite database receiving the voting request can determine whether the dqlite database sending the voting request has the identity to be voted.

[0029] Those skilled in the art know that the meanings of the current term number and the term number of the log entry are prior art and will not be repeated here.

[0030] S300, if a dqlite database receives a voting request sent by another dqlite database and the dqlite database has not voted for the other dqlite database, then determine whether the dqlite database corresponding to each voting request received has the identity to be voted, if there are more than or equal to 1 voting requests corresponding to the dqlite databases that have the identity to be voted, then cast the vote for the dqlite database that has the identity to be voted and has the highest priority.

[0031] In this embodiment, determining whether the dqlite database corresponding to each received voting request has the identity of being voted includes: determining whether the current term number in the voting request corresponding to the second dqlite database is less than the current term number of the first dqlite database, if so, determining that the second dqlite database does not have the identity of being voted; if greater than or equal to, determining whether the index of the last log entry in the voting request corresponding to the second dqlite database is at least as new as the last log entry of the first dqlite database, if so, determining that the second dqlite database has the identity of being voted; otherwise, determining that the second dqlite database does not have the identity of being voted; the second dqlite database is the dqlite database corresponding to any received voting request, and the first dqlite database is the dqlite database that receives the voting request.

[0032] Those skilled in the art know that the process of determining whether the index of a log entry is relatively new is a prior art. For example, when the index of a log entry increases with the addition of new logs, a larger index of a log entry indicates a newer index of the log entry.

[0033] In this embodiment, the voting for the dqlite database with the identity of being voted and the highest priority includes: if there are more than or equal to two voting requests corresponding to the dqlite databases with the identity of being voted and the highest priority, then the vote is cast for the dqlite database with the identity of being voted, the highest priority and the earliest issuing the voting request; if there are more than or equal to 1 voting request corresponding to the dqlite database with the identity of being voted and the highest priority, then the vote is cast for the dqlite database with the identity of being voted and the highest priority.

[0034] In this embodiment, if there is no dqlite database corresponding to the voting request that has the identity to be voted, no voting will be done.

[0035] S400: If a candidate dqlite database obtains votes from more than half of the dqlite databases, the candidate dqlite database is determined as a new leading dqlite database.

[0036] In this embodiment, after the new leading dqlite database is determined, the new leading dqlite database sends heartbeat information to other dqlite databases, implements log synchronization, and submits new log entries. As a specific implementation method, the process of implementing synchronization of specified information between dqlite databases running on all physical machines included in the system also includes the following steps:

[0037] S500, if the new leading dqlite database receives a request to update the specified information, the new leading dqlite database will append a log entry corresponding to the request to update the specified information in the local log, and send an additional entry request containing the log entry corresponding to the request to update the specified information to all following dqlite databases.

[0038] This embodiment implements the storage of specified information of all virtual machines running on all physical machines included in the system based on dqlite; wherein, in the process of realizing the synchronization of specified information between dqlite databases running on all physical machines included in the system, if the following dqlite database is converted into a candidate dqlite database, then after the conversion, the candidate dqlite database does not directly send a voting request to other dqlite databases, but first obtains its own priority according to the number of log entries submitted by itself in the most recent target time period and the latest degree of index, and the priority is consistent with the number of log entries submitted by itself in the most recent target time period and the latest degree of index. The latest degree is positively correlated, that is, the more log entries a candidate dqlite database has submitted in the most recent target time period and the newer the index is, the higher the priority of the candidate dqlite database is; since this embodiment gives priority to the candidate dqlite database with the highest priority in the voting phase, the new leading dqlite database finally determined by this embodiment has a large number of log entries submitted in the most recent target time period and a newer index, and the subsequent log synchronization based on the new leading dqlite database can reduce the number of logs that need to be retransmitted, thereby reducing the log synchronization time and achieving the purpose of reducing the system response time.

[0039] As a specific implementation, the system further includes an abnormality monitoring module, which is used to detect the state of each physical machine included in the system, and when an abnormality occurs in the state of a physical machine, migrate all virtual machines running on the physical machine to a designated physical machine; the designated physical machine is a physical machine other than the abnormal physical machine included in the system. Based on the abnormality monitoring module, this embodiment can realize the migration of virtual machines running on the abnormal physical machine when an abnormality occurs in a physical machine, so that the virtual machines running on the abnormal physical machine can be started normally.

[0040] In this embodiment, the abnormal state of the physical machine includes a physical machine downtime or disconnection.

[0041] As a preferred specific implementation, the process of determining the designated physical machine includes:

[0042] S010, obtaining the number of CPU cores occupied by each virtual machine running on the abnormal physical machine.

[0043] In this embodiment, the number of CPU cores occupied by each virtual machine running on the abnormal physical machine can be known.

[0044] S020, obtaining the memory usage of each virtual machine running on the abnormal physical machine.

[0045] In this embodiment, the memory usage of each virtual machine running on the abnormal physical machine can be known.

[0046] S030, obtaining the number of CPU cores and memory usage of each physical machine included in the system except for the physical machine where the abnormality occurs.

[0047] In this embodiment, the number of CPU cores and memory usage of each physical machine except the abnormal physical machine included in the system can be known.

[0048] S040, obtaining a set of virtual machine migration strategies that meet a first preset condition based on the number of CPU cores occupied by each virtual machine running on the physical machine where the abnormality occurs, the memory usage of each virtual machine running on the physical machine where the abnormality occurs, and the number of CPU cores occupied and the memory usage of each physical machine included in the system except the physical machine where the abnormality occurs; the first preset condition includes: after the migration is completed, the CPU usage of each physical machine to which the virtual machine is migrated is less than or equal to a preset CPU usage threshold, and after the migration is completed, the memory usage of each physical machine to which the virtual machine is migrated is less than or equal to a preset memory usage threshold.

[0049] In this embodiment, any virtual machine migration strategy includes a correspondence between each virtual machine running on the abnormal physical machine and the physical machine to which it is migrated.

[0050] As an optional specific implementation, an exhaustive method is used to obtain a set of virtual machine migration policies that meet the first preset condition.

[0051] In this embodiment, the preset CPU usage threshold and the preset memory usage threshold are both empirical values.

[0052] In this embodiment, if a virtual machine is migrated to a physical machine, the CPU usage of the physical machine is the ratio of the sum of the number of CPU cores occupied by the virtual machine and the number of CPU cores occupied by the physical machine to the total number of CPU cores of the physical machine, and the memory usage of the physical machine is the ratio of the sum of the memory usage of the virtual machine and the memory usage of the physical machine to the total memory capacity of the physical machine.

[0053] S050, filtering virtual machine migration policies in a set of virtual machine migration policies that meet a first preset condition according to affinity constraints and anti-affinity constraints of virtual machines running on the abnormal physical machine, to obtain a filtered set of virtual machine migration policies.

[0054] In this embodiment, any virtual machine migration strategy in the set of screened virtual machine migration strategies satisfies the affinity constraints and anti-affinity constraints of the virtual machines running on the abnormal physical machine, that is, there will be no situation where a virtual machine with anti-affinity constraints is migrated to the same physical machine, and there will be no situation where a virtual machine with affinity constraints is migrated to different physical machines.

[0055] S060, obtaining the priority of each virtual machine migration strategy in the set of filtered virtual machine migration strategies; wherein the priority of the j-th virtual machine migration strategy in the set of filtered virtual machine migration strategies is x. j , x j =β1×a' j +β2×b' j +β3×c' j , β1 is the preset weight of CPU usage, β2 is the preset weight of memory usage, β3 is the preset weight of network status, 0<β1<1, 0<β2<1, 0<β3<1, β1+β2+β3=1, a' j For a j The result after normalization, a j is the variance of the CPU usage of the physical machine after the migration is completed corresponding to the jth virtual machine migration strategy in the set of filtered virtual machine migration strategies, b' j For b j The normalized result, b j is the variance of the memory usage of the physical machine after the migration is completed corresponding to the jth virtual machine migration strategy in the set of filtered virtual machine migration strategies, c' j For c j The normalized result, c j is the migration speed corresponding to the jth virtual machine migration strategy in the set of filtered virtual machine migration strategies, c j =∑ m(j) k=1 z j,k / m(j),z j,k is the number of log entries submitted by the dqlite database running on the kth physical machine to which the virtual machine is migrated in the jth virtual machine migration strategy in the set of filtered virtual machine migration strategies during the historical target time period. The value range of k is 1 to m(j), and m(j) is the number of physical machines to which the virtual machine is migrated in the jth virtual machine migration strategy in the set of filtered virtual machine migration strategies.

[0056] In this embodiment, β1, β2 and β3 are empirical values, and optionally, β1=β2=β3=1 / 3.

[0057] In this embodiment, the length of the historical target time period is an empirical value. If the number of log entries submitted by a dqlite database within the historical target time period is large, it is determined that the network status of the physical machine on which the dqlite database runs is good.

[0058] S070: Determine the physical machine to which the virtual machine is migrated in the virtual machine migration policy with the highest priority in the set of filtered virtual machine migration policies as the designated physical machine.

[0059] In this embodiment, migrating the virtual machine running on the abnormal physical machine to the designated physical machine determined based on S010-S070 is beneficial to improving the migration speed of the virtual machine and improving the load balancing between the migrated physical machines.

[0060] In this embodiment, the virtual machine migration strategy with the highest priority is used to determine to which physical machines the virtual machines running on the abnormal physical machine will be migrated. After the physical machine (i.e., the designated physical machine) to which the virtual machines running on the abnormal physical machine are migrated is determined, the virtual machines running on the abnormal physical machine can be recovered based on the designated information (including startup parameters, startup status, and configuration parameters) of the virtual machines running on the abnormal physical machine stored in the dqlite database running on the designated physical machine.

[0061] Those skilled in the art know that any migration process in the prior art falls within the protection scope of the present invention.

[0062] Although some specific embodiments of the present invention have been described in detail by way of example, it will be appreciated by those skilled in the art that the above examples are for illustration only and are not intended to limit the scope of the present invention. It will also be appreciated by those skilled in the art that various modifications may be made to the embodiments without departing from the scope and spirit of the present invention. The scope of the present invention is defined by the appended claims.

Claims

1. A data storage and processing system for a cloud platform, characterized in that: The system includes several physical machines of the cloud platform, each of which runs a dqlite database and a virtual machine management center. Any virtual machine management center is used to manage all virtual machines running on the physical machine running the virtual machine management center. Any dqlite database stores the specified information of all virtual machines running on all physical machines included in the system, and the specified information of any virtual machine includes the startup parameters, startup status, configuration parameters of the virtual machine and the identity information of the physical machine on which the virtual machine runs. The process of synchronizing the specified information between the dqlite databases running on all physical machines included in the system includes the following steps: S100, if a follower dqlite database does not receive a heartbeat message sent by a leading dqlite database within a first preset time period, the follower dqlite database is transformed into a candidate dqlite database, and the priority of the candidate dqlite database is obtained according to the number of log entries submitted by the candidate dqlite database in the most recent target time period and the latest degree of the index; the priority of the candidate dqlite database is positively correlated with the number of log entries submitted by the candidate dqlite database in the most recent target time period and the latest degree of the index; S200, the candidate dqlite database sends a voting request to other dqlite databases; the voting request includes the priority of the candidate dqlite database; S300, if a dqlite database receives a voting request sent by another dqlite database and the dqlite database has not voted for the other dqlite database, then determine whether the dqlite database corresponding to each received voting request has the identity of being voted, if there are more than or equal to 1 voting requests corresponding to the dqlite database with the identity of being voted, then vote for the dqlite database with the identity of being voted and the highest priority; S400: If a candidate dqlite database obtains votes from more than half of the dqlite databases, the candidate dqlite database is determined as a new leading dqlite database.

2. The data storage and processing system of the cloud platform according to claim 1, characterized in that: The priority of a candidate dqlite database satisfies the following conditions: y = w1×q’ + w2×t’, where y is the priority of a certain candidate dqlite database, w1 is the weight of the preset number of log entries, w2 is the weight of the recency of the preset index of log entries, 0 < w1 < 1, 0 < w2 < 1, w1 + w2 = 1, q’ is the result after normalizing q, q is the number of log entries submitted by the candidate dqlite database in the most recent target time period, t’ is the result after normalizing t, t is the recency of the index of log entries submitted by the candidate dqlite database in the most recent target time period, and t = ∑ q i=1 d i / q, where d i is the time interval between the submission time of the i-th log entry submitted by the candidate dqlite database in the most recent target time period and the start time of the most recent target time period, and the value range of i is from 1 to q.

3. The data storage and processing system of the cloud platform according to claim 1, characterized in that: The process of synchronizing the specified information between the dqlite databases running on all physical machines included in the system also includes the following steps: S500, if the new leading dqlite database receives a request to update the specified information, the new leading dqlite database will append a log entry corresponding to the request to update the specified information in the local log, and send an additional entry request containing the log entry corresponding to the request to update the specified information to all following dqlite databases.

4. The data storage and processing system of the cloud platform according to claim 1, characterized in that: The system also includes an abnormality monitoring module, which is used to detect the status of each physical machine included in the system, and when the status of a physical machine is abnormal, migrate all virtual machines running on the physical machine to a designated physical machine; the designated physical machine is the physical machine included in the system except the physical machine with the abnormality.

5. The data storage and processing system of the cloud platform according to claim 4, characterized in that: The process of determining a specific physical machine includes: S010, obtaining the number of CPU cores occupied by each virtual machine running on the abnormal physical machine; S020, obtaining the memory usage of each virtual machine running on the abnormal physical machine; S030, obtaining the number of CPU cores and memory usage of each physical machine in the system except the abnormal physical machine; S040, obtaining a set of virtual machine migration strategies that meet a first preset condition according to the number of CPU cores occupied by each virtual machine running on the abnormal physical machine, the memory usage of each virtual machine running on the abnormal physical machine, and the number of CPU cores and memory usage occupied by each physical machine included in the system except the abnormal physical machine; the first preset condition includes: the CPU usage of each physical machine to which the virtual machine is migrated after the migration is completed is less than or equal to a preset CPU usage threshold, and the memory usage of each physical machine to which the virtual machine is migrated after the migration is completed is less than or equal to a preset memory usage threshold; S050, filtering virtual machine migration policies in a set of virtual machine migration policies that meet a first preset condition according to affinity constraints and anti-affinity constraints of virtual machines running on the abnormal physical machine, to obtain a filtered set of virtual machine migration policies; S060, obtaining the priority of each virtual machine migration strategy in the set of filtered virtual machine migration strategies; wherein the priority of the j-th virtual machine migration strategy in the set of filtered virtual machine migration strategies is x. j , x j =β1×a' j +β2×b' j +β3×c' j , β1 is the preset weight of CPU usage, β2 is the preset weight of memory usage, β3 is the preset weight of network status, 0<β1<1, 0<β2<1, 0<β3<1, β1+β2+β3=1, a' j For a j The result after normalization, a j is the variance of the CPU usage of the physical machine after the migration is completed corresponding to the jth virtual machine migration strategy in the set of filtered virtual machine migration strategies, b' j For b j The normalized result, b j is the variance of the memory usage of the physical machine after the migration is completed corresponding to the jth virtual machine migration strategy in the set of filtered virtual machine migration strategies, c' j For c j The normalized result, c j is the migration speed corresponding to the jth virtual machine migration strategy in the set of filtered virtual machine migration strategies, c j =∑ m(j) k=1 z j,k / m(j),z j,k is the number of log entries submitted by the dqlite database running on the kth physical machine to which the virtual machine is migrated in the jth virtual machine migration strategy in the set of filtered virtual machine migration strategies within the historical target time period, the value range of k is 1 to m(j), and m(j) is the number of physical machines to which the virtual machine is migrated in the jth virtual machine migration strategy in the set of filtered virtual machine migration strategies; S070: Determine the physical machine to which the virtual machine is migrated in the virtual machine migration policy with the highest priority in the set of filtered virtual machine migration policies as the designated physical machine.

6. The data storage and processing system of the cloud platform according to claim 1, characterized in that: The step of casting the vote for the dqlite database having the identity of being voted and the highest priority includes: if there are more than or equal to two dqlite databases corresponding to the voting requests that have the identity of being voted and both have the highest priority, then casting the vote for the dqlite database that has the identity of being voted, has the highest priority and sends the voting request earliest.

7. The data storage and processing system of the cloud platform according to claim 1, characterized in that: The voting request also includes the current term number, the identity information of the candidate dqlite database, the index of the last log entry, and the term number of the last log entry.

8. The data storage and processing system of the cloud platform according to claim 7, characterized in that: Determining whether the dqlite database corresponding to each received voting request has the identity of being voted includes: determining whether the current term number in the voting request corresponding to the second dqlite database is less than the current term number of the first dqlite database, if so, determining that the second dqlite database does not have the identity of being voted; if greater than or equal to, determining whether the index of the last log entry in the voting request corresponding to the second dqlite database is at least as new as the last log entry of the first dqlite database, if so, determining that the second dqlite database has the identity of being voted; otherwise, determining that the second dqlite database does not have the identity of being voted; the second dqlite database is the dqlite database corresponding to any received voting request, and the first dqlite database is the dqlite database that receives the voting request.

Citation Information

Patent Citations

  • Method and device for migrating host application based on Linux container

    CN116302529A

  • Keeping stable leadership in raft-based protocol with fast automatic failover

    US20240134879A1