Detailed Description
Features and exemplary embodiments of various aspects of the present invention will be described in detail below, and in order to make objects, technical solutions and advantages of the present invention more apparent, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not to be construed as limiting the invention. It will be apparent to one skilled in the art that the present invention may be practiced without some of these specific details. The following description of the embodiments is merely intended to provide a better understanding of the present invention by illustrating examples of the present invention.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
Fig. 1 is a system architecture diagram showing one example of an existing distributed service invocation system. As shown in fig. 1, the distributed service invocation system includes a registry 101 and a plurality of service devices communicatively connected to the registry 101, where a service device may be a server, and each service device registers a device identifier, a supported business service, and a device address of the service device in the registry 101. When a service device receives a service call instruction for a service, the service device becomes the service call device 102, and other service devices supporting the service become the service providing devices 103.
In the distributed service invocation system shown in fig. 1, the service invocation device 102 may send a subscription service request to the registry 101, the registry 101 queries the service provision device information of all the service provision devices 103 supporting the service based on the subscription service request, and the service invocation device 102 selects one invocation service from the service provision devices 103 supporting the service after receiving the service provision device information.
Under the condition that the distributed service calling system shown in fig. 1 is used for constructing the disaster recovery system, two sets of distributed service calling systems need to be arranged, so that the cost of the whole system is higher, the disaster recovery management is more difficult, the disaster recovery switching speed of the business service is lower, the reliability of the business service is reduced, and the data loss of the business service can be caused.
In order to solve the problem of the prior art, embodiments of the present invention provide a distributed service invocation system, and a service invocation method, apparatus, device and medium for the distributed service invocation system.
Fig. 2 is a system architecture diagram of a distributed service invocation system provided by an embodiment of the present invention. As shown in fig. 2, the distributed service invocation system includes a registry 201 and a plurality of service devices communicatively connected to the registry 201, wherein the service device may be a server, and the server may be a high-performance electronic calculator for storing and processing data. Each service device has registered in the registry 201 the device identification, the supported business services and the device address of the service device. When a service device receives a service call instruction for a service, the service device becomes the service call device 202, and other service devices supporting the service become the service providing devices 203.
With continued reference to fig. 2, the distributed service invocation system includes a plurality of data centers, wherein the data center including the service providing device 203 is the callable data center 204, and the plurality of service providing devices 203 are respectively located in different callable data centers 204. Wherein the number of service providing devices 203 in different callable data centers 204 may be the same or different. Each service providing device 203 may support one business service or a plurality of business services.
Since the plurality of service providing apparatuses 203 are respectively located in different callable data centers 204, each service apparatus also needs to register, in the registry 201, a data center identification of the data center to which the service apparatus belongs.
In the distributed service invocation system shown in fig. 2, the service invocation device 202 may send a subscription service request to the registration center 201, the registration center 201 queries the service provision device information of all the service provision devices 203 supporting the service based on the subscription service request, after receiving the service provision device information, the service invocation device 202 selects one invocation service from the invokable data centers 204 supporting the service, and when a disaster occurs in the invokable data center 204 for invoking the service, selects one invocation service from the other invokable data centers 204 to implement disaster-tolerant handover of service invocation.
With continued reference to fig. 2, the distributed service invocation system further includes a service control device 205, and the service control device 205 can control the operation of each data center with the registry 201.
Next, a service invocation method provided in an embodiment of the present invention is described in detail with reference to the distributed service invocation system shown in fig. 2.
Fig. 3 is a flowchart illustrating a service invocation method according to an embodiment of the present invention. Among them, the service invocation method shown in fig. 3 can be applied to the service invocation apparatus 202 in fig. 2. As shown in fig. 3, the service invocation method may include:
s310, under the condition that a disaster occurs in the primary data center, stopping calling the target service through the primary data center; the target service is provided with a plurality of adjustable data centers, the plurality of adjustable data centers are determined according to service providing equipment information corresponding to the target service, the data center with the highest priority in the plurality of adjustable data centers is a main data center, other data centers except the main data center in the plurality of adjustable data centers are disaster recovery data centers, and the priority of the plurality of adjustable data centers is determined according to the preset data center priority of the target service;
s320, determining a first data center with the highest priority in the disaster recovery data center according to the priority of the data center;
s330, sending a service calling request to the first data center to call the target service.
In the embodiment of the invention, the target service is provided with a plurality of tunable data centers determined according to the service providing equipment information corresponding to the target service, the data center with the highest priority determined according to the data center priority of the preset target service in the plurality of tunable data centers is used as a main data center, and other data centers are used as disaster backup data centers, so that a disaster tolerant mode can be formed through the main data center and the disaster backup data centers.
In the embodiment of the present invention, specifically, the data center may be called as a data center having service providing devices supporting the target service, which is determined according to the service providing device information corresponding to the target service. The service providing device may be the service providing device 203 in fig. 2.
In some embodiments of the present invention, the service providing device information may be obtained from the registry 201 in fig. 2.
Optionally, before S310, the service calling method may further include:
sending a subscription request for subscribing the target service to a registry;
and receiving the service providing equipment information fed back by the registration center.
Specifically, after receiving a service call instruction for a target service, the service call device may send a subscription request for subscribing the target service to the registration center in response to the service call instruction, and after receiving the subscription request, the registration center may determine, in the registered service devices, a service providing device that supports the target service according to the supported service registered by each service device, and feed back service providing device information corresponding to the service providing device to the service call device, so that the service call device obtains the service providing device information.
In some embodiments of the present invention, the service providing device information may include a plurality of service providing devices supporting the target service and device information of each service providing device, where the device information includes a data center identifier of a data center to which the device information belongs, so as to determine, according to the service providing device information, an invokable data center corresponding to the target service.
Optionally, after receiving the service providing device information fed back by the registry and before S310, the service invoking method may further include:
acquiring data center identifications corresponding to a plurality of service providing devices in the service providing device information;
and determining a plurality of callable data centers according to the acquired data center identification.
Therefore, the data center identifier can be used to add a "data center" attribute to each service providing device, so that the service invoking device can divide the service providing devices into the data centers according to the data center identifier of the data center to which each service providing device belongs in the service providing device information.
In some embodiments of the present invention, before S310, a primary data center may be further selected among the plurality of callable data centers according to priorities of the plurality of callable data centers, and specifically, the priorities of the plurality of callable data centers are determined according to preset data center priorities of target services.
Optionally, after receiving the service providing device information fed back by the registry and before S310, the service invoking method may further include:
acquiring the priority of a data center; the data center priority is the priority aiming at a plurality of data centers, and the plurality of data centers comprise callable data centers;
determining the priorities of the plurality of callable data centers according to the priorities of the data centers;
a primary data center is determined among the plurality of callable data centers based on the callable data center priorities.
In these embodiments, as shown in the distributed service invocation system in fig. 2, the distributed service invocation system may include a plurality of data centers, and since not every data center supports the target service, nor every data center that supports the target service is currently in a normal operation state, the plurality of invokable data centers determined according to the service providing device information are not necessarily all data centers that support the target service in the plurality of data centers of the distributed service invocation system. However, because the operating states of the multiple data centers of the distributed service invocation system are dynamic, the data centers that can be invoked each time the target service is invoked may be different, and therefore, the data center priorities of all the data centers that support the target service need to be configured in advance in the service invocation device. Accordingly, after determining the plurality of callable data centers, the callable data center priorities may be determined using the data center priorities, and the data center with the highest priority among the plurality of callable data centers may be selected as the primary data center according to the callable data center priorities.
In some embodiments of the present invention, after the primary data center is determined, the service invocation device may send a service invocation request to the primary data center to invoke the target service, so as to invoke the target service through the data center with the highest priority in the callable data centers.
In some embodiments of the present invention, the specific method of S320 may include:
and determining a first data center in the disaster recovery data center according to the priority of the callable data center.
Specifically, since the priority of the callable data center is already determined according to the priority of the data center, in the case of a disaster in the primary data center, it is not necessary to re-determine the priority of the disaster-backup data center, and only the data center with the highest priority is selected as the first data center with the highest priority in the disaster-backup data centers according to the determined priority of the callable data center.
In some embodiments of the present invention, in the case of a disaster occurring in the first data center, the data center with the highest priority may also be determined in the disaster recovery data center, and a service invocation request may be sent to the data center with the highest priority to invoke the target service. In the case of a disaster in the data center with the highest priority, the process is repeated in the same way, and details are not described here.
Therefore, in the embodiment of the present invention, the service invocation device may automatically determine, according to the preset data center priority, the primary data center in the plurality of callable data centers and the first data center in the disaster recovery data center by using the "data center" attribute of the service providing device, so as to implement automatic switching of disaster recovery.
In other embodiments of the present invention, the service providing device information may include a plurality of service providing devices supporting the target service and device information of each service providing device, and the device information may include a data center identifier of the data center, device operation information, and device address information, so that the target service is invoked through at least one service providing device in the data center selected by the service invoking device using the device information of the service providing device.
Next, a description will be given taking the data center selected by the service invocation device as the first data center as an example.
Optionally, the specific method of S330 may include:
determining first service providing equipment belonging to a first data center according to data center identifications corresponding to a plurality of service providing equipment in the service providing equipment information;
determining a first target service providing device in a first service providing device according to device operation information corresponding to a plurality of service providing devices in the service providing device information and a preset device calling rule;
determining a first target device address corresponding to a first target service providing device according to device address information corresponding to a plurality of service providing devices in the service providing device information;
and sending a service calling request to the first target service providing equipment through the first target equipment address so as to call the target service.
Specifically, in the case of a disaster occurring in the primary data center, after the service invocation device determines the first data center in the disaster recovery data center, the first service providing device having the data center identifier corresponding to the first data center may be selected according to the data center identifier corresponding to the plurality of service providing devices in the service providing device information, then the device operation information of each first service providing device may be determined according to the device operation information corresponding to the plurality of service providing devices in the service providing device information, and a first target service providing device capable of performing service invocation may be selected in the first service providing device by using a preset device invocation rule, for example, a load balancing rule, and a first target device address corresponding to the first target service providing device may be searched according to the device address information corresponding to the plurality of service providing devices in the service providing device information, thereby sending a service invocation request to the first target service providing device through the first target device address to invoke the target service.
In some embodiments of the invention, the service invocation device may determine that the primary data center has suffered a disaster using a notification sent by the primary data center. In other embodiments of the present invention, the service invocation device may also determine that the primary data center has suffered a disaster using the notification sent by the registry. In still other embodiments of the present invention, the service invocation device may also determine that the primary data center has suffered a disaster using notifications sent by the primary data center and the registry.
In some embodiments of the present invention, optionally before S310, the service invoking method may further include:
receiving a service exception notification;
in response to the service exception notification, determining an equipment running state of at least one second service providing equipment supporting the target service in the main data center;
and under the condition that the equipment operation states of the at least one second service providing device are all abnormal operation states, determining that the disaster happens to the primary data center.
In some embodiments, the service exception notification may be a notification sent by the primary data center. Specifically, the service exception notification may be a call request failure notification sent by second service providing equipment of the primary data center, which supports the target service, and when it is determined that the second service providing equipment of the primary data center, which supports the target service, all feed back the call request failure notification, it may be determined that the equipment operating states of at least one second service providing equipment are all abnormal operating states, so that it may be determined that the disaster occurs in the primary data center.
In other embodiments, the service anomaly notification may also be a notification sent by a registry. Specifically, the service exception notification may be a communication failure notification sent by the registry to the service invocation device when communication between the registry and the second service providing device supporting the target service fails, and when it is determined according to the communication failure notification that the second service providing device supporting the target service of the main data center fails to communicate with the registry, it may be determined that the device operating states of the at least one second service providing device are all abnormal operating states, so that it may be determined that a disaster occurs in the main data center.
In some embodiments, the service anomaly notification may also be a notification sent by the primary data center and a notification sent by the registry, and therefore, the above two notifications may be used to determine the device operating status of the at least one second service providing device in combination to determine whether the disaster occurs in the primary data center.
In other embodiments of the present invention, optionally before S310, the service invoking method may further include:
receiving a data center removal notification sent by a registration center;
in response to the data center removal notification, determining, among the plurality of callable data centers, a second data center to be removed;
and in the case that the second data center is the primary data center, determining that the disaster happens to the primary data center.
Specifically, when the registry confirms that the device operating states of the service providing devices supporting the target service in any one of the data centers are abnormal operating states, that is, the service providing devices supporting the target service in the data center are completely unavailable, the registry removes the service providing devices supporting the target service in the data center, that is, removes the data center from the callable data center of the target service, and after removal, sends a data center removal notification with the data center identification of the data center to the service invoking device invoking the target service through the data center, and after receiving the data center removal notification, the service invoking device determines the removed second data center according to the data center identification in the data center removal notification, and determines whether the second data center is a main data center, and if it is determined that the second data center is the main data center, it can be determined that a disaster occurred in the primary data center.
In further embodiments of the present invention, optionally before S310, the service invoking method may further include:
receiving a state change notification sent by a registration center;
determining a third data center that changes an operating state in response to the state change notification;
and determining that the disaster occurs in the primary data center under the condition that the third data center is the primary data center and the changed operation state of the third data center is the operation stopping state.
Specifically, the registry may receive a state change instruction from the service control apparatus 205 in fig. 2, and generate a state change notification according to a data center identifier of a third data center that changes an operation state in the state change instruction and a changed operation state of the third data center, and send the state change notification to the service invocation apparatus. After receiving the state change notification, the service calling device determines the third data center with the changed operation state and the changed operation state of the third data center, firstly judges whether the third data center is the main data center, and determines that the service control device sets the main data center to be in an 'un-shutdown state' under the condition that the third data center is determined to be the main data center and the changed operation state of the third data center is in a shutdown state, so that the disaster of the main data center is determined.
The specific method for the service control device 205 to generate the state change instruction will be described in detail below, and will not be described herein again.
In the embodiment of the invention, in the case of disaster of the main data center, the system has two modes of warm standby and cold standby. In the warm standby mode, the information of the service providing device obtained from the registration center according to the subscription request when the service calling device is started can be directly utilized to execute S320-330, so as to perform disaster recovery switching of the target service in real time. In the cold standby mode, the service invocation device needs to perform disaster recovery switching of the target service according to the device address of the cold standby service provision device which is pushed by the registration center and is started up.
In some embodiments, optionally, in the cold standby mode, after S310, the service calling method may further include:
and under the condition of receiving the address information of the target equipment sent by the registration center, sending a service calling request to the target service providing equipment corresponding to the address information of the target equipment so as to call the target service.
The target device address information refers to the device address information of the cold-standby service providing device which is started and completed.
In some embodiments of the present invention, the service invocation method may further include:
in the case of receiving a change notification of the primary data center sent by the registry, determining a fourth data center indicated by the change notification of the primary data center in the plurality of callable data centers;
updating the fourth data center to be a main data center;
and sending a service calling request to a fourth data center to call the target service.
Specifically, the registry may receive a primary data center change instruction from the service control device 205 in fig. 2, and generate a primary data center change notification according to a data center identifier of a fourth data center that needs to be changed to the primary data center in the primary data center change instruction, and send the primary data center change notification to the service invocation device. After receiving the change notification of the main data center, the service calling device determines a fourth data center indicated by the change notification of the main data center according to the data center identification in the change notification of the main data center, takes the fourth data center as a new main data center, and sends a service calling request to the fourth data center to call a target service, so that manual switching of the main data center is completed.
The specific method for the service control device 205 to generate the primary data center change instruction will be described in detail below, and will not be described herein again.
Fig. 4 is a flowchart illustrating a service invocation method according to another embodiment of the present invention. Among them, the service calling method shown in fig. 4 can be applied to the service control apparatus 205 in fig. 2. As shown in fig. 4, the service invocation method may include:
s410, acquiring first interactive operation data;
s420, responding to the first interactive operation data, and determining a third data center with a changed operation state and a changed operation state of the third data center;
s430, generating a state change instruction according to the third data center and the changed running state;
s440, sending a state change instruction to the registry so that the registry sends a state change notification corresponding to the state change instruction to the service calling equipment calling the target service through the third data center.
In the embodiment of the present invention, the service control device may be used for manual switching and manual control of some special switching scenarios, for example, the first service providing device in the first data center needs a certain preparation time and cannot be switched in real time, or a new main data center is set without stopping the operation state of the main data center, so as to implement unified integrated management of all registered data centers and service providing devices in the registration center.
Fig. 5 illustrates an operation state control interface diagram according to an embodiment of the present invention. As shown in fig. 5, the service control device 205 may be provided with a working state control interface, where the working state control interface is used for interacting with a user, acquiring interaction operation data of the user, and generating a corresponding instruction according to the interaction operation data.
In some embodiments of the present invention, S410 may specifically include:
receiving a first input operation of a user on a target state control button on a working state control interface; the working state control interface comprises a plurality of data centers registered on a registration center and a plurality of state control buttons corresponding to each data center;
and acquiring first interactive operation data aiming at the target state control button in response to the first input operation.
Referring to fig. 5, the working status control interface diagram shows two callable data centers, which are a beijing data center and a shanghai data center, respectively, the beijing data center has 6 service providing devices, the shanghai data center has 2 service providing devices, the beijing data center and the shanghai data center have three status control buttons 510, which are a "default" control button, a "start" control button, and a "close" control button, respectively, wherein the "start" control button and the "close" control button are used to change the operating status of the corresponding callable data center. The "set to enable" control button can set all service providing equipment in the corresponding callable data center to be in a normal operation state, so that the callable data center is in the normal operation state; the "set to off" control button may set all service providing devices in the corresponding callable data center to a stopped state, leaving the callable data center in the stopped state.
Specifically, the first input operation may be a click operation for a target state control button of the "set to on" control button and the "set to off" control button, and when the user clicks the target state control button, the service control device may obtain first interactive operation data for the target state control button, where the first interactive operation data includes a data center and an operating state corresponding to the target state control button, the data center is used as a third data center, and the operating state is used as a changed operating state.
In some embodiments of the present invention, S430 may specifically include generating a state change instruction according to the data center identifier of the third data center and the changed operation state.
In these embodiments, after any callable data center is set to a shutdown state, the callable data center is removed from the registry, so that the registry can also cause the service invocation device to switch the data center invoking the target service by sending a data center removal notification to the service invocation device.
Further, in the case that the above-mentioned callable data center set in the stop operation state is set in the normal operation state again, the registry may also make the service call device switch back to call the target service through the callable data center by sending a master data center state notification to the service call device.
Therefore, the manual switching mode provided by the embodiment of the invention can meet part of disaster recovery backup switching requirements, has very strong adaptability, and meets most of service disaster recovery backup switching requirements.
In other embodiments of the present invention, the service invocation method may further include:
receiving a second input operation of a user on a state control button on the working state control interface;
acquiring second interactive operation data aiming at the state control button in response to a second input operation;
determining a fourth data center to be changed into a main data center according to the second interactive operation data;
generating a main data center change instruction according to the data center identification of the fourth data center;
and sending a main data center change instruction to the registry so that the registry sends a main data center change notice corresponding to the data center change instruction to the service calling equipment.
With continued reference to fig. 5, the second input operation is a click operation on the "set to default" control button, and when the user clicks any "set to default" control button, it may be determined that the data center corresponding to the "set to default" control button is used as a new primary data center, that is, the data center corresponding to the "set to default" control button is used as a fourth data center to be changed, and a primary data center change instruction is generated according to a data center identifier of the fourth data center.
In summary, the service invocation method provided by the embodiment of the present invention can be applied to a distributed service invocation system, and the switching manner is flexible, strong in adaptability and high in universality, and can meet personalized and constantly changing requirements. Meanwhile, the complexity of the distributed service calling system is low, and the development efficiency of the distributed service calling system and the capability of coping with disaster recovery demand change are greatly improved.
Fig. 6 is a schematic structural diagram of a service invocation device according to an embodiment of the present invention. The service invocation means shown in fig. 6 can be applied to the service invocation device 202 in fig. 2. As shown in fig. 6, the service invocation means may include:
the first call control module 610 is configured to stop calling the target service through the primary data center when a disaster occurs in the primary data center; the target service is provided with a plurality of tunable data centers, the plurality of tunable data centers are determined according to service providing equipment information corresponding to the target service, the data center with the highest priority in the plurality of tunable data centers is a main data center, other data centers except the main data center in the plurality of tunable data centers are disaster recovery data centers, and the priority of the plurality of tunable data centers is determined according to the preset data center priority of the target service;
a data center reselection module 620, configured to determine, according to a priority of a data center, a first data center with a highest priority in the disaster recovery data center;
and a second call control module 630, configured to send a service call request to the first data center to call the target service.
In the embodiment of the invention, the target service is provided with a plurality of tunable data centers determined according to the service providing equipment information corresponding to the target service, the data center with the highest priority determined according to the data center priority of the preset target service in the plurality of tunable data centers is used as a main data center, and other data centers are used as disaster backup data centers, so that a disaster tolerant mode can be formed through the main data center and the disaster backup data centers.
In the embodiment of the present invention, specifically, the data center may be called as a data center having service providing devices supporting the target service, which is determined according to the service providing device information corresponding to the target service. The service providing device may be the service providing device 203 in fig. 2.
In some embodiments of the present invention, the service providing device information may be obtained from the registry 201 in fig. 2.
Optionally, the service invoking device may further include:
a subscription request sending module for sending a subscription request for subscribing the target service to the registry;
and the equipment information receiving module is used for receiving the service providing equipment information fed back by the registration center.
In some embodiments of the present invention, the service providing device information includes a plurality of service providing devices supporting the target service and device information of each service providing device, and the device information includes a data center identifier of a data center to which the device information belongs, so as to determine an invokable data center corresponding to the target service according to the service providing device information.
In some embodiments of the present invention, the service invoking device may further include:
a center identifier obtaining module, configured to obtain data center identifiers corresponding to multiple service providing devices in the service providing device information;
and the callable center determining module is used for determining a plurality of callable data centers according to the acquired data center identification.
Therefore, the data center identifier can be used to add a "data center" attribute to each service providing device, so that the service invoking device can divide the service providing devices into the data centers according to the data center identifier of the data center to which each service providing device belongs in the service providing device information.
In some embodiments of the present invention, the service invoking device may further include:
the priority acquisition module is used for acquiring the priority of the data center; the data center priority is the priority aiming at a plurality of data centers, and the plurality of data centers comprise callable data centers;
the priority determining module is used for determining the priorities of the callable data centers of the plurality of callable data centers according to the priorities of the data centers;
and the master center determining module is used for determining a master data center in the plurality of the callable data centers according to the callable data center priority.
In some embodiments of the present invention, the service invoking device may further include:
and the third calling control module is used for sending a service calling request to the main data center so as to call the target service.
In some embodiments of the present invention, the data center reselection module 620 may be specifically configured to:
and determining a first data center in the disaster recovery data center according to the priority of the callable data center.
Therefore, in the embodiment of the present invention, the service invocation device may automatically determine, according to the preset data center priority, the primary data center in the plurality of callable data centers and the first data center in the disaster recovery data center by using the "data center" attribute of the service providing device, so as to implement automatic switching of disaster recovery.
In other embodiments of the present invention, the service providing device information may include a plurality of service providing devices supporting the target service and device information of each service providing device, and the device information may include a data center identifier of the data center, device operation information, and device address information, so that the target service is invoked through at least one service providing device in the data center selected by the service invoking device using the device information of the service providing device.
Next, a description will be given taking the data center selected by the service invocation device as the first data center as an example.
In some embodiments of the present invention, the second call control module 630 may be specifically configured to:
determining first service providing equipment belonging to a first data center according to data center identifications corresponding to a plurality of service providing equipment in the service providing equipment information;
determining a first target service providing device in a first service providing device according to device operation information corresponding to a plurality of service providing devices in the service providing device information and a preset device calling rule;
determining a first target device address corresponding to a first target service providing device according to device address information corresponding to a plurality of service providing devices in the service providing device information;
and sending a service calling request to the first target service providing equipment through the first target equipment address so as to call the target service.
In some embodiments of the present invention, the service invoking device may further include:
the first notice receiving module is used for receiving a service abnormity notice;
the first notification processing module is used for responding to the service exception notification and determining the equipment running state of at least one second service providing equipment supporting the target service in the main data center;
and the first disaster determination module is used for determining that the disaster occurs in the primary data center under the condition that the equipment operation states of the at least one second service providing equipment are all abnormal operation states.
Optionally, the service exception notification is a notification sent by the main data center and/or a notification sent by the registry.
In other embodiments of the present invention, the service invoking device may further include:
the second notification receiving module is used for receiving a data center removal notification sent by the registration center;
a second notification processing module to determine, among the plurality of callable data centers, a second data center to be removed in response to the data center removal notification;
and the second disaster determination module is used for determining that the disaster happens to the primary data center under the condition that the second data center is the primary data center.
In still other embodiments of the present invention, the service invoking device may further include:
the third notification receiving module is used for receiving a state change notification sent by the registration center;
the third notification processing module is used for responding to the state change notification and determining a third data center for changing the running state;
and the third disaster determination module is used for determining that the disaster occurs in the main data center under the condition that the third data center is the main data center and the changed operation state of the third data center is the stop operation state.
In some embodiments of the present invention, the service invoking device may further include:
and the fourth calling control module is used for sending a service calling request to the target service providing equipment corresponding to the address information of the target equipment so as to call the target service under the condition of receiving the address information of the target equipment sent by the registration center.
In some embodiments of the present invention, the service invoking device may further include:
the fourth notification receiving module is used for determining a fourth data center indicated by the change notification of the main data center in the plurality of the callable data centers under the condition that the change notification of the main data center sent by the registration center is received;
the fourth notification processing module is used for updating the fourth data center into a main data center;
and the fifth calling control module is used for sending a service calling request to the fourth data center so as to call the target service.
It should be noted that the service invocation apparatus in the embodiment shown in fig. 6 can implement all functions and effects of the service invocation method in the embodiment shown in fig. 3, and the principles are similar, which are not described herein again.
Fig. 7 is a schematic structural diagram of a service invocation device according to another embodiment of the present invention. Among them, the service invocation means shown in fig. 7 can be applied to the service control apparatus 205 in fig. 2. As shown in fig. 7, the service invocation means may include:
a first data obtaining module 710, configured to obtain first interactive operation data;
a first data processing module 720, configured to determine, in response to the first interoperation data, a third data center of which the operation state is changed and a changed operation state of the third data center;
the first instruction generating module 730 is configured to generate a state change instruction according to the third data center and the changed operation state;
the first instruction sending module 740 is configured to send a state change instruction to the registry, so that the registry sends a state change notification corresponding to the state change instruction to the service invoking device invoking the target service through the third data center.
In the embodiment of the present invention, the service control device may be used for manual switching and manual control of some special switching scenarios, for example, the first service providing device in the first data center needs a certain preparation time and cannot be switched in real time, or a new main data center is set without stopping the operation state of the main data center, so as to implement unified integrated management of all registered data centers and service providing devices in the registration center.
In some embodiments of the present invention, the first data obtaining module 710 is specifically configured to:
receiving a first input operation of a user on a target state control button on a working state control interface; the working state control interface comprises a plurality of data centers registered on a registration center and a plurality of state control buttons corresponding to each data center;
and acquiring first interactive operation data aiming at the target state control button in response to the first input operation.
In other embodiments of the present invention, the service invoking device may further include:
the second data acquisition module is used for receiving a second input operation of the user on a state control button on the working state control interface; acquiring second interactive operation data aiming at the state control button in response to a second input operation;
the second data processing module is used for determining a fourth data center to be changed into the main data center according to the second interactive operation data;
the second instruction generation module is used for generating a main data center change instruction according to the data center identification of the fourth data center;
and the second instruction sending module is used for sending a main data center change instruction to the registry so that the registry sends a main data center change notification corresponding to the data center change instruction to the service calling equipment.
It should be noted that the service invocation apparatus in the embodiment shown in fig. 7 can implement all functions and effects of the service invocation method in the embodiment shown in fig. 4, and the principles are similar, which are not described herein again.
Fig. 8 is a schematic diagram illustrating a hardware structure of a service invocation device according to an embodiment of the present invention. As shown in fig. 8, the service invocation device may include a processor 801 and a memory 802 in which computer program instructions are stored.
Specifically, the processor 801 may include a Central Processing Unit (CPU), or an Application Specific Integrated Circuit (ASIC), or may be configured as one or more Integrated circuits implementing embodiments of the present invention.
Memory 802 may include mass storage for data or instructions. By way of example, and not limitation, memory 802 may include a Hard Disk Drive (HDD), a floppy Disk Drive, flash memory, an optical Disk, a magneto-optical Disk, a tape, or a Universal Serial Bus (USB) Drive or a combination of two or more of these. Memory 802 may include removable or non-removable (or fixed) media, where appropriate. The memory 802 may be internal or external to the integrated gateway disaster recovery device, where appropriate. In a particular embodiment, the memory 802 is a non-volatile solid-state memory. In a particular embodiment, the memory 802 includes Read Only Memory (ROM). Where appropriate, the ROM may be mask-programmed ROM, Programmable ROM (PROM), Erasable PROM (EPROM), Electrically Erasable PROM (EEPROM), electrically rewritable ROM (EAROM), or flash memory or a combination of two or more of these.
The processor 801 reads and executes computer program instructions stored in the memory 802 to implement any of the service invocation methods in the above-described embodiments.
In one example, the service invocation device may also include a communication interface 803 and a bus 810. As shown in fig. 8, the processor 801, the memory 802, and the communication interface 803 are connected via a bus 810 to complete communication therebetween.
The communication interface 803 is mainly used for implementing communication between modules, apparatuses, units and/or devices in the embodiments of the present invention.
The bus 810 includes hardware, software, or both to couple the components of the service invocation device to each other. By way of example, and not limitation, a bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a Hypertransport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an infiniband interconnect, a Low Pin Count (LPC) bus, a memory bus, a Micro Channel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a video electronics standards association local (VLB) bus, or other suitable bus or a combination of two or more of these. Bus 810 may include one or more buses, where appropriate. Although specific buses have been described and shown in the embodiments of the invention, any suitable buses or interconnects are contemplated by the invention.
The service invoking device implements each function of the service invoking method and apparatus described with reference to fig. 1 to fig. 7, which is not described herein again.
In addition, in combination with the service invocation method in the foregoing embodiment, the embodiment of the present invention may provide a computer storage medium to implement. The computer storage medium having computer program instructions stored thereon; the computer program instructions, when executed by a processor, implement any of the service invocation methods in the above embodiments.
It is to be understood that the invention is not limited to the specific arrangements and instrumentality described above and shown in the drawings. A detailed description of known methods is omitted herein for the sake of brevity. In the above embodiments, several specific steps are described and shown as examples. However, the method processes of the present invention are not limited to the specific steps described and illustrated, and those skilled in the art can make various changes, modifications and additions or change the order between the steps after comprehending the spirit of the present invention.
The functional blocks shown in the above-described structural block diagrams may be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, it may be, for example, an electronic circuit, an Application Specific Integrated Circuit (ASIC), suitable firmware, plug-in, function card, or the like. When implemented in software, the elements of the invention are the programs or code segments used to perform the required tasks. The program or code segments may be stored in a machine-readable medium or transmitted by a data signal carried in a carrier wave over a transmission medium or a communication link. A "machine-readable medium" may include any medium that can store or transfer information. Examples of a machine-readable medium include electronic circuits, semiconductor memory devices, ROM, flash memory, Erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, fiber optic media, Radio Frequency (RF) links, and so forth. The code segments may be downloaded via computer networks such as the internet, intranet, etc.
It should also be noted that the exemplary embodiments mentioned in this patent describe some methods or systems based on a series of steps or devices. However, the present invention is not limited to the order of the above-described steps, that is, the steps may be performed in the order mentioned in the embodiments, may be performed in an order different from the order in the embodiments, or may be performed simultaneously.
As described above, only the specific embodiments of the present invention are provided, and it can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the system, the module and the unit described above may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again. It should be understood that the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive various equivalent modifications or substitutions within the technical scope of the present invention, and these modifications or substitutions should be covered within the scope of the present invention.