Computer room switching method, device, equipment and storage medium
By obtaining the network status changes and pre-configured information of the computer room, service switching between computer rooms is realized, which solves the problem of poor versatility of existing computer room switching tools and improves the efficiency and reliability of switching.
Patent Information
- Application Number
- CN202110004925.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-01-04
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2041-01-04
AI Technical Summary
The poor versatility of existing cutting machine room tools causes enterprises to need to re-develop when switching, resulting in inconvenience and low efficiency.
By obtaining the network status changes of the computer room, the switching type is determined, and based on the pre-configured computer room switching information, the business interface information and interface alias information are queried to realize service switching between computer rooms, and the cache retry queue is used to ensure the reliability of the switching.
It improves the versatility and application scope of computer room switching tools, enables seamless switching between computer rooms of different enterprises, reduces the complexity of development and deployment, and improves the efficiency and reliability of switching.
Smart Images

Figure CN113765689B
Abstract
Description
Technical Field
[0001] The present application relates to the field of Internet technology, and in particular to a computer room switching method, device, equipment and storage medium. Background Art
[0002] With the rise and continuous development of science and technology, computer rooms that provide services to different objects such as enterprises have gradually emerged. Each enterprise will set up computer rooms in different locations to provide services in different places.
[0003] At present, each enterprise has its own one-click switching tool for switching computer rooms. When a computer room in one place fails, the one-click switching tool can be used to switch the business of the failed computer room to a computer room set up elsewhere to provide normal services.
[0004] In the process of implementing the present invention, the inventors found that there are at least the following problems in the prior art: some enterprises may not have their own one-click computer room switching tools, and they need to use the one-click computer room switching tools of other enterprises. However, since different enterprises handle different businesses, the underlying components relied on for developing the one-click computer room switching tools are also different. Therefore, when an enterprise wants to use the one-click computer room switching tools developed by other enterprises, it needs to be redeveloped, resulting in poor versatility of the one-click computer room switching tools. Summary of the invention
[0005] The present application provides a machine room switching method, device, equipment and storage medium, which are used to solve the problem of poor versatility of existing machine room switching tools.
[0006] In a first aspect, an embodiment of the present application provides a computer room switching method, including:
[0007] Determining a computer room switching type according to the acquired network status change of the first computer room, where the first computer room is a designated service computer room of the target object;
[0008] According to the identifier of the target object, query the pre-configured computer room switching information to determine the service interface information, interface alias information of the first computer room and the second computer room associated with the first computer room, where the second computer room is any one of at least one candidate service computer room of the target object;
[0009] The target service computer room of the target object is switched between the first computer room and the second computer room according to the computer room switching type, the service interface information and the interface alias information.
[0010] In a possible design of the first aspect, switching the target service computer room of the target object between the first computer room and the second computer room according to the computer room switching type, the service interface information, and the interface alias information includes:
[0011] When the computer room switching type is to cut out the first computer room, according to the service interface information and interface alias information of the first computer room, the services processed by the first computer room are sequentially transferred to the second computer room for processing;
[0012] When all the services processed by the first computer room are transferred to the second computer room for processing, the service equipment of the first computer room is taken offline;
[0013] When it is determined that all service devices in the first computer room are in an offline state, it is determined that the first computer room is successfully cut out.
[0014] In this possible design, the method further includes:
[0015] If part of the services processed by the first computer room is not successfully transferred to the second computer room for processing, all the services that are not successfully transferred are put into the service cache retry queue for retry until all the services processed by the first computer room are successfully transferred to the second computer room for processing; and / or
[0016] If some of the service devices in the first computer room fail to go offline successfully, all the service devices that fail to go offline successfully are put into the service cache retry queue for retry until all the service devices in the first computer room are successfully offline.
[0017] In another possible design of the first aspect, switching the target service computer room of the target object between the first computer room and the second computer room according to the computer room switching type, the service interface information, and the interface alias information includes:
[0018] When the switching type of the computer room is switching back to the first computer room, according to the service interface information and interface alias information of the first computer room, the service equipment of the first computer room is put online in sequence;
[0019] When all service devices in the first computer room are online, the services that the first computer room has mounted to the second computer room for processing are sequentially transferred back to the first computer room for processing;
[0020] When it is determined that all the services mounted by the first computer room to the second computer room for processing are transferred back to the first computer room for processing, it is determined that the switching back to the first computer room is successful.
[0021] In this possible design, the method further includes:
[0022] If there are service devices in the first computer room that have not been successfully online, all service devices that have not been successfully online are placed in a service cache retry queue for retries until all service devices in the first computer room are successfully online; and / or
[0023] If part of the business mounted to the second computer room by the first computer room for processing is not successfully transferred back to the first computer room for processing, all the businesses that have not been successfully transferred back will be placed in the business cache retry queue for retry until all the businesses mounted to the second computer room for processing are successfully transferred back to the first computer room for processing.
[0024] In another possible design of the first aspect, before determining the type of computer room switching according to the acquired network status change of the first computer room, the method further includes:
[0025] Acquire a computer room configuration request triggered by the outside world, wherein the computer room configuration request includes: business interface information, interface alias information and service computer room information of a target object;
[0026] Determine the business interface information corresponding to each service room and the interface alias information corresponding to each service room according to the business interface information, the interface alias information and the service room information;
[0027] Acquire a gateway interface permission request triggered by an external environment, wherein the gateway interface permission request includes: an application identifier of the target object;
[0028] According to the application identifier of the target object, opening and storing the gateway interface operation authority required by the application corresponding to the application identifier;
[0029] The pre-configured computer room switching information includes: business interface information corresponding to each service computer room, interface alias information corresponding to each service computer room, and gateway interface operation authority required by the application corresponding to the application identifier.
[0030] In another possible design of the first aspect, before switching the target service computer room of the target object between the first computer room and the second computer room according to the computer room switching type, the service interface information, and the interface alias information, the method further includes:
[0031] It is determined that the target service room meets a cut-in condition, where the cut-in condition includes: all service devices of the target service room are online, and a load of the target service room is less than a load threshold.
[0032] In another possible design of the first aspect, determining the type of computer room switching according to the acquired network status change of the first computer room includes:
[0033] When the network of the first computer room changes from a normal state to a fault state, determining that the computer room switching type is to cut out of the first computer room;
[0034] When the network of the first computer room recovers from a fault state to a normal state, it is determined that the computer room switching type is to switch back to the first computer room.
[0035] In a second aspect, an embodiment of the present application provides a computer room switching device, including: a first determination module, a second determination module and a processing module;
[0036] The first determination module is used to determine the type of computer room switching according to the acquired network status change of the first computer room, where the first computer room is a designated service computer room of the target object;
[0037] The second determination module is used to query the pre-configured computer room switching information according to the identifier of the target object, determine the service interface information, interface alias information of the first computer room and the second computer room associated with the first computer room, wherein the second computer room is any one of the at least one candidate service computer room of the target object;
[0038] The processing module is used to switch the target service room of the target object between the first room and the second room according to the room switching type, the service interface information and the interface alias information.
[0039] In a possible design of the second aspect, the processing module is specifically configured to:
[0040] When the computer room switching type is to cut out the first computer room, according to the service interface information and interface alias information of the first computer room, the services processed by the first computer room are sequentially transferred to the second computer room for processing;
[0041] When all the services processed by the first computer room are transferred to the second computer room for processing, the service equipment of the first computer room is taken offline;
[0042] When it is determined that all service devices in the first computer room are in an offline state, it is determined that the first computer room is successfully cut out.
[0043] In this possible design, the processing module is further used for:
[0044] When part of the services processed by the first computer room is not successfully transferred to the second computer room for processing, all the services that have not been successfully transferred are put into the service cache retry queue for retry until all the services processed by the first computer room are successfully transferred to the second computer room for processing; and / or
[0045] When some of the service devices in the first computer room fail to go offline successfully, all the service devices that fail to go offline successfully are put into a service cache retry queue for retrying until all the service devices in the first computer room go offline successfully.
[0046] In another possible design of the second aspect, the processing module is specifically configured to:
[0047] When the switching type of the computer room is switching back to the first computer room, according to the service interface information and interface alias information of the first computer room, the service equipment of the first computer room is put online in sequence;
[0048] When all service devices in the first computer room are online, the services that the first computer room has mounted to the second computer room for processing are sequentially transferred back to the first computer room for processing;
[0049] When it is determined that all the services mounted by the first computer room to the second computer room for processing are transferred back to the first computer room for processing, it is determined that the switching back to the first computer room is successful.
[0050] In this possible design, the processing module is further used for:
[0051] When there are service devices that have not been successfully online in the first computer room, all service devices that have not been successfully online are placed in a service cache retry queue for retrying until all service devices in the first computer room are successfully online; and / or
[0052] When some of the businesses mounted to the second computer room for processing by the first computer room are not successfully transferred back to the first computer room for processing, all the businesses that have not been successfully transferred back will be placed in the business cache retry queue for retry until all the businesses mounted to the second computer room for processing are successfully transferred back to the first computer room for processing.
[0053] In another possible design of the second aspect, the switching room device further includes: an acquisition module;
[0054] The acquisition module is used to acquire an externally triggered computer room configuration request before the first determination module determines the computer room switching type according to the acquired network status change of the first computer room, wherein the computer room configuration request includes: service interface information, interface alias information and service computer room information of the target object;
[0055] The first determination module is further used to determine the business interface information corresponding to each service room and the interface alias information corresponding to each service room according to the business interface information, the interface alias information and the service room information;
[0056] The acquisition module is further used to acquire a gateway interface permission request triggered by the outside world, wherein the gateway interface permission request includes: an application identifier of the target object;
[0057] The first determination module is further used to enable and store the gateway interface operation authority required by the application corresponding to the application identifier according to the application identifier of the target object;
[0058] The pre-configured computer room switching information includes: business interface information corresponding to each service computer room, interface alias information corresponding to each service computer room, and gateway interface operation authority required by the application corresponding to the application identifier.
[0059] In another possible design of the second aspect, the second determination module is further used to determine that the target service computer room meets the cut-in condition before switching the target service computer room of the target object between the first computer room and the second computer room according to the computer room switching type, the service interface information and the interface alias information, wherein the cut-in condition includes: all service equipment of the target service computer room is online and the load of the target service computer room is less than a load threshold.
[0060] In yet another possible design of the second aspect, the first determining module is specifically configured to:
[0061] When the network of the first computer room changes from a normal state to a fault state, determining that the computer room switching type is to cut out of the first computer room;
[0062] When the network of the first computer room recovers from a fault state to a normal state, it is determined that the computer room switching type is to switch back to the first computer room.
[0063] In a third aspect, the present application provides an electronic device, including: a processor, a memory, a display, and a system bus;
[0064] The memory stores computer-executable instructions;
[0065] When the processor executes the computer program instructions, the method provided in the first aspect and various possible designs is implemented.
[0066] In a fourth aspect, the present application provides a computer-readable storage medium, in which computer program instructions are stored. When the computer program instructions are executed by a processor, they are used to implement the methods provided in the first aspect and various possible designs.
[0067] In a fifth aspect, the present application provides a computer program product, comprising: program instructions, wherein the program instructions are used to implement the methods provided in the first aspect and various possible designs.
[0068] The computer room switching method, device, equipment and storage medium provided in the embodiment of the present application determine the computer room switching type by obtaining the network status change of the first computer room, and then query the pre-configured computer room switching information according to the identification of the target object, determine the service interface information, interface alias information of the first computer room and the second computer room associated with the first computer room, and finally switch the target service computer room of the target object between the first computer room and the second computer room according to the computer room switching type, service interface information and interface alias information. This technical solution can determine the service interface information and interface alias information of the computer room that needs to be changed according to the preset computer room switching information, so that the service computer room of the target object can be changed between different computer rooms, which improves the versatility and application scope of the method. BRIEF DESCRIPTION OF THE DRAWINGS
[0069] Figure 1 A schematic diagram of an application of the computer room switching method provided in an embodiment of the present application;
[0070] Figure 2 A flowchart of Embodiment 1 of the computer room switching method provided in the embodiment of the present application;
[0071] Figure 3 A flowchart of Embodiment 2 of the computer room switching method provided in the embodiment of the present application;
[0072] Figure 4 A flowchart of Embodiment 3 of the computer room switching method provided in the embodiment of the present application;
[0073] Figure 5 A flowchart of Embodiment 4 of the computer room switching method provided in the embodiment of the present application;
[0074] Figure 6 An overall flow chart of the computer room switching method provided in an embodiment of the present application;
[0075] Figure 7 A schematic diagram of the structure of a switching room device provided in an embodiment of the present application;
[0076] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0077] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in 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 part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0078] Before introducing the embodiments of the present application, the background technology of the present application is first explained.
[0079] A disaster recovery system refers to at least two Internet Technology (IT) systems with the same functions established in remote locations. These at least two IT systems can monitor health status and switch functions. When one of the IT systems stops working due to an unexpected situation (such as fire, earthquake, etc.), the business processed by the IT system can be switched to another IT system, so that the business processed by the IT system can continue to operate normally.
[0080] The switching between various IT systems is mainly achieved through disaster recovery tools, that is, one-click switching tools. Currently, many companies or enterprises have similar tools. However, since the business types handled by each company or enterprise are different, the one-click switching tools designed for each object are also different and not universal. If an object wants to use the one-click switching tool designed by another object, it will inevitably have to do a lot of code rewriting work, and smooth migration cannot be achieved.
[0081] In addition, since different one-click machine room switching tools rely on different underlying components, if an object wants to use the one-click machine room switching tool of another object, it will inevitably face problems such as the migration, deployment, and use of underlying components, which is very inconvenient. Therefore, there is an urgent need for a universal specification to guide the design of one-click machine room switching tools, so that different objects can use the same one-click machine room switching tool by reserving switching interfaces for the use of different objects.
[0082] Furthermore, most of the current one-click data center switching tools only support one-click switching away traffic (business handled by the data center) or one-click switching back traffic, and usually cannot support one-click switching away traffic and one-click switching back traffic at the same time.
[0083] Based on the problems existing in the above-mentioned prior art, the technical conception process of the technical solution of the present application is as follows: the inventor found that when the target object needs to use the one-click computer room switching tool, the computer room configuration information of the target object can be stored in the registration center of the one-click computer room switching tool. The computer room configuration information may include business interface information, interface alias information and service computer room information, and a gateway interface can be applied for the use of each computer room. In this way, when it is needed in the future, the registration center can be queried to obtain multiple different service computer rooms of the target object, thereby realizing switching between different computer rooms. Since different target objects can realize switching between computer rooms by configuring the computer room information in the registration center, the versatility and application scope of the one-click computer room switching tool are improved.
[0084] Based on the above technical concept, the present application provides a method for switching computer rooms, which determines the computer room switching type according to the obtained network status change of the first computer room, the first computer room is the designated service computer room of the target object, and then queries the pre-configured computer room switching information according to the identification of the target object, determines the service interface information, interface alias information of the first computer room and the second computer room associated with the first computer room, the second computer room is any one of at least one alternative service computer room of the target object, and finally switches the target service computer room of the target object between the first computer room and the second computer room according to the computer room switching type, service interface information and interface alias information. In this technical solution, according to the preset computer room switching information, the service interface information and interface alias information of the computer room that needs to be changed can be determined, so that the service computer room of the target object can be changed between different computer rooms. The method has high versatility and a wide range of applications.
[0085] For example, Figure 1 The application diagram of the computer room switching method provided in the embodiment of the present application is explained by the computer room switching information displayed on the interactive interface of the electronic device.
[0086] In practical applications, such as Figure 1 As shown, the computer room switching information of the target object may include: "select application", "select computer room", and "retry cache".
[0087] Among them, if the user clicks "Select Application", the status information of multiple computer rooms will be displayed on the interactive interface. For example, "1# Computer Room" and "2# Computer Room" will be displayed on the interactive interface. There is no limit on the number of computer rooms here.
[0088] In one implementation, when a network problem occurs in "Computer Room #1", in order not to affect the services that "Computer Room #1" can provide, it is necessary to switch the business processed by "Computer Room #1" to any one of the alternative service rooms for processing. For example, it can be switched to "Computer Room #2" which is displayed as online on the interactive interface.
[0089] Optionally, the buttons on the right side of "Data Center 1#" and "Data Center 2#" can be switch buttons. If you click the button on the right side of "Data Center 1#", the service provided by "Data Center 1#" will automatically switch to "Data Center 2#". If the switch is successful, a pop-up window will appear on the interactive interface to prompt the user that the data center providing the service has been successfully switched. If an unexpected situation occurs during the switching process, the service that failed to switch can be placed in the "Retry Cache" queue for retry.
[0090] Optionally, if "Equipment Room 1#" switches to "Equipment Room 2#" successfully, the button on the right of "Equipment Room 1#" will display the offline status.
[0091] In another implementation scheme, when the network problem of "Computer Room 1#" is solved, the services mounted in "Computer Room 1#" to "Computer Room 2#" need to be switched back to "Computer Room 1#".
[0092] Optionally, click the button on the right side of "1# Computer Room" and the service mounted to "2# Computer Room" can be switched back to "1# Computer Room". If the switch back to "1# Computer Room" is successful, a pop-up window will appear on the interactive interface to prompt the user that the switch back is successful. If an unexpected situation occurs during the switching process, the service that failed to switch will be placed in the "Retry Cache" queue for retry.
[0093] Optionally, if "Equipment Room 2" switches to "Equipment Room 1" successfully, the button on the right of "Equipment Room 1" will display the online status.
[0094] Understandably, Figure 1 The "Select Application", "Select Data Center", "Retry Cache" and other options presented in the figure can be set according to the actual situation. They are only used as examples here and do not limit the displayed content.
[0095] Below Figure 1 The application schematic diagram shown in the figure describes the technical solution of the present application in detail through specific embodiments. It should be noted that the following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0096] Figure 2 This is a flow chart of Embodiment 1 of the computer room switching method provided in the embodiment of the present application. Figure 2 As shown, the method may include the following steps:
[0097] Step 21: Determine the type of computer room switching according to the acquired network status change of the first computer room.
[0098] In this step, the change of the network status of the first computer room refers to a change from a normal status to a fault status, or a recovery from a fault status to a normal status.
[0099] The first computer room may be a designated service computer room of a target object, and the target object may be an IT system of a third-party team.
[0100] In practical applications, the network status change can be detected by the detection module, and when the network status change of the first computer room is detected, the computer room switching type can be determined according to the direction of the network status change. Optionally, when the network status of the first computer room changes from a normal state to a fault state, the computer room switching type is determined to be cutting out of the first computer room.
[0101] In a specific implementation, when the network status of the first computer room that is providing services to the target object changes from a normal state to a faulty state, it is necessary to switch the first computer room that provides the service to other computer rooms that can be used to provide the service to ensure that the IT system of the third-party team can operate normally. At this time, this type of switching is called cutting out the first computer room.
[0102] Optionally, when the network status of the first computer room changes from a faulty state to a normal state, it is determined that the computer room switching type is to switch back to the first computer room.
[0103] In another specific implementation, when the business that needs to be processed by the first computer room is switched to other computer rooms, and other computer rooms replace the first computer room to provide services for an IT system of a third-party team, at a possible moment, if the network status of the first computer room changes from a faulty state to a normal state, the business mounted to other computer rooms needs to be switched back to the first computer room to ensure that the IT system can operate normally. At this time, this type of switching is called switching back to the first computer room.
[0104] Step 22: According to the identifier of the target object, query the pre-configured computer room switching information to determine the service interface information, interface alias information of the first computer room and the second computer room associated with the first computer room.
[0105] In this step, the identifier of the target object may be identifier identification information pre-set in other teams to which the target object needs to switch, and is used to query pre-configured computer room switching information.
[0106] The pre-configured computer room switching information includes: service interface information corresponding to each service computer room, interface alias information corresponding to each service computer room, gateway interface operation permissions required by applications of services processed by each service computer room, etc. The present application embodiment does not limit the specific content of the computer room switching information, which can be determined according to the actual scenario.
[0107] Optionally, based on the identifier of the target object, the computer room switching information corresponding to the identifier can be obtained, and based on the identifier of the first computer room, the service interface information and interface alias information of the first computer room and the second computer room associated with the first computer room are determined in the computer room switching information. It can be understood that the second computer room associated with the first computer room can be a computer room that can replace the first computer room in providing services when the network of the first computer room fails, or can be a computer room that is currently replacing the first computer room in providing services.
[0108] Among them, the service interface information may be the gateway status interface authority and gateway online and offline interface authority of the first computer room; the interface alias information may refer to the alias information of the interface involved in the service provided by the first computer room. In actual applications, when it is necessary to switch the service processed by the first computer room to the second computer room, it is necessary to hang the alias of the first computer room to the second computer room so that the second computer room can replace the first computer room to provide the corresponding service; the second computer room can be any one of at least one alternative service computer room of the target object, that is, the second computer room can be any one of the alternative service computer rooms that provide the corresponding service for the first computer room.
[0109] Step 23: Switch the target service room of the target object between the first room and the second room according to the room switching type, the service interface information and the interface alias information.
[0110] In this step, the type of computer room switching is first determined, that is, switching out of the first computer room or switching back to the first computer room; secondly, according to the business interface information and interface alias information, the services provided by the first computer room are switched to the second computer room, or the services originally mounted to the second computer room for processing are switched back to the first computer room for processing.
[0111] Optionally, before this step, it is also necessary to determine whether the target service room meets the cut-in conditions, and the cut-in conditions include: all service equipment in the target service room is online, and the load of the target service room is less than the load threshold.
[0112] Specifically, when it is necessary to switch the service provided by the first computer room to the second computer room, it is necessary to ensure that all equipment in the second computer room is online and that the load of all equipment in the second computer room is less than the load threshold, so as to ensure that when the business processed by the first computer room is switched to the second computer room, the second computer room can provide the same service as the first computer room without affecting the service originally provided by the second computer room; similarly, when it is necessary to switch the business processed by the second computer room instead of the first computer room back to the first computer room, all equipment in the first computer room should be online, which is not elaborated here.
[0113] The computer room switching method provided in this embodiment determines the computer room switching type by obtaining the network status change of the first computer room, and then queries the pre-configured computer room switching information according to the identification of the target object, determines the service interface information, interface alias information of the first computer room and the second computer room associated with the first computer room, and finally switches the target service computer room of the target object between the first computer room and the second computer room according to the computer room switching type, service interface information and interface alias information. In this technical solution, the service interface information and interface alias information of the computer room that needs to be changed are determined by the preset computer room switching information, so that the service computer room of the target object can be changed between different computer rooms, which improves the versatility and application scope of the method.
[0114] Based on the above embodiments, Figure 3 This is a flow chart of Embodiment 2 of the computer room switching method provided in the embodiment of the present application. Figure 3 As shown, if the network of the first computer room changes from a normal state to a fault state, the above step 23 can be implemented by the following steps:
[0115] Step 31: When the computer room switching type is to cut out the first computer room, the services processed by the first computer room are transferred to the second computer room for processing in sequence according to the service interface information and interface alias information of the first computer room.
[0116] In this step, when the services provided by the first computer room are switched to the second computer room, the businesses processed by the first computer room need to be transferred to the second computer room in sequence, so that the second computer room can implement all the services provided by the first computer room.
[0117] Optionally, before transferring the business processed by the first computer room to the second computer room in sequence, the alias of the first computer room is first attached to the second computer room, and then based on the business interface information and interface alias information of the first computer room, the business processed by the first computer room is transferred to the second computer room for processing in sequence.
[0118] Optionally, if part of the business processed by the first computer room is not successfully transferred to the second computer room for processing, all the businesses that have not been successfully transferred will be placed in the business cache retry queue for retry until all the businesses processed by the first computer room are successfully transferred to the second computer room for processing.
[0119] Step 32: When all services processed in the first computer room are transferred to the second computer room for processing, the service equipment in the first computer room is taken offline.
[0120] In this step, when the service room of the service processed by the first room is switched, the transfer status of each service can be detected, and then the online and offline status of the service equipment in the first room can be determined according to the transfer status.
[0121] Optionally, when all services handled by the first computer room are transferred to the second computer room for processing, the service equipment in the first computer room is taken offline to facilitate subsequent network maintenance in the first computer room. If some service equipment in the first computer room fails to go offline successfully, all service equipment that fails to go offline successfully are put into the service cache retry queue for retry until all service equipment in the first computer room is successfully offline.
[0122] Step 33: When it is determined that all service devices in the first computer room are in an offline state, it is determined that the first computer room is successfully cut out.
[0123] In this step, all service equipment in the first computer room is successfully offline. At this time, all service equipment in the first computer room is in an offline state, indicating that all the services processed by the first computer room are transferred to the second computer room for processing, so that the service equipment in the second computer room replaces the service equipment in the first computer room to provide services. At this time, the first computer room is successfully cut out.
[0124] The computer room switching method provided in this embodiment, when the computer room switching type is to cut out the first computer room, the services processed by the first computer room are transferred to the second computer room for processing in sequence according to the service interface information and interface alias information of the first computer room. When all services processed by the first computer room are transferred to the second computer room for processing, the service equipment of the first computer room is offline. When it is determined that all service equipment of the first computer room is in an offline state, it is determined that the first computer room is successfully cut out. In this technical solution, based on the service interface information and interface alias information of the first computer room, all services processed by the first computer room are transferred to the second computer room for processing, so that the target object can use this method to switch the faulty computer room to other computer rooms, thereby ensuring that the services processed by the faulty computer room can be executed normally, improving the user experience.
[0125] Based on the above embodiments, Figure 4 This is a flow chart of Embodiment 3 of the computer room switching method provided in the embodiment of the present application. Figure 4 As shown, if the network of the first computer room changes from a fault state to a normal state, the above step 23 can be implemented by the following steps:
[0126] Step 41: When the computer room switching type is to switch back to the first computer room, the service equipment of the first computer room is put online in sequence according to the service interface information and interface alias information of the first computer room.
[0127] In this step, when the network status of the first computer room recovers from the fault, the business processed by the second computer room can be switched back, that is, the business processed by the second computer room is transferred to the first computer room in sequence, so that the first computer room can provide services to the target object again.
[0128] Optionally, before transferring the business processed by the second computer room to the first computer room in sequence, it is necessary to bring the offline service equipment in the first computer room online in sequence based on the business interface information and interface alias information of the first computer room, so that the business mounted to the second computer room for processing can be transferred back to the first computer room for processing.
[0129] Optionally, if there are service devices in the first computer room that have not been successfully brought online, all service devices that have not been successfully brought online are placed in a service cache retry queue for retries until all service devices in the first computer room are successfully brought online.
[0130] Step 42: When all service devices in the first computer room are online, the services that the first computer room mounted to the second computer room for processing are transferred back to the first computer room for processing.
[0131] In this step, while the service equipment in the first computer room is being put online, the online status of all service equipment in the first computer room can be detected. When all service equipment are online, the services mounted to the second computer room will be transferred back to the first computer room in turn and processed by the corresponding service equipment in the first computer room.
[0132] Optionally, if some of the services mounted in the first computer room to the second computer room for processing are not successfully transferred back to the first computer room for processing, all services that have not been successfully transferred back will be placed in the service cache retry queue for retry until all services mounted in the second computer room for processing are successfully transferred back to the first computer room for processing.
[0133] Step 43: When it is determined that all the services mounted in the first computer room to the second computer room for processing are transferred back to the first computer room for processing, it is determined that the switching back to the first computer room is successful.
[0134] In this step, all the services that were mounted in the first computer room and processed in the second computer room are transferred back to the first computer room, indicating that the service equipment in the first computer room can provide services to the target object again. At this time, the switch back to the first computer room is successful.
[0135] The computer room switching method provided in this embodiment, when the computer room switching type is switching back to the first computer room, the service equipment of the first computer room is put online in sequence according to the service interface information and interface alias information of the first computer room, and when all the service equipment of the first computer room are in an online state, the services mounted by the first computer room to the second computer room for processing are sequentially transferred back to the first computer room for processing, and when it is determined that all the services mounted by the first computer room to the second computer room for processing are transferred back to the first computer room for processing, it is determined that the switching back to the first computer room is successful. In this technical solution, based on the service interface information and interface alias information of the first computer room, all the services processed by the second computer room are transferred back to the first computer room for processing, the switching convenience is high, and the utilization efficiency of the designated service computer room of the target object is improved at the same time.
[0136] Figure 5 This is a flow chart of Embodiment 4 of the method for switching a computer room provided in the present application. Figure 5 As shown, before step 21, the method further includes the following steps:
[0137] Step 51: Obtain a computer room configuration request triggered by the outside world.
[0138] In this step, the computer room configuration request includes: service interface information, interface alias information and service computer room information of the target object.
[0139] Optionally, if the computer room providing services for the target object is to be switched, the computer room configuration request of the target object is first obtained, that is, the service interface information, interface alias information and service computer room information involved in the target object's services are entered.
[0140] Optionally, a plug-in interface may be reserved on the electronic device executing the method, so as to input the service interface information, interface alias information and service room information involved in the target object service.
[0141] Step 52: Determine the business interface information corresponding to each service room and the interface alias information corresponding to each service room according to the business interface information, the interface alias information and the service room information.
[0142] In this step, each computer room has its own corresponding service interface information and interface alias information. For example, the interface alias of the first computer room can be linked to other computer rooms, so that other computer rooms can process the services processed by the first computer room.
[0143] Step 53: Obtain the gateway interface permission request triggered by the outside world.
[0144] In this step, a gateway interface permission request of the target object is obtained, and the gateway interface permission request includes: an application identifier of the target object, that is, a mark that the target object needs to identify the container management center.
[0145] Optionally, the gateway interface authority may be a remote procedure call (rpc) gateway interface operation authority, including: status acquisition interface authority and online and offline interface authority.
[0146] Step 54: According to the application identifier of the target object, the gateway interface operation authority required by the application corresponding to the application identifier is opened and stored.
[0147] In this step, the gateway interface operation permissions include: gateway status interface permissions, gateway online and offline interface permissions. By identifying the tag of the container management center, the gateway interface operation permissions required by the application corresponding to the tag are opened and stored in the container management center.
[0148] The computer room switching method provided in this embodiment obtains the computer room configuration request triggered by the outside world, determines the business interface information corresponding to each service computer room and the interface alias information corresponding to each service computer room according to the business interface information, interface alias information and service computer room information, obtains the gateway interface permission request triggered by the outside world, and finally, according to the application identifier of the target object, opens and stores the gateway interface operation permission required by the application corresponding to the application identifier. In this technical solution, by obtaining the computer room configuration request, based on the business interface information, interface alias information and service computer room information, a basis is provided for realizing mutual switching between different computer rooms.
[0149] Based on the above embodiments, Figure 6 The overall flow chart of the computer room switching method provided in the embodiment of the present application is as follows. Figure 6 As shown, the method comprises the following steps:
[0150] S601, obtaining a computer room configuration request triggered by an external source, the computer room configuration request including: business interface information of a target object, interface alias information, and service computer room information;
[0151] S602, inputting the target object's business interface information, interface alias information, and service room information into a database;
[0152] S603, obtaining a gateway interface permission request triggered by the outside world, the gateway interface permission request including: an application identifier of a target object;
[0153] S604: According to the application identifier of the target object, the gateway interface operation authority required by the application corresponding to the application identifier is opened and stored, and registered in the container management center;
[0154] S605, determine whether the access work is completed; if so, perform subsequent operations according to the network status of the first computer room of the target object, if not, return to execute S602.
[0155] In a possible design, when it is determined that the network of the first computer room fails, the following steps are performed:
[0156] S606, determining that a network failure occurs in the first computer room;
[0157] S607, determine whether the second computer room associated with the first computer room meets the cut-in condition; if so, execute S608, if not, execute S614 (failure to cut out the first computer room) and S624 (notify the user);
[0158] S608, detecting the service interface information and interface alias information of the first computer room, and mounting the backup alias of the first computer room to the second computer room;
[0159] S609, determine whether the backup alias of the first computer room is mounted to the second computer room; if so, execute S610; if not, execute S612 and then return to execute S608;
[0160] S610, offline service equipment in the first computer room;
[0161] S611, determine whether the service equipment in the first computer room has been offline; if so, execute S613; if not, execute S612 and then return to execute S608;
[0162] S612, put it into the service cache retry queue for retry;
[0163] S613, determining that the first equipment room is successfully cut out;
[0164] In another possible implementation, when it is determined that the network of the first computer room has returned to normal, the following steps are performed:
[0165] S615, confirming that the network of the first computer room has returned to normal;
[0166] S616, determine whether all service devices in the first computer room are online; if so, execute S617, if not, execute S623 (failed to switch back to the first computer room), and then execute S624 (notify the user);
[0167] S617, detecting the service interface information and interface alias information of the first computer room, and bringing all service devices of the first computer room online;
[0168] S618, determine whether all service devices in the first computer room are online; if so, execute S619; if not, execute S621 and then return to execute S617;
[0169] S619, removing the backup alias of the first computer room from the second computer room;
[0170] S620, determine whether the standby alias of the first computer room in the second computer room has been removed; if so, execute S622; if not, execute S621 and then return to execute S617;
[0171] S621, put it into the service cache retry queue for retry;
[0172] S622: Determine that the service processed by the first computer room is switched back successfully.
[0173] The implementation principle and technical effect of the computer room switching method provided in this embodiment are similar to those of the above embodiments, and will not be described in detail here.
[0174] Figure 7 This is a schematic diagram of the structure of the switching room device provided in the embodiment of the present application. Figure 7 As shown, the device includes: a first determination module 71, a second determination module 72 and a processing module 73.
[0175] A first determination module 71 is used to determine the type of computer room switching according to the acquired network status change of the first computer room, where the first computer room is a designated service computer room of the target object;
[0176] A second determination module 72 is used to query the pre-configured computer room switching information according to the identifier of the target object, determine the service interface information, interface alias information of the first computer room and the second computer room associated with the first computer room, where the second computer room is any one of at least one candidate service computer room of the target object;
[0177] The processing module 73 is used to switch the target service room of the target object between the first room and the second room according to the room switching type, the service interface information and the interface alias information.
[0178] In a possible design of the embodiment of the present application, the processing module 73 is specifically used to:
[0179] When the computer room switching type is to cut out the first computer room, the services processed by the first computer room are sequentially transferred to the second computer room for processing according to the service interface information and interface alias information of the first computer room;
[0180] When all the services handled by the first computer room are transferred to the second computer room for processing, the service equipment in the first computer room is taken offline;
[0181] When it is determined that all service devices in the first computer room are in an offline state, it is determined that the first computer room is successfully cut out.
[0182] In this possible design, the processing module 73 is further used to:
[0183] When part of the services processed by the first computer room are not successfully transferred to the second computer room for processing, all the services that have not been successfully transferred are put into the service cache retry queue for retry until all the services processed by the first computer room are successfully transferred to the second computer room for processing; and / or
[0184] When some of the service devices in the first computer room fail to go offline successfully, all the service devices that fail to go offline successfully are put into the service cache retry queue for retry until all the service devices in the first computer room go offline successfully.
[0185] In another possible design of the embodiment of the present application, the processing module 73 is specifically used to:
[0186] When the computer room switching type is to switch back to the first computer room, the service equipment of the first computer room is put online in sequence according to the service interface information and interface alias information of the first computer room;
[0187] When all service devices in the first computer room are online, the services that were mounted in the first computer room to be processed in the second computer room are transferred back to the first computer room for processing in sequence;
[0188] When it is determined that all the services that were mounted in the first computer room to be processed in the second computer room are transferred back to the first computer room for processing, it is determined that the switching back to the first computer room is successful.
[0189] In this possible design, the processing module 73 is further used to:
[0190] When there are service devices that have not been successfully online in the first computer room, all service devices that have not been successfully online are placed in a service cache retry queue for retrying until all service devices in the first computer room are successfully online; and / or
[0191] When some of the services mounted in the first computer room to the second computer room for processing are not successfully transferred back to the first computer room for processing, all the services that have not been successfully transferred back will be placed in the service cache retry queue for retry until all the services mounted in the second computer room for processing are successfully transferred back to the first computer room for processing.
[0192] In another possible design of the embodiment of the present application, the switching room device further includes: an acquisition module 74;
[0193] The acquisition module 74 is used to acquire a computer room configuration request triggered by an external source before the first determination module 71 determines the computer room switching type according to the acquired network status change of the first computer room, wherein the computer room configuration request includes: service interface information of the target object, interface alias information and service computer room information;
[0194] The first determination module 71 is further used to determine the business interface information corresponding to each service room and the interface alias information corresponding to each service room according to the business interface information, the interface alias information and the service room information;
[0195] The acquisition module 74 is further used to acquire a gateway interface permission request triggered by the outside world, the gateway interface permission request including: an application identifier of a target object;
[0196] The first determination module 71 is further used to enable and store the gateway interface operation authority required by the application corresponding to the application identifier according to the application identifier of the target object;
[0197] The pre-configured computer room switching information includes: business interface information corresponding to each service computer room, interface alias information corresponding to each service computer room, and gateway interface operation authority required by the application identifier corresponding to the application.
[0198] In another possible design of the embodiment of the present application, the second determination module 72 is also used to determine that the target service room meets the cut-in conditions before switching the target service room of the target object between the first computer room and the second computer room based on the computer room switching type, business interface information and interface alias information. The cut-in conditions include: all service equipment in the target service room is online and the load of the target service room is less than the load threshold.
[0199] In another possible design of the embodiment of the present application, the first determining module 71 is specifically configured to:
[0200] When the network of the first computer room changes from a normal state to a fault state, determining the computer room switching type is to cut out of the first computer room;
[0201] When the network in the first computer room recovers from the fault state to the normal state, it is determined that the computer room switching type is to switch back to the first computer room.
[0202] The switching room device provided in this embodiment can be used to execute the solutions in the above embodiments. Its implementation principle and technical effects are similar and will not be described in detail here.
[0203] It should be noted that it should be understood that the division of the various modules of the above device is only a division of logical functions. In actual implementation, they can be fully or partially integrated into one physical entity, or they can be physically separated. And these modules can all be implemented in the form of software called by processing elements; they can also be all implemented in the form of hardware; some modules can also be implemented in the form of software called by processing elements, and some modules can be implemented in the form of hardware. For example, the determination module can be a separately established processing element, or it can be integrated in a chip of the above device. In addition, it can also be stored in the memory of the above device in the form of program code, and called and executed by a processing element of the above device. The implementation of other modules is similar. In addition, these modules can be fully or partially integrated together, or they can be implemented independently. The processing element here can be an integrated circuit with signal processing capabilities. In the implementation process, each step of the above method or each module above can be completed by an integrated logic circuit of hardware in the processor element or instructions in the form of software.
[0204] Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 8 As shown, the device may include: a processor 81 , a memory 82 , a system bus 83 , a transceiver 84 , and a display 85 .
[0205] The processor 81 executes the computer execution instructions stored in the memory, so that the processor 81 executes the scheme in the above embodiment. The processor 81 can be a general-purpose processor, including a central processing unit CPU, a network processor (NP), etc.; it can also be a digital signal processor DSP, an application-specific integrated circuit ASIC, a field programmable gate array FPGA or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.
[0206] The memory 82 and the transceiver 84 are connected to the processor 81 via the system bus 83 and communicate with each other. The memory 82 is used to store computer program instructions.
[0207] The system bus 83 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The system bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus. The transceiver is used to realize the communication between the database access device and other devices (such as a client, a read-write library, and a read-only library). The memory may include a random access memory (RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk storage.
[0208] The transceiver 84 is used to communicate with other devices. Optionally, in hardware implementation, the above Figure 7 The acquisition module 74 in the illustrated embodiment corresponds to the transceiver 84 in this embodiment, which constitutes a communication interface.
[0209] The display 85 may be a user interface. The user interface may include graphics, text, icons, videos, and any combination thereof. When the display 85 is a touch display screen, the transceiver 84 also has the ability to collect touch signals on the surface or above the surface. At this time, the display 85 may also be used to provide virtual buttons and / or virtual keyboards, also known as soft buttons and / or soft keyboards. In some embodiments, the display 85 may be a front panel of an electronic device; in other embodiments, the display 85 may be a flexible display screen, which is arranged on a curved surface or a folding surface of an electronic device. Even more, the display 85 may be arranged as a display screen of a non-rectangular irregular shape, i.e., a special-shaped screen. The display 85 may be made of materials such as a liquid crystal display (LCD) and an organic light-emitting diode (OLED).
[0210] The electronic device provided in the embodiment of the present application can be used to execute the solutions in the above embodiments. Its implementation principles and technical effects are similar and will not be repeated here.
[0211] An embodiment of the present application also provides a chip for executing instructions, which is used to execute the solution in the above embodiment.
[0212] An embodiment of the present application further provides a computer-readable storage medium, in which computer instructions are stored. When the computer instructions are executed on a computer, the computer executes the solution of the above embodiment.
[0213] An embodiment of the present application also provides a computer program product, which includes: program instructions, which are stored in a computer-readable storage medium. At least one processor can read the program instructions from the computer-readable storage medium, and when at least one processor executes the program instructions, the solution in the above embodiment can be implemented.
[0214] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A machine room switching method, characterized in that: include: Determining a computer room switching type according to the acquired network status change of the first computer room, where the first computer room is a designated service computer room of the target object; According to the identifier of the target object, query the pre-configured computer room switching information to determine the service interface information, interface alias information of the first computer room and the second computer room associated with the first computer room, where the second computer room is any one of at least one candidate service computer room of the target object; When the computer room switching type is to cut out the first computer room, the alias of the first computer room is attached to the second computer room, and the services processed by the first computer room are sequentially transferred to the second computer room for processing according to the service interface information and interface alias information of the first computer room; When the switching type of the computer room is switching back to the first computer room, the service devices of the first computer room are put online in sequence according to the service interface information and interface alias information of the first computer room.
2. The method according to claim 1, characterized in that When the equipment room switching type is to switch out of the first equipment room, the method further includes: When all the services processed by the first computer room are transferred to the second computer room for processing, the service equipment of the first computer room is taken offline; When it is determined that all service devices in the first computer room are in an offline state, it is determined that the first computer room is successfully cut out.
3. The method according to claim 2, characterized in that The method further comprises: If part of the services processed by the first computer room is not successfully transferred to the second computer room for processing, all the services that are not successfully transferred are put into the service cache retry queue for retry until all the services processed by the first computer room are successfully transferred to the second computer room for processing; and / or If some of the service devices in the first computer room fail to go offline successfully, all the service devices that fail to go offline successfully are put into the service cache retry queue for retry until all the service devices in the first computer room are successfully offline.
4. The method according to claim 1, characterized in that: When the equipment room switching type is switching back to the first equipment room, the method further includes: When all service devices in the first computer room are online, the services that the first computer room has mounted to the second computer room for processing are sequentially transferred back to the first computer room for processing; When it is determined that all the services mounted by the first computer room to the second computer room for processing are transferred back to the first computer room for processing, it is determined that the switching back to the first computer room is successful.
5. The method according to claim 4, characterized in that The method further comprises: If there are service devices in the first computer room that have not been successfully online, all service devices that have not been successfully online are placed in a service cache retry queue for retries until all service devices in the first computer room are successfully online; and / or If part of the business mounted to the second computer room by the first computer room for processing is not successfully transferred back to the first computer room for processing, all the businesses that have not been successfully transferred back will be placed in the business cache retry queue for retry until all the businesses mounted to the second computer room for processing are successfully transferred back to the first computer room for processing.
6. The method according to any one of claims 1 to 5, characterized in that: Before determining the type of equipment room switching according to the acquired network status change of the first equipment room, the method further includes: Acquire a computer room configuration request triggered by the outside world, wherein the computer room configuration request includes: business interface information, interface alias information and service computer room information of a target object; Determine the business interface information corresponding to each service room and the interface alias information corresponding to each service room according to the business interface information, the interface alias information and the service room information; Acquire a gateway interface permission request triggered by an external environment, wherein the gateway interface permission request includes: an application identifier of the target object; According to the application identifier of the target object, opening and storing the gateway interface operation authority required by the application corresponding to the application identifier; The pre-configured computer room switching information includes: business interface information corresponding to each service computer room, interface alias information corresponding to each service computer room, and gateway interface operation authority required by the application corresponding to the application identifier.
7. The method according to any one of claims 1 to 5, characterized in that: Before sequentially transferring the services processed by the first computer room to the second computer room for processing, the method further includes: Determining that the second computer room meets a cut-in condition, the cut-in condition including: all service devices in the second computer room are online, and a load amount of the second computer room is less than a load threshold; Before sequentially bringing the service equipment of the first computer room online, the method further includes: It is determined that the first computer room meets a cut-in condition, where the cut-in condition includes: all service devices in the first computer room are online, and a load amount of the first computer room is less than a load threshold.
8. The method according to any one of claims 1 to 5, characterized in that: The determining the type of switching of the computer room according to the acquired network status change of the first computer room includes: When the network of the first computer room changes from a normal state to a fault state, determining that the computer room switching type is to cut out of the first computer room; When the network of the first computer room recovers from a fault state to a normal state, it is determined that the computer room switching type is to switch back to the first computer room.
9. A machine room switching device, characterized in that: include: A first determining module, a second determining module and a processing module; The first determination module is used to determine the type of computer room switching according to the acquired network status change of the first computer room, where the first computer room is a designated service computer room of the target object; The second determination module is used to query the pre-configured computer room switching information according to the identifier of the target object, determine the service interface information, interface alias information of the first computer room and the second computer room associated with the first computer room, wherein the second computer room is any one of the at least one candidate service computer room of the target object; The processing module is used to transfer the services processed by the first computer room to the second computer room for processing in sequence according to the service interface information and interface alias information of the first computer room when the computer room switching type is to cut out the first computer room; and to bring the service equipment of the first computer room online in sequence according to the service interface information and interface alias information of the first computer room when the computer room switching type is to switch back to the first computer room.
10. An electronic device comprising a processor, a memory, a display, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the method according to any one of claims 1 to 8 is implemented.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 8 when executed by a processor.
12. A computer program product comprising: A program instruction, characterized in that the program instruction is used to implement the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Method for realizing fault migration through virtual host and virtual host service device
CN104468150A
DNS (domain name resolution) disaster-tolerant method and device
CN106686155A
Machine room switching method and switching device
CN109726046A
Database cross-machine-room migration method and device
CN110334077A
ONU service migration method, device and equipment and readable storage medium
CN111866624A
