Data recovery method, device and readable storage medium

By acquiring and restoring the status of the main control equipment and backup control equipment, and using the network management server to achieve data consistency, the visual network service paralysis problem caused by failure of the main control equipment in the autonomous cloud is solved, ensuring business reliability and stability.

CN111835555BActive Publication Date: 2024-12-24VISIONVERA INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010496522.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-06-03
Publication Date
2024-12-24
Estimated Expiration
2040-06-03

AI Technical Summary

Technical Problem

The failure of the main control device in the autonomous cloud causes the visual networking service to be paralyzed, and the existing technology is difficult to ensure the consistency of core data, affecting business reliability.

Method used

By obtaining the status of the main control device and the backup control device, using the network management server to recover data, ensuring the consistency of the core data on the main control device and the backup control device, and achieving the normal operation of the business after a failure occurs.

Benefits of technology

It ensures the consistency of core data on the main control equipment and the backup control equipment, ensures that the visual network service can continue through the backup control equipment after the main control equipment fails, and improves the reliability and stability of the service.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111835555B_ABST
    Figure CN111835555B_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a data recovery method, device and readable storage medium. The method includes: by obtaining a first state of a main master control device and a second state of a backup master control device, if one of the first state and the second state is an active state and the other state is a backup state, then according to the consistency of the data on the main master control device, the data on the backup master control device, and the data on the network management server, restore the data on at least one of the main master control device and the backup master control device, so that the data on the main master control device is consistent with the data on the backup master control device, so that after a main control device in a normal working mode fails, the visual network service can be continued through another main control device to ensure the normal operation of the visual network service.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of communications, and in particular to a data recovery method, device and readable storage medium. Background Art

[0002] The visual network is an important milestone in the development of the Internet. It is a more advanced form of the Internet. It is a real-time network that can achieve real-time transmission of high-definition video across the entire network, which is currently unavailable on the Internet. It will push many Internet applications towards high-definition video. Users can also use the visual network to achieve communication connections between Internet terminals.

[0003] With the rapid development of visual networking services, the visual networking customer base has also grown rapidly. It is crucial to provide stable, reliable and secure visual networking services. Among them, the main control device in the visual networking is the management core of the autonomous cloud. The functions realized mainly include managing and registering the devices in the autonomous cloud, realizing the visual networking business logic within and between autonomous clouds, and communicating with the management network of the visual networking to achieve higher-level management. If the main control device in some autonomous clouds fails, including software failure and / or supply failure, it will cause the visual networking business to be paralyzed. Summary of the invention

[0004] Embodiments of the present invention provide a data recovery method, device and readable storage medium to solve the problem of visual network service being paralyzed when a master control device in an autonomous cloud fails.

[0005] A first aspect of an embodiment of the present invention provides a data recovery method executed on a network management server, comprising:

[0006] Obtaining a first state of a primary control device and a second state of a secondary control device;

[0007] If one of the first state and the second state is an active state and the other state is a standby state, the data on at least one of the main master control device and the standby master control device is restored based on the consistency of the data on the main master control device, the data on the standby master control device, and the data on the network management server to make the data on the main master control device consistent with the data on the standby master control device.

[0008] A second aspect of an embodiment of the present invention provides a data recovery device, which is arranged in a network management server and includes:

[0009] An acquisition module, used to acquire a first state of a primary control device and a second state of a secondary control device;

[0010] A recovery module is used to restore the data on at least one of the main master control device and the backup master control device based on the consistency of the data on the main master control device, the data on the backup master control device, and the data on the network management server if one of the first state and the second state is the active state and the other state is the standby state, so as to make the data on the main master control device consistent with the data on the backup master control device.

[0011] According to a third aspect of an embodiment of the present invention, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the data recovery method described above are implemented.

[0012] According to a fourth aspect of the present invention, a data recovery device is provided, comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the computer program implements the steps of the above-mentioned data recovery method when executed by the processor.

[0013] Compared with the prior art, the present invention has the following advantages:

[0014] The data recovery method provided by the embodiment of the present invention obtains the first state of the main master control device and the second state of the backup master control device. If one of the first state and the second state is an active state and the other state is a backup state, then according to the consistency of the data on the main master control device, the data on the backup master control device, and the data on the network management server, the data on at least one of the main master control device and the backup master control device is restored to make the data on the main master control device consistent with the data on the backup master control device. To a certain extent, the consistency of the core data on the main master control device and the backup master control device can be guaranteed. Therefore, after a master control device in normal working mode fails, the visual network service can be continued through another master control device to ensure the normal operation of the visual network service.

[0015] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. Moreover, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:

[0017] Figure 1 A system architecture diagram of a data recovery method provided in an embodiment of the present invention;

[0018] Figure 2 A visual network topology tree structure diagram provided in an embodiment of the present invention;

[0019] Figure 3 A flowchart of a data recovery method provided in an embodiment of the present invention;

[0020] Figure 4 A state diagram provided in an embodiment of the present invention;

[0021] Figure 5 A schematic diagram of sending a setting signaling provided in an embodiment of the present invention;

[0022] Figure 6 A schematic diagram of sending a query signaling provided in an embodiment of the present invention;

[0023] Figure 7 A schematic diagram of the structure of a data recovery device provided in an embodiment of the present invention;

[0024] Figure 8 It is a networking schematic diagram of a visual network of the present invention;

[0025] Fig. 9 It is a schematic diagram of the hardware structure of a node server of the present invention;

[0026] Fig.10 It is a schematic diagram of the hardware structure of an access switch of the present invention;

[0027] Fig.11 It is a hardware structure diagram of an Ethernet protocol conversion gateway of the present invention. DETAILED DESCRIPTION

[0028] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.

[0029] It should be understood that the specific embodiments described herein are only used to explain the present invention, are only a part of the embodiments of the present invention, rather than all the embodiments, and are not used to limit the present invention.

[0030] Reference Figure 1 , Figure 1The system architecture diagram of a data recovery method provided in an embodiment of the present invention. The system includes a network management server, a main control device and a backup control device. In actual applications, one of the main control devices is ensured to be in an active state and the other is in a standby state. There can be multiple master control devices in the standby state. Here, a system including two master control devices is taken as an example for introduction.

[0031] In order to more clearly understand the present invention, the visual network topology tree structure is introduced here. The overall network structure of the visual network is composed of multiple substructures called autonomous clouds connected to each other. The autonomous clouds present a clear hierarchical structure when connected to each other. Starting from the top-level autonomous cloud, each autonomous cloud can be interconnected with multiple autonomous clouds in the next layer, and the autonomous clouds in the lower layer are connected to the autonomous clouds in the next layer. After all the autonomous clouds are connected layer by layer in this way, a complete visual network is formed. This hierarchical structure is a standard tree structure, and the entire visual network is a tree composed of autonomous cloud nodes.

[0032] For example, refer to Figure 2 , Figure 2 A visual network topology tree structure diagram provided in an embodiment of the present invention. Autonomous cloud 1 is the parent node, autonomous cloud 2 and autonomous cloud 3 are the child nodes of autonomous cloud 1, autonomous cloud 4 and autonomous cloud 5 are the child nodes of autonomous cloud 2, and autonomous cloud 6 and autonomous cloud 7 are the child nodes of autonomous cloud 3. In the prior art, each autonomous cloud has a main control device and a sub-control device. In the embodiment of the present invention, in order to ensure the reliability of the visual network service, each autonomous cloud can have two main control devices, and each main control device has two sub-control devices. The core data of the visual network is stored in the main control device, so that after one main control device goes down, another main control device can be used to continue the visual network service, thereby ensuring the reliable operation of the visual network service. Among them, the protection of the core data of the visual network is completed by the cooperation of the network management server and the two main control devices.

[0033] In order to ensure that when one of the main control devices fails, the visual network service can be carried out normally through the other main control device after switching to the other main control device, the network management server needs to perform signaling interaction with the main main control device and the backup main control device to ensure that the core data on the main main control device and the core data on the backup main control device are consistent. Among them, the core data can be, for example, the core data such as "registration information", "grouping information", "forwarding route", "upgrade file information" of the terminal device, sub-control device, main control device and other devices. The registration information includes, for example, the device number, type, address information of the terminal device. If the registration information of a terminal device on the two main control devices is inconsistent or the main control device that is currently working normally (for example, the device that is currently working normally is the main main control device) has the registration information of the terminal device, and the other backup main control device (backup main control device) does not have the registration information of the terminal device, then after the main main control device fails and switches to the backup main control device, since the backup main control device does not have the registration information of the terminal device or is inconsistent with the registration information of the terminal device on the main control device that was working normally before, the backup main control device will not accept the service initiated by the terminal device to the backup main control device. Therefore, it is necessary to ensure that the registration information of the terminal device on the main control device is consistent with the registration information of the terminal device on the backup control device. Similarly, it is necessary to ensure the consistency of various core data on the two control devices as much as possible to ensure the normal operation of the networked business after switching from a failed control device to another control device.

[0034] In the prior art, a network management server is connected to a master control device. After two master control devices are used in this embodiment, how should the network management server interact with the two master control devices to ensure the consistency of the core data of the two master control devices? Here, a general description is first given. The interaction between the network management server and the master control device can be summarized as two types of signaling: setting signaling and query signaling. The network management server can complete the control of the entire video service by manipulating the master control device. For example, the network management server tells the master control device to "adjust the network bandwidth to 100Mb / s" through setting signaling. In the case of two master control devices, if one master control device is in an active state and the other is in a standby state, the network management server will send setting signaling to both master control devices, allowing the two master control devices to adjust at the same time, thus ensuring that the bandwidth information of the two master control devices is consistent. The strategy of allowing the two master control devices to adjust their core data at the same time is called the "double-send" strategy. In addition, the network management server can also use query signaling to ask the master device "What is the current network bandwidth?" In order to avoid the long time required for the master device in the standby state to return the query result, the query efficiency is improved. At the same time, since the mechanism provided by this embodiment can ensure the consistency of the core data on the two master devices, this embodiment adopts the strategy of first sending the query signaling to the master device in the active state, and the master device in the active state returns the query result to the network management server. This strategy is called the "single-shot" strategy. If the master device in the active state returns a failed query result, the network management server sends the query signaling to the master device in the standby state. This strategy is called the "round-robin single-shot" strategy.

[0035] For example, the network management client sends a setting signaling to the network management server, and the network management server sends the setting signaling to the main control device and the backup control device at the same time. After receiving the setting signaling, the main control device and the backup control device parse the setting signaling, obtain the parameter information in the setting signaling, and write the parameter information into their respective local files. If the main control device writes successfully, it can send a write success result to the network management server. If the write fails, it can send a write failure result to the network management server.

[0036] The network management server can send a query signaling to the active master device among the main master device and the standby master device to obtain the core data previously set by setting the signaling. The active master device receives the query signaling, writes the core data saved in the file as a signaling parameter in a certain format and sends it to the network management server as a result. If the active master device returns a failed query result, the network management server can send a query signaling to the standby master device, that is, adopt the above-mentioned "polling single" strategy.

[0037] In order to introduce the embodiments of the present invention in detail, Figure 3 For explanation. Figure 3 , Figure 3 The following is a flow chart of a data recovery method provided in an embodiment of the present invention. The method can be executed on a network management server. The method in this embodiment includes the following steps:

[0038] Step 301: Obtain a first state of a primary control device and a second state of a secondary control device.

[0039] After the network management server establishes a communication connection with the main control device and the backup control device, the two control devices can send their current status to the network management server in the heartbeat response. The network management server can obtain the current status of the two control devices through the received heartbeat response. For example, the current status of the main control device obtained is the first status, and the current status of the backup control device obtained is the second status.

[0040] Step 302: If one of the first state and the second state is an active state and the other state is a standby state, then based on the consistency of the data on the main master control device, the data on the standby master control device, and the data on the network management server, restore the data on at least one of the main master control device and the standby master control device to make the data on the main master control device consistent with the data on the standby master control device.

[0041] The network management server can also send a hash value acquisition instruction to the main control device and the standby control device to obtain the hash value of the data on the main control device and the hash value of the data on the standby control device, and compare the hash value of the data on the main control device with the hash value of the data on the standby control device, so as to determine the consistency of the data on the main control device, the data on the standby control device, and the data on the network management server. Among them, the data on the main control device and the data on the standby control device can be core data. It should be noted that each type of core data has a corresponding hash value, and the main control device and the network management server can calculate the hash value of their own core data. The core data can be, for example, one of the data in the "registration information", "grouping information", "forwarding route", "user account information", and "upgrade file information" of the device. Among them, the device includes a main control device, a sub-control device, a terminal device, etc. The registration information is, for example, the device number of the terminal, the type of the terminal, the address of the terminal, etc. If the registration information of the terminal devices on the two master devices is inconsistent (for example, the master device in the standby state does not have the registration information of the terminal device 1 at this time), then after the master device in the active state fails, the master device in the standby state is converted from the standby state to the active state, but since there is no registration information of the terminal device 1 at this time, for example, the master device in the active state at this time will reject the network access instruction of the terminal device 1. If the upgrade file information is inconsistent, then after the master device in the active state fails, the master device in the standby state is converted from the standby state to the active state, resulting in the current version of the master device in the active state at this time not being the expected version, resulting in the inability to carry out the business. For example, if the upgrade file information of the two master devices is inconsistent, the version on the master device in the active state is a new version, and the new version is a version that eliminates certain vulnerabilities in the original version, while the version of the master device in the standby state is still the original version, then after switching to the master device in the standby state, the vulnerabilities of the original version of the standby master device still exist, which may affect the business quality or cause the business to be unable to proceed normally. Therefore, it is necessary to ensure the consistency of the same type of core data on the two master devices.

[0042] It should be noted that the main control device and the backup control device may also carry the hash value of their core data in the heartbeat response sent to the network management server. That is, the heartbeat response sent by the main control device to the network management server includes the first hash value, and the heartbeat response sent by the backup control device to the network management server includes the second hash value.

[0043] The first state can be any one of the waiting state, active state, standby state, out-of-step state and downtime state. The second state can also be any one of the waiting state, active state, standby state, out-of-step state and downtime state. Among them, the above-mentioned various states are interpreted with the main control device as the current device and the standby control device as the opposite device. The waiting state is used to indicate that the current device is synchronizing with the opposite device and the current device is in the standby working mode, the active state is used to indicate that the current device and the opposite device are successfully synchronized and the current device is in the normal working mode, the standby state is used to indicate that the current device and the opposite device are successfully synchronized and the current device is in the standby working mode, the out-of-step state is used to indicate that the current device and the opposite device have failed to synchronize and the current device is in the normal working mode, and the downtime state is used to indicate that the software and hardware of the current device have failed, resulting in the current device being unable to work normally.

[0044] The first state and the second state can form a total of 25 combinations. Figure 4 , Figure 4 This is a state diagram provided in an embodiment of the present invention. For example, when the first state is a waiting state and the second state is a downtime state, a temporary state is formed; when the first state and the second state are both standby states, an abnormal state is formed; when the first state and the second state are both active states, an abnormal state is formed; and when the first state and the second state are both waiting states, a temporary state is formed. Other states formed can be referred to Figure 4 As shown, no textual explanation is given here one by one. It should be noted that, among all the combination states composed of the first state and the second state, the other combination states except the first valid state and the second valid state are regarded as invalid states. Among them, the temporary state means that it will be restored to the normal state after a period of time (that is, the normal state means that one master control device is in the active state and the other master control device is in the standby state). The temporary state is a transitional state. It is abnormal if it stays in the temporary state for a long time. When the two master control devices are in the standby state, or both are in the active state, or both are in the out-of-step state, it means that both master control devices may fail and require manual intervention. If one of the first state and the second state is the active state and the other state is the standby state, the data on at least one of the main master control device and the standby master control device is restored according to the consistency of the data on the main master control device, the data on the standby master control device, and the data on the network management server. As Figure 4 As shown, if the first state of the first state and the second state is the active state and the second state is the standby state, or if the first state of the first state and the second state is the standby state and the second state is the active state, both are the first valid state.

[0045] Among them, according to the consistency of the data on the main control device, the data on the backup control device, and the data on the network management server, restoring the data on at least one of the main control device and the backup control device can be achieved in the following manner:

[0046] If the data on the network management server is inconsistent with the first data on the active master control device, and the data on the network management server is consistent with the second data on the standby master control device, a recovery signaling is sent to the active master control device so that the active master control device uses the data on the network management server included in the recovery signaling to replace the first data, thereby making the data on the main master control device consistent with the data on the standby master control device.

[0047] The data recovery method provided in this embodiment obtains the first state of the main master control device and the second state of the backup master control device. If one of the first state and the second state is an active state and the other state is a backup state, then according to the consistency of the data on the main master control device, the data on the backup master control device, and the data on the network management server, the data on at least one of the main master control device and the backup master control device is restored to make the data on the main master control device consistent with the data on the backup master control device, thereby ensuring the consistency of the data on the main master control device and the backup master control device to a certain extent. Therefore, after a master control device in normal working mode fails, the visual network service can be continued through another master control device to ensure the normal operation of the visual network service.

[0048] After obtaining the first state of the primary control device and the second state of the secondary control device in step 301, the following steps may also be included:

[0049] In the case where the first state and the second state constitute a valid state, sending a setting signaling to both the primary master control device and the backup master control device, wherein the valid state includes a first valid state and a second valid state, the first valid state indicates that one of the first state and the second state is an active state and the other state is a standby state, and the second valid state indicates that one of the first state and the second state is an out-of-sync state and the other state is a downtime state;

[0050] In the case where the first state and the second state constitute an invalid state, prompt information is output, wherein the invalid state is a state other than the valid state.

[0051] Among them, refer to Figure 4 The valid state includes a first valid state and a second valid state, and the second valid state means that one of the first state and the second state is an out-of-step state and the other is a downtime state.

[0052] For example, refer to Figure 5 , Figure 5A schematic diagram of sending a setting signaling provided in an embodiment of the present invention. When the first state and the second state constitute a first valid state, that is, when one state is an active state and the other state is a standby state, a double-send strategy is adopted, that is, setting signaling is sent to both master control devices. The purpose of the double-send strategy is to allow the data of the two master control devices to change at the same time, thereby reducing the probability of inconsistent data on the two master control devices to a certain extent, and reducing the probability of inconsistent data on the active master control device and the data on the network management server, thereby reducing the execution of subsequent recovery strategies. For example, a setting signaling is sent to the main master control device and the standby master control device at the same time to synchronize the registration information on the network management server to the two master control devices at the same time to ensure that the registration information on the two master control devices is consistent.

[0053] If after obtaining the first state and the second state in step 301, it is determined that the first state and the second state constitute an invalid state, then no setting signaling is sent to any of the main control device and the backup control device, thereby reducing signaling overhead and the probability of setting failure, and a prompt message can be output to prompt the user, and the content of the prompt message can be the state information of each of the two control devices. It should be noted that in the invalid state, no setting signaling is sent to any control device, thereby ensuring that the data on the two control devices is not modified, and to a certain extent ensuring the consistency of the data on the two control devices.

[0054] Optionally, according to the consistency of the data on the primary master control device, the data on the backup master control device, and the data on the network management server, restoring the data on at least one of the primary master control device and the backup master control device may be achieved in the following manner:

[0055] If the data on the network management server is inconsistent with the first data on the master control device in the active state, and the data on the network management server is inconsistent with the second data on the master control device in the standby state, a recovery signaling is sent to both the master control device in the active state and the master control device in the standby state, so that the master control device in the active state replaces the first data with the data on the network management server included in the recovery signaling, and the master control device in the standby state replaces the second data with the data on the network management server included in the recovery signaling; or,

[0056] If the data on the network management server is inconsistent with the first data on the active master device, and the data on the network management server is inconsistent with the second data on the standby master device, a recovery signaling is sent to the active master device so that the active master device uses the data on the network management server included in the recovery signaling to replace the first data, and if the first data is successfully recovered, the second data on the standby master device is restored using the data on the active master device.

[0057] Among them, in the case of successfully restoring the first data, the second data on the master device in the standby state is restored by using the data on the master device in the active state, so that the data on the master device in the active state can be synchronized to the master device in the standby state more quickly. Since the data on the master device is stored in the form of files, and the data on the network management server is stored in the form of a database, when the network management server sends a recovery signal to the master server, it is necessary to form the data in the database into information that can be recognized by the master server in a certain format, and then send it to the master server using the setting signal. Therefore, if the amount of data to be restored is large, it will take a long time. If the network management server successfully recovers the first data on the active master device after sending a recovery signaling to the active master server, it will take a long time to recover the second data on the standby master device by sending a setup signaling to the standby master device. Therefore, in order to save recovery time, the network management server recovers the second data on the standby master device by using the data on the active master device after successfully recovering the first data. The network management server can obtain the data on the active master device and restore the data in the form of a file on the active master device to the standby master device. It should be noted that the pressure on the active master device can be reduced by using the network management server to obtain the data on the active master device and restore the data in the form of a file on the active master device to the standby master device, rather than the active master device directly returning the data on the standby master device.

[0058] Optionally, based on the data on the primary control device, the data on the backup control device, and the data on the network management server, restoring the consistency of data on at least one of the primary control device and the backup control device can also be achieved in the following manner:

[0059] If the data on the network management server is consistent with the first data on the master control device in the active state, and the data on the network management server is inconsistent with the second data on the master control device in the standby state, a recovery signaling is sent to the master control device in the standby state, so that the master control device in the standby state replaces the second data with the data on the network management server included in the recovery signaling; or

[0060] If the data on the network management server is consistent with the first data on the active master device, and the data on the network management server is inconsistent with the second data on the standby master device, the second data on the standby master device is restored using the first data on the active master device.

[0061] Optionally, before restoring the second data on the master device in the standby state by using the first data on the master device in the active state, the following steps may also be included:

[0062] Determine whether the state of the main control device and the state of the standby control device remain unchanged within N heartbeat cycles, and whether the first data on the main control device and the second data on the standby control device are inconsistent in the Nth heartbeat cycle, where N is a preset value;

[0063] If the status of the main control device and the status of the standby control device remain unchanged within N heartbeat cycles, and the first data on the main control device is inconsistent with the second data on the standby control device in the Nth heartbeat cycle, the first data on the active control device is read, and the read first data is sent to the standby control device, so that the standby control device replaces the second data with the received first data.

[0064] It should be noted that when the first state and the second state form a second valid state, that is, when one state is an out-of-step state and the other state is a downtime state, a setup signaling is sent to both master control devices (when the setup signaling is sent to both master control devices, the master control device in the downtime state cannot receive the setup signaling), or the setup signaling is only sent to the master control device in the out-of-step state. For example, the main master control device is in an out-of-step state and the backup master control device is in a downtime state. In this case, the network management server only sends the setup signaling to the main master control device. After the main master control device receives the setup signaling, if the core data in the setup signaling is written successfully, it returns success, and if the writing fails, it returns failure.

[0065] It should be noted that when the first state and the second state form the first valid state, the setup signaling is sent to both master control devices. After the setup signaling is sent to both master control devices, if the master master control device and the backup master control device receive the setup signaling, and if the return results of the two master control devices are different, there is a situation where the core data on the two master control devices are inconsistent.

[0066] For example, the active master returns success, while the standby master returns failure; or the active master returns failure, while the standby master returns success, which will cause inconsistency in the core data on the two master devices. If the return results of the two master devices are different, the network management server will not process them for the time being, but will later determine whether the data on the network management server is the same as the data on the active master, and whether the data on the network management server is the same as the data on the standby master by obtaining the hash values ​​of the data on the two master devices.

[0067] For example, when the hash value of the data on the active master device is different from the hash value of the data on the network management server, it can be determined that the data on the active master device is different from the data on the network management server. For example, when the first state and the second state constitute the first valid state, a setting signaling is sent to the main master device and the backup master device, and the results returned by the two master devices are different. The network management server does not process it temporarily, but obtains the hash value of the data on the two master devices at a later stage. If it is found that the hash value of the active master device is different from the hash value of the data on the network management server, a recovery signaling can be sent to the active master device to synchronize the data on the network management server to the active master device. Among them, the hash values ​​of the data on the two master devices and the hash values ​​of the data on the network management server are both the hash values ​​of the current data. If the data changes, the hash value will change.

[0068] After the data of the active master device is identical to the data on the network management server, if the hash value of the data of the standby master device is identical to the hash value of the data on the network management server, the standby master device does not need to perform any action, and at this time, the data on the two master devices are consistent. If the hash value of the data of the standby master device is different from the hash value of the data on the network management server, it is necessary to perform the step of synchronizing the data on the active master device to the standby master device, that is, the network management server reads the data from the active master device and sends the read data to the standby master device, and the standby master device replaces the local data with the data received from the network management server, so that the data on the active master device and the standby master device are consistent. It should be noted that in order to reduce the burden on the master device, the core data is not directly synchronized between the two master devices, but the core data is read from the active master device by the network management server, and the read core data is sent to the standby master device. Among them, the core data on the two master control devices are stored in file format. The network management server can directly read the core data in file format on the active master control device and send it to the standby master control device. The standby master control device directly uses the core data in file format to replace the previous core data.

[0069] When the first state and the second state form a second valid state, after sending a setup signaling to the master device in the out-of-step state, if the master device in the out-of-step state is converted to the active state, and the master device in the downtime state is converted to the standby state, in this case, if the data on the master device in the active state is different from the data on the network management server, a recovery signaling is also sent to the master device in the active state. After sending the recovery signaling, if the data of the master device in the active state is the same as the data on the network management server, if the hash value of the data of the master device in the standby state is the same as the hash value of the data on the network management server, the master device in the standby state does not need to perform any action, and at this time, the data on the two master devices are consistent. If the hash value of the data of the master device in the standby state is different from the hash value of the data on the network management server, it is necessary to execute the step of synchronizing the data on the master device in the active state to the master device in the standby state.

[0070] It should be noted that, for example, when the first state and the second state form a second valid state, the master device in the out-of-sync state is converted to the active state, and the master device in the downtime state will enter the standby state after returning to normal. If the network management server detects that the hash value of the data on the active master device is different from the hash value of the data on the standby master device, it can be determined that the data on the active master device and the standby master device are different. The network management server will not immediately use the data on the active master device to restore the data on the standby master device, but wait for N heartbeat cycles (for example, wait for 10 heartbeat cycles, one heartbeat cycle is equal to 1 second). If the status of the two master devices does not transfer within N heartbeat cycles (that is, the status of the original active master device is still active, and the original standby master device is still standby), and the hash values ​​of the core data on the two master devices are still inconsistent, the network management server will read the core data on the active master device and send the read core data to the standby master device. This "delayed recovery" is meaningful in practice and can prevent erroneous operations caused by the "boundary effect" of the working state (unstable state, frequent switching). "Delayed recovery" means waiting for a preset time period before performing recovery (the recovery process is about to restore the core data from the active master device to the standby master device). For example, if a master device that has been switched from down state to standby state switches from standby state to down state again within N heartbeat cycles, recovery cannot be performed. If the hash values ​​of the core data on two master devices are the same within N heartbeat cycles, "delayed recovery" will not be performed after N heartbeat cycles are reached.

[0071] When the first state and the second state constitute a first valid state, after the network management server sends a setup signaling to the two master control devices, the network management server obtains the hash value of the core data on the two master control devices, and finds that the hash value of the core data of the active master control device is the same as the hash value of the core data on the network management server, while the hash value of the core data of the active master control device is different from the hash value of the core data of the standby master control device (due to network transmission reasons, the standby master control device receives the core data later, causing the data to be written later, resulting in different hash values ​​of the core data on the two master control devices), and the above-mentioned "delayed recovery" strategy is also executed.

[0072] By implementing the "delayed recovery" strategy, the consistency of the core data on the two master control devices can be further improved. Therefore, after one of the master control devices fails, the core data on the other master control device is consistent with the core data on the failed master control device, thereby ensuring that the visual network service can continue.

[0073] Optionally, the following steps may also be included:

[0074] When the first state and the second state form a first valid state, sending a query signaling to the master device in the active state; receiving a query response sent by the master device in the active state; if the query response indicates that the query fails, sending a query signaling to the master device in the standby state, wherein the first valid state indicates that one of the first state and the second state is the active state, and the other state is the standby state; or,

[0075] When the first state and the second state form a second valid state, a query signaling is sent to the master device in the out-of-sync state, wherein the second valid state indicates that one of the first state and the second state is the out-of-sync state and the other is the downtime state.

[0076] It should be noted that, refer to Figure 6 , Figure 6 Schematic diagram of sending a query signaling provided in an embodiment of the present invention. When the first state and the second state form a first valid state, if the master control device is a master control device in an active state, the following is executed: Figure 6 If the network management server receives the failure response result sent by the main control device, the network management server and the backup control device can perform the following steps: Figure 6 The query process is shown by the dotted line. If the standby master device also returns a failure, it means failure.

[0077] When the first state and the second state form a second valid state, a query signaling is sent to the master device in the out-of-step state, and a query signaling is not sent to the master device in the downtime state. For example, if the master master device is in the out-of-step state and the standby master device is in the downtime state, a query signaling is sent to the master master device, and a query signaling is not sent to the standby master device.

[0078] When the first state and the second state form an invalid state, no query signaling is sent to any of the main control device and the standby control device, and prompt information is output to prompt the user of the status of each control device.

[0079] Reference Figure 7 , Figure 7 The structure diagram of a data recovery device provided in an embodiment of the present invention is shown in FIG. 700 . The device 700 is arranged in a network management server and includes:

[0080] An acquisition module 710 is used to acquire a first state of a primary control device and a second state of a secondary control device;

[0081] The recovery module 720 is used to restore the data on at least one of the main master control device and the backup master control device based on the consistency of the data on the main master control device, the data on the backup master control device, and the data on the network management server if one of the first state and the second state is the active state and the other state is the standby state, so as to make the data on the main master control device consistent with the data on the backup master control device.

[0082] The data recovery method provided in this embodiment obtains the first state of the main master control device and the second state of the backup master control device. If one of the first state and the second state is an active state and the other state is a backup state, then according to the consistency of the data on the main master control device, the data on the backup master control device, and the data on the network management server, the data on at least one of the main master control device and the backup master control device is restored to make the data on the main master control device consistent with the data on the backup master control device. To a certain extent, the consistency of the core data on the main master control device and the backup master control device can be guaranteed. Therefore, after a master control device in normal working mode fails, the visual network service can be continued through another master control device to ensure the normal operation of the visual network service.

[0083] Optionally, the recovery module 720 is specifically used to send a recovery signaling to the active master device if the data on the network management server is inconsistent with the first data on the active master device, and the data on the network management server is consistent with the second data on the standby master device, so that the active master device uses the data on the network management server included in the recovery signaling to replace the first data.

[0084] Optionally, the recovery module 720 is specifically used to send recovery signaling to both the active master device and the standby master device if the data on the network management server is inconsistent with the first data on the active master device, and the data on the network management server is inconsistent with the second data on the standby master device, so that the active master device replaces the first data with the data on the network management server included in the recovery signaling, and the standby master device replaces the second data with the data on the network management server included in the recovery signaling; or

[0085] If the data on the network management server is inconsistent with the first data on the active master device, and the data on the network management server is inconsistent with the second data on the standby master device, a recovery signaling is sent to the active master device so that the active master device replaces the first data with the data on the network management server included in the recovery signaling, and if the first data is successfully recovered, the second data on the standby master device is restored using the data on the active master device.

[0086] Optionally, the recovery module 720 is specifically configured to send a recovery signaling to the master device in the standby state if the data on the network management server is consistent with the first data on the master device in the active state, and the data on the network management server is inconsistent with the second data on the master device in the standby state, so that the master device in the standby state replaces the second data with the data on the network management server included in the recovery signaling; or

[0087] If the data on the network management server is consistent with the first data on the active master device, and the data on the network management server is inconsistent with the second data on the standby master device, the second data on the standby master device is restored using the first data on the active master device.

[0088] Optionally, also include:

[0089] A judgment module, used to judge whether the state of the main control device and the state of the standby control device remain unchanged within N heartbeat cycles, and whether the first data on the main control device and the second data on the standby control device are inconsistent in the Nth heartbeat cycle, wherein N is a preset value;

[0090] A reading module is used to read the first data on the active master device and send the read first data to the standby master device if the state of the main master device and the state of the standby master device remain unchanged within the N heartbeat cycles, and the first data on the main master device is inconsistent with the second data on the standby master device in the Nth heartbeat cycle, so that the standby master device replaces the second data with the received first data.

[0091] Optionally, also include:

[0092] a sending module, configured to send a setting signaling to both the main control device and the standby control device when the first state and the second state constitute a valid state, wherein the valid state includes a first valid state and a second valid state, the first valid state indicates that one of the first state and the second state is an active state and the other state is a standby state, and the second valid state indicates that one of the first state and the second state is an out-of-sync state and the other state is a downtime state;

[0093] The output module is used to output prompt information when the first state and the second state form an invalid state, wherein the invalid state is a state other than the valid state.

[0094] Optionally, the sending module is further used to send a query signaling to a master device in an active state when the first state and the second state form a first valid state; receive a query response sent by the master device in an active state; if the query response indicates that the query fails, send the query signaling to a master device in a standby state, wherein the first valid state indicates that one of the first state and the second state is an active state, and the other state is a standby state; or,

[0095] When the first state and the second state form a second valid state, the query signaling is sent to the master device in the out-of-step state, wherein the second valid state indicates that one of the first state and the second state is an out-of-step state, and the other state is a downtime state.

[0096] In addition, an embodiment of the present invention further provides a data recovery device, which includes a processor, a memory, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, the various processes of the data recovery method embodiment of the above-mentioned embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.

[0097] The embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, each process of the above-mentioned data recovery method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it is not repeated here. Among them, the computer-readable storage medium can be a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc.

[0098] The embodiment of the present invention further provides a computer program, which can be stored in a cloud or local storage medium. When the computer program is run by a computer or a processor, it is used to perform the corresponding steps of the data recovery method of the embodiment of the present invention, and is used to implement the corresponding modules in the data recovery device according to the embodiment of the present invention.

[0099] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0100] It is easy for a person skilled in the art to think that any combination of the above embodiments is feasible, so any combination of the above embodiments is an implementation scheme of the present invention. However, due to space limitations, this specification will not describe them in detail here.

[0101] The data recovery method provided here is not inherently related to any specific computer, virtual system or other equipment. Various general systems can also be used together with the teachings based on this. According to the above description, it is obvious that the structure required by the system with the scheme of the present invention is constructed. In addition, the present invention is not directed to any specific programming language yet. It should be understood that various programming languages ​​can be utilized to realize the content of the present invention described here, and the description of the above specific language is for disclosing the best mode of the present invention.

[0102] In the description provided herein, a large number of specific details are described. However, it is understood that embodiments of the present invention can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.

[0103] Similarly, it should be understood that in order to streamline the present invention and aid in understanding one or more of the various inventive aspects, in the above description of exemplary embodiments of the present invention, various features of the present invention are sometimes grouped together into a single embodiment, figure, or description thereof. However, this disclosed method should not be interpreted as reflecting the intention that the claimed invention requires more features than those expressly recited in each claim. Rather, as reflected in the claims, inventive aspects lie in less than all of the features of the individual embodiments previously disclosed. Therefore, the claims that follow the detailed description are hereby expressly incorporated into the detailed description, with each claim itself serving as a separate embodiment of the present invention.

[0104] Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and in addition they may be divided into a plurality of submodules or subunits or subcomponents. Except that at least some of such features and / or processes or units are mutually exclusive, all features disclosed in this specification (including the accompanying claims, abstracts and drawings) and all processes or units of any method or device disclosed in this manner may be combined in any combination. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstracts and drawings) may be replaced by an alternative feature providing the same, equivalent or similar purpose.

[0105] In addition, those skilled in the art will appreciate that, although some embodiments described herein include certain features included in other embodiments but not other features, the combination of features of different embodiments is meant to be within the scope of the present invention and form different embodiments. For example, in the claims, any one of the claimed embodiments may be used in any combination.

[0106] The various component embodiments of the present invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. It should be understood by those skilled in the art that a microprocessor or digital signal processor (DSP) may be used in practice to implement some or all of the functions of some or all of the components in the data recovery method according to an embodiment of the present invention. The present invention may also be implemented as a device or apparatus program (e.g., a computer program and a computer program product) for executing part or all of the methods described herein. Such a program implementing the present invention may be stored on a computer-readable medium, or may be in the form of one or more signals. Such a signal may be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.

[0107] It should be noted that the above embodiments illustrate the present invention rather than limit it, and that those skilled in the art may devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference symbol between brackets shall not be construed as a limitation on the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "one" or "an" preceding an element does not exclude the presence of a plurality of such elements. The present invention may be implemented by means of hardware comprising a number of different elements and by means of a suitably programmed computer. In a unit claim enumerating a number of devices, several of these devices may be embodied by the same hardware item. The use of the words first, second, and third, etc., does not indicate any order. These words may be interpreted as names.

[0108] In order to enable those skilled in the art to better understand the embodiments of the present invention, the visual network is introduced as follows:

[0109] Some of the technologies used in the visual Internet of Things are as follows:

[0110] Network Technology

[0111] The network technology innovation of visual networking improves the traditional Ethernet to cope with the huge potential video traffic on the network. Different from simple network packet switching or network circuit switching, visual networking technology uses packet switching to meet streaming needs. Visual networking technology has the flexibility, simplicity and low price of packet switching, and the quality and security guarantee of circuit switching, realizing the seamless connection of the whole network switching virtual circuit and data format.

[0112] Switching Technology

[0113] Visual networking uses the two advantages of Ethernet: asynchronism and packet switching. It eliminates Ethernet defects under the premise of full compatibility, and has seamless end-to-end connection across the entire network, directly connects to user terminals, and directly carries IP data packets. User data does not require any format conversion within the entire network. Visual networking is a more advanced form of Ethernet and a real-time switching platform that can achieve large-scale real-time transmission of high-definition video across the entire network, which is currently unattainable on the Internet, and pushes many network video applications towards high definition and unification.

[0114] Server Technology

[0115] The server technology on the visual network and unified video platform is different from the traditional server. Its streaming media transmission is based on connection-oriented. Its data processing capability is independent of traffic and communication time. A single network layer can include signaling and data transmission. For voice and video services, the complexity of streaming media processing on the visual network and unified video platform is much simpler than data processing, and its efficiency is more than 100 times higher than that of traditional servers.

[0116] Storage Technology

[0117] The ultra-high-speed storage technology of the unified video platform adopts the most advanced real-time operating system to adapt to the media content with ultra-large capacity and ultra-large flow, mapping the program information in the server command to the specific hard disk space. The media content no longer passes through the server, but is directly delivered to the user terminal in an instant. The user generally waits for less than 0.2 seconds. The optimized sector distribution greatly reduces the mechanical movement of the hard disk head seeking, and the resource consumption accounts for only 20% of the same level of IP Internet, but it generates 3 times more concurrent traffic than the traditional hard disk array, and the overall efficiency is improved by more than 10 times.

[0118] Network Security Technology

[0119] The structural design of the visual network completely eradicates the network security issues that plague the Internet through separate licensing for each service and complete isolation of equipment and user data. Generally, anti-virus programs and firewalls are not required, and attacks by hackers and viruses are eliminated, providing users with a structurally worry-free and secure network.

[0120] Service Innovation Technology

[0121] The unified video platform integrates services and transmission. Whether it is a single user, a private network user or a network, it is just an automatic connection. User terminals, set-top boxes or PCs are directly connected to the unified video platform to obtain rich and colorful multimedia video services in various forms. The unified video platform uses a "recipe-style" table configuration mode to replace traditional complex application programming. Complex applications can be implemented with very little code, realizing "unlimited" new business innovation.

[0122] The networking of the visual network is as follows:

[0123] Visual networking is a centrally controlled network structure. The network can be a tree network, star network, ring network, etc., but on this basis, there needs to be a centralized control node in the network to control the entire network.

[0124] like Figure 5 As shown in the figure, the visual network is divided into two parts: access network and metropolitan area network.

[0125] The equipment in the access network can be divided into three categories: node server, access switch, and terminal (including various set-top boxes, encoding boards, storage, etc.). The node server is connected to the access switch, and the access switch can be connected to multiple terminals and can be connected to Ethernet.

[0126] The node server is a node in the access network that performs centralized control functions and can control access switches and terminals. The node server can be directly connected to the access switch or directly connected to the terminal.

[0127] Similarly, the devices in the metropolitan area network can also be divided into three categories: metropolitan area servers, node switches, and node servers. The metropolitan area servers are connected to the node switches, and the node switches can be connected to multiple node servers.

[0128] The node server is a node server of the access network part, that is, the node server belongs to both the access network part and the metropolitan area network part.

[0129] The metropolitan area server is a node with centralized control function in the metropolitan area network, which can control the node switch and node server. The metropolitan area server can be directly connected to the node switch or the node server.

[0130] It can be seen from this that the entire visual network is a hierarchical and centrally controlled network structure, and the network controlled by the node server and the metropolitan area server can be various structures such as tree, star, and ring.

[0131] Figuratively speaking, the access network part can form a unified video platform (the part in the dotted circle), and multiple unified video platforms can form a visual network; each unified video platform can be interconnected through the metropolitan area and wide area visual networks.

[0132] Visual networking equipment classification

[0133] 1.1 The devices in the visual network of the embodiment of the present invention can be mainly divided into three categories: servers, switches (including Ethernet gateways), terminals (including various set-top boxes, encoding boards, storage devices, etc.). The visual network as a whole can be divided into a metropolitan area network (or a national network, a global network, etc.) and an access network.

[0134] 1.2 The equipment in the access network can be mainly divided into three categories: node server, access switch (including Ethernet gateway), terminal (including various set-top boxes, encoding boards, storage, etc.).

[0135] The specific hardware structure of each access network device is as follows:

[0136] Node server:

[0137] like Fig. 9 As shown, it mainly includes a network interface module 901, a switching engine module 902, a CPU module 903, and a disk array module 904;

[0138] Among them, the packets coming from the network interface module 901, the CPU module 903, and the disk array module 904 all enter the switching engine module 902; the switching engine module 902 performs an operation of checking the address table 905 on the incoming packets, thereby obtaining the packet's guidance information; and according to the packet's guidance information, the packet is stored in the queue of the corresponding packet buffer 906; if the queue of the packet buffer 906 is close to full, it is discarded; the switching engine module 902 polls all packet buffer queues, and forwards if the following conditions are met: 1) the port sending buffer is not full; 2) the queue packet counter is greater than zero. The disk array module 904 mainly implements the control of the hard disk, including the initialization, reading and writing of the hard disk; the CPU module 903 is mainly responsible for the protocol processing between the access switch and the terminal (not shown in the figure), the configuration of the address table 905 (including the downstream protocol packet address table, the upstream protocol packet address table, and the data packet address table), and the configuration of the disk array module 904.

[0139] Access switch:

[0140] like Fig.10 As shown, it mainly includes a network interface module (a downlink network interface module 1001, an uplink network interface module 1002), a switching engine module 1003 and a CPU module 1004;

[0141] Among them, the packet (uplink data) coming from the downlink network interface module 1001 enters the packet detection module 1005; the packet detection module 1005 detects whether the destination address (DA), source address (SA), data packet type and packet length of the packet meet the requirements. If they meet the requirements, the corresponding stream identifier (stream-id) is allocated and enters the switching engine module 1003, otherwise it is discarded; the packet (downlink data) coming from the uplink network interface module 1002 enters the switching engine module 1003; the data packet coming from the CPU module 1004 enters the switching engine module 1003; the switching engine module 1003 processes the incoming The packet performs an operation of looking up the address table 1006 to obtain the packet's guidance information; if the packet entering the switching engine module 1003 is from the downstream network interface to the upstream network interface, the packet is stored in the queue of the corresponding packet buffer 1007 in combination with the stream identifier (stream-id); if the queue of the packet buffer 1007 is nearly full, it is discarded; if the packet entering the switching engine module 1003 is not from the downstream network interface to the upstream network interface, then according to the packet's guidance information, the data packet is stored in the queue of the corresponding packet buffer 1007; if the queue of the packet buffer 1007 is nearly full, it is discarded.

[0142] The switching engine module 1003 polls all packet buffer queues. In the embodiment of the present invention, there are two situations:

[0143] If the queue is from the downlink network interface to the uplink network interface, it is forwarded if the following conditions are met: 1) the port send buffer is not full; 2) the queue packet counter is greater than zero; 3) a token generated by the bit rate control module is obtained;

[0144] If the queue is not going from the downstream network interface to the upstream network interface, it is forwarded if the following conditions are met: 1) the port send buffer is not full; 2) the queue packet counter is greater than zero.

[0145] The code rate control module 1008 is configured by the CPU module 1004 to generate tokens for all packet buffer queues from the downstream network interface to the upstream network interface within a programmable interval to control the code rate of the upstream forwarding.

[0146] The CPU module 1004 is mainly responsible for protocol processing with the node server, configuration of the address table 1006 , and configuration of the bit rate control module 1008 .

[0147] Ethernet protocol conversion gateway:

[0148] like Fig.11As shown, it mainly includes a network interface module (a downlink network interface module 1101, an uplink network interface module 1102), a switching engine module 1103, a CPU module 1104, a packet detection module 1105, a bit rate control module 1108, an address table 1106, a packet buffer 1107 and a MAC adding module 1109, and a MAC deleting module 1110.

[0149] The data packet from the downlink network interface module 1101 enters the packet detection module 1105; the packet detection module 1105 detects whether the Ethernet MAC DA, Ethernet MAC SA, Ethernet length or frame type, visual network destination address DA, visual network source address SA, visual network data packet type and packet length of the data packet meet the requirements, and if they meet the requirements, the corresponding stream identifier (stream-id) is assigned; then, the MAC deletion module 1110 subtracts the MAC DA, MAC SA, length or frame type (2 bytes) and enters the corresponding receiving buffer, otherwise it is discarded;

[0150] The downstream network interface module 1101 detects the sending buffer of the port. If there is a packet, it obtains the Ethernet MAC DA of the corresponding terminal based on the visual network destination address DA of the packet, adds the Ethernet MAC DA of the terminal, the MACSA of the Ethernet protocol conversion gateway, and the Ethernet length or frame type, and sends it.

[0151] The functions of other modules in the Ethernet protocol conversion gateway are similar to those of the access switch.

[0152] terminal:

[0153] It mainly includes network interface module, business processing module and CPU module; for example, the set-top box mainly includes network interface module, audio and video encoding and decoding engine module, CPU module; the encoding board mainly includes network interface module, audio and video encoding engine module, CPU module; the memory mainly includes network interface module, CPU module and disk array module.

[0154] 1.3 The equipment in the metropolitan area network can be divided into two categories: node server, node switch, and metropolitan area server. Among them, the node switch mainly includes network interface module, switching engine module and CPU module; the metropolitan area server mainly includes network interface module, switching engine module and CPU module.

[0155] 2. Definition of Visual Network Data Packet

[0156] 2.1 Access Network Data Packet Definition

[0157] The data packet of the access network mainly includes the following parts: destination address (DA), source address (SA), reserved bytes, payload (PDU), and CRC.

[0158] As shown in the following table, the data packet of the access network mainly includes the following parts:

[0159] DA SA Reserved Payload CRC

[0160] DA SA Reserved Payload CRC

[0161] in:

[0162] The destination address (DA) consists of 8 bytes. The first byte indicates the type of data packet (such as various protocol packets, multicast data packets, unicast data packets, etc.), with a maximum of 256 possibilities. The second to sixth bytes are the metropolitan area network address, and the seventh and eighth bytes are the access network address.

[0163] The source address (SA) is also composed of 8 bytes and has the same definition as the destination address (DA).

[0164] The reserved bytes consist of 2 bytes;

[0165] The payload part has different lengths depending on the type of datagram. If it is a protocol packet, it is 64 bytes. If it is a single multicast data packet, it is 32+1024=1056 bytes. Of course, it is not limited to the above two types.

[0166] CRC consists of 4 bytes and its calculation method follows the standard Ethernet CRC algorithm.

[0167] 2.2 Definition of Metropolitan Area Network Data Packet

[0168] The topology of the metropolitan area network is a graph. There may be two or more connections between two devices, that is, there may be more than two connections between a node switch and a node server, a node switch and a node switch, and a node switch and a node server. However, the metropolitan area network address of a metropolitan area network device is unique. In order to accurately describe the connection relationship between metropolitan area network devices, a parameter: a label is introduced in the embodiment of the present invention to uniquely describe a metropolitan area network device.

[0169] The definition of labels in this manual is similar to the definition of labels in MPLS (Multi-Protocol Label Switch). Assuming that there are two connections between device A and device B, there are two labels for the data packet from device A to device B, and there are two labels for the data packet from device B to device A. Labels are divided into input labels and output labels. Assuming that the label of the data packet entering device A (input label) is 0x0000, the label of the data packet when leaving device A (output label) may become 0x0001. The access process of the metropolitan area network is a centralized access process, which means that the address allocation and label allocation of the metropolitan area network are dominated by the metropolitan area server, and the node switch and node server are only passively executed. This is different from the label allocation of MPLS, which is the result of mutual negotiation between the switch and the server.

[0170] As shown in the following table, the data packets of the metropolitan area network mainly include the following parts:

[0171] DA SA Reserved Label Payload CRC

[0172] That is, destination address (DA), source address (SA), reserved byte (Reserved), label, payload (PDU), CRC. The label format can refer to the following definition: the label is 32 bits, of which the upper 16 bits are reserved and only the lower 16 bits are used. It is located between the reserved bytes and payload of the data packet.

Claims

1. A data recovery method, characterized in that: Executed on the network management server, including: Obtaining a first state of a primary control device and a second state of a secondary control device; If one of the first state and the second state is an active state and the other state is a standby state, then according to the consistency of the data on the main master control device, the data on the standby master control device, and the data on the network management server, restore the data on at least one of the main master control device and the standby master control device to make the data on the main master control device consistent with the data on the standby master control device; The method of restoring data on at least one of the main control device and the standby control device according to the consistency of the data on the main control device, the data on the standby control device, and the data on the network management server comprises: If the data on the network management server is inconsistent with the first data on the active master device, and the data on the network management server is inconsistent with the second data on the standby master device, a recovery signaling is sent to the active master device so that the active master device replaces the first data with the data on the network management server included in the recovery signaling, and if the first data is successfully recovered, the second data on the standby master device is restored using the data on the active master device.

2. The method according to claim 1, characterized in that The method of restoring data on at least one of the main control device and the standby control device according to the consistency of the data on the main control device, the data on the standby control device, and the data on the network management server comprises: If the data on the network management server is inconsistent with the first data on the active master device, and the data on the network management server is consistent with the second data on the standby master device, a recovery signaling is sent to the active master device so that the active master device replaces the first data with the data on the network management server included in the recovery signaling.

3. The method according to claim 1, characterized in that The method of restoring data on at least one of the main control device and the standby control device according to the consistency of the data on the main control device, the data on the standby control device, and the data on the network management server further includes: If the data on the network management server is inconsistent with the first data on the master control device in the active state, and the data on the network management server is inconsistent with the second data on the master control device in the standby state, a recovery signaling is sent to both the master control device in the active state and the master control device in the standby state, so that the master control device in the active state replaces the first data with the data on the network management server included in the recovery signaling, and the master control device in the standby state replaces the second data with the data on the network management server included in the recovery signaling.

4. The method according to claim 1, characterized in that: The method of restoring the consistency of data on at least one of the main control device and the standby control device according to the data on the main control device, the data on the standby control device, and the data on the network management server includes: If the data on the network management server is consistent with the first data on the master control device in the active state, and the data on the network management server is inconsistent with the second data on the master control device in the standby state, a recovery signaling is sent to the master control device in the standby state, so that the master control device in the standby state replaces the second data with the data on the network management server included in the recovery signaling; or If the data on the network management server is consistent with the first data on the active master device, and the data on the network management server is inconsistent with the second data on the standby master device, the second data on the standby master device is restored using the first data on the active master device.

5. The method according to claim 4, characterized in that Before the second data on the master device in the standby state is restored by using the first data on the master device in the active state, the method further includes: Determine whether the state of the main control device and the state of the standby control device remain unchanged within N heartbeat cycles, and whether the first data on the main control device and the second data on the standby control device are inconsistent in the Nth heartbeat cycle, where N is a preset value; If the state of the main master control device and the state of the standby master control device remain unchanged within the N heartbeat cycles, and the first data on the main master control device is inconsistent with the second data on the standby master control device in the Nth heartbeat cycle, the first data on the active master control device is read, and the read first data is sent to the standby master control device, so that the standby master control device replaces the second data with the received first data.

6. The method according to any one of claims 1 to 5, characterized in that: After obtaining the first state of the main control device and the second state of the standby control device, the method further includes: In the case where the first state and the second state constitute a valid state, sending a setting signaling to both the primary master control device and the backup master control device, wherein the valid state includes a first valid state and a second valid state, the first valid state indicates that one of the first state and the second state is an active state and the other state is a standby state, and the second valid state indicates that one of the first state and the second state is an out-of-sync state and the other state is a downtime state; In the case where the first state and the second state constitute an invalid state, prompt information is output, wherein the invalid state is a state other than the valid state.

7. The method according to any one of claims 1 to 5, characterized in that: Also includes: When the first state and the second state form a first valid state, sending a query signaling to a master control device in an active state; receiving a query response sent by a master device in an active state; if the query response indicates that the query fails, sending the query signaling to the master device in a standby state, wherein the first valid state indicates that one of the first state and the second state is an active state and the other state is a standby state; or, When the first state and the second state form a second valid state, the query signaling is sent to the master device in the out-of-step state, wherein the second valid state indicates that one of the first state and the second state is an out-of-step state, and the other state is a downtime state.

8. A data recovery device, characterized in that: Set up on the network management server, including: An acquisition module, used to acquire a first state of a primary control device and a second state of a secondary control device; a recovery module, configured to, if one of the first state and the second state is an active state and the other state is a standby state, restore data on at least one of the main main control device and the standby main control device according to consistency of data on the main main control device, data on the standby main control device, and data on the network management server, so that data on the main main control device is consistent with data on the standby main control device; The recovery module is specifically used to send a recovery signaling to the active master control device if the data on the network management server is inconsistent with the first data on the active master control device, and the data on the network management server is inconsistent with the second data on the standby master control device, so that the active master control device uses the data on the network management server included in the recovery signaling to replace the first data, and when the first data is successfully recovered, restore the second data on the standby master control device through the data on the active master control device.

9. 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 processor, the data recovery method according to any one of claims 1 to 7 is implemented.

10. A data recovery device, comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the computer program implements the steps of the data recovery method according to any one of claims 1 to 7 when executed by the processor.