Disaster recovery method and electronic equipment
By synchronizing the control of business instructions between the main control unit and the backup unit and real-time backup, the problem of long service response time when the main control unit switches to the backup unit is solved, and faster service response and system stability are achieved.
Patent Information
- Application Number
- CN202411864696.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-17
- Publication Date
- 2025-04-25
AI Technical Summary
In the prior art, when the main control unit switches to the backup unit, the service response time is relatively long, and the service response time during the switching needs to be reduced.
By synchronizing the control of business instructions between the main control unit and the backup unit, and backing up the instructions of the main control unit in the backup unit in real time, it is ensured that the backup unit can directly execute the service instructions sent by the client in the main mode without reloading.
The service response time of the main control unit switches to the backup unit is shortened, and the real-time and data consistency of the system are improved.
Smart Images

Figure CN119883749A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of network technology, and in particular to a disaster recovery method and electronic equipment. Background Art
[0002] At present, cold backup solutions are usually adopted for some important facilities, such as data centers, power dispatch centers, traffic management centers, emergency command centers and other key mission areas. In this way, when the main control unit fails, the system will automatically switch to the backup unit to continue running, thus ensuring the continued operation of the business.
[0003] However, when the system switches from the main control unit to the backup unit for continued operation, there is a problem of long business response time. Therefore, how to reduce the business response time when switching from the main control unit to the backup unit has become an urgent problem to be solved. Summary of the invention
[0004] In order to solve the above technical problems, the present disclosure provides a disaster recovery method and an electronic device.
[0005] In a first aspect, the present disclosure provides a disaster recovery method, including: when the main control unit is in the main mode, upon receiving the first control business instruction sent by the client, the main control unit controls the first seat node to execute the first control business instruction, and sends the first control business instruction to the backup unit; wherein the access addresses corresponding to the main control unit and the backup unit are the same; when the backup unit is in the backup mode, the backup unit determines whether the main control unit is in a fault state based on the interaction information with the main control unit; when the backup unit determines that the main control unit is in a fault state, the backup mode is switched to the main mode; when the backup unit is in the main mode, the backup unit receives the second control business instruction sent by the client, and controls the second seat node to execute the second control business instruction.
[0006] In a second aspect, the present disclosure provides a disaster recovery device, including: when the main control unit is in the main mode, upon receiving the first control business instruction sent by the client, the main control unit controls the first seat node to execute the first control business instruction, and sends the first control business instruction to the backup unit; wherein the access addresses corresponding to the main control unit and the backup unit are the same; when the backup unit is in the backup mode, the backup unit determines whether the main control unit is in a fault state based on the interaction information with the main control unit; when the backup unit determines that the main control unit is in a fault state, it switches from the backup mode to the main mode; when the backup unit is in the main mode, it receives the second control business instruction sent by the client, and controls the second seat node to execute the second control business instruction.
[0007] In a third aspect, the present invention provides an electronic device, characterized in that it comprises: a memory and a processor, the memory being used to store a computer program; the processor being used to enable the electronic device to implement any one of the methods provided in the first aspect when executing the computer program.
[0008] In a fourth aspect, the present invention provides a computer-readable storage medium, comprising: a computer program is stored on the computer-readable storage medium, and the computer program is executed by a controller to perform any method provided in the first aspect.
[0009] In a fifth aspect, the present invention provides a computer program product. When the computer program product is run on a computer, the computer is enabled to execute any one of the methods provided in the first aspect.
[0010] These and other aspects of the present disclosure will become more apparent from the following description.
[0011] Compared with the prior art, the technical solution provided by the present invention has the following advantages:
[0012] The disaster recovery method provided by the present disclosure is that when the main control unit is in the main mode, upon receiving the first control business instruction sent by the client, it controls the first seat node to execute the first control business instruction and sends the control business instruction to the backup unit; in this way, when the main control unit executes the first control business instruction, it will back up the first control business instruction to the backup unit in real time. At the same time, when the backup unit is in the backup mode, it determines whether the main control unit is in a fault state based on the interaction information with the main control unit, such as: when the backup unit determines that the main control unit is faulty, it switches from the backup mode to the main mode. Since the backup unit and the main control unit have the same access address, and the backup unit has backed up the first control business instruction, when the main control unit fails, the backup unit can receive the second control business instruction sent by the client to the access address when it is in the main mode, without re-recording the first control business instruction, and the backup unit can directly execute the second control business instruction. Since there is no need to reload the first control business instruction of the main control unit to ensure that the operating environment of the backup unit is consistent with that of the main control unit, the loading time of the backup unit to load the first control business instruction of the main control unit can be shortened, and the business response time when the main control unit switches to the backup unit is reduced, thereby solving the problem of how to reduce the business response time when the main control unit switches to the backup unit. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0014] 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, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0015] Figure 1 A schematic diagram of a disaster recovery method provided by the first embodiment is shown in FIG.
[0016] Figure 2 One of the flow diagrams of a disaster recovery method provided in the first embodiment is exemplarily shown in FIG.
[0017] Figure 3 A schematic diagram of a disaster recovery method provided by the first embodiment is shown in FIG.
[0018] Figure 4 FIG. 2 exemplarily shows a flow chart of a disaster recovery method provided in the first embodiment;
[0019] Figure 5 FIG. 3 exemplarily shows a flow chart of a disaster recovery method provided in the first embodiment;
[0020] Figure 6 FIG4 is a flowchart of a disaster recovery method provided by the first embodiment of the present invention;
[0021] Figure 7 FIG. 5 exemplarily shows a flow chart of a disaster recovery method provided in the first embodiment;
[0022] Figure 8 A schematic diagram of the structure of a disaster recovery device provided in the first embodiment is exemplarily shown in FIG.
[0023] Fig. 9 A structural schematic diagram of an electronic device provided in the second embodiment is exemplarily shown in FIG. DETAILED DESCRIPTION
[0024] In order to more clearly understand the above-mentioned objectives, features and advantages of the present disclosure, the scheme of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features in the embodiments can be combined with each other without conflict.
[0025] In the following description, many specific details are set forth to facilitate a full understanding of the present disclosure, but the present disclosure may also be implemented in other ways different from those described herein; it is obvious that the embodiments in the specification are only part of the embodiments of the present disclosure, rather than all of the embodiments.
[0026] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article 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, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0027] The Keepalived service in the disclosed embodiment is an open source tool for achieving high availability and load balancing, mainly used for Linux servers. It uses VRRP (Virtual Routing Redundancy Protocol) to implement the failover of virtual IP addresses, ensuring that when the main server fails, the backup server can quickly take over and provide services, thereby ensuring service continuity and high availability.
[0028] Figure 1 The schematic diagram of the disaster recovery method is shown in FIG. 1 . The execution subject of this example may be a fiber optic seat host, such as Figure 1 As shown, the fiber optic seat host includes a main control unit 1 and a backup unit 2. Figure 2 The flowchart of the disaster recovery method is shown in FIG. 1 , including:
[0029] S11, when the main control unit is in the active mode, upon receiving the first control service instruction sent by the client, the main control unit controls the first agent node to execute the first control service instruction and sends the control service instruction to the backup unit, wherein the access addresses corresponding to the main control unit and the backup unit are the same.
[0030] In some examples, the fiber optic seat host adopts a dual master control architecture design to achieve redundant backup between two independent master control units and backup units. When the master control unit fails, the backup unit can immediately take over the work to ensure the continuous operation of the disaster recovery system.
[0031] In some examples, the fiber optic seat host uses a real-time backup technology at the dual master control instruction level, that is, when the master control unit executes the first control business instruction, it will back up the first control business instruction to the backup unit in real time. Since the first control business instruction has been backed up in the backup unit, when the master control unit fails, the backup unit does not need to load the first control business instruction in the master control unit, so there is no need to re-record the first control business instruction. In this way, when the client sends the second control business instruction again, the backup unit can directly execute the second control business instruction to ensure the real-time performance and data consistency of the system.
[0032] In some examples, when the main control unit receives the first management and control service instruction sent by the client, the main control unit stores the first management and control service instruction in a memory of the main control unit.
[0033] S12: When the backup unit is in the backup mode, the backup unit determines whether the main control unit is in a fault state according to the interaction information with the main control unit.
[0034] S13: When the backup unit determines that the main control unit is in a fault state, it switches from the backup mode to the main mode.
[0035] S14. When the backup unit is in the active mode, it receives a second management and control service instruction sent by the client, and controls the second agent node to execute the second management and control service instruction.
[0036] In some examples, the main control unit and backup unit in the fiber optic agent host use a real-time heartbeat detection mechanism to determine the main control unit that is actually working (only one main control unit will be in the actual working state of executing business control at the same time). Users use the client to connect to the external virtual IP of the fiber optic agent host to control the disaster recovery system. The main control unit and the agent node are connected through optical fiber, and the backup unit and the agent node are connected through optical fiber. The agent node receives the control business instructions of the main control unit in the actual working state and executes the business control task.
[0037] In some examples, when the backup unit receives the first management and control service instruction sent by the main control unit, the backup unit stores the first management and control service instruction in the memory of the backup unit.
[0038] In the disaster recovery method provided by the embodiment of the present disclosure, the main control unit synchronizes the received first control business instruction to the backup unit when in the main mode. When the backup unit is in the standby mode, it determines whether the main control unit is in a faulty state based on the interaction information with the main control unit. When the backup unit determines that the main control unit is faulty, the backup mode switches to the main mode. Since the first control business instruction of the main control unit is backed up in the backup unit, the backup unit does not need to reload the first control business instruction of the main control unit to ensure that the operating environment of the backup unit is consistent with the operating environment of the main control unit, thereby shortening the loading time of the backup unit to load the first control business instruction of the main control unit, and reducing the business response time when the main control unit switches to the backup unit.
[0039] In some possible implementation examples, combined with Figure 2 ,like Figure 3 As shown, the above S11 can be specifically implemented through the following S110 and S111.
[0040] S110: When the main control unit is in the master mode, based on the first management and control service instruction, determines at least one first agent node that executes the first management and control service instruction.
[0041] In some examples, the memory of the main control unit and the backup unit respectively stores the correspondence between the control business instruction and the theoretical seat node that processes the control business instruction. Afterwards, when the main control unit is not faulty, the main control unit can read the correspondence in the memory, and then query the correspondence based on the first control business instruction, determine the theoretical seat node that executes the first control business instruction, and use the theoretical seat node as the first seat node.
[0042] Exemplarily, the corresponding relationship is shown in Table 1.
[0043] Table 1
[0044] Control business instructions Theoretical seat node Control business instructions 1 Theoretical seat node 1, theoretical seat node 2 Control business instructions 2 Theoretical seat node 2, theoretical seat node 3
[0045] In this way, when the first control business instruction is control business instruction 1, it can be determined that the theoretical seat nodes executing the first control business instruction are theoretical seat node 1 and theoretical seat node 2, that is, at least one first seat node executing the first control business instruction includes theoretical seat node 1 and theoretical seat node 2. Alternatively, when the main control unit fails, the backup unit determines the second seat node executing the second control business instruction by reading the corresponding relationship in the memory and querying the corresponding relationship based on the second control business instruction. For example, when the second control business instruction is control business instruction 2, it can be determined that the theoretical seat nodes executing the second control business instruction are theoretical seat node 2 and theoretical seat node 3, that is, at least one second seat node executing the second control business instruction includes theoretical seat node 2 and theoretical seat node 3.
[0046] In some examples, the main control unit can determine the node status of each schedule node based on the historical schedule nodes that execute the first management and control business instructions, such as the node status includes node running time, node utilization, node access rate, etc. Afterwards, the main control node determines the processing priority of each schedule node based on the node status, such as: each state in the node status (such as: node running time, node utilization, node access rate, etc.) corresponds to a state weight, and determines that the processing priority of the schedule node is equal to the sum of the products of each state in the schedule node and the state weight. Afterwards, the processing priorities are sorted in order from small to large, so as to extract the top N schedule nodes as the first seat nodes. N is an integer greater than or equal to 1.
[0047] It should be noted that the process of the backup unit determining the second seat node is similar to the process of the main control unit determining the first seat node, which will not be repeated here.
[0048] S111. The main control unit sends execution information including a first control business instruction to each first seat node, and sends the first control business instruction to the backup unit; wherein the execution information is used to instruct the seat node to execute the first control business instruction.
[0049] The disaster recovery method provided by the embodiment of the present disclosure is that when the main control unit is in the main mode, based on the first control business instruction, at least one first seat node that executes the first control business instruction is determined, and the main control unit sends execution information containing the first control business instruction to each first seat node, and sends the first control business instruction to the backup unit. Therefore, the first control business instruction stored in the backup unit is the same as the first control business instruction stored in the main control unit. When the backup unit is in the standby mode, it determines whether the main control unit is in a fault state based on the interactive information with the main control unit. When the backup unit determines that the main control unit is faulty, the backup mode is switched to the main mode. Since the first control business instruction of the main control unit is backed up in the backup unit, the backup unit does not need to reload the first control business instruction of the main control unit to ensure that the operating environment of the backup unit is consistent with the operating environment of the main control unit, thereby shortening the loading time of the backup unit loading the first control business instruction of the main control unit, and reducing the business response time when the main control unit switches to the backup unit.
[0050] In some possible implementation examples, combined with Figure 2 ,like Figure 4 As shown, the above S12 can be specifically implemented through the following S120 and S121.
[0051] S120, when the backup unit is in the backup mode, sends to the main control unit acquisition information for acquiring the active heartbeat of the main control unit;
[0052] S121. The backup unit determines whether the main control unit is in a fault state based on the response information sent by the main control unit.
[0053] In some examples, the backup unit determines that the main control unit has failed when it determines that no acquisition information has been received within a preset time period, or the backup unit periodically sends acquisition information to the main control unit, and the backup unit determines that the main control unit has failed when it determines that no master-backup active heartbeat sent by the main control unit in response to the acquisition information has been received for N consecutive periods.
[0054] In the disaster recovery method provided by the embodiment of the present disclosure, the main control unit synchronizes the received first control business instruction to the backup unit. At the same time, the backup unit sends to the main control unit acquisition information for acquiring the active heartbeat of the main control unit; when the backup unit determines that the main control unit is faulty based on the acquired information, if it receives the second control business instruction sent by the client, it controls the second agent node to execute the second control business instruction. Therefore, when the backup unit determines that the main control unit is faulty, there is no need to reload the first control business instruction of the main control unit to ensure that the operating environment of the backup unit is consistent with that of the main control unit, thereby shortening the loading time of the backup unit to load the first control business instruction of the main control unit, and reducing the business response time when the main control unit switches to the backup unit.
[0055] In some possible implementation examples, combined with Figure 4 ,like Figure 5 As shown, the above S121 can be specifically implemented through the following S1210.
[0056] S1210: The backup unit does not receive a response message for obtaining information within a preset time period, and determines that the main control unit is in a fault state.
[0057] In some examples, the backup unit sends acquisition information for obtaining the active heartbeat of the master and standby to the main control unit in real time, and the main control unit replies to its working status after receiving the acquisition information. If the main control unit fails, the main control unit does not reply to the active heartbeat of the master and standby; at this time, the backup unit does not receive the response information of the acquisition information within the preset time (such as 5ms), and determines that the main control unit fails; the active heartbeat service of the master and standby on the backup unit detects the failure of the main control unit and automatically switches to the actual working state of taking over the disaster recovery system; after that, the client continues to send the second control business instruction to the fiber seat host; after receiving the second control business instruction, the backup unit saves the second control business instruction and sends the second control business instruction to the seat node at the same time; after receiving the second control business instruction sent by the backup unit, the seat node executes the business control task corresponding to the second control business instruction.
[0058] In the disaster recovery method provided by the embodiment of the present disclosure, the main control unit synchronizes the received first control business instruction to the backup unit. At the same time, the backup unit sends to the main control unit acquisition information for acquiring the active heartbeat of the main control unit; if the backup unit does not receive the response information of the acquisition information within the preset time length, it determines that the main control unit is faulty; if the backup unit receives the second control business instruction sent by the client, it controls the second seat node to execute the second control business instruction. Therefore, when the backup unit determines that the main control unit is faulty, there is no need to reload the first control business instruction of the main control unit to ensure that the operating environment of the backup unit is consistent with that of the main control unit, thereby shortening the loading time of the backup unit to load the first control business instruction of the main control unit, and reducing the business response time when the main control unit switches to the backup unit.
[0059] In some feasible examples, the access address includes an external Internet Protocol address (IP), the main control unit corresponds to a first physical IP, the backup unit corresponds to a second physical IP, and the first physical IP is different from the second physical IP; Figure 2 ,like Figure 6 As shown, the disaster recovery method provided by the embodiment of the present disclosure further includes: S14.
[0060] S14. When the main control unit establishes a communication connection with the client for the first time, it sends configuration information carrying the external network IP, the first physical IP and the second physical IP to the client; wherein the configuration information is used to instruct the client to access the main control unit or the backup unit according to the target address; wherein the target address includes the external network IP, the first physical IP and the second physical IP.
[0061] In some examples, after the fiber optic agent host is started, the main control unit will be initialized, that is, the physical IP of the main control unit is configured as the first physical IP (such as MasterIP), and the master-slave detection heartbeat service is started; at the same time, the backup unit will also be initialized, that is, the physical IP of the backup unit is configured as the second physical IP (such as: SlaveIP), and the master-slave detection heartbeat service is started. After that, the backup unit periodically sends acquisition information for obtaining the master-slave detection heartbeat to the main control unit, and the main control unit replies to its working status after receiving the acquisition information. After that, when the user needs to let the fiber optic agent host perform an operation, he can enter the first control business instruction in the client. After receiving the first control business instruction sent by the client, the main control unit saves the first control business, forwards the first control business to the backup unit in real time, and sends the control business instruction to the agent node at the same time; the backup unit saves the first control business after receiving the control business instruction; the agent node executes the business control task corresponding to the first control business instruction after receiving the first control business instruction sent by the main control unit.
[0062] In some examples, when the main control unit fails and the client sends the first control service instruction to the main control unit, the backup unit has taken over the actual working state of the fiber seat host. At this time, the failover service running on the backup unit will automatically take over the second control service instruction sent by the external network IP, and by mapping the first physical IP to the second physical IP, the backup unit can receive the second control service instruction sent by the client.
[0063] Exemplarily, the switching process of the main control unit and the backup unit includes:
[0064] The backup unit sends the acquisition information used to obtain the active heartbeat of the master and standby to the main control unit in real time; the main control unit fails and does not reply to the active heartbeat of the master and standby to the backup unit; the backup unit does not receive a response to the acquisition information within the preset time, and determines that the main control unit fails, and the backup unit automatically takes over the actual working status of the current fiber optic agent host; the client continues to issue the second control business instruction to the fiber optic agent host using the virtual IP; after receiving the second control business instruction, the backup unit saves the second control business instruction and simultaneously issues the second control business instruction to the agent node; after receiving the second control business instruction sent by the backup unit, the agent node executes the business control task corresponding to the second control business instruction.
[0065] The disaster recovery method provided by the embodiment of the present disclosure sends configuration information carrying an external network IP, a first physical IP, and a second physical IP to the client when establishing a communication connection with the client for the first time, so that the client can connect to the main control unit or the backup unit based on the configuration information. Then, the main control unit synchronizes the received first management and control business instructions to the backup unit. When the main control unit fails, the backup unit does not need to reload the first management and control business instructions of the main control unit to ensure that the operating environment of the backup unit is consistent with the operating environment of the main control unit, thereby shortening the loading time of the backup unit to load the first management and control business instructions of the main control unit, and reducing the business response time when the main control unit switches to the backup unit.
[0066] In some possible implementations, the external Internet Protocol address includes a virtual Internet Protocol address.
[0067] In some possible implementation examples, combined with Figure 2 ,like Figure 7 As shown, the disaster recovery method provided by the embodiment of the present disclosure also includes: S15 and S16.
[0068] S15. When the main control unit starts, it runs the failover service and switches to the active mode.
[0069] S16. When the backup unit starts, the failover service is run and switched to the backup mode.
[0070] In some examples, in order to further improve the high reliability and real-time response capability of the fiber optic seat host, virtual IP technology is used on the basis of the dual-master architecture, and failover services such as Keepalived services are run on the master unit and the backup unit respectively. The master unit is in the master service (MASTER) mode, and the backup unit is in the backup service (BACKUP) mode, but the external user client shows the same external network IP (such as virtual IP). When the master unit fails, the backup unit will automatically take over the virtual IP and continue to provide services. The client does not need to reconnect to the backup unit that actually works in the login system, that is, the master-slave switching process is not perceived by the user client, and the client can continue to control the system in real time to ensure service continuity.
[0071] In the disaster recovery method provided by the embodiment of the present disclosure, when the main control unit and the backup unit are started, a failover service is run. Afterwards, the main control unit synchronizes the received first control business instruction to the backup unit. When the main control unit fails, the backup unit does not need to reload the first control business instruction of the main control unit to ensure that the operating environment of the backup unit is consistent with the operating environment of the main control unit, thereby shortening the loading time of the backup unit to load the first control business instruction of the main control unit, and reducing the business response time when the main control unit switches to the backup unit.
[0072] Embodiment 2
[0073] Figure 8 The structural diagram of the disaster recovery device provided in the second embodiment of the present application is exemplarily shown in FIG. Figure 8 As shown, the vehicle controller includes: a main control unit 81 and a backup unit 82.
[0074] The main control unit 81 is used to control the first seat node to execute the first control business instruction when receiving the first control business instruction sent by the client in the main mode, and send the first control business instruction to the backup unit 82; wherein the access addresses corresponding to the main control unit and the backup unit are the same.
[0075] The backup unit 82 is used to determine whether the main control unit 81 is in a fault state according to the interaction information with the main control unit 81 when in the backup mode;
[0076] The backup unit 82 is used to switch from the backup mode to the main mode when determining that the main control unit 81 is in a fault state;
[0077] The backup unit 82 is used to receive the second management and control service instruction sent by the client in the active mode, and control the second agent node to execute the second management and control service instruction.
[0078] In some feasible examples, the main control unit 81 is specifically used to determine at least one first agent node that executes the first control business instruction based on the first control business instruction when in the main mode; the main control unit 81 is specifically used to send execution information containing the first control business instruction to each first agent node, and send the first control business instruction to the backup unit 82; wherein, the execution information is used to instruct the agent node to execute the first control business instruction.
[0079] In some feasible examples, the backup unit 82 is specifically used to send acquisition information for obtaining the master-slave detection heartbeat of the main control unit 81 to the main control unit 81 in the backup mode; the backup unit 82 is specifically used to determine whether the main control unit 81 is in a fault state based on the response information sent by the main control unit 81.
[0080] In some feasible examples, the backup unit 82 is specifically configured to determine that the main control unit 81 is in a fault state if no response information for obtaining information is received within a preset time period.
[0081] In some feasible examples, the access address includes an external Internet Protocol address IP, the main control unit 81 corresponds to a first physical IP, the backup unit 82 corresponds to a second physical IP, and the first physical IP is different from the second physical IP; the main control unit 81 is also used to send configuration information carrying the external IP, the first physical IP and the second physical IP to the client when establishing a communication connection with the client for the first time; wherein the configuration information is used to instruct the client to access the main control unit 81 or the backup unit 82 according to the target address; wherein the target address includes the external IP, the first physical IP and the second physical IP.
[0082] In some possible implementations, the external Internet Protocol address includes a virtual Internet Protocol address.
[0083] In some feasible examples, when the main control unit 81 starts, the failover service is run and switched to the active mode; when the backup unit 82 starts, the failover service is run and switched to the backup mode.
[0084] Embodiment 3
[0085] The structural diagram of the electronic device provided in the third embodiment of the present application is as follows: Fig. 9 The electronic device shown may include: at least one processor 51 , a memory 52 , a communication interface 53 and a communication bus 54 .
[0086] The following is a detailed introduction to the various components of electronic equipment:
[0087] The processor 51 is the control center of the electronic device, and may be a processor or a general term for multiple processing elements. For example, the processor 51 is a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention, such as one or more DSPs, or one or more field programmable gate arrays (FPGAs).
[0088] In a specific implementation, as an embodiment, the processor 51 may include one or more CPUs, such as CPU0 and CPU1 included in the CPU. Also, as an embodiment, the electronic device may include multiple processors, such as the CPU includes processor 51 and processor 55. Each of these processors may be a single-core processor (Single-CPU) or a multi-core processor (Multi-CPU). The processor here may refer to one or more devices, circuits, and / or processing cores for processing data (such as computer program instructions).
[0089] The memory 52 may be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 52 may exist independently and be connected to the processor 51 via a communication bus 54. The memory 52 may also be integrated with the processor 51.
[0090] In a specific implementation, the memory 52 is used to store the data of the present invention and execute the software program of the present invention. The processor 51 can execute various functions of the air conditioner by running or executing the software program stored in the memory 52 and calling the data stored in the memory 52.
[0091] The communication interface 53 uses any transceiver-like device to communicate with other devices or communication networks, such as Radio Access Network (RAN), Wireless Local Area Networks (WLAN), terminals, the cloud, etc. The communication interface 53 may include an acquisition module to implement the acquisition function.
[0092] The communication bus 54 may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used, but this does not mean that there is only one bus or one type of bus.
[0093] As an example, the functions implemented by the main control unit 81 are the same as those of the communication interface 53, the processor 51 and the memory 52 in the electronic device.
[0094] As an example, the functions implemented by the backup unit 82 are the same as those of the communication interface 53, the processor 51 and the memory 52 in the electronic device.
[0095] Embodiment 4
[0096] An embodiment of the present application further provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the method in any embodiment.
[0097] Embodiment 5
[0098] The embodiments of the present application also provide a computer program product. When the computer program product runs on a computer, the computer execution instructions are executed by a processor to implement the method in any embodiment.
[0099] The above description is only a specific embodiment of the present disclosure, so that those skilled in the art can understand or implement the present disclosure. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure will not be limited to the embodiments described herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A disaster recovery method, characterized in that: include: When the main control unit is in the master mode, upon receiving the first control service instruction sent by the client, the main control unit controls the first agent node to execute the first control service instruction, and sends the first control service instruction to the backup unit; wherein the access addresses corresponding to the main control unit and the backup unit are the same; When the backup unit is in the backup mode, the backup unit determines whether the main control unit is in a fault state according to the interaction information with the main control unit; When the backup unit determines that the main control unit is in a fault state, the backup mode is switched to the main mode; When in the active mode, the backup unit receives a second management and control service instruction sent by the client, and controls the second agent node to execute the second management and control service instruction.
2. The disaster recovery method according to claim 1, characterized in that: When the main control unit is in the active mode, upon receiving the first control service instruction sent by the client, controlling the first agent node to execute the first control service instruction and sending the first control service instruction to the backup unit, including: When the main control unit is in the master mode, based on the first control service instruction, determines at least one first agent node that executes the first control service instruction; The main control unit sends execution information including the first control business instruction to each of the first seat nodes, and sends the first control business instruction to the backup unit; wherein the execution information is used to instruct the seat node to execute the first control business instruction.
3. The disaster recovery method according to claim 1, characterized in that: When the backup unit is in the backup mode, determining whether the main control unit is in a fault state according to the interaction information with the main control unit includes: When the backup unit is in the backup mode, the backup unit sends to the main control unit acquisition information for acquiring the active heartbeat of the main control unit; The backup unit determines whether the main control unit is in a fault state based on the response information sent by the main control unit.
4. The disaster recovery method according to claim 3, characterized in that: The backup unit determines, based on the response information sent by the main control unit, whether the main control unit is in a fault state, including: The backup unit does not receive the response information of the acquisition information within a preset time period, and determines that the main control unit is in a fault state.
5. The disaster recovery method according to any one of claims 1 to 4, characterized in that: The access address includes an external Internet Protocol address IP, the main control unit corresponds to a first physical IP, the backup unit corresponds to a second physical IP, and the first physical IP is different from the second physical IP; When the main control unit is in the active mode, upon receiving the first control service instruction sent by the client, the main control unit controls the first agent node to execute the first control service instruction, and before sending the first control service instruction to the backup unit, the method further includes: When the main control unit establishes a communication connection with the client for the first time, the main control unit sends configuration information carrying the external network IP, the first physical IP and the second physical IP to the client; wherein the configuration information is used to instruct the client to access the main control unit or the backup unit according to the target address; wherein the target address includes the external network IP, the first physical IP and the second physical IP.
6. The disaster recovery method according to claim 5, characterized in that: The external network Internet Protocol address includes a virtual Internet Protocol address.
7. The disaster recovery method according to claim 1, characterized in that: When the main control unit is in the active mode, upon receiving the first control service instruction sent by the client, the main control unit controls the first agent node to execute the first control service instruction, and before sending the first control service instruction to the backup unit, the method further includes: When the main control unit starts, it runs the failover service and switches to the active mode; When the backup unit starts, the failover service is run and switched to the backup mode.
8. A disaster recovery device, characterized in that: include: When the main control unit is in the master mode, upon receiving the first control service instruction sent by the client, the main control unit controls the first agent node to execute the first control service instruction, and sends the first control service instruction to the backup unit; wherein the access addresses corresponding to the main control unit and the backup unit are the same; When the backup unit is in the backup mode, the backup unit determines whether the main control unit is in a fault state according to the interaction information with the main control unit; When the backup unit determines that the main control unit is in a fault state, the backup mode is switched to the main mode; When in the active mode, the backup unit receives a second management and control service instruction sent by the client, and controls the second agent node to execute the second management and control service instruction.
9. An electronic device, characterized in that: include: A memory and a processor, wherein the memory is used to store a computer program; and the processor is used to enable the electronic device to implement the method described in any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a computing device, the computing device implements the method according to any one of claims 1 to 7.