Method, device and storage medium for active / standby switching based on quantum entanglement

By deploying entangled state quantum pairs on the service nodes of the Internet system and conducting quantum measurements, the problems of monitoring windows and non-random switching during the active and backup switching processes are solved, security and unpredictability are improved, and the risk of external attacks is reduced.

CN116094904BActive Publication Date: 2024-08-23CHINA UNITED NETWORK COMM GRP CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310012662.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-01-05
Publication Date
2024-08-23
Estimated Expiration
2043-01-05

AI Technical Summary

Technical Problem

In the existing Internet system, there is a monitoring window during the active/standby switching process, which is easy to be detected and attacked by the outside. Moreover, the periodic switching lacks randomness and is easy to be cracked.

Method used

Deploy entangled state quantum pairs on two service nodes that are mutual backups, and use quantum measurements to determine whether to perform master-slave switching in the next service cycle, cut off communication confirmation, and use the randomness of quantum measurement results to reduce the risk of externally determining the master service node. .

Benefits of technology

It improves the security of the active-standby switching process, reduces the risk of external detection and attacks, and makes the switching process more unpredictable through the randomness of quantum measurement results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116094904B
    Figure CN116094904B
Patent Text Reader

Abstract

The present application provides a method, device and storage medium for active-standby switching based on quantum entanglement, which relates to the field of computer technology and is used to improve the security of an active-standby switching process. The method comprises: a first service node selects an Mth group of entangled quantum pairs related to a Pth service cycle from N groups of entangled quantum pairs within a Pth service cycle; the first service node performs quantum measurement based on the Mth group of entangled quantum pairs to obtain a quantum measurement result; the first service node determines whether to perform active-standby switching within a P+1th service cycle based on the quantum measurement result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a method, device and storage medium for active / standby switching based on quantum entanglement. Background Art

[0002] Currently, in Internet systems, in order to meet load balancing and prevent abnormal situations, multiple service nodes are usually deployed to form a system architecture with one master and multiple backups.

[0003] During the active / standby switchover process, the two service nodes that back up each other need to communicate and transmit data, which provides a monitoring window for external detection and attack. In addition, the periodic active / standby switchover mechanism is not random, and it is easy for the current active service node to be determined by the outside world, thus being attacked by the outside world. How to improve the security of the active / standby switchover process is an urgent problem to be solved. Summary of the invention

[0004] The embodiments of the present application provide a method, device and storage medium for active-standby switching based on quantum entanglement, which are used to improve the security during the active-standby switching process.

[0005] In a first aspect, a method for master-slave switching based on quantum entanglement is provided, the method comprising: a first service node selects an Mth group of entangled quantum pairs related to the Pth service cycle from N groups of entangled quantum pairs within a Pth service cycle; wherein one quantum of each group of entangled quantum pairs is deployed at the first service node, and the other quantum is deployed at a second service node; one of the first service node and the second service node is a master service node, and the other service node is a backup service node, P, M, and N are all positive integers, and M is less than or equal to N; the first service node performs quantum measurement based on the Mth group of entangled quantum pairs to obtain a quantum measurement result; the first service node determines whether to perform master-slave switching within the P+1th service cycle based on the quantum measurement result.

[0006] The technical solution provided by the embodiment of the present application brings at least the following beneficial effects: It can be seen that the present application deploys entangled quantum pairs on two service nodes that back up each other, performs quantum measurement on the quantum pairs, and then directly determines whether to perform active-standby switching in the next service cycle based on the measurement results, without the need for communication confirmation between the two service nodes, thus eliminating the chance of external detection and attack, and making the active-standby switching process safer. Since the quantum measurement results are random, the risk of external determination of the current active service node is reduced.

[0007] As a possible implementation manner, when the first service node is the primary service node in the Pth service cycle, the first service node determines whether to perform primary-backup switching in the P+1th service cycle based on the quantum measurement result, including: if the quantum measurement result satisfies the preset measurement result corresponding to the primary service node in the P+1th service cycle, the first service node determines not to perform primary-backup switching in the P+1th service cycle; or, if the quantum measurement result does not satisfy the preset measurement result corresponding to the primary service node in the P+1th service cycle, the first service node determines to perform primary-backup switching in the P+1th service cycle.

[0008] As a possible implementation method, after the first service node determines to perform active-standby switching within the P+1th service cycle, it includes: the first service node stops data service; the first service node copies data to the second service node; after the data copy is completed, the first service node changes its own identifier to the identifier corresponding to the standby service node.

[0009] As a possible implementation method, when the first service node is a backup service node in the Pth service cycle, the first service node determines whether to perform master-slave switching in the P+1th service cycle based on the quantum measurement result, including: if the quantum measurement result satisfies the preset measurement result corresponding to the primary service node in the P+1th service cycle, the first service node determines to perform master-slave switching in the P+1th service cycle; or, if the quantum measurement result does not satisfy the preset measurement result corresponding to the primary service node in the P+1th service cycle, the first service node determines not to perform master-slave switching in the P+1th service cycle.

[0010] As a possible implementation method, after the first service node determines to perform active-standby switching within the P+1th service cycle, it includes: the first service node copies data from the second service node; after the data copy is completed, the first service node changes its own identifier to the identifier corresponding to the active service node.

[0011] In a second aspect, a device for active / standby switching is provided, the device for active / standby switching comprising:

[0012] A selection module is used to select, within the Pth service cycle, the Mth group of entangled quantum pairs associated with the Pth service cycle from the N groups of entangled quantum pairs; wherein one quantum of each group of entangled quantum pairs is deployed at a first service node, and the other quantum is deployed at a second service node; one of the first service node and the second service node is a main service node, and the other service node is a backup service node, P, M, and N are all positive integers, and M is less than or equal to N;

[0013] A measurement module, used for performing quantum measurement according to the Mth group of entangled quantum pairs to obtain a quantum measurement result;

[0014] The judgment module is used to determine whether to perform active / standby switching within the P+1th service cycle according to the quantum measurement result.

[0015] As a possible implementation method, when the first service node is the primary service node in the Pth service cycle, the judgment module is specifically used to: if the quantum measurement result satisfies the preset measurement result corresponding to the primary service node in the P+1th service cycle, the judgment module determines that the primary-standby switching is not performed in the P+1th service cycle; or, if the quantum measurement result does not satisfy the preset measurement result corresponding to the primary service node in the P+1th service cycle, the judgment module determines that the primary-standby switching is performed in the P+1th service cycle.

[0016] As a possible implementation method, the above-mentioned device also includes: a first processing module, used to stop data service after the first service node determines to perform master-slave switching within the P+1th service cycle; copy the data to the second service node; after the data copy is completed, change its own identifier to the identifier corresponding to the backup service node.

[0017] As a possible implementation method, when the first service node is a backup service node in the Pth service cycle, the judgment module is also used to: if the quantum measurement result satisfies the preset measurement result corresponding to the main service node in the P+1th service cycle, the judgment module determines to perform the main-backup switching in the P+1th service cycle; or, if the quantum measurement result does not satisfy the preset measurement result corresponding to the main service node in the P+1th service cycle, the judgment module determines not to perform the main-backup switching in the P+1th service cycle.

[0018] As a possible implementation method, the above-mentioned device also includes: a second processing module, which is used to copy data from the second service node after the first service node determines to perform master-slave switching within the P+1th service cycle; after the data copy is completed, change its own identifier to the identifier corresponding to the master service node.

[0019] In a third aspect, a device for active-standby switching based on quantum entanglement is provided, comprising a processor, wherein when the processor executes a computer program, the method for active-standby switching based on quantum entanglement of the first aspect is implemented.

[0020] In a fourth aspect, a computer-readable storage medium is provided, which includes computer instructions; wherein, when the computer instructions are executed, the method for active-standby switching based on quantum entanglement of the first aspect is implemented.

[0021] The beneficial effects described in the second to fourth aspects of the present application can be referred to the beneficial effect analysis of the first aspect and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] The accompanying drawings are used to provide further understanding of the technical solution of the present application and constitute a part of the specification. Together with the embodiments of the present application, they are used to explain the technical solution of the present application and do not constitute a limitation on the technical solution of the present application.

[0023] Figure 1 A schematic diagram of a network architecture provided in an embodiment of the present application;

[0024] Figure 2 A schematic diagram of another networking architecture provided in an embodiment of the present application;

[0025] Figure 3 A flowchart of a method for active / standby switching based on quantum entanglement provided in an embodiment of the present application;

[0026] Figure 4 A complete flow chart of a method for active / standby switching based on quantum entanglement provided in an embodiment of the present application;

[0027] Figure 5 A schematic diagram of the structure of a device for active / standby switching based on quantum entanglement provided in an embodiment of the present application;

[0028] Figure 6 A schematic diagram of the structure of another device for active-standby switching based on quantum entanglement provided in an embodiment of the present application. DETAILED DESCRIPTION

[0029] The technical solutions of the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.

[0030] In the description of this application, unless otherwise specified, " / " means "or", for example, A / B can mean A or B. "And / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, "at least one" means one or more, and "multiple" means two or more. The words "first", "second", etc. do not limit the quantity and execution order, and the words "first", "second", etc. do not necessarily limit them to be different. It should be noted that in this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or explanations.

[0031] Any embodiment or design described in this application as "exemplary" or "for example" should not be construed as being preferred or advantageous over other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way. In an embodiment of the present application, "indication" may include direct indication and indirect indication. For example, taking the first control information below as an example, the first control information may directly carry information A itself or its index to achieve the purpose of directly indicating information A. Alternatively, the first control information may also carry information B that is associated with information A, thereby achieving the purpose of indirectly indicating information A while indicating information B.

[0032] The technical solution provided in the embodiment of the present application can be applied to a variety of network architectures, such as a direct connection network architecture, a cache network architecture, etc.

[0033] For example, Figure 1 A schematic diagram of a network architecture provided by an embodiment of the present application is shown in FIG. The architecture includes an application and multiple service nodes (such as the first service node and the second service node in the figure).

[0034] The application may communicate with the user equipment and send a service request to the service node according to the request of the user equipment.

[0035] The first service node and the second service node are connected in a direct connection mode. When data synchronization is performed, data can be directly copied to the service nodes that serve as backup for each other.

[0036] This networking architecture has high data synchronization efficiency, but during the data synchronization process, it is easy to be monitored by external parties, who can then determine that a master-slave switchover event is in progress, thereby looking for event windows to attack and eavesdrop on the system.

[0037] For example, Figure 2 A schematic diagram of another networking architecture provided by an embodiment of the present application is shown in FIG. The architecture includes a cache pool, an application, and multiple service nodes (such as the first service node and the second service node in the figure).

[0038] The cache pool is composed of multiple cache points. A cache point is a buffer for data exchange and a temporary place for storing data.

[0039] The first service node and the second service node are connected in a caching manner and are both connected to the cache pool. When synchronizing data, the service node that needs to copy data randomly selects a cache point from the cache pool and copies the data to be copied to the cache point. When the service nodes that back up each other copy data, they need to traverse all cache points in the cache pool, find the data to be copied, and then copy the data from the cache point.

[0040] This networking architecture avoids the external positioning of cache points during the master-slave switchover process through the cache pool mode, making it impossible for the outside to monitor the data synchronization process of the service node and determine the time window for attack or eavesdropping, but the efficiency of data synchronization is low.

[0041] It should be noted that Figure 1 and Figure 2 This is just an exemplary framework diagram. Figure 1 and Figure 2 The number of structures included in the Figure 1 and Figure 2 In addition to the structure shown, the networking architecture may also include other structures.

[0042] The application scenarios of the embodiments of the present application are not limited. The system architecture and business scenarios described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided by the embodiments of the present application. It is known to those skilled in the art that with the evolution of the network architecture and the emergence of new business scenarios, the technical solutions provided by the embodiments of the present application are also applicable to similar technical problems.

[0043] As described in the background art, current Internet systems often have a primary-backup switching mechanism, that is, multiple service nodes are deployed, and in certain specific situations, the primary service node and the backup service node are rotated.

[0044] At present, there are two triggering scenarios for active / standby switchover in various industries on the market:

[0045] The first situation is when the main service node has an abnormal condition, triggering the main and standby switching mechanism. When the main service node in the system cannot operate normally due to a fault or other reasons, other standby service nodes deployed in the system will become the main service nodes to maintain the normal operation of the system.

[0046] The second situation is that when both the main service node and the backup service node are normal, the main and backup switchover is performed periodically. When both the main service node and the backup service node are able to operate normally, the system will periodically perform the main and backup switchover in consideration of safety issues such as the long working time of the main service node and load balancing.

[0047] However, during the above-mentioned active / standby switching process, the active service node and the standby service node that back up each other need to communicate and confirm and transmit data, which provides a detection window for external detection and attack. In addition, in the above-mentioned periodic active / standby switching trigger mechanism, the switching cycle cannot be random, and it is easy for the outside to crack the switching pattern and then determine the active service node in the current cycle, thereby being attacked by the outside.

[0048] Based on this, the embodiment of the present application provides a method for active-standby switching, the idea of ​​which is that the first service node selects a group of entangled quantum pairs from N groups of entangled quantum pairs for quantum measurement, and determines whether to perform active-standby switching in the next cycle according to the quantum measurement results. This improves the security of the active-standby switching process, and because the quantum measurement results are random, the originally regular cycle is randomized, reducing the risk of the active service node of the current cycle being determined externally.

[0049] like Figure 3 As shown, the embodiment of the present application provides a method for active / standby switching based on quantum entanglement, the method comprising the following steps:

[0050] S301. The first service node selects, within a P-th service period, an M-th group of entangled quantum pairs associated with the P-th service period from N groups of entangled quantum pairs.

[0051] In some embodiments, the first service node and the second service node are backup service nodes for each other, and N groups of entangled quantum pairs are deployed on the first service node and the second service node; wherein a group of entangled quantum pairs includes two quanta, which are entangled with each other, one is deployed on the first service node, and the other is deployed on the second service node.

[0052] The entangled quantum pairs are deployed in sequence on the first service node and the second service node, and the entangled quantum pairs deployed for the first time are the first group of entangled quantum pairs.

[0053] As a possible implementation method, when the next service cycle arrives, the first service node selects the Mth group of entangled quantum pairs related to the Pth service cycle from the N groups of entangled quantum pairs to perform subsequent quantum measurement work.

[0054] For example, in the first service cycle, the entangled quantum pair selected by the first service node is the first group of N groups; in the next service cycle, the entangled quantum pair selected by the first service node is the second group of N groups, that is, the next group of entangled quantum pairs of the selected entangled quantum pairs.

[0055] The service period is the agreed period for active / standby switchover.

[0056] Optionally, the service period may be configured by system presets. Alternatively, the service period may be determined by the working conditions of the service nodes in the system. Alternatively, the service period may be configured by the user.

[0057] Optionally, the service cycle may be a cycle of uniform time, or a cycle of non-uniform time intervals.

[0058] Exemplarily, the service cycle may be a uniform time cycle, such as performing active / standby switching every 1 hour, and performing active / standby switching every 2 hours. Alternatively, the service cycle may be a cycle with uneven time intervals, such as 1, 3, 5, 7, 9, 11, and 13 hours as a group of cycles, which are used cyclically, i.e., performing active / standby switching every 1 hour for the first time, performing active / standby switching every 3 hours for the second time, performing active / standby switching every 5 hours for the third time, performing active / standby switching every 7 hours for the fourth time, performing active / standby switching every 9 hours for the fifth time, performing active / standby switching every 11 hours for the sixth time, performing active / standby switching every 13 hours for the seventh time, and then cyclically using the service cycle, performing active / standby switching every 1 hour for the eighth time, and so on.

[0059] S302. The first service node performs quantum measurement according to the selected Mth group of entangled quantum pairs to obtain a quantum measurement result.

[0060] In some embodiments, according to quantum entanglement theory, there are two results of quantum measurement. The quantum measurement result on the first service node and the quantum measurement result on the second service node are opposite polarization results, that is, the quantum measurement result on the first service node is one measurement result, and the quantum measurement result on the second service node is the other measurement result.

[0061] Exemplarily, a group of entangled quanta selected by the first service node are measured. After the collapse of the wave function, according to the quantum entanglement theory, it is assumed that the quantum measurement result on the first service node is →, and the quantum measurement result on the second service node is ↓. The above measurement results are opposite polarization results, and the probability of obtaining ↓ and → in the measurement results of the above two quanta is 50%.

[0062] S303: The first service node determines whether to perform active / standby switching within the P+1th service period according to the quantum measurement result.

[0063] In some embodiments, the first service node is the primary service node in the Pth service cycle. The quantum measurement result satisfies the preset measurement result corresponding to the primary service node in the P+1th service cycle, and the first service node determines not to perform the primary-standby switching in the P+1th service cycle.

[0064] Optionally, the preset measurement result may be configured by a system preset. Alternatively, the preset measurement result may also be determined by the working condition of the service node in the system. Alternatively, the preset measurement result may also be configured by a user.

[0065] Optionally, the preset measurement result may be a fixed value in each service cycle. Alternatively, the preset measurement result may be changed in each service cycle.

[0066] Exemplarily, the preset measurement result may be a fixed value in each service cycle, and in each service cycle, the service node where the quantum with a quantum measurement result of 0 is located is designated as the main service node for the next service cycle. The preset measurement result may be changed in each service cycle, and in this service cycle, the service node where the quantum with a quantum measurement result of 0 is located is designated as the main service node for the next service cycle, and in the next service cycle, the service node where the quantum with a quantum measurement result of 1 is located is designated as the main service node for the next service cycle.

[0067] Exemplarily, the first service node is the primary service node in the second service cycle. The measurement results of the quantum on the first service node and the quantum on the second service node are ↓ and → respectively. At this time, we define ↓=0, →=1, that is, the quantum measurement result on the first service node is 0, and the quantum measurement result on the second service node is 1. In this service cycle, the preset measurement result defines the service node where the quantum with a quantum measurement result of 0 is located as the primary service node of the third service cycle. Since the first service node is the primary service node in the second service cycle, and the quantum measurement result on the first service node is 0, which satisfies the preset measurement result, the first service node determines not to perform the primary-standby switching in the third service cycle.

[0068] In some embodiments, the first service node is the primary service node in the Pth service cycle. If the quantum measurement result does not meet the preset measurement result corresponding to the primary service node in the P+1th service cycle, the first service node determines to perform the primary-standby switching in the P+1th service cycle.

[0069] Exemplarily, the first service node is the primary service node in the second service cycle. The measurement results of the quantum on the first service node and the quantum on the second service node are ↓ and → respectively. At this time, we define ↓=0, →=1, that is, the quantum measurement result on the first service node is 0, and the quantum measurement result on the second service node is 1. In the second service cycle, the preset measurement result defines the service node where the quantum with the quantum measurement result of 1 is located as the primary service node of the third service cycle. Since the first service node is the primary service node in the second service cycle, and the quantum measurement result on the first service node is 0, which does not meet the preset measurement result, the first service node determines to perform the primary-standby switching in the third service cycle.

[0070] In some embodiments, the first service node is the primary service node within the Pth service cycle, and determines to perform primary-backup switching within the P+1th service cycle. The embodiment also includes: the first service node stops data service; the first service node copies data to the second service node; after the data copy is completed, the first service node changes its own identification to a backup service.

[0071] Exemplarily, in a cold standby scenario, the first service node and the second service node are directly connected. The first service node is the primary service node in the fifth service cycle, and determines to perform primary-standby switching within the sixth service cycle. The first service node stops service; the first service node copies data to the second service node; when the first service node completes data copying, the first service node changes the identifier of the primary service and changes its own identifier to the standby service; the second service node copies the above data; when the second service node completes copying the above data, the second service node changes the identifier of the standby service and changes its own identifier to the primary service; the second service node starts service.

[0072] As another example, in a cold standby scenario, the first service node and the second service node use a cache method. The first service node is the primary service node in the fifth service cycle, and determines to perform primary-standby switching within the sixth service. The first service node stops the service; the first service node randomly selects a cache point in the cache pool and copies the data to the cache point; when the first service node completes the data copy, the first service node changes the identifier of the primary service and changes its own identifier to the backup service; the second service node traverses the cache points in the cache pool; when the second service node finds the above cache point, it copies the above data from the cache point; when the second service node completes copying the above data, the second service node changes the identifier of the backup service and changes its own identifier to the primary service; the second service node starts the service.

[0073] Exemplarily, in a warm standby scenario, the first service node and the second service node are directly connected. The first service node is the primary service node in the fifth service cycle, and determines to perform primary-standby switching within the sixth service. The first service node stops the data write service and retains the data read service; the first service node copies the incremental data to the second service node; when the first service node completes the copy of the incremental data, the first service node changes the identifier of the primary service and changes its own identifier to the standby service; the second service node copies the above incremental data; when the second service node completes the copy of the above incremental data, the second service node changes the identifier of the standby service and changes its own identifier to the primary service; the second service node resumes the data write service.

[0074] As another example, in a warm standby scenario, the first service node and the second service node use a cache method. The first service node is the primary service node in the fifth service cycle, and determines to perform primary-standby switching within the sixth service. The first service node stops the data write service and retains the data read service; the first service node randomly selects a cache point in the cache pool and copies the incremental data to the cache point; when the first service node completes the data copy, the first service node changes the identifier of the primary service and changes its own identifier to the standby service; the second service node traverses the cache points in the cache pool; when the second service node finds the above cache point, it copies the above incremental data from the cache point; when the second service node completes copying the above data, the second service node changes the identifier of the standby service and changes its own identifier to the primary service; the second service node resumes the data write service.

[0075] Exemplarily, in a hot standby scenario, the first service node is the primary service node in the fifth service cycle, and determines to perform a primary-standby switchover in the sixth service cycle. The first service node and the second service node do not need to perform data synchronization, that is, the first service node does not need to copy data or incremental data to the second service node; and there is no need to stop and restart the service or data write service, and the primary-standby switchover is performed directly. The first service node changes the identifier of the primary service and changes its own identifier to the standby service; the second service node changes the identifier of the standby service and changes its own identifier to the primary service.

[0076] In some embodiments, the first service node is a backup service node in the Pth service cycle. If the quantum measurement result does not meet the preset measurement result corresponding to the primary service node in the P+1th service cycle, the first service node determines not to perform the primary-backup switching in the next service cycle.

[0077] In another exemplary embodiment, the first service node is a backup service node in the second service cycle. The measurement results of the quantum on the first service node and the quantum on the second service node are ↓ and → respectively. At this time, we define ↓=0, →=1, that is, the quantum measurement result on the first service node is 0, and the quantum measurement result on the second service node is 1. In this service cycle, the preset measurement result defines the service node where the quantum with a quantum measurement result of 1 is located as the main service node of the third service cycle. Since the first service node is a backup service node in the second service cycle, and the quantum measurement result on the first service node is 0, which does not meet the preset measurement result, the first service node determines not to perform the main-backup switching in the third service cycle.

[0078] In some embodiments, the first service node is a backup service node in the second service cycle. The quantum measurement result satisfies the preset measurement result corresponding to the primary service node in the third service cycle, and the first service node determines to perform the primary-backup switching in the third service cycle.

[0079] Exemplarily, the first service node is a backup service node in the second service cycle. The measurement results of the quantum on the first service node and the quantum on the second service node are ↓ and → respectively. At this time, we define ↓=0, →=1, that is, the quantum measurement result on the first service node is 0, and the quantum measurement result on the second service node is 1. In the second service cycle, the preset measurement result defines the service node where the quantum with a quantum measurement result of 0 is located as the main service node of the third service cycle. Since the first service node is a backup service node in the second service cycle, and the quantum measurement result on the first service node is 0, which meets the preset measurement result, the first service node determines to perform the main-backup switching in the third service cycle.

[0080] In some embodiments, the first service node is a backup service node in the Pth service cycle, and it is determined to perform active-standby switching within P+1 service cycles. The embodiment also includes: the first service node stops data service; the first service node copies data to the second service node; after the data copy is completed, the first service node changes its own identification to a backup service.

[0081] Exemplarily, in a cold standby scenario, the first service node and the second service node are directly connected. The first service node is a standby service node in the third service cycle, and determines to perform a master-slave switch in the fourth service. The second service node stops the service; the second service node copies the data to the first service node; when the second service node completes the data copy, the second service node changes the identifier of the primary service and changes its own identifier to the standby service; the first service node copies the above data; when the first service node completes the copy of the above data, the first service node changes the identifier of the standby service and changes its own identifier to the primary service; the first service node starts the service.

[0082] In another exemplary embodiment, in a cold standby scenario, the first service node and the second service node adopt a caching method. The first service node is a standby service node in the third service cycle, and determines to perform a master-slave switch in the fourth service cycle. The second service node stops the service; the second service node randomly selects a cache point in the cache pool and copies the data to the cache point; when the second service node completes the data copy, the second service node changes the identifier of the primary service and changes its own identifier to the standby service; the first service node traverses the cache points in the cache pool; when the first service node finds the above cache point, it copies the above data from the cache point; when the first service node completes copying the above data, the first service node changes the identifier of the standby service and changes its own identifier to the primary service; the first service node starts the service.

[0083] Exemplarily, in a warm standby scenario, the first service node and the second service node are directly connected. The first service node is a standby service node in the third service cycle, and determines to perform a master-slave switch in the fourth service. The second service node stops the data write service and retains the data read service; the second service node copies the incremental data to the first service node; when the second service node completes the copy of the incremental data, the second service node changes the identifier of the primary service and changes its own identifier to the standby service; the first service node copies the above incremental data; when the first service node completes the copy of the above incremental data, the first service node changes the identifier of the standby service and changes its own identifier to the primary service; the first service node resumes the data write service.

[0084] Another exemplary embodiment, in a warm standby scenario, the first service node and the second service node adopt a cache method. The first service node is the primary service node in the third service cycle, and determines to perform primary-standby switching in the fourth service. The second service node stops the data write service and retains the data read service; the second service node randomly selects a cache point in the cache pool and copies the incremental data to the cache point; when the second service node completes the data copy, the second service node changes the identifier of the primary service and changes its own identifier to the backup service; the first service node traverses the cache points in the cache pool; when the first service node finds the above cache point, it copies the above incremental data from the cache point; when the first service node completes copying the above data, the first service node changes the identifier of the backup service and changes its own identifier to the primary service; the first service node resumes the data write service.

[0085] Exemplarily, in a hot standby scenario, the first service node is the primary service node in the third service cycle, and determines to perform a primary-standby switch in the fourth service cycle. The first service node and the second service node do not need to perform data synchronization, that is, the second service node does not need to copy data or incremental data to the second service node; and there is no need to stop and restart the service or data write service, and the primary-standby switch is performed directly. The second service node changes the identifier of the primary service and changes its own identifier to the standby service; the first service node changes the identifier of the standby service and changes its own identifier to the primary service.

[0086] The embodiment of the present application is also applicable to cluster active-standby switching scenarios.

[0087] In some embodiments, when a service cluster performs active / standby switching, the service cluster has K service nodes, 2 / K of the nodes are selected as initial first service nodes, and another 2 / K of the nodes are selected as initial second service nodes.

[0088] The technical solution provided by the embodiment of the present application brings at least the following beneficial effects: It can be seen that the present application deploys entangled quantum pairs on two service nodes that back up each other, performs quantum measurement on the quantum pairs, and then directly determines whether to perform active-standby switching in the next service cycle based on the measurement results, without the need for communication confirmation between the two service nodes, thus eliminating the chance of external detection and attack, and making the active-standby switching process safer. Since the quantum measurement results are random, the risk of external determination of the current active service node is reduced.

[0089] In some embodiments, Figure 4 As shown, the embodiment of the present application provides a method for active / standby switching based on quantum entanglement, the method comprising the following steps:

[0090] S401. The first service node selects an entangled quantum pair.

[0091] S402: The first service node performs quantum measurement on the selected entangled quantum pair.

[0092] S403: Whether the first service node is the primary service node in the Pth service period.

[0093] If the first service node is the primary service node in the Pth service period, S404 is executed.

[0094] If the first service node is the primary service node in the Pth service period, S409 is executed.

[0095] S404: Whether the quantum measurement result satisfies the main service node corresponding to the P+1th service period.

[0096] If the quantum measurement result satisfies the main service node corresponding to the P+1th service period, S405 is executed.

[0097] If the quantum measurement result satisfies the main service node corresponding to the P+1th service period, S406 is executed.

[0098] S405: Do not perform active / standby switching.

[0099] S406: The first service node stops data service.

[0100] In some embodiments, during the process of performing active-standby switching in a cold standby scenario, the first service node stops serving.

[0101] In some embodiments, during the process of performing active-standby switching in a warm standby scenario, the first service node stops the data writing service and retains the data reading service.

[0102] In some embodiments, during the active / standby switchover in a hot standby scenario, the first service node does not need to stop service.

[0103] S407: The first service node copies the data to the second service node.

[0104] In some embodiments, in a cold standby scenario, the first service node and the second service node are connected in a direct connection manner, and the first service node directly copies data to the second service node.

[0105] In some embodiments, in a cold standby scenario, the first service node and the second service node are connected in a cache manner, and the first service node randomly selects a cache point in the cache pool and copies the data to the cache point.

[0106] In some embodiments, in a warm standby scenario, the first service node and the second service node are connected in a direct connection manner, and the first service node directly copies the incremental data to the second service node.

[0107] In some embodiments, in a cold standby scenario, the first service node and the second service node are connected in a cache manner, and the first service node randomly selects a cache point in the cache pool and copies the incremental data to the cache point.

[0108] In some embodiments, in a hot standby scenario, the first service node and the second service node do not need to copy data.

[0109] S408: The first service node changes its own identifier to an identifier corresponding to the standby service node.

[0110] After the first service node completes the identification change, S412 is executed.

[0111] S409: Whether the quantum measurement result satisfies the main service node corresponding to the next service cycle.

[0112] If the quantum measurement result does not satisfy the primary service node corresponding to the next service period, S405 is executed.

[0113] If the quantum measurement result satisfies the primary service node corresponding to the next service period, S410 is executed.

[0114] S410: The first service node copies data from the second service node.

[0115] In some embodiments, in a cold standby scenario, the first service node and the second service node are connected in a direct connection manner, and the first service node directly copies data from the second service node.

[0116] In some embodiments, in a cold standby scenario, the first service node and the second service node are connected in a cache manner, the first service node traverses the cache points in the cache pool, finds the cache point where the data to be copied is located, and copies the data from the cache point.

[0117] In some embodiments, in a warm standby scenario, the first service node and the second service node are connected in a direct connection manner, and the first service node copies incremental data from the second service node.

[0118] In some embodiments, in a warm standby scenario, the first service node and the second service node are connected in a caching manner. The first service node traverses the cache points in the cache pool, finds the cache point where the incremental data to be copied is located, and copies the incremental data from the cache point.

[0119] S411: The first service node changes its own identifier to an identifier corresponding to the primary service node.

[0120] After the first service node completes the identification change, S412 is executed.

[0121] S412: Complete the active / standby switchover.

[0122] The above mainly introduces the solution provided by the embodiment of the present application from the perspective of the method. In order to realize the above functions, it includes hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of each example described in the embodiment disclosed herein, the embodiment of the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present application.

[0123] The embodiment of the present application can divide the functional modules of the communication device according to the above method example. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module. The above integrated module can be implemented in the form of hardware or in the form of software functional modules. Optionally, the division of modules in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation.

[0124] Figure 5 A schematic diagram of the structure of a device for active / standby switching based on quantum entanglement provided in an embodiment of the present application is shown in FIG. Figure 5 As shown, the device includes: a selection module 501, a measurement module 502, a judgment module 503, a first processing module 504 and a second processing module 505.

[0125] The selection module 501 is used to select the Mth group of entangled quantum pairs related to the Pth service period from the N groups of entangled quantum pairs during the Pth service period.

[0126] The measurement module 502 is used to perform quantum measurement based on the Mth group of entangled quantum pairs to obtain a quantum measurement result.

[0127] The judgment module 503 is used to determine whether to perform active / standby switching within the P+1th service cycle according to the quantum measurement result.

[0128] In some embodiments, when the first service node is the primary service node in the Pth service cycle, if the quantum measurement result satisfies the preset measurement result corresponding to the primary service node in the P+1th service cycle, the judgment module 503 is used to determine not to perform the primary-standby switching in the next service cycle; or, if the quantum measurement result does not satisfy the preset measurement result corresponding to the primary service node in the P+1th service cycle, the judgment module 503 is used to determine to perform the primary-standby switching in the next service cycle.

[0129] In some embodiments, the above-mentioned device also includes: a first processing module, used to stop data service after the first service node determines to perform master-slave switching within the P+1th service cycle; copy the data to the second service node; after the data copy is completed, change its own identifier to the identifier corresponding to the backup service node.

[0130] In some embodiments, when the first service node is a backup service node in the Pth service cycle, if the quantum measurement result satisfies the preset measurement result corresponding to the primary service node in the P+1th service cycle, the judgment module 503 is used to determine whether to perform the primary-backup switching in the next service cycle; or, if the quantum measurement result does not satisfy the preset measurement result corresponding to the primary service node in the P+1th service cycle, the judgment module 503 is used to determine not to perform the primary-backup switching in the next service cycle.

[0131] In some embodiments, the above-mentioned device also includes: a second processing module 505, which is used to copy data from the second service node after the judgment module 503 determines that the primary and standby switching is performed within the P+1th service cycle; after the data copy is completed, change its own identifier to the identifier corresponding to the primary service node.

[0132] In the case of implementing the functions of the above-mentioned integrated modules in the form of hardware, the embodiment of the present application provides another possible structure of the device for active / standby switching based on quantum entanglement involved in the above-mentioned embodiment. Figure 6As shown, the active / standby switching device 60 includes: a processor 602 and a bus 604. Optionally, the active / standby switching device based on quantum entanglement may further include a memory 601; optionally, the active / standby switching device may further include a communication interface 603.

[0133] The processor 602 may be a processor that implements or executes various exemplary logic blocks, modules, and circuits described in conjunction with the embodiments of the present application. The processor 602 may be a central processing unit, a general-purpose processor, a digital signal processor, an application-specific integrated circuit, a field programmable gate array, or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It may implement or execute various exemplary logic blocks, modules, and circuits described in conjunction with the embodiments of the present application. The processor 602 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and the like.

[0134] The communication interface 603 is used to connect with other devices via a communication network, such as Ethernet, wireless access network, wireless local area network (WLAN), etc.

[0135] The memory 601 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 disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program codes in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto.

[0136] As a possible implementation, the memory 601 may exist independently of the processor 602, and the memory 601 may be connected to the processor 602 via a bus 604 for storing instructions or program codes. When the processor 602 calls and executes the instructions or program codes stored in the memory 601, a method for active-standby switching based on quantum entanglement provided in an embodiment of the present application can be implemented.

[0137] In another possible implementation, the memory 601 may also be integrated with the processor 602 .

[0138] The bus 604 may be an extended industry standard architecture (EISA) bus, etc. The bus 604 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 6 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0139] An embodiment of the present application also provides a computer-readable storage medium, which includes computer-executable instructions. When the computer-executable instructions are executed on a computer, the computer executes the method provided in the above embodiment.

[0140] The embodiment of the present application also provides a computer program product, which can be directly loaded into a memory and contains software code. After being loaded and executed by a computer, the computer program product can implement the method provided in the above embodiment.

[0141] Those skilled in the art should be aware that in one or more of the above examples, the functions described in this application can be implemented with hardware, software, firmware, or any combination thereof. When implemented using software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium. Computer-readable media include computer storage media and communication media, wherein the communication medium includes any medium that facilitates the transmission of a computer program from one place to another. The storage medium can be any available medium that can be accessed by a general or special-purpose computer. Through the description of the above implementation mode, it can be clearly understood by those skilled in the art that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned function allocation can be completed by different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above.

[0142] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A method for master-slave switching based on quantum entanglement, It is characterized in that The method comprises: The first service node selects, in the Pth service cycle, the Mth group of entangled quantum pairs associated with the Pth service cycle from the N groups of entangled quantum pairs; wherein one quantum of each group of entangled quantum pairs is deployed at the first service node, and the other quantum is deployed at the second service node; one of the first service node and the second service node is a primary service node, and the other service node is a backup service node, P, M, and N are all positive integers, and M is less than or equal to N; The first service node performs quantum measurement according to the Mth group of entangled quantum pairs to obtain a quantum measurement result; In the case where the first service node is the primary service node in the Pth service period, if the quantum measurement result satisfies the preset measurement result corresponding to the primary service node in the P+1th service period, the first service node determines not to perform the primary-standby switching in the P+1th service period; or, If the quantum measurement result does not satisfy the preset measurement result corresponding to the primary service node in the P+1th service period, the first service node determines to perform primary-standby switching in the P+1th service period.

2. The method according to claim 1, It is characterized in that After the first service node determines to perform active / standby switching within the P+1th service period, the method further includes: The first service node stops data service; The first service node copies the data to the second service node; After the data copy is completed, the first service node changes its own identifier to the identifier corresponding to the standby service node.

3. The method according to claim 1, It is characterized in that In a case where the first service node is a backup service node in the Pth service period, the first service node determines, according to the quantum measurement result, whether to perform a primary-backup switching in the P+1th service period, including: If the quantum measurement result satisfies the preset measurement result corresponding to the primary service node in the P+1th service period, the first service node determines to perform the primary-standby switching in the P+1th service period; or, If the quantum measurement result does not satisfy the preset measurement result corresponding to the primary service node in the P+1th service period, the first service node determines not to perform primary-standby switching in the P+1th service period.

4. The method according to claim 3, It is characterized in that After the first service node determines to perform active / standby switching within the P+1th service period, the method further includes: The first service node copies data from the second service node; After the data copying is completed, the first service node changes its own identifier to the identifier corresponding to the primary service node.

5. A device for master-slave switching based on quantum entanglement, It is characterized in that The device comprises: A selection module, in a P-th service cycle, selects an M-th group of entangled quantum pairs related to the P-th service cycle from N groups of entangled quantum pairs; wherein one quantum of each group of entangled quantum pairs is deployed at the first service node, and the other quantum is deployed at the second service node; one of the first service node and the second service node is a main service node, and the other service node is a backup service node, P, M, and N are all positive integers, and M is less than or equal to N; a measurement module, used to perform quantum measurement according to the M-th group of entangled quantum pairs to obtain a quantum measurement result; When the first service node is a primary service node in the Pth service period, the judging module is configured to: If the quantum measurement result satisfies the preset measurement result corresponding to the primary service node in the P+1th service period, the judgment module determines not to perform the primary-standby switching in the P+1th service period; or, If the quantum measurement result does not satisfy the preset measurement result corresponding to the primary service node in the P+1th service period, the judgment module determines to perform the primary-standby switching in the P+1th service period.

6. The device according to claim 5, It is characterized in that The device also includes: A first processing module, configured to stop data service after the first service node determines to perform active / standby switching within the P+1th service period; Copying the data to the second service node; After the data copy is completed, its own identifier is changed to the identifier corresponding to the standby service node.

7. The device according to claim 5, It is characterized in that In the case where the first service node is a standby service node in the Pth service period, the judging module is further configured to: If the quantum measurement result satisfies the preset measurement result corresponding to the primary service node in the P+1th service period, the judgment module determines to perform the primary-standby switching in the P+1th service period; or, If the quantum measurement result does not satisfy the preset measurement result corresponding to the primary service node in the P+1th service period, the judgment module determines not to perform the primary-standby switching in the P+1th service period.

8. The device according to claim 7, It is characterized in that The device also includes: A second processing module, configured to copy data from the second service node after the first service node determines to perform active / standby switching within the P+1th service period; After the data copy is completed, its own identifier is changed to the identifier corresponding to the primary service node.

9. A device for master-slave switching based on quantum entanglement, It is characterized in that It comprises a processor, which implements the method for active-standby switching based on quantum entanglement as claimed in any one of claims 1 to 4 when executing a computer program.

10. A computer-readable storage medium, It is characterized in that The computer-readable storage medium includes computer instructions; wherein, when the computer instructions are executed, the method for active-standby switching based on quantum entanglement as described in any one of claims 1 to 4 is implemented.