CN111614570A - Flow control system and method for service grid - Google Patents

Flow control system and method for service grid Download PDF

Info

Publication number
CN111614570A
CN111614570A CN202010313396.0A CN202010313396A CN111614570A CN 111614570 A CN111614570 A CN 111614570A CN 202010313396 A CN202010313396 A CN 202010313396A CN 111614570 A CN111614570 A CN 111614570A
Authority
CN
China
Prior art keywords
service
flow
token
service data
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202010313396.0A
Other languages
Chinese (zh)
Other versions
CN111614570B (en
Inventor
程渤
韩庆绵
程帅
陈俊亮
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing University of Posts and Telecommunications
CETC 54 Research Institute
Original Assignee
Beijing University of Posts and Telecommunications
CETC 54 Research Institute
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing University of Posts and Telecommunications, CETC 54 Research Institute filed Critical Beijing University of Posts and Telecommunications
Priority to CN202010313396.0A priority Critical patent/CN111614570B/en
Publication of CN111614570A publication Critical patent/CN111614570A/en
Application granted granted Critical
Publication of CN111614570B publication Critical patent/CN111614570B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/215Flow control; Congestion control using token-bucket
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/24Traffic characterised by specific attributes, e.g. priority or QoS
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/24Traffic characterised by specific attributes, e.g. priority or QoS
    • H04L47/2408Traffic characterised by specific attributes, e.g. priority or QoS for supporting different services, e.g. a differentiated services [DiffServ] type of service

Landscapes

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

Abstract

The embodiment of the invention provides a flow control system and a method for a service grid, wherein the system comprises the following steps: the flow limiting subsystem is used for carrying out flow limiting control on the flow of the flow limiting service data through a token bucket flow limiting algorithm and forwarding the key service data to the service degradation subsystem; and the service degradation subsystem is used for controlling the service level of the network bandwidth of the key service data forwarded by the flow limiting subsystem according to the service quality level to obtain the key service after flow control. The embodiment of the invention improves the service quality of the service grid under the narrow bandwidth network environment by carrying out current limiting and service degradation on different types of service data.

Description

Flow control system and method for service grid
Technical Field
The present invention relates to the field of flow control technologies, and in particular, to a flow control system and method for a service grid.
Background
With the proposal of the micro-Service architecture, the method brings great influence on the field of Service design architecture, more and more traditional Service architectures are changing towards the micro-Service architecture, a Service Mesh Service grid architecture is derived, and basic communication is handed to a Service grid to be completed. Based on technologies such as current limiting and service degradation, the guarantee of service quality in a service grid under a narrow-bandwidth network environment is indispensable in a micro-service grid.
Although the service grid can guarantee the stability of the service by providing fusing, current limiting, degrading and the like, and solve the guarantee of the service quality of the micro-service cluster in general conditions by rapid communication, for example, the Sentinel component provides the functions of current limiting, degrading, load protecting and the like, and is used for solving the problems of high concurrency, sudden increase of traffic flow, overhigh load, network delay and the like; the csemesher can simplify the development and maintenance of the micro-service by the user, and provides an integrated micro-service management mode for improving the living environment of the micro-service. However, under the condition of a constantly changing network environment, the guaranteed service quality of the existing service grid tool still needs to be improved.
Therefore, there is a need for a flow control system and method for a service grid to solve the above problems.
Disclosure of Invention
To solve the problems in the prior art, embodiments of the present invention provide a flow control system and method for a service grid.
In a first aspect, an embodiment of the present invention provides a flow control system for a service grid, including:
the flow limiting subsystem is used for carrying out flow limiting control on the flow of the flow limiting service data through a token bucket flow limiting algorithm and forwarding the key service data to the service degradation subsystem;
and the service degradation subsystem is used for controlling the service level of the network bandwidth of the key service data forwarded by the flow limiting subsystem according to the service quality level to obtain the key service after flow control.
Further, the system further comprises: and the micro-service resource management subsystem is used for carrying out continuous monitoring and state diagnosis on the micro-service.
Further, the current limiting subsystem comprises:
the filter module is used for filtering the received task request and analyzing the received task request according to the task request to obtain a server name and a port corresponding to the task request;
and the flow control strategy execution module is used for optimizing the token bucket flow limiting algorithm and generating a strategy triggered dynamic token according to the optimized token bucket flow limiting algorithm.
Further, the service degradation subsystem includes:
the forwarding control module is used for storing a task request into a request thread pool, and forwarding the task request to a target service according to configuration information and the task request so as to obtain a service instance corresponding to the task request, or directly obtaining the service instance corresponding to the task request according to the configuration information and the task request;
and the data compression degradation module is used for performing data compression degradation processing on the key service data according to the network bandwidth, the service instance CPU and the memory information to obtain the key service data after data compression.
Further, the micro service resource management subsystem comprises:
the service configuration management module is used for providing an operation interface for a user to deploy business service and edit service configuration information;
the service monitoring module is used for monitoring the resource condition of the host node and the micro-service;
and the service state management module is used for monitoring the service existing in the service grid and diagnosing the corresponding service and pod running states.
In a second aspect, an embodiment of the present invention provides a flow control method for a service grid, including:
acquiring service data corresponding to a task request, analyzing and judging the service data, and if the service data is current-limiting service data, performing current-limiting control on the flow of the current-limiting service data through a token bucket current-limiting algorithm;
and if the service data is key service data, performing service level control on the network bandwidth of the key service data according to the service quality level to obtain the key service after flow control.
Further, if the service data is key service data, performing service level control on the network bandwidth of the key service data according to the service quality level to obtain the flow-controlled key service, including:
obtaining a service quality compression ratio according to a service instance compression ratio formula, and performing service level control on the network bandwidth of the key service data according to a service quality level generated according to the service quality compression ratio, wherein the service instance compression ratio formula is as follows:
Figure BDA0002458529770000031
wherein Ratio (S)i) Representing the compression ratio of the ith service to be degraded, BiThe network bandwidth between the user task request end and the server end at the current moment is represented; a is1、a2And a3Respectively represent weight parameters, a1+a2+a3=1;U(Ci) Indicates the CPU utilization at the present time, U (M)i) Indicating the occupancy rate of the memory at the current time, B0Indicating a default value of network bandwidth, U (C), between the user task request side and the server side0) Indicates the CPU utilization default, U (M)0) Indicating the occupancy rate default of the memory.
Further, before performing flow limitation control on the flow of the flow limitation service data through a token bucket flow limitation algorithm if the service data is the flow limitation service data, the method further includes:
optimizing the token bucket current limiting algorithm to obtain an optimized token bucket current limiting algorithm;
and generating a strategy triggering type dynamic token according to the optimized token bucket current limiting algorithm.
Further, the generating a policy-triggered dynamic token according to the optimized token bucket throttling algorithm includes:
acquiring the time of each token application, and acquiring the time difference between the current time and the previous time of the token application after the request of the next token application arrives;
obtaining the token adding number at the current moment according to the token application time difference and the token adding rate;
and obtaining the final added token number of the token bucket according to the token addable number, the maximum token bucket number and the current remaining token number.
In a third aspect, an embodiment of the present invention provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the steps of the method provided in the second aspect when executing the program.
The flow control system and method for the service grid provided by the embodiment of the invention improve the service quality of the service grid in a narrow bandwidth network environment by carrying out flow limitation and service degradation on different types of service data.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and those skilled in the art can also obtain other drawings according to the drawings without creative efforts.
Fig. 1 is a schematic structural diagram of a flow control system for a service grid according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a current limiting subsystem according to an embodiment of the present invention;
FIG. 3 is a schematic structural diagram of a service downgrading subsystem according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a micro service resource management subsystem according to an embodiment of the present invention;
FIG. 5 is an overall block diagram of a flow control system for a services grid according to an embodiment of the present invention;
fig. 6 is a flowchart illustrating a flow control method for a service grid according to an embodiment of the present invention;
FIG. 7 is a diagram illustrating a current limiting implementation provided in accordance with an embodiment of the present invention;
FIG. 8 is a flow chart illustrating a service degradation control according to an embodiment of the present invention;
FIG. 9 is a diagram illustrating a policy-triggered dynamic token according to an embodiment of the present invention;
fig. 10 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Fig. 1 is a schematic structural diagram of a flow control system for a service grid according to an embodiment of the present invention, and as shown in fig. 1, an embodiment of the present invention provides a flow control system for a service grid, including:
and the flow limiting subsystem 101 is configured to perform flow limiting control on the flow of the flow limiting service data through a token bucket flow limiting algorithm, and forward the critical service data to the service degradation subsystem.
In the embodiment of the present invention, the throttling subsystem 101 is mainly used for throttling the data traffic of the non-critical service (i.e. throttling service data). Specifically, in the embodiment of the present invention, the current limiting subsystem 101 needs to intercept a service request, and first determines whether the request is current-limited, and forwards non-current-limited services (i.e., critical services) to the service downgrading subsystem 102; for the service needing current limiting, based on the token bucket current limiting algorithm, the placement rate of the tokens in the token bucket algorithm and the size of the token bucket are controlled by obtaining network bandwidth configuration data, so that the flow of the current limiting service data is controlled. In the embodiment of the invention, the token bucket algorithm is applied to the service grid, so that the flow control of each micro service is controlled, the network bandwidth of the corresponding level is distributed to the service with higher priority according to the network condition, and the response of the key service is not limited by the flow control by setting the white list.
And the service degradation subsystem 102 is configured to perform service level control on the network bandwidth of the key service data forwarded by the flow limiting subsystem according to the service quality level, so as to obtain the flow-controlled key service.
In the embodiment of the present invention, the service degradation subsystem 102 is configured to use a corresponding service degradation policy in a network environment with a narrow bandwidth and a weak connection, and implement service level selection of a service instance by monitoring a network condition, and further implement compression of data according to a degradation proportion calculated by a degradation algorithm in a special network condition, and improve a response probability of a service to a user by sacrificing a cost of service response data quality, and automatically implement switching of service quality as much as possible, so as to transmit data as much as possible. It should be noted that, in the embodiment of the present invention, the service degradation subsystem 102 may also set the preset quality of service level manually.
The flow control system for the service grid provided by the embodiment of the invention improves the service quality of the service grid in a narrow bandwidth network environment by carrying out flow limitation and service degradation on different types of service data.
On the basis of the above embodiment, the system further includes: and the micro-service resource management subsystem is used for carrying out continuous monitoring and state diagnosis on the micro-service.
In the embodiment of the invention, the micro service resource management subsystem is used for providing an operation interface for the user to deploy the service, edit the service configuration information and monitor the service grids and the service use conditions of the service grids, thereby realizing the continuous monitoring and service state diagnosis of the micro service by the user.
Fig. 2 is a schematic structural diagram of a current limiting subsystem according to an embodiment of the present invention, and referring to fig. 2, on the basis of the above embodiment, the current limiting subsystem includes:
and the filter module is used for filtering the received task request and analyzing according to the task request to obtain a server name and a port corresponding to the task request.
In the embodiment of the invention, the filter module is used for filtering the external request from the service grid and analyzing the service name and the port of the request through the task request of the user. Specifically, in the embodiment of the present invention, the filter module first analyzes and judges the request, encapsulates the request parameters into an entity, and returns a request response corresponding to the request forwarding to the user. In the embodiment of the invention, a uniform format url is used to access service according to the functional requirements of a filter module, the filter module reads configuration switch parameters related to flow control from Redis, selects a direct forwarding request or a flow control strategy, sets a Servlet as a filter inlet to receive a request of a user end, when the request of the user end arrives, uses an initialization method to put a request and a response into a context object, analyzes a URI in the user request, extracts the service name and the access port number of a real request, and acquires configuration item information. It should be noted that, in the embodiment of the present invention, if the current limiting mode is already turned on, the current limiting white list is matched, and if the task request exists in the white list, the request pre-processor is called to encapsulate the request entity according to the service name and the port number, and the request entity is directly forwarded to the corresponding service, and then the request response is forwarded to the user side, otherwise, the current limiting control is performed on the task request; and if the pass token can be acquired from the token bucket, forwarding the task request to a corresponding service, otherwise, intercepting the request.
And the flow control strategy execution module is used for optimizing the token bucket flow limiting algorithm and generating a strategy triggered dynamic token according to the optimized token bucket flow limiting algorithm.
In the embodiment of the invention, the flow control strategy execution module is used for optimizing the token bucket flow limiting algorithm and calculating the response or interception of the current task request through the optimized token bucket flow limiting algorithm according to the network environment and the flow control algorithm. Referring to fig. 2, the flow control policy enforcement module is mainly used to construct a token bucket and respond to a request for tokens from the filter module, and specifically, the flow control policy enforcement module optimizes a token bucket algorithm and dynamically generates tokens in a triggered manner according to a predetermined token generation policy, and when there is a token request, selects an allocation policy according to the size of the token bucket and the current number of tokens. In the embodiment of the invention, the token bucket is realized based on Redis, and the atomicity of data reading and writing is ensured, so that the data consistency of the token bucket is kept. And after the token bucket calculation, the flow control strategy execution module returns the application result to the filter module, if the token is obtained, the application result is passed, otherwise, the user request is intercepted.
Fig. 3 is a schematic structural diagram of a service downgrading subsystem according to an embodiment of the present invention, and referring to fig. 3, on the basis of the foregoing embodiment, the service downgrading subsystem includes:
and the forwarding control module is used for storing the task request into a request thread pool, and forwarding the task request to a target service according to the configuration information and the task request so as to obtain a service instance corresponding to the task request, or directly obtaining the service instance corresponding to the task request according to the configuration information and the task request.
In the embodiment of the invention, the forwarding control module is used for storing the task request into the request thread pool, and when the system is initialized, the forwarding control module reads the configuration information and the task request and judges whether to acquire the service instance or directly forward the task request to the target service. When the user configuration degradation type is degradation among service instances, the forwarding control module monitors network bandwidth and obtains configuration information, inquires corresponding services in the cluster, selects the service instance corresponding to the service according to the current network bandwidth and a threshold value configured by the user, and returns the name and the virtual ip of the real service instance to the request forwarding control module, so that the forwarding control module dynamically configures a flow rule in the istio and migrates the flow to the service instance of the corresponding version. Further, the forwarding control module forwards the request stored in the request thread pool to the real service, and the real service sends the request response to the forwarding control module and responds to the user through the filter module.
And the data compression degradation module is used for performing data compression degradation processing on the key service data according to the network bandwidth, the service instance CPU and the memory information to obtain the key service data after data compression.
In the embodiment of the present invention, referring to fig. 3, the data compression and degradation module is configured to compress the key service data to achieve the purpose of data compression and degradation. Considering three dimensions of network bandwidth, service instance CPU and memory according to the proportion of degradation required by a certain degraded service response data in the cluster, and automatically realizing the function of data compression according to a degradation threshold and the current network bandwidth by using a self-adaptive service degradation algorithm.
Fig. 4 is a schematic structural diagram of a micro service resource management subsystem according to an embodiment of the present invention, and referring to fig. 4, based on the above embodiment, the micro service resource management subsystem includes:
and the service configuration management module is used for providing an operation interface for the user to deploy the business service and edit the service configuration information.
In the embodiment of the invention, the service configuration management module provides an operation interface to realize foreground management on micro-service resources, so that a user deploys service and edits service configuration information through the module. Specifically, a user side accesses a foreground through a browser to perform relevant operations and sends an http request to a background server, a logic function processing unit of the background server processes the request, the logic function processing unit sends a data request to a grid cluster and a database, the grid cluster and the database send response requests to the logic function processing unit, and the logic function processing unit processes data and returns the data to a front-end browser.
And the service monitoring module is used for monitoring the resource condition of the host node and the micro-service.
In the embodiment of the invention, the service monitoring function of the service monitoring module is used for monitoring two layers, namely, integral monitoring which mainly refers to uniformly monitoring the distribution of services in a cluster and the running state of each host node; and the other is to monitor the specific micro-service operation indexes, including indexes such as throughput and resource use condition.
And the service state management module is used for monitoring the service existing in the service grid and diagnosing the corresponding service and pod running states.
In the embodiment of the invention, the service state management module checks the service details of the service existing in the service grid and diagnoses the running state of the service instance corresponding to the service grid. Specifically, in the embodiment of the present invention, a service whose details are to be checked is set, and then a request is sent to the background SvcController controller, and the background logic queries data of the service from the database according to the name of the service, and queries service and pod information corresponding to the service in the kubernets cluster according to the name of the service.
Fig. 5 is an overall framework diagram of a flow control system for a service grid according to an embodiment of the present invention, which can be referred to fig. 5, and in the embodiment of the present invention, the flow control system includes a micro service resource management subsystem, a configuration storage center, a current limiting subsystem, a service degradation subsystem, and a service cluster, where a current limiting white list, a flow control configuration center (for storing flow control configuration information), a service degradation configuration center (for storing service degradation configuration information), and a service management database are disposed in the configuration storage center.
Fig. 6 is a flowchart illustrating a flow control method for a serving grid according to an embodiment of the present invention, and as shown in fig. 6, an embodiment of the present invention provides a flow control method for a serving grid, including:
step 601, obtaining service data corresponding to a task request, analyzing and judging the service data, and if the service data is current-limiting service data, performing current-limiting control on the flow of the current-limiting service data through a token bucket current-limiting algorithm.
Step 602, if the service data is key service data, performing service level control on the network bandwidth of the key service data according to the service quality level to obtain the flow-controlled key service.
In the embodiment of the present invention, fig. 7 is a schematic diagram of a current limiting execution step provided in the embodiment of the present invention, and reference may be made to fig. 7, where the specific steps are as follows:
step 701, determining whether the traffic type key exists, if yes, going to step 703, and if not, going to step 702. It should be noted that, in the embodiment of the present invention, based on cluster flow limitation of distributed cache, flow allocation needs to be performed according to different flow categories, so that a flow category token bucket needs to be initialized when accessing for the first time;
step 702, if the traffic class key does not exist, initializing the traffic class token bucket;
step 703, if yes, calculating the number of tokens to be placed;
step 704, comparing the current request time with the last token placing time of the current key, defining delta as time difference, and setting the token placing number to be delta/r, wherein r represents the rate of adding tokens, when placing the tokens, the token number is ensured not to exceed the capacity of the token bucket, and meanwhile, the time for placing the tokens is reset;
step 705, placing tokens in the capacity range of the token bucket;
step 706, if the token acquisition is successful, that is, the capacity of the token bucket can be put into the token, go to step 710; if the current token bucket can not be put in, go to step 707;
step 707, determining whether there is an idle token bucket, if yes, going to step 709; otherwise, the token acquisition fails and the request is intercepted;
step 708, intercepting the request;
step 709, placing tokens in an idle token bucket;
step 710, allow the request.
Fig. 8 is a flowchart illustrating a service degradation control method according to an embodiment of the present invention, which can be described with reference to fig. 8, and includes the following specific steps:
step 801, judging whether a user-defined degradation strategy is available for performing service degradation selection on the current request service, if so, going to step 803, and if not, going to step 802;
step 802, automatically executing a budget degradation strategy on a business service instance through a data compression degradation module;
step 803, inquiring service instance information from the Etcd;
step 804, obtaining instance version configuration from the downgrade configuration information stored in the downgrade configuration center;
step 805, making a flow distribution strategy, and performing service level control on data;
step 806, receiving the request of user to access service, and returning the data of corresponding service quality.
The flow control method for the service grid provided by the embodiment of the invention improves the service quality of the service grid in a narrow bandwidth network environment by carrying out flow limitation and service degradation on different types of service data.
On the basis of the foregoing embodiment, if the service data is key service data, performing service level control on a network bandwidth of the key service data according to a service quality level to obtain a flow-controlled key service includes:
obtaining a service quality compression ratio according to a service instance compression ratio formula, and performing service level control on the network bandwidth of the key service data according to a service quality level generated according to the service quality compression ratio, wherein the service instance compression ratio formula is as follows:
Figure BDA0002458529770000101
wherein Ratio (S)i) Representing the compression ratio of the ith service to be degraded, BiThe network bandwidth between the user task request end and the server end at the current moment is represented; a is1、a2And a3Respectively represent weight parameters, a1+a2+a3=1;U(Ci) Indicates the CPU utilization at the present time, U (M)i) Indicating the occupancy rate of the memory at the current time, B0Indicating a default value of network bandwidth, U (C), between the user task request side and the server side0) Indicates the CPU utilization default, U (M)0) Indicating the occupancy rate default of the memory.
In the embodiment of the invention, for a certain degraded service SiWhen a request comes, acquiring the bandwidth B of the network of the previous network acquisition periodiAnd the bandwidth B is determinediAs the network bandwidth for the current time. In the embodiment of the present invention, an iperf tool is used to invoke a dmc command to detect the wire speed B between the client and the server, so that the network bandwidth data between the server and the client needs to be obtained because the quality of the service response data needs to be dynamically adjusted according to the bandwidth of the current networki(ii) a Monitoring resource use information of service instances in the cluster through kubernets, and collecting the utilization rate U (C) of a CPU at the current momenti) And current memory occupancy rate U (M)i) The data of (1). Further, according to the practical situation of the system, the embodiment of the invention sets the default value B under the normal environment and resource situation0、U(C0) And U (M)0) And sets the weight parameter { α1,α2,α3And identifying the influence weight of each index, so as to limit the degradation proportion through the data.
Further, in the embodiment of the present invention, the Ratio to which each service instance needs to be compressed is calculated by a service instance compression Ratio formula, a service instance with the largest Ratio value is selected from the service instances, the corresponding service instance ip is returned, and in order to reduce the reduction amplitude of the quality of service data to the maximum extent, a service instance with the smallest compression Ratio is selected, that is, the service instance with the largest compression Ratio is selected for responding to the service request.
On the basis of the above embodiment, before performing flow limitation control on the flow of the flow limitation service data through a token bucket flow limitation algorithm if the service data is the flow limitation service data, the method further includes:
optimizing the token bucket current limiting algorithm to obtain an optimized token bucket current limiting algorithm;
and generating a strategy triggering type dynamic token according to the optimized token bucket current limiting algorithm.
On the basis of the foregoing embodiment, the generating a policy-triggered dynamic token according to the optimized token bucket throttling algorithm includes:
acquiring the time of each token application, and acquiring the time difference between the current time and the previous time of the token application after the request of the next token application arrives;
obtaining the token adding number at the current moment according to the token application time difference and the token adding rate;
and obtaining the final added token number of the token bucket according to the token addable number, the maximum token bucket number and the current remaining token number.
Fig. 9 is a schematic diagram of a policy-triggered dynamic token provided by an embodiment of the present invention, and referring to fig. 9, in the embodiment of the present invention, a token bucket algorithm is improved in an optimization manner, and a policy-triggered dynamic token bucket algorithm is provided. In the conventional token bucket algorithm, a special thread needs to be configured to run repeatedly all the time, and in order to reduce the number of operations on Redis and improve the performance of a flow control module, the token generation is designed into a trigger type generation mode in the embodiment of the invention.
Specifically, in the embodiment of the present invention, by setting a variable, the time of each token application is recorded, after a request for a token application from the filter module arrives next time, a token application time difference between the current time and the previous time is calculated, and the number of tokens that can be added in this time is calculated according to the rate of adding tokens, where the calculation mode is represented as:
Figure BDA0002458529770000121
where currMill Millis the time of the current application, lastMillis the time of the last application for the token, and r is the rate at which tokens are added in units of one/second. The number of tokens eventually added to the token bucket is expressed as:
resultPermits=min(reservePermits,maxPermits-storedPermits);
where maxPermits represents the size of the token bucket and storedPermits represents the number of tokens currently present.
Further, in the embodiment of the present invention, service users deployed in the service grid need to be classified into different classes according to the services, that is, the service users are divided into various types of traffic. Generally, a single token bucket is defined for each type of traffic for multi-classification traffic, and isolation is realized from other types of traffic, but the use of such a solution can bring about the problems of network resource waste and low bandwidth utilization rate, and when tokens in a token bucket of a certain type are completely used up, requests of a corresponding type are intercepted or are in a waiting state; meanwhile, the request frequency of another category is not so high due to the service requirement, so that the number of tokens in the token bucket is always large, and for the situation, the network resource is in a waste state; furthermore, the class request with token supply shortage will delay the response because no token is intercepted or in queue state, and the service quality will be affected. In view of the above problems, the embodiments of the present invention use a semi-isolated token bucket to implement control shaping of multi-class traffic, so that the tokens of a certain class of traffic can allow other classes to use the remaining tokens under the condition of meeting the minimum requirement.
Fig. 10 is a schematic structural diagram of an electronic device according to an embodiment of the present invention, and referring to fig. 10, the electronic device may include: a processor (processor)1001, a communication Interface (communication Interface)1002, a memory (memory)1003 and a communication bus 1004, wherein the processor 1001, the communication Interface 1002 and the memory 1003 complete communication with each other through the communication bus 1004. Processor 1001 may call logic instructions in memory 1003 to perform the following method: acquiring service data corresponding to a task request, analyzing and judging the service data, and if the service data is current-limiting service data, performing current-limiting control on the flow of the current-limiting service data through a token bucket current-limiting algorithm; and if the service data is key service data, performing service level control on the network bandwidth of the key service data according to the service quality level to obtain the key service after flow control.
In addition, the logic instructions in the memory 1003 may be implemented in the form of software functional units and may be stored in a computer readable storage medium when the logic instructions are sold or used as independent products. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
In another aspect, an embodiment of the present invention further provides a non-transitory computer-readable storage medium, on which a computer program is stored, where the computer program is implemented to, when executed by a processor, perform the traffic control method for a service grid provided in the foregoing embodiments, for example, including: acquiring service data corresponding to a task request, analyzing and judging the service data, and if the service data is current-limiting service data, performing current-limiting control on the flow of the current-limiting service data through a token bucket current-limiting algorithm; and if the service data is key service data, performing service level control on the network bandwidth of the key service data according to the service quality level to obtain the key service after flow control.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (10)

1. A flow control system for a services grid, comprising:
the flow limiting subsystem is used for carrying out flow limiting control on the flow of the flow limiting service data through a token bucket flow limiting algorithm and forwarding the key service data to the service degradation subsystem;
and the service degradation subsystem is used for controlling the service level of the network bandwidth of the key service data forwarded by the flow limiting subsystem according to the service quality level to obtain the key service after flow control.
2. The flow control system for a services grid according to claim 1, wherein said system further comprises: and the micro-service resource management subsystem is used for carrying out continuous monitoring and state diagnosis on the micro-service.
3. The flow control system for a services grid according to claim 1, wherein the flow limiting subsystem comprises:
the filter module is used for filtering the received task request and analyzing the received task request according to the task request to obtain a server name and a port corresponding to the task request;
and the flow control strategy execution module is used for optimizing the token bucket flow limiting algorithm and generating a strategy triggered dynamic token according to the optimized token bucket flow limiting algorithm.
4. The flow control system for a services grid according to claim 1, wherein said service downgrading subsystem comprises:
the forwarding control module is used for storing a task request into a request thread pool, and forwarding the task request to a target service according to configuration information and the task request so as to obtain a service instance corresponding to the task request, or directly obtaining the service instance corresponding to the task request according to the configuration information and the task request;
and the data compression degradation module is used for performing data compression degradation processing on the key service data according to the network bandwidth, the service instance CPU and the memory information to obtain the key service data after data compression.
5. The flow control system for a services grid according to claim 2, wherein said micro-service resource management subsystem comprises:
the service configuration management module is used for providing an operation interface for a user to deploy business service and edit service configuration information;
the service monitoring module is used for monitoring the resource condition of the host node and the micro-service;
and the service state management module is used for monitoring the service existing in the service grid and diagnosing the corresponding service and pod running states.
6. A method of flow control for a services grid, comprising:
acquiring service data corresponding to a task request, analyzing and judging the service data, and if the service data is current-limiting service data, performing current-limiting control on the flow of the current-limiting service data through a token bucket current-limiting algorithm;
and if the service data is key service data, performing service level control on the network bandwidth of the key service data according to the service quality level to obtain the key service after flow control.
7. The method of claim 6, wherein if the service data is key service data, performing service level control on the network bandwidth of the key service data according to a service quality level to obtain a flow-controlled key service, comprises:
obtaining a service quality compression ratio according to a service instance compression ratio formula, and performing service level control on the network bandwidth of the key service data according to a service quality level generated according to the service quality compression ratio, wherein the service instance compression ratio formula is as follows:
Figure FDA0002458529760000021
wherein Ratio (S)i) Representing the compression ratio of the ith service to be degraded, BiThe network bandwidth between the user task request end and the server end at the current moment is represented; a is1、a2And a3Respectively represent weight parameters, a1+a2+a3=1;U(Ci) Indicates the CPU utilization at the present time, U (M)i) Indicating the occupancy rate of the memory at the current time, B0Indicating a default value of network bandwidth, U (C), between the user task request side and the server side0) Indicates the CPU utilization default, U (M)0) Indicating the occupancy rate default of the memory.
8. The method of claim 6, wherein before performing flow restriction control on the flow of the limited service data through a token bucket flow restriction algorithm if the service data is the limited service data, the method further comprises:
optimizing the token bucket current limiting algorithm to obtain an optimized token bucket current limiting algorithm;
and generating a strategy triggering type dynamic token according to the optimized token bucket current limiting algorithm.
9. The method of traffic control for a service grid according to claim 8, wherein said generating policy-triggered dynamic tokens according to said optimized token bucket throttling algorithm comprises:
acquiring the time of each token application, and acquiring the time difference between the current time and the previous time of the token application after the request of the next token application arrives;
obtaining the token adding number at the current moment according to the token application time difference and the token adding rate;
and obtaining the final added token number of the token bucket according to the token addable number, the maximum token bucket number and the current remaining token number.
10. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the steps of the flow control method according to any one of claims 6 to 9 are implemented when the program is executed by the processor.
CN202010313396.0A 2020-04-20 2020-04-20 Flow control system and method for service grid Active CN111614570B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010313396.0A CN111614570B (en) 2020-04-20 2020-04-20 Flow control system and method for service grid

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010313396.0A CN111614570B (en) 2020-04-20 2020-04-20 Flow control system and method for service grid

Publications (2)

Publication Number Publication Date
CN111614570A true CN111614570A (en) 2020-09-01
CN111614570B CN111614570B (en) 2022-07-01

Family

ID=72198261

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010313396.0A Active CN111614570B (en) 2020-04-20 2020-04-20 Flow control system and method for service grid

Country Status (1)

Country Link
CN (1) CN111614570B (en)

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111897659A (en) * 2020-09-29 2020-11-06 腾讯科技(深圳)有限公司 Method, system and device for controlling service processing frequency and electronic equipment
CN112187521A (en) * 2020-09-09 2021-01-05 上海微亿智造科技有限公司 Apollo-based system for realizing industrial internet distributed service degradation
CN113162802A (en) * 2021-04-02 2021-07-23 东云睿连(武汉)计算技术有限公司 Communication method, equipment and storage medium based on InfiniBand
CN113518041A (en) * 2021-06-15 2021-10-19 新华三大数据技术有限公司 Message processing method and device
CN113806096A (en) * 2021-09-24 2021-12-17 上海通联金融服务有限公司 Distributed current-limiting in-row pre-system high-availability improving method based on sentinel
CN114036031A (en) * 2022-01-05 2022-02-11 阿里云计算有限公司 Scheduling system and method for resource service application in enterprise digital middleboxes
CN114422447A (en) * 2021-12-25 2022-04-29 中国海洋大学 Multi-service multi-network converged communication scheduling method and system, medium, terminal and application
CN114615073A (en) * 2022-03-22 2022-06-10 广州方硅信息技术有限公司 Access flow control method, device, equipment and medium
CN114844835A (en) * 2022-07-04 2022-08-02 眉山环天智慧科技有限公司 Self-adaptive dynamic current limiting method and device
CN115002211A (en) * 2022-07-28 2022-09-02 成都乐超人科技有限公司 Cloud-native-based after-sale micro-service implementation method, device, equipment and medium
CN115189973A (en) * 2022-09-13 2022-10-14 以见科技(苏州)有限公司 Method and system for software security and encryption
CN115987902A (en) * 2022-12-20 2023-04-18 平安银行股份有限公司 Service current limiting method and device, computer equipment and storage medium
CN116582497A (en) * 2023-04-21 2023-08-11 中国测绘科学研究院 Method for shaping self-adaptive traffic of high-efficiency GIS service under single server condition
CN116743833A (en) * 2023-08-16 2023-09-12 雄安国创中心科技有限公司 Method and device for enhancing communication capability and network control capability of terminal and service

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102665187A (en) * 2012-02-29 2012-09-12 华中科技大学 Intelligent pipeline control method based on intelligent terminal
CN103281251A (en) * 2013-06-18 2013-09-04 北京百度网讯科技有限公司 Data transmission method and system between data centers and subsystem of data transmission system
US20150140983A1 (en) * 2012-05-04 2015-05-21 Vodafone Ip Licensing Limited Telecommunication networks
CN110475585A (en) * 2017-03-27 2019-11-19 王诠中 Implement the System and method for of physical stimulation service

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102665187A (en) * 2012-02-29 2012-09-12 华中科技大学 Intelligent pipeline control method based on intelligent terminal
US20150140983A1 (en) * 2012-05-04 2015-05-21 Vodafone Ip Licensing Limited Telecommunication networks
CN103281251A (en) * 2013-06-18 2013-09-04 北京百度网讯科技有限公司 Data transmission method and system between data centers and subsystem of data transmission system
CN110475585A (en) * 2017-03-27 2019-11-19 王诠中 Implement the System and method for of physical stimulation service

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
WES LLOYD等: "Serverless Computing: An Investigation of Factors Influencing Microservice Performance", 《2018 IEEE INTERNATIONAL CONFERENCE ON CLOUD ENGINEERING》 *
孙杰平: "论Service Mesh在微服务架构中的优势", 《通信世界》 *
蔡亚楠: "基于微服务的软件体系结构设计方法研究与应用", 《CNKI优秀硕士学位论文全文库》 *

Cited By (21)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112187521A (en) * 2020-09-09 2021-01-05 上海微亿智造科技有限公司 Apollo-based system for realizing industrial internet distributed service degradation
CN111897659A (en) * 2020-09-29 2020-11-06 腾讯科技(深圳)有限公司 Method, system and device for controlling service processing frequency and electronic equipment
CN113162802A (en) * 2021-04-02 2021-07-23 东云睿连(武汉)计算技术有限公司 Communication method, equipment and storage medium based on InfiniBand
CN113518041B (en) * 2021-06-15 2023-05-16 新华三大数据技术有限公司 Message processing method and device
CN113518041A (en) * 2021-06-15 2021-10-19 新华三大数据技术有限公司 Message processing method and device
CN113806096A (en) * 2021-09-24 2021-12-17 上海通联金融服务有限公司 Distributed current-limiting in-row pre-system high-availability improving method based on sentinel
CN114422447A (en) * 2021-12-25 2022-04-29 中国海洋大学 Multi-service multi-network converged communication scheduling method and system, medium, terminal and application
CN114422447B (en) * 2021-12-25 2024-05-17 中国海洋大学 Multi-service multi-network converged communication scheduling method and system, medium, terminal and application
CN114036031A (en) * 2022-01-05 2022-02-11 阿里云计算有限公司 Scheduling system and method for resource service application in enterprise digital middleboxes
CN114615073A (en) * 2022-03-22 2022-06-10 广州方硅信息技术有限公司 Access flow control method, device, equipment and medium
CN114844835B (en) * 2022-07-04 2022-09-20 眉山环天智慧科技有限公司 Self-adaptive dynamic current limiting method and device
CN114844835A (en) * 2022-07-04 2022-08-02 眉山环天智慧科技有限公司 Self-adaptive dynamic current limiting method and device
CN115002211A (en) * 2022-07-28 2022-09-02 成都乐超人科技有限公司 Cloud-native-based after-sale micro-service implementation method, device, equipment and medium
CN115002211B (en) * 2022-07-28 2022-12-06 成都乐超人科技有限公司 Method, device, equipment and medium for realizing after-sale micro-service based on cloud protogenesis
CN115189973A (en) * 2022-09-13 2022-10-14 以见科技(苏州)有限公司 Method and system for software security and encryption
CN115189973B (en) * 2022-09-13 2022-11-25 以见科技(苏州)有限公司 Method and system for software security and encryption
CN115987902A (en) * 2022-12-20 2023-04-18 平安银行股份有限公司 Service current limiting method and device, computer equipment and storage medium
CN116582497A (en) * 2023-04-21 2023-08-11 中国测绘科学研究院 Method for shaping self-adaptive traffic of high-efficiency GIS service under single server condition
CN116582497B (en) * 2023-04-21 2024-01-23 中国测绘科学研究院 Method for shaping self-adaptive traffic of high-efficiency GIS service under single server condition
CN116743833A (en) * 2023-08-16 2023-09-12 雄安国创中心科技有限公司 Method and device for enhancing communication capability and network control capability of terminal and service
CN116743833B (en) * 2023-08-16 2023-11-03 雄安国创中心科技有限公司 Method and device for enhancing communication capability and network control capability of terminal and service

Also Published As

Publication number Publication date
CN111614570B (en) 2022-07-01

Similar Documents

Publication Publication Date Title
CN111614570B (en) Flow control system and method for service grid
US11601512B2 (en) System and method for throttling service requests having non-uniform workloads
US10972344B2 (en) Automated adjustment of subscriber policies
CN107592345B (en) Transaction current limiting device, method and transaction system
CN109672627A (en) Method for processing business, platform, equipment and storage medium based on cluster server
US20150156123A1 (en) System and method for throttling service requests using work-based tokens
CN111198759B (en) Memory optimization method, system, terminal equipment and readable storage medium
US20170048163A1 (en) Method and system for resource scheduling
CN108776934A (en) Distributed data computational methods, device, computer equipment and readable storage medium storing program for executing
CN112866136B (en) Service data processing method and device
CN112868265B (en) Network resource management method, management device, electronic equipment and storage medium
CN112764920B (en) Edge application deployment method, device, equipment and storage medium
CN113364697A (en) Flow control method, device, equipment and computer readable storage medium
CN110677274A (en) Event-based cloud network service scheduling method and device
US9553774B2 (en) Cost tracking for virtual control planes
CN111641563B (en) Flow self-adaption method and system based on distributed scene
CN110838987B (en) Queue current limiting method and storage medium
US20130132552A1 (en) Application-Aware Quality Of Service In Network Applications
CN109348486B (en) Heterogeneous wireless network resource allocation method
WO2022100365A1 (en) Method, system, and device for managing artificial intelligence application task, and storage medium
CN109005060B (en) Deep learning application optimization framework based on hierarchical highly heterogeneous distributed system
CN114358134A (en) High-concurrency automatic capacity expansion and contraction method, system, computer equipment and medium
US20240086296A1 (en) Dynamic allocation and use of ims processing resources
CN111143033B (en) Operation execution method and device based on scalable operation system
CN112866128A (en) Speed limiting method and device for distributed network and electronic equipment

Legal Events

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