[go: up one dir, main page]

CN106598723A - Configuration method and device for resources in distributed system - Google Patents

Configuration method and device for resources in distributed system Download PDF

Info

Publication number
CN106598723A
CN106598723A CN201510679864.5A CN201510679864A CN106598723A CN 106598723 A CN106598723 A CN 106598723A CN 201510679864 A CN201510679864 A CN 201510679864A CN 106598723 A CN106598723 A CN 106598723A
Authority
CN
China
Prior art keywords
resource
information
preset
identification information
resource information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201510679864.5A
Other languages
Chinese (zh)
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 Gridsum Technology Co Ltd
Original Assignee
Beijing Gridsum 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 Gridsum Technology Co Ltd filed Critical Beijing Gridsum Technology Co Ltd
Priority to CN201510679864.5A priority Critical patent/CN106598723A/en
Publication of CN106598723A publication Critical patent/CN106598723A/en
Pending legal-status Critical Current

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/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5083Techniques for rebalancing the load in a distributed system

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 And Data Communications (AREA)

Abstract

The invention discloses a configuration method and a configuration device for resources in a distributed system, relates to the technical field of information, and can effectively control utilization of the resources in the distributed system, and stability of the distributed system is ensured. The method comprises the steps of firstly receiving a resource acquisition request which carries identifier information of the resource requested by a requester; then acquiring resource monitoring information corresponding to the identifier information from a preset storage position and judging whether the resource monitoring information accords with a preset limitation condition, wherein resource monitoring information and resource information respectively corresponding to the identifier information of the different resources are stored at the preset storage position; and if the resource monitoring information accords with the preset limitation condition, sending the resource information corresponding to the identifier information to the requester. The method and device provided by the invention are applicable to managing the utilization of the resources in the distributed system.

Description

The collocation method and device of resource in distributed system
Technical field
The present invention relates in areas of information technology, more particularly to a kind of distributed system the collocation method of resource and Device.
Background technology
In the last few years, developing rapidly with information technology, distributed system is used widely, distributed System is built upon the software system on network, processes every assisting for task, then integrates out result, The resource in network can be called for user to be used, in a distributed system, sometimes many users need Same item resource is used simultaneously.
At present for the usual not restriction of resource transfer, resource can be used without limit, but when resource exists When call number in stipulated time section is more, the unstable of distributed system can be caused.For example, it is daily to make Information website can be considered as a kind of distributed system, and each user for accessing can be from the information website Information is acquired, when user's malice frequently accesses the information website in certain time period, meeting Decline the corresponding server performance in the information website;When multiple users are in an identical manner in the same time period When inside frequently accessing the information website, can cause the information website cannot normal work, or even information network can be made Corresponding server of standing is delayed machine.
The content of the invention
In view of this, the embodiment of the present invention provides a kind of collocation method and device of resource in distributed system, Main purpose is can be to the resource in distributed system using being effectively controlled, it is ensured that distributed System is stablized.
To reach above-mentioned purpose, present invention generally provides following technical scheme:
According to one aspect of the present invention, there is provided the collocation method of resource in a kind of distributed system, the method bag Include:
Resource acquisition request is received, the mark of the resource of requestor requests is carried in the resource acquisition request Information;
The monitoring resource information corresponding with the identification information is obtained from preset storage location and judge the resource Whether monitoring information meets preset restrictive condition, and the preset storage location preserves the mark letter of different resource The corresponding monitoring resource information of breath difference and resource information;
If meeting the preset restrictive condition, to the requesting party resource corresponding to the identification information is sent Information.
According to another aspect of the present invention, there is provided the configuration device of resource in a kind of distributed system, the device Including:
Receiving unit, for receiving resource acquisition request, carrying requesting party in the resource acquisition request please The identification information of the resource asked;
Acquiring unit, for corresponding from the identification information that preset storage location is obtained with the receiving unit is received Monitoring resource information;
Judging unit, for judging whether the monitoring resource information that the acquiring unit is obtained meets preset restriction Condition, the preset storage location is preserved the identification information of different resource and distinguishes corresponding monitoring resource information And resource information;
Transmitting element, if judging that the monitoring resource information meets the preset limit for the judging unit Condition processed, then send resource information corresponding to the identification information to the requesting party.
By above-mentioned technical proposal, technical scheme provided in an embodiment of the present invention at least has following advantages:
The collocation method and device of resource, receives first in a kind of distributed system provided in an embodiment of the present invention Resource acquisition is asked, and the identification information of the resource of requestor requests is carried in the resource acquisition request;So Obtain the monitoring resource information corresponding with the identification information from preset storage location afterwards and judge the resource prison Whether control information meets preset restrictive condition, and the preset storage location preserves the identification information of different resource The corresponding monitoring resource information of difference and resource information;If meeting the preset restrictive condition, ask to described The side of asking sends resource information corresponding to the identification information.With at present for resource use unrestricted mode Compare, the present invention is by judging whether monitoring resource information corresponding with resource acquisition request meets preset restriction Condition, if meeting, to requesting party resource information is sent, if not meeting, is sent request to requesting party and is unsuccessfully rung Answer information, and then can realize to the resource in distributed system using being effectively controlled, it is ensured that point Cloth system stablizes, it is to avoid excessively the using to resource in stipulated time section, it is possible to achieve right Fragile resource usage frequency carries out unified limitation management in distributed system, and in system the fragile money is called During source, can slow down and call speed, so that the fragile resource will not occur exception.
Described above is only the general introduction of technical solution of the present invention, in order to better understand the technology of the present invention Means, and being practiced according to the content of description, and in order to allow above and other objects of the present invention, Feature and advantage can become apparent, below especially exemplified by the specific embodiment of the present invention.
Description of the drawings
By the detailed description for reading hereafter preferred implementation, various other advantage and benefit are for ability Domain those of ordinary skill will be clear from understanding.Accompanying drawing is only used for illustrating the purpose of preferred implementation, and and It is not considered as limitation of the present invention.And in whole accompanying drawing, it is denoted by the same reference numerals identical Part.In the accompanying drawings:
Fig. 1 shows that the collocation method flow process of resource in a kind of distributed system provided in an embodiment of the present invention is shown It is intended to;
Fig. 2 shows the collocation method flow process of resource in another kind of distributed system provided in an embodiment of the present invention Schematic diagram;
Fig. 3 shows that the configuration device structure of resource in a kind of distributed system provided in an embodiment of the present invention is shown It is intended to;
Fig. 4 shows the configuration device structure of resource in another kind of distributed system provided in an embodiment of the present invention Schematic diagram.
Specific embodiment
The exemplary embodiment of the disclosure is more fully described below with reference to accompanying drawings.Although showing in accompanying drawing The exemplary embodiment of the disclosure, it being understood, however, that may be realized in various forms the disclosure and should not be by Embodiments set forth here is limited.On the contrary, there is provided these embodiments are able to be best understood from this It is open, and can by the scope of the present disclosure it is complete convey to those skilled in the art.
A kind of collocation method of resource in distributed system is embodiments provided, as shown in figure 1, institute The method of stating includes:
101st, resource acquisition request is received.
Wherein, the identification information of the resource of requestor requests is carried in the resource acquisition request.The mark Knowledge information can be name information, ID (Identity, identity number) information etc..For example, resource 1, Resource 2 etc..
For the executive agent of the embodiment of the present invention can be to be used to manage resource tune between requesting party and recipient Intermediate equipment, or the management module in recipient, when executive agent is requesting party and recipient Between for the intermediate equipment for managing resource transfer when, resource acquisition request can be used for acquisition request with Resource transfer authority corresponding to the identification information;When executive agent is the management module in recipient, institute State resource acquisition request and can be used for the acquisition request resource information corresponding with the identification information.In order to illustrate The embodiment of the present invention, the executive agent of following steps is the management module in recipient.
102nd, obtain from preset storage location and carry requestor requests resource with resource acquisition request Monitoring resource information corresponding to identification information.
Wherein, the preset storage location preserves the corresponding monitoring resource of identification information difference of different resource Information and resource information.The preset storage location can be configured according to the actual requirements, it is also possible to by being System default configuration, the embodiment of the present invention is not limited.For example, preset storage location is configurable to predetermined Data storage storehouse.The monitoring resource information can include the request situation of resource, specifically can include Request number of times of the resource information within preset time period, the predetermined amount of time for receive request the moment to Time period between the moment of past passage Preset Time, can be set according to the actual requirements, it is also possible to Set by system default, the embodiment of the present invention is not limited.For example, predetermined amount of time can be to connect The moment for receiving request is counted and was elapsed in time period of 5 seconds to the past, or with receive request when Count at quarter and elapsed in time period of 10 seconds etc. to the past.
103rd, judge whether the monitoring resource information meets preset restrictive condition.
Wherein, the preset restrictive condition can be configured according to the actual requirements, it is also possible to by system default Configuration, the embodiment of the present invention is not limited.
For example, preset restrictive condition be resource transfer number of times in 2 seconds less than 4 times, when receiving resource 1 Acquisition ask when, the corresponding monitoring resource information of resource 1 is acquired from data storage storehouse, wherein wrapping Elapsed in the time period of 2 seconds to the past containing being counted with the moment for receiving request, the corresponding resource of resource 1 Call number, when the corresponding resource transfer number of times of resource 1 is 3 times in the time period, judges resource 1 pair The monitoring resource information answered meets preset restrictive condition;When the corresponding resource transfer of resource 1 in the time period When number is 5 times, judge that the corresponding monitoring resource information of resource 1 does not meet preset restrictive condition.
If the 104, judging, the monitoring resource information meets the preset restrictive condition, to the requesting party Send resource information corresponding to the identification information.
For the embodiment of the present invention, if judging, the monitoring resource information meets the preset restrictive condition, Then resource information corresponding to the identification information is sent to the requesting party, to realize that requesting party acquires this Resource information, if judging, the monitoring resource information does not meet the preset restrictive condition, to the request Side sends failure response information corresponding to the identification information, to notify that requesting party obtains resource information failure.
It should be noted that for number of site system, can there is anti-reptile mechanism, wherein, it is described counter to climb Worm mechanism is to prevent a large amount of download site data of robot program's malice, makes websites response not come, it is impossible to locate Reason is normal to ask, and website is not intended to others and obtains its data too quickly by robot program, makes The mechanism of data outflow, there is the web station system of anti-reptile mechanism can limit reptile behavior, in some instances it may even be possible to can forever IP (Internet Protocol, Internet protocol) the address access site resource that reptile is used is limited long, And method provided in an embodiment of the present invention can effectively prevent from triggering the anti-reptile mechanism of web station system, can be with Ensure the smooth working of crawler system, it is to avoid the situation that resource forever can not be used occur.
The collocation method of resource in a kind of distributed system provided in an embodiment of the present invention, receives first resource and obtains Request is taken, the identification information of the resource of requestor requests is carried in the resource acquisition request;Then from pre- Put storage location to obtain the monitoring resource information corresponding with the identification information and judge the monitoring resource information Whether preset restrictive condition is met, and the identification information that the preset storage location preserves different resource is right respectively The monitoring resource information answered and resource information;If meeting the preset restrictive condition, send out to the requesting party The resource information for sending the identification information corresponding.With at present for resource using unrestricted mode compared with, Whether the present invention meets preset restrictive condition by judgement monitoring resource information corresponding with resource acquisition request, If meeting, resource information is sent to requesting party, if not meeting, to requesting party request failure response information is sent, And then can realize to the resource in distributed system using being effectively controlled, it is ensured that distributed system Stablize, it is to avoid excessively the using to resource in stipulated time section, it is possible to achieve to distributed system Fragile resource usage frequency carries out unified limitation management in system, when system calls the fragile resource, can Speed is called to slow down, so that the fragile resource will not occur exception.
The collocation method of resource in another kind of distributed system is embodiments provided, as shown in Fig. 2 Methods described includes:
201st, resource acquisition request is received.
Wherein, the identification information of the resource of requestor requests is carried in the resource acquisition request.The mark Knowledge information can be name information, ID (Identity, identity number) information etc..For example, resource a, Resource b etc..
For the executive agent of the embodiment of the present invention can be the management module in recipient, the resource acquisition Request can be used for the acquisition request resource information corresponding with the identification information.
202nd, obtain from preset storage location and carry requestor requests resource with resource acquisition request Monitoring resource information corresponding to identification information.
Wherein, the preset storage location preserves the corresponding monitoring resource of identification information difference of different resource Information and resource information.The preset storage location can be configured according to the actual requirements, it is also possible to by being System default configuration, the embodiment of the present invention is not limited.The monitoring resource information exists including the resource information Request number of times in preset time period.The preset time period is pre- to elapsing to the past from the reception request moment If the time period between the moment of time, can be set according to the actual requirements, it is also possible to by system default Set, the embodiment of the present invention is not limited.For example, preset time period can be to receive request Moment is counted and was elapsed in the time period of 2 seconds to the past, or counted to mistake with the moment for receiving request Go the time period for elapsing 5 seconds interior etc..
203rd, judge whether the monitoring resource information meets preset restrictive condition.
For the embodiment of the present invention, the step 203 is specifically included:Judge corresponding with the identification information Whether request number of times of the resource information within preset time period is more than or equal to preset times;If less than described pre- If number of times, then confirm to meet the preset restrictive condition;If being more than or equal to the preset times, confirm The preset restrictive condition is not met.Wherein, the preset times can be configured according to the actual requirements, Can also be configured by system default, the embodiment of the present invention is not limited.
It should be noted that the monitoring resource information also includes the request correspondence that the asset information receipt is arrived Timestamp, the request number of times in the preset time period is the timestamp received in the preset time period Number, each resource acquisition request one timestamp of correspondence, for example, timestamp can be 20150517130101, at 1 point of moment of 1 second, connect at the moment during specially 2015 on May 17,13 A resource acquisition request is have received, and the resource is called.The judgement and the identification information Whether request number of times of the corresponding resource information within preset time period includes more than or equal to preset times:Sentence Whether the timestamp number that the resource information corresponding with the identification information of breaking is received within preset time period is big In or equal to predetermined number.
For example, predetermined number is configurable to 3, and preset time period is configurable to receive request Moment was counted to the passage time period of 2 seconds in past, when the acquisition for receiving resource a is asked, acquired Resource a is counting corresponding timestamp number in the time period that 2 seconds were elapsed to the past with the request moment, when this When the corresponding timestamp number of resource a is 2 in time period, judge the corresponding resource information of resource a pre- The timestamp number put in the time period is less than predetermined number;When the corresponding timestamp of resource a in the time period When number is 4, judge timestamp number of the corresponding resource information of resource a within preset time period more than pre- If number.
In order to realize the embodiment of the present invention, can creating and by way of managing multiple key-value pair structures, when When creating a resource transfer limitation entry, a key-value pair is created.Wherein, the corresponding key of the key-value pair Can be the mark for distinguishing resource transfer limitation entry, for example, the mark can use restriction for resource 1. The corresponding value of the key-value pair can include the record of restrictive condition and resource transfer situation.The restriction Condition can include the time segment length of monitoring, and the limited number of times of resource transfer.The resource transfer The record of situation can be the time list of resource transfer time, wherein timestamp when saving resource transfer, One timestamp correspondence first resource is called.For example, the corresponding key of key-value pair is resource 2, and key-value pair is corresponding It is worth for { 1 second, 2 times, [20150517130000,20150517130001] }, value expression is resource 2 Call restriction, the number of times that resource 2 is called in specially 1 second must not exceed 2 times, i.e., less than or equal to 2 It is secondary, and respectively in 0 second May 17 day 13 point 0 minute in 2015 and May 17 day 13: 0 in 2015 It is divided to 1 second two moment, have received the acquisition request of resource 2, and has carried out calling for resource 2.When When the acquisition for receiving resource 2 is asked, elapsed 1 second to the past with current point in time, calculate the judgement time Point A, the timestamp to preserving in the time list of resource transfer time carries out traversal and sentences by order from morning to night Disconnected, timing statisticses are later than or equal to the timestamp number for judging time point A, and judging the number of the timestamp is It is no to be less than 2, when the number of the timestamp is less than 2, to request the approval in-formation of the resource is sent; When the number of the timestamp is more than or equal to 2, resource acquisition request is rejected, and then realized to resource 2 The limitation management for calling.
Further, when the corresponding restrictive condition of resource information needs change, it is only necessary to receive resource transfer The change directive of the mark of limitation entry and corresponding restrictive condition, and receive corresponding with the mark new Restrictive condition, according to the change directive, pair with the time segment length of the corresponding monitoring of the mark and The limited number of times of resource transfer is covered, and is covered as new restrictive condition, and then reaches the purpose of change. New restrictive condition comes into force, it is possible to achieve change the purpose of restriction strategy in real time.
Further, judge that the resource information corresponding with the identification information connects within preset time period described Whether the timestamp number for receiving also includes more than or equal to before predetermined number:Judge the identification information With the presence or absence of the timestamp of the resource information corresponding with the identification information in corresponding monitoring resource information;If There is no the timestamp of the resource information corresponding with the identification information, then send the mark to the requesting party The corresponding resource information of knowledge information;By the timestamp of resource information corresponding to the identification information in the resource Preserved in monitoring information.
For example, when the acquisition for receiving resource b is asked, in judging the corresponding monitoring resource information of resource b With the presence or absence of the timestamp for having resource b, if there is no the timestamp of resource b, it may be said that bright resource b it It is front that the resource information of resource b can be sent to requesting party without called, and the acquisition for receiving is asked Corresponding timestamp is stored in the corresponding monitoring resource information of resource b, is entered when receiving resource b so as to next time Row judges;If there is the timestamp of resource b, then judge the corresponding resource information of resource b in preset time Whether the timestamp number received in section judges resource b corresponding more than or equal to predetermined number Whether monitoring resource information meets preset restrictive condition.
If 204a, judging that the monitoring resource information meets the preset restrictive condition, to the request Side sends resource information corresponding to the identification information.
For the embodiment of the present invention, if judging, the monitoring resource information meets the preset restrictive condition, Then resource information corresponding to the identification information is sent to the requesting party, to realize that requesting party acquires this Resource information.
If step 204b arranged side by side with step 204a, to judge that the monitoring resource information does not meet described preset Restrictive condition, then send request failure response information to the requesting party.
Wherein, the request failure response information is used to notify that requestor requests obtain resource information failure.
For the embodiment of the present invention, by judging whether monitoring resource information corresponding with resource acquisition request accords with Preset restrictive condition is closed, if meeting, to requesting party resource information corresponding to the identification information is sent;If Do not meet, then send request failure response information to the requesting party, it is possible to achieve in distributed system Resource is using being effectively controlled, it is ensured that distributed system is stablized, it is to avoid in stipulated time section To excessively using for resource.
Further, methods described also includes:Detect that the identification information is corresponding according to preset time interval With the presence or absence of the timestamp earlier than the preset time period in the timestamp of monitoring resource information;If existing, The timestamp earlier than the preset time period is deleted.Wherein, the preset time interval can be with Configured according to user's request, it is also possible to configured by system default, the embodiment of the present invention is not limited.Example Such as, the preset time interval is configurable to 30 minutes, 1 hour etc..
For example, detection be the corresponding monitoring resource information of resource 1 timestamp, preset time interval can be with It is configured to 20 minutes, preset time period is to count to the past to elapse time period of 1 second with detection moment, i.e., often With the presence or absence of preset earlier than this in the timestamp for detecting the corresponding monitoring resource information of first resource 1 every 20 minutes The timestamp of time period, 1 corresponding 3 timestamp of resource is respectively 20150517130500, 20150517130501st, 20150517130502, by taking 20150517130500 timestamp as an example, represent In 0 second May 17 day 13 point 5 minute in 2015 at this moment, when detection moment is 17 days 13 May in 2015 When putting 5 minutes and 3 seconds, elapsed 1 second to the past, calculate and judge time point B for 17 days 13 May in 2015 , in judging 1 corresponding 3 timestamp of resource, there are two timestamps earlier than the judgement time in point 5 minutes and 2 seconds Point B, respectively 20150517130500,20150517130501, the two timestamps are deleted.
Further, identification information correspondence different preset time periods of different resource, can according to it is preset when Between the identification information of interval detection different resource distinguish and whether there is in the timestamp of corresponding monitoring resource information Earlier than the timestamp of each self-corresponding preset time period, if existing, will be earlier than each self-corresponding preset time The timestamp of section is deleted, and can save holding time stamp space used.
It should be noted that in order to realize the embodiment of the present invention, a timing cleaning out-of-service time can be created The thread of stamp, the effect of this thread is that the timestamp for preventing resource correspondence from preserving is excessive, is occupied excessive System resource.The timestamp that the thread can be preserved at set intervals to resource correspondence is according to storage and monitoring time segment Ergodic judgement is carried out, expired timestamp is deleted, it is ensured that do not had excessive expiration stamp and take System resource.
For embodiment of the present invention concrete application scene can be with as follows, but not limited to this, including:
The acquisition request of resource a of requesting party's transmission is firstly received, is acquired from data storage storehouse The corresponding monitoring resource information of resource a, includes resource a within preset time period in monitoring resource information Request number of times, judges whether the monitoring resource information meets preset restrictive condition, if judging the monitoring resource Information meets the preset restrictive condition, then send the corresponding resource information of resource a to the requesting party, to realize Requesting party acquires the resource information;If on the contrary, not meeting, to the requesting party request failure is sent Response message, for notifying that requestor requests obtain the failure of resource a.Specifically judge resource a when preset Between request number of times in section whether be more than or equal to preset times, determine the corresponding monitoring resource information of resource a Whether preset restrictive condition is met, and further, the request number of times in preset time period can be preset time The timestamp number received in section, each resource acquisition request one timestamp of correspondence, you can to pass through Judge whether the timestamp number that resource a is received within preset time period is more than or equal to predetermined number, really Determine whether the corresponding monitoring resource information of resource a meets preset restrictive condition.
For example, predetermined number is configurable to 2, and preset time period is configurable to receive the request moment Counted to the passage time period of 1 second in past, when the acquisition for receiving resource a is asked, judge whether The timestamp of the corresponding monitoring resource information of resource a, if not existing, to the requesting party resource a correspondence is sent Resource information, and the acquisition that receives asks corresponding timestamp to be stored in the corresponding monitoring resource of resource a In information;If existing, resource a is acquired to ask the moment to be counted to the passage time of 1 second in past Corresponding timestamp number in section, when the corresponding timestamp number of resource a is 1 in the time period, sentences Timestamp number that resource a receives within preset time period is determined less than predetermined number, send to the requesting party The corresponding resource information of resource a, to realize that requesting party acquires resource a;When resource a pair in the time period When the timestamp number answered is 3, judge that the timestamp number that resource a is received within preset time period is big In predetermined number, request failure response information is sent to the requesting party, for notifying that requestor requests obtain money Source a fails.
The collocation method of resource, receives first resource in another kind of distributed system provided in an embodiment of the present invention Request is obtained, the identification information of the resource of requestor requests is carried in the resource acquisition request;Then from Preset storage location obtains the monitoring resource information corresponding with the identification information and judges the monitoring resource letter Whether breath meets preset restrictive condition, and the preset storage location preserves the identification information difference of different resource Corresponding monitoring resource information and resource information;If meeting the preset restrictive condition, to the requesting party Send resource information corresponding to the identification information.With at present for resource using unrestricted mode compared with, Whether the present invention meets preset restrictive condition by judgement monitoring resource information corresponding with resource acquisition request, If meeting, resource information is sent to requesting party, if not meeting, to requesting party request failure response information is sent, And then can realize to the resource in distributed system using being effectively controlled, it is ensured that distributed system Stablize, it is to avoid excessively the using to resource in stipulated time section, it is possible to achieve to distributed system Fragile resource usage frequency carries out unified limitation management in system, when system calls the fragile resource, can Speed is called to slow down, so that the fragile resource will not occur exception.
Further, implementing as method shown in Fig. 1, embodiments provides a kind of distribution The configuration device of resource in formula system, as shown in figure 3, described device includes:Receiving unit 31, acquisition are single Unit 32, judging unit 33, transmitting element 34.
The receiving unit 31, can be used for receiving resource acquisition request, carry in the resource acquisition request There is the identification information of the resource of requestor requests.
The acquiring unit 32, can be used for from preset storage location obtaining and the reception of the receiving unit 31 Monitoring resource information corresponding to identification information.
The judging unit 33, can be used for judging whether is monitoring resource information that the acquiring unit 32 obtains Meet preset restrictive condition, the identification information difference that the preset storage location preserves different resource is corresponding Monitoring resource information and resource information.
The transmitting element 34, if can be used for the judging unit 33 judges the monitoring resource information symbol The preset restrictive condition is closed, then sends resource information corresponding to the identification information to the requesting party.
It should be noted that in a kind of distributed system provided in an embodiment of the present invention resource configuration device institute It is related to other corresponding descriptions of each functional unit, may be referred to the correspondence description of Fig. 1, will not be described here.
The configuration device of resource in a kind of distributed system provided in an embodiment of the present invention, receives first resource and obtains Request is taken, the identification information of the resource of requestor requests is carried in the resource acquisition request;Then from pre- Put storage location to obtain the monitoring resource information corresponding with the identification information and judge the monitoring resource information Whether preset restrictive condition is met, and the identification information that the preset storage location preserves different resource is right respectively The monitoring resource information answered and resource information;If meeting the preset restrictive condition, send out to the requesting party The resource information for sending the identification information corresponding.With at present for resource using unrestricted mode compared with, Whether the present invention meets preset restrictive condition by judgement monitoring resource information corresponding with resource acquisition request, If meeting, resource information is sent to requesting party, if not meeting, to requesting party request failure response information is sent, And then can realize to the resource in distributed system using being effectively controlled, it is ensured that distributed system Stablize, it is to avoid excessively the using to resource in stipulated time section, it is possible to achieve to distributed system Fragile resource usage frequency carries out unified limitation management in system, when system calls the fragile resource, can Speed is called to slow down, so that the fragile resource will not occur exception.
Further, implementing as method shown in Fig. 2, embodiments provides another kind of point The configuration device of resource in cloth system, as shown in figure 4, described device includes:Receiving unit 41, acquisition Unit 42, judging unit 43, transmitting element 44.
The receiving unit 41, can be used for receiving resource acquisition request, carry in the resource acquisition request There is the identification information of the resource of requestor requests.
The acquiring unit 42, can be used for from preset storage location obtaining and the reception of the receiving unit 41 Monitoring resource information corresponding to identification information.
The judging unit 43, can be used for judging whether is monitoring resource information that the acquiring unit 42 obtains Meet preset restrictive condition, the identification information difference that the preset storage location preserves different resource is corresponding Monitoring resource information and resource information.
The transmitting element 44, if can be used for the judging unit 43 judges the monitoring resource information symbol The preset restrictive condition is closed, then sends resource information corresponding to the identification information to the requesting party.
The transmitting element 44, if being additionally operable to the judging unit 43 judges that the monitoring resource information is not inconsistent The preset restrictive condition is closed, then sends request failure response information to the requesting party.
Alternatively, the monitoring resource information includes request number of times of the resource information within preset time period.
Further, described device also includes:Confirmation unit 45.
The judging unit 43, specifically can be used for judging the resource information corresponding with the identification information pre- The request number of times in the time period is put whether more than or equal to preset times.
The confirmation unit 45, if judging the money corresponding with the identification information for the judging unit 43 Request number of times of the source information within preset time period is less than the preset times, then confirm to meet the preset limit Condition processed.
The confirmation unit 45, if be additionally operable to the judging unit 43 judge it is corresponding with the identification information Request number of times of the resource information within preset time period is more than or equal to the preset times, then confirm not meeting The preset restrictive condition.
Alternatively, the monitoring resource information also includes the correspondence of request each time that the asset information receipt is arrived Timestamp.
The judging unit 43, specifically can be also used for judging that the resource information corresponding with the identification information exists Whether the timestamp number received in preset time period is more than or equal to predetermined number.
It should be noted that in another kind of distributed system provided in an embodiment of the present invention resource configuration device Other corresponding descriptions of involved each functional unit, may be referred to the correspondence description of Fig. 2, will not be described here.
The configuration device of resource, receives first resource in another kind of distributed system provided in an embodiment of the present invention Request is obtained, the identification information of the resource of requestor requests is carried in the resource acquisition request;Then from Preset storage location obtains the monitoring resource information corresponding with the identification information and judges the monitoring resource letter Whether breath meets preset restrictive condition, and the preset storage location preserves the identification information difference of different resource Corresponding monitoring resource information and resource information;If meeting the preset restrictive condition, to the requesting party Send resource information corresponding to the identification information.With at present for resource using unrestricted mode compared with, Whether the present invention meets preset restrictive condition by judgement monitoring resource information corresponding with resource acquisition request, If meeting, resource information is sent to requesting party, if not meeting, to requesting party request failure response information is sent, And then can realize to the resource in distributed system using being effectively controlled, it is ensured that distributed system Stablize, it is to avoid excessively the using to resource in stipulated time section, it is possible to achieve to distributed system Fragile resource usage frequency carries out unified limitation management in system, when system calls the fragile resource, can Speed is called to slow down, so that the fragile resource will not occur exception.
Through the above description of the embodiments, those skilled in the art can be understood that this It is bright to add the mode of required common hardware to realize by software, naturally it is also possible to by hardware, but a lot In the case of the former be more preferably embodiment.Based on such understanding, technical scheme substantially or Person says that the part contributed to prior art can be embodied in the form of software product, and the computer is soft Part product is stored in the storage medium that can read, such as the floppy disk of computer, hard disk or CD etc., if including Dry instruction is used so that a computer equipment (can be personal computer, server, or the network equipment Deng) perform method described in each embodiment of the invention.
The above, the only specific embodiment of the present invention, but protection scope of the present invention is not limited to This, any those familiar with the art the invention discloses technical scope in, can readily occur in Change or replacement, all should be included within the scope of the present invention.Therefore, protection scope of the present invention should It is defined by the scope of the claims.

Claims (10)

1. in a kind of distributed system resource collocation method, it is characterised in that include:
Resource acquisition request is received, the mark of the resource of requestor requests is carried in the resource acquisition request Information;
The monitoring resource information corresponding with the identification information is obtained from preset storage location and judge the resource Whether monitoring information meets preset restrictive condition, and the preset storage location preserves the mark letter of different resource The corresponding monitoring resource information of breath difference and resource information;
If meeting the preset restrictive condition, to the requesting party resource corresponding to the identification information is sent Information.
2. in distributed system according to claim 1 resource collocation method, it is characterised in that institute Stating method also includes:
If not meeting the preset restrictive condition, to the requesting party request failure response information is sent.
3. in distributed system according to claim 1 resource collocation method, it is characterised in that institute Monitoring resource information is stated including request number of times of the resource information within preset time period, described in the judgement Whether monitoring resource information meets preset restrictive condition includes:
Judge whether request number of times of the resource information corresponding with the identification information within preset time period is more than Or equal to preset times;
If being less than the preset times, confirmation meets the preset restrictive condition;
If being more than or equal to the preset times, confirmation does not meet the preset restrictive condition.
4. in distributed system according to claim 3 resource collocation method, it is characterised in that institute Stating monitoring resource information also includes the corresponding timestamp of request that arrives of the asset information receipt, the judgement with Whether request number of times of resource information corresponding to the identification information within preset time period be more than or equal to default Number of times includes:
Judge the timestamp number that the resource information corresponding with the identification information is received within preset time period Whether predetermined number is more than or equal to.
5. in distributed system according to claim 4 resource collocation method, it is characterised in that institute State and judge that the timestamp number that the resource information corresponding with the identification information is received within preset time period is It is no more than or equal to predetermined number before, also include:
Judge in monitoring resource information corresponding to the identification information with the presence or absence of corresponding with the identification information The timestamp of resource information;
If there is no the timestamp of the resource information corresponding with the identification information, send to the requesting party Resource information corresponding to the identification information;
The timestamp of resource information corresponding to the identification information is protected in the monitoring resource information Deposit.
6. in the distributed system according to any one of claim 4-5 resource collocation method, its feature It is that methods described also includes:
Whether detect according to preset time interval in the timestamp of monitoring resource information corresponding to the identification information There is the timestamp earlier than the preset time period;
If existing, the timestamp earlier than the preset time period is deleted.
7. in a kind of distributed system resource configuration device, it is characterised in that include:
Receiving unit, for receiving resource acquisition request, carrying requesting party in the resource acquisition request please The identification information of the resource asked;
Acquiring unit, for corresponding from the identification information that preset storage location is obtained with the receiving unit is received Monitoring resource information;
Judging unit, for judging whether the monitoring resource information that the acquiring unit is obtained meets preset restriction Condition, the preset storage location is preserved the identification information of different resource and distinguishes corresponding monitoring resource information And resource information;
Transmitting element, if judging that the monitoring resource information meets the preset limit for the judging unit Condition processed, then send resource information corresponding to the identification information to the requesting party.
8. in distributed system according to claim 7 resource configuration device, it is characterised in that
The transmitting element, if being additionally operable to the judging unit judges that the monitoring resource information does not meet institute Preset restrictive condition is stated, then sends request failure response information to the requesting party.
9. in distributed system according to claim 7 resource configuration device, it is characterised in that institute Monitoring resource information is stated including request number of times of the resource information within preset time period, described device is also wrapped Include:Confirmation unit;
The judging unit, specifically for judging the resource information corresponding with the identification information in preset time Whether the request number of times in section is more than or equal to preset times;
The confirmation unit, if judging the resource letter corresponding with the identification information for the judging unit Request number of times of the breath within preset time period is less than the preset times, then confirm to meet the preset restriction bar Part;
The confirmation unit, if being additionally operable to the judging unit judges the resource corresponding with the identification information Request number of times of the information within preset time period is more than or equal to the preset times, then confirmation does not meet described Preset restrictive condition.
10. in distributed system according to claim 9 resource configuration device, it is characterised in that The monitoring resource information also includes the corresponding timestamp of request that the asset information receipt is arrived,
The judging unit, is specifically additionally operable to judge the resource information corresponding with the identification information when preset Between the timestamp number that receives in section whether more than or equal to predetermined number.
CN201510679864.5A 2015-10-19 2015-10-19 Configuration method and device for resources in distributed system Pending CN106598723A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510679864.5A CN106598723A (en) 2015-10-19 2015-10-19 Configuration method and device for resources in distributed system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510679864.5A CN106598723A (en) 2015-10-19 2015-10-19 Configuration method and device for resources in distributed system

Publications (1)

Publication Number Publication Date
CN106598723A true CN106598723A (en) 2017-04-26

Family

ID=58554855

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510679864.5A Pending CN106598723A (en) 2015-10-19 2015-10-19 Configuration method and device for resources in distributed system

Country Status (1)

Country Link
CN (1) CN106598723A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108040266A (en) * 2017-12-06 2018-05-15 深圳市雷鸟信息科技有限公司 Abnormality eliminating method, device and the storage medium of data synchronization
CN108491301A (en) * 2018-02-01 2018-09-04 平安科技(深圳)有限公司 Electronic device, the abnormity early warning method based on redis and storage medium
CN110120941A (en) * 2019-04-16 2019-08-13 石化盈科信息技术有限责任公司 A kind of single-point logging method based on cloud service

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1929477A (en) * 2005-09-08 2007-03-14 中兴通讯股份有限公司 Control system and method for multicast business limited access
CN101674293A (en) * 2008-09-11 2010-03-17 阿里巴巴集团控股有限公司 Method and system for processing abnormal request in distributed application
CN102483793A (en) * 2009-09-09 2012-05-30 株式会社东芝 Access Control System, Device, And Program
CN102833268A (en) * 2012-09-17 2012-12-19 福建星网锐捷网络有限公司 Method, equipment and system for resisting wireless network flooding attack
CN102866909A (en) * 2012-08-27 2013-01-09 北京奇虎科技有限公司 Resource lock system and method for controlling interface resource access
CN103442018A (en) * 2013-09-17 2013-12-11 网宿科技股份有限公司 Dynamic defense method and system for CC (Challenge Collapsar) attack
CN103905234A (en) * 2012-12-28 2014-07-02 北京友友天宇系统技术有限公司 Method and system for improving resource availability in distributed system
CN104219069A (en) * 2013-05-30 2014-12-17 腾讯科技(深圳)有限公司 Access frequency control method, device and control system

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1929477A (en) * 2005-09-08 2007-03-14 中兴通讯股份有限公司 Control system and method for multicast business limited access
CN101674293A (en) * 2008-09-11 2010-03-17 阿里巴巴集团控股有限公司 Method and system for processing abnormal request in distributed application
CN102483793A (en) * 2009-09-09 2012-05-30 株式会社东芝 Access Control System, Device, And Program
CN102866909A (en) * 2012-08-27 2013-01-09 北京奇虎科技有限公司 Resource lock system and method for controlling interface resource access
CN102833268A (en) * 2012-09-17 2012-12-19 福建星网锐捷网络有限公司 Method, equipment and system for resisting wireless network flooding attack
CN103905234A (en) * 2012-12-28 2014-07-02 北京友友天宇系统技术有限公司 Method and system for improving resource availability in distributed system
CN104219069A (en) * 2013-05-30 2014-12-17 腾讯科技(深圳)有限公司 Access frequency control method, device and control system
CN103442018A (en) * 2013-09-17 2013-12-11 网宿科技股份有限公司 Dynamic defense method and system for CC (Challenge Collapsar) attack

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108040266A (en) * 2017-12-06 2018-05-15 深圳市雷鸟信息科技有限公司 Abnormality eliminating method, device and the storage medium of data synchronization
CN108491301A (en) * 2018-02-01 2018-09-04 平安科技(深圳)有限公司 Electronic device, the abnormity early warning method based on redis and storage medium
CN108491301B (en) * 2018-02-01 2021-07-16 平安科技(深圳)有限公司 Electronic device, abnormality early warning method based on redis and storage medium
CN110120941A (en) * 2019-04-16 2019-08-13 石化盈科信息技术有限责任公司 A kind of single-point logging method based on cloud service

Similar Documents

Publication Publication Date Title
US11595792B2 (en) System and method for triggering on platform usage
EP2563062B1 (en) Long connection management apparatus and link resource management method for long connection communication
US20080263626A1 (en) Method and system for logging a network communication event
WO2005124554B1 (en) Two-stage network device configuration process
CN104219069B (en) access frequency control method, device and control system
KR102567900B1 (en) Method and Apparatus for Ensuring Continuous Device Operational Stability in Cloud Degraded Mode
CN106778260A (en) Attack detection method and device
CN106598723A (en) Configuration method and device for resources in distributed system
CN110474963A (en) A kind of resource access method based on zookeeper, system, medium and electronic equipment
CN107797859A (en) A kind of dispatching method of timed task and a kind of dispatch server
CN110113187B (en) Configuration updating method and device, configuration server and configuration system
CN101896917B (en) Method for moving rights object and method for managing rights of issuing rights object and system thereof
CN114760121B (en) Access frequency control method and access frequency control system
CN106411819A (en) Method and apparatus for recognizing proxy Internet protocol address
CN104363257B (en) A kind of user interface data method for refreshing and equipment
CN110351208A (en) A kind of message forwarding method, device, equipment and computer readable storage medium
CN103490964B (en) A kind of method and device for realizing that flexible configuration terminal accesses quantity
CN111339460B (en) Data updating method, device, computer equipment and storage medium
CN109995889B (en) Method and device for updating mapping relation table, gateway equipment and storage medium
CN109510730A (en) Distributed system and its monitoring method, device, electronic equipment and storage medium
CN110008681A (en) Access control method, equipment and system
CN106878247B (en) Attack identification method and device
CN105262757A (en) Data access method on the basis of IP protection
CN101854267B (en) Statistical method in content distribution, content distribution equipment and system
CN118890217B (en) Information processing method and device

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
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 100083 No. 401, 4th Floor, Haitai Building, 229 North Fourth Ring Road, Haidian District, Beijing

Applicant after: Beijing Guoshuang Technology Co.,Ltd.

Address before: 100086 Cuigong Hotel, 76 Zhichun Road, Shuangyushu District, Haidian District, Beijing

Applicant before: Beijing Guoshuang Technology Co.,Ltd.

RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20170426