A distributed control method and device for aerospace measurement and control software
By calling services in aerospace measurement and control software to achieve cluster processing, the problems of single-process performance bottlenecks and security and stability requirements are solved, and high availability and high reliability cluster processing capabilities are achieved.
Patent Information
- Application Number
- CN202011617511.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-30
- Publication Date
- 2025-04-01
- Estimated Expiration
- 2040-12-30
AI Technical Summary
When existing aerospace measurement and control software processes large amounts of data, the performance bottleneck of single-process software is prominent, and due to the high safety and stability requirements, it is difficult to expand cluster processing capabilities in a simple way.
The clustering of the software is achieved by calling services, responding to task requests from the aerospace measurement and control software, allocating master-slave roles to multiple software, and assigning tasks according to the role allocation results, realizing the maintenance and dynamic adjustment of the software's master-slave queue relationship.
It realizes the high availability and high reliability of the software, avoids the bottleneck of single-process performance, and meets the high requirements for safety and stability of aerospace measurement and control software.
Smart Images

Figure CN112631756B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of aerospace measurement and control technology, and in particular to a distributed control method and device applied to aerospace measurement and control software. Background Art
[0002] In the existing technology, the data processing volume of major measurement and control tasks represented by space stations has increased sharply, and the bottleneck problem of single-process software processing performance has become prominent, and there is an urgent need to expand distributed processing capabilities. However, since aerospace measurement and control software such as telemetry and remote control, transceiver, and orbit calculation are all Class A software, they have extremely high security and stability requirements. In terms of data processing capability expansion, it is hoped that the basic design and basic algorithms of the original software will not be changed. Therefore, there is an urgent need for a distributed software coordination service that can expand cluster processing capabilities through simple function calls, and the service must have the characteristics of high availability and high reliability. Summary of the invention
[0003] In response to the problems in the prior art, the distributed control method and device applied to aerospace measurement and control software provided by the present invention realize the clustering of software by calling services, realize the maintenance and dynamic adjustment of the master-slave queue relationship of the software, and can adjust the master-slave status of the software according to the corresponding order of plan or business software startup and the online situation.
[0004] In a first aspect, the present invention provides a distributed control method applied to aerospace measurement and control software, comprising:
[0005] Communicate with multiple aerospace measurement and control software;
[0006] In response to the task request of the aerospace measurement and control software, the plurality of aerospace measurement and control software are assigned master and slave roles to generate a first master and slave role assignment result;
[0007] The tasks are allocated to the multiple aerospace measurement and control software according to the first master-slave role allocation result.
[0008] In one embodiment, the distributed control method applied to aerospace measurement and control software also includes: sending a heartbeat message to the multiple aerospace measurement and control software.
[0009] In one embodiment, in response to the task request of the aerospace measurement and control software, performing master-slave role allocation on the plurality of aerospace measurement and control software to generate a first master-slave role allocation result includes:
[0010] According to the task request and the heartbeat information, the multiple aerospace measurement and control software are assigned master and slave roles.
[0011] In one embodiment, the distributed control method for aerospace measurement and control software further includes:
[0012] Detecting the status of the plurality of aerospace measurement and control software according to the heartbeat information;
[0013] When the state changes, a re-election is performed to generate a second master-slave role allocation result.
[0014] In a second aspect, the present invention provides a distributed control device applied to aerospace measurement and control software, comprising:
[0015] Software communication unit, used to communicate with multiple aerospace measurement and control software;
[0016] A role allocation unit, configured to allocate master and slave roles to the plurality of aerospace measurement and control software in response to a task request of the aerospace measurement and control software, so as to generate a first master and slave role allocation result;
[0017] A task allocation unit is used to allocate the task to the multiple aerospace measurement and control software according to the first master-slave role allocation result.
[0018] In one embodiment, the distributed control device applied to aerospace measurement and control software also includes: a heartbeat information sending unit, which is used to send heartbeat messages to the multiple aerospace measurement and control software.
[0019] In one embodiment, the role allocation unit is specifically used to allocate master and slave roles to the multiple aerospace measurement and control software according to the task request and the heartbeat information.
[0020] In one embodiment, the distributed control device applied to aerospace measurement and control software also includes:
[0021] A status monitoring unit, used for detecting the status of the plurality of aerospace measurement and control software according to the heartbeat information;
[0022] The re-election unit is used to perform a re-election to generate a second master-slave role allocation result.
[0023] In a third aspect, the present invention provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of a distributed control method applied to aerospace measurement and control software are implemented.
[0024] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of a distributed control method applied to aerospace measurement and control software.
[0025] From the above description, it can be seen that the distributed control method and device applied to aerospace measurement and control software provided by the embodiment of the present invention first communicates with multiple aerospace measurement and control software; then, in response to the task request of the aerospace measurement and control software, the multiple aerospace measurement and control software are assigned master-slave roles to generate a first master-slave role assignment result; finally, tasks are assigned to multiple aerospace measurement and control software according to the first master-slave role assignment result. The present invention realizes the clustering of software by calling services, realizes the maintenance and dynamic adjustment of the master-slave queue relationship of the software, and adjusts the master-slave status of the software according to the corresponding order of the plan or business software startup and the online situation. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] 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 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.
[0027] Figure 1 The following is a schematic diagram of the distributed control method used in aerospace measurement and control software in an embodiment of the present invention. Figure 1 ;
[0028] Figure 2 The following is a schematic diagram of the distributed control method used in aerospace measurement and control software in an embodiment of the present invention. Figure 2 ;
[0029] Figure 3 is a flow chart of step 200 in an embodiment of the present invention;
[0030] Figure 4 The following is a schematic diagram of the distributed control method used in aerospace measurement and control software in an embodiment of the present invention. Figure 3 ;
[0031] Figure 5 It is a flow chart of a distributed control method applied to aerospace measurement and control software in a specific application example of the present invention;
[0032] Figure 6 A workflow diagram of the software distributed coordination service election function in a specific application example of the present invention;
[0033] Figure 7 This is a flow chart of distributed coordination service functions in a specific application example of the present invention;
[0034] Figure 8 The structure frame of the distributed control device applied to aerospace measurement and control software in the embodiment of the present invention is Figure 1 ;
[0035] Fig. 9 The structure frame of the distributed control device applied to aerospace measurement and control software in the embodiment of the present invention is Figure 2 ;
[0036] Fig.10 The structure frame of the distributed control device applied to aerospace measurement and control software in the embodiment of the present invention is Figure 3 ;
[0037] Fig.11 FIG. 4 is a schematic diagram of the structure of an electronic device in an embodiment of the present invention. DETAILED DESCRIPTION
[0038] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are 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.
[0039] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take 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.) containing computer-usable program code.
[0040] It should be noted that the terms "including" and "having" and any variations thereof in the specification and claims of the present application and the above-mentioned drawings are intended to cover non-exclusive inclusions. For example, a process, method, system, product or apparatus comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or apparatuses.
[0041] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0042] See also Figure 1 The embodiment of the present invention provides a specific implementation of a distributed control method applied to aerospace measurement and control software, and the method specifically includes the following contents:
[0043] Step 100: Communicate with multiple aerospace measurement and control software.
[0044] From the background technology, it can be seen that the aerospace measurement and control software in the prior art are all independent of each other and cannot communicate with each other. With the rapid development of hardware technology, the hardware configuration of each aerospace measurement and control software has been greatly improved. This has led to the waste of hardware resources corresponding to some aerospace measurement and control software in certain periods of time, while the hardware resources corresponding to other software are extremely tight. For this reason, a memory database cluster can be constructed to serve as a communication "bridge" between multiple aerospace measurement and control software. Then, a distributed coordination service server program is built according to the task requirements, and the application software calls the initialization service to establish a connection with the memory database cluster.
[0045] Step 200: In response to a task request from the aerospace measurement and control software, the plurality of aerospace measurement and control software are assigned master-slave roles to generate a first master-slave role assignment result.
[0046] To prevent the control node from becoming a single point of failure, the control node of the distributed stream computing platform adopts a master-slave backup mechanism. The master-slave control node coordination module is mainly used for role determination, heartbeat keep-alive, and role coordination of the master-slave dual control nodes.
[0047] For color switching, see Table 1.
[0048] Table 1 Master-slave control node role determination table
[0049]
[0050] The master and slave control nodes will be located on two different physical machines when the system is installed. They will be configured as "Master" and "SecondaryMaster" respectively during the initial configuration of the system, and the communication TCP listening socket information of the other control node will be configured; the master and slave control nodes will be started in no particular order, and will send a registration message to the other control node when starting, and notify the role of the local machine; the control node A that starts first will receive the registration message sent by the control node B that starts later, and the control node A will make a role decision based on the registration message and the local role (refer to Table 1), and then reply to the control node B after the decision; after the role decision, the master and slave control nodes will execute different initialization processes. The master control node will become the only central node of the system, responsible for metadata management and resource allocation scheduling of the distributed platform, receiving and responding to requests from the management interface, and managing the computing node cluster. The slave control node only maintains a connection with the master control node to detect the status of the master control node; when receiving a request or registration information from the computing node and the management interface, the slave control node replies with a redirection message so that it can correctly connect to the master control node to obtain services; after the initialization process is completed, the slave control node will periodically send a heartbeat message to the master control node; the slave control node will always monitor the heartbeat reply sent by the master control node. When the slave control node does not receive a heartbeat reply for more than the MASTER_HEARTBEAT_TIMEOUT configured by the user, it is determined that the master control node is abnormal, switches to the "master" role, and notifies the daemon process of the physical node where the master control node is located to kill the master control node process and restart it.
[0051] Step 300: Allocate the task to the plurality of aerospace measurement and control software according to the first master-slave role allocation result.
[0052] Specifically, the application software calls the distributed coordination service and allocates node tasks according to the first master-slave role allocation result and software logic. On the other hand, the distributed service multiple nodes work to ensure the high availability and high reliability of the distributed coordination service, and provide real-time and efficient feedback to the business software cluster information.
[0053] From the above description, it can be seen that the distributed control method applied to aerospace measurement and control software provided by the embodiment of the present invention first communicates with multiple aerospace measurement and control software; then, in response to the task request of the aerospace measurement and control software, the multiple aerospace measurement and control software are assigned master-slave roles to generate a first master-slave role assignment result; finally, tasks are assigned to multiple aerospace measurement and control software according to the first master-slave role assignment result. The present invention realizes the clustering of software by calling services, realizes the maintenance and dynamic adjustment of the master-slave queue relationship of the software, and adjusts the master-slave status of the software according to the corresponding order of the plan or business software startup and the online situation.
[0054] In one embodiment, see Figure 2 , the distributed control methods applied to aerospace measurement and control software also include:
[0055] Step 400: Send a heartbeat message to the multiple aerospace measurement and control software.
[0056] It is understandable that the "heartbeat information" in step 400 refers to the periodic transmission of information between the main memory database cluster and each device in the monitoring of industrial equipment to determine the health status of the equipment and whether the other party is "alive". Specifically, the aerospace measurement and control software sends a heartbeat to the memory database cluster, and the memory database cluster responds to the aerospace measurement and control software with a heartbeat, thus forming a complete handshake of the aerospace measurement and control software memory database cluster. This handshake is to let both parties know that the connection between them is not disconnected and the aerospace measurement and control software is online. If the aerospace measurement and control software does not receive a response from the memory database cluster for more than a certain time threshold, or the memory database cluster does not receive the heartbeat of the aerospace measurement and control software, then the aerospace measurement and control software will disconnect the connection with the memory database cluster and re-establish a connection, and the memory database cluster only needs to disconnect this connection.
[0057] In one embodiment, see Figure 3 , step 200 further comprises:
[0058] Step 201: assigning master and slave roles to the plurality of aerospace measurement and control software according to the task request and the heartbeat information.
[0059] Specifically, the main control node Master is started and initialized; then, the slave control node SecondaryMaster is started and initialized; (Note: the first and second steps are in no particular order, the control node that is started later sends registration information to the control node that is started earlier, and establishes a heartbeat keep-alive connection between the control nodes;) Each computing node monitoring process Tracker in the computing node cluster is started and initialized; the computing node monitoring process obtains metadata such as the hardware resource information of the physical computer, registers with the main control node and reports the hardware resource information; then sends task allocation instructions to the main control node Master based on the hardware resource information.
[0060] In one embodiment, see Figure 4 , the distributed control methods applied to aerospace measurement and control software also include:
[0061] Step 500: Detecting the status of the plurality of aerospace measurement and control software according to the heartbeat information;
[0062] Step 600: When the state changes, re-election is performed to generate a second master-slave role allocation result.
[0063] In step 500 and step 600, the master-slave status information is determined based on the heartbeat. If the status changes, a re-election operation is performed to regenerate the master-slave role allocation result. Specifically, during the cluster initialization phase, when a space measurement and control software node Server1 is started, it cannot perform and complete the Leader election alone. When the second space measurement and control software node Server2 is started, the two machines can communicate with each other at this time, and each machine tries to find the Leader, so the election process begins. The election process is as follows:
[0064] (1) Each server issues a vote. Since this is the initial situation, Server1 and Server2 will vote as the Leader space tracking and control software node. Each space tracking and control software node will send voting information to other space tracking and control software nodes. This voting information includes SID and ZXID. SID is the unique identifier of the machine (myid); ZXID is the transaction ID. This ID is 64 bits, divided into high 32 bits and low 32 bits.
[0065] (2) Since this is the first vote, the ZXIDs are the same, so the SID is compared. The larger the SID, the greater the possibility of obtaining the leader.
[0066] (3) After the two aerospace tracking and control software nodes send their own voting information, they decide whether to change their own voting information based on the voting information they received from other aerospace tracking and control software nodes. The SID of the first aerospace tracking and control software node is 1, and the SID of the second aerospace tracking and control software node is 2, so Server2's vote is changed to 2, that is, there are two votes. Since there are three aerospace tracking and control software nodes in total, Server2 already has more than half of the votes at this time, so the leader is determined to be Server2; (half-vote) Even if Server3 is started, since the leader has been determined, there is no need to vote. Server3 only needs to establish a connection with the leader and synchronize the status.
[0067] In particular, the leader suddenly crashes and a new election is held. For example, there are 5 aerospace measurement and control software nodes at this time, and Server3 has been elected as the leader. Suddenly, the leader (Server3) crashes. At this time, the other four aerospace measurement and control software nodes need to re-elect and enter the LOOKING state. During the operation, their ZXIDs may not be the same. Therefore, in the new round of leader election, not only the SID but also the ZXID must be compared. The larger the ZXID, the greater the possibility of being elected as the leader. In the initial election, a conclusion can be drawn that the SID is in the middle, and the possibility of being elected as the leader is the greatest. However, if the leader suddenly crashes during operation and an election is held again, this conclusion is no longer applicable. The elected leader may be Server1, Server2, or Server4 or Server5. It is worth noting that the larger the ZXID is, the greater the possibility of electing a leader. As mentioned earlier, the ZXID is divided into the upper 32 bits and the lower 32 bits. Here, it is marked in red: the party with the smaller lower 32 bits in the ZXID is more likely to be the leader. After each aerospace measurement and control software node issues a vote, it will also receive elections from other machines. Each machine will process the voting information received from other machines according to certain rules and compare it with its own.
[0068] From the above description, it can be seen that the distributed control method applied to aerospace measurement and control software provided by the embodiment of the present invention can simultaneously support various large-scale aerospace mission joint debugging tests or task execution, and has achieved good results in the application process. During the task execution process, for example: telemetry calculation, information transmission and reception statistics, orbit calculation, database, platform monitoring and other software all use this service to expand the cluster processing capabilities. Practice has proved that this service is stable and reliable, and the effect is remarkable.
[0069] To further illustrate this solution, the present invention further provides a specific application example of the distributed control method applied to aerospace measurement and control software, which specifically includes the following contents, see Figure 5 .
[0070] Step S1: Build a distributed coordination service server program according to task requirements.
[0071] Step S2: The application software calls the initialization service and establishes a connection with the memory database cluster.
[0072] Step S3: The application software sends a heartbeat message to the memory database cluster.
[0073] Step S4: The task software automatically generates a heartbeat thread to establish a channel with the distributed coordination service, and the distributed coordination service allocates roles within the cluster according to the algorithm.
[0074] Specifically, see Figure 6 First, perform service initialization and fill in parameters; then, based on the initialization parameters, elect the master and slave machines and start the heartbeat sending thread; judge the master and slave status information based on the heartbeat, and the status changes; judge the master and slave status information based on the heartbeat, and the status does not change; if the status judgment returns information, execute the re-election status judgment return information, and generate the master and slave result according to the original status. Figure 6 The data dictionaries involved are:
[0075] 1: Execute initialization parameters;
[0076] 2: Initialize the parameters for selecting the master and slave machines;
[0077] 3: Start the heartbeat sending thread parameters;
[0078] 4: Determine status information;
[0079] 5: Status judgment information;
[0080] 6: Status judgment returns information;
[0081] 7: Status judgment returns information;
[0082] 8: Generate master-slave results;
[0083] 9: Generate master-slave results;
[0084] 10: Result notification;
[0085] In addition, in step S4, a distributed global lock is designed using the memory database, and the members in the cluster are identified based on the automatic clearing feature of data timeout, and sorted in order of entry, with the first one in first out being the primary one.
[0086] Step S5: The application software calls the distributed coordination service and allocates node tasks according to the software logic.
[0087] Specifically, see Figure 7 , role A in the same cluster group calls the service library parameters; the cluster processes the election information and obtains the master-slave information based on a certain algorithm; it contains a memory database cluster with multiple nodes for redundant backup to record and maintain cluster information, as well as role B in the same cluster group calling the service library parameters. Figure 7 The data dictionaries involved are:
[0088] 1: Role A calls the service library parameters;
[0089] 2: Cluster processing of election information;
[0090] 3: The in-memory database cluster records and maintains cluster information;
[0091] 4: Role B calls the service library parameters;
[0092] From the above description, it can be seen that the distributed control method and device applied to aerospace measurement and control software provided by the embodiment of the present invention first communicates with multiple aerospace measurement and control software; then, in response to the task request of the aerospace measurement and control software, the multiple aerospace measurement and control software are assigned master-slave roles to generate a first master-slave role assignment result; finally, tasks are assigned to multiple aerospace measurement and control software according to the first master-slave role assignment result. The operation of multiple nodes of the distributed service ensures the high availability and high reliability of the distributed coordination service, and provides real-time and efficient feedback to the business software cluster information.
[0093] In summary, the present invention provides a highly available and reliable distributed software coordination service technology, which realizes software clustering by calling services, realizes software master-slave queue relationship maintenance and dynamic adjustment, and adjusts software master-slave status according to the corresponding order of plan or business software startup and online status. The main function of the distributed software coordination service software is to generate and modify distributed software coordination service information, and record and save the information. In addition to the distributed information maintenance function of the above single target, the distributed software coordination service software must also have the ability to maintain distributed information for different targets under the same task, as well as the distributed coordination information maintenance function of multiple targets or task general configuration information. Specifically, the present invention has the following beneficial effects:
[0094] 1. Provides distributed master-slave election rules.
[0095] The service implements the allocation of node roles within the cluster based on the first-come-first-served principle and a comprehensive election algorithm based on the status sent by the software heartbeat.
[0096] 2. Cluster status records based on memory database.
[0097] By building a redundant backup mechanism for multiple service nodes, the distributed information record maintenance of the software cluster is realized. The redundant backup mechanism of multiple service nodes ensures the high availability of the service, and the disconnection of a single or a small number of service nodes will not cause the failure of the distributed coordination service.
[0098] Based on the same inventive concept, the embodiments of the present application also provide a distributed control device applied to aerospace measurement and control software, which can be used to implement the methods described in the above embodiments, such as the following embodiments. Since the principle of solving the problem by the distributed control device applied to aerospace measurement and control software is similar to the distributed control method applied to aerospace measurement and control software, the implementation of the distributed control device applied to aerospace measurement and control software can refer to the implementation of the distributed control method applied to aerospace measurement and control software, and the repeated parts will not be repeated. As used below, the term "unit" or "module" can be a combination of software and / or hardware that implements a predetermined function. Although the system described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceived.
[0099] The embodiment of the present invention provides a specific implementation of a distributed control device applied to aerospace measurement and control software that can implement a distributed control method applied to aerospace measurement and control software, see Figure 8 , the distributed control device used in aerospace measurement and control software specifically includes the following contents:
[0100] A software communication unit 10, used to communicate with multiple aerospace measurement and control software;
[0101] The role allocation unit 20 is used to allocate master and slave roles to the plurality of aerospace measurement and control software in response to a task request of the aerospace measurement and control software, so as to generate a first master and slave role allocation result;
[0102] The task allocation unit 30 is used to allocate the task to the multiple aerospace measurement and control software according to the first master-slave role allocation result.
[0103] In one embodiment, see Fig. 9 The distributed control device applied to aerospace measurement and control software also includes: a heartbeat information sending unit 40, which is used to send a heartbeat message to the multiple aerospace measurement and control software.
[0104] In one embodiment, the role allocation unit 20 is specifically used to allocate master and slave roles to the multiple aerospace measurement and control software according to the task request and the heartbeat information.
[0105] In one embodiment, see Fig.10 , the distributed control devices used in aerospace measurement and control software also include:
[0106] A status monitoring unit 50, configured to detect the status of the plurality of aerospace measurement and control software according to the heartbeat information;
[0107] The re-election unit 60 is used to perform a re-election to generate a second master-slave role allocation result.
[0108] From the above description, it can be seen that the distributed control device applied to aerospace measurement and control software provided by the embodiment of the present invention first communicates with multiple aerospace measurement and control software; then, in response to the task request of the aerospace measurement and control software, the multiple aerospace measurement and control software are assigned master-slave roles to generate a first master-slave role assignment result; finally, tasks are assigned to multiple aerospace measurement and control software according to the first master-slave role assignment result. The present invention realizes the clustering of software by calling services, realizes the maintenance and dynamic adjustment of the master-slave queue relationship of the software, and adjusts the master-slave status of the software according to the corresponding order of the plan or business software startup and the online situation.
[0109] The 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 an electronic device, and the electronic 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.
[0110] In a typical example, the electronic device specifically includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the steps of the above-mentioned distributed control method applied to aerospace measurement and control software are implemented, and the steps include:
[0111] Step 100: Communicate with multiple aerospace measurement and control software;
[0112] Step 200: In response to a task request of the aerospace measurement and control software, assigning master and slave roles to the plurality of aerospace measurement and control software to generate a first master and slave role assignment result;
[0113] Step 300: Allocate the task to the plurality of aerospace measurement and control software according to the first master-slave role allocation result.
[0114] Reference below Fig.11 , which shows a schematic structural diagram of an electronic device 600 suitable for implementing an embodiment of the present application.
[0115] like Fig.11As shown, electronic 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 portion 608 into a random access memory (RAM) 603. In RAM 603, various programs and data required for the operation of system 600 are also stored. CPU 601, ROM 602, and RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to bus 604.
[0116] 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 display (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.
[0117] 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-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the above-mentioned distributed control method applied to aerospace measurement and control software are implemented, and the steps include:
[0118] Step 100: Communicate with multiple aerospace measurement and control software;
[0119] Step 200: In response to a task request of the aerospace measurement and control software, assigning master and slave roles to the plurality of aerospace measurement and control software to generate a first master and slave role assignment result;
[0120] Step 300: Allocate the task to the plurality of aerospace measurement and control software according to the first master-slave role allocation result.
[0121] In such an embodiment, the computer program may be downloaded and installed from a network via the communication section 609 , and / or installed from the removable medium 611 .
[0122] 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 magnetic 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.
[0123] 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.
[0124] 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.
[0125] 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.
[0126] 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.
[0127] 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, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, commodity or device including the element.
[0128] 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.
[0129] 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.
[0130] The above are only embodiments of the present application and are 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 distributed control method applied to aerospace measurement and control software, characterized in that: include: Communicate with multiple aerospace measurement and control software; In response to the task request of the aerospace measurement and control software, the plurality of aerospace measurement and control software are assigned master and slave roles to generate a first master and slave role assignment result; Allocate the task to the plurality of aerospace measurement and control software according to the first master-slave role allocation result; The distributed control method applied to aerospace measurement and control software further includes: sending a heartbeat message to the plurality of aerospace measurement and control software; The step of performing master-slave role allocation on the plurality of aerospace measurement and control software in response to the task request of the aerospace measurement and control software to generate a first master-slave role allocation result includes: According to the task request and the heartbeat information, the multiple aerospace measurement and control software are assigned master and slave roles; The distributed control method applied to aerospace measurement and control software also includes: Detecting the status of the plurality of aerospace measurement and control software according to the heartbeat information; When the state changes, a re-election is performed to generate a second master-slave role allocation result, specifically: The master-slave status information is determined based on the heartbeat. If the status changes, a re-election operation is performed to regenerate the master-slave role allocation result. Specifically, during the cluster initialization phase, when a space measurement and control software node Server1 is started, it cannot perform and complete the Leader election alone. When the second space measurement and control software node Server2 is started, the two machines can communicate with each other at this time. Each machine tries to find the Leader, and then enters the election process. The election process is as follows: (1) Each server issues a vote. Since this is the initial situation, Server1 and Server2 will vote as the Leader aerospace tracking and control software node. Each aerospace tracking and control software node will send voting information to other aerospace tracking and control software nodes. This voting information includes SID and ZXID. SID is the unique identifier of the machine. ZXID is the transaction ID. The ID is 64 bits, divided into high 32 bits and low 32 bits. (2) Since this is the first vote, the ZXIDs are the same, so the SID is compared. The larger the SID, the greater the possibility of obtaining the leader. (3) After the two nodes send their voting information, they decide whether to change their voting information based on the voting information received from other nodes. The SID of the first node is 1, and the SID of the second node is 2, so Server2's vote is changed to 2, that is, there are two votes. Since there are three nodes in total, Server2 already has more than half of the votes, so the leader is Server2. Even if Server3 is started, since the leader has been determined, there is no need to vote. Server3 only needs to establish a connection with the leader and synchronize the status. In a new round of Leader election, SID and ZXID need to be compared. The larger the ZXID, the greater the possibility of being elected as the Leader.
2. A distributed control device applied to aerospace measurement and control software, characterized in that: include: Software communication unit, used to communicate with multiple aerospace measurement and control software; A role allocation unit, configured to allocate master and slave roles to the plurality of aerospace measurement and control software in response to a task request of the aerospace measurement and control software, so as to generate a first master and slave role allocation result; A task allocation unit, configured to allocate the task to the plurality of aerospace measurement and control software according to the first master-slave role allocation result; The distributed control device applied to aerospace measurement and control software further includes: a heartbeat information sending unit, which is used to send a heartbeat message to the plurality of aerospace measurement and control software; The role allocation unit is specifically used to allocate master and slave roles to the multiple aerospace measurement and control software according to the task request and the heartbeat information; The distributed control device applied to aerospace measurement and control software also includes: A status monitoring unit, used for detecting the status of the plurality of aerospace measurement and control software according to the heartbeat information; The re-election unit is used to perform a re-election to generate a second master-slave role allocation result, specifically: The master-slave status information is determined based on the heartbeat. If the status changes, a re-election operation is performed to regenerate the master-slave role allocation result. Specifically, during the cluster initialization phase, when a space measurement and control software node Server1 is started, it cannot perform and complete the Leader election alone. When the second space measurement and control software node Server2 is started, the two machines can communicate with each other at this time. Each machine tries to find the Leader, and then enters the election process. The election process is as follows: (1) Each server issues a vote. Since this is the initial situation, Server1 and Server2 will vote as the Leader aerospace tracking and control software node. Each aerospace tracking and control software node will send voting information to other aerospace tracking and control software nodes. This voting information includes SID and ZXID. SID is the unique identifier of the machine. ZXID is the transaction ID. The ID is 64 bits, divided into high 32 bits and low 32 bits. (2) Since this is the first vote, the ZXIDs are the same, so the SID is compared. The larger the SID, the greater the possibility of obtaining the leader. (3) After the two nodes send their voting information, they decide whether to change their voting information based on the voting information received from other nodes. The SID of the first node is 1, and the SID of the second node is 2, so Server2's vote is changed to 2, that is, there are two votes. Since there are three nodes in total, Server2 already has more than half of the votes, so the leader is Server2. Even if Server3 is started, since the leader has been determined, there is no need to vote. Server3 only needs to establish a connection with the leader and synchronize the status. In a new round of Leader election, SID and ZXID need to be compared. The larger the ZXID, the greater the possibility of being elected as the Leader.
3. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the distributed control method applied to aerospace measurement and control software described in claim 1 are implemented.
4. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by the processor, the steps of the distributed control method applied to aerospace measurement and control software described in claim 1 are implemented.
Citation Information
Patent Citations
Task processing method and device
CN111181765A
Cloud platform resource scheduling management method and system
CN111447097A