CN111245873A - Service degradation method, device, equipment and storage medium - Google Patents

Service degradation method, device, equipment and storage medium Download PDF

Info

Publication number
CN111245873A
CN111245873A CN201811431892.5A CN201811431892A CN111245873A CN 111245873 A CN111245873 A CN 111245873A CN 201811431892 A CN201811431892 A CN 201811431892A CN 111245873 A CN111245873 A CN 111245873A
Authority
CN
China
Prior art keywords
service
data
gateway
storage unit
detector
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.)
Granted
Application number
CN201811431892.5A
Other languages
Chinese (zh)
Other versions
CN111245873B (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.)
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology 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 Beijing Jingdong Century Trading Co Ltd, Beijing Jingdong Shangke Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN201811431892.5A priority Critical patent/CN111245873B/en
Publication of CN111245873A publication Critical patent/CN111245873A/en
Application granted granted Critical
Publication of CN111245873B publication Critical patent/CN111245873B/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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0813Configuration setting characterised by the conditions triggering a change of settings
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0813Configuration setting characterised by the conditions triggering a change of settings
    • H04L41/0816Configuration setting characterised by the conditions triggering a change of settings the condition being an adaptation, e.g. in response to network events
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0805Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability
    • 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/55Push-based network services

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Environmental & Geological Engineering (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention provides a service degradation method, a device, equipment and a storage medium, wherein a service detector requests service data from a service end through a service gateway, monitors whether the service is available, and pushes the service data to a storage unit corresponding to the service if the service is available; and if the service is unavailable, the service detector informs the service gateway to start a service degradation mode for the service, and the user requests service data from the storage unit corresponding to the service through the service gateway. Because the service data in the storage unit is updated by the service detector when the service is available, the service data acquired from the storage unit by a user after the service degradation is basically consistent with the real data, the elegant degradation of the reading service with no particularly high requirement on the data consistency is realized, and the service and the user experience are not influenced.

Description

Service degradation method, device, equipment and storage medium
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a method, an apparatus, a device, and a storage medium for service degradation.
Background
In order to guarantee the normal operation of the system, degradation processing of the service must be considered when the pressure of the server sharply increases or the service is abnormal. For example, when an interface for acquiring the information of the promotion activity is abnormal, the cached data can be adopted, which is a service degradation, thereby ensuring the availability of the system and improving the user experience.
The current service degradation mode usually adopts shielding degradation, a switch is arranged in a business code, and the calling of the service is manually closed when the service is not available. The existing service degradation method directly closes the service when the service is unavailable, but cannot automatically start the service in time when the service is recovered, so that a user cannot use the service after the service degradation, and the service and the user experience are influenced.
Disclosure of Invention
The invention provides a service degradation method, a device, equipment and a storage medium, so that a user can still obtain service data after service degradation, the service data is basically consistent with real data, and service and user experience are not influenced.
The first aspect of the present invention provides a service degradation method, including:
requesting service data from a server through a service gateway;
monitoring whether the service of the server is available;
if the service is available, pushing the service data to a storage unit corresponding to the service;
and if the service is unavailable, informing the service gateway to start a service degradation mode for the service so that a user requests service data from a storage unit corresponding to the service through the service gateway.
A second aspect of the present invention provides a service degradation method, including:
receiving a service request, identifying a source of the service request;
if the service request is sent by a service detector, service data are obtained from a service end according to the service request and returned to the service detector, and the service data are pushed to a storage unit corresponding to the service after a push instruction sent by the service detector when the service of the service end is determined to be available is received;
and if the service request is sent by the user, requesting service data to the service or the storage unit corresponding to the service according to whether the service starts a service degradation mode and returning the service data to the user.
A third aspect of the present invention is to provide a service degradation apparatus, including:
the request module is used for requesting service data from the server through the service gateway;
a processing module for monitoring whether the service is available;
the pushing module is used for pushing the service data to a storage unit corresponding to the service if the service is available;
the processing module is further configured to, if the service is unavailable, notify the service gateway to start a service degradation mode for the service by the service detector, so that a user requests service data from a storage unit corresponding to the service through the service gateway.
A fourth aspect of the present invention provides a service degradation apparatus, including:
a communication module for receiving a service request;
a processing module for identifying a source of the service request; if the service request is sent by a service detector according to preset polling interval time, controlling the communication module to obtain service data from a service end according to the service request and return the service data to the service detector, and after receiving a push instruction sent by the service detector when the service detector determines that the service of the service end is available, pushing the service data to a storage unit corresponding to the service by the service detector through the communication module; and if the service request is sent by a user, controlling the communication module to request service data to the service or the storage unit corresponding to the service to be returned to the user according to whether the service starts a service degradation mode.
A fifth aspect of the present invention provides a service detector, comprising:
a memory;
a processor; and
a computer program;
wherein the computer program is stored in the memory and configured to be executed by the processor to implement the method of the first aspect.
A sixth aspect of the present invention provides a service gateway, comprising:
a memory;
a processor; and
a computer program;
wherein the computer program is stored in the memory and configured to be executed by the processor to implement the method of the second aspect.
A seventh aspect of the present invention is to provide a computer-readable storage medium having a computer program stored thereon;
which when executed by a processor implements the method according to the first aspect.
An eighth aspect of the present invention is to provide a computer-readable storage medium having stored thereon a computer program;
which when executed by a processor implements the method according to the first aspect.
According to the service degradation method, the device, the equipment and the storage medium, the service detector requests service data from the service end through the service gateway, monitors whether the service is available or not, and pushes the service data to the storage unit corresponding to the service if the service is available; and if the service is unavailable, the service detector informs the service gateway to start a service degradation mode for the service, and the user requests service data from the storage unit corresponding to the service through the service gateway. Because the service data in the storage unit is updated by the service detector when the service is available, the service data acquired from the storage unit by a user after the service degradation is basically consistent with the real data, the elegant degradation of the reading service with no particularly high requirement on the data consistency is realized, and the service and the user experience are not influenced.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
FIG. 1 is a diagram of a system architecture according to an embodiment of the present invention;
FIG. 2 is a flowchart of a method for service degradation according to an embodiment of the present invention;
FIG. 3 is a flow chart of a method for downgrading a service according to another embodiment of the present invention;
FIG. 4 is a block diagram of a service downgrade apparatus according to an embodiment of the present invention;
FIG. 5 is a block diagram of a service downgrade apparatus according to another embodiment of the present invention;
FIG. 6 is a block diagram of a service detector provided by an embodiment of the present invention;
fig. 7 is a structural diagram of a service gateway according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The service degradation method provided by the present invention can be applied to the communication system shown in fig. 1. As shown in fig. 1, the communication system includes a service detector, a service gateway, a service end, a storage unit, a user, and may further include a configuration unit and a database, where the connection relationship is as shown in fig. 1, it should be noted that a plurality of service ends may be provided, and respectively provide different services, each service may correspond to at least one storage unit, and only one service end and one storage unit are shown in fig. 1. The storage unit may be a CDN (Content Delivery Network), and the CDN has a basic principle that various cache servers are widely used, and are distributed to a region or a Network where user access is relatively concentrated, and when a user accesses a website, the access of the user is directed to a cache server that is closest to the user and works normally, and the cache server directly responds to a user request; the service detector can send a request to a server through the service gateway at preset time intervals to acquire service data, monitor whether the service is available according to the request state and the returned service data, inform the service gateway to start service degradation if the service is unavailable, and push the latest service data to a storage unit corresponding to the service through the service gateway if the service is determined to be available after the service detector requests the service data each time; after receiving a service request of a user, if the service is identified to be degraded, the service gateway directly acquires service data from a storage unit corresponding to the service and returns the service data to the user, and if the service is not degraded, the service gateway directly acquires the service data from the service end. The service degradation process is described in detail below with reference to specific embodiments.
Fig. 2 is a flowchart of a service downgrading method according to an embodiment of the present invention. The embodiment provides a service degradation method, wherein an execution subject is a service detector, and the method comprises the following specific steps:
s101, service data is requested to a server through a service gateway. .
In this embodiment, the service probe sends a service request to the server through the service gateway at preset intervals, and receives the returned service data. Further, the service detector may request service data from the service end through the service gateway according to a preset polling interval time, so that the service data in the storage unit corresponding to the service may be updated. It should be noted that, no matter whether the service is degraded or not, the service detector may access the service end to obtain the service data, so as to determine whether the service can be recovered or not after the service is degraded. In addition, if there are multiple services, the service probe may send requests to each server in turn.
S102, monitoring whether the service of the server is available.
In this embodiment, the service detector monitors whether the service is available, specifically, a return code of the interface may be received each time the service detector requests the service, where the return code is preset, for example, 0 is returned when the service is available, and-1 is returned when the service is unavailable (for example, the service is busy), and the service detector may determine whether the service is available by identifying the return code. In addition, a data range may also be preset, and after the service detector acquires the service data each time, the service data is analyzed, and if the analysis result exceeds the data range, the service is determined to be unavailable, for example, a commodity price range is preset, and when the commodity price in the analyzed service data exceeds the commodity price range, the service data is indicated as an error, and further, the service is indicated as unavailable. Since the service detector may send the service request periodically, the determination of whether the service is available in this embodiment may be performed periodically accordingly. Of course, whether the monitoring service is available or not in this embodiment is not limited to the above example, and other monitoring methods may be adopted, which are not described herein again. If the service detector does not monitor whether the service is available or not by requesting service data from the server, the sequence of S101 and S102 is not limited.
S103, if the service is available, pushing the service data to a storage unit corresponding to the service.
In this embodiment, the service detector pushes the service data to the storage unit corresponding to the service through the service gateway after confirming that the service is available, so as to periodically update the service data in the storage unit, but in this embodiment, the service detector or the service gateway may also control the service to directly push the service data to the storage unit corresponding to the service. When the service detector determines that the service is unavailable, the service data in the storage unit may not be updated, so as to avoid uploading erroneous service data to the storage unit (for example, service data beyond a preset data range). The storage unit may be a content delivery network CDN.
And S104, if the service is unavailable, informing the service gateway to start a service degradation mode for the service so that a user requests service data from a storage unit corresponding to the service through the service gateway.
In this embodiment, when the service detector determines that the service is unavailable, the service gateway is notified to start a service degradation mode for the service, and then if a service request is received by a user, service data is obtained from a storage unit corresponding to the service. In the system, there may be more than one service, the service degradation is only for the unavailable service, and the user acquires the service data from the storage unit corresponding to the unavailable service.
In the service degradation method provided by this embodiment, a service detector requests service data from a service end through a service gateway, and monitors whether the service is available, and if the service is available, pushes the service data to a storage unit corresponding to the service; and if the service is unavailable, the service detector informs the service gateway to start a service degradation mode for the service, and the user requests service data from the storage unit corresponding to the service through the service gateway. Because the service data in the storage unit is updated by the service detector when the service is available, the service data acquired from the storage unit by a user after the service degradation is basically consistent with the real data, the elegant degradation of the reading service with no particularly high requirement on the data consistency is realized, and the service and the user experience are not influenced.
On the basis of the foregoing embodiment, if the service is unavailable in S103, the service detector notifies the service gateway to start a service degradation mode for the service, which may specifically include:
and if the service is unavailable, the service detector sends a first service state identifier modification instruction to the service gateway, so that the service gateway configures the service state identifier of the service as unavailable according to the first service state identifier modification instruction.
Further, if the service is available, the service detector sends a second service state identifier modification instruction to the service gateway, so that the service gateway configures the service state identifier of the service to be available according to the second service state identifier modification instruction.
In this embodiment, when it is determined that a certain service is not available, the service detector controls the service gateway to modify the service state identifier of the service into unavailable, when a user requests the service, the service gateway first identifies the service state identifier of the service, if the service state identifier is available, the service gateway obtains service data from the service according to the service request and returns the service data to the user, and if the service state identifier is unavailable, the service gateway obtains the service data from a storage unit corresponding to the service according to the service request and returns the service data to the user. The embodiment configures the service state identifier at the service gateway, thereby implementing the start and shutdown of service degradation.
In the foregoing embodiment, the step S102 of monitoring, by the service detector, whether the service is available may specifically include:
the service detector receives a return code sent by the service gateway after requesting service through the service gateway, compares the return code with a preset return code, and determines that the service is unavailable if the return code is matched with a service abnormal return code in the preset return code; and/or
And the service detector analyzes the returned service data, judges whether an analysis result meets a preset data range, and determines that the service is unavailable if the analysis result does not meet the preset data range.
In this embodiment, whether the service is available or not may be determined by the return code and/or the service data parsing result, where a preset return code is agreed in advance, for example, 0 is returned when the service is available, and-1 is returned when the service is abnormal (for example, the service is busy), the return code of the interface is received each time the service probe requests the service, and the service probe may determine whether the service is available or not by identifying the return code. And a preset data range can be predetermined, the service detector analyzes the service data each time after acquiring the service data, and if the analysis result exceeds the data range, the service is judged to be unavailable.
Further, whether the service is available or not can be judged by using the return code, if the return code is matched with the service abnormal return code, the service data is not analyzed, and the unavailability of the service is directly determined; and when the return code is not matched with the service abnormal return code, further analyzing the service data, judging whether the analysis result meets a preset data range, if not, determining that the service is unavailable, and if so, determining that the service is available.
On the basis of the above embodiment, the method may further include:
and the service detector receives a service degradation strategy sent by a configuration unit, wherein the service degradation strategy comprises the preset interval time and/or the preset return code and/or the preset data range.
In this embodiment, a development engineer or a manager may configure the service degradation policy in a personalized manner, for example, set or modify a preset interval time and/or a preset return code and/or a preset data range in the configuration unit according to a requirement, and after the configuration unit configures the service degradation policy, the service degradation policy is sent to the service detector, so as to perform service degradation according to the service degradation policy. In addition, a development engineer or a manager can also force service degradation, a forced service degradation instruction is sent to the service detector through the configuration unit, and the service detector informs the service gateway to start a service degradation mode for the service according to the forced service degradation instruction.
According to the service degradation method provided by the embodiment, the service detector updates the service data in the storage unit corresponding to the service when the service is available, so that the service data acquired from the storage unit by a user after the service degradation is basically consistent with the real data, the elegant degradation of the reading service without particularly high requirement on data consistency is realized, and the service and the user experience are not influenced. In addition, automatic opening or closing of service degradation can be realized, and manual operation is not needed; meanwhile, the method does not need to be coupled with the service, and has better flexibility and expandability.
Fig. 3 is a flowchart of a service downgrading method according to an embodiment of the present invention. The embodiment provides a service degradation method, wherein an execution subject is a service gateway, and the method comprises the following specific steps:
s201, receiving a service request, and identifying a source of the service request.
In this embodiment, since the service probe can access the service acquisition service data regardless of whether the service is degraded or not, and the user can only acquire the service data from the storage unit after the service is degraded, the service gateway needs to identify whether the source of the service request is the service probe or the user. The storage unit may be a content delivery network CDN.
S202, if the service request is sent by a service detector according to a preset polling interval time, the service gateway obtains service data from a service end according to the service request and returns the service data to the service detector, and after receiving a push instruction sent by the service detector when the service detector determines that the service of the service end is available, the service data is pushed to a storage unit on the CDN corresponding to the service by the service detector through the service gateway.
In this embodiment, the service probe sends a service request to the server through the service gateway, receives the returned service data, and when the service probe determines that the service of the server is available, pushes the service data to the storage unit corresponding to the service through the service gateway, so as to update the service data in the storage unit. Of course, the service data can also be pushed directly to the corresponding storage unit by the service detector or the service gateway control service. The service detector can request service data from the server through the service gateway at preset intervals, so that the service data in the storage unit can be periodically updated. When the service detector determines that the service is unavailable, the service detector may not send a push instruction to the service gateway to update the service data in the storage unit, so as to avoid uploading wrong service data to the storage unit (for example, service data beyond a preset data range).
S203, if the service request is sent by the user, requesting service data to the service or the storage unit corresponding to the service according to whether the service starts a service degradation mode and returning the service data to the user.
In this embodiment, when a user sends a service request, if the service degradation mode is not started at this time, service data is requested from the service and returned to the user, and if the service degradation mode is started at this time, service data is requested from a storage unit corresponding to the service and returned to the user.
In this embodiment, S202 and S203 do not have any sequence, and no conflict occurs, for example, when the service gateway receives service requests sent by the service detector and the user at the same time, S202 and S203 are respectively executed.
In the service degradation method provided by this embodiment, a service detector requests service data from a service end through a service gateway, and monitors whether the service is available, and if the service is available, pushes the service data to a storage unit corresponding to the service; and if the service is unavailable, the service detector informs the service gateway to start a service degradation mode for the service, and the user requests service data from the storage unit corresponding to the service through the service gateway. Because the service data in the storage unit is updated by the service detector when the service is available, the service data acquired from the storage unit by a user after the service degradation is basically consistent with the real data, the elegant degradation of the reading service with no particularly high requirement on the data consistency is realized, and the service and the user experience are not influenced.
On the basis of the above embodiment, the method may further include:
when the service gateway receives a first service state identifier modification instruction sent by the service detector after judging that the service is unavailable, configuring the service state identifier of the service as unavailable according to the first service state identifier modification instruction;
and when the service gateway receives a second service state identifier modification instruction sent by the service detector after judging that the service is available, configuring the service state identifier of the service to be available according to the second service state identifier modification instruction.
In this embodiment, when the service detector determines that a certain service is unavailable, the service detector controls the service gateway to modify the service state identifier of the service into unavailable, when the user requests the service, the service gateway first identifies the service state identifier of the service, if the service state identifier is available, the service gateway obtains service data from the service according to the service request and returns the service data to the user, and if the service state identifier is unavailable, the service gateway obtains the service data from the storage unit corresponding to the service according to the service request and returns the service data to the user. The embodiment configures the service state identifier at the service gateway, thereby implementing the start and shutdown of service degradation.
That is, in S203, the service gateway requests the service or the storage unit corresponding to the service for service data to be returned to the user according to whether the service opens the service degradation mode, specifically including:
the service gateway identifies the service state identification of the service;
if the service state identification is available, the service gateway acquires service data from the service end according to the service request and returns the service data to the user;
and if the service state identifier is unavailable, the service gateway acquires service data from a storage unit corresponding to the service according to the service request and returns the service data to the user.
According to the service degradation method provided by the embodiment, the service detector updates the service data in the storage unit corresponding to the service when the service is available, so that the service data acquired from the storage unit by a user after the service degradation is basically consistent with the real data, the elegant degradation of the reading service without particularly high requirement on data consistency is realized, and the service and the user experience are not influenced. In addition, automatic opening or closing of service degradation can be realized, and manual operation is not needed; meanwhile, the method does not need to be coupled with the service, and has better flexibility and expandability.
On the basis of the foregoing embodiments, the present embodiment provides a service degradation method, which includes the following specific steps:
s301, the service detector requests service data from the service end through the service gateway according to the preset interval time.
S302, after the service detector requests service through the service gateway, receiving a return code sent by the service gateway, comparing the return code with a preset return code, and if the return code is matched with a service abnormal return code in the preset return code, judging whether the service is available; and/or the service detector analyzes the returned service data and judges whether the analysis result meets a preset data range, thereby judging whether the service is available.
If the service is available, executing S303; if the service is not available, executing S304;
s303, if the service is available, the service detector pushes the service data to a storage unit corresponding to the service; and is
And the service detector sends a second service state identification modification instruction to the service gateway so that the service gateway configures the service state identification of the service to be available according to the second service state identification modification instruction.
S304, if the service is unavailable, the service detector sends a first service state identifier modification instruction to the service gateway, so that the service gateway configures the service state identifier of the service as unavailable according to the first service state identifier modification instruction.
When the user requests the service data, the specific steps are as follows:
s311, the user sends a service request to the service gateway through the user side.
S312, after the service gateway receives the service request, the service gateway identifies that the service request is sent by the user, and then identifies the service state identifier of the service.
S313, if the service state identification is available, the service gateway acquires service data from the service end according to the service request and returns the service data to the user.
And S314, if the service state identifier is unavailable, the service gateway acquires service data from the storage unit corresponding to the service according to the service request and returns the service data to the user.
In the service degradation method provided by this embodiment, a service detector requests service data from a service end through a service gateway, and monitors whether the service is available, and if the service is available, pushes the service data to a storage unit corresponding to the service; and if the service is unavailable, the service detector informs the service gateway to start a service degradation mode for the service, and the user requests service data from the storage unit corresponding to the service through the service gateway. Because the service data in the storage unit is updated by the service detector when the service is available, the service data acquired from the storage unit by a user after the service degradation is basically consistent with the real data, the elegant degradation of the reading service with no particularly high requirement on the data consistency is realized, and the service and the user experience are not influenced.
Fig. 4 is a structural diagram of a service downgrading apparatus according to an embodiment of the present invention. The service degradation device may specifically be the service detector in the above-described embodiment. The service downgrading apparatus provided in this embodiment may execute the processing procedure provided in the service downgrading method of the service probe side, as shown in fig. 4, the service downgrading apparatus 40 includes a request module 41, a push module 42, and a processing module 43.
The request module 41 is configured to request service data from a server through a service gateway;
a processing module 43 for monitoring whether the service is available;
a pushing module 42, configured to push the service data to a storage unit corresponding to the service if the service is available;
the processing module 43 is further configured to, if the service is not available, notify the service gateway to start a service degradation mode for the service by the service detector, so that a user requests service data from a storage unit corresponding to the service through the service gateway.
Further, the processing module 43 is configured to:
and if the service is unavailable, sending a first service state identification modification instruction to the service gateway so that the service gateway configures the service state identification of the service as unavailable according to the first service state identification modification instruction.
Further, the processing module 43 is further configured to:
and if the service is available, sending a second service state identification modification instruction to the service gateway so that the service gateway configures the service state identification of the service to be available according to the second service state identification modification instruction.
Further, the processing module 43 is specifically configured to:
after the service is requested through the service gateway, receiving a return code sent by the service gateway, comparing the return code with a preset return code, and if the return code is matched with a service abnormal return code in the preset return code, determining that the service is unavailable; and/or
And analyzing the returned service data, judging whether an analysis result meets a preset data range, and if not, determining that the service is unavailable.
Further, the apparatus further comprises:
a receiving module, configured to receive a service degradation policy sent by a configuration unit, where the service degradation policy includes the preset interval time and/or the preset return code and/or the preset data range.
Further, the requesting module 41 is specifically configured to request service data from the service end through the service gateway according to a preset polling interval time.
Further, the storage unit is a content delivery network CDN.
The service degradation apparatus provided in the embodiment of the present invention may be specifically configured to execute the method embodiment provided in fig. 2, and specific functions are not described herein again.
According to the service degradation device provided by the embodiment of the invention, the service detector requests service data from the service end through the service gateway, monitors whether the service is available or not, and pushes the service data to the storage unit corresponding to the service if the service is available; and if the service is unavailable, the service detector informs the service gateway to start a service degradation mode for the service, and the user requests service data from the storage unit corresponding to the service through the service gateway. Because the service data in the storage unit is updated by the service detector when the service is available, the service data acquired from the storage unit by a user after the service degradation is basically consistent with the real data, the elegant degradation of the reading service with no particularly high requirement on the data consistency is realized, and the service and the user experience are not influenced.
Fig. 5 is a structural diagram of a service downgrading apparatus according to an embodiment of the present invention. The service downgrading means may specifically be a gateway in the above-described embodiment. The service downgrading apparatus provided in this embodiment may execute the processing procedure provided in the service downgrading method of the service gateway side, as shown in fig. 5, the service downgrading apparatus 50 includes a communication module 51 and a processing module 52.
The communication module 51 is configured to receive a service request;
a processing module 52 for identifying the source of the service request; if the service request is sent by a service detector, controlling the communication module 51 to obtain service data from a server according to the service request and return the service data to the service detector, and after receiving a push instruction sent by the service detector when determining that the service of the server is available, pushing the service data to a storage unit corresponding to the service through the communication module 51; if the service request is sent by a user, the communication module 51 is controlled to request service data to the service or the storage unit corresponding to the service to be returned to the user according to whether the service degradation mode is started or not.
Further, the apparatus further comprises a configuration module configured to:
when a first service state identifier modification instruction sent by the service detector after judging that the service is unavailable is received, configuring the service state identifier of the service as unavailable according to the first service state identifier modification instruction;
and when a second service state identifier modification instruction sent by the service detector after the service is judged to be available is received, configuring the service state identifier of the service to be available according to the second service state identifier modification instruction.
Further, the processing module 52 is specifically configured to:
identifying a service state identification of the service;
if the service state identification is available, controlling the communication module to acquire service data from the service end according to the service request and returning the service data to the user;
and if the service state identifier is unavailable, controlling the communication module to acquire service data from a storage unit corresponding to the service according to the service request and returning the service data to the user.
Further, the storage unit is a content delivery network CDN.
The service degradation apparatus provided in the embodiment of the present invention may be specifically configured to execute the method embodiment provided in fig. 3, and specific functions are not described herein again.
According to the service degradation device provided by the embodiment of the invention, the service detector requests service data from the service end through the service gateway, monitors whether the service is available or not, and pushes the service data to the storage unit corresponding to the service if the service is available; and if the service is unavailable, the service detector informs the service gateway to start a service degradation mode for the service, and the user requests service data from the storage unit corresponding to the service through the service gateway. Because the service data in the storage unit is updated by the service detector when the service is available, the service data acquired from the storage unit by a user after the service degradation is basically consistent with the real data, the elegant degradation of the reading service with no particularly high requirement on the data consistency is realized, and the service and the user experience are not influenced.
Fig. 6 is a schematic structural diagram of a service detector according to an embodiment of the present invention. The service detector provided in the embodiment of the present invention may execute the processing flow provided in the embodiment of the service degradation method on the service detector side, as shown in fig. 6, the service detector 60 includes a memory 61, a processor 62, a computer program, and a communication interface 63; wherein a computer program is stored in the memory 61 and configured to be executed by the processor 62 for performing the block chain reconciliation method described in the above embodiments.
The service detector of the embodiment shown in fig. 6 may be used to implement the technical solution of the above method embodiment, and the implementation principle and technical effect are similar, which are not described herein again.
Fig. 7 is a schematic structural diagram of a service gateway according to an embodiment of the present invention. The service gateway provided in the embodiment of the present invention may execute the processing flow provided in the embodiment of the service degradation method at the service gateway side, as shown in fig. 7, the service gateway 70 includes a memory 71, a processor 72, a computer program, and a communication interface 73; wherein a computer program is stored in the memory 71 and configured to execute the block chain reconciliation method described in the above embodiments by the processor 72.
The service gateway in the embodiment shown in fig. 7 may be configured to execute the technical solution of the above method embodiment, and the implementation principle and the technical effect are similar, which are not described herein again.
In addition, the present embodiment also provides a computer-readable storage medium, on which a computer program is stored, the computer program being executed by a processor to implement the service degradation method on the service probe side described in the above embodiments.
In addition, the present embodiment also provides a computer-readable storage medium, on which a computer program is stored, where the computer program is executed by a processor to implement the service degradation method on the service gateway side described in the above embodiment.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
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 units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.
The integrated unit implemented in the form of a software functional unit may be stored in a computer readable storage medium. The software functional unit is stored in a storage medium and includes several instructions to enable a computer device (which may be a personal computer, a server, or a network device) or a processor (processor) to execute some steps of the methods according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
It is obvious to those skilled in the art that, for convenience and simplicity of description, the foregoing division of the functional modules is merely used as an example, and in practical applications, the above function distribution may be performed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to perform all or part of the above described functions. For the specific working process of the device described above, reference may be made to the corresponding process in the foregoing method embodiment, which is not described herein again.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.

Claims (17)

1. A method for service degradation, comprising:
requesting service data from a server through a service gateway;
monitoring whether the service of the server is available;
if the service is available, pushing the service data to a storage unit corresponding to the service;
and if the service is unavailable, informing the service gateway to start a service degradation mode for the service so that a user requests service data from a storage unit corresponding to the service through the service gateway.
2. The method of claim 1, wherein notifying the service gateway to open a service degradation mode for the service if the service is unavailable comprises:
and if the service is unavailable, sending a first service state identification modification instruction to the service gateway so that the service gateway configures the service state identification of the service as unavailable according to the first service state identification modification instruction.
3. The method of claim 2, further comprising:
and if the service is available, sending a second service state identification modification instruction to the service gateway so that the service gateway configures the service state identification of the service to be available according to the second service state identification modification instruction.
4. A method according to any of claims 1-3, wherein said monitoring whether said service is available comprises:
after the service is requested through the service gateway, receiving a return code sent by the service gateway, comparing the return code with a preset return code, and if the return code is matched with a service abnormal return code in the preset return code, determining that the service is unavailable; and/or
And analyzing the returned service data, judging whether an analysis result meets a preset data range, and if not, determining that the service is unavailable.
5. The method of claim 4, further comprising:
and receiving a service degradation strategy sent by a configuration unit, wherein the service degradation strategy comprises the preset polling interval time and/or the preset return code and/or the preset data range.
6. The method of claim 1, wherein the requesting service data from the server through the service gateway comprises:
and requesting service data to the service end through the service gateway according to the preset polling interval time.
7. The method of claim 1, wherein the storage unit is a Content Delivery Network (CDN).
8. A method for service degradation, comprising:
receiving a service request, identifying a source of the service request;
if the service request is sent by a service detector, service data are obtained from a service end according to the service request and returned to the service detector, and the service data are pushed to a storage unit corresponding to the service after a push instruction sent by the service detector when the service of the service end is determined to be available is received;
and if the service request is sent by the user, requesting service data to the service or the storage unit corresponding to the service according to whether the service starts a service degradation mode and returning the service data to the user.
9. The method of claim 8, further comprising:
when a first service state identifier modification instruction sent by the service detector after judging that the service is unavailable is received, configuring the service state identifier of the service as unavailable according to the first service state identifier modification instruction;
and when a second service state identifier modification instruction sent by the service detector after the service is judged to be available is received, configuring the service state identifier of the service to be available according to the second service state identifier modification instruction.
10. The method of claim 9, wherein requesting service data from the service or a storage unit corresponding to the service to be returned to the user according to whether the service has a service degradation mode enabled comprises:
identifying a service state identification of the service;
if the service state identification is available, service data are obtained from the service end according to the service request and returned to the user;
and if the service state identification is unavailable, acquiring service data from a storage unit corresponding to the service according to the service request and returning the service data to the user.
11. The method according to any of claims 8-10, wherein the storage unit is a content delivery network, CDN.
12. A service degradation apparatus, comprising:
the request module is used for requesting service data from the server through the service gateway;
a processing module for monitoring whether the service is available;
the pushing module is used for pushing the service data to a storage unit corresponding to the service if the service is available;
the processing module is further configured to, if the service is unavailable, notify the service gateway to start a service degradation mode for the service by the service detector, so that a user requests service data from a storage unit corresponding to the service through the service gateway.
13. A service degradation apparatus, comprising:
a communication module for receiving a service request;
a processing module for identifying a source of the service request; if the service request is sent by a service detector, controlling the communication module to acquire service data from a server according to the service request and return the service data to the service detector, and after receiving a push instruction sent by the service detector when the service of the server is determined to be available, pushing the service data to a storage unit corresponding to the service through the communication module; and if the service request is sent by a user, controlling the communication module to request service data to the service or the storage unit corresponding to the service to be returned to the user according to whether the service starts a service degradation mode.
14. A service detector, comprising:
a memory;
a processor; and
a computer program;
wherein the computer program is stored in the memory and configured to be executed by the processor to implement the method of any one of claims 1-7.
15. A serving gateway, comprising:
a memory;
a processor; and
a computer program;
wherein the computer program is stored in the memory and configured to be executed by the processor to implement the method of any one of claims 8-11.
16. A computer-readable storage medium, having stored thereon a computer program;
the computer program, when executed by a processor, implementing the method of any one of claims 1-7.
17. A computer-readable storage medium, having stored thereon a computer program;
the computer program, when executed by a processor, implementing the method of any one of claims 8-11.
CN201811431892.5A 2018-11-28 2018-11-28 Service degradation method, device, equipment and storage medium Active CN111245873B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811431892.5A CN111245873B (en) 2018-11-28 2018-11-28 Service degradation method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811431892.5A CN111245873B (en) 2018-11-28 2018-11-28 Service degradation method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111245873A true CN111245873A (en) 2020-06-05
CN111245873B CN111245873B (en) 2023-09-05

Family

ID=70863627

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811431892.5A Active CN111245873B (en) 2018-11-28 2018-11-28 Service degradation method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111245873B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113486029A (en) * 2021-06-28 2021-10-08 上海万物新生环保科技集团有限公司 Data compensation method, system and equipment for service degradation
CN114143056A (en) * 2021-11-24 2022-03-04 上海派拉软件股份有限公司 Terminal access method and device, electronic equipment and storage medium
CN114138366A (en) * 2021-11-30 2022-03-04 驭势(上海)汽车科技有限公司 Service control method, device, equipment and storage medium
WO2022077221A1 (en) * 2020-10-13 2022-04-21 深圳市大疆创新科技有限公司 Service management and access methods and apparatuses, device, and storage medium
CN116233250A (en) * 2022-11-28 2023-06-06 荣耀终端有限公司 Service calling method and gateway equipment

Citations (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1804810A (en) * 2005-01-14 2006-07-19 国际商业机器公司 Method and system of redirection for storage access requests
US20100293256A1 (en) * 2007-12-26 2010-11-18 Nec Corporation Graceful degradation designing system and method
EP2637097A1 (en) * 2012-03-05 2013-09-11 Accenture Global Services Limited Differentiated service-based graceful degradation layer
US20140244589A1 (en) * 2013-02-25 2014-08-28 Nec Corporation Server, backup system and backup method
CN105072201A (en) * 2015-08-28 2015-11-18 北京奇艺世纪科技有限公司 Distributed storage system and storage quality control method and device thereof
CN105164991A (en) * 2013-09-17 2015-12-16 思科技术公司 Redundancy network protocol system
US20160149855A1 (en) * 2013-06-26 2016-05-26 Huawei Technologies Co., Ltd. Service processing method, system, and relevant device
CN107222567A (en) * 2017-07-07 2017-09-29 北京京东尚科信息技术有限公司 Method, device and the service cluster of processing data request
CN107958018A (en) * 2017-10-17 2018-04-24 北京百度网讯科技有限公司 Data-updating method, device and computer-readable medium in caching
US20180129576A1 (en) * 2016-11-10 2018-05-10 International Business Machines Corporation Handling degraded conditions using a redirect module
US20180146033A1 (en) * 2016-11-23 2018-05-24 Level 3 Communications, Llc Overload handling in a content delivery network (cdn)
CN108153603A (en) * 2017-12-08 2018-06-12 上海陆家嘴国际金融资产交易市场股份有限公司 Database server fault handling method, device and storage medium
CN108156013A (en) * 2016-12-02 2018-06-12 阿里巴巴集团控股有限公司 A kind of Page Service disaster recovery method, device and electronic equipment
US10007434B1 (en) * 2016-06-28 2018-06-26 EMC IP Holding Company LLC Proactive release of high performance data storage resources when exceeding a service level objective
CN108259526A (en) * 2016-12-28 2018-07-06 阿里巴巴集团控股有限公司 A kind of data transmission method and device
CN108829498A (en) * 2018-03-30 2018-11-16 阿里巴巴集团控股有限公司 Service data visitation method and apparatus

Patent Citations (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1804810A (en) * 2005-01-14 2006-07-19 国际商业机器公司 Method and system of redirection for storage access requests
US20100293256A1 (en) * 2007-12-26 2010-11-18 Nec Corporation Graceful degradation designing system and method
EP2637097A1 (en) * 2012-03-05 2013-09-11 Accenture Global Services Limited Differentiated service-based graceful degradation layer
US20140244589A1 (en) * 2013-02-25 2014-08-28 Nec Corporation Server, backup system and backup method
US20160149855A1 (en) * 2013-06-26 2016-05-26 Huawei Technologies Co., Ltd. Service processing method, system, and relevant device
CN105164991A (en) * 2013-09-17 2015-12-16 思科技术公司 Redundancy network protocol system
CN105072201A (en) * 2015-08-28 2015-11-18 北京奇艺世纪科技有限公司 Distributed storage system and storage quality control method and device thereof
US10007434B1 (en) * 2016-06-28 2018-06-26 EMC IP Holding Company LLC Proactive release of high performance data storage resources when exceeding a service level objective
US20180129576A1 (en) * 2016-11-10 2018-05-10 International Business Machines Corporation Handling degraded conditions using a redirect module
US20180146033A1 (en) * 2016-11-23 2018-05-24 Level 3 Communications, Llc Overload handling in a content delivery network (cdn)
CN108156013A (en) * 2016-12-02 2018-06-12 阿里巴巴集团控股有限公司 A kind of Page Service disaster recovery method, device and electronic equipment
CN108259526A (en) * 2016-12-28 2018-07-06 阿里巴巴集团控股有限公司 A kind of data transmission method and device
CN107222567A (en) * 2017-07-07 2017-09-29 北京京东尚科信息技术有限公司 Method, device and the service cluster of processing data request
CN107958018A (en) * 2017-10-17 2018-04-24 北京百度网讯科技有限公司 Data-updating method, device and computer-readable medium in caching
CN108153603A (en) * 2017-12-08 2018-06-12 上海陆家嘴国际金融资产交易市场股份有限公司 Database server fault handling method, device and storage medium
CN108829498A (en) * 2018-03-30 2018-11-16 阿里巴巴集团控股有限公司 Service data visitation method and apparatus

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022077221A1 (en) * 2020-10-13 2022-04-21 深圳市大疆创新科技有限公司 Service management and access methods and apparatuses, device, and storage medium
CN113486029A (en) * 2021-06-28 2021-10-08 上海万物新生环保科技集团有限公司 Data compensation method, system and equipment for service degradation
CN114143056A (en) * 2021-11-24 2022-03-04 上海派拉软件股份有限公司 Terminal access method and device, electronic equipment and storage medium
CN114143056B (en) * 2021-11-24 2024-04-05 上海派拉软件股份有限公司 Terminal access method and device, electronic equipment and storage medium
CN114138366A (en) * 2021-11-30 2022-03-04 驭势(上海)汽车科技有限公司 Service control method, device, equipment and storage medium
CN116233250A (en) * 2022-11-28 2023-06-06 荣耀终端有限公司 Service calling method and gateway equipment
CN116233250B (en) * 2022-11-28 2023-12-15 荣耀终端有限公司 Service calling method and gateway equipment

Also Published As

Publication number Publication date
CN111245873B (en) 2023-09-05

Similar Documents

Publication Publication Date Title
CN111245873B (en) Service degradation method, device, equipment and storage medium
US10956424B2 (en) Application recommending method and system, and server
CN108566290B (en) Service configuration management method, system, storage medium and server
CN105812435B (en) Application upgrading data packet processing method and device, electronic equipment and system
CN109586969A (en) Content distributing network disaster recovery method, device, computer equipment and storage medium
US20140289719A1 (en) Automatic version management
CN109600384B (en) Flow switching method, system, equipment and storage medium in RPC interface upgrading
CN111008026B (en) Cluster management method, device and system
CN113141412A (en) Domain name switching method, system, device, equipment and storage medium
CN109828830B (en) Method and apparatus for managing containers
US20070050447A1 (en) Method and device arrangement for managing a client/server environment
CN110737548A (en) Data request method and server
US20160321086A1 (en) Recording medium, information processing terminal and control method
US20150277892A1 (en) Multi-phase software delivery
CN111182536A (en) SIM card state detection method, device, network equipment and storage medium
CN112436974B (en) CDN data resource consistency detection method and device and computer equipment
CN104348646A (en) Configuration data processing method, device and system
CN106375372B (en) big data resource allocation method and device
CN112367540B (en) Method and device for monitoring live broadcast stream pushing number on line
CN111385327A (en) Data processing method and system
CN112714020B (en) Method and device for determining validity of data, storage medium and electronic device
CN115242615B (en) Server operation management method and device, electronic equipment and storage medium
CN111224861B (en) Method, system, equipment and storage medium for opening instant message service
CN110019535B (en) Database management method, database management device, storage medium and computer equipment
CN112968933B (en) Data transmission method, device, server 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
GR01 Patent grant
GR01 Patent grant