Control method, system, computing device and storage medium for multi-computer room service switching

By using linkage control commands in a multi-computer room environment, the status switching and data synchronization of the source and target room components are achieved, and the problem of low service switching efficiency in the existing technology is solved, and the efficiency and reliability of service switching is improved.

CN112131056BActive Publication Date: 2025-03-28ZHANGYUE TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202010980403.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-09-17
Publication Date
2025-03-28
Estimated Expiration
2040-09-17

AI Technical Summary

Technical Problem

In the prior art, multi-computer room service switching usually requires manual intervention, resulting in low switching efficiency, long-term service failure, and inability to effectively respond to changes in access pressure.

Method used

With the support of the switching control platform, linkage control commands are sent to the components of the source and target computer rooms, and the operation of prohibiting data writing and synchronizing data is realized, thereby completing the rapid switching of services.

Benefits of technology

It realizes data synchronization between the source computer room and the target computer room without generating new service data, ensuring that the target computer room provides services consistent with the source computer room, and improving the efficiency and reliability of service switching.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112131056B_ABST
    Figure CN112131056B_ABST
Patent Text Reader

Abstract

The present invention discloses a control method, system, computing device and storage medium for multi-computer room service switching, the method comprising: based on a cross-computer room switching request from a source computer room to a target computer room of any service, determining at least one component that the service depends on; sending a first linkage control command to at least one component of the source computer room; at least one component of the source computer room performs data writing prohibition processing and / or consumption stop processing according to the first linkage control command; at least one component of the source computer room synchronizes data with at least one component of the target computer room; after data synchronization is completed, sending a second linkage control command to at least one component of the target computer room; at least one component of the target computer room performs data writing permission processing and / or consumption permission processing according to the second linkage control command to complete service switching. Through the above-mentioned scheme of the present invention, rapid switching of services between multiple computer rooms can be realized, and data can be ensured not to be lost after switching.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of Internet technology, and in particular to a control method, system, computing device and storage medium for multi-computer room service switching. Background Art

[0002] With the growth of business volume and the expansion of business scope, a single computer room often cannot provide stable and reliable services. In this case, deploying multiple computer rooms is a common choice, where each computer room can provide several services to the outside world, and each service usually relies on one or more components to implement. At the same time, in practice, there is often a need to switch the services provided by one computer room to another. For example, if the access pressure of a computer room is high, service switching is required. Only by switching services can stable services continue to be provided to the business side.

[0003] In the prior art, service switching can usually only be performed manually, which has low switching efficiency and causes long-term service failures. Therefore, a solution that can efficiently perform service switching is urgently needed. Summary of the invention

[0004] In view of the above problems, embodiments of the present invention are proposed to provide a control method, system, computing device and storage medium for multi-machine room service switching that overcome the above problems or at least partially solve the above problems.

[0005] According to one aspect of an embodiment of the present invention, a control method for multi-machine room service switching is provided, comprising:

[0006] Based on a cross-machine room switching request from a source machine room to a target machine room of any service, determining at least one component on which the service depends; sending a first linkage control command to at least one component in the source machine room;

[0007] At least one component in the source computer room prohibits data writing and / or stops consumption according to the first linkage control command;

[0008] At least one component of the source computer room synchronizes data with at least one component of the target computer room;

[0009] After the data synchronization is completed, a second linkage control command is sent to at least one component of the target computer room;

[0010] At least one component of the target computer room allows data writing and / or allows production and consumption according to the second linkage control command to complete the service switching.

[0011] According to another aspect of an embodiment of the present invention, a control system for multi-machine room service switching is provided, comprising: a switching control platform and at least two machine rooms, wherein the at least two machine rooms are deployed with multiple components on which various services depend; wherein:

[0012] The switching control platform is used to: determine at least one component that the service depends on based on a cross-machine room switching request from a source machine room to a target machine room of any service; send a first linkage control command to at least one component in the source machine room; and after data synchronization is completed, send a second linkage control command to at least one component in the target machine room;

[0013] At least one target component of the source computer room is used to: perform write prohibition processing and / or stop consumption processing according to the first linkage control command, and synchronize data to at least one component of the target computer room;

[0014] At least one target component of the target computer room is used to: allow data writing processing and / or allow production and consumption processing according to the second linkage control command to complete service switching.

[0015] According to another aspect of an embodiment of the present invention, there is provided a computing device, comprising: a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus;

[0016] The memory is used to store at least one executable instruction, and the executable instruction enables the processor to execute operations corresponding to the control method for multi-machine room service switching.

[0017] According to another aspect of an embodiment of the present invention, a computer storage medium is provided, wherein the storage medium stores at least one executable instruction, and the executable instruction enables a processor to execute operations corresponding to the above-mentioned control method for multi-machine room service switching.

[0018] According to the control method, system, computing device and storage medium for multi-computer room service switching of the present invention, for a switching request of any service, at least one component on which the service depends is determined; a first linkage control command is sent to at least one component in the source computer room, and at least one component in the source computer room is controlled in parallel to prohibit data writing and / or stop consumption processing to prepare for data synchronization and avoid generating new data during the synchronization process; after responding to the first linkage control command, at least one component in the source computer room synchronizes data with at least one component in the target computer room, so that the data in at least one component in the target computer room remains completely consistent with that in the source computer room to avoid data omission; after the data synchronization is completed, a second linkage control command is sent to at least one component in the target computer room, and at least one component in the target computer room is controlled in parallel to allow data writing and / or production and consumption. After that, at least one component in the target computer room has data reading and writing functions, and / or production and consumption functions, and can provide the service externally. It can be seen that the scheme of this embodiment, under the premise of controlling that no new service data is generated, synchronizes data from the source computer room to the target computer room, thereby avoiding data omissions and ensuring that the target computer room can provide the service consistent with the source computer room; and, through linkage control commands, controls the functions provided by at least one component in the source computer room and the target computer room in parallel, thereby achieving rapid switching of services.

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

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

[0021] Figure 1 A flow chart showing a method for controlling multi-machine room service switching provided by an embodiment of the present invention;

[0022] Figure 2 A flow chart showing a method for controlling multi-machine room service switching provided by another embodiment of the present invention;

[0023] Figure 3 A diagram showing a functional switch status of at least one component before responding to a first linkage control command in a specific example is shown;

[0024] Figure 4 Shows the corresponding Figure 3 An example of a functional switch status diagram of at least one component after responding to a first linkage control command;

[0025] Figure 5 Shows the corresponding Figure 3 Example of a function switch status of at least one component after responding to the second linkage control command and the third linkage control command;

[0026] Figure 6 A schematic diagram showing the structure of the control of multi-machine room service switching provided by an embodiment of the present invention is shown;

[0027] Figure 7 A schematic diagram of the structure of a computing device provided by an embodiment of the present invention is shown. DETAILED DESCRIPTION

[0028] The exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present invention and to enable the scope of the present invention to be fully communicated to those skilled in the art.

[0029] Figure 1 The flowchart of the control method for multi-computer room service switching provided by an embodiment of the present invention is shown. The method controls the state of at least one component that the service depends on by the switching control platform, completes the switching of the service from the source computer room to the target computer room, and realizes the rapid switching of the service. Figure 1 As shown, the method comprises the following steps:

[0030] Step S110: Based on a cross-machine-room switching request from a source machine room to a target machine room of any service, determine at least one component that the service depends on; and send a first linkage control command to at least one component of the source machine room.

[0031] The switching request may be initiated by an administrator, or may be automatically initiated after the switching control platform detects that the switching conditions are met. In addition, the source computer room is the computer room currently providing the service, and the target computer room is the computer room that provides the service after the service switching is completed. The target computer room may be determined by designation, or may be determined by the switching control platform matching the service requirements with the configurations of each computer room.

[0032] Specifically, after receiving the switching request, the switching control platform determines at least one component that the service depends on, for example, a storage database that the service depends on. It should be noted that multiple computer rooms are deployed with at least one component of each service. Even if the computer room does not currently provide a certain service, the component of the service will be deployed for use after the service is switched.

[0033] Then, the switching control platform sends a first linkage control command to the at least one component of the source computer room to prepare the at least one component of the source computer room for service switching, wherein, when there are multiple at least one component, the first linkage control command is a command for controlling the multiple components at the same time to achieve parallel control of the multiple components.

[0034] In addition, it should be noted that in the embodiments of the present invention, only the switching of any one service is used for illustration. In practice, if there are multiple services with switching requirements, each of the multiple services can be switched in the manner of the embodiments of the present invention, and the switching process of the multiple services can be completed by the parallel control of the switching control platform, thereby improving the efficiency of switching multiple services.

[0035] Step S120: at least one component of the source computer room prohibits data writing and / or stops consumption according to the first linkage control command.

[0036] When the service is provided by the source computer room, at least one component on which the service depends and deployed in the source computer room provides read and write functions, and / or provides production and consumption functions, while at least one component on which the service depends and deployed in the remaining computer rooms (including the target computer room) does not provide write functions, and / or does not provide production and consumption functions.

[0037] The at least one component of the source computer room turns off the data writing function and / or consumption function according to the first linkage control command to avoid adding new service data in the at least one component. Among the at least one component of the source computer room, different components may provide different functions. For example, the MySQL component provides data reading and writing functions, while the Redis QueueProxy component provides production and consumption functions.

[0038] Step S130: at least one component of the source computer room synchronizes data with at least one component of the target computer room; after data synchronization is completed, a second linkage control command is sent to at least one component of the target computer room.

[0039] In practice, components deployed in peer-to-peer fashion between the source computer room and other computer rooms will maintain data synchronization. However, due to latency, it is not possible to ensure that the data is always strictly consistent. In addition, since synchronization is performed from the source computer room to other computer rooms, the data in the source computer room is the most complete.

[0040] Specifically, after at least one component in the source computer room turns off the write function and / or the consumption function, data synchronization is performed from at least one component in the source computer room to at least one component in the target computer room until the data in at least one component in the target computer room is synchronized to be the same as the data in at least one component in the source computer room, and then the data synchronization is completed. Then, the switching control platform sends a second linkage control command to at least one component in the target computer room to control at least one component in the target computer room to prepare to provide services.

[0041] Step S140: at least one component of the target computer room allows data writing and / or allows production and consumption according to the second linkage control command, thereby completing service switching.

[0042] At least one component of the target computer room opens the data writing function and / or consumption function according to the second linkage control command. After the above processing, at least one component of the target computer room has both the data reading and writing function and / or both the production and consumption functions, and can provide services to the outside world.

[0043] According to the control method for multi-computer room service switching provided by the present embodiment, for a switching request of any service, at least one component on which the service depends is determined; a first linkage control command is sent to at least one component in the source computer room, and at least one component in the source computer room is controlled in parallel to prohibit data writing and / or stop consumption processing, so as to prepare for data synchronization and avoid generating new data during the synchronization process; after responding to the first linkage control command, at least one component in the source computer room synchronizes data with at least one component in the target computer room, so that the data in at least one component in the target computer room remains completely consistent with that in the source computer room, so as to avoid data omission; after the data synchronization is completed, a second linkage control command is sent to at least one component in the target computer room, and at least one component in the target computer room is controlled in parallel to allow data writing and / or allow production and consumption. After that, at least one component in the target computer room has data reading and writing functions, and / or production and consumption functions, and can provide the service externally. It can be seen that the scheme of this embodiment, under the premise of controlling that no new service data is generated, synchronizes data from the source computer room to the target computer room, thereby avoiding data omissions and ensuring that the target computer room can provide the service consistent with the source computer room; and, through linkage control commands, controls the functions provided by at least one component in the source computer room and the target computer room in parallel, thereby achieving rapid switching of services.

[0044] Figure 2 FIG. 2 is a flow chart showing a control method for multi-machine room service switching provided by another embodiment of the present invention. Figure 2 As shown, the method comprises the following steps:

[0045] Step S210: Based on a cross-machine-room switching request from a source machine room to a target machine room of any service, determine at least one component that the service depends on; and send a first linkage control command to at least one component of the source machine room.

[0046] In this embodiment, at least one component is mainly used as a storage component for explanation, which includes but is not limited to at least one of the following components: MySQL component, MongoDB component, Codis component, Redis Queue Proxy component and RabbitMQ Proxy component, wherein MySQL, MongoDB, Codis, Redis Queue Proxy and RabbitMQProxy are all structures for storage; and MySQL (a relational database management system) component, MongoDB (a database based on distributed file storage) component and Codis (a distributed Redis solution) use DRC (Data Replicate Center) to achieve real-time data synchronization in two computer rooms; RedisQueue (redis queue) and RabbitMQ (a message queue service) have developed corresponding Proxy middleware to realize production and consumption in the two computer rooms.

[0047] Specifically, the initiator initiates a switching request to switch any service from the source computer room to the target computer room to the switching control platform. After receiving the switching request, the switching control platform determines at least one component that the service depends on, and the at least one component is deployed in each computer room. The switching control platform sends a first linkage control command to the at least one component in the source computer room to control the at least one component in the source computer room to prepare for service switching.

[0048] Step S220: at least one component of the source computer room prohibits data writing and / or stops consumption according to the first linkage control command.

[0049] Specifically, the at least one component in the source computer room can be controlled by the first linkage control command to prohibit data writing and / or stop consumption at the same time, wherein each component provides its own corresponding function, and under the control of the first linkage control command, each component will perform different processing. Optionally, the MySQL component, MongoDB component and / or Codis component of the source computer room prohibit data writing according to the first linkage control command; and / or, the Redis Queue Proxy component and / or the RabbitMQ Proxy component stop consumption according to the first linkage control command. After the at least one component in the source computer room prohibits data writing and / or stops consumption, the at least one component in the source computer room will no longer generate new service data.

[0050] Figure 3 FIG. 1 shows a diagram of the function switch of at least one component before responding to the first linkage control command in a specific example. Figure 3 As shown, a service of the business APP depends on components 1 to 5, which can be MySQL component, MongoDB component, Codis component, Redis Queue Proxy component and RabbitMQ Proxy component respectively. Before the response, components 1, 2 and 3 of the source computer room are readable and writable, and components 4 and 5 can produce and consume, while components 1, 2 and 3 of the target computer room are readable but not writable, and components 4 and 5 cannot produce or consume.

[0051] Figure 4 Shows the corresponding Figure 3 Example of a functional switch status diagram of at least one component after responding to the first linkage control command. Figure 3 The difference is that Figure 4 After responding to the first linkage control command, components 1, 2 and 3 in the source computer room change from readable and writable to readable and non-writable, and components 4 and 5 change from producible and consumable to producible and non-consumable. Then, the five components in the source computer room will not generate new storage data.

[0052] Step S230: at least one component of the source computer room synchronizes data with at least one component of the target computer room; after data synchronization is completed, a second linkage control command is sent to at least one component of the target computer room.

[0053] When at least one component in the source computer room no longer generates new service data, the at least one component in the source computer room synchronizes data with the at least one component in the target computer room, and completes synchronization of data in the at least one component in the target computer room that has not been fully synchronized due to delay, so that the data in the at least one component in the source computer room and the target computer room remain completely consistent. Figure 4 For example, in the Figure 4 In the state shown, components 1 to 5 in the source computer room synchronize data with corresponding components 1 to 5 in the target computer room respectively. And, after completing data synchronization, a second linkage control command is sent to at least one component in the target computer room to control at least one component in the target computer room to prepare to provide the service.

[0054] In some optional embodiments of the present invention, after data synchronization is started (that is, after at least one component of the source computer room prohibits data writing and / or stops consumption according to the first linkage control command), the following method is used to detect whether data synchronization from the source computer room to the target computer room is completed: marking data is written to at least one component of the source computer room, specifically as the latest data written to each computer room in at least one component of the source computer room, and the marking data only serves as a mark and is not used as service data; the marking data is queried in at least one component of the target computer room, and if the marking data is queried, it is determined that data synchronization is completed, wherein, if the latest written marking data is queried in at least one component of the target computer room, it indicates that the stored data before the marking data has been synchronized, and then the switching control platform can be triggered to send a second linkage control command. For example, if at least one component includes MySQL component, MongoDB component and Codis, a piece of marking data is written to the MySQL component, MongoDB component and Codis component of the source computer room at the same time, and then the MySQL component, MongoDB component and Codis component are checked in the target computer room to see if the data can be found. If so, it means that the data of the two computer rooms have been synchronized and reached consistency. This optional implementation method can accurately detect whether the data synchronization is completed by writing marking data, and then can timely trigger the sending of the second linkage control command after the data synchronization is completed, so as to achieve seamless connection between the previous and next processes, which is conducive to speeding up the entire switching process.

[0055] In some other optional embodiments of the present invention, after data synchronization is completed, the synchronization direction of the target component in at least one component is switched between the source computer room and the target computer room. For some target components, which do not support bidirectional synchronization themselves, after data synchronization is completed, data synchronization from the target computer room to the source computer room is achieved by modifying the synchronization direction, that is, the synchronization direction of the target component in the source computer room is switched from copying out to syncing in, and the synchronization direction of the target component in the target computer room is switched from syncing in to copying out, so that the newly generated service data in the target computer room can be synchronized to the source computer room. In addition, if there are other computer rooms besides the source computer room and the target computer room, the synchronization direction of the target component in the other computer room remains unchanged. Specifically, the target component may include a MySQL component and / or a MongoDB component, and the switching of the synchronization direction of the DRC of the MySQL component and / or the MongoDB component between the source computer room and the target computer room is achieved by switching the synchronization direction of the DRC of the MySQL component and / or the MongoDB component. Among them, MySQL component, MongoDB component and Codis component all use DRC to achieve real-time data synchronization. Among them, MySQL component and MongoDB component do not support two-way synchronization, so the synchronization direction of DRC needs to be modified. On the contrary, Codis component itself supports two-way synchronization and does not need to be modified. The above optional implementation method, after the data synchronization is completed, can ensure that the newly generated service data in the subsequent target computer room during the process of providing the service can be synchronized to the source computer room in a timely manner by modifying the synchronization direction of some target components.

[0056] Step S240: at least one component of the target computer room allows data writing and / or allows production and consumption according to the second linkage control command.

[0057] Specifically, the at least one component in the target computer room can be controlled by the second linkage control command to allow data writing and / or consumption at the same time, wherein each component provides its own corresponding function, and under the control of the first linkage control command, each component will perform different processing. Optionally, the MySQL component, MongoDB component and / or Codis component of the target computer room allow data writing according to the second linkage control command; and / or, the Redis QueueProxy component and / or the RabbitMQ Proxy component allow consumption according to the second linkage control command. After the at least one component in the target computer room allows data writing and / or allows production and consumption, it is the same as the function switch state of at least one component in the source computer room before responding to the first linkage control command. At this time, at least one component in the target computer room is ready to provide the service.

[0058] Furthermore, after completing data synchronization, the switching control platform also sends a third linkage control command to at least one component in the source computer room to control at least one component in the source computer room to completely stop the service. At least one component in the source computer room stops production processing according to the third linkage control command, and thereafter the at least one component in the source computer room no longer has the data writing function and / or the production and consumption function, that is, the function switch state of at least one component in the target computer room is the same as that before responding to the first linkage control command.

[0059] Figure 5 Shows the corresponding Figure 3 Example of the function switch status of at least one component after responding to the second linkage control command and the third linkage control command. Figure 4 The difference is that Figure 5 After responding to the second linkage control command, components 1, 2 and 3 in the target computer room change from non-writable to readable and writable, and components 4 and 5 change from non-production and non-consumption to production and consumption; and, after responding to the third linkage control command, components 4 and 5 in the source computer room change from production and non-consumption to non-production and non-consumption.

[0060] Through the above steps S210 to S240, the function conversion of the storage components that the service depends on in the source computer room and the target computer room is completed, and the data synchronization is completed, that is, the switching of the storage layer is completed.

[0061] Step S250: Send a traffic switching notification to the initiator of the switching request to instruct the initiator to migrate the traffic for the service to the target computer room to complete the service switching.

[0062] The switching control platform sends a traffic switching notification to the initiator of the switching request. The initiator migrates the traffic of the service from the source computer room to the target computer room. At this time, the traffic of the service can be carried by the target computer room, completing the service switching.

[0063] According to the control method for multi-computer room service switching provided by this embodiment, for a switching request of any service, at least one component that the service depends on is determined; a first linkage control command is sent to at least one component in the source computer room, and at least one component in the source computer room is controlled in parallel to prohibit data writing and / or stop consumption processing, so as to avoid generating new data during the synchronization process, so as to prepare for data synchronization; after responding to the first linkage control command, at least one component in the source computer room synchronizes data with at least one component in the target computer room, so that the data in at least one component in the target computer room is kept completely consistent with that in the source computer room, so as to avoid data omission; during the synchronization process, data synchronization can be detected by writing marker data Whether it is completed, the switching control platform is triggered in time to send the second linkage control command to achieve seamless connection between the previous and next processes, which is conducive to speeding up the entire switching process; after the synchronization is completed, the synchronization direction of the target component is switched so that the newly generated service data in the target computer room can be synchronized to the source computer room; and, after the synchronization is completed, a second linkage control command is sent to at least one component of the target computer room, and at least one component of the target computer room is controlled in parallel to allow data writing and / or production and consumption. At this time, at least one component of the target computer room is ready to provide services and the switching of the storage layer is completed; then, traffic migration is performed so that the target computer room carries the service traffic and provides services. It can be seen that the scheme of this embodiment, through the switching control platform to control at least one component that the service depends on in the source computer room and the target computer room in parallel, efficiently completes the switching of the storage layer, and ensures that data is not lost.

[0064] Figure 6 The schematic diagram of the structure of the control of multi-machine room service switching provided by the embodiment of the present invention is shown. Figure 6 As shown, the system includes: a switching control platform 610 and at least two computer rooms (including a source computer room 620 and a target computer room 630), wherein the at least two computer rooms are deployed with multiple components that various services depend on; wherein,

[0065] The switching control platform 610 is adapted to: determine at least one component that the service depends on based on a cross-machine room switching request from a source machine room to a target machine room of any service; send a first linkage control command to at least one component in the source machine room; and send a second linkage control command to at least one component in the target machine room after data synchronization is completed;

[0066] At least one target component 621 of the source computer room is adapted to: perform write prohibition processing and / or stop consumption processing according to the first linkage control command, and synchronize data to at least one component of the target computer room;

[0067] At least one target component 631 of the target computer room is adapted to: perform data writing permission processing and / or production and consumption permission processing according to the second linkage control command to complete service switching.

[0068] In an optional manner, the switching control platform is further adapted to: send a third linkage control command to at least one component of the source computer room; and the at least one component of the source computer room stops production processing according to the third linkage control command.

[0069] In an optional manner, the at least one component includes at least one of the following: a MySQL component, a MongoDB component, a Codis component, a Redis Queue Proxy component, and a RabbitMQ Proxy component.

[0070] Among them, at least one target component of the source computer room is further adapted to: the MySQL component, the MongoDB component and / or the Codis component of the source computer room prohibit data writing processing according to the first linkage control command; and / or the RedisQueue Proxy component and / or the RabbitMQ Proxy component stop consumption processing according to the first linkage control command;

[0071] At least one component of the target computer room is further adapted to: the MySQL component, MongoDB component and / or Codis component of the target computer room allow data writing processing according to the second linkage control command; and / or the Redis QueueProxy component and / or RabbitMQ Proxy component allow production and consumption processing according to the second linkage control command.

[0072] In an optional manner, the switching control platform is further adapted to:

[0073] Writing marking data into at least one component of the source computer room;

[0074] The marking data is queried in at least one component of the target computer room, and if the marking data is found, it is determined that data synchronization is completed.

[0075] In an optional manner, the switching control platform is further adapted to:

[0076] Switch the synchronization direction of the target component in at least one component between the source computer room and the target computer room.

[0077] In an optional manner, the target component includes a MySQL component and / or a MongoDB component; and the switching control platform is further adapted to:

[0078] Switches the synchronization direction of the data replication center of the MySQL component and / or the MongoDB component.

[0079] In an optional manner, the switching control platform is further adapted to:

[0080] A traffic switching notification is sent to the initiator of the switching request to instruct the initiator to migrate the traffic for the service to the target computer room.

[0081] An embodiment of the present invention provides a non-volatile computer storage medium, wherein the computer storage medium stores at least one executable instruction, and the computer executable instruction can execute the control method for multi-machine room service switching in any of the above method embodiments.

[0082] The executable instructions may be specifically used to cause the processor to perform the following operations:

[0083] Based on a cross-machine room switching request from a source machine room to a target machine room of any service, determining at least one component on which the service depends; sending a first linkage control command to at least one component in the source machine room;

[0084] At least one component in the source computer room prohibits data writing and / or stops consumption according to the first linkage control command;

[0085] At least one component of the source computer room synchronizes data with at least one component of the target computer room;

[0086] After the data synchronization is completed, a second linkage control command is sent to at least one component of the target computer room;

[0087] At least one component of the target computer room allows data writing and / or allows production and consumption according to the second linkage control command to complete the service switching.

[0088] In an optional manner, the executable instruction further causes the processor to perform the following operations:

[0089] A third linkage control command is sent to at least one component of the source computer room; and the at least one component of the source computer room stops production processing according to the third linkage control command.

[0090] In an optional manner, the at least one component includes at least one of the following: a MySQL component, a MongoDB component, a Codis component, a Redis Queue Proxy component, and a RabbitMQ Proxy component.

[0091] In an optional manner, the executable instruction further causes the processor to perform the following operations:

[0092] The MySQL component, MongoDB component and / or Codis component of the source computer room prohibit data writing according to the first linkage control command; and / or the Redis Queue Proxy component and / or the RabbitMQ Proxy component stop consumption according to the first linkage control command;

[0093] The MySQL component, MongoDB component and / or Codis component of the target computer room allow data writing processing according to the second linkage control command; and / or the Redis Queue Proxy component and / or RabbitMQ Proxy component allow production and consumption processing according to the second linkage control command.

[0094] In an optional manner, the executable instruction further causes the processor to perform the following operations:

[0095] Writing marking data into at least one component of the source computer room;

[0096] The marking data is queried in at least one component of the target computer room, and if the marking data is found, it is determined that data synchronization is completed.

[0097] In an optional manner, the executable instruction further causes the processor to perform the following operations:

[0098] Switch the synchronization direction of the target component in at least one component between the source computer room and the target computer room.

[0099] In an optional manner, the target component includes a MySQL component and / or a MongoDB component; the executable instruction further causes the processor to perform the following operations:

[0100] Switches the synchronization direction of the data replication center of the MySQL component and / or the MongoDB component.

[0101] In an optional manner, the executable instruction further causes the processor to perform the following operations:

[0102] A traffic switching notification is sent to the initiator of the switching request to instruct the initiator to migrate the traffic for the service to the target computer room.

[0103] Figure 7 A schematic diagram of the structure of a computing device provided by an embodiment of the present invention is shown, and the specific embodiment of the present invention does not limit the specific implementation of the computing device.

[0104] like Figure 7As shown, the computing device may include: a processor (processor) 702 , a communications interface (Communications Interface) 704 , a memory (memory) 706 , and a communication bus 708 .

[0105] The processor 702, the communication interface 704, and the memory 706 communicate with each other via the communication bus 708. The communication interface 704 is used to communicate with other devices such as a client or other server network elements. The processor 702 is used to execute the program 710, which can specifically execute the relevant steps in the above-mentioned control method for multi-machine room service switching of computing devices.

[0106] Specifically, the program 710 may include program codes, which include computer operation instructions.

[0107] The processor 702 may be a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention. The one or more processors included in the computing device may be processors of the same type, such as one or more CPUs; or processors of different types, such as one or more CPUs and one or more ASICs.

[0108] The memory 706 is used to store the program 710. The memory 706 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.

[0109] The program 710 may be specifically configured to enable the processor 702 to perform the following operations:

[0110] Based on a cross-machine room switching request from a source machine room to a target machine room of any service, determining at least one component on which the service depends; sending a first linkage control command to at least one component in the source machine room;

[0111] At least one component in the source computer room prohibits data writing and / or stops consumption according to the first linkage control command;

[0112] At least one component of the source computer room synchronizes data with at least one component of the target computer room;

[0113] After the data synchronization is completed, a second linkage control command is sent to at least one component of the target computer room;

[0114] At least one component of the target computer room allows data writing and / or allows production and consumption according to the second linkage control command to complete the service switching.

[0115] In an optional manner, the program 710 further enables the processor 702 to perform the following operations:

[0116] A third linkage control command is sent to at least one component of the source computer room; and the at least one component of the source computer room stops production processing according to the third linkage control command.

[0117] In an optional manner, the at least one component includes at least one of the following: a MySQL component, a MongoDB component, a Codis component, a Redis Queue Proxy component, and a RabbitMQ Proxy component.

[0118] In an optional manner, the program 710 further enables the processor 702 to perform the following operations:

[0119] The MySQL component, MongoDB component and / or Codis component of the source computer room prohibit data writing according to the first linkage control command; and / or the Redis Queue Proxy component and / or the RabbitMQ Proxy component stop consumption according to the first linkage control command;

[0120] The MySQL component, MongoDB component and / or Codis component of the target computer room allow data writing processing according to the second linkage control command; and / or the Redis Queue Proxy component and / or RabbitMQ Proxy component allow production and consumption processing according to the second linkage control command.

[0121] In an optional manner, the program 710 further enables the processor 702 to perform the following operations:

[0122] Writing marking data into at least one component of the source computer room;

[0123] The marking data is queried in at least one component of the target computer room, and if the marking data is found, it is determined that data synchronization is completed.

[0124] In an optional manner, the program 710 further enables the processor 702 to perform the following operations:

[0125] Switch the synchronization direction of the target component in at least one component between the source computer room and the target computer room.

[0126] In an optional manner, the target component includes a MySQL component and / or a MongoDB component; the program 710 further causes the processor 702 to perform the following operations:

[0127] Switches the synchronization direction of the data replication center of the MySQL component and / or the MongoDB component.

[0128] In an optional manner, the program 710 further enables the processor 702 to perform the following operations:

[0129] A traffic switching notification is sent to the initiator of the switching request to instruct the initiator to migrate the traffic for the service to the target computer room.

[0130] The algorithm or display provided herein is not inherently related to any particular computer, virtual system or other device. Various general purpose systems can also be used together with the teachings based on this. According to the above description, it is obvious that the structure required for constructing this type of system. In addition, the embodiment of the present invention is not directed to any specific programming language either. It should be understood that various programming languages ​​can be utilized to realize the content of the embodiment of the present invention described herein, and the description of the above specific language is to disclose the best mode of the embodiment of the present invention.

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

[0132] Similarly, it should be understood that in order to streamline the embodiments of the present invention and to aid in understanding one or more of the various inventive aspects, in the above description of exemplary embodiments of the present invention, various features of the embodiments of the present invention are sometimes grouped together into a single embodiment, figure, or description thereof. However, this disclosed method should not be interpreted as reflecting the following intention: that the claimed embodiments of the present invention require more features than those explicitly recited in each claim.

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

[0134] Furthermore, those skilled in the art will appreciate that although some embodiments herein include certain features included in other embodiments but not other features, the combination of features from different embodiments is meant to be within the scope of the present invention and to form different embodiments.

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

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

Claims

1. A control method for multi-machine room service switching, comprising: Based on a cross-computer room switching request of any service from a source computer room to a target computer room, determining at least one component on which the service depends; Sending a first linkage control command to at least one component in the source computer room; At least one component of the source computer room performs data writing prohibition processing and / or consumption stop processing according to the first linkage control command; wherein, after responding to the first linkage control command, the MySQL component, MongoDB component and / or Codis component in at least one component of the source computer room changes from readable and writable to readable and unwritable, and the Redis Queue Proxy component and / or RabbitMQ Proxy component in at least one component of the source computer room changes from being producible and consumable to being producible but not consumable; At least one component of the source computer room synchronizes data with at least one component of the target computer room; After the data synchronization is completed, a second linkage control command is sent to at least one component of the target computer room; At least one component of the target computer room allows data writing and / or allows production and consumption according to the second linkage control command to complete service switching; wherein, after responding to the second linkage control command, the MySQL component, MongoDB component and / or Codis component in at least one component of the target computer room changes from being non-writable to being readable and writable, and the Redis Queue Proxy component and / or RabbitMQ Proxy component in at least one component of the target computer room changes from being non-producing and non-consuming to being capable of production and consumption; After the data synchronization is completed, the method further includes: A third linkage control command is sent to at least one component of the source computer room; at least one component of the source computer room stops production processing according to the third linkage control command; wherein, after responding to the third linkage control command, the Redis Queue Proxy component and / or the RabbitMQ Proxy component in at least one component of the source computer room changes from being able to produce but not consume to being unable to produce and consume.

2. The method according to claim 1, wherein: The method further comprises: Writing marking data into at least one component of the source computer room; The marking data is queried in at least one component of the target computer room, and if the marking data is found, it is determined that data synchronization is completed.

3. The method according to claim 1 or 2, wherein: After the data synchronization is completed, the method further includes: switching the synchronization direction of a target component in at least one component between the source computer room and the target computer room.

4. The method according to claim 3, wherein: The target component includes a MySQL component and / or a MongoDB component; and the switching of the synchronization direction of the target component in at least one component between the source computer room and the target computer room further includes: Switches the synchronization direction of the data replication center of the MySQL component and / or the MongoDB component.

5. The method according to claim 1, wherein: After the data writing permission process and / or the consumption permission process is performed, the method further includes: A traffic switching notification is sent to the initiator of the switching request to instruct the initiator to migrate the traffic for the service to the target computer room.

6. A control system for multi-machine room service switching, comprising: A switching control platform and at least two computer rooms, wherein the at least two computer rooms are deployed with multiple components that various services depend on; wherein, The switching control platform is adapted to: determine at least one component that the service depends on based on a cross-machine room switching request from a source machine room to a target machine room of any service; send a first linkage control command to at least one component in the source machine room; and send a second linkage control command to at least one component in the target machine room after data synchronization is completed; At least one target component of the source computer room is suitable for: performing write prohibition processing and / or stopping consumption processing according to the first linkage control command, and synchronizing data to at least one component of the target computer room; wherein, after responding to the first linkage control command, the MySQL component, MongoDB component and / or Codis component in at least one component of the source computer room changes from readable and writable to readable and non-writable, and the Redis Queue Proxy component and / or RabbitMQ Proxy component in at least one component of the source computer room changes from being producible and consumable to being producible and non-consumable; At least one target component of the target computer room is suitable for: according to the second linkage control command, allowing data writing processing and / or allowing production and consumption processing to complete service switching; wherein, after responding to the second linkage control command, the MySQL component, MongoDB component and / or Codis component in at least one component of the target computer room changes from non-writable to readable and writable, and the Redis Queue Proxy component and / or RabbitMQ Proxy component in at least one component of the target computer room changes from non-production and non-consumption to production and consumption; The switching control platform is also suitable for: sending a third linkage control command to at least one component of the source computer room; at least one component of the source computer room stops production processing according to the third linkage control command; wherein, after responding to the third linkage control command, the Redis Queue Proxy component and / or the RabbitMQ Proxy component in at least one component of the source computer room changes from being able to produce but not consume to being neither producing nor consuming.

7. The system according to claim 6, wherein: The switching control platform is also suitable for: Writing marking data into at least one component of the source computer room; The marking data is queried in at least one component of the target computer room, and if the marking data is found, it is determined that data synchronization is completed.

8. The system according to claim 6 or 7, wherein: The switching control platform is also suitable for: Switch the synchronization direction of the target component in at least one component between the source computer room and the target computer room.

9. The system according to claim 8, wherein: The target component includes a MySQL component and / or a MongoDB component; the switching control platform is also suitable for: Switches the synchronization direction of the data replication center of the MySQL component and / or the MongoDB component.

10. The system according to claim 6, wherein: The switching control platform is also suitable for: A traffic switching notification is sent to the initiator of the switching request to instruct the initiator to migrate the traffic for the service to the target computer room.

11. A computing device comprising: A processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus; The memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform operations corresponding to the control method for multi-computer room service switching as described in any one of claims 1-5.

12. A computer storage medium, wherein at least one executable instruction is stored in the storage medium, and the executable instruction executes an operation corresponding to the control method for multi-computer room service switching according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Migration method for micro-service in multiple machine rooms, electronic device and storage medium

    CN110673941A