CN107948284B - Service offline method, device and system based on micro-service architecture - Google Patents

Service offline method, device and system based on micro-service architecture Download PDF

Info

Publication number
CN107948284B
CN107948284B CN201711192759.4A CN201711192759A CN107948284B CN 107948284 B CN107948284 B CN 107948284B CN 201711192759 A CN201711192759 A CN 201711192759A CN 107948284 B CN107948284 B CN 107948284B
Authority
CN
China
Prior art keywords
service
registration
service node
node
list
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201711192759.4A
Other languages
Chinese (zh)
Other versions
CN107948284A (en
Inventor
刘伟奇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Taikang Insurance Group Co Ltd
Original Assignee
Taikang Insurance Group Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Taikang Insurance Group Co Ltd filed Critical Taikang Insurance Group Co Ltd
Priority to CN201711192759.4A priority Critical patent/CN107948284B/en
Publication of CN107948284A publication Critical patent/CN107948284A/en
Application granted granted Critical
Publication of CN107948284B publication Critical patent/CN107948284B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/51Discovery or management thereof, e.g. service location protocol [SLP] or web services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5083Techniques for rebalancing the load in a distributed system
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources

Abstract

The embodiment of the application provides a method, equipment and a system for offline service based on a micro-service architecture, wherein the method comprises the following steps: determining a first service node, and sending an offline instruction to the first service node; confirming whether the service registration equipment deletes the address information of the first service node from a registration list; if the service registration equipment is confirmed to delete the address information of the first service node from the registration list, whether a cache list of the gateway equipment contains the address information of the first service node is confirmed; and if the cache list of the gateway equipment does not contain the address information of the first service node, sending an instruction for closing the first service node after the data request of the first service node is confirmed to be processed. According to the embodiment of the application system updating method and device, the updating efficiency and performance of the application system can be effectively improved, the loss of the external data request is effectively avoided, and the occurrence of calling failure of the external data request is reduced.

Description

Service offline method, device and system based on micro-service architecture
Technical Field
The embodiment of the application relates to the technical field of computers, in particular to a method, equipment and a system for offline service based on a micro-service architecture.
Background
In the prior art, an application system generally adopts a system architecture as shown in fig. 1, one load balancing server is connected with two servers, and the two servers correspond to the same application a to realize the same service function. When the external request is received, the external request is evenly distributed to two servers for processing by the load balancing server. The structure can meet the requirement of load balancing to a certain extent, but has the defect that the system cannot be updated and released in time. This is because all functions of the same application are grouped together, requiring a long start-up time once updated. In addition, the update release of the prior art application system is often performed late at night and cannot meet the high availability requirement. If the application system needs to be updated in an emergency, for example, when the system is abnormal, the data request being processed is often lost, which results in a failure of service invocation.
Disclosure of Invention
The embodiment of the application provides a method, equipment and a system for offline service based on a micro-service architecture, and aims to solve the technical problems that an application system in the prior art is low in updating efficiency and easy to lose data requests.
Therefore, the embodiment of the application provides the following technical scheme:
a first aspect of an embodiment of the present application discloses a service offline method based on a micro-service architecture, which is applied to a service control device, where the service control device is in communication connection with a service registration device, a gateway device, and each service node, and the method includes: the method comprises the steps that a service control device determines a first service node and sends an offline instruction to the first service node; the first service node corresponds to a first service, and the first service is one of a plurality of services included in a first application program; the service control equipment confirms whether the service registration equipment deletes the address information of the first service node from a registration list or not; the service registration equipment is used for deleting the address information of a first service node from a registration list after receiving an offline request sent by the first service node; if the service registration equipment is confirmed to delete the address information of the first service node from the registration list, the service control equipment confirms whether the cache list of the gateway equipment contains the address information of the first service node; the gateway device is used for updating the information of the cache list according to the information of the registration list; if the cache list of the gateway device does not contain the address information of the first service node, the service control device sends an instruction for closing the first service node after confirming that the data request of the first service node is processed.
In a second aspect of the embodiments of the present application, a method for offline service based on a micro-service architecture is disclosed, which is applied to a service registration device, where the service registration device is in communication connection with a service control device, a gateway device, and each service node, and the method includes: the service registration equipment receives an offline request sent by a first service node, and deletes address information of the first service node from a registration list; the service registration equipment sends an updated registration list to the gateway equipment, and the updated registration list is used for indicating the gateway equipment to update the cache list stored by the gateway equipment according to the updated registration list; the service registration device sends a message to the service control device indicating that the service control device has deleted the address information of the first service node from the registration list.
In a third aspect of the embodiments of the present application, a service offline method based on a micro-service architecture is disclosed, which is applied to a gateway device, where the gateway device is in communication connection with a service control device, a service registration device, and each service node, and the method includes: the gateway equipment receives an updated registration list sent by the service registration equipment, and updates a cache list stored by the gateway equipment according to the updated registration list; the gateway equipment sends a message to the service control equipment, wherein the message is used for indicating whether the cache list of the gateway equipment contains the address information of the first service node.
In a fourth aspect of the embodiments of the present application, a service control device is disclosed, including: the system comprises a determining unit, a sending unit and a receiving unit, wherein the determining unit is used for determining a first service node and sending an offline instruction to the first service node; the first service node corresponds to a first service, and the first service is one of a plurality of services included in a first application program; a first confirming unit configured to confirm whether the service registration apparatus deletes the address information of the first service node from the registration list; the service registration equipment is used for deleting the address information of a first service node from a registration list after receiving an offline request sent by the first service node; a second confirming unit, configured to confirm whether the cache list of the gateway device includes the address information of the first service node if it is confirmed that the service registration device has deleted the address information of the first service node from the registration list; the gateway device is used for updating the information of the cache list according to the information of the registration list; and the closing unit is used for sending an instruction for closing the first service node after the service control device confirms that the data request of the first service node is processed if the cache list of the gateway device does not contain the address information of the first service node.
In a fifth aspect of the embodiments of the present application, a service control apparatus is disclosed, which includes a memory, and one or more programs, where the one or more programs are stored in the memory and configured to be executed by one or more processors to perform the micro-service architecture based service offline method according to the first aspect.
In a sixth aspect of embodiments of the present application, a machine-readable medium is disclosed, on which instructions are stored, which when executed by one or more processors, cause an apparatus to perform the micro-service architecture based service offline method according to the first aspect.
A seventh aspect of the embodiments of the present application discloses a service registration apparatus, including: the deleting unit is used for receiving an offline request sent by the first service node and deleting the address information of the first service node from the registration list; a first sending unit, configured to send an updated registration list to a gateway device, and instruct the gateway device to update a cache list stored in the gateway device according to the updated registration list; a second sending unit, configured to send a message to a service control device, where the message is used to indicate that the service control device has deleted the address information of the first service node from the registration list.
In an eighth aspect of the embodiments of the present application, a service registration apparatus is disclosed, which includes a memory and one or more programs, where the one or more programs are stored in the memory and configured to be executed by one or more processors to perform the micro-service architecture based service offline method according to the second aspect.
In a ninth aspect of embodiments of the present application, a machine-readable medium is disclosed, on which instructions are stored, which when executed by one or more processors, cause an apparatus to perform the micro-service architecture based service offline method according to the second aspect.
In a tenth aspect of the embodiments of the present application, a gateway device is disclosed, which includes: a receiving unit, configured to receive an updated registration list sent by a service registration device, and update a cache list stored in the gateway device according to the updated registration list; a sending unit, configured to send a message to a service control device, where the message is used to indicate whether a cache list of the gateway device includes address information of a first service node.
In an eleventh aspect of the embodiments of the present application, a gateway device is disclosed, which includes a memory, and one or more programs, where the one or more programs are stored in the memory and configured to be executed by one or more processors to perform the service offline method based on the micro-service architecture according to the third aspect.
In a twelfth aspect of embodiments of the present application, a machine-readable medium is disclosed, on which instructions are stored, which when executed by one or more processors, cause an apparatus to perform the micro-service architecture based service offline method according to the third aspect.
The beneficial effects that at least one aspect of the embodiment of the application can reach are: according to the application, the service control device can select one or more service nodes corresponding to one service from a plurality of services contained in the first application program as the first service node, and the offline instruction is sent to the first service node. And the service control device sends an instruction for closing the first service node after confirming that the service registration device and the gateway device do not contain the address information of the first service node and the data request of the first service node is processed. According to the method and the device, offline processing can be executed for the sub-node of one of the services contained in the application program, and the service corresponding to the whole application program does not need to be offline, so that the application program can still provide the service to the outside when the service node is updated, and an external client calling the application program is unaware of the service, so that gray release of the application program service is realized, the processing performance and the updating efficiency of the application program are improved, and the user experience is improved. In addition, in the embodiment of the application, when it is determined that neither the registration device nor the gateway device includes the registration information of the first service node, the first service node is closed, so that a new external data request is not distributed to the first service node by the gateway, and the calling failure of the external data request is avoided. In addition, the first service node is closed after the data request of the first service node is confirmed to be processed, the data request being processed by the first service node is not lost, the calling failure of the external data request is avoided, and the user experience is improved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments described in the present application, and other drawings can be obtained by those skilled in the art without creative efforts.
FIG. 1 is a diagram of an application system architecture provided in the prior art;
FIG. 2 is a schematic diagram of a service offline system based on a microservice architecture according to an embodiment of the present disclosure;
fig. 3 is a schematic view of an application scenario provided in an embodiment of the present application;
FIG. 4 is a flowchart of a service offline method according to an embodiment of the present application;
FIG. 5 is a flowchart of a service logoff method according to another embodiment of the present application;
FIG. 6 is a flowchart of a service logoff method according to yet another embodiment of the present application;
fig. 7 is a signaling interaction diagram of a service offline method according to another embodiment of the present application;
fig. 8 is a schematic diagram of a service control device according to an embodiment of the present application;
fig. 9 is a schematic diagram of a service control apparatus according to another embodiment of the present application;
fig. 10 is a schematic diagram of a service registration apparatus according to an embodiment of the present application;
FIG. 11 is a schematic diagram of a service registration apparatus provided in another embodiment of the present application;
fig. 12 is a schematic diagram of a gateway device according to an embodiment of the present application;
fig. 13 is a schematic diagram of a gateway device according to another embodiment of the present application.
Detailed Description
The embodiment of the application provides a method, equipment and a system for service offline based on a micro-service architecture, which effectively improve the updating efficiency and performance of an application system, effectively avoid the loss of external data requests and reduce the calling failure of the external data requests.
Referring to fig. 2, a schematic diagram of a service offline system based on a microservice architecture provided in the embodiment of the present application is shown. The service offline system includes a service control device 800, a service registration device 1000, a Gateway device Gateway1200, each service node 101, 102, 201, 202, 301, 302, and the like.
It should be noted that, in the micro service architecture provided in the embodiment of the present application, the whole application program is generally split into a plurality of sub-services, that is, micro services. Different micro services are independent and do not interfere with each other, can be independently compiled, upgraded and deployed, and expose the services to the outside through an interface API (application program interface), and provide the services to the outside as a whole. For example, the first application may be split into multiple sub-services, e.g., the first service, the second service, the third service … … may each be deployed on a different service node. As shown in fig. 2, the service nodes 101 and 102 correspond to a first service, the service nodes 201 and 202 correspond to a second service, and the service nodes 301 and 302 correspond to a third service … …, however, more service nodes may be included, for example, each service includes more than 3 service nodes, or the application may be split into more sub-services. Because the application program is divided into a plurality of sub-services, when the application program is updated, offline processing can be performed only on one or more service nodes corresponding to one of the sub-services, other service nodes still provide services to the outside, and calling of an external client to the services is not influenced. According to the method and the device, the service of the whole application program is not required to be downloaded, but only the service node of one sub-service can be downloaded, the calling requirement of an external client is not influenced, and the upgrading and updating of the application program are realized.
Specifically, the service control device shown in fig. 2 is capable of implementing communication connection with the service registration device, the gateway device, and each service node. The service control equipment is used for determining a first service node and sending an offline instruction to the first service node; the first service node corresponds to a first service, and the first service is one of a plurality of services included in a first application program.
The first service node is used for receiving an offline instruction sent by the service control device and sending an offline request to the service registration device.
The service registration device is used for deleting the address information of the first service node from the registration list after receiving an offline request sent by the first service node.
The gateway device is used for updating the information of the cache list according to the information of the registration list.
The service control device is further configured to confirm whether the service registration device deletes the address information of the first service node from the registration list; if the service registration equipment is confirmed to delete the address information of the first service node from the registration list, the service control equipment confirms whether the cache list of the gateway equipment contains the address information of the first service node; if the cache list of the gateway device does not contain the address information of the first service node, the service control device sends an instruction for closing the first service node after confirming that the data request of the first service node is processed.
Referring to fig. 3, an exemplary application scenario of the embodiment of the present application is shown. Of course, the embodiments of the present application may also be applied to other scenarios, and are not limited herein. In fig. 3, after receiving an external data request sent by a client, a load balancing server may select a gateway device to process the external data request according to a load balancing policy. And the selected gateway equipment receives the external data request, and selects a service node to process the external data request according to the address information of each service node in the stored cache list. It should be noted that the cache list stored by the gateway device and the registration list stored by the service registration device are kept updated synchronously. In the application, the service control device closes the first service node when determining that neither the registration device nor the gateway device contains the registration information of the first service node, so that a new external data request is not distributed to the first service node by the gateway, and the calling failure of the external data request is avoided. In addition, the first service node is closed after the data request of the first service node is confirmed to be processed, the data request being processed by the first service node is not lost, the calling failure of the external data request is avoided, and the user experience is improved.
It should be noted that the above application scenarios are only shown for the convenience of understanding the present application, and the embodiments of the present application are not limited in any way in this respect. Rather, embodiments of the present application may be applied to any scenario where applicable.
The service offline method according to the exemplary embodiment of the present application will be described below with reference to fig. 4 to 7.
Referring to fig. 4, a flowchart of a service offline method provided in an embodiment of the present application is shown. The method shown in fig. 4 is applied to a service control device, which is in communication connection with a service registration device, a gateway device, and service nodes, and may include:
s401, the service control device determines a first service node and sends an offline instruction to the first service node.
In the embodiment of the application, each application program may include a plurality of services, and each service may correspond to one or more service nodes. For example, the first service node corresponds to a first service, and the first service is one of a plurality of services included in a first application.
The service control equipment can control one or more service nodes to be offline and online, can ensure that no external data request is issued to the micro service node needing to be issued in a shutdown mode, can ensure that the micro service node is closed after the data request currently processed by the micro service node is processed, and achieves service gray level issuing without perception of an external client.
In specific implementation, the service control device may select one or more service nodes from a plurality of service nodes corresponding to the service that needs to be offline, and send the offline request. The number of the selected first service nodes is smaller than the number of the service nodes corresponding to the first service. That is to say, generally, at least one service node needs to be guaranteed to be available, the service can be provided to the outside, and the list of the service registration device and the gateway device at least includes at least one service node of the service that needs to be offline, for example, the first service.
In some embodiments, the service control apparatus determining the first service node comprises: when the first service corresponds to a plurality of service nodes, one or more service nodes with low resource occupancy rates are selected from the plurality of service nodes as the first service node. For example, when it is determined that the first service of the first application program needs to be issued by shutdown, the resource occupancy rates of the service nodes of the first service may be obtained, and the service node whose resource occupancy rate is smaller than the second set threshold may be used as the first service node. Or, according to the resource occupancy rate, sequencing from low to high, and determining the service node with the top N bits as the first service node. N is more than or equal to 1 and is less than the total number M of the service nodes contained in the first service node.
In some embodiments, the service control apparatus determining the first service node comprises: when the first service corresponds to the plurality of service nodes, one or more service nodes are randomly selected from the plurality of service nodes to serve as the first service node. In this implementation, one or more nodes may be randomly selected as the first serving node regardless of the state of each serving node.
After determining the first service node, the service control device may send a logoff instruction to the first service node. And after receiving the offline instruction, the first service node sends an offline request to the service registration device, so as to request offline. Generally, after receiving an offline request sent by a first service node and sent by the first service node, a service registration device deletes address information of the first service node from a registration list. Typically, the registration list of the service registration device contains an identification of the available service and address information of the service node contained by the available service.
S402, the service control device determines whether the service registration device deletes the address information of the first service node from the registration list.
In some embodiments, the service control device may send a list request to the service registration device, which sends the registration list to the service control device in response to the list request. The service control equipment receives a registration list sent by service registration equipment, and matches the address information of the first service node with the address information of each service node contained in the registration list; and if the matching result does not exist, determining that the service registration equipment deletes the address information of the first service node from the registration list.
In some embodiments, the service control device may send a confirmation request containing an identification of the first service node to the service registration device for confirming whether the service registration device deletes the address information of the first service node from the registration list. The first serving node identification may be address information of the first serving node or other information that may identify the first serving node. The service registration apparatus may determine whether the first service node information exists in the registration list according to the identifier of the first service node, and send a confirmation message to the service control apparatus to instruct the service registration apparatus to delete the address information of the first service node from the registration list. The service control device is used for receiving the confirmation information sent by the service registration device and determining that the service registration device deletes the address information of the first service node from the registration list according to the confirmation information.
Of course, in some embodiments, after receiving the offline request sent by the first service node and deleting the address information of the first service node from the registration list, the service registration apparatus may actively send a message to the service control apparatus, where the message is used to indicate that the service control apparatus has deleted the address information of the first service node from the registration list. The message may be a message including a registration list, and the service control apparatus determines, according to the registration list and the address information of the first service node, whether the service registration apparatus deletes the address information of the first service node from the registration list. The message may also be a confirmation message containing the identifier of the first service node, and the service control device confirms, according to the message, that the service registration device has deleted the address information of the first service node from the registration list.
The address information of the first service node may include, but is not limited to, an IP address, a MAC address, or a port number of the first service node, which is not limited herein.
S403, if it is determined that the service registration device has deleted the address information of the first service node from the registration list, the service control device determines whether the cache list of the gateway device contains the address information of the first service node.
It should be noted that, after receiving the offline request sent by the first service node and deleting the address information of the first service node from the registration list, the service registration device may send an updated registration list to the gateway device actively or in response to the request of the gateway device, and the gateway device updates the information of the cache list stored in the gateway device according to the information of the registration list. The cache list stored by the gateway device and the registration list of the service registration device are kept updated synchronously. In some cases, there may be some delay in the synchronization process such that the cache list maintained by the gateway device is inconsistent with the registration list maintained by the service registration device. And the gateway device determines the address of the available service node according to the cache list and distributes the external data request to the available service node. Therefore, it is necessary to determine that the address information of the first service node requiring offline is no longer stored in the gateway device, that is, it is necessary to determine that the first service node is not in the available service list, so as to avoid sending a new external request to the first service node requiring offline.
In some embodiments, upon determining whether the cache list of the gateway device contains address information of the first service node, the service control device may send a request to the gateway device; the method comprises the steps that service control equipment receives a cache list sent by gateway equipment, and address information of a first service node is matched with address information of each service node contained in the cache list; and if the matching result does not exist, determining that the cache list does not contain the address information of the first service node.
In some embodiments, when determining whether the cache list of the gateway device contains the address information of the first service node, the service control device may send a confirmation request containing an identification of the first service node to the gateway device for confirming whether the cache list of the gateway device contains the address information of the first service node. The first serving node identification may be address information of the first serving node or other information that may identify the first serving node. The gateway device may determine whether the first service node information exists in the cache list according to the identifier of the first service node, and send a confirmation message to the service control device to indicate that the cache list of the gateway device does not include the address information of the first service node. The service control device is used for receiving confirmation information sent by the gateway device, and determining that the cache list of the gateway device does not contain the address information of the first service node according to the confirmation information.
Of course, in some embodiments, after updating the address information of the service node in the cache list, the gateway device may actively send a message to the service control device, where the message is used to indicate that the service control device has updated the cache list, and the cache list does not include the address information of the first service node. The message may be a message including a cache list, and the service control device determines, according to the registration list and the address information of the first service node, whether the cache list of the gateway device includes the address information of the first service node. The message may also be a confirmation message containing the identifier of the first service node, and the service control device confirms that the cache list of the gateway device does not contain the address information of the first service node according to the message.
It should be noted that, after the first service node sends the offline request, each gateway device may further store the address information of the first service node, and at this time, the first service node continues to provide the service to the outside. Therefore, the service control device needs to confirm that the address information of the first service node is not stored on all gateway devices gateway.
S404, if it is determined that the cache list of the gateway device does not include the address information of the first service node, the service control device sends an instruction to close the first service node after determining that the data request of the first service node is processed.
In order to avoid the loss of the external data request being processed by the first service node, in the embodiment of the application, after the data request of the first service node is confirmed to be processed, an instruction for closing the first service node is sent, so that the call of the external client to the application program is not failed, and the unaware halt issue of the external client is realized.
In some embodiments, the service control device confirming that the data request of the first service node is processed comprises: the service control equipment determines first preset time according to the historical processing time of each data request, and after the first preset time, the service control equipment confirms that the first service node finishes processing the data processing request. For example, historical processing data of each data request may be acquired, an average processing time or a longest processing time may be determined, and a first preset time may be determined according to the determined average processing time or the determined longest processing time, so that the first preset time is greater than the average processing time or the longest processing time. For example, the average processing time period of the data request is 90S, and the first preset time period may be set to 120S. Thus, after 120S, the data request is generally processed, and a close command may be sent to the first serving node.
In some embodiments, the service control device confirming that the data request of the first service node is processed comprises: the method comprises the steps that service control equipment obtains resource occupancy rate of a first service node, and when the resource occupancy rate is smaller than a first preset threshold value, it is determined that data requests of the first service node are processed. For example, the resource occupancy rate is different when the service node has a data request to process and when there is no data processing request. When the resource occupancy rate is less than a first preset threshold, it may be determined that the service node has no data request processing. The determination of the first preset threshold may be empirically or statistically derived.
In some embodiments, the service control device confirming that the data request of the first service node is processed comprises: and the service control equipment receives the confirmation information sent by the first service node after the data processing request is processed, and determines that the data processing request of the first service node is processed. In this implementation, it may be arranged that the service node may actively send an acknowledgement message to the service control device for indicating that the data request has been processed.
In this embodiment of the application, the service control device may implement offline control of a child node of one of the services included in the application program, without having to offline the service corresponding to the entire application program, so that the application program can still provide the service to the outside when the service node is updated, and an external client invoking the application program is unaware of this, thereby implementing gray-scale publishing of the application program service, improving processing performance and updating efficiency of the application program, and improving user experience. In addition, the service control device in the embodiment of the application closes the first service node when it is determined that neither the registration device nor the gateway device includes the registration information of the first service node, so that a new external data request is not distributed to the first service node by the gateway, and the call failure of the external data request is avoided. In addition, the first service node is closed after the data request of the first service node is confirmed to be processed, the data request being processed by the first service node is not lost, the calling failure of the external data request is avoided, and the user experience is improved.
Referring to fig. 5, a flowchart of a service offline method according to another embodiment of the present application is provided. The method shown in fig. 5 is applied to a service registration device, where the service registration device is communicatively connected to a service control device, a gateway device, and service nodes, and the method may include:
s501, the service registration device receives an offline request sent by the first service node, and deletes the address information of the first service node from the registration list.
S502, the service registration device sends the updated registration list to the gateway device, and the updated registration list is used for indicating the gateway device to update the cache list stored in the gateway device according to the updated registration list.
S503, the service registration apparatus sends a message to the service control apparatus, where the message is used to indicate that the service control apparatus has deleted the address information of the first service node from the registration list.
In some embodiments, the service registration device sending the message to the service control device comprises: the service registration device sends a message containing a registration list to a service control device; the message is sent by the service registration device after receiving a list request sent by the service control device, or the message is sent by the service registration device after receiving an offline request sent by a first service node and deleting address information of the first service node from a registration list.
In some embodiments, the service registration device sending the message to the service control device comprises: the service registration device sends a confirmation message containing a first service node identifier to a service control device, wherein the confirmation message is used for indicating that the service control device deletes the address information of the first service node from a registration list.
Referring to fig. 6, a flowchart of a service offline method according to still another embodiment of the present application is provided. The method shown in fig. 6 is applied to a gateway device, which is in communication connection with a service control device, a service registration device and service nodes, and may include:
s601, the gateway device receives the updated registration list sent by the service registration device, and updates the cache list stored by the gateway device according to the updated registration list.
S602, the gateway device sends a message to the service control device, where the message is used to indicate whether the cache list of the gateway device contains address information of the first service node.
In some embodiments, the gateway device sending the message to the service control device comprises: the gateway equipment sends a message containing a cache list to service control equipment; the message is sent by the gateway device after receiving a list request sent by the service control device, or the message is sent by the gateway device after updating address information of the service node in the cache list.
In some embodiments, the gateway device sending the message to the service control device comprises: the gateway device sends a confirmation message containing a first service node identifier to a service control device, wherein the confirmation message is used for indicating that the cache list of the service control device does not contain address information of the first service node.
In some embodiments, the gateway device may further receive an external data request for the first application, and select an available service node for processing the external data request according to the updated cache list. It should be noted that the gateway device determines the address of the available service node according to the cache list, and assigns the external data request to the available service node. Since the service control device confirms that the cache list of the gateway device does not store the address information of the first service node needing to be offline, a new external request can be effectively prevented from being sent to the first service node needing to be offline. And other service nodes corresponding to the first application program can still provide services and process external data requests. After the first service node is stopped, the external client can still call the first application program without stopping sending the request, and the grey scale release without perception of the external client is realized.
In order to facilitate a clear understanding of the embodiments of the present application for those skilled in the art, the following description of the embodiments of the present application is provided as a specific example. It should be noted that the specific example is only to make the present application more clearly understood by those skilled in the art, but the embodiments of the present application are not limited to the specific example.
Referring to fig. 7, a signaling interaction diagram of a service offline method according to another embodiment of the present application is shown. As shown in fig. 7, may include:
s701, the service control apparatus determines a first service node.
S702, the service control device sends a offline instruction to the first service node.
S703, the first service node receives the offline instruction and sends an offline request to the service registration device.
S704, the service registration device receives the offline request of the first service node, and deletes the address information of the first service node in the registration list.
S705, the service registration apparatus sends a list update request to the gateway apparatus, where the list update request is used to instruct the gateway apparatus to update the cached list.
S706, the gateway device receives the updated registration list, and updates the local cached list.
S707, the service control apparatus transmits a list request to the service registration apparatus.
S708, the service registration apparatus transmits the registration list to the service control apparatus.
S709, the service control device determines whether the registration list includes address information of the first service node. If not, executing S710; if yes, after waiting for a second preset time, S707 is executed again to send a list request to the service registration apparatus.
S710, the service control device sends a list request to the gateway device.
S711, the gateway device sends the cache list to the service control device.
S712, the service control device determines whether the cache list includes address information of the first service node. If not, executing S713; if yes, after waiting for a third preset time, S710 is executed again to send a list request to the gateway device.
S713, the service control device determines whether the external data request of the first service node is processed. If yes, go to step S714. If not, wait for a period of time and execute step S714.
S714, the service control device sends a close command to close the first service node.
Optionally, the method may further comprise the following steps (not shown in fig. 7):
s715, the load balancing server receives an external data request for the first application, and selects a gateway device.
S716, the gateway device receives the external data request, and selects a second service node to process the external data request according to the updated cache list.
S717, the second service node processes the external data request.
The following describes a device corresponding to the method provided by the embodiment of the present application.
Referring to fig. 8, a schematic diagram of a service control device according to an embodiment of the present application is provided.
A service control device 800 comprising:
a determining unit 801, configured to determine a first service node, and send a logoff instruction to the first service node; the first service node corresponds to a first service, and the first service is one of a plurality of services included in a first application program. The specific implementation of the determining unit 801 may be implemented with reference to S401 in the embodiment shown in fig. 4.
A first confirming unit 802, configured to confirm whether the service registration apparatus deletes the address information of the first service node from the registration list; the service registration device is configured to delete address information of a first service node from a registration list after receiving an offline request sent by the first service node. The specific implementation of the first confirming unit 802 may be implemented with reference to S402 in the embodiment shown in fig. 4.
A second confirming unit 803, configured to confirm whether the cache list of the gateway device includes the address information of the first service node if it is confirmed that the service registration device has deleted the address information of the first service node from the registration list; the gateway device is configured to update the information of the cache list according to the information of the registration list. The second confirming unit 803 may be implemented with reference to S403 in the embodiment shown in fig. 4.
A closing unit 804, configured to send an instruction to close the first service node after the service control device determines that the data request of the first service node is processed, if it is determined that the cache list of the gateway device does not include the address information of the first service node. The specific implementation of the closing unit 804 can be implemented with reference to S404 in the embodiment shown in fig. 4.
In some embodiments, the determining unit 801 specifically includes:
a first determining unit, configured to select one or more service nodes with low resource occupancy rates from the plurality of service nodes as a first service node when a first service corresponds to the plurality of service nodes; alternatively, the first and second electrodes may be,
a second determining unit, configured to randomly select one or more service nodes from the multiple service nodes as a first service node when the first service corresponds to the multiple service nodes; the number of the selected first service nodes is smaller than the number of the service nodes corresponding to the first service.
In some embodiments, the first acknowledgement unit 802 comprises:
a first sending unit, configured to send a list request to a service registration apparatus;
a first receiving unit, configured to receive a registration list sent by a service registration device, and match address information of the first service node with address information of each service node included in the registration list; and if the matching result does not exist, determining that the service registration equipment deletes the address information of the first service node from the registration list.
In some embodiments, the first acknowledgement unit 802 comprises:
the second receiving unit is used for receiving the confirmation information sent by the service registration equipment and determining that the service registration equipment deletes the address information of the first service node from the registration list according to the confirmation information; the confirmation information is sent by the service registration device after receiving the offline request sent by the first service node and deleting the address information of the first service node from the registration list.
In some embodiments, the second confirming unit 803 comprises:
a second sending unit, configured to send a request to the gateway device;
a third receiving unit, configured to receive a cache list sent by a gateway device, and match address information of the first service node with address information of each service node included in the cache list; and if the matching result does not exist, determining that the cache list does not contain the address information of the first service node.
In some embodiments, the second confirming unit 803 comprises:
a fourth receiving unit, configured to receive acknowledgement information sent by a gateway device, and determine, according to the acknowledgement information, that a cache list of the gateway device does not include address information of the first service node; and the confirmation information is sent after the gateway equipment updates the address information of the service node in the cache list.
In some embodiments, the closing unit specifically includes:
the second determining unit is used for determining first preset time according to the historical processing time of each data request, and after the first preset time, the first service node confirms that the data processing request of the first service node is processed; alternatively, the first and second electrodes may be,
the third determining unit is used for acquiring the resource occupancy rate of the first service node, and when the resource occupancy rate is smaller than a first preset threshold value, determining that the data request of the first service node is processed; alternatively, the first and second electrodes may be,
and the fourth determining unit is used for receiving confirmation information sent by the first service node after the data processing request is processed, and determining that the data processing request of the first service node is processed.
Referring to fig. 9, a block diagram of a service control device according to another embodiment of the present application is provided. The method comprises the following steps: at least one processor 901 (e.g., CPU), memory 902 and at least one communication bus 903 for enabling communications among the devices. The processor 901 is adapted to execute executable modules, e.g. computer programs, stored in the memory 902. The Memory 902 may comprise a high-speed Random Access Memory (RAM) and may further comprise a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. One or more programs are stored in the memory and configured to be executed by the one or more processors 901 include instructions for: determining a first service node, and sending an offline instruction to the first service node; the first service node corresponds to a first service, and the first service is one of a plurality of services included in a first application program; confirming whether the service registration equipment deletes the address information of the first service node from a registration list; the service registration equipment is used for deleting the address information of a first service node from a registration list after receiving an offline request sent by the first service node; if the service registration equipment is confirmed to delete the address information of the first service node from the registration list, whether a cache list of the gateway equipment contains the address information of the first service node is confirmed; the gateway device is used for updating the information of the cache list according to the information of the registration list; and if the cache list of the gateway equipment does not contain the address information of the first service node, sending an instruction for closing the first service node after the data request of the first service node is confirmed to be processed.
In some embodiments, the instructions executed by the processor 901 to determine the operation of the first service node specifically include: when the first service corresponds to a plurality of service nodes, selecting one or more service nodes with low resource occupancy rate from the plurality of service nodes as the first service node; or when the first service corresponds to a plurality of service nodes, randomly selecting one or more service nodes from the plurality of service nodes as the first service node; the number of the selected first service nodes is smaller than the number of the service nodes corresponding to the first service.
In some embodiments, the instructions executed by the processor 901 to determine whether the service registration apparatus deletes the address information of the first service node from the registration list specifically include: sending a list request to a service registration device; receiving a registration list sent by service registration equipment, and matching the address information of the first service node with the address information of each service node contained in the registration list; and if the matching result does not exist, determining that the service registration equipment deletes the address information of the first service node from the registration list.
In some embodiments, the instructions executed by the processor 901 to determine whether the service registration apparatus deletes the address information of the first service node from the registration list specifically include: receiving confirmation information sent by service registration equipment, and determining that the service registration equipment deletes the address information of the first service node from a registration list according to the confirmation information; the confirmation information is sent by the service registration device after receiving the offline request sent by the first service node and deleting the address information of the first service node from the registration list.
In some embodiments, the instructions executed by the processor 901 to determine whether the cache list of the gateway device contains the address information of the first service node specifically include: sending a request to a gateway device; receiving a cache list sent by gateway equipment, and matching the address information of the first service node with the address information of each service node contained in the cache list; and if the matching result does not exist, determining that the cache list does not contain the address information of the first service node.
In some embodiments, the instructions executed by the processor 901 to determine whether the cache list of the gateway device contains the address information of the first service node specifically include: receiving confirmation information sent by the gateway equipment, and determining that a cache list of the gateway equipment does not contain address information of the first service node according to the confirmation information; and the confirmation information is sent after the gateway equipment updates the address information of the service node in the cache list.
In some embodiments, the instructions executed by the processor 901 to determine whether the cache list of the gateway device contains the address information of the first service node specifically include: determining first preset time according to the historical processing time of each data request, and after the first preset time, determining that the processing of the data processing request of the first service node is finished; or acquiring the resource occupancy rate of the first service node, and determining that the data request of the first service node is processed when the resource occupancy rate is smaller than a first preset threshold value; or receiving confirmation information sent by the first service node after the data processing request is processed, and determining that the data processing request of the first service node is processed.
In an exemplary embodiment, a non-transitory computer-readable storage medium comprising instructions, such as a memory comprising instructions, executable by a processor of an apparatus to perform the above-described method is also provided. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like. A machine-readable medium, which may be, for example, a non-transitory computer-readable storage medium, in which instructions, when executed by a processor of an apparatus (terminal or server), enable the apparatus to perform a microservice architecture-based service offline method, the method comprising: determining a first service node, and sending an offline instruction to the first service node; the first service node corresponds to a first service, and the first service is one of a plurality of services included in a first application program; confirming whether the service registration equipment deletes the address information of the first service node from a registration list; the service registration equipment is used for deleting the address information of a first service node from a registration list after receiving an offline request sent by the first service node; if the service registration equipment is confirmed to delete the address information of the first service node from the registration list, whether a cache list of the gateway equipment contains the address information of the first service node is confirmed; the gateway device is used for updating the information of the cache list according to the information of the registration list; and if the cache list of the gateway equipment does not contain the address information of the first service node, sending an instruction for closing the first service node after the data request of the first service node is confirmed to be processed.
Referring to fig. 10, a schematic diagram of a service registration apparatus according to an embodiment of the present application is provided.
A service registration apparatus 1000, comprising:
the deleting unit 1001 is configured to receive an offline request sent by the first service node, and delete the address information of the first service node from the registration list. The specific implementation of the deleting unit 1001 may be implemented with reference to S501 of the embodiment shown in fig. 5.
A first sending unit 1002, configured to send the updated registration list to the gateway device, and instruct the gateway device to update the cache list stored in the gateway device according to the updated registration list. The specific implementation of the first sending unit 1002 can be implemented with reference to S502 in the embodiment shown in fig. 5.
A second sending unit 1003, configured to, if sending a message to a service control apparatus, indicate that the service control apparatus has deleted the address information of the first service node from the registration list. The specific implementation of the second sending unit 1003 can be implemented with reference to S503 in the embodiment shown in fig. 5.
In some embodiments, the second sending unit 1003 specifically includes:
a first sending subunit, configured to send a message including a registration list to the service control apparatus; the message is sent by the service registration device after receiving a list request sent by the service control device, or the message is sent by the service registration device after receiving an offline request sent by a first service node and deleting address information of the first service node from a registration list; alternatively, the first and second electrodes may be,
a second sending subunit, configured to send, to a service control apparatus, a confirmation message including an identifier of a first service node, where the confirmation message is used to indicate that the service control apparatus has deleted address information of the first service node from a registration list.
Referring to fig. 11, a block diagram of a service registration apparatus according to another embodiment of the present application is shown. The method comprises the following steps: at least one processor 1101 (e.g., CPU), memory 1102 and at least one communication bus 1103 for enabling communications among the devices. The processor 1101 is used to execute executable modules, such as computer programs, stored in the memory 1102. The Memory 1102 may include a Random Access Memory (RAM) and may also include a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. One or more programs are stored in the memory and configured to be executed by the one or more processors 1101 include instructions for: receiving an offline request sent by a first service node, and deleting address information of the first service node from a registration list; sending an updated registration list to the gateway equipment, wherein the updated registration list is used for indicating the gateway equipment to update a cache list stored by the gateway equipment according to the updated registration list; sending a message to a service control device indicating that the service control device has deleted the address information of the first service node from the registration list.
In some embodiments, the instructions for the processor 1101 to execute the operation of sending the message to the service control device specifically include: sending a message containing a registration list to the service control device; the message is sent by the service registration device after receiving a list request sent by the service control device, or the message is sent by the service registration device after receiving an offline request sent by a first service node and deleting address information of the first service node from a registration list.
In some embodiments, the instructions for the processor 1101 to execute the operation of sending the message to the service control device specifically include: sending a confirmation message containing the first service node identification to the service control device, wherein the confirmation message is used for indicating that the service control device deletes the address information of the first service node from the registration list.
In an exemplary embodiment, a non-transitory computer-readable storage medium comprising instructions, such as a memory comprising instructions, executable by a processor of an apparatus to perform the above-described method is also provided. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like. A machine-readable medium, which may be, for example, a non-transitory computer-readable storage medium, in which instructions, when executed by a processor of an apparatus (terminal or server), enable the apparatus to perform a microservice architecture-based service offline method, the method comprising: receiving an offline request sent by a first service node, and deleting address information of the first service node from a registration list; sending an updated registration list to the gateway equipment, wherein the updated registration list is used for indicating the gateway equipment to update a cache list stored by the gateway equipment according to the updated registration list; sending a message to a service control device indicating that the service control device has deleted the address information of the first service node from the registration list.
Referring to fig. 12, a schematic diagram of a gateway device according to an embodiment of the present application is provided.
A gateway device 1200, comprising:
a receiving unit 1201, configured to receive an updated registration list sent by a service registration device, and update a cache list stored in the gateway device according to the updated registration list. The specific implementation of the receiving unit 1201 can be implemented with reference to S601 in the embodiment shown in fig. 6.
A sending unit 1202, configured to send a message to a service control device, where the message is used to indicate whether a cache list of the gateway device includes address information of a first service node. The specific implementation of the sending unit 1202 can be implemented with reference to S602 in the embodiment shown in fig. 6.
In some embodiments, the sending unit 1202 specifically includes:
the first sending subunit is configured to send a message including a cache list to the service control device; the message is sent by the gateway device after receiving a list request sent by the service control device, or the message is sent by the gateway device after updating the address information of the service node in the cache list; alternatively, the first and second electrodes may be,
a second sending subunit, configured to send, to a service control device, a confirmation message including an identifier of a first service node, where the confirmation message is used to indicate that the cache list of the service control device does not include address information of the first service node.
In some embodiments, the gateway device 1200 further comprises:
and the selection unit is used for receiving an external data request aiming at the first application program and selecting an available service node for processing the external data request according to the updated cache list.
Referring to fig. 13, a block diagram of a service registration apparatus according to another embodiment of the present application is shown. The method comprises the following steps: at least one processor 1301 (e.g., a CPU), memory 1302, and at least one communication bus 1303 for enabling connectivity communications between these devices. The processor 1301 is used to execute executable modules, such as computer programs, stored in the memory 1302. The Memory 1302 may include a Random Access Memory (RAM) and may also include a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. One or more programs are stored in the memory and configured to be executed by the one or more processors 1301 include instructions for: receiving an updated registration list sent by service registration equipment, and updating a cache list stored by the gateway equipment according to the updated registration list; and sending a message to the service control device, wherein the message is used for indicating whether the cache list of the gateway device contains the address information of the first service node.
In some embodiments, the instructions for the processor 1301 to execute the operation of sending the message to the service control apparatus specifically include: sending a message containing a cache list to the service control device; the message is sent by the gateway device after receiving a list request sent by the service control device, or the message is sent by the gateway device after updating address information of the service node in the cache list.
In some embodiments, the instructions for the processor 1301 to execute the operation of sending the message to the service control apparatus specifically include: sending a confirmation message containing a first service node identifier to a service control device, where the confirmation message is used to indicate that the cache list of the service control device does not contain address information of the first service node.
In some embodiments, the processor 1301 is further configured to execute instructions to: an external data request for the first application is received, and an available service node is selected for processing the external data request according to the updated cache list.
In an exemplary embodiment, a non-transitory computer-readable storage medium comprising instructions, such as a memory comprising instructions, executable by a processor of an apparatus to perform the above-described method is also provided. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like. A machine-readable medium, which may be, for example, a non-transitory computer-readable storage medium, in which instructions, when executed by a processor of an apparatus (terminal or server), enable the apparatus to perform a microservice architecture-based service offline method, the method comprising: receiving an updated registration list sent by service registration equipment, and updating a cache list stored by the gateway equipment according to the updated registration list; and sending a message to the service control device, wherein the message is used for indicating whether the cache list of the gateway device contains the address information of the first service node.
The arrangement of each unit or module of the apparatus of the present application can be implemented by referring to the methods shown in fig. 2 to 7, which are not described herein again.
Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice in the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the application being indicated by the following claims.
It will be understood that the present application is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the application is limited only by the attached claims
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 an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element. The application may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The application may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the apparatus embodiment, since it is substantially similar to the method embodiment, it is relatively simple to describe, and reference may be made to some descriptions of the method embodiment for relevant points. The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort. The foregoing is directed to embodiments of the present application and it is noted that numerous modifications and adaptations may be made by those skilled in the art without departing from the principles of the present application and are intended to be within the scope of the present application.

Claims (22)

1. A service offline method based on a micro-service architecture is applied to a service control device, wherein the service control device is in communication connection with a service registration device, a gateway device and each service node, and the method comprises the following steps:
the method comprises the steps that a service control device determines a first service node and sends an offline instruction to the first service node; the first service node corresponds to a first service, and the first service is one of a plurality of services included in a first application program; the first service node is one or more service nodes selected from the service nodes corresponding to the first service, wherein the number of the selected first service nodes is less than that of the service nodes corresponding to the first service;
the service control equipment confirms whether the service registration equipment deletes the address information of the first service node from a registration list or not; the service registration equipment is used for deleting the address information of a first service node from a registration list after receiving an offline request sent by the first service node;
if the service registration equipment is confirmed to delete the address information of the first service node from the registration list, the service control equipment confirms whether the cache list of the gateway equipment contains the address information of the first service node; the gateway device is used for updating the information of the cache list according to the information of the registration list;
if the cache list of the gateway device does not contain the address information of the first service node, the service control device sends an instruction for closing the first service node after confirming that the data request of the first service node is processed.
2. The method of claim 1, wherein the service control device determining the first service node comprises:
when the first service corresponds to a plurality of service nodes, selecting one or more service nodes with low resource occupancy rate from the plurality of service nodes as the first service node; alternatively, the first and second electrodes may be,
when the first service corresponds to the plurality of service nodes, one or more service nodes are randomly selected from the plurality of service nodes to serve as the first service node.
3. The method of claim 1, wherein the service control device confirming whether the service registration device deletes the address information of the first service node from the registration list comprises:
the service control device sends a list request to the service registration device;
the service control equipment receives a registration list sent by service registration equipment, and matches the address information of the first service node with the address information of each service node contained in the registration list; and if the matching result does not exist, determining that the service registration equipment deletes the address information of the first service node from the registration list.
4. The method of claim 1, wherein the service control device confirming whether the service registration device deletes the address information of the first service node from the registration list comprises:
the service control equipment receives confirmation information sent by the service registration equipment, and determines that the service registration equipment deletes the address information of the first service node from a registration list according to the confirmation information; the confirmation information is sent by the service registration device after receiving the offline request sent by the first service node and deleting the address information of the first service node from the registration list.
5. The method of claim 1, wherein the service control device determining whether the cache list of the gateway device contains the address information of the first service node comprises:
the service control equipment sends a request to the gateway equipment;
the method comprises the steps that service control equipment receives a cache list sent by gateway equipment, and address information of a first service node is matched with address information of each service node contained in the cache list; and if the matching result does not exist, determining that the cache list does not contain the address information of the first service node.
6. The method of claim 1, wherein the service control device determining whether the cache list of the gateway device contains the address information of the first service node comprises:
the service control equipment receives confirmation information sent by the gateway equipment, and determines that a cache list of the gateway equipment does not contain address information of the first service node according to the confirmation information; and the confirmation information is sent after the gateway equipment updates the address information of the service node in the cache list.
7. The method of claim 1, wherein the step of the service control device confirming that the data request of the first service node is processed comprises:
the service control equipment determines first preset time according to the historical processing time of each data request, and confirms that the processing of the data processing request of the first service node is finished after the first preset time; alternatively, the first and second electrodes may be,
the method comprises the steps that service control equipment obtains resource occupancy rate of a first service node, and when the resource occupancy rate is smaller than a first preset threshold value, it is determined that data requests of the first service node are processed; alternatively, the first and second electrodes may be,
and the service control equipment receives the confirmation information sent by the first service node after the data processing request is processed, and determines that the data processing request of the first service node is processed.
8. A service offline method based on a micro-service architecture is applied to a service registration device, wherein the service registration device is in communication connection with a service control device, a gateway device and each service node, and the method comprises the following steps:
the service registration equipment receives an offline request sent by a first service node, and deletes address information of the first service node from a registration list; the first service node corresponds to a first service, and the first service is one of a plurality of services included in a first application program; the first service node is one or more service nodes selected from the service nodes corresponding to the first service, wherein the number of the selected first service nodes is less than that of the service nodes corresponding to the first service;
the service registration equipment sends an updated registration list to the gateway equipment, and the updated registration list is used for indicating the gateway equipment to update the cache list stored by the gateway equipment according to the updated registration list;
the service registration device sends a message to the service control device indicating that the service control device has deleted the address information of the first service node from the registration list.
9. The method of claim 8, wherein sending, by the service registration device, the message to the service control device comprises:
the service registration device sends a message containing a registration list to a service control device; the message is sent by the service registration device after receiving a list request sent by the service control device, or the message is sent by the service registration device after receiving an offline request sent by a first service node and deleting address information of the first service node from a registration list;
alternatively, the first and second electrodes may be,
the service registration device sends a confirmation message containing a first service node identifier to a service control device, wherein the confirmation message is used for indicating that the service control device deletes the address information of the first service node from a registration list.
10. A service offline method based on a micro-service architecture is applied to a gateway device, wherein the gateway device is in communication connection with a service control device, a service registration device and service nodes, and the method comprises the following steps:
the gateway equipment receives an updated registration list sent by the service registration equipment, and updates a cache list stored by the gateway equipment according to the updated registration list;
the gateway equipment sends a message to the service control equipment, wherein the message is used for indicating whether a cache list of the gateway equipment contains address information of a first service node; the first service node corresponds to a first service, and the first service is one of a plurality of services included in a first application program; the first service node is one or more service nodes selected from the service nodes corresponding to the first service, wherein the number of the selected first service nodes is less than the number of the service nodes corresponding to the first service.
11. The method of claim 10, wherein sending, by the gateway device, the message to the service control device comprises:
the gateway equipment sends a message containing a cache list to service control equipment; the message is sent by the gateway device after receiving a list request sent by the service control device, or the message is sent by the gateway device after updating the address information of the service node in the cache list;
alternatively, the first and second electrodes may be,
the gateway device sends a confirmation message containing a first service node identifier to a service control device, wherein the confirmation message is used for indicating that the cache list of the service control device does not contain address information of the first service node.
12. The method of claim 10, further comprising:
the gateway device receives an external data request for a first application program, and selects an available service node for processing the external data request according to the updated cache list.
13. A service control apparatus, characterized by comprising:
the system comprises a determining unit, a sending unit and a receiving unit, wherein the determining unit is used for determining a first service node and sending an offline instruction to the first service node; the first service node corresponds to a first service, and the first service is one of a plurality of services included in a first application program; the first service node is one or more service nodes selected from the service nodes corresponding to the first service, wherein the number of the selected first service nodes is less than that of the service nodes corresponding to the first service;
a first confirming unit configured to confirm whether the service registration apparatus deletes the address information of the first service node from the registration list; the service registration equipment is used for deleting the address information of a first service node from a registration list after receiving an offline request sent by the first service node;
a second confirming unit, configured to confirm whether the cache list of the gateway device includes the address information of the first service node if it is confirmed that the service registration device has deleted the address information of the first service node from the registration list; the gateway device is used for updating the information of the cache list according to the information of the registration list;
and the closing unit is used for sending an instruction for closing the first service node after the service control device confirms that the data request of the first service node is processed if the cache list of the gateway device does not contain the address information of the first service node.
14. A service control apparatus comprising a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by one or more processors to perform the microservice architecture-based service logoff method according to one or more of claims 1-7.
15. A machine-readable medium having stored thereon instructions, which when executed by one or more processors, cause an apparatus to perform a microservice architecture-based service logoff method according to one or more of claims 1 to 7.
16. A service registration apparatus, comprising:
the deleting unit is used for receiving an offline request sent by the first service node and deleting the address information of the first service node from the registration list; the first service node corresponds to a first service, and the first service is one of a plurality of services included in a first application program; the first service node is one or more service nodes selected from the service nodes corresponding to the first service, wherein the number of the selected first service nodes is less than that of the service nodes corresponding to the first service;
a first sending unit, configured to send an updated registration list to a gateway device, and instruct the gateway device to update a cache list stored in the gateway device according to the updated registration list;
a second sending unit, configured to send a message to a service control device, where the message is used to indicate that the service control device has deleted the address information of the first service node from the registration list.
17. A service registration apparatus comprising a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by one or more processors to perform the micro-service architecture based service logoff method according to one or more of claims 8 to 9.
18. A machine-readable medium having stored thereon instructions, which when executed by one or more processors, cause an apparatus to perform a microservice architecture-based service logoff method according to one or more of claims 8 to 9.
19. A gateway device, comprising:
a receiving unit, configured to receive an updated registration list sent by a service registration device, and update a cache list stored in the gateway device according to the updated registration list;
a sending unit, configured to send a message to a service control device, where the message is used to indicate whether a cache list of the gateway device includes address information of a first service node; the first service node corresponds to a first service, and the first service is one of a plurality of services included in a first application program; the first service node is one or more service nodes selected from the service nodes corresponding to the first service, wherein the number of the selected first service nodes is less than the number of the service nodes corresponding to the first service.
20. A gateway device comprising a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by one or more processors to perform the microservice architecture-based service logoff method according to one or more of claims 10-12.
21. A machine-readable medium having stored thereon instructions, which when executed by one or more processors, cause an apparatus to perform a microservice architecture-based service logoff method according to one or more of claims 10 to 12.
22. A service offline system based on micro-service architecture is characterized by comprising service control equipment, service registration equipment, gateway equipment and service nodes, wherein:
the service control equipment is used for determining a first service node and sending an offline instruction to the first service node; the first service node corresponds to a first service, and the first service is one of a plurality of services included in a first application program; the first service node is one or more service nodes selected from the service nodes corresponding to the first service, wherein the number of the selected first service nodes is less than that of the service nodes corresponding to the first service;
the first service node is used for receiving an offline instruction sent by the service control equipment and sending an offline request to the service registration equipment;
the service registration device is used for deleting the address information of the first service node from a registration list after receiving an offline request sent by the first service node;
the gateway equipment is used for updating the information of the cache list according to the information of the registration list;
the service control device is further configured to confirm whether the service registration device deletes the address information of the first service node from the registration list; if the service registration equipment is confirmed to delete the address information of the first service node from the registration list, the service control equipment confirms whether the cache list of the gateway equipment contains the address information of the first service node; if the cache list of the gateway device does not contain the address information of the first service node, the service control device sends an instruction for closing the first service node after confirming that the data request of the first service node is processed.
CN201711192759.4A 2017-11-24 2017-11-24 Service offline method, device and system based on micro-service architecture Active CN107948284B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711192759.4A CN107948284B (en) 2017-11-24 2017-11-24 Service offline method, device and system based on micro-service architecture

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711192759.4A CN107948284B (en) 2017-11-24 2017-11-24 Service offline method, device and system based on micro-service architecture

Publications (2)

Publication Number Publication Date
CN107948284A CN107948284A (en) 2018-04-20
CN107948284B true CN107948284B (en) 2021-04-16

Family

ID=61948706

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711192759.4A Active CN107948284B (en) 2017-11-24 2017-11-24 Service offline method, device and system based on micro-service architecture

Country Status (1)

Country Link
CN (1) CN107948284B (en)

Families Citing this family (20)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110636093B (en) * 2018-06-25 2022-04-26 中兴通讯股份有限公司 Microservice registration and discovery method, microservice registration and discovery device, storage medium and microservice system
CN108901022B (en) * 2018-06-28 2021-08-20 深圳云之家网络有限公司 Micro-service unified authentication method and gateway
CN111212099A (en) * 2018-11-22 2020-05-29 青岛海信智能商用系统股份有限公司 Micro-service management method and device
CN109814917A (en) * 2019-01-16 2019-05-28 中国平安财产保险股份有限公司 Micro services dissemination method, device, computer equipment and storage medium
CN111629013A (en) * 2019-02-27 2020-09-04 北京奇虎科技有限公司 Method and device for managing service node and node network
CN110087251B (en) * 2019-04-15 2022-10-11 公牛集团股份有限公司 Method and device for quickly deleting equipment, computer equipment and storage medium
CN112055039B (en) * 2019-06-06 2022-07-26 阿里巴巴集团控股有限公司 Data access method, device and system and computing equipment
CN110489248A (en) * 2019-08-22 2019-11-22 中国工商银行股份有限公司 System-down method, service calling method, device and storage medium
CN112532670B (en) * 2019-09-19 2022-07-05 阿里巴巴集团控股有限公司 Data processing method and device
CN110708367A (en) * 2019-09-24 2020-01-17 中信百信银行股份有限公司 Application calling method, application publishing method and application publishing system
CN111581061A (en) * 2020-05-15 2020-08-25 海信集团有限公司 Service offline method, device and equipment
CN111953562B (en) * 2020-07-29 2022-05-24 新华三信息安全技术有限公司 Equipment state monitoring method and device
CN112087506B (en) * 2020-09-01 2023-02-07 北京火山引擎科技有限公司 Cluster node management method and device and computer storage medium
CN112351077B (en) * 2020-10-21 2022-07-29 中国建设银行股份有限公司 Application service operation method, system, device and storage medium
CN112350856B (en) * 2020-10-27 2023-04-07 中国联合网络通信集团有限公司 Distributed service sign-off method and equipment
CN112632032B (en) * 2020-12-18 2022-12-27 华人运通(上海)云计算科技有限公司 Data migration method and device, storage medium and terminal equipment
CN112783647A (en) * 2021-01-13 2021-05-11 中国银联股份有限公司 Server capacity expansion and reduction method, server, system and storage medium
CN113315824B (en) * 2021-05-26 2023-04-18 武汉悦学帮网络技术有限公司 Application gray scale publishing method and device and application gray scale publishing system
CN114401311A (en) * 2022-01-19 2022-04-26 阿维塔科技(重庆)有限公司 Microservice registration and discovery method, microservice registration and discovery device, electronic equipment and medium
CN115103008B (en) * 2022-06-13 2024-03-08 北京奇艺世纪科技有限公司 Service request forwarding system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105208047A (en) * 2014-05-29 2015-12-30 阿里巴巴集团控股有限公司 Online and off line methods of distributed system server, and server
CN106453288A (en) * 2016-09-29 2017-02-22 上海和付信息技术有限公司 Asynchronous mode supporting distributed micro service framework system and implementation method thereof
US9652214B1 (en) * 2015-12-18 2017-05-16 Sap Se Pluggable extension of software applications
CN106789974A (en) * 2016-12-07 2017-05-31 武汉市烽视威科技有限公司 A kind of implementation method of IPTV system and IPTV service
CN106790601A (en) * 2016-12-29 2017-05-31 Tcl集团股份有限公司 The reading device of address of service, system and method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105208047A (en) * 2014-05-29 2015-12-30 阿里巴巴集团控股有限公司 Online and off line methods of distributed system server, and server
US9652214B1 (en) * 2015-12-18 2017-05-16 Sap Se Pluggable extension of software applications
CN106453288A (en) * 2016-09-29 2017-02-22 上海和付信息技术有限公司 Asynchronous mode supporting distributed micro service framework system and implementation method thereof
CN106789974A (en) * 2016-12-07 2017-05-31 武汉市烽视威科技有限公司 A kind of implementation method of IPTV system and IPTV service
CN106790601A (en) * 2016-12-29 2017-05-31 Tcl集团股份有限公司 The reading device of address of service, system and method

Also Published As

Publication number Publication date
CN107948284A (en) 2018-04-20

Similar Documents

Publication Publication Date Title
CN107948284B (en) Service offline method, device and system based on micro-service architecture
US9912538B2 (en) Synchronization of configuration file of virtual application distribution chassis
EP2647174B1 (en) System and method to distribute application traffic to servers based on dynamic service response time
CN106657314B (en) Cross-data center data synchronization system and method
CN110839084B (en) Session management method, device, equipment and medium
US20170214751A1 (en) Migrating a chat message service provided by a chat server to a new chat server
US20200142759A1 (en) Rest gateway for messaging
US9900403B2 (en) Method and server for assigning relative order to message by using vector clock and delivering the message based on the assigned relative order under distributed environment
CN108833588B (en) Session processing method and device
EP1843520A1 (en) A method and device for controlling the configuration of configuration parameter set of the remote device
CN109413117B (en) Distributed data calculation method, device, server and computer storage medium
CN103931138A (en) Scalable distributed multicluster device management server architecture and method of operation thereof
CN106790354B (en) Communication method and device for preventing data congestion
CN111790159B (en) Data processing method, device, equipment and computer readable storage medium
CN110233791B (en) Data deduplication method and device
CN109688011B (en) Agent selection method and device based on OpenStack
CN107682396B (en) IM server deployment method and system
US20210256600A1 (en) Connector leasing for long-running software operations
CN112671914B (en) IOT (Internet of things) equipment communication method and system based on actor model
CN112351077B (en) Application service operation method, system, device and storage medium
US9577946B1 (en) Account-specific login throttling
US20170085626A1 (en) Method and system for transferring narrow data
US11695644B2 (en) Communication management apparatus and communication management method
CN112104506B (en) Networking method, networking device, server and readable storage medium
US20110137972A1 (en) System and method for agent networks

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant