Network bandwidth limiting method, system, electronic device and readable storage medium

By deploying a traffic monitoring and counting device and a centralized cache counting center in a distributed system to detect and configure the current limiting threshold in real time, it solves the bandwidth limitation problem in existing technologies that cannot adapt to multiple-capability machines and business needs, and realizes distributed control. Efficient and accurate network bandwidth management for storage services.

CN114500381BActive Publication Date: 2024-10-22BEIJING QIYI CENTURY SCI & TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210067707.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-20
Publication Date
2024-10-22
Estimated Expiration
2042-01-20

AI Technical Summary

Technical Problem

The existing network bandwidth limitation method is difficult to adapt to a variety of machines with different capabilities. It cannot accurately limit bandwidth according to business needs, resulting in low and inaccurate storage and download efficiency, and cannot effectively handle the bandwidth limitation problem of distributed storage services.

Method used

In the distributed system, each object storage server deploys a traffic monitoring and counting device to detect traffic data in real time, and configures the current limiting threshold in real time based on the business level through the centralized cache and counting center, and counts the total traffic to achieve flexible and precise restrictions on network bandwidth. .

Benefits of technology

It realizes efficient bandwidth restriction for distributed storage services, can flexibly allocate bandwidth resources according to service levels, prioritize key services, and improve the flexibility and stability of enterprise business resource scheduling.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114500381B_ABST
    Figure CN114500381B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention provides a network bandwidth limitation method, system, electronic device and readable storage medium, the method comprising: receiving a service request sent by a client through at least one object storage server; detecting the flow data in real time according to the service request through each flow monitoring and counting device, and sending the flow data to a centralized cache counting center; the centralized cache counting center is used to configure the flow limiting threshold in real time based on the service level of the requested service, and count the total flow of the flow data; and limiting the network bandwidth of the requested service according to the flow limiting threshold and the total flow through each flow monitoring and counting device. By adding a flow monitoring and counting device in each object storage server to detect the flow size in real time, and by adding a centralized cache counting center to configure the threshold of the overall access bandwidth, effective limitation of the distributed storage service can be achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a network bandwidth limiting method, a network bandwidth limiting system, an electronic device and a computer-readable storage medium. Background Art

[0002] At present, with the continuous increase of Internet business and the development of big data, the number of data files that need to be stored is gradually increasing, and Object Storage Service (OSS) has become the industry standard for Internet storage services. As a shared, bandwidth-intensive infrastructure service, OSS can be used to carry all storage services of an enterprise / company, but due to its limited bandwidth capacity, it is necessary to require relevant restrictions and fuse measures for each upper-level business, otherwise it is likely to affect the business of the entire enterprise / company.

[0003] The existing bandwidth limitation capabilities are basically QPS (Query Per Second) limitation, connection number limitation, etc. These bandwidth limitation methods need to be implemented by limiting the network of a single machine, which is difficult to adapt to machines with different capabilities. Summary of the invention

[0004] The purpose of the embodiments of the present invention is to provide a network bandwidth limitation method, a corresponding network bandwidth limitation device, a corresponding network bandwidth limitation system, an electronic device and a computer-readable storage medium, so as to achieve effective bandwidth limitation for distributed storage services. The specific technical solution is as follows:

[0005] In a first aspect of the implementation of the present invention, a network bandwidth limitation method is first provided, which is applied to a distributed system, wherein the distributed system includes a centralized cache counting center and at least one object storage server, and the method includes:

[0006] Receiving a service request sent by a client through at least one object storage server; wherein each object storage server is deployed with a flow monitoring and counting device;

[0007] The flow data is detected in real time according to the service request by each flow monitoring and counting device, and the flow data is sent to the centralized cache counting center; the centralized cache counting center is used to configure the flow limiting threshold in real time based on the service level of the requested service, and count the total flow of the flow data;

[0008] The network bandwidth of the requested service is limited according to the current limiting threshold and the total flow through each flow monitoring and counting device.

[0009] In a second aspect of the implementation of the present invention, a network bandwidth limiting system is further provided, wherein the network bandwidth limiting system is deployed with a distributed system, wherein the distributed system includes a centralized cache counting center and at least one object storage server, wherein each object storage server is deployed with a flow monitoring and counting device;

[0010] The at least one object storage server is used to receive a service request sent by a client; each flow monitoring and counting device is used to detect flow data in real time according to the service request, and send the flow data to the centralized cache counting center;

[0011] The centralized cache counting center is used to configure the flow limiting threshold in real time based on the service level of the requested service, and to count the total flow of the flow data;

[0012] Each flow monitoring and counting device is also used to limit the network bandwidth of the requested service according to the flow limiting threshold and the total flow.

[0013] In another aspect of an embodiment of the present invention, a network bandwidth limiting device is provided, which is applied to a distributed system, wherein the distributed system includes a centralized cache counting center and at least one object storage server, and the device includes:

[0014] A service request receiving module, located in the object storage server, is used to receive a service request sent by a client; wherein each object storage server is deployed with a flow monitoring and counting device;

[0015] A flow data monitoring module, located in the flow monitoring and counting device, is used to detect flow data in real time according to the service request, and send the flow data to the centralized cache counting center; the centralized cache counting center is used to configure the flow limiting threshold in real time based on the service level of the requested service, and count the total flow of the flow data;

[0016] The bandwidth limiting module is located in the flow monitoring and counting device and is used to limit the network bandwidth of the requested service according to the flow limiting threshold and the total flow.

[0017] In another aspect of the present invention, a computer-readable storage medium is provided, wherein instructions are stored in the computer-readable storage medium, and when the computer-readable storage medium is executed on a computer, the computer executes the steps of any of the above-mentioned network bandwidth limitation methods.

[0018] In another aspect of the present invention, a computer program product comprising instructions is provided, which, when executed on a computer, enables the computer to execute the steps of any of the above-mentioned network bandwidth limitation methods.

[0019] The network bandwidth limiting method and network bandwidth limiting system provided by the embodiments of the present invention monitor the traffic size of the service requested by the service request by adding a traffic monitoring and counting device in each object storage server in the storage service of the distributed system, and add a centralized cache counting center to count the total traffic of each object storage server in the distributed system, and can configure the flow limiting threshold in real time based on the service level of the requested service, so as to determine the bandwidth threshold of the shared machine to meet the service requirements on the basis of traffic statistics of multiple machines that may be accessed by the requested service at the same time, and can efficiently handle the bandwidth limitation problem of the distributed storage service, realize the limitation of the network bandwidth of the requested service in the distributed system, and based on the real-time configured flow limiting threshold, limit the bandwidth of machines with different capabilities that the requested service needs to access, so as to realize effective limitation of the storage service. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art are briefly introduced below.

[0021] Figure 1 A schematic diagram of the framework of a network bandwidth limitation system provided in an embodiment of the present invention;

[0022] Figure 2 A flowchart of the steps of the network bandwidth limitation method provided in an embodiment of the present invention;

[0023] Figure 3 Another step flow chart of the network bandwidth limitation method provided in an embodiment of the present invention;

[0024] Figure 4 This is an application scenario diagram of the network bandwidth limitation provided in an embodiment of the present invention;

[0025] Figure 5 A schematic diagram of the structure of a network bandwidth limiting device provided in an embodiment of the present invention;

[0026] Figure 6 The figure is a schematic diagram of the structure of an electronic device in an embodiment of the present invention. DETAILED DESCRIPTION

[0027] The technical solutions in the embodiments of the present invention will be described below in conjunction with the accompanying drawings in the embodiments of the present invention.

[0028] In the object storage service OSS, network bandwidth needs to be limited. The existing bandwidth limitation capabilities are basically QPS limitation, connection number limitation, etc. These bandwidth limitation methods all send the overall capacity limitation target to a single machine for network limitation, that is, it needs to be achieved by network limitation of a single machine. Generally, the threshold is pre-set before the service is started. This method is difficult to adapt to machines with different capabilities, and it will be difficult to determine the threshold for some shared machines. In addition, a certain business may need to access multiple machines at the same time. Since it is difficult to adapt to machines with different capabilities, single-machine limitation cannot limit bandwidth according to business needs. That is, the single-machine limitation of the object storage service that focuses on storage and bandwidth is inefficient and inaccurate, and it is also impossible to limit network bandwidth according to business.

[0029] One of the core ideas of the embodiments of the present invention is to add a traffic monitoring and counting device in each object storage server to detect the traffic size in real time, and to add a centralized cache counting center to configure the threshold of the overall access bandwidth carried by the global business or a certain business object, so as to achieve effective restriction on the distributed storage business.

[0030] Reference Figure 1 , shows a schematic diagram of the framework of the network bandwidth limitation system provided in an embodiment of the present invention, the network bandwidth limitation system includes a client 101 and a deployed distributed system, the distributed system may include a centralized cache counting center 102 and at least one object storage server 103. Wherein, a flow monitoring and counting device 104 may be deployed in each object storage server 103, and the centralized cache counting center 102 may be a data counting service independent of the server.

[0031] When the client 101 makes a request for a storage object, it can communicate with the object storage server 103. In this case, the requested read and write services may need to access multiple machines. The object storage server 103 directly connected to the client 101 may be one or more object storage servers with various capabilities involved in the distributed system. The service request sent by the client can be received through the connected object storage server, and the required storage object can be provided to the client that sent the request through the connected object storage server, thereby realizing business support for the user.

[0032] In order to limit the network bandwidth in the distributed system when responding to the object storage request, the bandwidth limitation of the distributed storage service can be implemented through the centralized cache counting center 102 and the traffic monitoring and counting device 104 deployed in the distributed system.

[0033] Specifically, the traffic monitoring and counting device 104 deployed in the object storage server 103 can be mainly used to detect traffic data in real time according to the received business request, so as to count the single-machine traffic data of a single object storage server 103 through each counting device 104, and can send its statistical traffic data to the centralized cache counting center 102 independent of the server, so that the centralized cache counting center 102 can configure the flow limiting threshold in real time based on the business level of the requested business, and count the total flow of the traffic data, so as to determine the bandwidth threshold for shared machines to realize business needs based on the traffic statistics of multiple machines that may be accessed simultaneously by the requested business, and after counting the global traffic in the distributed system, each traffic monitoring and counting device can effectively limit the overall access bandwidth of the requested business on each object storage server according to the configured flow limiting threshold and the total flow counted.

[0034] Among them, the flow limiting threshold is configured in real time based on the service level of the requested service. It can be achieved by defining a token for the request amount of the requested service and configuring the service token bucket threshold. The specific system can put tokens into the token bucket at a constant speed. If the request needs to be processed, it is necessary to get a token from the bucket first. When there is no token available in the bucket, the service is denied. The request amount is limited based on the token, and then the bandwidth limit of the requested service is achieved.

[0035] In the provided network bandwidth limitation system, the Local (i.e., a single traffic monitoring and counting device corresponds to a single object storage server one-to-one) and Distributed (i.e., a plurality of traffic monitoring and counting devices correspond to a single centralized cache counting center) architectures can be used to limit the bandwidth. The deployment of the traffic monitoring and counting device in the Local can prevent the exhaustion of the local network card resources. The deployment of the centralized cache counting center in the Distributed can prevent the Bucket (i.e., the storage bucket, which is the carrier of the object and can be understood as the container for storing the object) from consuming excessive bandwidth resources. At the same time, the Distributed can also control the bandwidth of the entire business, prevent the exhaustion of the bandwidth resources of the entire computer room, realize the flexibility, accuracy and efficiency of bandwidth limitation, and improve the stability and disaster resistance of the basic storage services.

[0036] Reference Figure 2 , shows a flowchart of the steps of the network bandwidth limitation method provided in an embodiment of the present invention, which is applied to a distributed system, and the distributed system includes a centralized cache counting center and at least one object storage server. Among them, a traffic monitoring and counting device can be deployed in each storage server, and the centralized cache counting center can provide data counting services independent of the server, which can specifically include the following steps:

[0037] Step 201: receiving a service request sent by a client through at least one object storage server;

[0038] When a client makes a business request for object storage, it can communicate with the object storage server. At this time, the requested read and write business may need to access multiple machines. The object storage server directly connected to the client may be one or more object storage servers with various capabilities involved in the distributed system. The business request sent by the client can be received through the connected object storage server, and the required storage objects can be provided to the client that sent the request through the connected object storage server, thereby realizing business support for the user.

[0039] Step 202, using each flow monitoring and counting device to detect flow data in real time according to the service request, and sending the flow data to a centralized cache counting center;

[0040] In order to limit the network bandwidth in the distributed system when responding to the object storage request, the bandwidth limitation of the distributed storage service can be implemented through the centralized cache counting center and traffic monitoring and counting device deployed in the distributed system.

[0041] Specifically, by adding a traffic monitoring and counting device to each object storage server to detect the traffic size in real time, it is possible to count the single-machine traffic data of a single object storage server, so that bandwidth can be limited based on the configured threshold of the bandwidth that the single machine can bear. It is also possible to count the total traffic of the network bandwidth accessed by the storage business of the distributed system by counting the single-machine traffic data requested by each object storage server, so that a threshold judgment can be made on the overall access bandwidth.

[0042] In actual applications, after the traffic data of the requested services in each object storage server is detected in real time through the deployed traffic monitoring and counting devices, the traffic data can be sent to the centralized cache counting center independent of the server, so that the centralized cache counting center can configure the flow limiting threshold in real time based on the service level of the requested service, and count the total flow of the traffic data. Among them, the configured flow limiting threshold is not pre-set, but can be set in real time based on the needs corresponding to different service levels. The real-time setting based on the service can realize the configuration of bandwidth limit threshold according to the actual service, and flexibly allocate network bandwidth resources for different levels of services, thereby greatly improving the resource allocation capability, and can give priority to the storage and download of the company's key services, improve the flexibility of the company's business resource scheduling, and ensure the stable and continuous operation of the company's key services.

[0043] Among them, the real-time configuration of the flow limiting threshold can be achieved by defining a token for the request amount of the requested service and configuring the service token bucket threshold. The specific system can put tokens into the token bucket at a constant speed. If the request needs to be processed, it is necessary to first obtain a token from the bucket. When there is no token available in the bucket, the service is denied. The request amount is limited based on the token, and then the bandwidth of the requested service is limited.

[0044] Step 203: The network bandwidth of the requested service is limited according to the flow limiting threshold and the total flow through each flow monitoring and counting device.

[0045] In the embodiment of the present invention, the network bandwidth in the distributed system is limited, and the bandwidth limitation of the distributed storage service can be achieved through the centralized cache counting center and the traffic monitoring and counting device deployed in the distributed system.

[0046] Specifically, after statistics are collected on the global traffic in the distributed system, the traffic monitoring and counting devices deployed on the object storage servers can effectively limit the overall access bandwidth of the services requested on each object storage server according to the configured current limiting threshold and the total traffic counted. Specifically, the total traffic counted can be used to perform a threshold judgment based on the configured threshold, and based on the result of the threshold comparison, it can be determined whether to execute a bandwidth restriction instruction on the current distributed system.

[0047] In an embodiment of the present invention, in the storage service of a distributed system, a flow monitoring and counting device is added to each object storage server to monitor the flow size of the service requested by the service request, and a centralized cache counting center is added to count the total flow of each object storage server in the distributed system, and the flow limiting threshold can be configured in real time based on the service level of the requested service, so as to determine the bandwidth threshold for the shared machine to achieve the business demand on the basis of flow statistics of multiple machines that may be accessed by the requested service at the same time, and the distributed storage service bandwidth limitation problem can be efficiently handled, and the network bandwidth of the requested service in the distributed system can be limited, and based on the real-time configured flow limiting threshold, the bandwidth of machines with different capabilities that the requested service needs to access can be limited, thereby achieving effective limitation of the storage service.

[0048] Reference Figure 3 , shows another step flow chart of the network bandwidth limitation method provided in an embodiment of the present invention, which may specifically include the following steps:

[0049] Step 301: receiving a read / write request for a requested service sent by a client through an object storage service interface;

[0050] In an embodiment of the present invention, the client and the object storage server may be communicatively connected via an object storage service interface.

[0051] Specifically, when a business request sent by a client is received through at least one object storage server, the read and write requests for the requested business sent by the client are mainly received through the object storage service interface. At this time, the object storage interface can respond to the storage objects read and written in the read and write requests, determine the object storage server where the requested business is located, and then directly connect the client to the corresponding object storage server determined through the object storage interface to complete the communication connection between the client and the object storage server.

[0052] Step 302, counting traffic data according to a preset time period, and sending the counted traffic data to a centralized cache counting center;

[0053] In order to limit the network bandwidth in the distributed system when responding to the object storage request, the bandwidth limitation of the distributed storage service can be implemented through the centralized cache counting center and traffic monitoring and counting device deployed in the distributed system.

[0054] Specifically, a traffic monitoring and counting device can be added to each object storage server to detect the traffic size in real time, so as to count the single-machine traffic data of a single object storage server, so as to subsequently limit the bandwidth based on the configured thresholds for the single-machine tolerable bandwidth and the overall access bandwidth.

[0055] The real-time detection operation of the traffic data by the traffic monitoring and counting device can count the traffic of the services requested by the corresponding read and write requests according to the preset time period through at least one traffic monitoring and counting device. Specifically, it can be manifested as sliding on the data stream using a time window (i.e., a specific time period) to calculate the transmission traffic within a certain time. Then, the counted traffic data can be timed, that is, pushed to the centralized cache counting center at preset time intervals, such as 1 minute intervals, so as to submit data to the centralized cache counting center after accumulating the reading of specific bytes (manifested as real-time statistics and timed data push), thereby greatly reducing the interaction with the cache counting center and improving the performance of the entire system.

[0056] In a preferred embodiment, the total flow of the flow data sent by each flow monitoring and counting device can be counted by a centralized cache counting center to implement flow statistics for multiple machines that may be accessed simultaneously by the requested service.

[0057] The centralized cache counting center can be built based on Redis (essentially a Key-Value storage system). When performing statistics on the total flow, the object storage server where each flow monitoring and counting device of the sent flow data is located can be obtained first, and the business object carrier of the corresponding request service of each flow data can be determined. The determined business object carrier can refer to the machine that the requested service needs to access in the distributed storage service, which can include the single machine that the requested service needs to access, the Bucket used to carry the service, and the system global, in combination with Redis's evalsha command (through the built-in Lua interpreter The Lua script is executed by a decoder to return data after executing the Lua script) to ensure the atomic execution characteristics of the Lua script (that is, the operation cannot be interrupted), and the atomic increase operation in the Lua script is used to calculate the total traffic of each single machine in the preset time period based on the object carrier corresponding to the traffic data, and the total traffic of the global business and the business bucket in the preset time period is obtained by calculating the total traffic of each single machine in the preset time period, that is, the total traffic of each single machine, the total traffic of the global business, and the total traffic of the business bucket are calculated, so as to subsequently limit the bandwidth based on the configured thresholds for the bandwidth that the single machine can bear and the overall access bandwidth.

[0058] Among them, the centralized cache counting center can be built based on Redis (essentially a Key-Value storage system). At this time, when counting, the business object carrier and its total traffic within a preset time period can be stored as key-value pairs in the centralized cache counting center. For example, the internal Bucket name is used as the counting key, and the traffic sum of this Bucket within a certain time period is stored as the value Value, so as to calculate the global traffic sum of the business.

[0059] In a preferred embodiment, the centralized cache counting center can also configure the flow limiting threshold in real time based on the service level of the requested service, so that the bandwidth limiting threshold can be configured according to the actual service based on the real-time setting of the service, and network bandwidth resources can be flexibly allocated for services of different levels, thereby greatly improving the resource allocation capability. Specifically, different affordable bandwidth thresholds can be configured by the centralized cache counting center based on the service level of the requested service. The affordable bandwidth threshold configured for each level of the requested service can include a single machine affordable bandwidth threshold, a bucket-level affordable bandwidth threshold, and a system-wide affordable bandwidth threshold. At this time, the centralized cache counting center can send the flow limiting threshold to each traffic monitoring and counting device to perform subsequent bandwidth restrictions.

[0060] Step 303: perform a threshold comparison based on the real-time configuration flow limiting threshold value based on the service level of the requested service and the counted traffic sum, and limit the network bandwidth of the requested service when the threshold comparison result is the bandwidth upper limit.

[0061] Based on the deployed centralized cache counting center and traffic monitoring and counting device, bandwidth limitation for distributed storage services can be achieved. Specifically, this can be achieved by comparing the total traffic count with the configured current limiting threshold, and the network bandwidth of the requested service can be limited according to the threshold comparison result.

[0062] Among them, the flow limiting threshold configured based on business needs may include the configured single-machine tolerable bandwidth threshold, the configured Bucket-level tolerable bandwidth threshold, and the configured system-wide tolerable bandwidth threshold, so as to set threshold limits on the network bandwidth of a single storage object server (i.e., a single machine), a Bucket host, and the entire distributed storage business.

[0063] Specifically, the token bucket current limiting algorithm (which is the most commonly used algorithm in network traffic shaping (Traffic Shaping) and rate limiting (Rate Limiting), which can be used to control the number of data sent to the network and allow the sending of burst data) can be combined to judge the real-time data statistics, that is, the total traffic in the preset time period, the total traffic of the business bucket in the preset time period, and the total traffic of the global business in the preset time period are respectively compared with the configured single-machine tolerable bandwidth threshold, the configured Bucket-level tolerable bandwidth threshold, and the configured system-global tolerable bandwidth threshold in turn. Then, when the threshold comparison result is the bandwidth upper limit, that is, when the threshold comparison result is the single-machine bandwidth upper limit or the Bucket-level bandwidth upper limit or the system business global bandwidth upper limit, the network bandwidth of the requested business is limited, so as to effectively limit the large bandwidth occupied by the download of large files in the video field.

[0064] The threshold comparison can be performed in the aforementioned order, that is, first, it can be determined whether the traffic data detected in real time in a single object storage server exceeds the bandwidth threshold that a single machine can bear. If the total traffic of each single machine within the preset time period exceeds the configured bandwidth threshold that a single machine can bear, it indicates that the bandwidth upper limit of the single machine is reached at this time, and the access bandwidth of the distributed storage service needs to be limited; otherwise, it can continue to be determined whether the total traffic of the business Bucket within the preset time period exceeds the bandwidth threshold that the Bucket level can bear. If it exceeds this threshold, it indicates that the bandwidth upper limit of the Bucket level is reached. At this time, the access bandwidth of the distributed storage service also needs to be limited; otherwise, it can continue to be determined whether the total traffic of the global business within the preset time period calculated based on the total traffic of each business carrier exceeds the global bandwidth threshold that the system can bear. If it exceeds this threshold, it indicates the global bandwidth upper limit of the overall system business. At this time, the access bandwidth of the distributed storage service also needs to be limited. Otherwise, the requested business object can be transmitted normally, that is, business support can be provided to the client user normally.

[0065] The network bandwidth of the requested service is limited. The bandwidth limiting method performed by the traffic monitoring and counting device can generate bandwidth limitation information for the requested service through each traffic monitoring and counting device, and send the bandwidth limitation information to the client, so that the bandwidth limitation information sent can be used to inform the user on the client to reduce the request amount for the requested service.

[0066] In practical applications, the communication transmission between the distributed system and the client can be sent in the form of Nginx. The bandwidth limitation information can be expressed as a pre-agreed Nginx status code indicating that the bandwidth has reached the upper limit. When the bandwidth needs to be limited, the flow limiting instruction can be executed through the traffic monitoring and counting device. This flow limiting instruction can send the pre-agreed Nginx status code to the client to prompt the user to lower the request amount.

[0067] In an embodiment of the present invention, in the storage service of a distributed system, a traffic monitoring and counting device is added to each object storage server to monitor the traffic size of the service requested by the service request, and a centralized cache counting center is added to count the total traffic of each object storage server in the distributed system, and the service token threshold can be configured in real time based on the business needs of the requested service, so as to determine the bandwidth threshold of the shared machine to meet the business needs on the basis of traffic statistics of multiple machines that may be accessed simultaneously by the requested service, and the distributed storage service bandwidth limitation problem can be efficiently handled, and the network bandwidth of the requested service in the distributed system can be limited, so as to meet the effective limitation of the storage service in the case of multiple machines with different capabilities.

[0068] Reference Figure 4, which shows an application scenario diagram of the network bandwidth limitation provided in an embodiment of the present invention, and its application scenario can be applied to the following: Figure 1 The network bandwidth limitation system shown is applicable to enterprises that need to use object storage services, have massive data transmission, and need to classify, limit, and fuse their services.

[0069] In an embodiment of the present invention, the network bandwidth in a distributed system is limited, and the bandwidth limitation of the distributed storage service can be achieved through device A (i.e., a traffic monitoring and counting device) and device B (i.e., a centralized cache counting center) deployed in the distributed system.

[0070] Among them, the traffic monitoring and counting device can be mainly deployed in the object storage server. It can be responsible for counting the traffic according to the preset time period and pushing the data to the device B according to the preset time interval, and is responsible for judging whether to perform the flow limiting operation, and if so, executing the flow limiting instruction; the centralized cache counting center is independent of the data counting service of the business. On the one hand, it can be used as a traffic upper limit center for business configuration (Config) (referring to the configuration of flow limiting, which can be realized by configuring the business token bucket threshold), and on the other hand, it can also be used as a business Bucket and overall traffic atomic counting (Count) center, which is equivalent to the operation of an independent thread and will not affect the normal operation of the business. That is, by adding a traffic monitoring and counting device A in each object storage server to detect the traffic size in real time, and by adding a centralized cache counting center to configure the threshold of the overall access bandwidth of the global business or a certain business carrier, effective restrictions on the distributed storage business can be achieved.

[0071] The process of limiting the bandwidth of the distributed storage service through the traffic monitoring and counting device (ie, device A) and the centralized cache counting center (ie, device B) can be as follows:

[0072] I. The process of connecting the client to the object storage server: The user can initiate a read or write request to one of the OSS servers (the server where the requested file is located, i.e. the object storage server) through the client's HTTP protocol (HyperText Transfer Protocol), thus completing the data transmission connection established between the client and the server;

[0073] II. Real-time traffic detection process: When the traffic monitoring and counting device added to each object storage server transmits data between the OSS service and the client, it can slide on the data stream according to the preset time period, specifically using the time window to calculate the transmission traffic within a certain period of time (i.e., real-time detection of traffic data);

[0074] III. Traffic sum statistics process: The traffic monitoring and counting device can push the statistical data to the centralized cache counting center at a preset time interval, such as 1 minute. At this time, the centralized cache counting center can use Redis atomic increase operation to calculate the traffic of the business global and business object carrier Bucket in real time. The Bucket name can be used as the counting key inside, and the traffic sum during this period is stored as the Value;

[0075] IV. The centralized cache counting center can send the total traffic calculated in real time and the service token bucket threshold configured in real time based on the service level of the requested service to the traffic monitoring and counting device;

[0076] V. Threshold comparison process: The traffic monitoring and counting device can use a token bucket current limiting algorithm to compare the thresholds, and limit the bandwidth when the threshold comparison result is the bandwidth upper limit, wherein the token bucket current limiting algorithm can be expressed as the traffic monitoring and counting device compares the total traffic of each single machine in the preset time period, the total traffic of the business bucket in the preset time period, and the total traffic of the global business in the preset time period with the configured single machine tolerable bandwidth threshold, the configured Bucket-level tolerable bandwidth threshold, and the configured system global tolerable bandwidth threshold in order according to the configured service token bucket threshold. That is, when the threshold comparison result is the single machine bandwidth upper limit, the Bucket-level bandwidth upper limit, and the system service global bandwidth upper limit, the network bandwidth of the requested service needs to be limited, otherwise the requested service object can be transmitted normally, that is, the service support is provided to the client user normally;

[0077] VI. In the case where it is determined that bandwidth limitation is required, a flow limiting instruction may be executed through a flow monitoring and counting device. This flow limiting instruction may send a pre-agreed Nginx status code to the client to prompt the user to lower the request amount.

[0078] In the embodiment of the present invention, by adding a traffic monitoring and counting device in each object storage server to detect the traffic size in real time, and by adding a centralized cache counting center to configure the threshold of the overall access bandwidth carried by the global business or a certain business object, effective restriction of the distributed storage business is achieved.

[0079] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.

[0080] Reference Figure 5 , shows a schematic diagram of the structure of a network bandwidth limiting device provided in an embodiment of the present invention, which is applied to a distributed system. The distributed system includes a centralized cache counting center and at least one object storage server, and may specifically include the following modules:

[0081] The service request receiving module 501 is located in the object storage server and is used to receive the service request sent by the client; wherein each object storage server is deployed with a flow monitoring and counting device;

[0082] The flow data monitoring module 502 is located in the flow monitoring and counting device, and is used to detect the flow data in real time according to the service request, and send the flow data to the centralized cache counting center; the centralized cache counting center is used to configure the flow limiting threshold in real time based on the service level of the requested service, and count the total flow of the flow data;

[0083] The bandwidth limiting module 503 is located in the flow monitoring and counting device and is used to limit the network bandwidth of the requested object according to the flow limiting threshold and the total flow.

[0084] In an embodiment of the present invention, the service request includes a read and write request for the requested service, and the traffic data monitoring module 502 may include the following submodules:

[0085] The flow data statistics submodule is located in the flow monitoring and counting device, and is used to count the flow of the services requested by the corresponding read and write requests according to the preset time period, and push the counted flow data to the centralized cache counting center according to the preset time interval.

[0086] In one embodiment of the present invention, the centralized cache counting center is built based on Redis, and the device may further include the following modules:

[0087] A flow sum counting module, located in the centralized cache counting center, is used to count the flow sum of the flow data sent by each flow monitoring and counting device;

[0088] The traffic sum counting module may include the following submodules:

[0089] The object carrier determination submodule is used to obtain the object storage server where each flow monitoring and counting device of the sent flow data is located, and determine the business object carrier of the corresponding request service of each flow data; wherein the business object carrier includes the single machine that the requested service needs to access, the Bucket used to carry the service, and the system global;

[0090] The traffic sum counting submodule is located in the centralized cache counting center and is used to calculate the traffic sum of each single machine within a preset time period based on the traffic data corresponding to each business object carrier, and to obtain the traffic sum of the global business and the business bucket within the preset time period by calculating the traffic sum of the single machine within the preset time period; wherein the business object carrier and its traffic sum within the preset time period are respectively stored as key-value pairs in the centralized cache counting center.

[0091] In one embodiment of the present invention, the device may further include the following modules:

[0092] The flow limiting threshold sending module is located in the centralized cache counting center and is used to send the flow limiting threshold to each flow monitoring and counting device, wherein the flow limiting threshold includes different affordable bandwidth thresholds configured according to the service level of the requested service; wherein the affordable bandwidth threshold configured for each level of requested service includes a single-machine affordable bandwidth threshold, a Bucket-level affordable bandwidth threshold, and a system-wide affordable bandwidth threshold.

[0093] In an embodiment of the present invention, the traffic sum includes the traffic sum of each stand-alone machine within a preset time period, the traffic sum of the service bucket within a preset time period, and the traffic sum of the global service within a preset time period; the bandwidth limiting module 503 may include the following submodules:

[0094] A threshold comparison submodule, located in the quantity monitoring and counting device, is used to compare the total traffic of each single machine in a preset time period, the total traffic of the service bucket in a preset time period, and the total traffic of the global service in a preset time period with the configured single machine tolerable bandwidth threshold, the configured Bucket-level tolerable bandwidth threshold, and the configured system global tolerable bandwidth threshold in sequence;

[0095] The bandwidth limiting submodule is used to limit the network bandwidth of the requested service when the threshold comparison result is the bandwidth upper limit.

[0096] In one embodiment of the present invention, the bandwidth limitation submodule may include the following units:

[0097] The bandwidth limiting unit is used to limit the network bandwidth of the requested service when the threshold comparison result is a single-machine bandwidth upper limit, a bucket-level bandwidth upper limit, or a system service global bandwidth upper limit; wherein, when the sum of the traffic of each single machine in a preset time period exceeds the configured single-machine tolerable bandwidth threshold, it indicates the single-machine bandwidth upper limit; when the sum of the traffic of the service bucket in the preset time period exceeds the bucket-level tolerable bandwidth threshold, it indicates the bucket-level bandwidth upper limit; when the sum of the global traffic of the service in the preset time period exceeds the system global tolerable bandwidth threshold, it indicates the system service global bandwidth upper limit.

[0098] In one embodiment of the present invention, the bandwidth limiting unit may include the following subunits:

[0099] The bandwidth limitation subunit is located in the traffic monitoring and counting device, and is used to generate bandwidth limitation information for the requested service and send the bandwidth limitation information to the client; the bandwidth limitation information is used to inform the user at the client to reduce the request amount for the requested service.

[0100] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0101] The embodiment of the present invention further provides an electronic device, such as Figure 6 As shown, it includes a processor 601, a communication interface 602, a memory 603 and a communication bus 604, wherein the processor 601, the communication interface 602, and the memory 603 communicate with each other through the communication bus 604.

[0102] Memory 603, used for storing computer programs;

[0103] The processor 601 is used to execute the program stored in the memory 603 to implement the following steps:

[0104] Receiving a service request sent by a client through at least one object storage server; wherein each object storage server is deployed with a flow monitoring and counting device;

[0105] The flow data is detected in real time according to the service request by each flow monitoring and counting device, and the flow data is sent to the centralized cache counting center; the centralized cache counting center is used to configure the flow limiting threshold in real time based on the service level of the requested service, and count the total flow of the flow data;

[0106] The network bandwidth of the requested service is limited according to the current limiting threshold and the total flow through each flow monitoring and counting device.

[0107] The communication bus mentioned in the above terminal can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0108] The communication interface is used for communication between the above terminal and other devices.

[0109] The memory may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0110] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0111] In another embodiment of the present invention, a computer-readable storage medium is provided. The computer-readable storage medium stores instructions. When the instructions are executed on a computer, the computer executes the steps of the network bandwidth limitation method described in any of the above embodiments.

[0112] In another embodiment of the present invention, a computer program product including instructions is provided. When the computer program product is run on a computer, the computer executes the steps of any of the network bandwidth limiting methods described in the above embodiments.

[0113] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk SolidStateDisk (SSD)), etc.

[0114] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0115] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0116] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.

Claims

1. A network bandwidth limiting method, characterized in that: Applied to a distributed system, the distributed system includes a centralized cache counting center and at least one object storage server, the method includes: Receiving a service request sent by a client through at least one object storage server; wherein each object storage server is deployed with a flow monitoring and counting device, and the service request includes a read and write request for the requested service; The flow data is detected in real time according to the service request by each flow monitoring and counting device, and the flow data is sent to the centralized cache counting center, including: the flow of the service requested by the corresponding read and write request is counted by each flow monitoring and counting device according to a preset time period, and the counted flow data is pushed to the centralized cache counting center according to a preset time interval; the centralized cache counting center is used to configure the flow limiting threshold in real time based on the service level of the requested service, and count the total flow of the flow data; The network bandwidth of the requested service is limited according to the flow limiting threshold and the flow sum by means of each flow monitoring and counting device. The network bandwidth limitation includes limiting the network bandwidth of the requested service according to the flow sum of a single object storage server and the flow limiting threshold configured for the single object storage server, and limiting the network bandwidth of the requested service according to the overall flow sum of at least one object storage server in the distributed system and the flow limiting threshold configured for at least one object storage server as a whole.

2. The method according to claim 1, characterized in that The centralized cache counting center is built based on Redis and also includes: The centralized cache counting center counts the total flow of the flow data sent by each flow monitoring and counting device; The counting of the total flow of the flow data sent by each flow monitoring and counting device by the centralized cache counting center includes: Obtain the object storage server where each traffic monitoring and counting device of the sent traffic data is located, and determine the business object carrier of the corresponding request service of each traffic data; wherein the business object carrier includes a single machine that needs to be accessed by the requested service, a Bucket for carrying the service, and a system global; The centralized cache counting center calculates the total traffic of each single machine within a preset time period based on the traffic data corresponding to each business object carrier, and obtains the total traffic of the global business and the business bucket within the preset time period by calculating the total traffic of each single machine within the preset time period; wherein the business object carrier and its total traffic within the preset time period are respectively stored as key-value pairs in the centralized cache counting center.

3. The method according to claim 1, characterized in that The method further comprises: The centralized cache counting center sends a flow limiting threshold to each flow monitoring and counting device, wherein the flow limiting threshold includes different affordable bandwidth thresholds configured according to different service levels of the requested service; wherein the affordable bandwidth threshold configured for each level of requested service includes a single-machine affordable bandwidth threshold, a Bucket-level affordable bandwidth threshold, and a system-wide affordable bandwidth threshold.

4. The method according to claim 3, characterized in that The traffic sum includes the traffic sum of each stand-alone machine in the preset time period, the traffic sum of the service bucket in the preset time period, and the traffic sum of the global service in the preset time period; The limiting the network bandwidth of the requested service according to the flow limiting threshold and the total flow by the flow monitoring and counting device includes: The traffic monitoring and counting device compares the total traffic of each single machine in a preset time period, the total traffic of the service bucket in a preset time period, and the total traffic of the global service in a preset time period with the configured single machine tolerable bandwidth threshold, the configured bucket-level tolerable bandwidth threshold, and the configured system global tolerable bandwidth threshold in sequence; When the threshold comparison result is the bandwidth upper limit, the network bandwidth of the requested service is limited.

5. The method according to claim 4, characterized in that When the threshold comparison result is the bandwidth upper limit, limiting the network bandwidth of the requested service includes: When the threshold comparison result is a single-machine bandwidth upper limit, a bucket-level bandwidth upper limit, or a system service global bandwidth upper limit, the network bandwidth of the requested service is restricted; wherein, when the sum of the traffic of each single machine within a preset time period exceeds the configured single-machine tolerable bandwidth threshold, it indicates the single-machine bandwidth upper limit; when the sum of the traffic of the service bucket within a preset time period exceeds the bucket-level tolerable bandwidth threshold, it indicates the bucket-level bandwidth upper limit; when the sum of the global traffic of the service within the preset time period exceeds the system global tolerable bandwidth threshold, it indicates the system service global bandwidth upper limit.

6. The method according to claim 1, 3 or 5, characterized in that: The limiting of the network bandwidth of the requested service includes: The bandwidth limitation information for the requested service is generated by each flow monitoring and counting device, and the bandwidth limitation information is sent to the client; the bandwidth limitation information is used to inform the user at the client to reduce the request amount for the requested service.

7. A network bandwidth limitation system, characterized in that: The network bandwidth limiting system is deployed with a distributed system, and the distributed system includes a centralized cache counting center and at least one object storage server, wherein each object storage server is deployed with a flow monitoring and counting device; The at least one object storage server is used to receive a service request sent by a client, where the service request includes a read and write request for the requested service; Each flow monitoring and counting device is used to detect flow data in real time according to the service request, and send the flow data to the centralized cache counting center, including: using each flow monitoring and counting device to count the flow of the service requested by the corresponding read and write request according to a preset time period, and pushing the counted flow data to the centralized cache counting center according to a preset time interval; The centralized cache counting center is used to configure the flow limiting threshold in real time based on the service level of the requested service, and count the total flow of the flow data; Each traffic monitoring and counting device is also used to limit the network bandwidth of the requested service based on the flow limiting threshold and the flow sum. The network bandwidth limitation includes limiting the network bandwidth of the requested service based on the flow sum of a single object storage server and the flow limiting threshold configured for a single object storage server, and limiting the network bandwidth of the requested service based on the overall flow sum of at least one object storage server in a distributed system and the flow limiting threshold configured for at least one object storage server as a whole.

8. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; The processor is used to implement the steps of the network bandwidth limitation method described in any one of claims 1-6 when executing the program stored in the memory.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the network bandwidth limitation method as described in any one of claims 1 to 6 are implemented.