CN110324253A - Flow control methods, device, storage medium and electronic equipment - Google Patents

Flow control methods, device, storage medium and electronic equipment Download PDF

Info

Publication number
CN110324253A
CN110324253A CN201910582567.7A CN201910582567A CN110324253A CN 110324253 A CN110324253 A CN 110324253A CN 201910582567 A CN201910582567 A CN 201910582567A CN 110324253 A CN110324253 A CN 110324253A
Authority
CN
China
Prior art keywords
node
service node
application
token
token service
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
CN201910582567.7A
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.)
Jiangsu Manyun Software Technology Co Ltd
Original Assignee
Jiangsu Manyun Software 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 Jiangsu Manyun Software Technology Co Ltd filed Critical Jiangsu Manyun Software Technology Co Ltd
Priority to CN201910582567.7A priority Critical patent/CN110324253A/en
Publication of CN110324253A publication Critical patent/CN110324253A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • H04L63/0807Network architectures or network communication protocols for network security for authentication of entities using tickets, e.g. Kerberos

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The embodiment of the present application discloses a kind of flow control methods, device, storage medium and electronic equipment.This method coordination service end executes, this method comprises: deleting the token service node of failure from service cluster belonging to token service node, and notify to the application node subscribed to if listening to the token service node failure event of the first application node access;Change the token service node freelist of the service cluster, and it is sent to the application node subscribed to, select token service node as target spoke service node according to preset rules in the token service node freelist after change for the application node subscribed to.By running technical solution provided herein, may be implemented to improve the effect of network service stability while carrying out flow control to multiple application nodes.

Description

Flow control methods, device, storage medium and electronic equipment
Technical field
The invention relates to flow control technique field more particularly to a kind of flow control methods, device, storage Jie Matter and electronic equipment.
Background technique
With the popularity of the internet, more and more users carry out information inquiry, shopping at network etc. using internet.Work as visitor When there are many number of users at family end, very big flow pressure can be caused to server-side.
Current set-up mode is mostly the scheme using single node flow control, that is, assumes there is 10 in a present cluster Platform machine, we are 10QPS (Queries Per Second, query rate per second) to every machine setting single machine current limit threshold, The current limit threshold of ideally entire cluster is just 100QPS.But every machine flow may be uneven under actual conditions It is even, it will lead to certain machines in the case that total amount does not arrive and begin to current limliting.Therefore it is only gone if limiting flow by single machine dimension It can not can accurately limit bulk flow.
In the prior art, some is specially counted by a server (Server) using total calling amount, the application All nodes all communicated with this server to determine whether can call.But, during actual use if this Server delay machine, the statistics of entire flow will be unable to carry out, and also will be unable to be carried out according to statistics total flow using all nodes The current limliting of node causes the stability of network service to receive great threat.
Summary of the invention
The embodiment of the present application provides a kind of flow control methods, device, storage medium and electronic equipment, to realize to more While a application node carries out flow control, the effect of network service stability is improved.
In a first aspect, the embodiment of the present application provides a kind of flow control methods, this method is executed by coordination service end, should Method includes:
If the token service node failure event of the first application node access is listened to, belonging to token service node The token service node of failure is deleted in service cluster, and is notified to the application node subscribed to;
The token service node freelist of the service cluster is changed, and is sent to the application node subscribed to, for institute It states the application node subscribed to and selects token service section according to preset rules in the token service node freelist after change Point is used as target spoke service node.
Further, before monitoring token service node failure event, the method also includes:
Receive the registration request of token service node;
According to the registration request of the token service node, token service node freelist is determined.
Second aspect, the embodiment of the present application provide a kind of flow control methods, and this method is executed by application node, the party Method includes:
If receiving the notice for deleting the token service node of failure, the service being locally stored is changed according to the notice The token service node freelist of cluster;
Target spoke service node is determined according to the freelist;Wherein, the target spoke service node for pair The flow of application node is monitored.
Further, target spoke service node is determined according to the freelist, comprising:
At least one standby node of selection failure token service node from freelist, and successively determination is described at least Whether one standby node can be used, if available, using available standby node as target spoke service node.
Further, the target spoke service node is used for the traffic requests reported in response to application node, if using The flow of node is more than flow threshold, then refuses the traffic requests.
The third aspect, the embodiment of the present application provide a kind of volume control device, are configured at coordination service end, the device packet It includes:
Token service knot removal module, if the token service node failure thing for listening to the access of the first application node Part then deletes the token service node of failure from service cluster belonging to token service node, and notifies to answer to what is subscribed to Use node;
Notification of Changes module for changing the token service node freelist of the service cluster, and is sent to and has ordered The application node read, for the application node subscribed to according to default rule in the token service node freelist after change Then select token service node as target spoke service node.
Fourth aspect, the embodiment of the present application provide a kind of volume control device, are configured at application node, the device packet It includes:
Freelist changes module, if for receiving the notice for deleting the token service node of failure, according to The token service node freelist for the service cluster that notice change is locally stored;
Target spoke service node determining module, for determining target spoke service node according to the freelist;Its In, the target spoke service node is for being monitored the flow of application node.
Further, the target spoke service node determining module is specifically used for:
At least one standby node of selection failure token service node from freelist, and successively determination is described at least Whether one standby node can be used, if available, using available standby node as target spoke service node.
5th aspect, the embodiment of the present application provide a kind of computer readable storage medium, are stored thereon with computer journey Sequence realizes the flow control side as described in the embodiment of the present application first aspect or second aspect when the program is run by processor Method.
6th aspect, the embodiment of the present application provide a kind of electronic equipment, including memory, processor and are stored in storage It can realize on device and when the computer program of processor operation, the processor run the computer program as the application is real Apply flow control methods described in a first aspect or second aspect.
Technical solution provided by the embodiment of the present application, if the token service node for listening to the access of the first application node loses Effect event then deletes the token service node of failure from service cluster belonging to token service node, and notice has been subscribed to Application node;The token service node freelist of the service cluster is changed, and is sent to the application node subscribed to, is supplied The application node subscribed to selects token service according to preset rules in the token service node freelist after change Node is as target spoke service node.By using technical solution provided herein, may be implemented to multiple applications While node carries out flow control, the effect of network service stability is improved.
Detailed description of the invention
Fig. 1 is the flow chart for the flow control methods that the embodiment of the present application one provides;
Fig. 2 is the flow chart for the flow control methods that the embodiment of the present application two provides;
Fig. 3 is the flow control integrated stand composition that the embodiment of the present application three provides;
Fig. 4 is the structural schematic diagram that stores on Zookeeper that the embodiment of the present application three provides;
Fig. 5 is the network communication schematic diagram that the embodiment of the present application three provides;
Fig. 6 is the structural schematic diagram for the volume control device that the embodiment of the present application four provides;
Fig. 7 is the structural schematic diagram for the volume control device that the embodiment of the present application five provides;
Fig. 8 is the structural schematic diagram for a kind of electronic equipment that the embodiment of the present application seven provides.
Specific embodiment
The application is described in further detail with reference to the accompanying drawings and examples.It is understood that this place is retouched The specific embodiment stated is used only for explaining the application, rather than the restriction to the application.It also should be noted that in order to just Part relevant to the application is illustrated only in description, attached drawing rather than entire infrastructure.
It should be mentioned that some exemplary embodiments are described as before exemplary embodiment is discussed in greater detail The processing or method described as flow chart.Although each step is described as the processing of sequence by flow chart, many of these Step can be implemented concurrently, concomitantly or simultaneously.In addition, the sequence of each step can be rearranged.When its operation The processing can be terminated when completion, it is also possible to have the additional step being not included in attached drawing.The processing can be with Corresponding to method, function, regulation, subroutine, subprogram etc..
Embodiment one
Fig. 1 is the flow chart for the flow control methods that the embodiment of the present application one provides, and the present embodiment may be adapted to application node Traffic monitoring situation, this method can the volume control device as provided by the embodiment of the present application third aspect operation, the dress Setting can be realized by the mode of software and/or hardware, and can be integrated in the electronic equipments such as coordination service device.
As shown in Figure 1, the flow control methods include:
If S110, the token service node failure event for listening to the access of the first application node, from token service node The token service node of failure is deleted in affiliated service cluster, and is notified to the application node subscribed to.
Wherein, monitoring movement can be is performed by coordination service end, the specific can be that coordination service device (Zookeeper) Lai Zhihang.It in the present embodiment, can be by being that application node carries out traffic monitoring clothes in token service node When business, by adding coordination service end, and by token service node clustering management, to guarantee that the network of application node accesses shape State is stable.
Wherein, token service node (Token Server) can be in the flow acquisition request for receiving application node When, according to the relationship between the total flow of the application node and pre-set flow threshold, if total stream of the application node Amount is more than flow threshold, then the application node is forbidden to carry out network access;If the total flow of the application node is less than flow Threshold value then returns to the application node token (Token), for carrying out network access for the application node.
Specifically, coordination service end can determine whether there is the token service node to work by listening mode Whether failure event is occurred, wherein a token service node can correspond to a token server, and failure event may include Situations such as delay machine of token server.It, can be with if listening to the token service node failure event of the first application node access Freelist in service cluster belonging to the token service node is changed, the token service node of the failure is such as deleted Network address.Wherein, cluster can be pre-designed, be answered for one by two or more token service range of nodes Use node.
In the present embodiment, optionally, before monitoring token service node failure event, the method also includes: it connects Receive the registration request of token service node;According to the registration request of the token service node, determine that token service node is available List.Wherein, token service node can be is registered at coordination service end in advance, can by the letter of token service node Breath is registered on coordination service end, and coordination service end can be determined according to the information of the registration to therein some or all of Token service node carries out clustering processing, in the present embodiment, in each cluster may include at least two token service sections Point, in order to wherein one can not work normally after, by other token service nodes replace its work, can guarantee to answer in this way With the normal access network of program.
In the present embodiment, the mistake of token service node preferentially can be carried out at coordination service end after application node starting The subscription of event message is imitated, thus can be after the generation of token service node failure event, it, will according to the subscribing mechanism of message The token service node failure event message is sent to the application node subscribed to.Wherein, it is preferred that for each token service For node cluster, message informing can be carried out for the application node that it is serviced, the benefit being arranged in this way is can be for this Service cluster notifies the application node serviced to it after token service node failure event in time.
The token service node freelist of S120, the change service cluster, and it is sent to the application node subscribed to, For the application node subscribed to according to preset rules selection token clothes in the token service node freelist after change Node be engaged in as target spoke service node.
After the generation of token service node failure event, the token service node available column of service cluster can be first changed Table.The network address that specific change can be the token service node that will be failed in the freelist is deleted.Change available column After table, the freelist after the change can be sent to the application node that the service cluster is serviced.In the present embodiment, excellent Choosing, service node can locally save the freelist.The benefit being arranged in this way be once coordination service end delay machine, can be with Guarantee that subsequent applications node can complete the switching of token service node according to the freelist of itself storage.
In the present embodiment, the token service node in freelist can be selected according to preset rules, wherein specific Can be determined by the way of poll, such as script first token service node damage, then can be deleted, Successively whether second of determining script can be used with third token service node, if second token service node is available, Target spoke service node is determined it as, if second token service node is unavailable, may further determine that third Whether token service node can be used, if available, third token service node is determined as target spoke service node, if It is unavailable, and there is no other token service nodes in current service cluster, then application node can not then continue to access network.
Technical solution provided by the present embodiment, if listening to the token service node failure thing of the first application node access Part then deletes the token service node of failure from service cluster belonging to token service node, and notifies to answer to what is subscribed to Use node;The token service node freelist of the service cluster is changed, and is sent to the application node subscribed to, for described The application node subscribed to selects token service node according to preset rules in the token service node freelist after change As target spoke service node.By using technical solution provided herein, may be implemented to multiple application nodes While carrying out flow control, the effect of network service stability is improved.
Embodiment two
Fig. 2 is the flow chart for the flow control methods that the embodiment of the present application two provides, and the present embodiment may be adapted to application node Traffic monitoring situation, this method can the volume control device as provided by the embodiment of the present application fourth aspect operation, the dress Setting can be realized by the mode of software and/or hardware, and can be integrated in the electronics such as intelligent terminal with respective application node In equipment.
As shown in Fig. 2, the flow control methods include:
If S210, receiving the notice for deleting the token service node of failure, it is locally stored according to notice change Service cluster token service node freelist.
Wherein, application node can be before the network that accesses, and token is obtained first from token service node, if Token service node finds that the flow of the application node has arrived at flow threshold, then can refuse as application node granting order Board is controlled with the flow to application node.But since token service node during the work time inevitably can be due to some There is a situation where delay machines etc. can not work normally for special reason, if in this case, without other token service sections Point replaces its work, then will lead to application node can not carry out the phenomenon that normal network accesses.Therefore, this programme passes through By at least two token service design of node at a cluster, and Design coordination server-side, token is taken by coordination service end The failure event of business node is monitored, and after listening to token service node failure event, the message of the failure is led to The application node for knowing the serving node services that give token changes the clothes that application node is locally stored for application node according to the notice The token service node freelist of business cluster.Application node can determine that there are which by the freelist after change in this way A little token service nodes can access, and avoid in the case where only designing a token service node, since token takes The case where business node delay machine causes application node that can not normally access network.
S220, target spoke service node is determined according to the freelist;Wherein, the target spoke service node is used It is monitored in the flow to application node.
Target spoke service node is determined according to the freelist, wherein can be according to the token clothes in freelist The sequence of business node, to determine target spoke service node.Wherein it is determined that after target spoke service node, it can be by token Service node is monitored the flow of the application node.
In the present embodiment, optionally, target spoke service node is determined according to the freelist, comprising: from available At least one standby node of selection failure token service node in list, and successively determine that at least one described standby node is It is no available, if available, using available standby node as target spoke service node.Wherein, if successively in determination process, It was found that some standby node is available, then it can be using the standby node as target spoke service node.If it find that all Standby node is unavailable, and application node can not access network, can carry out by other means alarm or report the information. The benefit being arranged in this way is destination node can be determined from standby node in the case where main token service node failure, with Traffic statistics and monitoring are carried out to application node, and can guarantee normal access of the application node to network.
In the present embodiment, optionally, the target spoke service node is used for the flow reported in response to application node Request refuses the traffic requests if the flow of application node is more than flow threshold.Wherein, target spoke service node can To count to all of application node using the flow of child node, and determine whether the total flow of the application node is more than stream Threshold value is measured, if so, can refuse to provide token for the application node.The benefit that the present embodiment is arranged in this way is can to switch After token service node, still the flow of application node is effectively controlled.
Technical solution provided by the present embodiment, if receiving the notice for deleting the token service node of failure, basis The token service node freelist for the service cluster that the notice change is locally stored;Target is determined according to the freelist Token service node;Wherein, the target spoke service node is for being monitored the flow of application node.By using this Technical solution provided by applying may be implemented to improve network service while carrying out flow control to multiple application nodes The effect of stability.
Embodiment three
In order to allow those skilled in the art to be more apparent from technical solution disclosed in the present application, the application is also mentioned A kind of preferred embodiment is supplied.
The present invention provides a kind of group flows of high-performance High Availabitity to control solution, for applying more piece at one In the case where point clustering deployment, the control of flow is accurately carried out to the cluster.
First, to introduce cluster flow control solution why.Assuming that having 10 machines in a present cluster, we are given Every machine setting single machine current limit threshold is 10QPS, and the current limit threshold of ideally entire cluster is just 100QPS.It is but real Border situation down-off may be uneven to every machine, will lead to certain machines in the case that total amount does not arrive and begins to limit Stream.Therefore it only goes accurately limit bulk flow if limiting by single machine dimension.And cluster flow control can be controlled accurately Make the calling total amount of entire cluster.
Second, any problem can be brought after introducing cluster flow control.Now, we specially count certain by a Server The total calling amount of a application, all nodes of the application are all communicated with this Server to determine whether can call, at this moment, I Have been found that this Server delay machine, the statistics of entire flow will be unable to carry out, also will be unable to basis using all nodes The current limliting that total flow carries out node is counted, therefore, we introduce a third party by the Server of more statistics flows of deployment High-availability cluster monitors the Server cluster of statistics flow, and when there is a Server delay machine failure, third party's cluster can be quick The variation for learning enabled node in the server cluster of statistics flow, the enabled node after variation is notified to answer to application node One is found out from enabled node with node, is communicated with this Server to determine whether can be called.
Currently, this concept of micro services is very universal in internet industry, many Internet companies all by itself Backend application is split as service unit one by one from monomer, at this point, when flow is gradually increased, for example, ticket is robbed in popular concert, Double ten is first-class, will certainly some or even certain several services be caused with very big request pressure, at this time, we can pass through Increase service node (server) to share request flow, still, we can not increase node (server) without limitation after all Carry out resistance to compression, so, it comes into being for the multi-node cluster fluidics of some service.
Currently, existing cluster flow control solution is as follows:
Ali's open source product Sentinel: Token Server concept is introduced, allows some using all nodes and one Token Server communication, when some node for having request call to apply, which reports QPS to give Token Server, Token Server decides whether to provide Token to the node according to the cluster flow control rule of configuration whether allow call request Pass through.But the scheme of separate unit Token Server can not be provided normally after will generating Token Server Single Point of Faliure naturally The problem of service.
The present invention increases the active and standby of more Token Server nodes and election scheduling branch on the basis of Sentinel It holds, when a certain Server delay machine, spare Server node can be switched fast, the energy for providing Token is provided application node Power avoids Single Point of Faliure, ensure that the High Availabitity of Token Server.Meanwhile application partition thought is introduced, guarantee every The high-performance treatments ability of Token Server.
Existing cluster flow control solution is to sum up have the disadvantage that:
The request flow that one Server statistics application cluster interior joint reports, there are Single Point of Faliures.That is this Server There is delay machine, will be unable to receive the requests traffic information that application node reports, can not also feed back whether application node can be adjusted As a result, will be unable to carry out normal current limliting using all nodes.
The present invention supports statistics the active and standby of flow Server to be switched fast by the system for introducing third party's High Availabitity, it is ensured that After one Server delay machine, service can be provided by cut-in stand-by Server at once, avoid the Single Point of Faliure of Server, guarantee The High Availabitity of Server.Meanwhile after application partition ideological guarantee introducing Server active and standby more piece dot pattern, single machine Server system Count high-performance when flow.
The present invention mainly includes registration center, election scheduling and network communication this three parts.The present invention is as open source product The High Availabitity high performance solution of Sentinel, is under the jurisdiction of the standalone module of Sentinel, and the module is by Sentinel SDK It relies on and introduces, when access side needs cluster flow control, need to only introduce the relevant SDK of Sentinel.
Fig. 3 is the flow control integrated stand composition that the embodiment of the present application three provides.As shown in Figure 3, wherein each Token The box of Server represents the service cluster of a Token Server.It should be understood that being wherein directed to APP1, APP2 and APP3 Table is divided to represent three application nodes, each application node includes multiple application child nodes (Node in such as figure) again.Node1, Dashed box part where Node2 etc. indicates the structure of application deployment, such as: using having Node1 and Node2 two sections in APP1 Point, using there is tri- nodes of Node3, Node4 and Node5 in APP2, APP3 has two nodes of Node1 and Node2.By Token The dotted line that Server is directed toward Zookeeper indicates Token Server registration relevant information to Zookeeper, by application node The relevant information of subscription Token Server is indicated using the dotted line that child node is directed toward Zookeeper.It is answered by Zookeeper direction With the solid line using child node of node indicate application node subscribe to information change after, Zookeeper notice application section Information after point change.The solid line for being directed toward Token Server from Zookeeper indicates that Zookeeper can be to Token Server sends some message.
Structure of the invention mainly includes registration center, election scheduling and these three parts of network communication.Wherein:
Registration center:
Registration center mainly includes following responsibility:
The registration of first, Token Server node.
When Token Server starts, itself is registered on Zookeeper, Fig. 4 is that the embodiment of the present application three provides The structural schematic diagram stored on Zookeeper.As shown in figure 4, Root Node (root node) be Sentinel, below Node be Server, one layer of Node is application name further below, for example, APP1, APP2, using being the Token specifically registered below Node The IP address of Server.
Second, Token Server failure are monitored.
When there is some Token Server node failure, registration center can be stood by Zookeeper Watcher mechanism It carves and deletes the failure node, and notify to subscribe to the application node of Token Server node.
Third, application node subscribe to Token Server registration information.
When application node starts, the node application catalogue app of Token Server registration on Zookeeper is subscribed to, as above The app1 of figure, when there is Token Server node failure under the application, Zookeeper registers the variation of Token Server node, The application node that Zookeeper notice is subscribed to, application node receive the available Token Server node column of the application after change Table and in the local cache freelist.
Election scheduling
Load balancing is carried out to the node under an application cluster, searches available a Token Server, Mei Geying With a set of Token Server cluster of correspondence, it is assumed that APP1 corresponds to a set of, and APP2 corresponds to another set of, it is assumed that No. 1 node need with One Token Server communication, it first reads local cache this apply corresponding available Token Server list, pass through Load balancing, default use sequence polling mode.So No. 1 node finds 1 in the Token Server cluster of APP1 Number node, communicates.No. 2 nodes find No. 2 nodes in the Token Server cluster of APP1 using polling mechanism, therewith Communication, similarly, the node under APP2, APP3, which can equally be found, fixes a Token Server node.Currently, load balancing Strategy also supports stochastic searching.
Network communication (RPC communication)
Fig. 5 is the network communication schematic diagram that the embodiment of the present application three provides.As shown in figure 5, being requested using APP node Token Server reports traffic requests information QPS (Request) to Token Server, Token Server to read local All node recent statistics flows under the APP in memory, summarize it is cumulative, and according to configuration this apply flow control rule meter It calculates, generates the Token that whether lets pass, return to Token to the application node, tell whether application node allows to be called.
Technical solution provided herein can realize malfunctioning node by Zookeeper and its Watcher mechanism Automatic transfer, guarantee Token Server High Availabitity.Application partition thought is introduced, guarantees the height of single-point Token Server Performance processing capacity.
Example IV
Fig. 6 is the structural schematic diagram for the volume control device that the embodiment of the present application four provides.As shown in fig. 6, the flow Control device, comprising:
Token service knot removal module 610, if the token service node for listening to the access of the first application node loses Effect event then deletes the token service node of failure from service cluster belonging to token service node, and notice has been subscribed to Application node;
Notification of Changes module 620 for changing the token service node freelist of the service cluster, and is sent to The application node of subscription, for the application node subscribed to according to default in the token service node freelist after change Rule selects token service node as target spoke service node.
Technical solution provided by the embodiment of the present application, if the token service node for listening to the access of the first application node loses Effect event then deletes the token service node of failure from service cluster belonging to token service node, and notice has been subscribed to Application node;The token service node freelist of the service cluster is changed, and is sent to the application node subscribed to, is supplied The application node subscribed to selects token service according to preset rules in the token service node freelist after change Node is as target spoke service node.By using technical solution provided herein, may be implemented to multiple applications While node carries out flow control, the effect of network service stability is improved.
The said goods can run method provided by the embodiment of the present application one, have the corresponding functional module of operation method and Beneficial effect.
Embodiment five
Fig. 7 is the structural schematic diagram for the volume control device that the embodiment of the present application five provides.As shown in fig. 7, the flow Control device, comprising:
Freelist changes module 710, if for receiving the notice for deleting the token service node of failure, according to institute State the token service node freelist for the service cluster that notice change is locally stored;
Target spoke service node determining module 720, for determining target spoke service node according to the freelist; Wherein, the target spoke service node is for being monitored the flow of application node.
Technical solution provided by the present embodiment, if receiving the notice for deleting the token service node of failure, basis The token service node freelist for the service cluster that the notice change is locally stored;Target is determined according to the freelist Token service node;Wherein, the target spoke service node is for being monitored the flow of application node.By using this Technical solution provided by applying may be implemented to improve network service while carrying out flow control to multiple application nodes The effect of stability.
Based on the above technical solution, optionally, the target spoke service node determining module is specifically used for:
At least one standby node of selection failure token service node from freelist, and successively determination is described at least Whether one standby node can be used, if available, using available standby node as target spoke service node.
The said goods can run method provided by the embodiment of the present application two, have the corresponding functional module of operation method and Beneficial effect.
Embodiment six
The embodiment of the present application also provide it is a kind of comprising computer can operating instruction storage medium, the computer can run Instruction is used to run a kind of flow control methods when being run by computer processor, this method comprises:
If the token service node failure event of the first application node access is listened to, belonging to token service node The token service node of failure is deleted in service cluster, and is notified to the application node subscribed to;
The token service node freelist of the service cluster is changed, and is sent to the application node subscribed to, for institute It states the application node subscribed to and selects token service section according to preset rules in the token service node freelist after change Point is used as target spoke service node.
Alternatively, the computer can operating instruction when being run by computer processor for running a kind of flow control side Method, this method comprises:
If receiving the notice for deleting the token service node of failure, the service being locally stored is changed according to the notice The token service node freelist of cluster;
Target spoke service node is determined according to the freelist;Wherein, the target spoke service node for pair The flow of application node is monitored.
Storage medium --- any various types of memory devices or storage equipment.Term " storage medium " is intended to wrap It includes: install medium, such as CD-ROM, floppy disk or magnetic tape equipment;Computer system memory or random access memory, such as DRAM, DDR RAM, SRAM, EDO RAM, Lan Basi (Rambus) RAM etc.;Nonvolatile memory, such as flash memory, magnetic medium (such as hard disk or optical storage);Register or the memory component of other similar types etc..Storage medium can further include other Memory of type or combinations thereof.In addition, storage medium can be located at program in the computer system being wherein run, or It can be located in different second computer systems, second computer system is connected to computer by network (such as internet) System.Second computer system can provide program instruction to computer for running.Term " storage medium " may include can To reside in different location two or more storage mediums of (such as in the different computer systems by network connection). Storage medium can store the program instruction (such as being implemented as computer program) that can be run by one or more processors.
Certainly, provided by the embodiment of the present application it is a kind of comprising computer can operating instruction storage medium, computer Can the flow control operation that is not limited to the described above of operating instruction, flow provided by the application any embodiment can also be run Relevant operation in control method.
Embodiment seven
The embodiment of the present application provides a kind of electronic equipment, and stream provided by the embodiments of the present application can be integrated in the electronic equipment Amount control device.Fig. 8 is the structural schematic diagram for a kind of electronic equipment that the embodiment of the present application seven provides.As shown in figure 8, this implementation Example provides a kind of electronic equipment 800 comprising: one or more processors 820;Storage device 810, for store one or Multiple programs, when one or more of programs are run by one or more of processors 820, so that one or more of Processor 820 realizes flow control methods provided by the embodiment of the present application one, this method comprises:
If the token service node failure event of the first application node access is listened to, belonging to token service node The token service node of failure is deleted in service cluster, and is notified to the application node subscribed to;
The token service node freelist of the service cluster is changed, and is sent to the application node subscribed to, for institute It states the application node subscribed to and selects token service section according to preset rules in the token service node freelist after change Point is used as target spoke service node.
Or realize flow control methods provided by the embodiment of the present application two, this method comprises:
If receiving the notice for deleting the token service node of failure, the service being locally stored is changed according to the notice The token service node freelist of cluster;
Target spoke service node is determined according to the freelist;Wherein, the target spoke service node for pair The flow of application node is monitored.
Certainly, it will be understood by those skilled in the art that processor 820 can also realize that the application any embodiment is provided Flow control methods technical solution.
The electronic equipment 800 that Fig. 8 is shown is only an example, should not function and use scope to the embodiment of the present application Bring any restrictions.
As shown in figure 8, the electronic equipment 800 includes processor 820, storage device 810, input unit 830 and output dress Set 840;The quantity of processor 820 can be one or more in electronic equipment, in Fig. 8 by taking a processor 820 as an example;Electronics Processor 820, storage device 810, input unit 830 and output device 840 in equipment can pass through bus or other modes It connects, in Fig. 8 for being connected by bus 850.
Storage device 810 is used as a kind of computer readable storage medium, and can be used for storing software program, computer can run Program and modular unit, such as the corresponding program instruction of flow control methods in the embodiment of the present application.
Storage device 810 can mainly include storing program area and storage data area, wherein storing program area can store operation Application program needed for system, at least one function;Storage data area, which can be stored, uses created data etc. according to terminal. In addition, storage device 810 may include high-speed random access memory, it can also include nonvolatile memory, for example, at least One disk memory, flush memory device or other non-volatile solid state memory parts.In some instances, storage device 810 It can further comprise the memory remotely located relative to processor 820, these remote memories can pass through network connection.On The example for stating network includes but is not limited to internet, intranet, local area network, mobile radio communication and combinations thereof.
Input unit 830 can be used for receiving number, character information or the voice messaging of input, and generation and electronic equipment User setting and function control related key signals input.Output device 840 may include the equipment such as display screen, loudspeaker.
Electronic equipment provided by the embodiments of the present application may be implemented carrying out the same of flow control to multiple application nodes When, improve the effect of network service stability.
Volume control device, storage medium and the electronic equipment provided in above-described embodiment, which can run the application, arbitrarily to be implemented Flow control methods provided by example have the corresponding functional module of operation this method and beneficial effect.Not in above-described embodiment In detailed description technical detail, reference can be made to flow control methods provided by the application any embodiment.
Note that above are only the preferred embodiment and institute's application technology principle of the application.It will be appreciated by those skilled in the art that The application is not limited to specific embodiment described here, be able to carry out for a person skilled in the art it is various it is apparent variation, The protection scope readjusted and substituted without departing from the application.Therefore, although being carried out by above embodiments to the application It is described in further detail, but the application is not limited only to above embodiments, in the case where not departing from the application design, also It may include more other equivalent embodiments, and scope of the present application is determined by the scope of the appended claims.

Claims (10)

1. a kind of flow control methods, which is characterized in that executed by coordination service end, which comprises
If listening to the token service node failure event of the first application node access, the service belonging to the token service node The token service node of failure is deleted in cluster, and is notified to the application node subscribed to;
Change the token service node freelist of the service cluster, and be sent to the application node subscribed to, for it is described The application node of subscription is made in the token service node freelist after change according to preset rules selection token service node For target spoke service node.
2. described the method according to claim 1, wherein before monitoring token service node failure event Method further include:
Receive the registration request of token service node;
According to the registration request of the token service node, token service node freelist is determined.
3. a kind of flow control methods, which is characterized in that executed by application node, which comprises
If receiving the notice for deleting the token service node of failure, the service cluster being locally stored is changed according to the notice Token service node freelist;
Target spoke service node is determined according to the freelist;Wherein, the target spoke service node is used for application The flow of node is monitored.
4. according to the method described in claim 3, it is characterized in that, determining target spoke service section according to the freelist Point, comprising:
At least one standby node of selection failure token service node from freelist, and successively determine it is described at least one Whether standby node can be used, if available, using available standby node as target spoke service node.
5. according to the method described in claim 3, it is characterized in that, the target spoke service node is used to save in response to application The traffic requests that point reports refuse the traffic requests if the flow of application node is more than flow threshold.
6. a kind of volume control device, which is characterized in that be configured at coordination service end, described device includes:
Token service knot removal module, if the token service node failure event for listening to the access of the first application node, The token service node of failure is then deleted from service cluster belonging to token service node, and is notified to the application section subscribed to Point;
Notification of Changes module has been subscribed to for changing the token service node freelist of the service cluster, and being sent to Application node selects in the token service node freelist after change according to preset rules for the application node subscribed to Token service node is selected as target spoke service node.
7. a kind of volume control device, which is characterized in that be configured at application node, described device includes:
Freelist changes module, if for receiving the notice for deleting the token service node of failure, according to the notice Change the token service node freelist for the service cluster being locally stored;
Target spoke service node determining module, for determining target spoke service node according to the freelist;Wherein, institute Target spoke service node is stated for being monitored to the flow of application node.
8. device according to claim 7, which is characterized in that the target spoke service node determining module is specifically used In:
At least one standby node of selection failure token service node from freelist, and successively determine it is described at least one Whether standby node can be used, if available, using available standby node as target spoke service node.
9. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that the program is held by processor The flow control methods as described in any one of claim 1-2 or claim 3-5 are realized when row.
10. a kind of electronic equipment, including memory, processor and storage are on a memory and can be in the computer of processor operation Program, which is characterized in that the processor realizes such as claim 1-2 or claim 3- when executing the computer program Flow control methods described in any one of 5.
CN201910582567.7A 2019-06-29 2019-06-29 Flow control methods, device, storage medium and electronic equipment Pending CN110324253A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910582567.7A CN110324253A (en) 2019-06-29 2019-06-29 Flow control methods, device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910582567.7A CN110324253A (en) 2019-06-29 2019-06-29 Flow control methods, device, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN110324253A true CN110324253A (en) 2019-10-11

Family

ID=68121531

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910582567.7A Pending CN110324253A (en) 2019-06-29 2019-06-29 Flow control methods, device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN110324253A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111970339A (en) * 2020-07-30 2020-11-20 北京金山云网络技术有限公司 Request control method and device and electronic equipment
CN113778637A (en) * 2021-01-18 2021-12-10 北京沃东天骏信息技术有限公司 Service call processing method and device
CN114338535A (en) * 2022-01-12 2022-04-12 平安壹钱包电子商务有限公司 Zookeeper-based cluster current limiting method, system, equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106534328A (en) * 2016-11-28 2017-03-22 网宿科技股份有限公司 Node connection method and distributed computing system
US20180041515A1 (en) * 2016-08-05 2018-02-08 Oracle International Corporation Service discovery for a multi-tenant identity and data security management cloud service
CN109412967A (en) * 2018-09-28 2019-03-01 江苏满运软件科技有限公司 System flow control method, device, electronic equipment, storage medium based on token
CN109451065A (en) * 2018-12-26 2019-03-08 中电福富信息科技有限公司 A kind of soft load balancing shunts automated system and its operation method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180041515A1 (en) * 2016-08-05 2018-02-08 Oracle International Corporation Service discovery for a multi-tenant identity and data security management cloud service
CN106534328A (en) * 2016-11-28 2017-03-22 网宿科技股份有限公司 Node connection method and distributed computing system
CN109412967A (en) * 2018-09-28 2019-03-01 江苏满运软件科技有限公司 System flow control method, device, electronic equipment, storage medium based on token
CN109451065A (en) * 2018-12-26 2019-03-08 中电福富信息科技有限公司 A kind of soft load balancing shunts automated system and its operation method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
OSC_EIBR31R7: "sentinel集群流控原理", 《HTTPS://MY.OSCHINA.NET/U/4314615/BLOG/3260272》 *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111970339A (en) * 2020-07-30 2020-11-20 北京金山云网络技术有限公司 Request control method and device and electronic equipment
CN111970339B (en) * 2020-07-30 2022-05-10 北京金山云网络技术有限公司 Request control method and device and electronic equipment
CN113778637A (en) * 2021-01-18 2021-12-10 北京沃东天骏信息技术有限公司 Service call processing method and device
CN114338535A (en) * 2022-01-12 2022-04-12 平安壹钱包电子商务有限公司 Zookeeper-based cluster current limiting method, system, equipment and storage medium
CN114338535B (en) * 2022-01-12 2023-09-22 平安壹钱包电子商务有限公司 Zookeeper-based cluster current limiting method, system, equipment and storage medium

Similar Documents

Publication Publication Date Title
CN102611735B (en) A kind of load-balancing method of application service and system
CN110324253A (en) Flow control methods, device, storage medium and electronic equipment
CN108712464A (en) A kind of implementation method towards cluster micro services High Availabitity
CN100525378C (en) Management method, system and device to update distributed set top box
US9071612B2 (en) Service providing system
CN103701916A (en) Dynamic load balancing method of distributed storage system
CN102137128A (en) Method and device for balancing load of cluster service
CN110719311B (en) Distributed coordination service method, system and computer readable storage medium
US8880665B2 (en) Nonstop service system using voting, and information updating and providing method in the same
CN106385435A (en) Service treatment method and system of service system
CN109981768A (en) I/o multipath planning method and equipment in distributed network storage system
CN100512224C (en) Port convergence rate management system and port convergence rate oscillation suppression method
CN113727464A (en) Method and device for establishing high-concurrency call of SIP streaming media server
US20110113131A1 (en) Method of Load Balance Based on BS Architecture
CN107562803B (en) Data supply system and method and terminal
CN102984762A (en) Method and device for function allocation of IMS
CN113326100B (en) Cluster management method, device, equipment and computer storage medium
CN101621409B (en) Service control method, service control device and broadband access servers
CN100484014C (en) Distributed cluster service management system and service management method in intelligent network
Johansson On the impact of network latency on distributed systems design
Cidon et al. A distributed control architecture of high-speed networks
CN107528884B (en) User request processing method and device of aggregation server
Shukla et al. MCDC: Multicast routing leveraging SDN for Data Center networks
CN102647424B (en) Data transmission method and data transmission device
CN105187518B (en) CDN content distribution method and system

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20191011