CN105677466A - Method and device for degrading handling of third-party application interface - Google Patents

Method and device for degrading handling of third-party application interface Download PDF

Info

Publication number
CN105677466A
CN105677466A CN201511031311.5A CN201511031311A CN105677466A CN 105677466 A CN105677466 A CN 105677466A CN 201511031311 A CN201511031311 A CN 201511031311A CN 105677466 A CN105677466 A CN 105677466A
Authority
CN
China
Prior art keywords
degradation
party application
application interface
configuration file
duty
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
CN201511031311.5A
Other languages
Chinese (zh)
Other versions
CN105677466B (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 Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and 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 Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN201511031311.5A priority Critical patent/CN105677466B/en
Publication of CN105677466A publication Critical patent/CN105677466A/en
Application granted granted Critical
Publication of CN105677466B publication Critical patent/CN105677466B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/50Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
    • G06F21/55Detecting local intrusion or implementing counter-measures
    • G06F21/552Detecting local intrusion or implementing counter-measures involving long-term monitoring or reporting

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Hardware Design (AREA)
  • Telephonic Communication Services (AREA)

Abstract

The embodiment of the invention discloses a method and device for degrading handling of a third-party application interface. The method comprises the steps that a configuration file is inquired according to a generated third-party application interface calling request so as to determine the working state of the third-party application interface; if the working state of the third-party application interface is a degrading state, a degrading strategy is determined according to degrading handling rules in the configuration file; the degrading strategy is executed, and a handling result of the calling request is obtained. Thus, the problems that in the prior art, calling of a server to a third-party application interface is not stable, and consequently the handling failure rate of service handling requests is high are solved.

Description

The method and apparatus that the degradation of third-party application interface processes
Technical field
The present embodiments relate to microcomputer data processing, particularly relate to the method and apparatus that the degradation of a kind of third-party application interface processes.
Background technology
Along with becoming increasingly popular of network, the application of the Internet has been deep into every field, and provides service easily for the daily life of user, working and learning. Application program is a kind of software being arranged on intelligent terminal, usually used as client, coordinates with background server and provides the user corresponding function services.
Development along with the network integration; background server provides in the process of function services for client; often occur other application programs are called demand; when namely realizing the Business Processing request that the background server of the first function processes the first function; can produce to process the demand of the second function, then need to call the third-party application interface that can realize the second function and realize the second function. The result of the second function is re-incorporated in the processing procedure of the second function, and final result returns to client.
Kind yet with third party application is a lot, and interface stability is uneven so that calling of this third-party application interface can not be completely trusted.
Therefore, prior art to third-party application interface to call instability, mortality high, it is impossible to ensure efficient to provide normal service processing function for client.
Summary of the invention
Embodiments providing the method and apparatus that the degradation of a kind of third-party application interface processes, the business function relating to third-party application interface interchange with efficient guarantee is properly functioning.
On the one hand, embodiments provide the degradation processing method of a kind of third-party application interface, including:
Call request according to the third-party application interface produced, query configuration file is to determine the duty of described third-party application interface;
If the duty of described third-party application interface is degrading state, then according to the degradation processing rule in described configuration file, it is determined that degradation strategy;
Perform described degradation strategy, obtain the result of described call request.
On the other hand, the embodiment of the present invention additionally provides the degradation of a kind of third-party application interface and processes device, including:
Duty determines module, and for the call request according to the third-party application interface produced, query configuration file is to determine the duty of described third-party application interface;
Degradation strategy determines module, when being degrading state for the duty of third-party application interface, according to the degradation processing rule in described configuration file, it is determined that degradation strategy;
Result acquisition module, is used for performing described degradation strategy, obtains the result of described call request.
The technical scheme that the embodiment of the present invention provides, the server call request according to the third-party application interface produced, query configuration file determines whether this third-party application interface is in degrading state, if, then determine degradation strategy according to the degradation processing rule in configuration file, and perform this degradation strategy with complete call request, and obtain the result of call request, this technical scheme manages duty and the degradation processing rule of third-party application interface by configuration file, can be tactful by the adjustment degradation changing configuration file real-time, without in advance degradation strategy being built in the background server caller to third-party application interface, so strategy of demoting more flexibly can be adopted, thus solving background server in prior art third-party application interface called instability, cause the problem that the process mortality of Business Processing request is high.
Accompanying drawing explanation
The flow chart of the degradation processing method of a kind of third-party application interface that Fig. 1 provides for the embodiment of the present invention one;
The flow chart of the degradation processing method of a kind of third-party application interface that Fig. 2 provides for the embodiment of the present invention two;
The flow chart of the method for a kind of degradation time started recording third party's interface that Fig. 3 provides for the embodiment of the present invention three;
The degradation of a kind of third-party application interface that Fig. 4 provides for the embodiment of the present invention four processes the structural representation of device;
The flow chart of the degradation processing method of a kind of third-party application interface that Fig. 5 provides for the embodiment of the present invention five.
Detailed description of the invention
Below in conjunction with drawings and Examples, the present invention is described in further detail. It is understood that specific embodiment described herein is used only for explaining the present invention, but not limitation of the invention. It also should be noted that, for the ease of describing, accompanying drawing illustrate only part related to the present invention but not entire infrastructure.
Embodiment one
The flow chart of the degradation processing method of a kind of third-party application interface that Fig. 1 provides for the embodiment of the present invention one. The method is applied in the background server of application program, with the application client being installed in mobile terminal with the use of, above-mentioned mobile terminal can be, but not limited to in intelligent television, mobile phone, panel computer or computer any one.
With reference to Fig. 1, the degradation processing method of this third-party application interface includes following operation:
S110, according to the call request of third-party application interface produced, query configuration file is to determine the duty of described third-party application interface.
In aforesaid operations, configuration file can be stored in the background server of client, and can store the duty of one or more third-party application interface, degradation processing rule and its interface identifier in configuration file. Duty includes normal condition and degrading state, and normal condition is that this third-party application interface exception does not occur, can by background server normal call, and degrading state is that this third-party application interface occurs abnormal, temporarily can not by background server normal call. Duty can by configuring manually, it is also possible to triggers the rule duty from dynamic renewal third-party application interface based on default degradation.
Usual background server can receive the Business Processing request that client sends, and processes request based on miscellaneous service and creates the call request to third-party application interface accordingly. Third-party application interface herein can be the interface realizing any third party's function. The call request of this third-party application interface includes the interface identifier of at least one third-party application interface. Background server call according to call request correspondence third party's interface before, first query configuration file, the interface identifier according to third-party application interface, it is determined that the duty of different third-party application interfaces.
If the duty of the described third-party application interface of S120 is degrading state, then according to the degradation processing rule in described configuration file, it is determined that degradation strategy.
If this third-party application interface is in normal condition, then background server this third-party application interface of interface identifier normal call according to its correspondence, if this third-party application interface is in degrading state, then background server determines, according to the degradation processing rule in configuration file, the degradation strategy that currently need to perform.
Degradation processing rule in configuration file can have various ways, degradation processing rule may refer to the background server selection rule to degradation strategy, exemplary, can be the degradation strategy of each third-party application interface setting acquiescence in advance, according to the priority of third-party application interface, degradation strategy can also be selected, or according to the current processing status parameter of third-party application interface, degradation strategy can also be selected.
In the present embodiment; preferably being configured with the degradation strategy that at least two is different, degradation strategy may include that according to default return value degradation, uses local cache data to demote, utilize random rejection service degradation and utilize message queue exceptionization to retry degradation etc.
The benefit arranging at least two degradation strategy in background server is, when the first degradation strategy occurs abnormal, background server can also continue to call the second degradation strategy and processes with the Business Processing request continuing client is sent, when avoiding third-party application interface to be only correspondingly arranged on a kind of fixing degradation strategy, if this degradation strategy occurs abnormal, then the problem that background server will can not complete the Business Processing request that client sends.
When the duty that this third-party application interface determined by background server query configuration file is degrading state, then determine degradation strategy according to degradation processing rule.
In a detailed description of the invention of the embodiment of the present invention, degradation processing rule refers to the priority according to third-party application interface and degradation strategy is selected, and its specifically chosen process includes following operation:
Operate one, according to the degradation policy priority level arranged in described configuration file, according to the degradation strategy of priority orders selection current priority.
Degradation policy priority level refers to the sequencing of the selection to different degradation strategies, the setting of the priority of degradation strategy can be that background server sets according to the stability of degradation strategy, or can also is that what operator were manually set according to the actual requirements.
When third-party application interface is in degrading state, background server is according to degradation policy priority level, and first-selection calls the degradation strategy that priority is the highest. Exemplary, according to degradation policy priority level, above-mentioned four kinds of degradation strategies can be ranked up in the following order:
Demote according to default return value;
Use local cache data is demoted;
Utilize random rejection service degradation;
Message queue exceptionization is utilized to retry degradation.
Namely, when third-party application interface is in degrading state, first background server calls the Business Processing request continuing client is sent according to the degradation strategy of default return value degradation and processes, and obtains the result of this degradation strategy call request.
If the result of the described call request that operation two gets is for process unsuccessfully, then return the operation of the degradation strategy selecting next priority.
The result got is analyzed by background server, when the result determining this call request is process successfully, it is determined that the Business Processing request that client sends is complete, it is possible to send, to client, the information that Business Processing has been asked; When the result determining this call request is process unsuccessfully, then determine that the degradation strategy of current level occurs abnormal, the customer service process request that client sends can not be completed, then continue to select the degradation strategy of next priority, the still clooating sequence to operate degradation strategy given in, then select the Business Processing request that the degradation strategy using local cache data degradation continues client is sent to process, and obtain the result of this degradation strategy call request.
Further, in the another embodiment of the embodiment of the present invention, degradation processing rule refers to the current processing status parameter according to third-party application interface and degradation strategy is selected, and its specifically chosen process includes following operation:
Operation one, according in described configuration file arrange degradation processing rule, gather the current processing status parameter of described third-party application interface.
The current processing status parameter of third-party application interface may refer to the concurrent invocation quantity of third-party application interface, and third-party application interface call response time etc., it is also possible to include the errors number that third-party application interface currently adds up.
Operate two, select corresponding degradation strategy according to described current processing status parameter.
The concurrent invocation quantity of third-party application interface is more many, then illustrate that the workload of third-party application interface is more big; Third-party application interface to call response time more long, then illustrate that the stability of third-party application interface is more low. Such as, now the concurrent invocation quantity of third-party application interface is many and third-party application interface to call response time long, then select the degradation strategy that stability is high.
S130, perform described degradation strategy, obtain the result of described call request.
In aforesaid operations, background server determines degradation strategy according to the degradation processing rule in configuration file, and performs this degradation strategy, and obtains the result of this degradation strategy call request. Obtaining this result is in order to this result is analyzed, to determine that the Business Processing request whether this degradation strategy sends client processes successfully, if it is, background server can send, to client, the information that Business Processing has been asked; If it is not, then it is abnormal to determine that this degradation strategy occurs, background server need to continue to call other strategies of optionally demoting, and continues with the Business Processing request that client is sent.
The technical scheme of the embodiment of the present invention, duty and the degradation processing rule of third-party application interface is managed by configuration file, can be tactful by the adjustment degradation changing configuration file real-time, without in advance degradation strategy being built in the background server caller to third-party application interface, so degradation schemes more flexibly can be adopted, thus solving background server in prior art third-party application interface is called instability, cause Business Processing request is processed the problem that mortality is high. The technical scheme of the present embodiment, improves the success rate called to third-party application interface, has efficiently ensured business function properly functioning of third-party application interface interchange.
Embodiment two
The flow chart of the degradation processing method of a kind of third-party application interface that Fig. 2 provides for the embodiment of the present invention two.The present embodiment, on the basis of above-described embodiment one, adds the related content realizing degradation triggering rule. This degradation processing method still can be performed by background server.
In embodiments of the present invention, configuration file can also store degradation triggering rule, trigger the rule duty from dynamic adjustment third-party application interface according to degradation, it is achieved the triggering of degradation strategy execution controls.
Referring to Fig. 2, the degradation processing method of this third-party application interface includes following operation:
S210, according to the call request of third-party application interface produced, query configuration file is to determine the duty of described third-party application interface.
If the duty of the described third-party application interface of S220 is normal condition, then trigger rule according to the degradation in described configuration file, monitor the situation of calling of described third-party application interface in real time, and change the duty of third-party application interface in described configuration file according to situation of calling.
In aforesaid operations, the degradation triggering rule in configuration file may refer to background server and by normal condition, the duty of third-party application interface changed to judgment rule during degrading state. When the situation of calling of the third-party application interface real-time monitored meets this degradation triggering rule, the duty of this third-party application interface is changed to degrading state by normal condition.
Exemplary, when by query configuration file, background server determines that the duty of third-party application interface is normal condition, on the one hand, background server directly invokes this third-party application interface and completes the Business Processing request that client sends, on the other hand, triggering rule according to the degradation in configuration file, that detects this third-party application interface in real time calls situation. When the situation that third-party server appearance is abnormal meets and imposes a condition, then in change configuration file, the duty of third-party application interface is degrading state, in subsequent operation, background server is according to the degradation processing rule arranged in configuration file, select corresponding degradation strategy, and perform this degradation strategy, complete the Business Processing request that client sends.
At this, it should be noted that third-party application interface occur abnormal may refer to when background server monitor the third-party application interface response time to the call request of background server exceed predetermined threshold value time, it is determined that third-party application interface occurs abnormal. Now, background server needs the duty of change third-party application interface to be degrading state.
It should be appreciated by those skilled in the art that background server can when detecting that third-party application interface occurs once abnormal, in change configuration file, the duty of this third-party application interface is degrading state at once; Or, background server can also record third-party application interface and abnormal errors number and mistake time of origin occurs, and the duty determining the need for changing this third-party application interface according to this errors number and mistake time of origin is degrading state.
In a detailed description of the invention of the embodiment of the present invention, third-party application interface is occurred that abnormal situation is further defined, now, the errors number of this third-party application interface of background server record and every time mistake time of origin, and errors number and mistake time of origin are added up, when statistical result meets pre-conditioned, the duty of this third-party application interface in change configuration file.Concrete, the method includes following operation:
Operation one, trigger rule according to the degradation in described configuration file, described third-party application interface call appearance abnormal time, misregistration number of times and mistake time of origin.
When calling appearance exception of third-party application interface, background server misregistration number of times and mistake time of origin, the recording mode of these two data is had multiple by it, for instance, it is possible in table form these two data are recorded. Mode one, form includes the interface identifier of this third-party application interface, errors number and mistake time of origin; Mode two, errors number is added up by background server, and to each wrong time of origin record respectively. In subsequent operation, errors number and mistake time of origin at interval of the fixed cycle, can be added up by background server; Or errors number and mistake time of origin also can be carried out real-time statistics by background server, and the benefit so arranged is, in order to better to determine a need for changing the duty of this third-party application interface more accurately.
Operate two, trigger rule according to degradation, errors number and mistake time of origin to described third-party application interface carry out real-time statistics, if a situation arises meets pre-conditioned for mistake, then the duty of third-party application interface in described configuration file is set to degrading state.
Wherein, the errors number to record and mistake time of origin that background server is real-time are added up, and wherein, errors number is carried out statistics and obtains summation errors number, the wrong time of origin that first time mistake time of origin is nearest with the distance statistics moment is asked poor, obtains mistake and total duration occurs.
Pre-conditioned include two parts, Part I is for presetting errors number, Part II is preset duration, when mistake occurs total duration less than or equal to preset duration, and summation errors number more than default errors number time, then background server determine mistake a situation arises meet pre-conditioned, it is necessary to the duty of this third-party application interface is changed to degrading state by normal condition, therefore the duty of this third-party application interface in configuration file is set to degrading state.
The technical scheme of the embodiment of the present invention, background server triggers, according to the degradation in configuration file, the duty adjusting third-party application interface that rule is real-time, can control whether in real time to perform degradation strategy. Degradation triggers in rule, to calling what state monitoring, and it is pre-conditioned which kind of meets, all can be modified configuration file to update, it can also be the differently configured degradation triggering rule of different third-party application interface flexibles, it is possible to realize the real-time management to third-party application interface, it also is able to adopt the degradation being more suitable for trigger rule, further improve the stability to third-party application interface interchange, ensure business function properly functioning of third-party application interface interchange.
Embodiment three
The flow chart of the method for a kind of degradation time started recording third party's interface that Fig. 3 provides for the embodiment of the present invention three. The present embodiment is on the basis of above-described embodiment, add the recovery control program to third-party application interface degrading state, namely when determining that the duty of third-party application interface is degrading state, further increase the operation of the degradation time started of record third-party application interface, in order in subsequent operation according to the background server monitoring to this degradation time started, the duty of this third-party application interface is made change.
In the present embodiment, configuration file can also store degradation time started and the degradation duration threshold value of third-party application interface, in order to determine the degradation persistent period of third-party application interface according to this degradation time started, and by the degradation duration threshold ratio of this degradation persistent period and corresponding third-party application interface relatively, when the persistent period of demoting meets or exceeds degradation duration threshold value, the duty of this third-party application interface is changed to normal condition.
With reference to Fig. 3, the method for the degradation time started of record third-party application interface includes following operation:
S310, will when in described configuration file, the duty of third-party application interface is set to degrading state, record degradation the time started.
In aforesaid operations, the degradation time started may refer to be set to the duty of the third-party application interface in configuration file the time of degrading state. So it is disposed in subsequent operation and determines degradation persistent period of third-party application interface by the time started of demoting.
Those skilled in the art should understand that, the condition that the duty of the third-party application interface in configuration file is set to degrading state can be had a variety of by background server, for example, it is possible to trigger rule according to degradation in configuration file, duty is set to degrading state; Or what the demand according to operator that can also is that was artificial is set to degrading state by duty.
The duty of described third-party application interface if according to the described degradation time started recognizes the degradation duration threshold value that the current degradation persistent period reaches in described configuration file, is then set to normal condition by S320.
In aforesaid operations, the difference of present system time with degradation time started is defined as the degradation persistent period. And the degradation persistent period is compared with degradation duration threshold value. Wherein, the manner of comparison of two time values can have various ways. Such as, background server calculates according to the degradation time started in real time and obtains the degradation persistent period, and monitor whether this degradation persistent period meets or exceeds degradation duration threshold value in real time, if so, then the duty of this third-party application interface is changed to normal condition by degrading state;
Or, background server completes, according to the degradation strategy in configuration file, the first Business Processing request that client sends, and when again receiving the second Business Processing request of client transmission, the call request of this third-party application interface is again produced according to the request of this second Business Processing, background server query configuration file determines that the duty of third-party application interface is while degrading state, the degradation time started of inquiry third-party application interface, and obtain the degradation persistent period according to the calculating of this degradation time started, judge whether this degradation persistent period meets or exceeds degradation duration threshold value, if, then the duty of this third-party application interface is revised as normal condition by degrading state. now, background server determines that the duty of this third-party application interface is normal condition, then directly invoke this third-party application interface and process with the Business Processing request that client is sent,
In addition, those skilled in the art should understand that, degradation duration threshold value is the restriction of the degradation duration to third-party application interface, the degradation duration threshold value of all third-party application interfaces can be set as same value by background server in embodiments of the present invention, certainly, can also according to the degree of stability grade point of third-party application interface degradation duration threshold value that each third-party application interface setting is different, or according to the degree of stability grade point of third-party application interface, different third-party application interfaces can also be grouped, and to the third-party application interface setting degradation duration threshold value often organized.
In a preferred implementation of the embodiment of the present invention, the background server degree of stability grade point according to described third-party application interface, the degradation duration threshold value of third-party application interface described in described configuration file is set.
The technical scheme of the embodiment of the present invention, by recording the degradation time started of the degrading state of third-party application interface, and determine the degradation persistent period according to the difference of this degradation time started Yu present system time, the degradation persistent period is compared with degradation duration threshold value, when the persistent period of demoting meets or exceeds degradation duration threshold value, then the duty of this third-party application interface is revised as normal condition by degrading state.Thus furthermore achieved that the management to third-party application interface, improve the success rate called to third-party application interface, efficiently having ensured business function properly functioning of third-party application interface interchange.
Embodiment four
The degradation of a kind of third-party application interface that Fig. 4 provides for the embodiment of the present invention five processes the structural representation of device. This degradation processes device can perform the degradation processing method described in any embodiment of the present invention.
Referring to Fig. 4, this degradation processes the concrete structure of device and includes: duty determines that module 41, degradation strategy determine module 42 and result acquisition module 43, wherein,
Duty determines module 41, and for the call request according to the third-party application interface produced, query configuration file is to determine the duty of described third-party application interface;
Degradation strategy determines module 42, when being degrading state for the duty of third-party application interface, according to the degradation processing rule in described configuration file, it is determined that degradation strategy;
Result acquisition module 43, is used for performing described degradation strategy, obtains the result of described call request.
Further, described degradation strategy determines that module 42 includes:
Current degradation policy selection unit 421, for according to the degradation policy priority level arranged in described configuration file, selecting the degradation strategy of current priority according to priority orders;
Next policy selection unit 422 of demoting, if for the result of described call request that gets for process unsuccessfully, then returning the tactful operation of demoting of next priority of selection.
In technique scheme, degradation strategy determines that module 42 selects degradation strategy according to the degradation policy priority level arranged in configuration file, in addition, degradation strategy determines that module 42 can also select degradation strategy according to the degradation processing rule in configuration file, now, described degradation strategy determines that module 42 includes:
Parameter acquisition unit 423, for according to the degradation processing rule arranged in described configuration file, gathering the current processing status parameter of described third-party application interface;
Degradation policy selection unit 424, for selecting corresponding degradation strategy according to described current processing status parameter.
Preferably, described current processing status parameter include following at least one: the concurrent invocation quantity of described third-party application interface, and described third-party application interface call response time.
Further, described degradation strategy include following at least one: according to default return value demote, use local cache data degradation, utilize random rejection service degradation and utilize message queue exceptionization to retry degradation.
Further, on technique scheme basis, this degradation processes device and can also include:
Duty change module 44, for triggering rule according to the degradation in described configuration file, monitors the situation of calling of described third-party application interface in real time, and changes the duty of third-party application interface in described configuration file according to situation of calling.
Further, described duty change module 44 includes:
Error logging unit 441, for triggering rule according to the degradation in described configuration file, described third-party application interface call appearance abnormal time, misregistration number of times and mistake time of origin;
Degrading state arranges unit 442, for triggering rule according to degradation, errors number and mistake time of origin to described third-party application interface carry out real-time statistics, if a situation arises meets pre-conditioned for mistake, then the duty of third-party application interface in described configuration file is set to degrading state.
Additionally, on the basis of technique scheme, degradation processes device and can also include:
Degradation time started logging modle 45, for by when in described configuration file, the duty of third-party application interface is set to degrading state, record is demoted the time started;
Normal condition arranges module 46, for if according to the described degradation time started recognizes the degradation duration threshold value that the current degradation persistent period reaches in described configuration file, then the duty of described third-party application interface being set to normal condition.
Further, this degradation process device can also include:
Threshold setting module 47, for the degree of stability grade point according to described third-party application interface, arranges the degradation duration threshold value of third-party application interface described in described configuration file.
Product described in the present embodiment can perform the multi-screen changing method performed by server that any embodiment of the present invention provides, and possesses the corresponding functional module of execution method and beneficial effect.
Embodiment five
The flow chart of the degradation processing method of a kind of third-party application interface that Fig. 5 provides for the embodiment of the present invention six. The present embodiment can based on above-described embodiment, and the present embodiment is to be Baidu's Oryza glutinosa in client, and this client is arranged in mobile phone under this concrete application scenarios, it is provided that a kind of preferred embodiment.
Referring to Fig. 5, this preferred degradation processing method includes following operation:
S501, according to the call request of third-party application interface produced, it is judged that whether the duty of third-party application interface described in configuration file is normal condition.
If it is, perform operation S502, if it is not, then perform operation S507.
S502, call third-party application interface, and trigger rule according to the degradation in described configuration file, described third-party application interface call appearance abnormal time, misregistration number of times and mistake time of origin.
Baidu's Oryza glutinosa background server directly invokes this third-party application interface Business Processing to Baidu's Oryza glutinosa and asks to process.
S503, according to degradation trigger rule, errors number and mistake time of origin to described third-party application interface carry out real-time statistics, if a situation arises meets pre-conditioned for mistake, then the duty of third-party application interface in described configuration file is set to degrading state.
Now, if confirming during background server query configuration file, the duty of this third-party application interface is degrading state, then perform operation S507.
S504, will when in described configuration file, the duty of third-party application interface is set to degrading state, record degradation the time started.
S505, recognize the current degradation persistent period according to the described degradation time started, and judge the degradation duration threshold value whether the degradation persistent period reach in described configuration file.
If it is, perform operation S506, otherwise continue executing with operation S505.
S506, the duty of described third-party application interface is set to normal condition.
Now, if confirming during background server query configuration file, the duty of this third-party application interface is normal condition, then perform operation S502.
S507, according in described configuration file arrange degradation policy priority level, according to priority orders select current priority degradation strategy.
S508, perform described degradation strategy, obtain the result of described call request, and judge the result whether success of this call request.
If it is, perform operation S509, otherwise perform operation S510.
S509, the Business Processing that background server sends to client has asked information.
S510, return select next priority degradation strategy operation, and perform operation S508.
In order to be more clearly understood from the technical scheme of the embodiment of the present invention, now it is illustrated.
User purchases by group on Baidu's Oryza glutinosa, and will purchase by group order and submit, and the time of delivery is 15:07. Baidu Oryza glutinosa client reception user purchases by group order business, and this is purchased by group order business send to background server and process, background server purchases by group order business according to this and produces the call request of third-party application interface, such as, background server produces the third-party application interface interchange request of anti-cheating, in order to check whether user has cheating when purchasing by group, produce preferential strategy third-party application interface interchange request, in order to check that this is purchased by group whether order has preferential policy by shop business, and produce the request of stock's third-party application interface interchange, in order to check that this purchases by group whether product has residue quantity in stock.
In the configuration file of background server, storage has the interface identifier of each third-party application interface above-mentioned, duty, acquiescence degradation degradation strategy tactful, optional, degradation to trigger rule, degradation time started and degradation duration threshold value. The profile data form that table 1 provides for the embodiment of the present invention.
The profile data form of table 1 background server
According to table 1, the anti-duty practising fraud third-party application interface is normal condition, and background server can directly invoke this anti-cheating third-party application interface; The duty of preferential strategy third-party application interface is degrading state, and the difference (the degradation persistent period is 7min) between present system time (15:07) and degradation time started (15:00) is not up to degradation duration threshold value (10min), it is thus determined that this preferential policy third-party application interface is in degrading state; In like manner, the duty of preferential strategy third-party application interface is degrading state, and the difference (the degradation persistent period is 4min) between present system time (15:07) and degradation time started (15:03) is not up to degradation duration threshold value (8min), it is thus determined that this preferential policy third-party application interface is in degrading state.
The background server of Baidu's Oryza glutinosa client calls, according to the acquiescence degradation strategy of preferential strategy third-party application interface, the degradation strategy using local cache data degradation, acquiescence degradation strategy according to stock's third-party application interface calls the degradation strategy utilizing random rejection service degradation, and the order that purchases by group of Baidu's Oryza glutinosa client is processed. If the acquiescence degradation strategy of above-mentioned third party's interface occurs abnormal, then background server can continue to call Business Processing request that client sends by other the optional degradation strategies arranged in configuration file and continues with.
Meanwhile, background server real time record is counter practises fraud the 3rd errors number and the mistake time of origin putting application interface, when its errors number and mistake duration trigger rule (in 1 minute, mistake makes a mistake number of times more than 10 times) more than degradation, then the anti-duty practising fraud third-party application interface is changed to degrading state.
Note, above are only presently preferred embodiments of the present invention and institute's application technology principle. It will be appreciated by those skilled in the art that and the invention is not restricted to specific embodiment described here, various obvious change can be carried out for a person skilled in the art, readjust and substitute without departing from protection scope of the present invention. Therefore, although the present invention being described in further detail by above example, but the present invention is not limited only to above example, when without departing from present inventive concept, other Equivalent embodiments more can also be included, and the scope of the present invention is determined by appended right.

Claims (18)

1. the degradation processing method of a third-party application interface, it is characterised in that including:
Call request according to the third-party application interface produced, query configuration file is to determine the duty of described third-party application interface;
If the duty of described third-party application interface is degrading state, then according to the degradation processing rule in described configuration file, it is determined that degradation strategy;
Perform described degradation strategy, obtain the result of described call request.
2. method according to claim 1, it is characterised in that according to the degradation processing rule in described configuration file, it is determined that degradation strategy includes:
According to the degradation policy priority level arranged in described configuration file, select the degradation strategy of current priority according to priority orders;
If the result of the described call request got is for process unsuccessfully, then return the operation of the degradation strategy selecting next priority.
3. method according to claim 1, it is characterised in that according to the degradation processing rule in described configuration file, it is determined that degradation strategy includes:
According to the degradation processing rule arranged in described configuration file, gather the current processing status parameter of described third-party application interface;
Corresponding degradation strategy is selected according to described current processing status parameter.
4. method according to claim 3, it is characterised in that described current processing status parameter include following at least one:
The concurrent invocation quantity of described third-party application interface, and described third-party application interface call response time.
5. according to the arbitrary described method of claim 1-4; it is characterized in that, described degradation strategy include following at least one: according to default return value demote, use local cache data degradation, utilize random rejection service degradation and utilize message queue exceptionization to retry degradation.
6. method according to claim 1, it is characterised in that also include:
Trigger rule according to the degradation in described configuration file, monitor the situation of calling of described third-party application interface in real time, and change the duty of third-party application interface in described configuration file according to situation of calling.
7. method according to claim 6, it is characterized in that, trigger rule according to the degradation in described configuration file, monitor the situation of calling of described third-party application interface in real time, and include according to calling the duty of third-party application interface in the situation described configuration file of change:
Trigger rule according to the degradation in described configuration file, described third-party application interface call appearance abnormal time, misregistration number of times and mistake time of origin;
Rule is triggered according to degradation, errors number and mistake time of origin to described third-party application interface carry out real-time statistics, if a situation arises meets pre-conditioned for mistake, then the duty of third-party application interface in described configuration file is set to degrading state.
8. method according to claim 1, it is characterised in that also include:
By when in described configuration file, the duty of third-party application interface is set to degrading state, record is demoted the time started;
If according to the described degradation time started recognizes the degradation duration threshold value that the current degradation persistent period reaches in described configuration file, then the duty of described third-party application interface is set to normal condition.
9. method according to claim 8, it is characterised in that also include:
Degree of stability grade point according to described third-party application interface, arranges the degradation duration threshold value of third-party application interface described in described configuration file.
10. the degradation of a third-party application interface processes device, it is characterised in that including:
Duty determines module, and for the call request according to the third-party application interface produced, query configuration file is to determine the duty of described third-party application interface;
Degradation strategy determines module, when being degrading state for the duty of third-party application interface, according to the degradation processing rule in described configuration file, it is determined that degradation strategy;
Result acquisition module, is used for performing described degradation strategy, obtains the result of described call request.
11. device according to claim 10, it is characterised in that described degradation strategy determines that module includes:
Current degradation policy selection unit, for according to the degradation policy priority level arranged in described configuration file, selecting the degradation strategy of current priority according to priority orders;
Next policy selection unit of demoting, if for the result of described call request that gets for process unsuccessfully, then returning the tactful operation of demoting of next priority of selection.
12. device according to claim 10, it is characterised in that described degradation strategy determines that module includes:
Parameter acquisition unit, for according to the degradation processing rule arranged in described configuration file, gathering the current processing status parameter of described third-party application interface;
Degradation policy selection unit, for selecting corresponding degradation strategy according to described current processing status parameter.
13. device according to claim 12, it is characterised in that described current processing status parameter include following at least one:
The concurrent invocation quantity of described third-party application interface, and described third-party application interface call response time.
14. according to the arbitrary described device of claim 10-13; it is characterized in that, described degradation strategy include following at least one: according to default return value demote, use local cache data degradation, utilize random rejection service degradation and utilize message queue exceptionization to retry degradation.
15. device according to claim 10, it is characterised in that also include:
Duty change module, for triggering rule according to the degradation in described configuration file, monitors the situation of calling of described third-party application interface in real time, and changes the duty of third-party application interface in described configuration file according to situation of calling.
16. device according to claim 15, it is characterised in that described duty change module includes:
Error logging unit, for triggering rule according to the degradation in described configuration file, described third-party application interface call appearance abnormal time, misregistration number of times and mistake time of origin;
Degrading state arranges unit, for triggering rule according to degradation, errors number and mistake time of origin to described third-party application interface carry out real-time statistics, if a situation arises meets pre-conditioned for mistake, then the duty of third-party application interface in described configuration file is set to degrading state.
17. device according to claim 10, it is characterised in that also include:
Degradation time started logging modle, for by when in described configuration file, the duty of third-party application interface is set to degrading state, record is demoted the time started;
Normal condition arranges module, for if according to the described degradation time started recognizes the degradation duration threshold value that the current degradation persistent period reaches in described configuration file, then the duty of described third-party application interface being set to normal condition.
18. device according to claim 17, it is characterised in that also include:
Threshold setting module, for the degree of stability grade point according to described third-party application interface, arranges the degradation duration threshold value of third-party application interface described in described configuration file.
CN201511031311.5A 2015-12-31 2015-12-31 The method and apparatus of the downgrade processing of third-party application interface Active CN105677466B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201511031311.5A CN105677466B (en) 2015-12-31 2015-12-31 The method and apparatus of the downgrade processing of third-party application interface

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201511031311.5A CN105677466B (en) 2015-12-31 2015-12-31 The method and apparatus of the downgrade processing of third-party application interface

Publications (2)

Publication Number Publication Date
CN105677466A true CN105677466A (en) 2016-06-15
CN105677466B CN105677466B (en) 2019-08-30

Family

ID=56298496

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201511031311.5A Active CN105677466B (en) 2015-12-31 2015-12-31 The method and apparatus of the downgrade processing of third-party application interface

Country Status (1)

Country Link
CN (1) CN105677466B (en)

Cited By (23)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106533812A (en) * 2016-12-30 2017-03-22 重庆腾帆科技有限公司 Application server
CN106649045A (en) * 2016-12-30 2017-05-10 重庆腾帆科技有限公司 Third-party interface exception monitoring device
CN106844146A (en) * 2016-12-30 2017-06-13 重庆腾帆科技有限公司 A kind of tripartite's interface abnormality monitoring method
CN107172122A (en) * 2017-03-31 2017-09-15 北京奇艺世纪科技有限公司 A kind of abnormality eliminating method and device
CN107577629A (en) * 2017-09-25 2018-01-12 北京因特睿软件有限公司 A kind of data-interface processing method, device, server and medium
CN107659431A (en) * 2017-08-15 2018-02-02 北京趣拿软件科技有限公司 Interface processing method, apparatus, storage medium and processor
CN107689886A (en) * 2017-08-11 2018-02-13 北京小度信息科技有限公司 Data-interface fault handling method, device and electronic equipment
CN107707384A (en) * 2017-09-06 2018-02-16 北京五八到家信息技术有限公司 A kind of service state monitoring method and monitoring system based on calling external service
CN107908438A (en) * 2017-11-15 2018-04-13 山东浪潮通软信息科技有限公司 A kind of method and device for improving data interaction stability
CN108717396A (en) * 2018-05-17 2018-10-30 中国平安人寿保险股份有限公司 A kind of degradation processing method, device, electronic equipment and its storage medium
CN109120686A (en) * 2018-08-08 2019-01-01 联动优势电子商务有限公司 A kind of method and device servicing pre-authentication
CN109165127A (en) * 2018-08-29 2019-01-08 北京奇艺世纪科技有限公司 Localization method, device and the electronic equipment of problem interface
CN110399178A (en) * 2019-06-14 2019-11-01 五八有限公司 A kind of call method of third party's service, device, electronic equipment and storage medium
CN110413486A (en) * 2018-04-28 2019-11-05 北京京东尚科信息技术有限公司 The method, apparatus and medium of monitoring system intrinsic call link
CN110554895A (en) * 2018-05-31 2019-12-10 北京京东尚科信息技术有限公司 Data calling method and device
CN111988387A (en) * 2020-08-11 2020-11-24 北京达佳互联信息技术有限公司 Interface request processing method, device, server, equipment and storage medium
CN112134721A (en) * 2020-08-17 2020-12-25 福建天泉教育科技有限公司 API gateway degradation method and terminal
CN112187505A (en) * 2020-08-17 2021-01-05 杭州安恒信息技术股份有限公司 Adaptive service degradation method, electronic device and storage medium
CN112306659A (en) * 2020-11-02 2021-02-02 北京中电普华信息技术有限公司 Degradation protection method of application and business processing system
CN113179188A (en) * 2021-05-26 2021-07-27 深圳平安智汇企业信息管理有限公司 Service degradation dynamic realization method and device, computer equipment and storage medium
CN113282392A (en) * 2021-05-24 2021-08-20 挂号网(杭州)科技有限公司 Interface service calling method and device, electronic equipment and storage medium
CN115883358A (en) * 2022-11-23 2023-03-31 紫光云技术有限公司 Method and device for monitoring, early warning and degrading third-party application
WO2024066374A1 (en) * 2022-09-26 2024-04-04 京东科技信息技术有限公司 Service degradation method and apparatus, device, computer-readable medium and program product

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101272280A (en) * 2008-04-02 2008-09-24 北京邮电大学 Method and system for Web service management
CN104899106A (en) * 2014-03-07 2015-09-09 阿里巴巴集团控股有限公司 Processing method and processing device when interface service is abnormal
CN105159285A (en) * 2015-09-17 2015-12-16 北京汽车股份有限公司 CAN controller bus fault processing method and device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101272280A (en) * 2008-04-02 2008-09-24 北京邮电大学 Method and system for Web service management
CN104899106A (en) * 2014-03-07 2015-09-09 阿里巴巴集团控股有限公司 Processing method and processing device when interface service is abnormal
CN105159285A (en) * 2015-09-17 2015-12-16 北京汽车股份有限公司 CAN controller bus fault processing method and device

Cited By (30)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106533812B (en) * 2016-12-30 2020-01-14 重庆腾帆科技有限公司 Application server
CN106649045A (en) * 2016-12-30 2017-05-10 重庆腾帆科技有限公司 Third-party interface exception monitoring device
CN106844146A (en) * 2016-12-30 2017-06-13 重庆腾帆科技有限公司 A kind of tripartite's interface abnormality monitoring method
CN106533812A (en) * 2016-12-30 2017-03-22 重庆腾帆科技有限公司 Application server
CN107172122A (en) * 2017-03-31 2017-09-15 北京奇艺世纪科技有限公司 A kind of abnormality eliminating method and device
CN107689886A (en) * 2017-08-11 2018-02-13 北京小度信息科技有限公司 Data-interface fault handling method, device and electronic equipment
CN107659431A (en) * 2017-08-15 2018-02-02 北京趣拿软件科技有限公司 Interface processing method, apparatus, storage medium and processor
CN107707384A (en) * 2017-09-06 2018-02-16 北京五八到家信息技术有限公司 A kind of service state monitoring method and monitoring system based on calling external service
CN107577629B (en) * 2017-09-25 2019-12-31 北京因特睿软件有限公司 Data interface processing method, device, server and medium
CN107577629A (en) * 2017-09-25 2018-01-12 北京因特睿软件有限公司 A kind of data-interface processing method, device, server and medium
CN107908438A (en) * 2017-11-15 2018-04-13 山东浪潮通软信息科技有限公司 A kind of method and device for improving data interaction stability
CN110413486A (en) * 2018-04-28 2019-11-05 北京京东尚科信息技术有限公司 The method, apparatus and medium of monitoring system intrinsic call link
CN108717396A (en) * 2018-05-17 2018-10-30 中国平安人寿保险股份有限公司 A kind of degradation processing method, device, electronic equipment and its storage medium
CN110554895A (en) * 2018-05-31 2019-12-10 北京京东尚科信息技术有限公司 Data calling method and device
CN109120686A (en) * 2018-08-08 2019-01-01 联动优势电子商务有限公司 A kind of method and device servicing pre-authentication
CN109165127A (en) * 2018-08-29 2019-01-08 北京奇艺世纪科技有限公司 Localization method, device and the electronic equipment of problem interface
CN109165127B (en) * 2018-08-29 2022-09-02 北京奇艺世纪科技有限公司 Problem interface positioning method and device and electronic equipment
CN110399178B (en) * 2019-06-14 2022-09-27 五八有限公司 Third-party service calling method and device, electronic equipment and storage medium
CN110399178A (en) * 2019-06-14 2019-11-01 五八有限公司 A kind of call method of third party's service, device, electronic equipment and storage medium
CN111988387A (en) * 2020-08-11 2020-11-24 北京达佳互联信息技术有限公司 Interface request processing method, device, server, equipment and storage medium
CN112134721A (en) * 2020-08-17 2020-12-25 福建天泉教育科技有限公司 API gateway degradation method and terminal
CN112187505A (en) * 2020-08-17 2021-01-05 杭州安恒信息技术股份有限公司 Adaptive service degradation method, electronic device and storage medium
CN112187505B (en) * 2020-08-17 2023-04-18 杭州安恒信息技术股份有限公司 Adaptive service degradation method, electronic device and storage medium
CN112306659A (en) * 2020-11-02 2021-02-02 北京中电普华信息技术有限公司 Degradation protection method of application and business processing system
CN112306659B (en) * 2020-11-02 2024-03-15 北京中电普华信息技术有限公司 Application degradation protection method and service processing system
CN113282392A (en) * 2021-05-24 2021-08-20 挂号网(杭州)科技有限公司 Interface service calling method and device, electronic equipment and storage medium
CN113179188B (en) * 2021-05-26 2022-09-13 深圳平安智汇企业信息管理有限公司 Service degradation dynamic realization method and device, computer equipment and storage medium
CN113179188A (en) * 2021-05-26 2021-07-27 深圳平安智汇企业信息管理有限公司 Service degradation dynamic realization method and device, computer equipment and storage medium
WO2024066374A1 (en) * 2022-09-26 2024-04-04 京东科技信息技术有限公司 Service degradation method and apparatus, device, computer-readable medium and program product
CN115883358A (en) * 2022-11-23 2023-03-31 紫光云技术有限公司 Method and device for monitoring, early warning and degrading third-party application

Also Published As

Publication number Publication date
CN105677466B (en) 2019-08-30

Similar Documents

Publication Publication Date Title
CN105677466A (en) Method and device for degrading handling of third-party application interface
US7904759B2 (en) System and method for service availability management
US20190140920A1 (en) Scheduling Method for Content Delivery Network, and Device
CN101510167B (en) A kind of method of plug-in component operation, Apparatus and system
CN105678568A (en) Method and apparatus for determining preferential information
CN109189640A (en) Monitoring method, device, computer equipment and the storage medium of server
US10277529B2 (en) Visualization of computer resource quotas
CN111352806A (en) Log data monitoring method and device
CN102984500A (en) Method and device and system for achieving compatibility among multiple video monitor equipment
CN105095055A (en) User activity statistical approach and system
CN104978172A (en) Integrated management and control method, system and equipment of SDN (Software Defined Networking) applications
CN105677451A (en) Load balancing method and equipment used for multiple processes
CN104065526A (en) Server fault alarming method and device thereof
CN109780680A (en) Troublshooting method, apparatus, air conditioner and the server of air conditioner
CN108306776B (en) Information prompting method, device and system and computer readable storage medium
US20070064914A1 (en) Method for notifying customers of an agent's progress in fulfilling work orders
CN108876218A (en) Based reminding method, device and the storage medium of supplier's risk
CN111124808A (en) Distributed storage monitoring method, system, equipment and computer storage medium
JP5269394B2 (en) Database distribution device, database distribution method, program, and recording medium
CN105635124A (en) Flow control method and device
CN110784358A (en) Method and device for constructing network call relation topological graph
CN111737084B (en) Information monitoring method, device, intelligent equipment, computer equipment and medium
CN106161490A (en) A kind of user's online behavior state update method, Apparatus and system
CN111443962A (en) Transaction limiting method and device
CN116431929A (en) Information recommendation method, device, equipment and medium based on privacy calculation

Legal Events

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