Cluster management method and device for aerospace test operation control system
By adopting multi-threaded parallel connection and slave-first competition writing mechanism in the aerospace measurement and operation control system, combined with the passivation cluster management strategy of state retention, the delay and stability of cluster management during Redis cluster restart or failure migration is solved, and higher reliability and stability are achieved.
Patent Information
- Application Number
- CN202411711269.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-27
- Publication Date
- 2025-03-28
- Estimated Expiration
- 2044-11-27
AI Technical Summary
The cluster management solution of the existing aerospace measurement and operation control system will cause delay in the recovery of the cluster agent software when the Redis cluster is restarted or failed, and may cause problems such as multi-main coexistence of business software and frequent changes in cluster status.
A multi-threaded parallel connection method is used to establish communication connections with the database cluster server, implement a slave-first competition writing mechanism, and complete the failure migration of the database cluster through a state-retained passivation cluster management strategy.
It effectively reduces the service recovery delay during Redis cluster restart, improves the system's reliability and ability to deal with abnormalities, avoids the problem of multi-main coexistence of business software, and improves the stability of the system.
Smart Images

Figure CN119728401A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of aerospace measurement and control technology, in particular to the field of artificial intelligence technology, and more particularly to a cluster management method and device for an aerospace measurement, operation and control system. Background Art
[0002] With the continuous development of aerospace technology, the amount of mission data and the volume of measurement, operation and control business have increased dramatically. The distributed clustered architecture has been vigorously developed and widely used in the field of aerospace measurement, operation and control. The importance of high-reliability cluster management systems in the field of aerospace measurement, operation and control has become increasingly prominent. In the existing cluster management solution system of the ground flight control center, the remote dictionary service (Redis) is selected as the technical base. The master-slave information and cluster information of each distributed clustered architecture software are written into the Redis database through the cluster agent software to complete the cluster management of the system. When the Redis cluster works normally, this method can effectively support the state management of each cluster in the ground flight control center of the aerospace measurement, operation and control system. However, when the cluster agent software needs to re-establish a connection with the Redis cluster (such as restarting the Redis cluster or restarting the cluster agent software), the problem of delayed service recovery of the cluster agent software may occur; when the Redis-Server master node fails, which leads to Redis fault migration, it may induce the master-slave switching of the business software, the coexistence of multiple masters, and the frequent changes of the cluster state. Summary of the invention
[0003] One object of the present invention is to provide a cluster management method for an aerospace measurement, operation and control system, which effectively reduces the delay of the cluster management software restoring service when the Redis cluster is restarted, and greatly improves the reliability and ability to cope with abnormalities of the ground flight control center software system. A slave-priority competitive write mechanism is implemented, which effectively avoids the problem of multi-master coexistence of business software due to the failure migration of the Redis server (Redis-Server), and further improves the stability and reliability of the ground measurement, operation and control system software. Another object of the present invention is to provide a cluster management device for an aerospace measurement, operation and control system. Another object of the present invention is to provide a computer-readable medium. Another object of the present invention is to provide a computer device.
[0004] In order to achieve the above objectives, the present invention discloses a cluster management method of an aerospace measurement, operation and control system, comprising:
[0005] In response to a cluster restart event of the aerospace measurement, operation and control system, a communication connection is established with a server of a database cluster of a ground flight control center through a multi-threaded parallel connection mode;
[0006] In response to a failure of a server master node of a database cluster, the master-slave status of the business software is written to the server of the database cluster according to the master-slave status of the business software stored through a set slave-first competitive writing mechanism;
[0007] By setting the passivation cluster management strategy with state retention, according to the cluster management mode, the fault migration of the database cluster is completed according to the master-slave status of the server, the master-slave status of the business software, and the business software cluster status.
[0008] Preferably, establishing a communication connection with a server of a database cluster of a ground flight control center through a multi-threaded parallel connection method includes:
[0009] Send communication connection requests to the sentinels of the database cluster through multi-threaded parallel connection;
[0010] Receive the connection result returned by the sentinel;
[0011] If the connection result includes a successful connection, a communication connection is established between the server of the database cluster corresponding to the sentinel.
[0012] Preferably, by setting a slave-first competitive write mechanism, the master-slave status of the business software is written to the server of the database cluster according to the master-slave status of the business software stored, including:
[0013] After the updated server master node is determined, the business software process information sent by the business software is received, and the business software process information is written into the server of the database cluster;
[0014] Return the slave node identifier to the business software, so that the business software remains in the state of the slave node during the current read and write cycle;
[0015] Through the master-slave status of the business software, the business software with the status of the master node is queried, and the master node identifier is sent to the business software with the status of the master node, so that the business software can resume normal service in the next read-write cycle.
[0016] Preferably, the cluster management mode includes a master-slave mode;
[0017] By setting the passivation cluster management strategy with state retention, according to the cluster management mode, the fault migration of the database cluster is completed according to the master-slave status of the server, the master-slave status of the business software, and the business software cluster status, including:
[0018] Determine whether the server master-slave status is the master node;
[0019] If yes, obtain the master node identifier corresponding to the business software in the server master node;
[0020] Determine whether the process information in the master node identifier is consistent with the process information of the business software;
[0021] If yes, update the timestamp in the master node identifier;
[0022] If not, the step of determining whether the server master-slave state is a master node is repeated according to a preset timing cycle.
[0023] Preferably, the method further comprises:
[0024] If the master-slave state of the server is a slave node, determine whether the master-slave state of the server is a master node according to a preset timing cycle;
[0025] If so, determine whether the status of the business software in the server master node is the master node based on the master-slave status of the business software;
[0026] If so, update the timestamp in the master node identifier corresponding to the business software in the server master node;
[0027] If not, after waiting for a preset waiting time, repeat the step of determining whether the master-slave status of the server is the master node.
[0028] Preferably, the cluster management mode includes a parallel computing mode;
[0029] By setting the passivation cluster management strategy with state retention, according to the cluster management mode, the fault migration of the database cluster is completed according to the master-slave status of the server, the master-slave status of the business software, and the business software cluster status, including:
[0030] Determine whether the server master-slave status is the master node;
[0031] If so, determine whether the current business software node exists in the business software cluster according to the business software cluster status;
[0032] If it exists, write the business software ID and current timestamp to the server;
[0033] If it does not exist, add a new business software node in the business software cluster and write the corresponding business software identifier and current timestamp;
[0034] Get the current timestamp of all business software nodes in the business software cluster;
[0035] Compare the difference between the current timestamp of each business software node and the timestamp of the last access cycle stored, and filter out abnormal business software nodes with a difference of 0;
[0036] Delete the abnormal business software node from the business software cluster.
[0037] The present invention also discloses a cluster management device for an aerospace measurement, operation and control system, comprising:
[0038] A connection establishing unit, used to establish a communication connection with a server of a database cluster of a ground flight control center through a multi-threaded parallel connection mode in response to a cluster restart event of the aerospace measurement, operation and control system;
[0039] A competitive writing unit, used to respond to a failure of a server master node of a database cluster, and write the master-slave status of the business software to the server of the database cluster according to the master-slave status of the stored business software through a set slave-priority competitive writing mechanism;
[0040] The cluster management unit is used to complete the fault migration of the database cluster according to the master-slave state of the server, the master-slave state of the business software and the cluster state of the business software through the set state-retained passivation cluster management strategy, according to the cluster management mode.
[0041] The present invention also discloses a computer-readable medium on which a computer program is stored. When the program is executed by a processor, the method described above is implemented.
[0042] The present invention also discloses a computer device, including a memory and a processor, wherein the memory is used to store information including program instructions, the processor is used to control the execution of program instructions, and the processor implements the above method when executing the program.
[0043] The present invention also discloses a computer program product, including a computer program / instruction, and the method described above is implemented when the computer program / instruction is executed by a processor.
[0044] The present invention designs a Redis high-speed parallel connection model, and uses a multi-threaded parallel connection method to establish a reliable connection relationship with the Redis cluster, which effectively reduces the delay of the cluster management software restoring the service when the Redis cluster is restarted, and greatly improves the reliability and ability to deal with abnormalities of the ground flight control center software system. A slave-first competitive write mechanism is implemented, which effectively avoids the problem of multi-master coexistence of business software caused by the failure migration of Redis-Server, and further improves the reliability of the system. The design implements a state-retained passivation cluster management strategy. When the Redis-Server fails to migrate, the cluster proxy software can retain the master-slave state and cluster state of the business software. After the switch is completed, the original state can be rewritten, which effectively solves the problem of frequent switching of the master-slave state of the business software after the Redis-Server failure migration is completed, and at the same time avoids the problem of frequent changes in the cluster state caused by mistakenly judging normal nodes as invalid nodes and deleting them, which greatly improves the stability and reliability of the ground measurement and control system software. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. 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 paying creative work.
[0046] Figure 1 A hierarchical schematic diagram of a cluster management solution system with an abnormality provided by an embodiment of the present invention;
[0047] Figure 2 A schematic diagram showing the time consumption of a cluster proxy software connecting to a Sentinel provided in an embodiment of the present invention;
[0048] Figure 3 A schematic diagram of a Redis-Server failure migration state transition provided by an embodiment of the present invention;
[0049] Figure 4 A schematic diagram of a master-slave mode competitive writing provided by an embodiment of the present invention;
[0050] Figure 5 A schematic diagram of competitive writing in a parallel computing mode provided by an embodiment of the present invention;
[0051] Figure 6 A flow chart of a cluster management method for an aerospace measurement, operation and control system provided by an embodiment of the present invention;
[0052] Figure 7 A flow chart of a cluster management method for a space measurement, operation and control system provided by an embodiment of the present invention;
[0053] Figure 8 A timing diagram of a cluster proxy software multi-threaded parallel connection to Redis-Sentinel provided by an embodiment of the present invention;
[0054] Fig. 9 A schematic diagram of a slave priority mode competitive writing provided by an embodiment of the present invention;
[0055] Fig.10 A schematic diagram of a cluster management process in a master-slave mode provided by an embodiment of the present invention;
[0056] Fig.11 A schematic diagram of a master-slave mode passivation cluster management strategy state transition provided by an embodiment of the present invention;
[0057] Fig.12A schematic diagram of a process flow of cluster management in a parallel computing mode provided by an embodiment of the present invention;
[0058] Fig.13 A schematic diagram of a state transition of a passivation cluster management strategy in a parallel computing mode provided by an embodiment of the present invention;
[0059] Fig.14 A schematic diagram of the structure of a cluster management device for an aerospace measurement, transportation and control system provided by an embodiment of the present invention;
[0060] Fig.15 A schematic diagram of the structure of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0061] 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 ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0062] It should be noted that the cluster management method and device for a space measurement, operation and control system disclosed in the present application can be used in the field of artificial intelligence technology, and can also be used in any field outside the field of artificial intelligence technology. The application field of the cluster management method and device for a space measurement, operation and control system disclosed in the present application is not limited.
[0063] In order to facilitate the understanding of the technical solution provided by this application, the relevant contents of the technical solution of this application are first explained below. With the continuous development of aerospace technology, major aerospace missions represented by manned spaceflight, lunar exploration, and deep space exploration have been carried out one after another, and the amount of mission data and measurement, operation and control business volume have increased dramatically. Distributed clustered architecture has been vigorously developed and widely used in the field of aerospace measurement, operation and control. In the ground flight control center, many key core business software such as data distribution, telemetry processing, display and control support, and orbit calculation all adopt a distributed clustered architecture. Therefore, the importance of high-reliability cluster management systems in the field of aerospace measurement, operation and control has become increasingly prominent.
[0064] Remote Dictionary Server (Redis) is a completely open source, free, high-performance distributed memory database based on key-value pairs. It can run based on memory and support data persistence. Redis can support a variety of data types, and because of its memory-based operation, it can provide high-speed data reading and writing, suitable for high-concurrency application scenarios. The ground flight control center uses Redis as the technical foundation, and writes the master-slave information and cluster information of each distributed cluster architecture software into the Redis database through the cluster proxy software, completing the cluster management of the system. The specific implementation technical solution is described as follows.
[0065] In the first step, the ground flight control center of the Aerospace Measurement, Operation and Control Center adopted a typical application scenario of Redis cluster, the Sentinel mode, to achieve the reliability of the memory database itself. The configuration method is one master and two slaves of Redis server (Redis-Server), where the master server supports information reading and writing, and the slave server only supports information acquisition. The slave node regularly copies data from the master node to maintain synchronization. Run three Redis sentinels (Redis-Sentinels) for status monitoring. If the Server master node fails, the three Sentinels can determine that the master node is objectively offline through the voting mechanism, and automatically switch one of the slave nodes in the cluster to the master through the election mechanism, and notify other slave nodes in the cluster to modify the relevant configuration through the publish-subscribe mode, thereby ensuring the high availability of the Redis system. This process is called Redis fault migration.
[0066] The second step is to develop cluster proxy software and deploy it with the business software to provide periodic read and write services of master-slave or cluster information for the business software. After the proxy software is started, it will connect to Redis-Sentinel in sequence according to its own configuration information. If the connection fails, it will continue to connect to the next Sentinel until the connection is successful, otherwise it will exit with an error. After successfully connecting to Redis-Sentinel, connect to the master server through the Sentinel to achieve periodic data reading and writing.
[0067] Currently, there are two main modes for the software cluster managed by the ground flight control center using this solution: one is the master-slave mode, in which the memory database stores the master node information in the cluster in the form of Key-Value, where the Key stores the cluster ID and the Value stores the node ID (the format is: process ID + timestamp); the other is the parallel computing mode, in which the memory database stores all valid node information in the cluster in the form of Key-Value, without distinguishing between master and slave, where the Key stores the cluster ID and the Value stores all valid node IDs in the form of a formatted string (the format is: process ID 1 + timestamp 1; process ID 2 + timestamp 2; process ID 3 + timestamp 3).
[0068] The existing cluster management solution system mainly includes three levels, namely business software, cluster proxy software and underlying Redis cluster. Business software reads and writes master-slave information and cluster information to Redis cluster through cluster proxy software. Cluster proxy software and Redis cluster jointly provide cluster management services for business software. Cluster proxy software is a bridge for interaction between business software and Redis cluster. During the long-term task execution process, we found that when the Redis cluster works normally, this method can effectively support the state management of each cluster in the ground flight control center of the aerospace measurement, operation and control system. However, when the cluster proxy software needs to re-establish a connection with the Redis cluster (such as restarting the Redis cluster or restarting the cluster proxy software), there may be a problem of delay in the cluster proxy software restoring service; when the Redis-Server master node fails, which leads to Redis fault migration, it may induce the master-slave switching of business software, the coexistence of multiple masters, and the frequent changes of cluster status. Figure 1 A hierarchical schematic diagram of a cluster management solution system with an abnormality provided by an embodiment of the present invention, such as Figure 1 As shown, the cluster management solution system includes three levels: business software, cluster proxy software and the underlying Redis cluster. The cluster proxy software provides proxy services for the business software. The business software interacts with the Redis cluster through the cluster proxy software. Abnormal situations include Redis connection abnormalities or Redis cluster abnormalities. The cluster proxy software needs to re-establish a connection with the Redis cluster and perform fault migration. In this process, there are the following two technical problems.
[0069] Figure 2 A schematic diagram of the time consumption of a cluster proxy software connecting to Sentinel provided by an embodiment of the present invention is shown as follows: Figure 2As shown in the figure, when the Redis cluster deployment server is restarted, or the cluster proxy software is restarted, the cluster proxy software needs to re-establish a connection relationship with the Redis cluster. At this time, the cluster proxy software selects the connection configuration of the first Sentinel from the initialization configuration file and tries to connect; when the connection fails, the cluster proxy software selects the connection configuration of the next Sentinel in turn according to the configuration file and tries to connect until the connection is successfully established with the master node. During this process, it has been unable to provide cluster information read and write services for the business software. Under the condition that the Redis cluster is deployed on a hardware server with a CPU main frequency of 3.10GHz, 144 cores, and 512GB of memory, and the network is a 10G LAN, it is found through testing that when the cluster proxy software successfully connects to Redis-Sentinel, it takes less than 1 millisecond from the start of connection to the return of success; when the cluster proxy software fails to connect to Redis-Sentinel, it takes about 1.6 seconds from the start of connection to the return of failure. Under the premise of deploying three Redis-Sentinels, in extreme cases, the cluster proxy software attempts to connect to two invalid addresses before connecting to an available Sentinel, and this process takes about 3.2 seconds. As a result, the cluster proxy software service returned to normal after 3.2 seconds. And as the Redis cluster itself expanded, the connection speed decreased linearly. This is unacceptable in the field of aerospace measurement, operation and control, which has large data volumes, high business density and high reliability requirements.
[0070] Figure 3 A schematic diagram of a Redis-Server failure migration state transition provided by an embodiment of the present invention is as follows: Figure 3 As shown in the figure, during the Redis-Server failure migration time, that is, the time from the failure of the master node (T0) to the successful election of the new master node (T0+2000ms), each business software cannot write information to the Redis cluster through the cluster proxy software. At this time, the cluster proxy software can keep the state of the master node before failure and return it to the business software, but the key values written in Redis have been deleted due to the "expiration mechanism (default expiration time 300ms)". When the new master node is successfully elected, since there is no relevant key value information in the Redis database, each business software competes to write to the Redis database through the cluster proxy software, causing a large number of master-slave mode processes to switch between master and slave (multiple masters may appear in a short time), and the parallel computing mode processes obtain the wrong cluster state in a short time. Assume that the failure time of the Redis-Server master node is T0, the expiration time of the key value in Redis is 300ms, it takes 2000 milliseconds for the Server master node to be successfully re-elected, and an information read and write cycle is 50 milliseconds. Under this condition, the conversion relationship between the Server master node state, the key value state in Redis, the cluster proxy software state, and the business software state is as follows Figure 3As shown in the figure, the failure of the cluster proxy software occurs in the first read-write cycle (from T0+2000ms to T0+2050ms) after the new master node is successfully elected, that is, in the master-slave mode, the cluster proxy software state is written in competition in the first read-write cycle, and the business software state is switched from master to slave in the first read-write cycle; in the parallel computing mode, the cluster proxy software state is written successively in the first read-write cycle, and the business software state fails to obtain an incomplete state in the first read-write cycle. The above-mentioned master-slave switching, multi-master coexistence problems, and frequent changes in cluster status not only consume system computing resources unnecessarily, but also pose a great threat to the reliability of the software system of the ground flight control center of the aerospace measurement, operation and control system.
[0071] The following is an analysis of the competitive writing process of the master-slave mode. Figure 4 A schematic diagram of a master-slave mode competitive writing provided by an embodiment of the present invention, such as Figure 4 As shown in the figure, when the master node election succeeds (T1), the state of the Server master node returns to normal. Since the key value of a cluster in Redis has been deleted due to the expiration mechanism, and multiple business software in the same cluster obtain the state of no key value in Redis through the cluster proxy software, at this time, each business software (business software 1, business software 2 and business software 3) writes its own process information to Redis-Server as the master node mark (key value) through its own cluster proxy software (cluster proxy software 1, cluster proxy software 2 and cluster proxy software 3) in turn, and the cluster proxy software returns 1 to the business software (that is, the local machine is the master node). Under this condition, the state of the above business software is set to master, and the key value information in Redis is the key value written by the last business software in this read and write cycle (from T1 to T1+50ms) (this key value may be different from the value before Redis fault migration), which leads to the problem of multi-master anomaly and master-slave switching. In the next read-write cycle (from T1+50ms to T1+100ms), the key value of the cluster in Redis is valid (the key value status is that business software 3 is the master node), and the cluster proxy software resumes normal service.
[0072] The following is an analysis of the competitive writing process of the parallel computing mode. Figure 5 A schematic diagram of a parallel computing mode competitive writing provided by an embodiment of the present invention, such as Figure 5As shown in the figure, during the time from the failure of the Redis-Server master node to the successful election of the new master node, each business software cannot write / read information to the Redis cluster. At this time, the cluster agent software can maintain the cluster group status before the failure of the master node and return it to the business software. When the master node election is successful (T1), the status of the Server master node returns to normal. In the parallel computing mode, each business software (business software 1, business software 2, and business software 3) can write the node application software identifier and the corresponding time stamp to Redis through its own cluster agent software (cluster agent software 1, cluster agent software 2, and cluster agent software 3). At the same time, it can also read the status of the cluster group from Redis. Since the read and write operations of each node are performed separately and there is no time sequence, and Redis is a single-threaded response processing method, the key value status (update time stamp) of node 3 has not been written yet, and node 2 has read the cluster group status (1 new, 2 new, and 3 old). At this time, in the cluster group In the state, the time stamp of node 3 is an unupdated state (3 old), which is the same as the time stamp of node 3 in the cluster group state saved by node 2 in the previous cycle (1 old, 2 old and 3 old). At this time, node 2 will judge that node 3 is not working properly and delete node 3 from the cluster group; similarly, node 3 will also delete itself from the cluster group. In the subsequent process (not shown in the figure), node 3 writes the node application software identifier and the corresponding time stamp to Redis, and other nodes re-add node 3 to the cluster group, and the cluster group returns to normal. In this process, the business software node 3 has been working normally, but the cluster group state has changed abnormally.
[0073] In view of the above technical problems, the present invention designs a Redis high-speed parallel connection model, and uses a multi-threaded parallel connection method to establish a reliable connection relationship with the Redis cluster, which effectively reduces the delay of the cluster management software to restore the service when the Redis cluster is restarted, greatly improving the reliability of the ground flight control center software system and the ability to deal with abnormalities; realizes the slave-first competitive write mechanism, effectively avoids the problem of multi-master coexistence of business software caused by the failure migration of Redis-Server, and further improves the reliability of the system. The design implements a state-retained passivation cluster management strategy. When the Redis-Server fails to migrate, the cluster proxy software can retain the master-slave state and cluster state of the business software. After the switch is completed, the original state can be rewritten, effectively solving the problem of frequent switching of the master-slave state of the business software after the Redis-Server failure migration is completed, and at the same time avoids the problem of frequent changes in the cluster state caused by mistakenly judging normal nodes as invalid nodes and deleting them, which greatly improves the stability and reliability of the ground measurement and control system software.
[0074] The following takes the cluster management device of the aerospace measurement, operation and control system as an example to illustrate the implementation process of the cluster management method of the aerospace measurement, operation and control system provided by the embodiment of the present invention. It can be understood that the execution subject of the cluster management method of the aerospace measurement, operation and control system provided by the embodiment of the present invention includes but is not limited to the cluster management device of the aerospace measurement, operation and control system.
[0075] Figure 6 A flow chart of a cluster management method for a space measurement, operation and control system provided by an embodiment of the present invention is as follows: Figure 6 As shown, the method includes:
[0076] Step 101: In response to a cluster restart event of the aerospace measurement, operation and control system, a communication connection is established with a server of a database cluster of a ground flight control center through a multi-threaded parallel connection mode.
[0077] Step 102, in response to a failure of a server master node of the database cluster, the master-slave status of the business software is written to the server of the database cluster according to the master-slave status of the stored business software through a set slave-priority competitive write mechanism.
[0078] In the embodiment of the present invention, the aerospace measurement, operation and control mission has extremely high requirements on the reliability of the ground software system. When the system fails, the response logic of the software system becomes abnormal. In this case, the user generally hopes to suspend the program function until the fault is repaired. Figure 4 It can be seen that when the Redis-Server master node is abnormal and causes fault migration, it may cause the business software to have multiple masters coexist, which is unacceptable in the aerospace measurement, operation and control system. For example, when a remote control command to control the spacecraft sailboard to rotate 90 degrees is sent to the outside through the display and control cluster, there are two master nodes in this cluster, which will cause the remote control command to be sent twice. In the absence of other fault tolerance mechanisms, the spacecraft sailboard will rotate 90 degrees twice, which will cause a serious failure that is not in line with expectations.
[0079] To avoid the above problems, a slave-first competitive write mechanism is designed and implemented: when the Redis-Server fails and migrates, the key values of the cluster in the memory database are deleted due to the expiration mechanism, and the key values obtained by the cluster proxy software in Redis are invalid. At this time, the business software writes its own process information to Redis as the master node mark through the cluster proxy software in turn, and the cluster proxy software returns 0 to the business software (that is, the local machine is a slave node).
[0080] Step 103: Complete the fault migration of the database cluster by setting the state-retained passivation cluster management strategy, according to the cluster management mode, and based on the master-slave status of the server, the master-slave status of the business software, and the business software cluster status.
[0081] In the embodiment of the present invention, the cluster management mode includes a master-slave mode or a parallel computing mode.
[0082] In the technical solution provided by the embodiment of the present invention, a Redis high-speed parallel connection model is designed, and a reliable connection relationship with the Redis cluster is established by adopting a multi-threaded parallel connection method, which effectively reduces the delay of the cluster management software to restore the service when the Redis cluster is restarted, and greatly improves the reliability and ability to deal with abnormalities of the ground flight control center software system. A slave-first competitive write mechanism is implemented, which effectively avoids the problem of multi-master coexistence of business software caused by the failure migration of Redis-Server, and further improves the reliability of the system. The state-retained passivation cluster management strategy is designed and implemented. When the Redis-Server fails to migrate, the cluster proxy software can retain the master-slave state and cluster state of the business software. After the switch is completed, the original state can be rewritten, which effectively solves the problem of frequent switching of the master-slave state of the business software after the Redis-Server failure migration is completed, and at the same time avoids the problem of frequent changes in the cluster state caused by mistakenly judging normal nodes as invalid nodes and deleting them, which greatly improves the stability and reliability of the ground measurement and control system software.
[0083] Figure 7 A flow chart of another cluster management method of an aerospace measurement, operation and control system provided by an embodiment of the present invention is as follows: Figure 7 As shown, the method includes:
[0084] Step 201: In response to a cluster restart event of the aerospace measurement, operation and control system, a communication connection request is sent to a sentinel (Redis-Sentinel) of a database cluster through a multi-threaded parallel connection method.
[0085] In the embodiment of the present invention, each step is executed by a cluster management device of the aerospace measurement, transportation and control system.
[0086] In the embodiment of the present invention, the cluster restart event includes but is not limited to restarting the Redis cluster or restarting the cluster proxy software.
[0087] In the embodiment of the present invention, the original single-thread processing mode of the cluster proxy software serially connecting to the Sentinel according to the configuration file is modified to a multi-threaded parallel connection. Through multiple connection threads, communication connection requests are sent to multiple Sentinels at the same time to try to establish a communication connection. The number of connection threads is dynamically determined according to the connection configuration of the Sentinel in the configuration file.
[0088] Step 202: Receive the connection result returned by Redis-Sentinel. If the connection result includes a successful connection, execute step 203; if the connection result is a failed connection, the process ends.
[0089] In the embodiment of the present invention, each sentinel returns a connection result, and the connection result includes a connection success or a connection failure; if the connection is successful, it indicates that the cluster proxy software and the Redis-Sentinel communication connection are successful, and step 203 is continued; if each connection is a connection failure, it indicates that the cluster proxy software and each Redis-Sentinel have failed to connect, and the process ends.
[0090] Step 203: Establish a communication connection between the servers of the database cluster corresponding to the sentinel.
[0091] Figure 8 A timing diagram of a cluster proxy software multi-threaded parallel connection to Redis-Sentinel provided by an embodiment of the present invention, such as Figure 8 As shown, the cluster proxy software simultaneously sends communication connection requests to Redis-Sentinel (1), Redis-Sentinel (2) and Redis-Sentinel (3) through multi-threaded parallel connection, and tries to establish a communication connection with each Redis-Sentinel; Redis-Sentinel (3) connects successfully and immediately returns the connection result of successful connection to the cluster proxy software, and then terminates the thread, which takes less than 1 millisecond; Redis-Sentinel (1) and Redis-Sentinel (2) fail to connect, return the connection result of failed connection to the cluster proxy software, and then terminate the corresponding thread, which takes 1.6 seconds. Therefore, the connection time of this solution is less than 1 millisecond, and the connection speed is increased by more than 3000 times. Moreover, as the Redis cluster itself expands, the connection speed of this solution remains unchanged. The multi-threaded parallel connection method effectively reduces the delay of the cluster management software to restore service when the Redis cluster is restarted, greatly improving the reliability and ability to deal with abnormalities of the ground flight control center software system.
[0092] Step 204 , in response to a failure of a server master node of the database cluster, after an updated server master node is determined, the business software's own process information sent by the business software is received, and the business software's own process information is written into the server of the database cluster.
[0093] In the embodiment of the present invention, in the first read-write cycle after the server master node is successfully elected and updated, the cluster proxy software sequentially writes its own process information into the Redis-Server as the master node mark.
[0094] It is worth noting that the read and write cycle can be set according to actual needs, and the embodiment of the present invention does not limit this. As an option, the read and write cycle is 50ms.
[0095] Step 205: Return the slave node identifier to the service software, so that the service software remains in the state of a slave node in the current read-write cycle.
[0096] In the embodiment of the present invention, the slave node identifier is 0, and the master node identifier is 1. Specifically, the cluster agent software returns 0 to the service software, indicating that the service software is a slave node.
[0097] Step 206: query the business software that is in the master node state through the master-slave state of the business software, and send the master node identifier to the business software that is in the master node state, so that the business software can resume normal service in the next read-write cycle.
[0098] In the embodiment of the present invention, the cluster proxy software stores the master-slave status of the business software and the cluster status. In the next read-write cycle, the master node of the business software is queried through the master-slave status of the business software; 1 is returned to the business software, indicating that the business software is the master node, and other business software remains in the slave node state. The key value of the cluster in Redis-Server is valid in the next read-write cycle.
[0099] Fig. 9 A schematic diagram of a slave priority mode competitive write provided by an embodiment of the present invention, such as Fig. 9 As shown, in the first read-write cycle after the moment T1 at which the server master node is successfully elected, that is, from T1 to T1+50ms, the Server master node is normal, the key value status is deleted due to the expiration mechanism, and business software 1, business software 2, and business software 3 fail to obtain the key value. Based on the slave priority competition, they write their own process information as the key value, and respond to the slave node identifier 0 to maintain their own status as the business software slave node. At this time, the business software has no master node and does not provide services; in the next read-write cycle, that is, from T1+50ms to T1+100ms, business software 1, business software 2, and business software 3 obtain the key value of business software 3, then business software 1 and business software 2 respond to the slave node identifier 0 and maintain their own status as the business software slave node; business software 3 responds to the master node identifier 1 and maintains its own status as the business software master node, and the business software returns to normal.
[0100] In the embodiment of the present invention, the slave priority competitive write mechanism is used to effectively avoid the problem of multi-master coexistence of business software caused by the failure migration of Redis-Server, and further improve the reliability of the system.
[0101] Step 207: Complete the fault migration of the database cluster according to the set state-retained passivation cluster management strategy, the cluster management mode, the master-slave state of the server, the master-slave state of the business software, and the business software cluster state.
[0102] In the embodiment of the present invention, a state-retaining passivation cluster management strategy is designed to ensure that when a Redis-Server fails over, the cluster proxy software can retain the master-slave state and cluster state of the business software, and when the switch is completed, the original state can be rewritten back to achieve the purpose of not causing business software state switching when the Redis-Server fails over.
[0103] Fig.10 A schematic diagram of a cluster management process in a master-slave mode provided by an embodiment of the present invention. If the cluster management mode is a master-slave mode, step 207 specifically includes:
[0104] Step 2071, determine whether the master-slave status of Redis-Server is the master node, if so, execute step 2072; if not, execute step 2075.
[0105] In the embodiment of the present invention, the master-slave status of the Redis-Server is obtained. If it is Master, it indicates that the Redis-Server is a master node, and step 2072 is continued; if it is Slave, it indicates that the Redis-Server is a slave node, and step 2075 is continued.
[0106] Furthermore, according to a preset timing cycle, it is determined whether the master-slave state of the server is a master node, so as to realize regular read and write management of the cluster.
[0107] It is worth noting that the timing period can be set according to actual needs, and the embodiment of the present invention does not limit this. As an optional solution, the timing period is 50 milliseconds (ms).
[0108] Step 2072: Obtain the master node identifier corresponding to the business software in the server master node.
[0109] In the embodiment of the present invention, the Value corresponding to the business software Key in the Server node is obtained, that is, the master node identifier.
[0110] Step 2073, determine whether the process information in the master node identifier is consistent with the process information of the business software. If so, execute step 2074; if not, execute step 2071.
[0111] In an embodiment of the present invention, if the process information in the master node identifier is consistent with the process information of the business software, it indicates that there is no abnormality in the node, and step 2074 is continued to be executed; if the process information in the master node identifier is inconsistent with the process information of the business software, it indicates that there is an abnormality in the node, and timing control is performed through the timer, and step 2071 is continued to be executed according to the preset timing period.
[0112] It is worth noting that the timing period can be set according to actual needs, and the embodiment of the present invention does not limit this. As an optional solution, the timing period is 50ms.
[0113] Step 2074: Update the timestamp in the master node identifier, and this step ends.
[0114] Specifically, the timestamp in the master node identifier is updated to the current time.
[0115] Step 2075, stop periodic writing, and determine whether the server master-slave state is a master node according to a preset timing cycle. If so, execute step 2076; if not, execute this step 2075 in a loop.
[0116] In the embodiment of the present invention, if the master-slave state of Redis-Server is Slave, stop periodic writing, perform timing control through a timer, obtain the master-slave state of Redis-Server according to the timing period, and determine whether the master-slave state of Redis-Server is a master node. If so, it indicates that the Redis-Server fault migration is completed, and continue to execute step 2076; if not, it indicates that the Redis-Server fault migration is not completed, and continue to execute step 2075 until the master-slave state of Redis-Server changes from Slave to Master, that is, from a slave node to a master node.
[0117] It is worth noting that the read-write cycle of the periodic write can be set according to the actual read-write cycle applied in the flight control center task, and the embodiment of the present invention does not limit this. As an optional solution, the read-write cycle of the periodic write is 50ms.
[0118] Step 2076: Based on the master-slave status of the business software, determine whether the status of the business software in the server master node is a master node. If so, execute step 2077; if not, execute step 2078.
[0119] In the embodiment of the present invention, based on the master-slave status of the business software, it is determined whether the business software status corresponding to the Redis-Server master node is the master node. If so, the cluster proxy software corresponding to the business software master node resumes periodic writing and continues to execute step 2077; if not, it indicates that there is no write permission, normal periodic access is resumed, and step 2078 is continued.
[0120] Step 2077: Update the timestamp in the master node identifier corresponding to the business software in the server master node.
[0121] Specifically, the timestamp in the master node identifier is updated to the current time.
[0122] Step 2078, wait for a preset waiting time, and execute step 2071.
[0123] In the embodiment of the present invention, the cluster proxy software corresponding to the service software slave node needs to wait for a certain period of time to resume normal periodic access and repeat step 2071.
[0124] It is worth noting that the waiting time can be set according to actual needs, and the embodiment of the present invention does not limit this. As an optional solution, the waiting time is 3 timing cycles, that is, 150ms.
[0125] Fig.11 A schematic diagram of a master-slave mode passivation cluster management strategy state transition provided by an embodiment of the present invention, such as Fig.11 As shown, T0 is the moment when the Server master node fails. Before T0, the Server status, key value status, cluster proxy software status and business software status are all normal; the expiration time of the key value in Redis is 300ms. Before T0+300ms, the key value is in a valid state. After T0+300ms, the key value expires and is deleted, and the key value is in an invalid state; it takes 2000ms for the Server master node to be re-elected successfully. From T0 to T0+2000ms, the cluster proxy software status is in a write failure and hold state, and the business software status is in a hold state; at T0+2000ms, the Server master node is re-elected successfully, the Server status returns to normal, the key value status is that the key value can be written, the cluster proxy software status is writing to the master node, the slave node is waiting, and the business software status is in a hold state; after T0+2150ms, the Server status, key value status, cluster proxy software status and business software status all return to normal.
[0126] In the embodiment of the present invention, the cluster proxy software retains the original business node status when a Redis-Server failure occurs, and delays the writing time of the business software from the node after the failure migration is completed, thereby ensuring the priority writing of the business software master node. Fig.11 and Figure 4 It can be seen that during the whole process from the normal operation of the Redis-Server host to the failure of the host and then to the recovery, the master-slave status of the business software remains stable. Therefore, this design effectively solves the problem of frequent switching of the master-slave status of the business software after the Redis-Server fault migration is completed, greatly improving the stability and reliability of the ground measurement and control system software.
[0127] Fig.12A schematic diagram of a process flow of cluster management in a parallel computing mode provided by an embodiment of the present invention. If the cluster management mode is a parallel computing mode, step 207 specifically includes:
[0128] Step 3071, determine whether the server master-slave status is a master node, if so, execute step 3072; if not, execute step 3078.
[0129] In the embodiment of the present invention, the master-slave status of the Redis-Server is obtained. If it is Master, it indicates that the Redis-Server is a master node, and step 3072 is continued; if it is Slave, it indicates that the Redis-Server is a slave node, and step 3078 is continued.
[0130] Step 3072: According to the state of the business software cluster, determine whether the current business software node exists in the business software cluster. If so, execute step 3073; if not, execute step 3074.
[0131] In an embodiment of the present invention, the current business software node is matched with the business software node in the stored business software cluster state. If the match is successful, it indicates that the current business software node exists in the business software cluster, and step 3073 is continued; if the match fails, it indicates that the current business software node does not exist in the business software cluster, and step 3074 is continued.
[0132] Step 3073, write the business software identifier and the current timestamp into the server, and continue to step 3075.
[0133] In the embodiment of the present invention, if the current business software node exists in the business software cluster, the business software identifier and the current timestamp of the business software are written into the Redis-Server to indicate that the current node status in the cluster group is normal.
[0134] Step 3074: Add a new business software node in the business software cluster, and write the corresponding business software identifier and current timestamp.
[0135] In an embodiment of the present invention, if the current business software node does not exist in the business software cluster, a new business software node will be added to the business software cluster, and the corresponding business software identifier and the current timestamp will be written to the business software node, and the business software cluster state will increase by one node compared to the previous state.
[0136] Step 3075: Obtain the current timestamps of all business software nodes in the business software cluster.
[0137] Specifically, the cluster proxy software reads the current timestamps of all the business software nodes in the business software cluster from the Redis database.
[0138] Step 3076: perform a difference comparison between the current timestamp of each business software node and the timestamp of the last access cycle stored, and filter out abnormal business software nodes with a difference of 0.
[0139] In the embodiment of the present invention, if the difference between the current timestamp of a business software node and the timestamp of the previous access cycle is 0, it indicates that the business software node is a business software node with an abnormal state, and the business software node is determined to be an abnormal business software node; if the difference between the current timestamp of a business software node and the timestamp of the previous access cycle is not 0, it indicates that the business software node is a business software node with a normal state.
[0140] Step 3077: Delete the abnormal business software node from the business software cluster, and this step ends.
[0141] Specifically, the abnormal business software nodes are deleted from the business software cluster of the Redis database, and the number of nodes reduced in the business software cluster compared with before is the number of abnormal business software nodes.
[0142] Step 3078, stop periodic writing, and determine whether the server master-slave status is a master node according to a preset timing cycle. If so, execute step 3079; if not, loop this step 3078.
[0143] In the embodiment of the present invention, if the master-slave state of Redis-Server is Slave, stop periodic writing, and keep the current business software cluster state and return it to the business software; perform timing control through a timer, obtain the master-slave state of Redis-Server according to the timing period, and determine whether the master-slave state of Redis-Server is a master node. If so, it indicates that the Redis-Server fault migration is completed, and continue to execute step 3079; if not, it indicates that the Redis-Server fault migration is not completed, and continue to execute step 3078 until the master-slave state of Redis-Server changes from Slave to Master, that is, from a slave node to a master node.
[0144] It is worth noting that the read-write cycle of the periodic write can be set according to the actual read-write cycle applied in the flight control center task, and the embodiment of the present invention does not limit this. As an optional solution, the read-write cycle of the periodic write is 50ms.
[0145] Step 3079: wait for the preset waiting time and execute step 3071.
[0146] In the embodiment of the present invention, the Redis-Server master node needs to wait for a certain period of time to resume normal periodic reading and writing and continue to execute step 3071.
[0147] It is worth noting that the waiting time can be set according to actual needs, and the embodiment of the present invention does not limit this. As an optional solution, the waiting time is 3 timing cycles, that is, 150ms.
[0148] Fig.13 A schematic diagram of a state transition of a passivation cluster management strategy in a parallel computing mode provided by an embodiment of the present invention, such as Fig.13 As shown in the figure, T0 is the moment when the Server master node fails. Before T0, the Server status, key value status, cluster proxy software status and business software status are all normal; the expiration time of the key value in Redis is 300ms, and before T0+300ms, the key value is in a valid state. After T0+300ms, the key value expires and is deleted, and the key value is in an invalid state; it takes 2000ms for the Server master node to be re-elected successfully. From T0 to T0+2000ms, the cluster proxy software status is in a write failure and hold state, and the business software status is in a hold state; at T0+2000ms, the Server master node is re-elected successfully, the Server status returns to normal, the key value status is that the key value can be written, the cluster proxy software status is in a continuous write and hold state, and the business software status is in a hold state; after T0+2150ms, the Server status, key value status, cluster proxy software status and business software status all return to normal.
[0149] After the Redis-Server fault migration is completed, within one read-write cycle (50ms), each business software can complete a status update through the cluster agent software. Further considering network jitter, each business software can write the identifier and timestamp to Redis within three read-write cycles (150ms), so that the timestamps of each normal node in Redis have been updated. In these three read-write cycles, because of the use of the passivation read strategy, the cluster agent software does not read the cluster status in Redis, but keeps the original status and returns it to each business software until the information of each normal node is stably written to Redis, avoiding the problem of mistakenly judging normal nodes as invalid nodes and deleting them, which causes the cluster status to change frequently. Compare Fig.13 and Figure 5 It can be seen that during the entire process from when the Redis-Server host was working normally to when a fault occurred and the host failed, and then to when it returned to normal, the business software cluster status remained stable.
[0150] It is worth noting that the acquisition, storage, use, and processing of data in the technical solution of this application are in compliance with the relevant provisions of laws and regulations. The user information in the embodiments of this application is obtained through legal and compliant channels, and the acquisition, storage, use, and processing of user information are authorized and agreed by the customer.
[0151] It is worth noting that the information collected in this application is information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of relevant data comply with the relevant laws, regulations and standards of relevant countries and regions, take necessary confidentiality measures, do not violate public order and good customs, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0152] It is worth noting that the technical solution provided in this application provides users with corresponding operation entrances for them to choose to agree or reject the automated decision-making results; if the user chooses to reject, the expert decision-making process will be entered.
[0153] In the technical solution of the cluster management method of the aerospace measurement, operation and control system provided by the embodiment of the present invention, a Redis high-speed parallel connection model is designed, and a reliable connection relationship with the Redis cluster is established by adopting a multi-threaded parallel connection method, which effectively reduces the delay of the cluster management software to restore the service when the Redis cluster is restarted, and greatly improves the reliability and ability to deal with abnormalities of the ground flight control center software system. A slave-first competitive write mechanism is implemented, which effectively avoids the problem of multi-master coexistence of business software caused by the failure migration of Redis-Server, and further improves the reliability of the system. The state-retained passivation cluster management strategy is designed and implemented. When the Redis-Server fails to migrate, the cluster proxy software can retain the master-slave state and cluster state of the business software, and when the switch is completed, the original state can be rewritten back, which effectively solves the problem of frequent switching of the master-slave state of the business software after the Redis-Server failure migration is completed, and at the same time avoids the problem of frequent changes in the cluster state caused by mistakenly judging normal nodes as invalid nodes and deleting them, which greatly improves the stability and reliability of the ground measurement, operation and control system software.
[0154] Fig.14 A schematic diagram of the structure of a cluster management device for a spacecraft measurement, operation and control system provided by an embodiment of the present invention, wherein the device is used to execute the cluster management method for the spacecraft measurement, operation and control system, such as Fig.14 As shown, the device includes: a connection establishing unit 11, a contention writing unit 12 and a cluster management unit 13.
[0155] The connection establishing unit 11 is used to establish a communication connection with a server of a database cluster of a ground flight control center in response to a cluster restart event of the aerospace measurement, operation and control system through a multi-threaded parallel connection mode.
[0156] The competitive writing unit 12 is used to respond to the failure of the server master node of the database cluster, and write the master-slave status of the business software to the server of the database cluster according to the master-slave status of the stored business software through the set slave-priority competitive writing mechanism.
[0157] The cluster management unit 13 is used to complete the fault migration of the database cluster according to the master-slave state of the server, the master-slave state of the business software and the business software cluster state through the set state-retained passivation cluster management strategy, according to the cluster management mode.
[0158] In an embodiment of the present invention, the connection establishment unit 11 is specifically used to send a communication connection request to the sentinel of the database cluster through a multi-threaded parallel connection method; receive the connection result returned by the sentinel; if the connection result includes a successful connection, establish a communication connection between the servers of the database cluster corresponding to the sentinel.
[0159] In an embodiment of the present invention, the competitive write unit 12 is specifically used to receive the business software's own process information sent by the business software after the updated server master node is determined, and write the business software's own process information into the server of the database cluster; return the slave node identifier to the business software, so that the business software remains in the state of a slave node during the current read-write cycle; query the business software whose state is the master node through the master-slave state of the business software, and send the master node identifier to the business software whose state is the master node, so that the business software resumes normal service during the next read-write cycle.
[0160] In an embodiment of the present invention, the cluster management mode includes a master-slave mode; the cluster management unit 13 is specifically used to determine whether the master-slave state of the server is a master node; if so, obtain the master node identifier corresponding to the business software in the server master node; determine whether the process information in the master node identifier is consistent with the process information of the business software; if so, update the timestamp in the master node identifier; if not, repeat the steps of determining whether the master-slave state of the server is a master node according to a preset timing period.
[0161] In an embodiment of the present invention, the cluster management unit 13 is specifically used to determine whether the master-slave state of the server is a master node according to a preset timing period if the master-slave state of the server is a slave node; if so, determine whether the state of the business software in the server master node is a master node based on the master-slave state of the business software; if so, update the timestamp in the master node identifier corresponding to the business software in the server master node; if not, after waiting for a preset waiting time, repeat the step of determining whether the master-slave state of the server is a master node.
[0162] In an embodiment of the present invention, the cluster management mode includes a parallel computing mode; the cluster management unit 13 is specifically used to determine whether the master-slave state of the server is a master node; if so, determine whether there is a current business software node in the business software cluster based on the business software cluster state; if so, write the business software identifier and the current timestamp to the server; if not, add a new business software node to the business software cluster, and write the corresponding business software identifier and the current timestamp; obtain the current timestamp of all business software nodes in the business software cluster; compare the difference between the current timestamp of each business software node and the timestamp of the stored previous access cycle, and filter out abnormal business software nodes with a difference of 0; delete the abnormal business software node from the business software cluster.
[0163] In the scheme of the embodiment of the present invention, a Redis high-speed parallel connection model is designed, and a reliable connection relationship with the Redis cluster is established by adopting a multi-threaded parallel connection method, which effectively reduces the delay of the cluster management software to restore the service when the Redis cluster is restarted, and greatly improves the reliability and ability to deal with abnormalities of the ground flight control center software system. A slave-first competitive write mechanism is implemented, which effectively avoids the problem of multi-master coexistence of business software caused by the failure migration of Redis-Server, and further improves the reliability of the system. The design implements a state-retained passivation cluster management strategy. When the Redis-Server fails to migrate, the cluster agent software can retain the master-slave state and cluster state of the business software. After the switch is completed, the original state can be rewritten, which effectively solves the problem of frequent switching of the master-slave state of the business software after the Redis-Server fails to migrate, and avoids the problem of frequent changes in the cluster state caused by mistakenly judging normal nodes as invalid nodes and deleting them, which greatly improves the stability and reliability of the ground measurement and control system software.
[0164] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer device, and specifically, the computer device may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0165] An embodiment of the present invention provides a computer device, including a memory and a processor, the memory is used to store information including program instructions, the processor is used to control the execution of the program instructions, and the program instructions, when loaded and executed by the processor, implement the steps of the embodiment of the cluster management method of the above-mentioned aerospace measurement, operation and control system. For a specific description, please refer to the embodiment of the cluster management method of the above-mentioned aerospace measurement, operation and control system.
[0166] Reference below Fig.15 , which shows a schematic diagram of the structure of a computer device 600 suitable for implementing an embodiment of the present application.
[0167] like Fig.15 As shown, the computer device 600 includes a central processing unit (CPU) 601, which can perform various appropriate operations and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage part 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the computer device 600 are also stored. The CPU 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0168] The following components are connected to the I / O interface 605: an input section 606 including a keyboard, a mouse, etc.; an output section 607 including a cathode ray tube (CRT), a liquid crystal feedback device (LCD), etc., and a speaker, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN card, a modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as needed, so that a computer program read therefrom is installed as needed as the storage section 608.
[0169] In particular, according to an embodiment of the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present invention includes a computer program product, which includes a computer program tangibly contained on a machine-readable medium, and the computer program includes program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication part 609, and / or installed from the removable medium 611.
[0170] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0171] For the convenience of description, the above device is described in various units according to their functions. Of course, when implementing the present application, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0172] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0173] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0174] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0175] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0176] The acquisition, storage, use, and processing of data in the technical solution of this application comply with the relevant provisions of national laws and regulations.
[0177] It should be noted that in the embodiments of the present application, certain software, components, models and other existing solutions in the industry may be mentioned, and they should be regarded as exemplary. Their purpose is only to illustrate the feasibility of implementing the technical solution of the present application, but it does not mean that the applicant has or will necessarily use the solution.
[0178] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0179] The present application may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.
[0180] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0181] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.
Claims
1. A cluster management method for aerospace measurement, operation and control system, characterized in that: The method comprises: In response to a cluster restart event of the aerospace measurement, operation and control system, a communication connection is established with a server of a database cluster of a ground flight control center through a multi-threaded parallel connection mode; In response to a failure of a server master node of the database cluster, the master-slave status of the business software is written to the server of the database cluster according to the master-slave status of the business software stored by the set slave-priority competitive writing mechanism; By setting the passivation cluster management strategy with state retention, according to the cluster management mode, the fault migration of the database cluster is completed according to the master-slave status of the server, the master-slave status of the business software, and the business software cluster status.
2. The cluster management method of aerospace measurement, operation and control system according to claim 1, characterized in that: The method of establishing a communication connection with a server of a database cluster of a ground flight control center by means of a multi-threaded parallel connection includes: Sending a communication connection request to the sentinel of the database cluster through a multi-threaded parallel connection mode; Receive the connection result returned by the sentinel; If the connection result includes a successful connection, a communication connection is established between the server of the database cluster corresponding to the sentinel.
3. The cluster management method of aerospace measurement, operation and control system according to claim 1, characterized in that: The slave-priority competitive writing mechanism is set to write the master-slave status of the business software to the server of the database cluster according to the master-slave status of the business software stored in the business software, including: After the updated server master node is determined, the business software process information sent by the business software is received, and the business software process information is written into the server of the database cluster; Returning a slave node identifier to the service software, so that the service software remains in the state of a slave node in the current read-write cycle; The business software with the master node status is queried through the master-slave status of the business software, and the master node identifier is sent to the business software with the master node status, so that the business software can resume normal service in the next read-write cycle.
4. The cluster management method of aerospace measurement, operation and control system according to claim 1, characterized in that: The cluster management mode includes a master-slave mode; The passivation cluster management strategy of the set state retention is used to complete the fault migration of the database cluster according to the cluster management mode, the master-slave state of the server, the master-slave state of the business software, and the cluster state of the business software, including: Determine whether the master-slave status of the server is a master node; If yes, obtain the master node identifier corresponding to the business software in the server master node; Determine whether the process information in the master node identifier is consistent with the process information of the business software; If yes, update the timestamp in the master node identifier; If not, the step of determining whether the server is in a master-slave state is a master node is repeated according to a preset timing cycle.
5. The cluster management method of aerospace measurement, operation and control system according to claim 4, characterized in that: The method further comprises: If the master-slave state of the server is a slave node, judging whether the master-slave state of the server is a master node according to a preset timing cycle; If so, judging whether the status of the business software in the server master node is a master node according to the master-slave status of the business software; If so, update the timestamp in the master node identifier corresponding to the business software in the server master node; If not, after waiting for a preset waiting time, repeat the step of determining whether the master-slave status of the server is a master node.
6. The cluster management method of aerospace measurement, operation and control system according to claim 1, characterized in that: The cluster management mode includes a parallel computing mode; The passivation cluster management strategy of the set state retention is used to complete the fault migration of the database cluster according to the cluster management mode, the master-slave state of the server, the master-slave state of the business software, and the cluster state of the business software, including: Determine whether the master-slave status of the server is a master node; If so, judging whether there is a current business software node in the business software cluster according to the business software cluster state; If it exists, write the business software ID and current timestamp to the server; If it does not exist, add a new business software node in the business software cluster and write the corresponding business software identifier and the current timestamp; Obtaining the current timestamps of all business software nodes in the business software cluster; Compare the difference between the current timestamp of each business software node and the timestamp of the last access cycle stored, and filter out abnormal business software nodes with a difference of 0; The abnormal business software node is deleted from the business software cluster.
7. A cluster management device for an aerospace measurement, operation and control system, characterized in that: The device comprises: A connection establishing unit, used to establish a communication connection with a server of a database cluster of a ground flight control center through a multi-threaded parallel connection mode in response to a cluster restart event of the aerospace measurement, operation and control system; A competitive writing unit, configured to respond to a failure of a server master node of the database cluster by setting a slave-first competitive writing mechanism and write the master-slave status of the business software to the server of the database cluster according to the master-slave status of the business software stored in the business software; The cluster management unit is used to complete the fault migration of the database cluster according to the master-slave state of the server, the master-slave state of the business software and the cluster state of the business software through the set state-retained passivation cluster management strategy, according to the cluster management mode.
8. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the cluster management method of the aerospace measurement, operation and control system described in any one of claims 1 to 6 is implemented.
9. A computer device comprising a memory and a processor, wherein the memory is used to store information including program instructions, and the processor is used to control the execution of the program instructions, characterized in that: When the program instructions are loaded and executed by the processor, the cluster management method of the aerospace measurement, operation and control system described in any one of claims 1 to 6 is implemented.
10. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instruction is executed by a processor, the cluster management method of the aerospace measurement, operation and control system according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Node availability management and control method, node, cluster, device and medium
CN113704029A
Method for realizing high availability of Redis cluster and proxy middleware
CN114785713A
Scheduling method and device for Redis cluster
CN114995975A
Cluster deployment method and device, electronic equipment and computer readable medium
CN116302716A
Redis master-slave instance switching method and device, storage medium and computer equipment
CN116473311A
Cited By
Redis cluster switching method and device
CN122372406A
Switching method and device for redis cluster
CN122372406B