CN110162344A - A kind of method, apparatus, computer equipment and readable storage medium storing program for executing that current limliting is isolated - Google Patents

A kind of method, apparatus, computer equipment and readable storage medium storing program for executing that current limliting is isolated Download PDF

Info

Publication number
CN110162344A
CN110162344A CN201910301150.9A CN201910301150A CN110162344A CN 110162344 A CN110162344 A CN 110162344A CN 201910301150 A CN201910301150 A CN 201910301150A CN 110162344 A CN110162344 A CN 110162344A
Authority
CN
China
Prior art keywords
current limliting
isolation current
initial parameter
parameter value
isolation
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
CN201910301150.9A
Other languages
Chinese (zh)
Other versions
CN110162344B (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.)
OneConnect Smart Technology Co Ltd
Original Assignee
OneConnect Smart 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 OneConnect Smart Technology Co Ltd filed Critical OneConnect Smart Technology Co Ltd
Priority to CN201910301150.9A priority Critical patent/CN110162344B/en
Publication of CN110162344A publication Critical patent/CN110162344A/en
Application granted granted Critical
Publication of CN110162344B publication Critical patent/CN110162344B/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/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention discloses a kind of method body that current limliting is isolated, party's body of laws includes: the method body searched in operation system frame and explained added with preset isolation current limliting;The parameter value of key configuration item is obtained from the isolation current limliting note, corresponding with operation system frame initial parameter group is searched from preset background management platform, and from the initial parameter group found other configurations item of the acquisition other than the key configuration item initial parameter value;According to the initial parameter value of the parameter value of the key configuration item in the isolation current limliting note and the other configurations item obtained from the background management platform, the@HystrixCommand for constructing Hystrix component is explained;It is explained according to the@HystrixCommand constructed and isolation current limliting processing is carried out to the method body.Present invention reduces the technical thresholds for using Hystrix, and can modify to configured parameter value, improve using experience degree.

Description

A kind of method, apparatus, computer equipment and readable storage medium storing program for executing that current limliting is isolated
Technical field
The present invention relates to field of computer technology, and in particular to it is a kind of be isolated the method, apparatus of current limliting, computer equipment and Readable storage medium storing program for executing.
Background technique
Under distributed environment, operation system usually has many dependences (such as: various third party's interfaces call), in height Under concurrently accessing, these dependences might have many uncontrollable problems, such as: network connection is slowly, resource is busy, temporarily can not With etc.;When relying on obstruction, will make a big impact to entire operation system;Hystrix component is a related delay With the fault-tolerant open source library packet of failure, isolation to dependence, current limliting, fuse function can be provided, thus under high concurrent environment Service carries out certain protection, reduces the risk that operation system is worn down.But it when using Hystrix component, needs to develop Personnel carry out the parameter setting of a series of configuration item, this just needs developer to have certain understanding to Hystrix component;This Outside, it after the parameter value of configuration item is provided with, cannot modify to the parameter value being arranged, there is certain limitation Property.
Summary of the invention
The purpose of the present invention is to provide it is a kind of be isolated current limliting method, apparatus, computer equipment and readable storage medium storing program for executing, The technical threshold using Hystrix is reduced, and can be modified to configured parameter value, using experience degree is improved.
The present invention is to solve above-mentioned technical problem by following technical proposals:
According to an aspect of the invention, there is provided a kind of method that current limliting is isolated, includes the following steps:
The method body explained added with preset isolation current limliting is searched in operation system frame;
The parameter value that key configuration item is obtained from the isolation current limliting note, is searched from preset background management platform Initial parameter group corresponding with the operation system frame, and obtain from the initial parameter group found in addition to the key is matched Set the initial parameter value of the other configurations item except item;
It is obtained according to the parameter value of the key configuration item in the isolation current limliting note and from the background management platform The initial parameter value of the other configurations item taken, the@HystrixCommand for constructing Hystrix component are explained;
It is explained according to the@HystrixCommand constructed and isolation current limliting processing is carried out to the method body.
Further, it is the note added on the method body for needing to have isolation current-limiting function that the isolation current limliting, which is explained, Solution;The key configuration item is included in the configuration item in the isolation current limliting note.
Further, the background management platform is stored with initial parameter corresponding with each operation system frame respectively Group;Wherein, each initial parameter group includes the initial parameter value of each configuration item required for Hystrix component;
It is described that initial parameter group corresponding with the operation system frame is searched from preset background management platform, specifically Include:
According to the configuration file of the operation system frame, searched and the operation system from the background management platform The corresponding initial parameter value of frame.
Further, it is described according to the isolation current limliting explain in key configuration item parameter value and from the backstage The initial parameter value of the other configurations item obtained in management platform constructs the@HystrixCommand note of Hystrix component Solution, specifically includes:
It obtains preset@HystrixCommand and explains template;Wherein, the note template only includes Hystrix component Required each configuration item;
It is corresponding to be added in the note template by the parameter value of the key configuration item in the isolation current limliting note;
It is corresponding to be added to the note by the initial parameter value of the other configurations item obtained from the background management platform It solves in template.
Further, the@HystrixCommand note that the basis constructs carries out isolation current limliting to the method body Processing, specifically includes:
According to it is described isolation current limliting explain in configuration item type, determine it is corresponding with the isolation current limliting note every From current-limiting mode;Wherein, the isolation current-limiting mode includes: semaphore isolation method, thread pool isolation method, fusing mode;
According to the isolation current-limiting mode determined, isolation current limliting processing is carried out to the method body.
Further, the method also includes:
Initial parameter modification instruction is received, and is repaired in the background management platform according to initial parameter modification instruction Change the initial parameter value of the correspondence configuration item in corresponding operation system frame.
To achieve the goals above, it the present invention also provides a kind of device that current limliting is isolated, specifically includes:
Searching module, for searching the method body explained added with preset isolation current limliting in operation system frame;
Module is obtained, for obtaining the parameter value of key configuration item in explaining from the isolation current limliting, from preset backstage It manages and searches initial parameter group corresponding with the operation system frame in platform, and obtained from the initial parameter group found The initial parameter value of other configurations item other than the key configuration item;
Module is constructed, for the parameter value of the key configuration item in explaining according to the isolation current limliting and from the backstage The initial parameter value of the other configurations item obtained in management platform constructs the@HystrixCommand note of Hystrix component Solution;
Processing module, for carrying out isolation current limliting to the method body according to the@HystrixCommand note constructed Processing.
Further, described device further include:
Modified module, for receiving initial parameter modification instruction, and according to initial parameter modification instruction after described Platform manages the initial parameter value that the correspondence configuration item in corresponding operation system frame is modified in platform.
To achieve the goals above, the present invention also provides a kind of computer equipment, specifically include: memory, processor with And it is stored in the computer program that can be run on the memory and on the processor, the processor executes described program The step of Shi Shixian above method.
To achieve the goals above, the present invention also provides a kind of computer readable storage medium, it is stored thereon with computer Program, when described program is executed by processor the step of the realization above method.
Method, apparatus, computer equipment and the readable storage medium storing program for executing of isolation current limliting provided by the invention, due to customized Isolation current limliting explain in only need to add the parameter value of key configuration item, facilitate business to quickly access isolation current-limiting function, drop The low technical threshold using Hystrix component;Configuration item complicated in original Hystrix component is carried out in the present invention Encapsulation, customized new isolation current limliting are explained, and the parameter value of key configuration item need to only be arranged in isolation current limliting is explained, and nothing The parameter value of other configurations item need to be configured, reduce the workload of developer, be easy to developer and use Hystrix Component.In addition, in the prior art, there is technical issues that the configuration item being arranged can not be modified, and in this hair In bright, the parameter value of configuration item can targetedly be modified by preset background management platform.
Detailed description of the invention
By reading the following detailed description of the preferred embodiment, various other advantages and benefits are common for this field Technical staff will become clear.The drawings are only for the purpose of illustrating a preferred embodiment, and is not considered as to the present invention Limitation.And throughout the drawings, the same reference numbers will be used to refer to the same parts.In the accompanying drawings:
Fig. 1 is a kind of optional flow diagram of the method for the isolation current limliting that embodiment one provides;
Fig. 2 is a kind of optional program module schematic diagram of the device for the isolation current limliting that embodiment two provides;
Fig. 3 is a kind of optional hardware structure schematic diagram for the computer equipment that embodiment three provides.
Specific embodiment
In order to make the objectives, technical solutions, and advantages of the present invention clearer, with reference to the accompanying drawings and embodiments, right The present invention is further elaborated.It should be appreciated that described herein, specific examples are only used to explain the present invention, not For limiting the present invention.Based on the embodiments of the present invention, those of ordinary skill in the art are not before making creative work Every other embodiment obtained is put, shall fall within the protection scope of the present invention.
Embodiment one
The method of isolation current limliting provided by the invention is illustrated with reference to the accompanying drawing.
Fig. 1 is a kind of optional flow diagram of the method for present invention isolation current limliting, as shown in Figure 1, this method can be with The following steps are included:
Step S101: the method body explained added with preset isolation current limliting is searched in operation system frame.
Wherein, the operation system frame is the system framework that the business of multiple functions can be achieved, in the operation system Include method body corresponding with each function in frame, corresponding function may be implemented by executing each method body;In this reality It applies in example, the method that preset isolation current limliting is explained that is added to is searched in the operation system frame for including multiple method bodies Body.
It is the note added on the method body for needing to have isolation current-limiting function, the isolation that the isolation current limliting, which is explained, It is the encapsulation explained the@HystrixCommand of Hystrix component that current limliting, which is explained,.Due to the meeting in an operation system frame There are multiple method bodies corresponding with each function, and when operation system is under high concurrent access, the method body of being easy to appear cannot The problem of being performed causes very big influence to entire operation system, thus need to the method body in operation system frame into Row isolation current limliting reduces the wind that operation system is worn down to carry out certain protection to the operation system under high concurrent environment Danger.Therefore, developer can introduce preset isolation current limliting on each method body and explain when constructing operation system frame, The effect that isolation current limliting is carried out to each method body is realized to explain by preset isolation current limliting.
Hystrix component provides the functions such as fusing, isolation, current limliting, can occur simultaneously in one or more method bodies Guarantee that operation system still can be used when problem;In the prior art, it if it is desired that with Hystrix component, needs that there is isolation @HystrixCommand is added on the method body of current-limiting function to explain, however in@HystrixCommand note, it needs out Hair personnel carry out parameter setting to all configuration items required for Hystrix component in code, such as: time-out time, fusing Threshold value, maximum allowable Thread Count;The meaning and use of each configuration item in Hystrix component are understood therefore, it is necessary to developer On the way, the scene that developer takes a significant amount of time the operating mechanism for understanding Hystrix component and configuration item is applicable in is needed;And In the present embodiment, explained using simplified isolation current limliting to substitute complicated@HystrixCommand and explain, in isolation current limliting Developer only needs to carry out parameter setting to the configuration item of special attention in note, and the parameter value of other configurations item then uses Default value.
Note is the expansion templates of a method body, and method body can realize corresponding function according to the rule in note. In the present embodiment, if some method body needs only to need developer to call in party's body of laws using Hystrix component Customized isolation current limliting is explained, and the parameter value of key configuration item is arranged in isolation current limliting is explained.
It should also be noted that, in the present embodiment, being only capable of adding on the method body that type is public customized Current limliting is isolated to explain.
Step S102: the parameter value of key configuration item is obtained from the isolation current limliting note, from preset back-stage management Corresponding with operation system frame initial parameter group is searched in platform, and from the initial parameter group found acquisition in addition to The initial parameter value of other configurations item except the key configuration item.
Wherein, the key configuration item is included in the configuration item in the isolation current limliting note;
The background management platform is stored with initial parameter group corresponding with each operation system frame respectively;
Each initial parameter group includes the initial parameter value of each configuration item required for Hystrix component.
In the present embodiment, in isolation current limliting is explained, developer only needs to carry out parameter value to key configuration item Setting, and the parameter value of other configurations item required for Hystrix component is then obtained from background management platform;In back-stage management It is stored with the initial parameter group of different types of operation system frame in platform, and includes in each initial parameter group The initial parameter value of each configuration item required for Hystrix component;Due to that can have certain difference between each operation system Different, so there may be differences for the parameter value of the same configuration item of different business systems, therefore, developer can be according to business Demand and historical experience value are that initial parameter is respectively set in each configuration item of each operation system in background management platform Value.
For example, if including key configuration item maxRequest (maximum concurrency) and timeout in the note of isolation current limliting The parameter value of (time-out time), then need from the corresponding initial parameter group in background management platform obtain in addition to The initial parameter value of other configurations item except maxRequest (maximum concurrency) and timeout (time-out time).
Specifically, described search initial parameter corresponding with the operation system frame from preset background management platform Group specifically includes:
According to the configuration file of the operation system frame, searched and the operation system from the background management platform The corresponding initial parameter value of frame.
Step S103: according to the isolation current limliting explain in key configuration item parameter value and from the back-stage management The initial parameter value of the other configurations item obtained in platform, the@HystrixCommand for constructing Hystrix component are explained.
Specifically, step S103, comprising:
It obtains preset@HystrixCommand and explains template;Wherein, the note template only includes Hystrix component Required each configuration item;
It is corresponding to be added in the note template by the parameter value of the key configuration item in the isolation current limliting note;
It is corresponding to be added to the note by the initial parameter value of the other configurations item obtained from the background management platform It solves in template.
Since the@HystrixCommand code format explained is fixed, need developer to each configuration when in use Carry out parameter setting, so in the present embodiment, can be explained according to isolation current limliting in key configuration item parameter value with And the initial parameter value of the other configurations item got from background management platform, the code explained according to@HystrixCommand Format automatically generates@HystrixCommand note, to realize the isolation current-limiting function of Hystrix component.
Step S104: it is explained according to the@HystrixCommand constructed and isolation current limliting processing is carried out to the method body.
Specifically, step S104, comprising:
According to it is described isolation current limliting explain in configuration item type, determine it is corresponding with the isolation current limliting note every From current-limiting mode;Wherein, the isolation current-limiting mode includes: semaphore isolation method, thread pool isolation method, fusing mode;
According to the isolation current-limiting mode determined, isolation current limliting processing is carried out to the method body.
Further, the type according to the configuration item in the isolation current limliting note, determines that limit is isolated with described The corresponding isolation current-limiting mode of streamer solution, comprising:
When the type of the key configuration item in the isolation current limliting note are as follows: group belonging to command name commandKey, order When name commandGroup, service degradation method fallback, the isolation current limliting explains corresponding isolation current-limiting mode and is Semaphore isolation method;
When the type of the key configuration item in the isolation current limliting note are as follows: group belonging to command name commandKey, order When name commandGroup, service degradation method fallback, isolation strategy isolationStgy, the isolation current limliting is explained Corresponding isolation current-limiting mode is thread pool isolation method;
When the type of the key configuration item in the isolation current limliting note are as follows: group belonging to command name commandKey, order Name commandGroup, service degradation method fallback, request threshold value requestThreshold, failure threshold value When errorThreshold, it is fusing mode that the isolation current limliting, which explains corresponding isolation current-limiting mode,.
For example, when using@Phystrix to explain as isolation current limliting note;Corresponding to being explained as the@Phystrix Isolation current-limiting mode be semaphore isolation method when ,@Phystrix explain example it is as follows:
@Phystrix (commandKey=" getProfile ", commandGroup=" getProfile ", FallBack=" fail ", maxRequest=50, timeout=2000)
publicProfileDOgetUserProfile(String userId){
//TODO
}
Wherein, the value of commandKey is consistent with method body name;Class belonging to the value and method body of commandGroup Class name is consistent;The value of fallBack reflects the service degradation mode of use, and parameter value is consistent with original method body, usually needs It configures, the content for mainly quickly unsuccessfully returning or alerting in method body is not related to service logic generally;
MaxRequest is the maximum concurrency allowed, and timeout is time-out time;In this example, maxRequest It is key configuration item with timeout;The default value of maxRequest is the default value of 500, timeout in background management platform For 1000ms;But in this example, developer by the parameter value of maxRequest sets 50, by the parameter of timeout Value is set as 2000ms.
In another example when it is thread pool isolation method that the@Phystrix, which explains corresponding isolation current-limiting mode ,@ The example that Phystrix is explained is as follows:
Wherein, it when using thread pool isolation method, needs to add configuration item in@Phystrix note "isolationStgy";If configuration item " isolationStgy " is not present in@Phystrix note, semaphore is used Isolation method.
Timeout is time-out time, threadPoolSize is thread pool size;In this example, timeout and ThreadPoolSize is key configuration item.
In the present embodiment, hystrix-core is relied on, is explained and is made with customized isolation current limliting using spring AOP @HystrixCommand object is constructed, and in structure in being added to the method body calling process that isolation current limliting is explained for point of contact In the@HystrixCommand object built using isolation current limliting explain in key configuration item parameter value, and other configurations item Parameter value use the initial parameter value stored in background management platform.This programme is to explain building@according to isolation current limliting HystrixCommand is explained;Therefore, it is added to the method body that isolation current limliting is explained and is just capable of calling Hystrix component, just possess The function of isolation current limliting.
Further, the method also includes:
Initial parameter modification instruction is received, and is repaired in the background management platform according to initial parameter modification instruction Change the initial parameter value of the correspondence configuration item in corresponding operation system frame.
It in the prior art, cannot be to the ginseng of configuration item therein after@HystrixCommand, which explains building, to be completed Numerical value is modified, if to modify the parameter value of configuration item, needs to rebuild@HystrixCommand note;And at this In embodiment, developer can be modified by initial parameter value of the background management platform to configuration item.
In the present embodiment, developer only needs to add on needing the method body with isolation current-limiting function customized Isolation current limliting explain, i.e., the processing logic of executable corresponding isolation current limliting;When reference isolation current limliting is explained, if exploit person Member does not carry out parameter setting to key configuration item in isolation current limliting is explained, then using each configuration item in background management platform Initial parameter value;If developer carries out parameter setting to key configuration item in isolation current limliting is explained, isolation is used Parameter value in current limliting note.
Embodiment two
The method of the isolation current limliting provided in one based on the above embodiment provides a kind of dress that current limliting is isolated in the present embodiment It sets, specifically, Fig. 2 shows the optional structural block diagram of the device of the isolation current limliting, the device of the isolation current limliting is divided into One or more program modules, one or more program module are stored in storage medium, and are handled by one or more Performed by device, to complete the present invention.The so-called program module of the present invention is the series of computation machine for referring to complete specific function Program instruction section is more suitable for implementation procedure of the device of description isolation current limliting in storage medium than program itself, is described below The function of each program module of the present embodiment will specifically be introduced.
As shown in Fig. 2, the device of the isolation current limliting specifically includes consisting of part:
Searching module 201, for searching the method body explained added with preset isolation current limliting in operation system frame.
Wherein, it is the note added on the method body for needing to have isolation current-limiting function, institute that the isolation current limliting, which is explained, Stating isolation current limliting and explaining is the encapsulation explained the@HystrixCommand of Hystrix component.
It should also be noted that, in the present embodiment, being only capable of adding on the method body that type is public customized Current limliting is isolated to explain.
Module 202 is obtained, for obtaining the parameter value of key configuration item in explaining from the isolation current limliting, after preset Platform, which manages, searches initial parameter group corresponding with the operation system frame in platform, and obtains from the initial parameter group found The initial parameter value of the other configurations item except the key configuration item is removed.
Wherein, the key configuration item is included in the configuration item in the isolation current limliting note;
The background management platform is stored with initial parameter group corresponding with each operation system frame respectively;
Each initial parameter group includes the initial parameter value of each configuration item required for Hystrix component.
Specifically, obtaining module 202, it is used for:
According to the configuration file of the operation system frame, searched and the operation system from the background management platform The corresponding initial parameter value of frame.
Module 203 is constructed, for the parameter value of the key configuration item in explaining according to the isolation current limliting and from described The initial parameter value of the other configurations item obtained in background management platform constructs the@HystrixCommand of Hystrix component It explains.
Specifically, building module 203, is used for:
It obtains preset@HystrixCommand and explains template;Wherein, the note template only includes Hystrix component Required each configuration item;By the isolation current limliting explain in key configuration item parameter value, it is corresponding be added to it is described It explains in template;It is corresponding to be added to institute by the initial parameter value of the other configurations item obtained from the background management platform It states and explains in template.
Processing module 204, for carrying out isolation limit to the method body according to the@HystrixCommand note constructed Stream process.
Specifically, processing module 204, comprising:
Determination unit for the type of the configuration item in being explained according to the isolation current limliting determines that limit is isolated with described The corresponding isolation current-limiting mode of streamer solution;Wherein, the isolation current-limiting mode includes: semaphore isolation method, thread pool isolation Mode, fusing mode;
Processing unit, for carrying out isolation current limliting processing to the method body according to the isolation current-limiting mode determined.
Further, determination unit is specifically used for:
When the type of the key configuration item in the isolation current limliting note are as follows: group belonging to command name commandKey, order When name commandGroup, service degradation method fallback, the isolation current limliting explains corresponding isolation current-limiting mode and is Semaphore isolation method;
When the type of the key configuration item in the isolation current limliting note are as follows: group belonging to command name commandKey, order When name commandGroup, service degradation method fallback, isolation strategy isolationStgy, the isolation current limliting is explained Corresponding isolation current-limiting mode is thread pool isolation method;
When the type of the key configuration item in the isolation current limliting note are as follows: group belonging to command name commandKey, order Name commandGroup, service degradation method fallback, request threshold value requestThreshold, failure threshold value When errorThreshold, it is fusing mode that the isolation current limliting, which explains corresponding isolation current-limiting mode,.
Further, described device further include:
Modified module, for receiving initial parameter modification instruction, and according to initial parameter modification instruction after described Platform manages the initial parameter value that the correspondence configuration item in corresponding operation system frame is modified in platform.
It in the prior art, cannot be to the ginseng of configuration item therein after@HystrixCommand, which explains building, to be completed Numerical value is modified, if to modify the parameter value of configuration item, needs to rebuild@HystrixCommand note;And at this In embodiment, developer can be modified by initial parameter value of the background management platform to configuration item.
Embodiment three
The present embodiment also provides a kind of computer equipment, can such as execute the smart phone, tablet computer, notebook of program Computer, desktop computer, rack-mount server, blade server, tower server or Cabinet-type server are (including independent Server cluster composed by server or multiple servers) etc..As shown in figure 3, the computer equipment 30 of the present embodiment to It is few to include but is not limited to: memory 301, the processor 302 of connection can be in communication with each other by system bus.It should be pointed out that Fig. 3 illustrates only the computer equipment 30 with component 301-302, it should be understood that being not required for implementing all show Component, the implementation that can be substituted is more or less component.
In the present embodiment, memory 301 (i.e. readable storage medium storing program for executing) includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory etc.), random access storage device (RAM), static random-access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read only memory (PROM), magnetic storage, magnetic Disk, CD etc..In some embodiments, memory 301 can be the internal storage unit of computer equipment 30, such as the calculating The hard disk or memory of machine equipment 30.In further embodiments, memory 301 is also possible to the external storage of computer equipment 30 The plug-in type hard disk being equipped in equipment, such as the computer equipment 30, intelligent memory card (Smart Media Card, SMC), peace Digital (Secure Digital, SD) card, flash card (Flash Card) etc..Certainly, memory 301 can also both include meter The internal storage unit for calculating machine equipment 30 also includes its External memory equipment.In the present embodiment, memory 301 is commonly used in depositing Storage is installed on the operating system and types of applications software of computer equipment 30, for example, embodiment two isolation current limliting device journey Sequence code etc..In addition, memory 301 can be also used for temporarily storing the Various types of data that has exported or will export.
Processor 302 can be in some embodiments central processing unit (Central Processing Unit, CPU), Controller, microcontroller, microprocessor or other data processing chips.The processor 302 is commonly used in control computer equipment 30 overall operation.
Specifically, in the present embodiment, the method that processor 302 is used to execute the isolation current limliting stored in processor 302 Program, the program of method of the isolation current limliting is performed realization following steps:
The method body explained added with preset isolation current limliting is searched in operation system frame;
The parameter value that key configuration item is obtained from the isolation current limliting note, is searched from preset background management platform Initial parameter group corresponding with the operation system frame, and obtain from the initial parameter group found in addition to the key is matched Set the initial parameter value of the other configurations item except item;
It is obtained according to the parameter value of the key configuration item in the isolation current limliting note and from the background management platform The initial parameter value of the other configurations item taken, the@HystrixCommand for constructing Hystrix component are explained;
It is explained according to the@HystrixCommand constructed and isolation current limliting processing is carried out to the method body.
The specific embodiment process of above method step can be found in first embodiment, and the present embodiment is not repeated to go to live in the household of one's in-laws on getting married herein It states.
Example IV
The present embodiment also provides a kind of computer readable storage medium, such as flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory etc.), random access storage device (RAM), static random-access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read only memory (PROM), magnetic storage, magnetic Disk, CD, server, App are stored thereon with computer program, the computer program is held by processor using store etc. Following method and step is realized when row:
The method body explained added with preset isolation current limliting is searched in operation system frame;
The parameter value that key configuration item is obtained from the isolation current limliting note, is searched from preset background management platform Initial parameter group corresponding with the operation system frame, and obtain from the initial parameter group found in addition to the key is matched Set the initial parameter value of the other configurations item except item;
It is obtained according to the parameter value of the key configuration item in the isolation current limliting note and from the background management platform The initial parameter value of the other configurations item taken, the@HystrixCommand for constructing Hystrix component are explained;
It is explained according to the@HystrixCommand constructed and isolation current limliting processing is carried out to the method body.
The specific embodiment process of above method step can be found in first embodiment, and the present embodiment is not repeated to go to live in the household of one's in-laws on getting married herein It states.
It should be noted that, in this document, the terms "include", "comprise" or its any other variant are intended to non-row His property includes, so that the process, method, article or the device that include a series of elements not only include those elements, and And further include other elements that are not explicitly listed, or further include for this process, method, article or device institute it is intrinsic Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including being somebody's turn to do There is also other identical elements in the process, method of element, article or device.
The serial number of the above embodiments of the invention is only for description, does not represent the advantages or disadvantages of the embodiments.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment side Method can be realized by means of software and necessary general hardware platform, naturally it is also possible to by hardware, but in many cases The former is more preferably embodiment.
The above is only a preferred embodiment of the present invention, is not intended to limit the scope of the invention, all to utilize this hair Equivalent structure or equivalent flow shift made by bright specification and accompanying drawing content is applied directly or indirectly in other relevant skills Art field, is included within the scope of the present invention.

Claims (10)

1. a kind of method that current limliting is isolated, which is characterized in that the described method includes:
The method body explained added with preset isolation current limliting is searched in operation system frame;
The parameter value of key configuration item, lookup and institute from preset background management platform are obtained from the isolation current limliting note The corresponding initial parameter group of operation system frame is stated, and is obtained from the initial parameter group found in addition to the key configuration item Except other configurations item initial parameter value;
It is obtained according to the parameter value of the key configuration item in the isolation current limliting note and from the background management platform The initial parameter value of other configurations item, the@HystrixCommand for constructing Hystrix component are explained;
It is explained according to the@HystrixCommand constructed and isolation current limliting processing is carried out to the method body.
2. the method for isolation current limliting according to claim 1, which is characterized in that the isolation current limliting note is that addition is needing There is the note on the method body of isolation current-limiting function;The key configuration item is included in the isolation current limliting note Configuration item.
3. the method for isolation current limliting according to claim 2, which is characterized in that the background management platform is stored with difference Initial parameter group corresponding with each operation system frame;Wherein, each initial parameter group includes required for Hystrix component The initial parameter value of each configuration item;
It is described that initial parameter group corresponding with the operation system frame, specific packet are searched from preset background management platform It includes:
According to the configuration file of the operation system frame, searched and the operation system frame from the background management platform Corresponding initial parameter value.
4. the method for isolation current limliting according to claim 3, which is characterized in that described according in isolation current limliting note Key configuration item parameter value and the other configurations item obtained from the background management platform initial parameter value, building The@HystrixCommand of Hystrix component is explained out, is specifically included:
It obtains preset@HystrixCommand and explains template;Wherein, the note template only includes needed for Hystrix component The each configuration item wanted;
It is corresponding to be added in the note template by the parameter value of the key configuration item in the isolation current limliting note;
It is corresponding to be added to the note mould by the initial parameter value of the other configurations item obtained from the background management platform In plate.
5. the method for isolation current limliting according to claim 4, which is characterized in that the@that the basis constructs HystrixCommand, which is explained, carries out isolation current limliting processing to the method body, specifically includes:
According to the type of the configuration item in the isolation current limliting note, isolation limit corresponding with the isolation current limliting note is determined Stream mode;Wherein, the isolation current-limiting mode includes: semaphore isolation method, thread pool isolation method, fusing mode;
According to the isolation current-limiting mode determined, isolation current limliting processing is carried out to the method body.
6. the method for isolation current limliting according to any one of claims 1 to 5, which is characterized in that the method also includes:
Initial parameter modification instruction is received, and according to initial parameter modification instruction modification pair in the background management platform Answer the initial parameter value of the correspondence configuration item in operation system frame.
7. a kind of device that current limliting is isolated, which is characterized in that described device includes:
Searching module, for searching the method body explained added with preset isolation current limliting in operation system frame;
Module is obtained, for obtaining the parameter value of key configuration item in explaining from the isolation current limliting, from preset back-stage management Corresponding with operation system frame initial parameter group is searched in platform, and from the initial parameter group found acquisition in addition to The initial parameter value of other configurations item except the key configuration item;
Module is constructed, for the parameter value of the key configuration item in explaining according to the isolation current limliting and from the back-stage management The initial parameter value of the other configurations item obtained in platform, the@HystrixCommand for constructing Hystrix component are explained;
Processing module carries out isolation current limliting processing to the method body for explaining according to the@HystrixCommand constructed.
8. the device of isolation current limliting according to claim 7, which is characterized in that described device further include:
Modified module is managed for receiving initial parameter modification instruction, and according to initial parameter modification instruction on the backstage The initial parameter value of the correspondence configuration item in corresponding operation system frame is modified in platform.
9. a kind of computer equipment, the computer equipment includes: memory, processor and is stored on the memory simultaneously The computer program that can be run on the processor, which is characterized in that the processor realizes right when executing described program It is required that the step of any one of 1 to 6 the method.
10. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that described program is processed The step of any one of claim 1 to 6 the method is realized when device executes.
CN201910301150.9A 2019-04-15 2019-04-15 Isolation current limiting method and device, computer equipment and readable storage medium Active CN110162344B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910301150.9A CN110162344B (en) 2019-04-15 2019-04-15 Isolation current limiting method and device, computer equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910301150.9A CN110162344B (en) 2019-04-15 2019-04-15 Isolation current limiting method and device, computer equipment and readable storage medium

Publications (2)

Publication Number Publication Date
CN110162344A true CN110162344A (en) 2019-08-23
CN110162344B CN110162344B (en) 2023-03-31

Family

ID=67639482

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910301150.9A Active CN110162344B (en) 2019-04-15 2019-04-15 Isolation current limiting method and device, computer equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN110162344B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110727477A (en) * 2019-10-12 2020-01-24 上海陆家嘴国际金融资产交易市场股份有限公司 Component loading method and device, computer equipment and storage medium
CN111709050A (en) * 2020-05-21 2020-09-25 四川虹美智能科技有限公司 Method and device for initializing permission configuration parameters
CN113110887A (en) * 2021-03-31 2021-07-13 联想(北京)有限公司 Information processing method and device, electronic equipment and storage medium
CN114979137A (en) * 2022-04-28 2022-08-30 中国电力科学研究院有限公司 Method, system, equipment and medium for high-concurrency processing in power industry

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104951694A (en) * 2014-03-24 2015-09-30 华为技术有限公司 Isolation method and apparatus for management virtual machine
CN107301098A (en) * 2017-06-15 2017-10-27 搜易贷(北京)金融信息服务有限公司 A kind of remote procedure call device based on Thrift agreements, method and system
CN108009075A (en) * 2017-11-27 2018-05-08 南京联创信息科技有限公司 Dynamic fusing determination methods based on Hystrix frames
CN108446111A (en) * 2018-03-26 2018-08-24 国家电网公司客户服务中心 A kind of micro services construction method based on Spring cloud
CN109587272A (en) * 2018-12-30 2019-04-05 深圳云天励飞技术有限公司 A kind of optimization method of micro services, device and electronic equipment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104951694A (en) * 2014-03-24 2015-09-30 华为技术有限公司 Isolation method and apparatus for management virtual machine
CN107301098A (en) * 2017-06-15 2017-10-27 搜易贷(北京)金融信息服务有限公司 A kind of remote procedure call device based on Thrift agreements, method and system
CN108009075A (en) * 2017-11-27 2018-05-08 南京联创信息科技有限公司 Dynamic fusing determination methods based on Hystrix frames
CN108446111A (en) * 2018-03-26 2018-08-24 国家电网公司客户服务中心 A kind of micro services construction method based on Spring cloud
CN109587272A (en) * 2018-12-30 2019-04-05 深圳云天励飞技术有限公司 A kind of optimization method of micro services, device and electronic equipment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
高广超: ""使用Hystrix实现自动降级与依赖隔离[微服务]"", 《HTTPS://CLOUD.TENCENT.COM/DEVELOPER/ARTICLE/1371154》 *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110727477A (en) * 2019-10-12 2020-01-24 上海陆家嘴国际金融资产交易市场股份有限公司 Component loading method and device, computer equipment and storage medium
CN111709050A (en) * 2020-05-21 2020-09-25 四川虹美智能科技有限公司 Method and device for initializing permission configuration parameters
CN113110887A (en) * 2021-03-31 2021-07-13 联想(北京)有限公司 Information processing method and device, electronic equipment and storage medium
CN113110887B (en) * 2021-03-31 2023-07-21 联想(北京)有限公司 Information processing method, device, electronic equipment and storage medium
CN114979137A (en) * 2022-04-28 2022-08-30 中国电力科学研究院有限公司 Method, system, equipment and medium for high-concurrency processing in power industry

Also Published As

Publication number Publication date
CN110162344B (en) 2023-03-31

Similar Documents

Publication Publication Date Title
CN110162344A (en) A kind of method, apparatus, computer equipment and readable storage medium storing program for executing that current limliting is isolated
US10048996B1 (en) Predicting infrastructure failures in a data center for hosted service mitigation actions
CN111767143B (en) Transaction data processing method, device, equipment and system
US20180365254A1 (en) Method and apparatus for processing information flow data
CN111756601B (en) Microservice architecture monitoring method and device, computer equipment and readable storage medium
CN103927338A (en) Log information storage processing method and log information storage processing device
Jeong et al. Anomaly teletraffic intrusion detection systems on hadoop-based platforms: A survey of some problems and solutions
CN109146095A (en) The treating method and apparatus of multiservice system problem
CN109191287A (en) A kind of sharding method, device and the electronic equipment of block chain intelligence contract
CN113254445A (en) Real-time data storage method and device, computer equipment and storage medium
CN110737504B (en) Fault-tolerant method, system, terminal and storage medium for deep learning model training
CN115757611A (en) Big data cluster switching method and device, electronic equipment and storage medium
CN110908644B (en) Configuration method and device of state node, computer equipment and storage medium
CN115409507A (en) Block processing method, block processing device, computer equipment and storage medium
WO2021174779A1 (en) Data pre-processing system and method, computer device, and readable storage medium
CN111752961A (en) Data processing method and device
CN109948994A (en) A kind of instant communicating method, device, computer system and readable storage medium storing program for executing
CN114756362A (en) Resource quota management method and system, intelligent terminal and storage medium
CN116263717A (en) Order service processing method and device based on event
CN114564211A (en) Cluster deployment method, cluster deployment device, equipment and medium
CN110941479B (en) Task data execution method, server, and computer storage medium
CN111147575B (en) Data storage system based on block chain
CN115033551A (en) Database migration method and device, electronic equipment and storage medium
Zhou [Retracted] Regional Financial Data Processing Based on Distributed Decoding Technology
CN116233255B (en) Scheduling policy chain generation and scheduling method and related equipment

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