CN107911470B - Distributed dynamic load-balancing method calculates equipment and computer storage medium - Google Patents

Distributed dynamic load-balancing method calculates equipment and computer storage medium Download PDF

Info

Publication number
CN107911470B
CN107911470B CN201711240171.1A CN201711240171A CN107911470B CN 107911470 B CN107911470 B CN 107911470B CN 201711240171 A CN201711240171 A CN 201711240171A CN 107911470 B CN107911470 B CN 107911470B
Authority
CN
China
Prior art keywords
service request
load balancing
uri
name space
configuration strategy
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.)
Active
Application number
CN201711240171.1A
Other languages
Chinese (zh)
Other versions
CN107911470A (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.)
Shenzhen Zhangyue Animation Technology Co ltd
Original Assignee
Zhangyue 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 Zhangyue Technology Co Ltd filed Critical Zhangyue Technology Co Ltd
Priority to CN201711240171.1A priority Critical patent/CN107911470B/en
Publication of CN107911470A publication Critical patent/CN107911470A/en
Application granted granted Critical
Publication of CN107911470B publication Critical patent/CN107911470B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • H04L67/1004Server selection for load balancing
    • H04L67/1025Dynamic adaptation of the criteria on which the server selection is based
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
    • H04L67/61Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources taking into account QoS or priority requirements

Landscapes

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

Abstract

The invention discloses a kind of distributed dynamic load-balancing method, calculate equipment and computer storage medium.Wherein, method includes: the Notification of Changes of the real-time load balancing configuration strategy for monitoring the storage of decentralized configuration administrative center;According to the Notification of Changes, the load balancing configuration strategy after change is synchronized in memory;Service request is received, service node corresponding with the service request is determined according to the load balancing configuration strategy in memory;The service request is redirected to the service node to handle.Using this programme, service request can be routed according to the load balancing configuration strategy that dynamic updates in real time, improve the flexibility to service request routing;And avoid and low efficiency is updated to load balancing in the prior art, and after being updated to load balancing, the drawbacks of can not being routed in time according to updated load balancing to service request.

Description

Distributed dynamic load-balancing method calculates equipment and computer storage medium
Technical field
The present invention relates to field of computer technology, and in particular to a kind of distributed dynamic load-balancing method calculates equipment And computer storage medium.
Background technique
Favor of the distributed system with its powerful processing capacity and by numerous technical staff.However, due to distribution Service node number is more in system, when occurring load imbalance in distributed system, as the load of some service node is serious super negative Lotus and when leading to service node delay machine, then will affect entire distributed system performance.So need to usually pass through load balancer It realizes the load balancing to distributed system, guarantees the stability of distributed system.
Currently used distributed load equalizing method be according to the load balancing configuration strategy being stored in disk come pair Service request is routed.However, being needed using this kind of load-balancing method when being changed to load balancing configuration strategy Write operation is carried out to disk, after changing to the load balancing configuration strategy in disk, generally requires restarting load Balanced device loads load balancing configuration strategy new in disk, and then according to new load balancing configuration strategy to service request It is routed.So will be greatly reduced the update efficiency of load balancing configuration strategy using this kind of method, and can not be in real time Service request is routed according to updated load balancing configuration strategy.
Summary of the invention
In view of the above problems, the present invention is proposed to overcome the above problem in order to provide one kind or at least be partially solved The distributed dynamic load-balancing method of the above problem calculates equipment and computer storage medium.
According to an aspect of the invention, there is provided a kind of distributed dynamic load-balancing method, comprising:
The Notification of Changes of the load balancing configuration strategy of decentralized configuration administrative center storage is monitored in real time;
According to the Notification of Changes, the load balancing configuration strategy after change is synchronized in memory;
Service request is received, it is corresponding with the service request according to the load balancing configuration strategy determination in memory Service node;
The service request is redirected to the service node to handle.
According to another aspect of the present invention, a kind of calculating equipment is provided, the calculating equipment is used for in distribution The service registered in coordination system carries out health examination, wherein calculate equipment include: processor, memory, communication interface and Communication bus, the processor, the memory and the communication interface complete mutual lead to by the communication bus Letter;
The memory for storing an at least executable instruction, the executable instruction execute the processor with Lower operation:
The Notification of Changes of the load balancing configuration strategy of decentralized configuration administrative center storage is monitored in real time;
According to the Notification of Changes, the load balancing configuration strategy after change is synchronized in memory;
Service request is received, it is corresponding with the service request according to the load balancing configuration strategy determination in memory Service node;
The service request is redirected to the service node to handle.
According to a further aspect of the invention, a kind of computer storage medium is provided, in the computer storage medium It is stored with an at least executable instruction, for carrying out health examination to the service registered in distributed coordination system, this can be held Row instruction makes processor execute following operation:
The Notification of Changes of the load balancing configuration strategy of decentralized configuration administrative center storage is monitored in real time;
According to the Notification of Changes, the load balancing configuration strategy after change is synchronized in memory;
Service request is received, it is corresponding with the service request according to the load balancing configuration strategy determination in memory Service node;
The service request is redirected to the service node to handle.
Distributed dynamic load-balancing method, calculating equipment and the computer storage medium provided according to the present invention, passes through The Notification of Changes of the load balancing configuration strategy of decentralized configuration administrative center storage is monitored in real time, and according to Notification of Changes, it will Load balancing configuration strategy after change is synchronized in memory, thus can realize rapidly to load balancing configuration strategy more Newly;Also, service node corresponding with service request is determined according to the load balancing configuration strategy in memory, and business is asked It asks and is redirected to corresponding service node and is handled.Using this programme, it is equal to realize the load updated in real time according to dynamic Weighing apparatus configuration strategy routes service request, improves the flexibility to service request routing;And it avoids in the prior art Low efficiency is updated to load balancing, and after being updated to load balancing, it can not be in time according to update The drawbacks of load balancing afterwards routes service request.
The above description is only an overview of the technical scheme of the present invention, in order to better understand the technical means of the present invention, And it can be implemented in accordance with the contents of the specification, and in order to allow above and other objects of the present invention, feature and advantage can It is clearer and more comprehensible, the followings are specific embodiments of the present invention.
Detailed description of the invention
By reading the following detailed description of the preferred embodiment, various other advantages and benefits are general for this field Logical technical staff will become clear.The drawings are only for the purpose of illustrating a preferred embodiment, and is not considered as to this hair Bright limitation.And throughout the drawings, the same reference numbers will be used to refer to the same parts.In the accompanying drawings:
Fig. 1 shows the process signal of the distributed dynamic load-balancing method provided according to an embodiment of the present invention Figure;
Fig. 2 shows the processes of the distributed dynamic load-balancing method provided according to a further embodiment of the invention to show It is intended to;
Fig. 3 shows a kind of structural schematic diagram of the calculating equipment provided according to an embodiment of the present invention.
Specific embodiment
Exemplary embodiments of the present disclosure are described in more detail below with reference to accompanying drawings.Although showing this public affairs in attached drawing The exemplary embodiment opened, it being understood, however, that may be realized in various forms the disclosure without the implementation that should be illustrated here Example is limited.On the contrary, these embodiments are provided to facilitate a more thoroughly understanding of the present invention, and can be by the disclosure Range is fully disclosed to those skilled in the art.
Fig. 1 shows the process signal of the distributed dynamic load-balancing method provided according to an embodiment of the present invention Figure.As shown in Figure 1, this method comprises:
Step S110 monitors the Notification of Changes of the load balancing configuration strategy of decentralized configuration administrative center storage in real time.
Wherein, decentralized configuration administrative center is stored with load balancing configuration strategy.Pass through decentralized configuration administrative center Load balancing configuration strategy is stored convenient for improving the reliability of configuration strategy, and convenient for carrying out pipe to load balancing configuration strategy Reason and change.
Further, since the load balancing configuration strategy of decentralized configuration administrative center storage can dynamically update, becoming Corresponding Notification of Changes is generated more afterwards, then can monitor the load balancing of decentralized configuration administrative center storage in this step in real time The Notification of Changes of configuration strategy, for updated load balancing configuration strategy can be obtained in subsequent step in real time.
Specifically, the specific of the Notification of Changes of the load balancing configuration strategy of decentralized configuration administrative center storage is monitored Implementation, those skilled in the art can self-setting, include the negative of decentralized configuration administrative center storage in Notification of Changes Carry the identification information that equilibrium allocation strategy changes.Alternatively, also may include decentralized configuration in Notification of Changes in this step The detailed change details of the load balancing configuration strategy of administrative center's storage.It such as, may include that load balancing is matched in Notification of Changes The n-th part in strategy is set to have occurred change (n is the integer more than or equal to 1), and the change letter that other parts do not change Breath.
Load balancing configuration strategy after change is synchronized in memory by step S120 according to Notification of Changes.
According to the Notification of Changes in step S110, the load balancing configuration strategy after change is synchronized in memory, thus Achieve the purpose that the load balancing configuration strategy after change can be obtained in real time.
Optionally, load balancing configuration strategy after change can be synchronized in memory in such a way that full dose is synchronous. Such as, when in step S110 whenever listening to Notification of Changes, after the change for storing decentralized configuration administrative center in this step All load balancing configuration strategies be synchronized in memory.
Optionally, the load balancing configuration strategy after change can be synchronized in memory by way of increment synchronization. For example, when whenever listening to Notification of Changes, according to Notification of Changes, decentralized configuration administrative center is stored in step S110 Load balancing configuration strategy in the part changed be synchronized in memory.Synchronous number needed for being reduced using this method According to amount, synchronous efficiency is improved.
Step S130 receives service request, corresponding with service request according to the load balancing configuration strategy determination in memory Service node.
Specifically, receive service request, according to the load balancing configuration strategy stored in current memory to service request into Row parsing, determines service node corresponding with the service request according to parsing result.Optionally, when the business received When request is multiple, service corresponding with each service request is determined according to the load balancing configuration strategy in memory respectively Node.
Service request is redirected to corresponding service node and handled by step S140.
Specifically, according to the service node corresponding with service request determined in step S130, service request is reset It is handled to corresponding service node.
According to distributed dynamic load-balancing method provided in this embodiment, by monitoring decentralized configuration management in real time The Notification of Changes of the load balancing configuration strategy of central store, and according to Notification of Changes, the load balancing after change is configured into plan It is slightly synchronized in memory, so that the rapidly update to load balancing configuration strategy can be realized;Also, according to negative in memory It carries equilibrium allocation strategy and determines service node corresponding with service request, and service request is redirected to corresponding service and is saved Point is handled.Using this programme, realize in real time according to dynamic update load balancing configuration strategy to service request into Walking along the street is by improving the flexibility to service request routing;And it avoids and efficiency is updated to load balancing in the prior art It is low, and after being updated to load balancing, it can not be in time according to updated load balancing to business The drawbacks of request is routed.
Fig. 2 shows the processes of the distributed dynamic load-balancing method provided according to a further embodiment of the invention to show It is intended to.As shown in Fig. 2, this method comprises:
Step S210 monitors the Notification of Changes of the load balancing configuration strategy of decentralized configuration administrative center storage in real time.
Wherein, decentralized configuration administrative center can be the Distributed Application management coordination center based on zookeeper. After servicing online, the service discovery component in zookeeper distributed application program coordination system calls service registration automatically Interface will be in service registration to zookeeper.Also, the data store organisation of tree structure is used in zookeeper, thus The drawbacks of naming conflict occurs when being registered on zookeeper is avoided, ensure that global uniqueness.Further, work as service Node is notified that all nodes for subscribing to the service node after changing.
By the way that the reliability of configuration strategy can be improved in decentralized configuration administrative center storage load balancing configuration strategy, And convenient for load balancing configuration strategy is managed and is changed.For example, zookeeper would know that by health control mechanism The health status of each service node then can accurately be known by this decentralized configuration administrative center of zookeeper each The information of service node, consequently facilitating the load balancing configuration strategy according to the information of each service node for storage carries out Change.Such as, after a certain service node is offline, it is dynamically adjusted load balancing configuration strategy, for asking subsequent for business The offline service node is shielded when seeking distribution service node, to improve the processing speed to service request.
Specifically, it is included at least in the load balancing configuration strategy of the decentralized configuration administrative center storage in this step There are rewriting rule and/or routing rule.Wherein, for being written over replacement to service request, routing rule is used for rewriting rule Service node corresponding thereto is determined according to service request.It is further alternative, in the decentralized configuration management in this step Feel and specifically includes URI (Uniform Resource Identifier, uniform resource identifier) and name in the routing rule of storage The corresponding relationship of word space and at least one match pattern.Wherein, match pattern includes accurate match pattern, with modification Prefix matching mode, case sensitive canonical match pattern, the canonical match pattern of case-insensitive, without modification Prefix matching mode, and/or general match pattern.
Optionally, decentralized configuration administrative center is provided with connects to what rewriting rule and/or routing rule were configured Mouthful.The dynamic adjustment to rewriting rule and/or routing rule can be realized by rewriting rule and/or routing rule interface, thus Realize that the dynamic of the load balancing configuration strategy stored in decentralized configuration administrative center updates.It is further alternative, the interface It can be http interface, can be convenient for the management and update to load balancing configuration strategy using http interface, and be load balancing The visualization of configuration strategy updates operation and provides basis, can also be adapted to most production environment servers.
Since the load balancing configuration strategy of decentralized configuration administrative center storage can dynamically update, when changing, Corresponding Notification of Changes can be generated, then can monitor the load balancing configuration plan of decentralized configuration administrative center storage in this step Notification of Changes slightly.Wherein, specific listening mode those skilled in the art can self-setting.It optionally, can in Notification of Changes The identification information only changed comprising load balancing configuration strategy, as only (T shows to bear comprising identification parameter in Notification of Changes It carries equilibrium allocation strategy to change);Alternatively, in Notification of Changes can also packet load balancing configuration strategy detailed change it is thin Section, e.g., in Notification of Changes may include in load balancing configuration strategy the n-th part have occurred change (n be it is whole more than or equal to 1 Number), and the modification information that other parts do not change.
Step S220, it is by shared drive component, the load balancing configuration strategy after change is same according to Notification of Changes Step is into memory.
Wherein, when decentralized configuration administrative center is the Distributed Application management coordination center based on zookeeper, The load balancing configuration strategy after change can be synchronized to by the qconf agent shared drive component in zookeeper In memory.By the application of shared drive component, avoidable load balancing configuration strategy is frequently heavily loaded when changing, To improve the update synchronous efficiency of load balancing configuration strategy.
Specifically, read the URI's and name space configured in decentralized configuration administrative center by shared drive component Corresponding relationship and at least one match pattern, the corresponding relationship and at least one match pattern of URI and name space is same Step is into memory.
Further, it is synchronized in memory by the corresponding relationship of URI and name space and at least one match pattern Afterwards, corresponding priority can be set for match pattern.For example, priority set-up mode as shown in Table 1 can be used, shown in table 1 Priority set-up mode in, accurate match pattern highest priority, and general match pattern priority is minimum.The present embodiment The set-up mode of middle priority includes but is not limited to the set-up mode in table 1, and those skilled in the art can be according to practical business need Self-setting is sought, the present embodiment is not construed as limiting this.
Table 1
Match pattern Priority
Accurate match pattern 1
Prefix matching mode with modification 2
Case sensitive canonical match pattern 3
The canonical match pattern of case-insensitive 4
Without the prefix matching mode of modification 5
General match pattern 6
Optionally, during the load balancing configuration strategy after change is synchronized to memory, it is synchronous that full dose can be used Mode, the load balancing configuration strategy after change is synchronized in memory.Such as, when in step S210 whenever listen to change When notice, all load balancing configuration strategies after the change for storing decentralized configuration administrative center in this step are synchronous Into memory.Alternatively, the load balancing configuration strategy after change can also be synchronized in memory by way of increment synchronization. For example, when whenever listening to Notification of Changes, according to Notification of Changes, decentralized configuration administrative center is stored in step S210 Load balancing configuration strategy in the part changed be synchronized in memory.The number of synchrodata can be reduced using this method According to amount, synchronous efficiency is improved.
Step S230 receives service request, extracts the URI information in service request, is advised according to routing stored in memory The then name space that the determining URI information with service request matches, determine the corresponding service node of the name space be with The corresponding service node of service request.
Specifically, when receiving service request, the URI information in the service request is extracted.For example, receiving When http service request, the URI field in the http request can be extracted, to obtain the URI information in the service request.
Further, according to the determining name space to match with URI information of routing rule stored in memory.Firstly, The corresponding match pattern of URI information is determined according to match pattern stored in memory and corresponding priority.Specifically, it presses According to the sequence of priority from high to low, successively matched using a match pattern in routing rule with the URI information, Until successful match, then stop matching, and the successful match pattern of current matching is determined as corresponding with the URI information Match pattern.For example, being matched first, in accordance with accurate match pattern with the URI information, if successful match, it is determined that accurate Match pattern is match pattern corresponding with the URI information;Otherwise, further according to the prefix matching mode pair with modification URI information is matched, if successful match, it is determined that with modification prefix matching mode be and the URI information corresponding With mode, to determine match pattern corresponding with the URI information using this kind of method.Secondly, URI information has been determined After corresponding match pattern, URI information is parsed according to the match pattern, and according to result after parsing and interior The URI information for depositing middle storage determines name space corresponding with the URI information with the corresponding relationship of name space.
It optionally, can also be according to memory before according to the determining name space to match with URI information of routing rule The rewriting rule of middle storage is written over the URI information in service request, the URI information after being rewritten.Optionally, URI Information can pass through one or many rewrite operations.After being written over to URI information, URI information after being rewritten, Name space corresponding with the URI information after rewriting is further then determined according to routing rule stored in memory.By right The rewriting of URI, can further specification URI format, realize pseudo- static address (i.e. by dynamic address disguise oneself as static address), and It is able to satisfy the demand that address jumps after domain name switches.
It, further will service corresponding with the name space after the name space to match with URI information has been determined Node is determined as service node corresponding with service request.
Service request is redirected to corresponding service node and handled by step S240.
According to the URI information corresponding with service request determined in step S230, in a manner of dynamic routing, by institute It states request and is redirected to the corresponding service node of the request, so that the service node handles service request.
According to distributed dynamic load-balancing method provided in this embodiment, by monitoring decentralized configuration management in real time The Notification of Changes of the load balancing configuration strategy of central store, and will be changed according to Notification of Changes by shared drive component Load balancing configuration strategy afterwards is synchronized in memory, so that the rapidly update to load balancing configuration strategy can be realized;And Service request is received, the URI information in service request is extracted, according to routing rule determination stored in memory and service request In the name space that matches of URI information, determine that the corresponding service node of the name space is clothes corresponding with service request Business node, and service request is redirected to corresponding service node and is handled.Using this programme, root in real time is realized Service request is routed according to the load balancing configuration strategy that dynamic updates, improves the flexibility to service request routing; And avoid and low efficiency is updated to load balancing in the prior art, and after being updated to load balancing, nothing The drawbacks of method in time routes service request according to updated load balancing;Also, in decentralized configuration pipe The interface configured to rewriting rule and/or routing rule is provided in reason center, thus further convenient for rewriting rule Then and/or the adjustment and management of routing rule;Moreover, the synchronization of load balancing configuration strategy is realized by shared drive component, It can further improve synchronous efficiency, the frequent heavy duty of load balancing configuration strategy avoided, to further increase router efficiency.
A kind of nonvolatile computer storage media is provided according to an embodiment of the present invention, wherein the computer Storage medium is stored with an at least executable instruction, which can be performed in above-mentioned any means embodiment Method.
Executable instruction specifically can be used for so that processor executes following operation:
The Notification of Changes of the load balancing configuration strategy of decentralized configuration administrative center storage is monitored in real time;According to described Load balancing configuration strategy after change is synchronized in memory by Notification of Changes;Service request is received, according to the institute in memory It states load balancing configuration strategy and determines service node corresponding with the service request;The service request is redirected to institute Service node is stated to be handled.
In a kind of optional embodiment, the load balancing configuration strategy is included at least: rewriting rule and/or road By rule.
In a kind of optional embodiment, the decentralized configuration administrative center is provided with to rewriting rule and/or road The interface configured by rule.
In a kind of optional embodiment, executable instruction specifically can be used for so that processor executes following operation:
The URI information in the service request is extracted, is determined according to the routing rule and is matched with the URI information Name space;Determine that the corresponding service node of the name space is service node corresponding with the service request.
In a kind of optional embodiment, executable instruction specifically can be used for so that processor executes following operation:
The URI information in the service request is written over according to the rewriting rule, the URI letter after being rewritten Breath;It is then described to determine that the name space to match with the URI information further comprises according to the routing rule: according to institute State the name space that the determining URI information with after the rewriting of routing rule matches.
In a kind of optional embodiment, executable instruction specifically can be used for so that processor executes following operation:
The load balancing configuration strategy after change is synchronized to interior according to the Notification of Changes by shared drive component In depositing.
In a kind of optional embodiment, executable instruction specifically can be used for so that processor executes following operation:
The pass corresponding with name space the URI configured in decentralized configuration administrative center is read by shared drive component System and at least one match pattern, the URI is synchronous with the corresponding relationship of name space and at least one match pattern Into memory.
In a kind of optional embodiment, executable instruction specifically can be used for so that processor executes following operation:
According to the corresponding relationship and at least one match pattern of the URI and name space, set for the match pattern Set corresponding priority.
In a kind of optional embodiment, the decentralized configuration administrative center is the distribution based on zookeeper Application management Consultation Center.
Fig. 3 shows a kind of structural schematic diagram of the calculating equipment provided according to an embodiment of the present invention, present invention tool Body embodiment does not limit the specific implementation for calculating equipment.
As shown in figure 3, the calculating equipment may include: processor (processor) 302, communication interface (Communications Interface) 304, memory (memory) 306 and communication bus 308.
Wherein: processor 302, communication interface 304 and memory 306 are completed mutual by communication bus 308 Communication.Communication interface 304, for being communicated with the network element of other equipment such as client or other servers etc..Processor 302, For executing program 310, the correlation step in above method embodiment can be specifically executed.
Program 310 specifically can be used for so that processor 302 executes following operation:
The Notification of Changes of the load balancing configuration strategy of decentralized configuration administrative center storage is monitored in real time;
According to the Notification of Changes, the load balancing configuration strategy after change is synchronized in memory;
Service request is received, it is corresponding with the service request according to the load balancing configuration strategy determination in memory Service node;
The service request is redirected to the service node to handle.
In a kind of optional embodiment, the load balancing configuration strategy is included at least: rewriting rule and/or road By rule.
In a kind of optional embodiment, the decentralized configuration administrative center is provided with to rewriting rule and/or road The interface configured by rule.
In a kind of optional embodiment, program 310 specifically can be used for so that processor 302 executes following operation:
The URI information in the service request is extracted, is determined according to the routing rule and is matched with the URI information Name space;Determine that the corresponding service node of the name space is service node corresponding with the service request.
In a kind of optional embodiment, program 310 specifically can be used for so that processor 302 executes following operation:
The URI information in the service request is written over according to the rewriting rule, the URI letter after being rewritten Breath;It is then described to determine that the name space to match with the URI information further comprises according to the routing rule: according to institute State the name space that the determining URI information with after the rewriting of routing rule matches.
In a kind of optional embodiment, program 310 specifically can be used for so that processor 302 executes following operation:
The load balancing configuration strategy after change is synchronized to interior according to the Notification of Changes by shared drive component In depositing.
In a kind of optional embodiment, program 310 specifically can be used for so that processor 302 executes following operation:
The pass corresponding with name space the URI configured in decentralized configuration administrative center is read by shared drive component System and at least one match pattern, the URI is synchronous with the corresponding relationship of name space and at least one match pattern Into memory.
In a kind of optional embodiment, program 310 specifically can be used for so that processor 302 executes following operation:
According to the corresponding relationship and at least one match pattern of the URI and name space, set for the match pattern Set corresponding priority.
In a kind of optional embodiment, the decentralized configuration administrative center is the distribution based on zookeeper Application management Consultation Center.
Algorithm and display are not inherently related to any particular computer, virtual system, or other device provided herein. Various general-purpose systems can also be used together with teachings based herein.As described above, it constructs required by this kind of system Structure be obvious.In addition, the present invention is also not directed to any particular programming language.It should be understood that can use various Programming language realizes summary of the invention described herein, and the description done above to language-specific is to disclose this The preferred forms of invention.
In the instructions provided here, numerous specific details are set forth.It is to be appreciated, however, that implementation of the invention Example can be practiced without these specific details.In some instances, well known method, knot is not been shown in detail Structure and technology, so as not to obscure the understanding of this specification.
Similarly, it should be understood that in order to simplify the disclosure and help to understand one or more of the various inventive aspects, In the above description of the exemplary embodiment of the present invention, each feature of the invention is grouped together into single reality sometimes It applies in example, figure or descriptions thereof.However, the disclosed method should not be interpreted as reflecting the following intention: being wanted Ask protection the present invention claims features more more than feature expressly recited in each claim.More precisely, such as As following claims reflect, inventive aspect is all features less than single embodiment disclosed above. Therefore, it then follows thus claims of specific embodiment are expressly incorporated in the specific embodiment, wherein each right It is required that itself is all as a separate embodiment of the present invention.
Those skilled in the art will understand that adaptivity can be carried out to the module in the equipment in embodiment Ground changes and they is arranged in one or more devices different from this embodiment.It can be the module in embodiment Or unit or assembly is combined into a module or unit or component, and furthermore they can be divided into multiple submodule or sons Unit or sub-component.It, can be with other than such feature and/or at least some of process or unit exclude each other Using any combination to all features disclosed in this specification (including adjoint claim, abstract and attached drawing) and such as All process or units of any method or apparatus of the displosure are combined.Unless expressly stated otherwise, this specification Each feature disclosed in (including the accompanying claims, abstract and drawings) can be by providing identical, equivalent, or similar mesh Alternative features replace.
In addition, it will be appreciated by those of skill in the art that although some embodiments described herein include other embodiments In included certain features rather than other feature, but the combination of the feature of different embodiments means in the present invention Within the scope of and form different embodiments.For example, in the following claims, embodiment claimed It is one of any can in any combination mode come using.
It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and this Field technical staff can be designed alternative embodiment without departing from the scope of the appended claims.In claim In, any reference symbol between parentheses should not be configured to limitations on claims.Word "comprising" is not excluded for depositing In element or step not listed in the claims.Word "a" or "an" located in front of the element does not exclude the presence of multiple Such element.The present invention can be by means of including the hardware of several different elements and by means of properly programmed calculating Machine is realized.In the unit claims listing several devices, several in these devices can be by same Hardware branch embodies.The use of word first, second, and third does not indicate any sequence.It can be by these word solutions It is interpreted as title.
The invention discloses: a kind of distributed dynamic load-balancing method of A1., comprising:
The Notification of Changes of the load balancing configuration strategy of decentralized configuration administrative center storage is monitored in real time;
According to the Notification of Changes, the load balancing configuration strategy after change is synchronized in memory;
Service request is received, it is corresponding with the service request according to the load balancing configuration strategy determination in memory Service node;
The service request is redirected to the service node to handle.
A2. method according to a1, wherein the load balancing configuration strategy includes at least: rewriting rule and/or Routing rule.
A3. the method according to A2, wherein the decentralized configuration administrative center be provided with to rewriting rule and/or The interface that routing rule is configured.
A4. the method according to any one of A2 or A3, wherein the load balancing according in memory is matched It sets strategy and determines that service node corresponding with the service request further comprises:
The URI information in the service request is extracted, is determined according to the routing rule and is matched with the URI information Name space;
Determine that the corresponding service node of the name space is service node corresponding with the service request.
A5. method according to a4, wherein described according to routing rule determination and the URI information phase Before the name space matched, the method also includes:
The URI information in the service request is written over according to the rewriting rule, the URI letter after being rewritten Breath;
It is then described to determine that the name space to match with the URI information further comprises according to the routing rule:
The name space to be matched according to the determining URI information with after the rewriting of the routing rule.
A6. according to the described in any item methods of A1-A5, wherein it is described according to the Notification of Changes, it will be negative after change Carrying equilibrium allocation policy synchronization to memory further comprises:
The load balancing configuration strategy after change is synchronized to interior according to the Notification of Changes by shared drive component In depositing.
A7. the method according to A6, wherein the load balancing configuration strategy by after change is synchronized in memory Further comprise:
The pass corresponding with name space the URI configured in decentralized configuration administrative center is read by shared drive component System and at least one match pattern, the URI is synchronous with the corresponding relationship of name space and at least one match pattern Into memory.
A8. the method according to A7, wherein the method also includes:
According to the corresponding relationship and at least one match pattern of the URI and name space, set for the match pattern Set corresponding priority.
A9. according to the described in any item methods of A1-A8, wherein the decentralized configuration administrative center be based on The Distributed Application management coordination center of zookeeper.
The invention also discloses: a kind of calculating equipment of B10., the calculating equipment includes: processor, memory, communication Interface and communication bus, the processor, the memory and the communication interface are completed mutual by the communication bus Communication;
The memory for storing an at least executable instruction, the executable instruction execute the processor with Lower operation:
The Notification of Changes of the load balancing configuration strategy of decentralized configuration administrative center storage is monitored in real time;
According to the Notification of Changes, the load balancing configuration strategy after change is synchronized in memory;
Service request is received, it is corresponding with the service request according to the load balancing configuration strategy determination in memory Service node;
The service request is redirected to the service node to handle.
B11. calculating equipment according to b10, wherein the load balancing configuration strategy includes at least: rewriting rule And/or routing rule.
B12. the calculating equipment according to B11, wherein the decentralized configuration administrative center, which is provided with, advises rewriting Then and/or the interface that is configured of routing rule.
B13. the calculating equipment according to any one of B11 or B12, wherein the executable instruction further makes institute It states processor and executes following operation:
The URI information in the service request is extracted, is determined according to the routing rule and is matched with the URI information Name space;
Determine that the corresponding service node of the name space is service node corresponding with the service request.
B14. calculating equipment according to b13, wherein the executable instruction further executes the processor It operates below:
The URI information in the service request is written over according to the rewriting rule, the URI letter after being rewritten Breath;
It is then described to determine that the name space to match with the URI information further comprises according to the routing rule:
The name space to be matched according to the determining URI information with after the rewriting of the routing rule.
B15. according to the described in any item calculating equipment of B10-B14, wherein the executable instruction further makes described Processor executes following operation:
The load balancing configuration strategy after change is synchronized to interior according to the Notification of Changes by shared drive component In depositing.
B16. the calculating equipment according to B15, wherein the executable instruction further executes the processor It operates below:
The pass corresponding with name space the URI configured in decentralized configuration administrative center is read by shared drive component System and at least one match pattern, the URI is synchronous with the corresponding relationship of name space and at least one match pattern Into memory.
B17. the calculating equipment according to B16, wherein the executable instruction further executes the processor It operates below:
According to the corresponding relationship and at least one match pattern of the URI and name space, set for the match pattern Set corresponding priority.
B18. according to the described in any item calculating equipment of B10-B17, wherein the decentralized configuration administrative center is base In the Distributed Application management coordination center of zookeeper.
The invention also discloses a kind of C19. computer storage medium, it is stored at least in the computer storage medium One executable instruction, the executable instruction make processor execute following operation:
The Notification of Changes of the load balancing configuration strategy of decentralized configuration administrative center storage is monitored in real time;
According to the Notification of Changes, the load balancing configuration strategy after change is synchronized in memory;
Service request is received, it is corresponding with the service request according to the load balancing configuration strategy determination in memory Service node;
The service request is redirected to the service node to handle.
C20. the computer storage medium according to C19, wherein the load balancing configuration strategy includes at least: weight Write rule and/or routing rule.
C21. the computer storage medium according to C20, wherein the decentralized configuration administrative center is provided with pair The interface that rewriting rule and/or routing rule are configured.
C22. the computer storage medium according to any one of C20 or C21, wherein the executable instruction is into one Step makes the processor execute following operation:
The URI information in the service request is extracted, is determined according to the routing rule and is matched with the URI information Name space;
Determine that the corresponding service node of the name space is service node corresponding with the service request.
C23. the computer storage medium according to C22, wherein the executable instruction further makes the processing Device executes following operation:
The URI information in the service request is written over according to the rewriting rule, the URI letter after being rewritten Breath;
It is then described to determine that the name space to match with the URI information further comprises according to the routing rule:
The name space to be matched according to the determining URI information with after the rewriting of the routing rule.
C24. according to the described in any item computer storage mediums of C19-C23, wherein the executable instruction is further The processor is set to execute following operation:
The load balancing configuration strategy after change is synchronized to interior according to the Notification of Changes by shared drive component In depositing.
C25. the computer storage medium according to C24, wherein the executable instruction further makes the processing Device executes following operation:
The pass corresponding with name space the URI configured in decentralized configuration administrative center is read by shared drive component System and at least one match pattern, the URI is synchronous with the corresponding relationship of name space and at least one match pattern Into memory.
C26. the computer storage medium according to C25, wherein the executable instruction further makes the processing Device executes following operation:
According to the corresponding relationship and at least one match pattern of the URI and name space, set for the match pattern Set corresponding priority.
C27. according to the described in any item computer storage mediums of C19-C26, wherein in the decentralized configuration management The heart is the Distributed Application management coordination center based on zookeeper.

Claims (21)

1. a kind of distributed dynamic load-balancing method, comprising:
The Notification of Changes of the load balancing configuration strategy of decentralized configuration administrative center storage is monitored in real time;
The load balancing configuration strategy after change is synchronized in memory by shared drive component according to the Notification of Changes; Wherein, by shared drive component read the corresponding relationship of URI and name space configured in decentralized configuration administrative center with And at least one match pattern, the corresponding relationship and at least one match pattern of the URI and name space are synchronized to interior In depositing;
Service request is received, service corresponding with the service request is determined according to the load balancing configuration strategy in memory Node;
The service request is redirected to the service node to handle.
2. according to the method described in claim 1, wherein, the load balancing configuration strategy includes at least: rewriting rule and/or Routing rule.
3. according to the method described in claim 2, wherein, the decentralized configuration administrative center be provided with to rewriting rule and/ Or the interface that routing rule is configured.
4. according to the method described in claim 2, wherein, the load balancing configuration strategy according in memory determine with The corresponding service node of the service request further comprises:
The URI information in the service request is extracted, according to the determining name to match with the URI information of the routing rule Space;
Determine that the corresponding service node of the name space is service node corresponding with the service request.
5. according to the method described in claim 4, wherein, described according to the routing rule is determining and the URI information phase Before matched name space, the method also includes:
The URI information in the service request is written over according to the rewriting rule, the URI information after being rewritten;
It is then described to determine that the name space to match with the URI information further comprises according to the routing rule:
The name space to be matched according to the determining URI information with after the rewriting of the routing rule.
6. method according to any one of claims 1-5, wherein the method also includes:
According to the corresponding relationship and at least one match pattern of the URI and name space, phase is set for the match pattern The priority answered.
7. method according to any one of claims 1-5, wherein the decentralized configuration administrative center be based on The Distributed Application management coordination center of zookeeper.
8. a kind of calculating equipment, the calculating equipment includes: processor, memory, communication interface and communication bus, the processing Device, the memory and the communication interface complete mutual communication by the communication bus;
The memory makes the processor execute following behaviour for storing an at least executable instruction, the executable instruction Make:
The Notification of Changes of the load balancing configuration strategy of decentralized configuration administrative center storage is monitored in real time;
The load balancing configuration strategy after change is synchronized in memory by shared drive component according to the Notification of Changes; Wherein, by shared drive component read the corresponding relationship of URI and name space configured in decentralized configuration administrative center with And at least one match pattern, the corresponding relationship and at least one match pattern of the URI and name space are synchronized to interior In depositing;
Service request is received, service corresponding with the service request is determined according to the load balancing configuration strategy in memory Node;
The service request is redirected to the service node to handle.
9. calculating equipment according to claim 8, wherein the load balancing configuration strategy includes at least: rewriting rule And/or routing rule.
10. calculating equipment according to claim 9, wherein the decentralized configuration administrative center, which is provided with, advises rewriting Then and/or the interface that is configured of routing rule.
11. calculating equipment according to claim 9, wherein the executable instruction further executes the processor It operates below:
The URI information in the service request is extracted, according to the determining name to match with the URI information of the routing rule Space;
Determine that the corresponding service node of the name space is service node corresponding with the service request.
12. calculating equipment according to claim 11, wherein the executable instruction further executes the processor It operates below:
The URI information in the service request is written over according to the rewriting rule, the URI information after being rewritten;
It is then described to determine that the name space to match with the URI information further comprises according to the routing rule:
The name space to be matched according to the determining URI information with after the rewriting of the routing rule.
13. the calculating equipment according to any one of claim 8-12, wherein the executable instruction further makes described Processor executes following operation:
According to the corresponding relationship and at least one match pattern of the URI and name space, phase is set for the match pattern The priority answered.
14. the calculating equipment according to any one of claim 8-12, wherein the decentralized configuration administrative center is base In the Distributed Application management coordination center of zookeeper.
15. a kind of computer storage medium, it is stored with an at least executable instruction in the computer storage medium, it is described to hold Row instruction makes processor execute following operation:
The Notification of Changes of the load balancing configuration strategy of decentralized configuration administrative center storage is monitored in real time;
The load balancing configuration strategy after change is synchronized in memory by shared drive component according to the Notification of Changes; Wherein, by shared drive component read the corresponding relationship of URI and name space configured in decentralized configuration administrative center with And at least one match pattern, the corresponding relationship and at least one match pattern of the URI and name space are synchronized to interior In depositing;
Service request is received, service corresponding with the service request is determined according to the load balancing configuration strategy in memory Node;
The service request is redirected to the service node to handle.
16. computer storage medium according to claim 15, wherein the load balancing configuration strategy includes at least: Rewriting rule and/or routing rule.
17. computer storage medium according to claim 16, wherein the decentralized configuration administrative center is provided with pair The interface that rewriting rule and/or routing rule are configured.
18. computer storage medium according to claim 16, wherein the executable instruction further makes the processing Device executes following operation:
The URI information in the service request is extracted, according to the determining name to match with the URI information of the routing rule Space;
Determine that the corresponding service node of the name space is service node corresponding with the service request.
19. computer storage medium according to claim 18, wherein the executable instruction further makes the processing Device executes following operation:
The URI information in the service request is written over according to the rewriting rule, the URI information after being rewritten;
It is then described to determine that the name space to match with the URI information further comprises according to the routing rule:
The name space to be matched according to the determining URI information with after the rewriting of the routing rule.
20. computer storage medium described in any one of 5-19 according to claim 1, wherein the executable instruction is into one Step makes the processor execute following operation:
According to the corresponding relationship and at least one match pattern of the URI and name space, phase is set for the match pattern The priority answered.
21. computer storage medium described in any one of 5-19 according to claim 1, wherein the decentralized configuration management Center is the Distributed Application management coordination center based on zookeeper.
CN201711240171.1A 2017-11-30 2017-11-30 Distributed dynamic load-balancing method calculates equipment and computer storage medium Active CN107911470B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711240171.1A CN107911470B (en) 2017-11-30 2017-11-30 Distributed dynamic load-balancing method calculates equipment and computer storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711240171.1A CN107911470B (en) 2017-11-30 2017-11-30 Distributed dynamic load-balancing method calculates equipment and computer storage medium

Publications (2)

Publication Number Publication Date
CN107911470A CN107911470A (en) 2018-04-13
CN107911470B true CN107911470B (en) 2018-12-14

Family

ID=61848266

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711240171.1A Active CN107911470B (en) 2017-11-30 2017-11-30 Distributed dynamic load-balancing method calculates equipment and computer storage medium

Country Status (1)

Country Link
CN (1) CN107911470B (en)

Families Citing this family (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108809848A (en) * 2018-05-28 2018-11-13 北京奇艺世纪科技有限公司 Load-balancing method, device, electronic equipment and storage medium
CN108965381B (en) * 2018-05-31 2023-03-21 康键信息技术(深圳)有限公司 Nginx-based load balancing implementation method and device, computer equipment and medium
CN109376013B (en) * 2018-10-11 2020-12-15 北京小米智能科技有限公司 Load balancing method and device
CN110047236B (en) * 2019-04-23 2021-01-15 万申科技股份有限公司 High-risk-level area security management method and system
CN110519388B (en) * 2019-08-30 2022-04-19 望海康信(北京)科技股份公司 Processing method and device for block chain request, electronic equipment and readable storage medium
CN112527491A (en) * 2019-09-17 2021-03-19 烽火通信科技股份有限公司 Micro-service call load balancing method and system
CN110688146A (en) * 2019-09-23 2020-01-14 凡普数字技术有限公司 Method, device and storage medium for dynamically configuring monitoring system
CN111064626B (en) * 2020-01-02 2023-05-26 广州虎牙科技有限公司 Configuration updating method, device, server and readable storage medium
CN111600930B (en) * 2020-04-09 2022-12-09 网宿科技股份有限公司 Micro-service request traffic management method, device, server and storage medium
CN111711569A (en) * 2020-06-16 2020-09-25 普元信息技术股份有限公司 System and method for realizing request dynamic routing in enterprise distributed application
CN112039710B (en) * 2020-09-02 2023-08-01 曙光信息产业(北京)有限公司 Service fault processing method, terminal equipment and readable storage medium
CN112929408A (en) * 2021-01-19 2021-06-08 郑州阿帕斯数云信息科技有限公司 Dynamic load balancing method and device
CN112905341B (en) * 2021-02-08 2024-02-23 中国工商银行股份有限公司 Method and device for continuously inheriting distributed load balancing service information
CN115065686B (en) * 2022-07-29 2024-02-27 中国工商银行股份有限公司 Configuration method, device and system of distributed load balancing system

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101394426A (en) * 2008-11-10 2009-03-25 中国网络通信集团公司 Internet service processing method and system based on network television
CN101534255A (en) * 2009-04-02 2009-09-16 福建星网锐捷网络有限公司 A method and device for realizing oriented processing of certain request
CN103491115A (en) * 2012-06-12 2014-01-01 华为软件技术有限公司 Resource dispatching method, resource dispatching device and resource dispatching system

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7761514B2 (en) * 2003-11-26 2010-07-20 International Business Machines Corporation Method and apparatus for providing dynamic group management for distributed interactive applications
CN101272389A (en) * 2008-05-27 2008-09-24 华为技术有限公司 CS communication method, system and device
CN103607305B (en) * 2013-11-26 2017-03-15 北京华胜天成科技股份有限公司 A kind of distributed network strategy implementation method and device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101394426A (en) * 2008-11-10 2009-03-25 中国网络通信集团公司 Internet service processing method and system based on network television
CN101534255A (en) * 2009-04-02 2009-09-16 福建星网锐捷网络有限公司 A method and device for realizing oriented processing of certain request
CN103491115A (en) * 2012-06-12 2014-01-01 华为软件技术有限公司 Resource dispatching method, resource dispatching device and resource dispatching system

Also Published As

Publication number Publication date
CN107911470A (en) 2018-04-13

Similar Documents

Publication Publication Date Title
CN107911470B (en) Distributed dynamic load-balancing method calculates equipment and computer storage medium
US11088900B2 (en) Configuring system resources for different reference architectures
US11882017B2 (en) Automated route propagation among networks attached to scalable virtual traffic hubs
US10797989B2 (en) Scalable virtual traffic hub interconnecting isolated networks
US11677619B2 (en) Selectable declarative requirement levels
US10999201B2 (en) Dynamic advertisement routing
CN105099988B (en) Method, access method and device and system for supporting gray scale to issue
US20200092252A1 (en) Domain name system operations implemented using scalable virtual traffic hub
CN105579965B (en) Via the client guard station resources control of provider's defining interface
US10785146B2 (en) Scalable cell-based packet processing service using client-provided decision metadata
CN107003983B (en) Configuring a network
CN102202078B (en) The method and system of a kind of multiple foreign peoples roles for configuration server field
CN108683516A (en) A kind of upgrade method of application example, device and system
US8904003B2 (en) Method and system for delegated job control across a network
US20220156129A1 (en) Method and apparatus for scaling a custom resource with custom metrics in a containerized application handling system
US20190222636A1 (en) Virtual network interface multiplexing
CN111240763A (en) Configuration updating method, device, equipment and storage medium
CN106657287A (en) Data access method and system
US20210410057A1 (en) Service Discovery Extension in a 5G Mobile Communication Network
CN107210924B (en) Method and apparatus for configuring a communication system
CN107251533A (en) The peer device being located at one for equity matching
US8935377B2 (en) Dynamic registration of listener resources for cloud services
US11601365B2 (en) Wide area networking service using provider network backbone network
CN107278365A (en) Expansible equity matching
GB2535743A (en) Configuration services

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
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20220624

Address after: 518054-13098, 13th floor, main tower of marine center, No. 59, Linhai Avenue, Qianhai Shenzhen Hong Kong cooperation zone, Shenzhen, Guangdong

Patentee after: Shenzhen ZhangYue Animation Technology Co.,Ltd.

Address before: 100124 2029e, Sihui building, Chaoyang District, Beijing

Patentee before: ZHANGYUE TECHNOLOGY Co.,Ltd.