CN116962416A - Service offline method, device and storage medium - Google Patents
Service offline method, device and storage medium Download PDFInfo
- Publication number
- CN116962416A CN116962416A CN202310773593.4A CN202310773593A CN116962416A CN 116962416 A CN116962416 A CN 116962416A CN 202310773593 A CN202310773593 A CN 202310773593A CN 116962416 A CN116962416 A CN 116962416A
- Authority
- CN
- China
- Prior art keywords
- service
- offline
- preset
- flow
- timestamp
- 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.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 36
- 230000004044 response Effects 0.000 claims abstract description 6
- 230000005856 abnormality Effects 0.000 abstract description 6
- 238000001514 detection method Methods 0.000 description 8
- 238000010586 diagram Methods 0.000 description 3
- 238000004590 computer program Methods 0.000 description 1
- 230000001419 dependent effect Effects 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000004904 shortening Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/1001—Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
- H04L67/1004—Server selection for load balancing
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/48—Program initiating; Program switching, e.g. by interrupt
- G06F9/4806—Task transfer initiation or dispatching
- G06F9/4843—Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5083—Techniques for rebalancing the load in a distributed system
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/51—Discovery or management thereof, e.g. service location protocol [SLP] or web services
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/56—Provisioning of proxy services
- H04L67/568—Storing data temporarily at an intermediate stage, e.g. caching
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The embodiment of the invention discloses a service offline method, a device, electronic equipment and a storage medium, relates to the technical field of computer software, and can improve the high availability of service and reduce the probability of service abnormality caused by direct service offline. The method comprises the following steps: sending a service offline request to a registry or a flow balancing server so that the registry or the flow balancing server can log off the service; setting a service state flag of the service to be stopped in response to a stop setting request sent by the registry or the flow equalization server; judging whether the service meets the offline condition; and if the service meets the offline condition, the service is offline. The invention can be used for the occasions of safe offline of service.
Description
Technical Field
The present invention relates to the field of computer software technologies, and in particular, to a service offline method, device, electronic apparatus, and storage medium.
Background
The service request is routed to the actual service for service processing through the load balancing strategy, when the online service needs to be stopped and disconnected, the continuous service flow can be routed to the service executing the stop, if the stop is forced, the service can refuse to process the service, the user can not request correct response, and the user experience is affected. The root cause of the problem is that the registry and the service can cache the dependent service information, the service starts to be offline, but the cache update still has time difference, so that the service of shutdown is wrongly called, and the cache cannot be updated in real time for balancing the performance and time.
The current mainstream solution in the industry is to actively inform the service to execute the offline after the offline service of the registry is completed, and adjust the scheme for shortening the cache update time, but still has the problem of high service abnormality probability caused by the cache update time difference.
Disclosure of Invention
In view of the above, embodiments of the present invention provide a service offline method, device, electronic apparatus, and storage medium, which can improve the high availability of a service and reduce the probability of service anomalies caused by direct service offline.
In a first aspect, an embodiment of the present invention provides a service offline method, applied to a service provider, including:
sending a service offline request to a registry or a flow balancing server so that the registry or the flow balancing server can log off the service;
setting a service state flag of the service to be stopped in response to a stop setting request sent by the registry or the flow equalization server;
judging whether the service meets the offline condition;
and if the service meets the offline condition, the service is offline.
With reference to the first aspect, in a first implementation manner of the first aspect, the determining whether the service meets a drop-off condition includes:
judging whether the elapsed time length after the service state mark of the service is set to be stopped meets a preset duration threshold value or not;
and if the service state mark of the service is set to be that after the machine is stopped, the elapsed time length meets a preset duration threshold value, determining that the service meets the offline condition.
With reference to the first aspect, in a second implementation manner of the first aspect, the determining whether the service meets a drop-off condition includes:
setting a service state flag of the service to be a time stamp of the flow entering the service after stopping;
judging whether the flow entering the service in a preset time window is smaller than a preset flow threshold value or not based on the time stamp;
if the flow entering the service in the preset time window is smaller than a preset flow threshold, determining that the service meets the offline condition.
With reference to the second implementation manner of the first aspect, in a third implementation manner of the first aspect, the recording a timestamp of traffic entering the service includes:
the time stamp of the flow entering the service is put into a time stamp node of a time stamp linked list; wherein each timestamp node comprises a deposited timestamp, a pointer address pointing to a previous timestamp node, and a pointer address pointing to a subsequent timestamp node.
With reference to the third implementation manner of the first aspect, in a fourth implementation manner of the first aspect, the placing the timestamp of the traffic entering the service into a timestamp node of a timestamp linked list includes:
and placing the timestamp of the latest traffic entering the service into a timestamp node at the head of the queue in a timestamp linked list.
With reference to the second implementation manner of the first aspect, in a fifth implementation manner of the first aspect, the determining, based on the timestamp, whether a traffic entering the service within a preset time window is less than a preset traffic threshold includes:
judging whether the flow entering the service in a preset fixed time window or a preset sliding time window is smaller than a preset flow threshold value or not based on the time stamp;
if the flow entering the service in the preset time window is smaller than a preset flow threshold, determining that the service meets the offline condition includes:
if the flow entering the service in the preset fixed time window or the preset sliding time window is smaller than the preset flow threshold, determining that the service meets the offline condition.
In a second aspect, an embodiment of the present invention provides a service offline device, applied to a service provider, including:
the off-line request module is used for sending a service off-line request to a registry or a flow balancing server so as to enable the registry or the flow balancing server to cancel the service;
the stop sign setting module is used for responding to a stop setting request sent by the registry or the flow balance server and setting the service state sign of the service as stop;
the off-line judging module is used for judging whether the service meets the off-line condition or not;
and the offline execution module is used for downloading the service if the service meets the offline condition.
With reference to the second aspect, in a first implementation manner of the second aspect, the offline determining module includes:
the time length judging unit is used for judging whether the elapsed time length after the service state mark of the service is set to be stopped meets a preset time length threshold value; and if the service state mark of the service is set to be that after the machine is stopped, the elapsed time length meets a preset duration threshold value, determining that the service meets the offline condition.
With reference to the second aspect, in a second implementation manner of the second aspect, the offline determining module includes:
the flow recording unit is used for setting the service state mark of the service as a time stamp of the flow entering the service after stopping;
the traffic judgment unit is used for judging whether the traffic entering the service in a preset time window is smaller than a preset traffic threshold value or not based on the time stamp; if the flow entering the service in the preset time window is smaller than a preset flow threshold, determining that the service meets the offline condition.
With reference to the second implementation manner of the second aspect, in a third implementation manner of the second aspect, the flow recording unit is configured to put a timestamp of a flow entering the service into a timestamp node of a timestamp linked list; wherein each timestamp node comprises a deposited timestamp, a pointer address pointing to a previous timestamp node, and a pointer address pointing to a subsequent timestamp node.
With reference to the third implementation manner of the second aspect, in a fourth implementation manner of the second aspect, the placing the timestamp of the traffic entering the service into a timestamp node of a timestamp linked list includes:
and placing the timestamp of the latest traffic entering the service into a timestamp node at the head of the queue in a timestamp linked list.
With reference to the second implementation manner of the second aspect, in a fifth implementation manner of the second aspect, the flow determining unit includes:
judging whether the flow entering the service in a preset fixed time window or a preset sliding time window is smaller than a preset flow threshold value or not based on the time stamp;
if the flow entering the service in the preset time window is smaller than a preset flow threshold, determining that the service meets the offline condition includes:
if the flow entering the service in the preset fixed time window or the preset sliding time window is smaller than the preset flow threshold, determining that the service meets the offline condition.
In a third aspect, an embodiment of the present invention provides an electronic device, including: the device comprises a shell, a processor, a memory, a circuit board and a power circuit, wherein the circuit board is arranged in a space surrounded by the shell, and the processor and the memory are arranged on the circuit board; a power supply circuit for supplying power to each circuit or device of the electronic apparatus; the memory is used for storing executable program codes; the processor executes a program corresponding to the executable program code by reading the executable program code stored in the memory, for executing the service offline method provided by any one of the foregoing embodiments of the present invention.
In a second aspect, an embodiment of the present invention provides a computer readable storage medium storing one or more programs executable by one or more processors to implement the service offline method provided by any one of the foregoing embodiments of the present invention.
Before the service to be disconnected is disconnected, a service disconnection request is sent to a registry or a flow balancing server, and a service state mark of the service is set to be disconnected after the service is stopped in response to a stop setting request sent by the registry or the flow balancing server, and the service is disconnected only when the service meets a disconnection condition. Therefore, the buffer time is reserved between the service request offline and the service truly offline, so that the high availability of the service is improved, and the service abnormality probability caused by the direct offline of the service is reduced.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flowchart of a method for service offline provided by an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a service offline device according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a partial structure of a device for serving offline according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
A service offline method provided by an embodiment of the present invention is described in detail below with reference to the accompanying drawings.
It should be understood that the described embodiments are merely some, but not all, embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Fig. 1 is a flowchart of a service offline method according to an embodiment of the present invention. As shown in fig. 1, the service offline method of the present embodiment may include the following steps:
s1, sending a service offline request to a registry or a flow balancing server so that the registry or the flow balancing server can log off the service;
in the micro-service architecture, three principals are included, a service consumer, a service provider, and a registry. The service provider registers own service interface information to a registration center when starting; the service consumer subscribes the service list information needed by the service consumer to the registry, the subscribed service list is cached to the local, when the service consumer needs to call the service end interface, the address list is obtained from the local cache, and then the service provider information is called remotely; the registry maintains service address list information and subscription information for service consumers. When the service provider requests stopping, the registry logs out the service, the service consumer cannot cache the service information when caching the service list from the registry next time, and at the moment, the flow cannot call the service of the service provider through the cache of the service consumer;
correspondingly, in the single service architecture, the traffic invokes the service through the service information cached in the gateway, and when the service request stops, the service is logged out in the traffic balancing server.
S2, responding to a stop setting request sent by the registry or the flow balancing server, and setting a service state mark of the service as stop;
after the registration center or the flow balance server cancels the service, the service state sign is switched to a shutdown state. At this time, the service is not disconnected, only the service status flag is changed, and the service can still be continuously invoked.
S3, judging whether the service meets the offline condition;
s4, if the service meets the offline condition, the service is offline.
The service provider is preset with a service offline condition, when the service state mark is detected to be switched to the shutdown state, the judging program is started to execute, whether the service meets the offline condition is judged according to the preset service offline condition, and if the service meets the offline condition, the service is offline.
Before the service to be disconnected is disconnected, the service disconnection method provided by the embodiment of the invention sends a service disconnection request to a registry or a flow balance server, and responds to a shutdown setting request sent by the registry or the flow balance server to set a service state mark of the service as shutdown, and then the service is disconnected only when the service meets the disconnection condition. Therefore, the buffer time is reserved between the service request offline and the service truly offline, so that the high availability of the service is improved, and the service abnormality probability caused by the direct offline of the service is reduced.
Optionally, in an embodiment of the present invention, determining in step S3 whether the service meets the following condition may specifically include: judging whether the elapsed time length after the service state mark of the service is set to be stopped meets a preset duration threshold value or not; and if the service state mark of the service is set to be that after the machine is stopped, the elapsed time length meets a preset duration threshold value, determining that the service meets the offline condition. The duration threshold is preset for the service provider in advance. For example, the service provider sets a duration threshold to 10 seconds in advance, and the service provider starts to be offline after 10 seconds elapse after detecting that the service status flag is switched to the stop flag, and within the duration threshold, the service provider can still process the flow request of the cache call service. Preferably, the preset duration threshold should be greater than the cache update time, and the service provider can thoroughly process the flow request of the cache call service before the cache update, and the service is not started to be disconnected due to the service, but the cache update still has a time difference, so that the service which is disconnected is erroneously called.
Optionally, in an embodiment of the present invention, determining in step S3 whether the service meets the offline condition may further include: setting a service state flag of the service to be a time stamp of the flow entering the service after stopping; judging whether the flow entering the service in a preset time window is smaller than a preset flow threshold value or not based on the time stamp; if the flow entering the service in the preset time window is smaller than a preset flow threshold, determining that the service meets the offline condition.
For example, when the service provider detects that the service down flag is set to a down state, the service provider begins recording the traffic request time to invoke the service. The service provider presets the offline condition that the flow request for calling the service is smaller than 10 in 10 seconds, and when the service provider detects that the flow request for calling the service is larger than 10 in 1-10 seconds, the service continues to be online, and the service provider continues to record the flow request time for calling the service; at 11-20 seconds, the service provider detects that the flow request to invoke the service is less than 10, and the service starts to be offline.
Optionally, in one embodiment of the present invention, the recording a timestamp of traffic entering the service includes: the time stamp of the flow entering the service is put into a time stamp node of a time stamp linked list; wherein each timestamp node comprises a deposited timestamp, a pointer address pointing to a previous timestamp node, and a pointer address pointing to a subsequent timestamp node. The time stamp of the flow entering the service is put into a time stamp node of a time stamp linked list, and the time stamp node comprises: and placing the timestamp of the latest traffic entering the service into a timestamp node at the head of the queue in a timestamp linked list. The service provider records each flow request time through a timestamp linked list so as to judge the flow request quantity in a time window.
Optionally, in an embodiment of the present invention, the determining, based on the timestamp, whether the traffic entering the service in a preset time window is less than a preset traffic threshold includes: judging whether the flow entering the service in a preset fixed time window or a preset sliding time window is smaller than a preset flow threshold value or not based on the time stamp; if the flow entering the service in the preset time window is smaller than a preset flow threshold, determining that the service meets the offline condition includes: if the flow entering the service in the preset fixed time window or the preset sliding time window is smaller than the preset flow threshold, determining that the service meets the offline condition.
The through time window detection traffic includes fixed time window detection and sliding time window detection. For example, if the service provider sets the time window to 10 seconds, the service provider segments the flow request time after recording the flow request time, and the flow request time is a detection window every 10 seconds, the fixed time window detects the flow request amount of 1-10 seconds, 11-20 seconds, 21-30 seconds …, and the sliding time window detects the flow request amount of 1-10 seconds, 2-11 seconds, 3-12 seconds ….
Optionally, in an embodiment of the present invention, three modes or any two modes of preset duration, fixed time window detection and sliding time window detection may also exist in one service at the same time, and the modes are switched according to the service offline requirement. When the service needs to be disconnected as soon as possible and the requirement on user experience is high, the sliding time window detection mode can be switched; when the service has low requirements on time and user experience, switching to a preset duration mode; the fixed time window detection mode may be switched to when the squad time requirements are not high but the user experience requirements are high.
Preferably, the sliding time window may detect that the number of flow requests is below the preset flow threshold more quickly. For example, the service provider sets a time window to 10 seconds, the traffic threshold is 10 pieces, the number of 1 st second traffic requests is 9 pieces, the number of 2-10 second traffic requests is 1 piece, the number of 11 second traffic requests is 5 pieces, the number of 12-20 second traffic requests is 1 piece, the traffic request number of 11-20 seconds can be detected to be lower than the traffic threshold when the time window is fixed to 20 seconds, the service can be disconnected, and the traffic request number of 2-11 seconds can be detected to be lower than the traffic threshold when the sliding time window is slid to 11 seconds, and the service can be disconnected.
Corresponding to the service offline method provided by the embodiment of the invention, the embodiment of the invention also provides a service offline device which can improve the high availability of the service and reduce the service abnormality probability caused by directly offline the service.
As shown in fig. 2, the service offline device provided by the embodiment of the present invention may include: a service-off request module 21, configured to send a service-off request to a registry or a traffic balancing server, so that the registry or the traffic balancing server logs off the service; a stop flag setting module 22, configured to set a service status flag of the service to stop in response to a stop setting request sent by the registry or the traffic balancing server; a offline determining module 23, configured to determine whether the service meets an offline condition; and the offline execution module 24 is configured to offline the service if the service meets an offline condition.
Before the service to be disconnected is disconnected, the service disconnection device provided by the embodiment of the invention sends a service disconnection request to a registry or a flow balance server, and responds to a shutdown setting request sent by the registry or the flow balance server to set a service state mark of the service as shutdown, and then disconnects the service only when the service meets the disconnection condition. Therefore, the buffer time is reserved between the service request offline and the service truly offline, so that the high availability of the service is improved, and the service abnormality probability caused by the direct offline of the service is reduced.
Optionally, the offline determining module may include a duration determining unit, and determine whether the service may be offline by using the preset duration as the service offline condition.
Optionally, as shown in fig. 3, the offline determining module may further include: a flow recording unit 31, configured to set a service status flag of the service to a timestamp of a flow entering the service after stopping; a flow judging unit 32, configured to judge, based on the timestamp, whether a flow entering the service in a preset time window is smaller than a preset flow threshold; if the flow entering the service in the preset time window is smaller than a preset flow threshold, determining that the service meets the offline condition.
Alternatively, in one embodiment of the present invention, the flow recording unit 31 includes: the time stamp of the flow entering the service is put into a time stamp node of a time stamp linked list; wherein each timestamp node comprises a deposited timestamp, a pointer address pointing to a previous timestamp node, and a pointer address pointing to a subsequent timestamp node. The time stamp of the flow entering the service is put into a time stamp node of a time stamp linked list, and the time stamp node comprises: and placing the timestamp of the latest traffic entering the service into a timestamp node at the head of the queue in a timestamp linked list. The service provider records each flow request time through a timestamp linked list so as to judge the flow request quantity in a time window.
As shown in fig. 4, an electronic device provided by an embodiment of the present invention may include: the device comprises a shell 41, a processor 42, a memory 43, a circuit board 44 and a power circuit 45, wherein the circuit board 44 is arranged in a space surrounded by the shell 41, and the processor 42 and the memory 43 are arranged on the circuit board 44; a power supply circuit 45 for supplying power to the respective circuits or devices of the above-described electronic apparatus; the memory 43 is for storing executable program code; the processor 42 runs a program corresponding to the executable program code by reading the executable program code stored in the memory 43 for executing the service-down method provided in any of the foregoing embodiments. The specific implementation of the above steps by the processor 42 and the further implementation of the steps by the processor 42 through the execution of the executable program code may be referred to the description of the foregoing embodiments, and will not be repeated here.
Accordingly, embodiments of the present invention also provide a computer-readable storage medium storing one or more programs executable by one or more processors to implement any of the service offline methods provided by the foregoing embodiments. The specific execution of the steps by the processor and the further execution of the steps by the processor by executing the executable program code may be referred to the description of the foregoing embodiments, and will not be repeated here.
It is noted that relational terms such as first and second, and the like are 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. Moreover, 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 one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
In this specification, each embodiment is described in a related manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments.
In particular, for the device embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and reference is made to the description of the method embodiments in part.
For convenience of description, the above apparatus is described as being functionally divided into various units/modules, respectively. Of course, the functions of the various elements/modules may be implemented in the same piece or pieces of software and/or hardware when implementing the present invention.
Those skilled in the art will appreciate that implementing all or part of the above-described methods in accordance with the embodiments may be accomplished by way of a computer program stored on a computer readable storage medium, which when executed may comprise the steps of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), or the like.
The foregoing is merely illustrative of the present invention, and the present invention is not limited thereto, and any changes or substitutions easily contemplated by those skilled in the art within the scope of the present invention should be included in the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims (10)
1. A service offline method, applied to a service provider, comprising:
sending a service offline request to a registry or a flow balancing server so that the registry or the flow balancing server can log off the service;
setting a service state flag of the service to be stopped in response to a stop setting request sent by the registry or the flow equalization server;
judging whether the service meets the offline condition;
and if the service meets the offline condition, the service is offline.
2. The service offline method according to claim 1, wherein the determining whether the service satisfies an offline condition comprises:
judging whether the elapsed time length after the service state mark of the service is set to be stopped meets a preset duration threshold value or not;
and if the service state mark of the service is set to be that after the machine is stopped, the elapsed time length meets a preset duration threshold value, determining that the service meets the offline condition.
3. The service offline method according to claim 1, wherein the determining whether the service satisfies an offline condition comprises:
setting a service state flag of the service to be a time stamp of the flow entering the service after stopping;
judging whether the flow entering the service in a preset time window is smaller than a preset flow threshold value or not based on the time stamp;
if the flow entering the service in the preset time window is smaller than a preset flow threshold, determining that the service meets the offline condition.
4. A service offline method according to claim 3, wherein said recording a timestamp of traffic entering said service comprises:
the time stamp of the flow entering the service is put into a time stamp node of a time stamp linked list; wherein each timestamp node comprises a deposited timestamp, a pointer address pointing to a previous timestamp node, and a pointer address pointing to a subsequent timestamp node.
5. The service offline method according to claim 4, wherein the placing the timestamp of the traffic entering the service into the timestamp node of the timestamp linked list comprises:
and placing the timestamp of the latest traffic entering the service into a timestamp node at the head of the queue in a timestamp linked list.
6. The service offline method according to claim 3, wherein the determining whether the traffic entering the service within the preset time window is less than a preset traffic threshold based on the timestamp comprises:
judging whether the flow entering the service in a preset fixed time window or a preset sliding time window is smaller than a preset flow threshold value or not based on the time stamp;
if the flow entering the service in the preset time window is smaller than a preset flow threshold, determining that the service meets the offline condition includes:
if the flow entering the service in the preset fixed time window or the preset sliding time window is smaller than the preset flow threshold, determining that the service meets the offline condition.
7. A service drop-off device for use with a service provider, the service drop-off device comprising:
the off-line request module is used for sending a service off-line request to a registry or a flow balancing server so as to enable the registry or the flow balancing server to cancel the service;
the stop sign setting module is used for responding to a stop setting request sent by the registry or the flow balance server and setting the service state sign of the service as stop;
the off-line judging module is used for judging whether the service meets the off-line condition or not;
and the offline execution module is used for downloading the service if the service meets the offline condition.
8. The service offline apparatus according to claim 7, wherein the offline determination module comprises:
the time length judging unit is used for judging whether the elapsed time length after the service state mark of the service is set to be stopped meets a preset time length threshold value; and if the service state mark of the service is set to be that after the machine is stopped, the elapsed time length meets a preset duration threshold value, determining that the service meets the offline condition.
9. The service offline apparatus according to claim 7, wherein the offline determination module comprises:
the flow recording unit is used for setting the service state mark of the service as a time stamp of the flow entering the service after stopping;
the traffic judgment unit is used for judging whether the traffic entering the service in a preset time window is smaller than a preset traffic threshold value or not based on the time stamp; if the flow entering the service in the preset time window is smaller than a preset flow threshold, determining that the service meets the offline condition.
10. The service offline apparatus according to claim 9, wherein the traffic recording unit is configured to put a timestamp of traffic entering the service into a timestamp node of a timestamp linked list; wherein each timestamp node comprises a deposited timestamp, a pointer address pointing to a previous timestamp node, and a pointer address pointing to a subsequent timestamp node.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310773593.4A CN116962416A (en) | 2023-06-27 | 2023-06-27 | Service offline method, device and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310773593.4A CN116962416A (en) | 2023-06-27 | 2023-06-27 | Service offline method, device and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116962416A true CN116962416A (en) | 2023-10-27 |
Family
ID=88453943
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310773593.4A Pending CN116962416A (en) | 2023-06-27 | 2023-06-27 | Service offline method, device and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116962416A (en) |
-
2023
- 2023-06-27 CN CN202310773593.4A patent/CN116962416A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8073952B2 (en) | Proactive load balancing | |
US8984123B2 (en) | Rejuvenation processing device, rejuvenation processing system, computer program, and data processing method | |
CN106533805B (en) | Micro-service request processing method, micro-service controller and micro-service architecture | |
US10972336B2 (en) | Technique for resolving a link failure | |
US20080288812A1 (en) | Cluster system and an error recovery method thereof | |
US20080077657A1 (en) | Transaction takeover system | |
CN109450701B (en) | Virtual switch switching method and device, host machine and computer readable storage medium | |
US7434085B2 (en) | Architecture for high availability using system management mode driven monitoring and communications | |
CN110618889A (en) | Service availability detection method and device, computer equipment and storage medium | |
CN109361542A (en) | The fault handling method of client, device, system, terminal and server | |
CN111585835B (en) | Control method and device for out-of-band management system and storage medium | |
CN113867915A (en) | Task scheduling method, electronic device and storage medium | |
CN116962416A (en) | Service offline method, device and storage medium | |
CN116233155A (en) | Hybrid cloud data synchronization method and device, electronic equipment and storage medium | |
CN115712521A (en) | Cluster node fault processing method, system and medium | |
CN113688021B (en) | Load balancing service processing method, device, equipment and readable storage medium | |
JP2006285453A (en) | Information processor, information processing method, and information processing program | |
CN109947630B (en) | Fault notification method, device and storage medium | |
CN112367386B (en) | Ignite-based automatic operation and maintenance method and device and computer equipment | |
CN109032643A (en) | The method and apparatus of software upgrading | |
US8595349B1 (en) | Method and apparatus for passive process monitoring | |
CN110865895B (en) | Access flow control method, device, electronic equipment and storage medium | |
CN106776119A (en) | The method for restarting of Service Instance, device and server | |
JP5691248B2 (en) | Task takeover program, processing device, and computer system | |
CN111934909A (en) | Method and device for switching IP (Internet protocol) resources of host and standby machine, computer equipment and storage medium |
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 |