A flow control method, device, apparatus and storage medium
By using traffic control methods for cloud object storage clusters to filter and statistically analyze historical service request traffic, precise control of data traffic is achieved, solving the problem of low stability of cloud object storage clusters and improving service stability and accuracy.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- TENCENT TECHNOLOGY (SHENZHEN) CO LTD
- Filing Date
- 2024-12-18
- Publication Date
- 2026-06-19
AI Technical Summary
Cloud object storage clusters have low stability when handling data traffic and are prone to abnormal situations such as data loss or service crashes.
By acquiring historical service requests within the first time period, filtering flow control service requests according to the preset flow control strategy, performing flow statistics, determining whether the overall transmission flow has reached the threshold, and receiving target service requests according to the flow threshold within the second time period, precise flow control is achieved.
It improves the stability of cloud object storage services, avoids anomalies caused by excessive data traffic, and enhances the accuracy and timeliness of traffic control.
Smart Images

Figure CN122247932A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a flow control method, apparatus, device, and storage medium. Background Technology
[0002] With the continuous development of technology, more and more client clusters or server clusters can be associated with cloud object storage clusters to provide cloud object storage (COS) services to store unstructured data.
[0003] For example, a multimedia playback software can store or access a large number of multimedia resources without consuming its own storage resources through cloud object storage services provided by a server cluster. For instance, when a client uploads a multimedia resource to the server cluster, the uploaded multimedia resource is saved to the cloud object storage cluster; similarly, when a client loads a multimedia resource from the server cluster, the corresponding multimedia resource is downloaded from the cloud object storage cluster.
[0004] In related technologies, in a device cluster associated with a cloud object storage cluster, there are usually a large number of software, programs, processes and other service requesters that send and receive data through the cloud object storage service provided by the cloud object storage cluster. This causes the cloud object storage cluster to handle a large amount of data traffic, which can easily lead to abnormal situations such as data loss or service crashes, affecting the stability of the cloud object storage service.
[0005] It is evident that there is an urgent need for a traffic control method for cloud object storage clusters in related technologies to ensure the stability of cloud object storage services. Summary of the Invention
[0006] This application provides a flow control method, apparatus, device, and storage medium to address the problem of low stability in data flow processing by cloud object storage clusters.
[0007] Firstly, a flow control method is provided, including:
[0008] Obtain each historical service request received within a first time period; wherein each historical service request is used to read and write data to the cloud object storage cluster;
[0009] For at least one preset flow control policy, perform the following operations respectively:
[0010] Traffic statistics are performed on each flow control service request selected from the historical service requests to obtain the comprehensive transmission traffic of each flow control service request; wherein, each flow control service request is a historical service request containing a flow control object with a flow control policy indication;
[0011] When the total transmission traffic reaches the traffic threshold indicated by the traffic control policy, the system receives each target service request containing the flow control object within a second duration according to the traffic threshold; wherein the start time of the second duration is later than the end time of the first duration.
[0012] Secondly, a flow control device is provided, comprising:
[0013] Acquisition module: used to acquire each historical service request received within a first time period; wherein each historical service request is used to read and write data to the cloud object storage cluster;
[0014] Processing module: Used to perform the following operations for at least one preset flow control policy:
[0015] The processing module is specifically used to: perform traffic statistics on each flow control service request selected from the historical service requests to obtain the comprehensive transmission traffic of each flow control service request; wherein, each flow control service request is: a historical service request containing a flow control object with a flow control policy indication;
[0016] The processing module is specifically used to: when the overall transmission traffic reaches the traffic threshold indicated by the traffic control policy, receive each target service request containing the flow control object within a second duration according to the traffic threshold; wherein the start time of the second duration is later than the end time of the first duration.
[0017] Optionally, the processing module is specifically used for:
[0018] For each historical service request, the following steps are performed: extract at least one request field from a historical service request, and if there is a request field in the at least one request field that matches the flow control object, then treat the historical service request as a flow control service request.
[0019] Traffic statistics are performed on each obtained flow control service request to obtain the comprehensive transmission traffic of each flow control service request.
[0020] Optionally, the processing module is specifically used to perform any of the following methods:
[0021] When the traffic threshold includes a quantity threshold, the total number of requests for each flow control service request within a unit of time is statistically obtained to obtain the comprehensive transmission traffic of each flow control service request.
[0022] When the traffic threshold includes a data volume threshold, the total data volume occupied by each flow control service request per unit time is statistically obtained to obtain the comprehensive transmission traffic of each flow control service request.
[0023] Optionally, each historical service request is received by multiple request receiving processes;
[0024] The processing module is specifically used for:
[0025] The multiple request receiving processes are invoked to perform the following: filter out at least one flow control service request from the multiple received historical service requests, and perform traffic statistics on the at least one flow control service request to obtain the intra-process transmission traffic;
[0026] The data processing process associated with the flow control policy is invoked to perform the following: integrate the intra-process transmission traffic statistics of the multiple request receiving processes to obtain the comprehensive transmission traffic of each flow control service request.
[0027] Optionally, the processing module is specifically used for:
[0028] Determine the traffic difference between the total transmission traffic and the traffic threshold;
[0029] Based on the preset mapping relationship between each reference overflow value and each reference rejection probability, the reference rejection probability corresponding to the traffic difference is determined as the request rejection probability;
[0030] Based on the request rejection probability, each target service request containing the flow control object is received within the second time period.
[0031] Optionally, the processing module is specifically used for:
[0032] The overflow ratio of the overall transmission traffic is determined based on the ratio between the traffic difference and the preset overflow limit for the traffic control strategy.
[0033] Based on the preset mapping relationship between each reference overflow value and each reference rejection probability, the reference rejection probability corresponding to the overflow ratio is determined as the request rejection probability.
[0034] Optionally, the reference overflow value is positively correlated with the reference rejection probability.
[0035] Optionally, the mapping relationship is a piecewise quadratic function, and for each of the reference overflow values, the multiple first segment overflow values that are less than the segment threshold: the multiple first segment overflow values and their respective corresponding reference rejection probabilities satisfy the first piecewise quadratic function, and the first segment overflow value is positively correlated with the slope of the first piecewise quadratic function.
[0036] Optionally, the mapping relationship is a piecewise quadratic function, and for each of the reference overflow values, there are multiple second segment overflow values that are not less than the segment threshold: the multiple second segment overflow values and their respective corresponding reference rejection probabilities satisfy the second segment quadratic function, and the second segment overflow value is negatively correlated with the slope of the second segment quadratic function.
[0037] Optionally, the mapping relationship satisfies the following formula:
[0038]
[0039] Where x represents a reference overflow value and p represents a reference rejection probability.
[0040] Optionally, each historical service request is received by multiple request receiving processes, and the overall transmission traffic is determined by the data processing process associated with the traffic control strategy.
[0041] The processing module is specifically used for:
[0042] The data processing process associated with the aforementioned traffic control strategy is invoked, and when the total transmission traffic reaches the traffic threshold indicated by the traffic control strategy, the request rejection probability corresponding to the traffic control strategy is determined based on the traffic threshold.
[0043] The plurality of request receiving processes are invoked to perform the following: based on the request rejection probability, receive at least one target service request containing the flow control object within a second time period.
[0044] Optionally, the first duration is the duration within any period with the third duration as the period, and the third duration is not less than the first duration.
[0045] Thirdly, a computer program product is provided, including a computer program that, when executed by a processor, implements the method described in the first aspect.
[0046] Fourthly, a computer device is provided, comprising:
[0047] Memory, used to store program instructions;
[0048] A processor is configured to invoke program instructions stored in the memory and execute the method described in the first aspect according to the obtained program instructions.
[0049] Fifthly, a computer-readable storage medium is provided, the computer-readable storage medium storing computer-executable instructions for causing a computer to perform the method as described in the first aspect.
[0050] In this embodiment of the application, by detecting each historical service request received within the first time period, the data traffic carried by the cloud object storage cluster can be perceived. Thus, corresponding traffic control can be applied to the excessive data traffic within the second time period to avoid abnormal situations in the cloud object storage service due to large data traffic and to ensure the stability of the cloud object storage service.
[0051] Furthermore, according to each preset traffic control policy, traffic control service requests that meet the corresponding traffic control policy can be selected from each historical service request. By statistically analyzing the comprehensive transmission traffic of each traffic control service request, it can be sensed whether the data traffic that meets the traffic control policy exceeds the limit. Thus, if the limit is exceeded, targeted traffic control can be carried out within a second time period according to the traffic threshold indicated by the traffic control policy. This avoids the situation of applying a one-size-fits-all approach to traffic control, improves the accuracy of traffic control, and achieves the goal of ensuring the stability of cloud object storage services.
[0052] Furthermore, by sensing the traffic situation within the first time period, timely and accurate traffic control can be implemented for the second time period, which is later than the first time period, thus ensuring the stability of cloud object storage services to a certain extent. Attached Figure Description
[0053] Figure 1A This is a schematic diagram illustrating an application field of the flow control method provided in the embodiments of this application;
[0054] Figure 1B This is one application scenario of the flow control method provided in the embodiments of this application;
[0055] Figure 2 A flowchart illustrating a flow control method provided in an embodiment of this application;
[0056] Figure 3A A schematic diagram illustrating the principle of the flow control method provided in this application embodiment;
[0057] Figure 3B A schematic diagram of the principle of the flow control method provided in the embodiments of this application. Figure 2 ;
[0058] Figure 4A A schematic diagram three illustrating the principle of the flow control method provided in this application embodiment;
[0059] Figure 4B A schematic diagram four illustrating the principle of the flow control method provided in this application embodiment;
[0060] Figure 4C A schematic diagram five illustrating the principle of the flow control method provided in the embodiments of this application;
[0061] Figure 4D A schematic diagram six illustrating the principle of the flow control method provided in the embodiments of this application;
[0062] Figure 4E A schematic diagram seven illustrating the principle of the flow control method provided in this application embodiment;
[0063] Figure 5A A schematic diagram of the principle of the flow control method provided in the embodiments of this application. Figure 8 ;
[0064] Figure 5B A schematic diagram of the principle of the flow control method provided in the embodiments of this application. Figure 9 ;
[0065] Figure 6A A schematic diagram of the principle of the flow control method provided in the embodiments of this application is shown in Figure 10.
[0066] Figure 6B 11. A schematic diagram of the principle of the flow control method provided in the embodiments of this application;
[0067] Figure 6C A schematic diagram twelve illustrating the principle of the flow control method provided in this application embodiment;
[0068] Figure 7A A schematic diagram thirteen illustrating the principle of the flow control method provided in this application embodiment;
[0069] Figure 7B Fourteen is a schematic diagram illustrating the principle of the flow control method provided in the embodiments of this application;
[0070] Figure 7C A schematic diagram fifteen illustrating the principle of the flow control method provided in the embodiments of this application;
[0071] Figure 8 A schematic diagram of the flow control device provided in the embodiments of this application is shown below;
[0072] Figure 9 A schematic diagram of the flow control device provided in the embodiments of this application. Figure 2 . Detailed Implementation
[0073] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings.
[0074] The following explanations of some terms used in the embodiments of this application are provided to facilitate understanding by those skilled in the art.
[0075] (1) Flow rate:
[0076] In network communication, traffic refers to the total amount of data transmitted through the network per unit of time. It can be measured in bits per second (bps), kilobits per second (Kbps), megabits per second (Mbps), or gigabits per second (Gbps), among other metrics. Network traffic includes upload traffic (the amount of data sent from the local device to the network) and download traffic (the amount of data received from the network to the local device). Network administrators frequently monitor traffic to ensure network performance and security.
[0077] (2) Cloud object storage:
[0078] Cloud object storage is a cloud computing service that provides an efficient and scalable way to store and manage large amounts of unstructured data. Unstructured data typically includes images, videos, documents, and other binary files. Cloud object storage uses a flat structure, where each object (or file) is stored in a so-called "bucket" and has a unique identifier.
[0079] (3) Common Gateway Interface (CGI):
[0080] A Common Gateway Interface (CGI) is a standard protocol used for interaction between a web server and external applications. It defines how a web server forwards client requests to external programs and receives data returned by these programs to generate dynamic content. Through CGI, a web server can invoke standalone applications or scripts to process user requests, such as form submissions and database queries, and then format the results as HTML pages to return to the user.
[0081] This application relates to Artificial Intelligence (AI) technology and cloud computing. AI technology and cloud computing can be applied to many fields, such as smart homes, smart wearable devices, virtual assistants, smart speakers, smart marketing, autonomous driving, smart transportation, smart maps, driver assistance systems, vehicle terminals, aircraft, digital twins, virtual humans, robots, AI-generated content (AIGC), conversational interaction, smart healthcare, smart customer service, game AI, etc. It is believed that with the development of technology, AI technology and cloud computing will be applied in more fields and play an increasingly important role.
[0082] It should be noted that the operations involving obtaining historical service requests and other data in the embodiments of this application require user permission or consent when applied to specific products or technologies, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0083] In this application embodiment, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.
[0084] The application areas of the flow control method provided in the embodiments of this application will be briefly introduced below.
[0085] With the continuous development of technology, more and more client clusters or server clusters can be associated with cloud object storage clusters to provide cloud object storage (COS) services to store unstructured data.
[0086] Please refer to Figure 1A A multimedia playback software can store or access a large number of multimedia resources without consuming its own storage resources through cloud object storage services provided by a server cluster. For example, when a client uploads a multimedia resource to the server cluster, the uploaded multimedia resource is saved to the cloud object storage cluster; similarly, when a client loads a multimedia resource from the server cluster, the corresponding multimedia resource is downloaded from the cloud object storage cluster.
[0087] In related technologies, in device clusters associated with large-scale distributed cloud object storage clusters, there are usually a large number of service requesting clients such as software, programs, and processes that send and receive data through the cloud object storage service provided by the cloud object storage cluster. This causes the cloud object storage cluster to handle a large amount of data traffic, which can easily lead to abnormal situations such as data loss or service crashes, affecting the stability of the cloud object storage service.
[0088] It is evident that there is an urgent need for a traffic control method for cloud object storage clusters in related technologies to ensure the stability of cloud object storage services.
[0089] To address the issue of low stability in data traffic processing by cloud object storage clusters, this application proposes a traffic control method. This method is applied to a cloud object storage cluster, and in this method, it acquires each historical service request received within a first time period, where each historical service request is used for data read / write operations on the cloud object storage cluster. For at least one preset traffic control policy, the following operations are performed respectively:
[0090] Traffic statistics are performed on each flow control service request selected from historical service requests to obtain the overall transmission traffic of each flow control service request. Each flow control service request is a historical service request containing a flow control object indicated by a flow control policy. When the overall transmission traffic reaches a traffic threshold indicated by a flow control policy, each target service request containing the flow control object is received within a second time period according to the traffic threshold. The start time of the second time period is later than the end time of the first time period.
[0091] In this embodiment of the application, by detecting each historical service request received within the first time period, the data traffic carried by the cloud object storage cluster can be perceived. Thus, corresponding traffic control can be applied to the excessive data traffic within the second time period to avoid abnormal situations in the cloud object storage service due to large data traffic and to ensure the stability of the cloud object storage service.
[0092] Furthermore, according to each preset traffic control policy, traffic control service requests that meet the corresponding traffic control policy can be selected from each historical service request. By statistically analyzing the comprehensive transmission traffic of each traffic control service request, it can be sensed whether the data traffic that meets the traffic control policy exceeds the limit. Thus, if the limit is exceeded, targeted traffic control can be carried out within a second time period according to the traffic threshold indicated by the traffic control policy. This avoids the situation of applying a one-size-fits-all approach to traffic control, improves the accuracy of traffic control, and achieves the goal of ensuring the stability of cloud object storage services.
[0093] Furthermore, by sensing the traffic situation within the first time period, timely and accurate traffic control can be implemented for the second time period, which is later than the first time period, thus ensuring the stability of cloud object storage services to a certain extent.
[0094] The application scenarios of the flow control method provided in this application are described below.
[0095] Please refer to Figure 1BThis is a schematic diagram illustrating an application scenario of the flow control method provided in this application. The application scenario includes a server cluster 101, a client cluster 102, and a cloud object storage cluster 103. The server cluster 101 and the client cluster 102 can communicate with each other, and the server cluster 101 and the cloud object storage cluster 103 can communicate with each other. The communication method can be wired, such as through a network cable or serial cable; or wireless, such as through Bluetooth or Wireless Fidelity (WIFI), etc., without any specific limitation.
[0096] Client cluster 102 generally refers to a cluster of devices that can have software installed, such as terminal devices, third-party applications accessible by the terminal devices, or web pages accessible by the terminal devices. Server cluster 101 generally refers to a cluster of devices running programs or processes, such as terminal devices or servers.
[0097] Terminal devices include, but are not limited to, mobile phones, computers, smart medical devices, smart home appliances, vehicle terminals, or aircraft. Servers include, but are not limited to, cloud servers, local servers, or associated third-party servers. Server cluster 101, client cluster 102, and cloud object storage cluster 103 can all use cloud computing to reduce the consumption of local computing resources; similarly, they can also use cloud storage to reduce the consumption of local storage resources.
[0098] As one embodiment, the server cluster 101 and the client cluster 102 can be the same device cluster, or they can be different device clusters, or they can be different device clusters with some devices sharing each other, etc., and there are no specific restrictions.
[0099] In response to a search operation triggered by a search software, a client sends a data retrieval command to the corresponding server. The server receives the data retrieval command from the client and sends a data retrieval request to the cloud object storage cluster 103. The cloud object storage cluster 103 receives the data retrieval request from the server and returns the corresponding search dataset. The server receives the search dataset returned by the cloud object storage cluster 103 and arranges the search data contained in the search dataset in list form to obtain the search result presentation data. The server sends the search result presentation data to the client. The client receives the search result presentation data sent by the server and presents a search list of search results arranged in sequential order based on the search result presentation data.
[0100] The following is based on Figure 1B This paper provides a detailed description of the flow control method provided in the embodiments of this application. Please refer to [link / reference]. Figure 2This is a flowchart illustrating a flow control method provided in an embodiment of this application.
[0101] S201, obtain all historical service requests received within the first time period.
[0102] Each historical service request is used to read or write data to the cloud object storage cluster. For example, it may be used to request the storage of data in the cloud object storage cluster, or to request the download of stored data from the cloud object storage cluster.
[0103] For large-scale distributed cloud object storage clusters, there may be various types of business traffic, such as data read and write from multiple software programs, data read and write from multiple company systems, and data read and write from devices located in multiple regions, etc., without any specific restrictions.
[0104] The first duration can be a time period ending at the current time. Please refer to [reference needed]. Figure 3A (1) refers to the period within 1 second ending at the current time; it can also refer to a time period within the previous period adjacent to the current period, which is the third period in time. Please refer to [reference needed]. Figure 3A (2) refers to the 1 second in the previous cycle preceding the current cycle, with a period of 2 seconds; it can also be a time interval within a preset time range, please refer to [reference needed]. Figure 3A (3) in the text, 5 minutes per hour, etc., are not specifically limited.
[0105] As one embodiment, a cloud object storage cluster can run multiple request receiving processes. These processes receive service requests through a Common Gateway Interface (CGI), and each process can receive at least one historical service request. Please refer to [link / reference]. Figure 3B The logical layer of a cloud object storage cluster contains multiple controllers, such as controller_1, controller_2, ..., and controller_N. Each controller runs a request receiving process to receive service requests, such as request receiving process_1, request receiving process_2, ..., and request receiving process_N. The cloud object storage cluster can employ load balancing strategies to distribute the number of service requests received by each request receiving process evenly, avoiding issues such as unreasonable resource utilization.
[0106] S202, for at least one preset flow control policy, perform the following operations S2021 to S2022 respectively.
[0107] A cloud object storage cluster can be associated with at least one traffic control policy. The traffic control policy is used to indicate the object to which traffic control is implemented, i.e., the flow control object; it is also used to indicate the traffic limit, i.e., the traffic threshold.
[0108] Traffic control policies can be set in response to policy input operations, or they can be set based on alarm objects and alarm traffic indicated by stability alarm records of cloud object storage clusters, etc. There are no specific restrictions.
[0109] For example, cloud object storage clusters predefine several key syntactic sugars for policies, such as `enumPredicateType{kEach=0; kEachExcept=1; kTotal=2; kTotalExcept=3;}`, which define multiple predicates to describe which elements in a given set are processed. `kEach=0` means every element in the given set; `kEachExcept=1` means elements in the given set that are included in addition to those in the given list; `kTotal=2` means the sum of all elements in the given set; and `kTotalExcept=3` means the sum of all elements in the given set that are included in the given set in addition to those in the given list. If not specified, `kTotal` is used by default. If the given set is empty, it represents all sets stored in the cloud object storage cluster under the given request attribute.
[0110] For example, the message `Condition{string attribute=1; PredicateType predicate=2; repeated string predicate_object=3;}` defines multiple conditions used to extract a given set or list, as well as predicates and requested attributes. `string attribute=1` represents a given requested attribute; `PredicateType predicate=2` represents a predicate; and `repeated string predicate_object=3` represents a given set or list.
[0111] For example, the message ScopeStatement {repeated Condition conditions = 1;} defines a scope (ScopeStatement) used to describe the AND operation of the above multiple conditions.
[0112] The cloud object storage cluster provides a policy configuration entry point. In response to input operations triggered by the policy configuration entry point, policy configuration data can be obtained, and the aforementioned key syntactic sugars can be called to generate policy configuration code corresponding to the policy configuration data. The policy configuration code is then written into the cloud object storage cluster to complete the configuration of the traffic control policy.
[0113] For example, please refer to Figure 4A For any bucket named BucketA or BucketB in the cloud object storage cluster, the data traffic for both the write operation PutObject and the read operation GetObject cannot exceed 100 Queries Per Second (QPS). Therefore, in the policy configuration entry, you can input Bucket Each[BucketA, BucketB], API Each[GetObject, PutObject], and 100 QPS. Here, "Bucket" represents the given request attribute, "Each" is the predicate, and "[BucketA, BucketB]" represents the given set; "API" represents the given request attribute, "Each" is the predicate, and "[GetObject, PutObject]" represents the given set.
[0114] The above key syntactic sugar is used to configure a flow control policy, where BucketA and BucketB, the write operation PutObject and the read operation GetObject are both flow control objects, and 100 QPS is the flow threshold.
[0115] For example, please refer to Figure 4B For the union of requests to two buckets named BucketA and BucketB in a cloud object storage cluster, the data traffic for the GetObject read operation cannot exceed 100 QPS. Therefore, in the policy configuration entry, you can input Bucket Total[BucketA, BucketB], API Each[GetObject], and 100 QPS. Here, "Bucket" represents the given request attribute, "Total" is the predicate, and "[BucketA, BucketB]" represents the given set; "API" represents the given request attribute, "Each" is the predicate, and "[GetObject]" represents the given set.
[0116] The above key syntactic sugar is used to configure a flow control policy, where BucketA, BucketB, and the read operation GetObject are all flow control objects, and 100 QPS is the flow threshold.
[0117] For example, please refer to Figure 4C For any bucket named BucketA or BucketB in a cloud object storage cluster, the sum of the data traffic from write operations (PutObject) and read operations (GetObject) cannot exceed 100 QPS. Therefore, in the policy configuration entry, you can input Bucket Each[BucketA, BucketB], API Total[GetObject, PutObject], and 100 QPS. Here, "Bucket" represents the given request attribute, "Each" is the predicate, and "[BucketA, BucketB]" represents the given set; "API" represents the given request attribute, "Total" is the predicate, and "[GetObject, PutObject]" represents the given set.
[0118] The above key syntactic sugar is used to configure a flow control policy, where BucketA and BucketB, the write operation PutObject and the read operation GetObject are both flow control objects, and 100 QPS is the flow threshold.
[0119] For example, please refer to Figure 4D For any bucket in a cloud object storage cluster, except for BucketVip which represents a bucket list for a large customer, the sum of all operations cannot exceed 100 QPS.
[0120] In the policy configuration entry, you can input Bucket EachExcept[BucketVip], APITotal[], and 100 QPS. "Bucket" is the given request attribute, "EachExcept" is the predicate, and "[BucketVip]" is the given list. Since it doesn't include the given set, the given set is all sets under the corresponding given request attribute. "API" is the given request attribute, "Total" is the predicate, and "[]" represents all sets under the corresponding given request attribute.
[0121] The above key syntactic sugar is used to configure a flow control policy. In this policy, all sets under the request attribute "Bucket" (excluding the bucket list "BucketVip") and all sets under the request attribute "API" are flow control objects, and 100 QPS is the flow threshold.
[0122] For example, please refer to Figure 4EFor any bucket in the cloud object storage cluster, except for BucketVip which represents a list of buckets for a large customer, no operation can exceed 100 QPS.
[0123] In the policy configuration entry, you can input `Bucket EachExcept[BucketVip]`, `APIEach[]`, and 100 QPS. Here, "Bucket" is the given request attribute, "EachExcept" is the predicate, and "[BucketVip]" is the given list. Since it doesn't include the given set, the given set is all sets under the corresponding given request attribute. Similarly, "API" is the given request attribute, "Each" is the predicate, and "[]" represents all sets under the corresponding given request attribute.
[0124] The above key syntactic sugar is used to configure a flow control policy. In this policy, all sets under the request attribute "Bucket" (excluding the bucket list "BucketVip") and all sets under the request attribute "API" are flow control objects, and 100 QPS is the flow threshold.
[0125] As one example, the above input operation can also be input in the form of Chinese text, and then the semantics of the text can be recognized by a large language model. In this way, based on a variety of preset programming syntaxes, strategy configuration code can be automatically generated according to the text semantics. The strategy configuration code can be written into the cloud object storage cluster to complete the configuration of the traffic control strategy, etc. There are no specific restrictions.
[0126] By configuring flow control policies, precise and refined flow control can be performed on any flow control object, enabling diverse flow control methods.
[0127] S2021, traffic statistics are performed on each flow control service request selected from each historical service request to obtain the comprehensive transmission traffic of each flow control service request.
[0128] After obtaining all historical service requests, traffic statistics can be performed on each flow control service request selected from these historical requests to obtain the overall transmission traffic of each flow control service request. Each flow control service request is a historical service request containing a flow control object that indicates a flow control policy. The flow control object is used to indicate the target traffic for flow control; please refer to the example above for details.
[0129] For example, a flow control policy might stipulate that for either Bucket A or Bucket B in a cloud object storage cluster, the data traffic for both write operations (PutObject) and read operations (GetObject) cannot exceed 100 QPS. Therefore, the flow control targets are the write operations (PutObject) and read operations (GetObject) for either Bucket A or Bucket B. By analyzing historical service requests, we can identify the write or read requests for either Bucket A or Bucket B as the flow control service requests.
[0130] Traffic statistics can be categorized in several ways. For example, it can count the number of flow control service requests received per second and average the results over a first time period to obtain the total transmission traffic of each flow control service request. Alternatively, it can count the number of flow control service requests received within a first time period, or it can count the number of flow control service requests received within a first time period and calculate the changes over each second as the total transmission traffic of each flow control service request. Traffic statistics can also include data volume, and there are no specific limitations on the methods used.
[0131] As one example, when filtering flow control service requests from historical service requests, the following can be performed separately for each historical service request:
[0132] Extract at least one request field from a historical service request, and if at least one of the request fields matches the flow control object, then treat the historical service request as a flow control service request. Perform traffic statistics on each obtained flow control service request to obtain the total transmission traffic of each flow control service request.
[0133] For example, from a historical service request, multiple request fields are extracted, including "Api", "UserId", "Bucket", and "Key". The flow control policy's flow control objects are BucketA and BucketB, as well as the write operation PutObject and the read operation GetObject. Then, it's determined whether the value of the request field "Bucket" is BucketA or BucketB. If it is, then the value of the request field "Api" is further determined to be either a write operation PutObject or a read operation GetObject. If it is determined to be a write operation PutObject or a read operation GetObject, then this historical service request is treated as a flow control service request.
[0134] By combining the request format of the service request, at least one request field can be extracted, thereby filtering out each flow control service request through a calculation process with less data, improving the efficiency and accuracy of filtering each flow control service request.
[0135] As one embodiment, when performing traffic statistics, since both the number of requests and the amount of data occupied by requests can characterize traffic, when the traffic threshold includes a quantity threshold, the total number of requests for each flow control service request within a unit of time can be counted to obtain the comprehensive transmission traffic of each flow control service request. When the traffic threshold includes a data volume threshold, the total amount of data occupied by each flow control service request within a unit of time can be counted to obtain the comprehensive transmission traffic of each flow control service request. When the traffic threshold includes both a quantity threshold and a data volume threshold, the total number of requests for each flow control service request within a unit of time and the total amount of data occupied by each flow control service request within a unit of time can be counted, and the obtained total number of requests and total amount of data occupied can be used as the comprehensive transmission traffic.
[0136] Whether a traffic threshold includes a quantity threshold or a data volume threshold can be determined by the unit of the threshold, such as 100 QPS for a quantity threshold and 15 Gib / s for a data volume threshold.
[0137] By employing various traffic statistics methods, diverse traffic control processes can be implemented. This not only controls the number of requests but also the amount of data used by each request, thus improving the flexibility of traffic control.
[0138] As one example, if the historical service requests are received by multiple request receiving processes (see the previous description for details), then during traffic statistics, multiple request receiving processes can be invoked first to perform the following: filter out at least one flow control service request from the received historical service requests, and perform traffic statistics on at least one flow control service request to obtain the in-process transmission traffic. Then, a data processing process associated with the flow control policy is invoked to perform the following: integrate the in-process transmission traffic statistics from each of the multiple request receiving processes to obtain the comprehensive transmission traffic of each flow control service request.
[0139] Each request receiving process can filter out at least one flow control service request, or it can choose not to perform traffic statistics if no flow control service request is filtered out. This application embodiment will be described using the example that each request receiving process filters out at least one flow control service request.
[0140] Since the number of historical service requests received by each request receiving process is much smaller than the total number of historical service requests received by all request receiving processes, the multiple historical service requests can be filtered in the process memory of the request receiving process. This can greatly reduce the amount of data processed by the request receiving process for each filtering. It is equivalent to distributing the huge workload of filtering each flow control service request from each historical service request to each request receiving process synchronously, thereby improving filtering efficiency and ensuring the timeliness of flow control.
[0141] Furthermore, each request receiving process performs traffic statistics on at least one flow control service request identified in the statistics to obtain the intra-process transmission traffic. Similarly, the workload of performing traffic statistics on all flow control service requests can be distributed to each request receiving process and performed synchronously, which can further improve the filtering efficiency and ensure the timeliness of traffic control.
[0142] During the data processing process, it is only necessary to integrate the intra-process transmission traffic statistics of multiple request receiving processes, which greatly reduces the running burden of the data processing process and avoids the stable operation of other normal services in the cloud object storage cluster due to the flow control process, thus ensuring the stability of the cloud object storage service to a certain extent.
[0143] Please refer to Figure 5A The cloud object storage cluster is configured with traffic control policies A, B, etc. Multiple data processing processes run within the cloud object storage cluster. The traffic control process for each traffic control policy A is executed within one data processing process; this is denoted as traffic control policy A associated with one data processing process, traffic control policy B associated with one data processing process, and so on.
[0144] The cloud object storage cluster runs multiple data processing processes, including primary data processing processes and backup data processing processes. When the corresponding primary data processing process encounters an error, the backup data processing process takes over the data processing, switching its running status from backup to primary, while the corresponding primary data processing process switches its running status from primary to backup.
[0145] A cloud object storage cluster runs multiple request receiving processes, each responsible for receiving service requests. Each process can receive at least one historical service request. The logical layer of the cloud object storage cluster contains multiple controllers, such as controller_1, controller_2, ..., and controller_N. Each controller runs a request receiving process to receive service requests, such as request receiving process_1, request receiving process_2, ..., and request receiving process_N.
[0146] In the request receiving process_1, request receiving process_2, ... and request receiving process_N, each request receiving process filters multiple historical service requests received within a first time period to obtain at least one flow control service request that matches the flow control policy A, and performs traffic statistics on at least one flow control service request to obtain the intra-process transmission traffic, namely intra-process transmission traffic_1, intra-process transmission traffic_2, ... and intra-process transmission traffic_N.
[0147] The request receiving process_1 sends the statistical intra-process transmission traffic_1 to the data processing process associated with flow control policy A; the request receiving process_2 sends the statistical intra-process transmission traffic_2 to the data processing process associated with flow control policy A, and so on, which will not be elaborated here. The data processing process integrates intra-process transmission traffic_1, intra-process transmission traffic_2, ... and intra-process transmission traffic_N to obtain the comprehensive transmission traffic of all flow control service requests.
[0148] S2022, when it is determined that the total transmission traffic has reached a traffic threshold indicated by a traffic control policy, the system receives each target service request containing the traffic control object within a second time period according to the traffic threshold.
[0149] After obtaining the overall transmission traffic, it can be determined whether the overall transmission traffic has reached the traffic threshold indicated by the aforementioned traffic control policy. If it has not reached the traffic threshold indicated by the traffic control policy, it means that the data traffic conforming to the traffic control policy has not exceeded the transmission limit, and therefore, its transmission traffic can be unrestricted. If it has reached the traffic threshold indicated by the traffic control policy, it means that the data traffic conforming to the traffic control policy has exceeded the transmission limit. In order to ensure the stable operation of the cloud object storage service, within the second time period, requests for each target service containing the flow-controlled object are received according to the traffic threshold. The start time of the second time period is later than the end time of the first time period. By statistically analyzing the traffic transmission situation within the first time period, traffic control is performed on the subsequent second time period, enabling accurate control based on the actual traffic transmission situation, further improving the stability of the cloud object storage service.
[0150] When receiving requests for target services containing flow control objects according to the flow threshold, there are several ways to achieve this. Two of them are introduced below as examples.
[0151] Method 1: Based on the preset mapping relationship between each reference overflow value and each reference rejection probability, determine the receiving strategy for each target service request containing the flow control object.
[0152] If there is a pre-defined mapping relationship between each reference overflow value and each reference rejection probability, then the matching reference rejection probability can be selected from the mapping relationship as the request rejection probability to generate the receiving strategy for each target service request containing the flow control object.
[0153] Please refer to Figure 5B For example, if the request rejection probability is 0.3, then the receiving strategy could be: within the second time period, for service requests containing flow control objects sent to the cloud object storage cluster (such as service request_1, service request_2, ... and service request_100), there is a 30% probability of rejection and a 70% probability of acceptance.
[0154] If service request_1 and service request_2 agree to be accepted, they are designated as target service request_1 and target service request_2; service request_3, service request_4, and service request_5 refuse to be accepted; and so on, so that the ratio between the received target service requests containing flow control objects, such as target service request_1, target service request_2, ... and target service request_70, reflected in the second time period, and all service requests containing flow control objects sent to the cloud object storage cluster is 0.7.
[0155] As one embodiment, when selecting a matching reference rejection probability, the reference rejection probability corresponding to the matching reference overflow value in the mapping relationship can be selected based on the overflow value of the overall transmission traffic exceeding the traffic threshold. There are several ways to represent the overflow value of the overall transmission traffic exceeding the traffic threshold; two examples are described below.
[0156] Overflow value 1: The difference between the total transmission traffic and the traffic threshold.
[0157] After determining the traffic difference between the overall transmission traffic and the traffic threshold, the reference rejection probability corresponding to the traffic difference can be determined as the request rejection probability based on the preset mapping relationship between each reference overflow value and each reference rejection probability. Based on the request rejection probability, each target service request containing the flow control object is received within the second time period.
[0158] By calculating the difference between the total transmission traffic and the traffic threshold, the situation of traffic exceeding the limit can be reflected in the simplest calculation. This allows for the selection of different request rejection probabilities based on different exceedance situations, avoiding the unevenness caused by a large number of rejected requests when using a uniform rejection probability, which affects the performance of cloud object storage services. It also avoids the problem of poor traffic control effect caused by using a uniform rejection probability, such as using a high probability to reject a small number of exceedance situations or a low probability to reject a large number of exceedance situations, thus improving the accuracy of traffic control.
[0159] Overflow value 2: The ratio between the difference between the total transmission traffic and the traffic threshold, and the preset overflow limit for this traffic control strategy.
[0160] After determining the traffic difference between the total transmission traffic and the traffic threshold, the overflow ratio of the total transmission traffic is determined based on the ratio between the traffic difference and the preset overflow limit for a traffic control policy. Therefore, based on the preset mapping relationship between each reference overflow value and each reference rejection probability, the reference rejection probability corresponding to the overflow ratio can be determined as the request rejection probability.
[0161] If the flow control strategy has a preset overflow limit, this limit can be used to further improve the accuracy of selecting the request rejection probability. The overflow ratio, determined by the ratio between the flow difference and the overflow limit, reflects the urgency of flow control. This allows for the selection of the request rejection probability based on the urgency of flow control, avoiding the problem of using a uniform rejection probability, which can lead to poor flow control performance—such as rejecting urgent traffic with a low probability or rejecting less urgent traffic with a high probability. This improves the accuracy of flow control.
[0162] As one embodiment, the above mapping relationship can be a positive correlation between the reference overflow value and the reference rejection probability, such as a linear or non-linear relationship. As the reference overflow value increases, the reference rejection probability also gradually increases. The larger the reference overflow value, the more overflowing traffic there is, so more requests should be rejected, and therefore the reference rejection probability is also higher; the smaller the reference overflow value, the less overflowing traffic there is, so fewer requests should be rejected, and therefore the reference rejection probability is lower, achieving more flexible flow control.
[0163] The above mapping relationship can be implemented using a piecewise quadratic function, or other functions such as linear functions or other polynomial functions. There are no specific restrictions, and they will not be listed here. Only a two-piecewise quadratic function will be used as an example. Therefore, different mapping strategies can be adopted for different traffic exceeding situations, preventing sudden changes in traffic control such as a large number of rejected requests, achieving smooth traffic control, and improving the flexibility of traffic control.
[0164] The following section introduces three types of piecewise quadratic functions as examples.
[0165] Piecewise quadratic function 1:
[0166] For each reference overflow value, there are multiple first segment overflow values that are less than the segment threshold: the multiple first segment overflow values and their corresponding reference rejection probabilities satisfy the first segment quadratic function, and the first segment overflow value is positively correlated with the slope of the first segment quadratic function.
[0167] By using a quadratic function in the first segment, a relatively small reference rejection probability can be used when the overflow value of the first segment is small, so that the traffic limit will not feel like all requests are failing, thus achieving smooth traffic. As the overflow value of the first segment increases, the change in the corresponding two reference rejection probabilities also gradually increases, thus achieving an effective traffic limit process.
[0168] Please refer to Figure 6A Taking the ratio between the flow difference represented by the reference overflow value and the overflow limit as an example, the segment threshold can be any one of the reference overflow values. For example, if the segment threshold is 0.8, then multiple reference overflow values less than 0.8 are multiple first segment overflow values. The first segment quadratic function satisfies, for example, formula (1). For other reference overflow values besides multiple first segment overflow values, for example, formula (2) is used for mapping.
[0169] p = x 2 x<0.8 (1)
[0170] Where x represents the first segment overflow value, and p represents the corresponding reference rejection probability.
[0171] p = -x 2 +1.92 x≥0.8 (2)
[0172] Where x represents other reference overflow values, and p represents the corresponding reference rejection probability.
[0173] Piecewise quadratic function 2:
[0174] For each reference overflow value, there are multiple second segment overflow values that are not less than the segment threshold: the multiple second segment overflow values and their corresponding reference rejection probabilities satisfy the second segment quadratic function, and the second segment overflow value is negatively correlated with the slope of the second segment quadratic function.
[0175] By using a second-segment quadratic function, when the second-segment overflow value is large, the change in the probability of rejection between each pair of references is relatively small, so that when limiting traffic, it does not feel like all requests are failing, thus achieving traffic smoothing. When the second-segment overflow value is small, as the second-segment overflow value increases, the change in the probability of rejection between each pair of references gradually decreases from a large value, thus achieving an effective traffic limiting process under the premise of traffic smoothing.
[0176] Please refer to Figure 6BTaking the ratio between the flow difference represented by the reference overflow value and the overflow limit as an example, the segment threshold can be any one of the reference overflow values. For example, if the segment threshold is 0.4, then multiple reference overflow values greater than 0.4 are multiple second segment overflow values. The second segment quadratic function satisfies, for example, formula (3). For other reference overflow values besides multiple second segment overflow values, for example, formula (4) is used for mapping.
[0177] p = -2x 2 +4x-1 x≥0.4 (3)
[0178] Where x represents the second segment overflow value, and p represents the corresponding reference rejection probability.
[0179] p = x 2 x<0.4 (4)
[0180] Where x represents other reference overflow values, and p represents the corresponding reference rejection probability.
[0181] Piecewise quadratic function 3:
[0182] Please refer to Figure 6C The above mapping relationship satisfies the following formula (5):
[0183]
[0184] Where x represents a reference overflow value and p represents a corresponding reference rejection probability.
[0185] The above formula allows for a relatively small reference rejection probability when the reference overflow value is small, preventing the feeling of constant request failures when limiting traffic and achieving smooth traffic flow. As the reference overflow value increases, the change in the probability between every two reference rejections gradually increases, achieving an effective traffic limiting process. Furthermore, when the reference overflow value is large, the change in the probability between every two reference rejections is switched to gradually decrease, achieving effective traffic limiting while maintaining smooth traffic flow.
[0186] As one example, if, as described above, each historical service request is received by multiple request receiving processes, and the overall transmission traffic is determined by a data processing process associated with the aforementioned traffic control strategy, then when receiving a target service request, the data processing process associated with this traffic control strategy can be invoked. When the overall transmission traffic reaches the traffic threshold indicated by this traffic control strategy, a request rejection probability corresponding to a traffic control strategy is determined based on the traffic threshold. Multiple request receiving processes are then invoked to respectively execute: based on the request rejection probability, receiving at least one target service request containing a flow control object within a second time period.
[0187] Please refer to Figure 7A The cloud object storage cluster is configured with traffic control policy A, traffic control policy B, etc. Multiple data processing processes run within the cloud object storage cluster. The traffic control process for each traffic control policy A is executed within one of these data processing processes; this is referred to as traffic control policy A being associated with one data processing process.
[0188] The cloud object storage cluster runs multiple data processing processes, including primary data processing processes and secondary data processing processes. The logical layer of the cloud object storage cluster has multiple controllers, such as controller_1, controller_2, ..., and controller_N. Each controller runs a request receiving process to receive service requests, such as request receiving process_1, request receiving process_2, ..., and request receiving process_N.
[0189] Each request receiving process performs traffic statistics on each flow control service request selected from multiple historical service requests received within the first time period, and reports it to the data processing process. The data processing process integrates the intra-process transmission traffic_1, intra-process transmission traffic_2, ... and intra-process transmission traffic_N to obtain the comprehensive transmission traffic of all flow control service requests.
[0190] When the data processing process determines that the total transmission traffic has reached the traffic threshold indicated by traffic control strategy A, it first determines the traffic difference between the total transmission traffic and the traffic threshold, and then determines the overflow ratio between the traffic difference and the overflow limit preset by traffic control strategy A. For example, if the ratio is 0.8, it means that there is a large overflow.
[0191] Using the above formula (5), the reference rejection probability corresponding to the overflow ratio of 0.8 is determined to be 0.92. Therefore, using 0.92 as the request rejection probability, the target service request containing the flow control object is received within the second time period. Then, the data processing process returns the request rejection probability to the request receiving process_1, request receiving process_2, ... and request receiving process_N. In each request receiving process, of the 100 service requests containing the flow control object sent to the cloud object storage cluster, approximately 92 will be rejected, and only 8 will be accepted as target service requests.
[0192] Method 2:
[0193] Based on the comprehensive transmission traffic, traffic threshold, second duration, and traffic object statistics within the first duration, traffic control prompt words are generated. A trained question-answering model is used to extract the text features of the traffic control prompt words. Based on the text features, the receiving strategy within the second duration is predicted. The predicted receiving strategy is then used to receive the target service request within the second duration.
[0194] For example, if the total transmission traffic is 1000 QPS, the traffic threshold is 100 QPS, the second duration is the next second, and the traffic object is a storage bucket named BucketA, then the traffic control prompt could be: "As a traffic controller with extensive experience in traffic control, given that the transmission traffic counted in the previous second was 1000 QPS and the traffic threshold is 100 QPS, please configure the service request reception policy for the storage bucket named BucketA in the next second."
[0195] The trained question-answering model can predict the receiving strategy for the second time period based on the learned knowledge base. For example, the receiving strategy is to reject service requests containing flow control objects in the next 5 milliseconds every 10 milliseconds.
[0196] As one embodiment, the first duration is the duration within any period of the third duration, and the third duration is not less than the first duration. For example, the above scheme can be executed every second to achieve near real-time traffic awareness and control, improving the stability of cloud object storage services. Another example is that the third duration is 10 minutes, the first duration is the first minute within every ten minutes, and the second duration is the other nine minutes within every ten minutes excluding the first minute.
[0197] The following example illustrates the process of implementing the flow control method provided in the embodiments of this application using the Frequency program system.
[0198] Please refer to Figure 7B The Frequency program system includes a Frequency client side and a Frequency server side, denoted as FrequencyClient and FrequencyServer, respectively; the Frequency program system also includes a traffic control policy management side, denoted as FrequencyMaster; and a traffic control policy configuration side, denoted as FrequencyDashboard.
[0199] FrequencyClient is used to receive or reject service requests; it is also used to perform traffic statistics on in-process traffic and report the obtained in-process transmission traffic to the corresponding FrequencyServer. FrequencyClient can run in the controller of the logical layer of the cloud object storage cluster. The controller sends the received service requests to FrequencyClient, which decides whether to reject them and performs traffic statistics.
[0200] FrequencyServer manages instances of at least one associated traffic control policy, determining whether to return a request rejection probability based on the in-process traffic reported by each FrequencyClient. FrequencyServer can be implemented using modules in cloud object storage used for sharding management and master-slave failover, such as the Cayman module.
[0201] FrequencyMaster manages configured traffic control policies and pushes these policies to each FrequencyClient and FrequencyServer. FrequencyMaster can utilize the SCAL module in cloud object storage to ensure high reliability and guarantee that traffic control policies are not lost.
[0202] FrequencyDashboard is used to generate and present traffic control policies in response to configuration input. FrequencyDashboard can be embedded in the operation and maintenance platform associated with the cloud object storage cluster and communicate with FrequencyMaster.
[0203] Taking a flow control policy with a first duration of 1 second, a second duration of 1 second, and a third duration of 1 second as an example, the FrequencyClient executes the following within the controller process for each flow control policy: Statistically count the in-process transmission traffic of each flow control service request containing a flow control policy instruction within 1 second.
[0204] Please refer to Figure 7C One traffic control strategy is as follows: for each bucket in the cloud object storage cluster, the total data traffic for write operations (PutObject) and read operations (GetObject) cannot exceed 30,000 QPS. Buckets include names such as "Software A-img", "Software B-img", and "Software C-video".
[0205] One traffic control policy is as follows: for each bucket in the cloud object storage cluster, the total data traffic for write operations (PutObject) and read operations (GetObject) cannot exceed 15 Gbis / s. Buckets include "Software D-img", "Software A-img", "Software C-video", etc.
[0206] One traffic control policy is as follows: for each bucket in the cloud object storage cluster, the data traffic for the RestoreObject operation cannot exceed 100 QPS. Buckets include "software B-img", "software E-video", "software F-img", etc.
[0207] FrequencyClient can sort the statistical data traffic in process memory, and can also delete storage buckets that have not been updated within a certain period of time, thus avoiding unnecessary occupation of storage resources.
[0208] The following section uses the flow control process of a flow control strategy as an example to illustrate the process.
[0209] Each FrequencyClient reports its own statistically analyzed in-process traffic to the FrequencyServer corresponding to the flow control policy. The FrequencyServer receives the in-process traffic reports from each FrequencyClient. The FrequencyServer then integrates the in-process traffic reports from each FrequencyClient in its process memory to obtain the aggregated traffic.
[0210] FrequencyServer determines whether the obtained total transmission traffic exceeds the traffic threshold indicated by the traffic control policy. If it does not exceed the traffic threshold, no processing is performed. If it exceeds the traffic threshold, the request rejection probability is determined based on the pre-stored mapping relationship, and each request rejection probability is returned to each FrequencyClient to ensure that the traffic does not exceed the limit.
[0211] In this embodiment, precise traffic control services can be provided for cloud object storage clusters, ensuring that when cloud object storage clusters encounter traffic surges, traffic attacks, or other behaviors, they can effectively reject unnecessary and unexpected traffic, thus protecting the overall stable operation of the system.
[0212] Based on the same inventive concept, embodiments of this application provide a flow control device capable of realizing the functions corresponding to the aforementioned flow control method. Please refer to... Figure 8 The device includes a processing module 802 and an acquisition module 801, wherein:
[0213] Acquisition module 801: used to acquire each historical service request received within the first time period; wherein, each historical service request is used to read and write data to the cloud object storage cluster;
[0214] Processing module 802: Performs the following operations for at least one preset flow control policy:
[0215] The processing module 802 is specifically used to: perform traffic statistics on each flow control service request selected from each historical service request, and obtain the comprehensive transmission traffic of each flow control service request; wherein, each flow control service request is: a historical service request containing a flow control object with a flow control policy indication;
[0216] The processing module 802 is specifically used to: when the total transmission traffic reaches a traffic threshold indicated by a traffic control policy, receive each target service request containing the flow control object within a second duration according to the traffic threshold; wherein the start time of the second duration is later than the end time of the first duration.
[0217] Optionally, the processing module 802 is specifically used for:
[0218] For each historical service request, the following steps are performed: extract at least one request field from a historical service request, and if at least one request field matches the flow control object, then treat the historical service request as a flow control service request.
[0219] Traffic statistics are performed on each obtained flow control service request to obtain the comprehensive transmission traffic of each flow control service request.
[0220] Optionally, the processing module 802 is specifically used to perform any of the following methods:
[0221] When the traffic threshold includes the quantity threshold, the total number of requests for each flow control service within a unit of time is statistically obtained to obtain the comprehensive transmission traffic of each flow control service request.
[0222] When the traffic threshold includes the data volume threshold, the total amount of data occupied by each flow control service request per unit time is statistically obtained to obtain the comprehensive transmission traffic of each flow control service request.
[0223] Optionally, each historical service request is received by multiple request receiving processes;
[0224] The processing module 802 is specifically used for:
[0225] Invoke multiple request receiving processes, each of which performs the following: filter out at least one flow control service request from multiple received historical service requests, and perform traffic statistics on at least one flow control service request to obtain the intra-process transmission traffic;
[0226] Invoke a data processing process associated with a flow control policy to perform the following: integrate the in-process transmission traffic statistics of multiple request receiving processes to obtain the comprehensive transmission traffic of each flow control service request.
[0227] Optionally, the processing module 802 is specifically used for:
[0228] Determine the traffic difference between the total transmission traffic and the traffic threshold;
[0229] Based on the preset mapping relationship between each reference overflow value and each reference rejection probability, the reference rejection probability corresponding to the traffic difference is determined as the request rejection probability;
[0230] Based on the request rejection probability, each target service request containing the flow control object is received within the second time period.
[0231] Optionally, the processing module 802 is specifically used for:
[0232] The overflow ratio of the overall transmission traffic is determined based on the ratio between the traffic difference and the preset overflow limit for a traffic control strategy.
[0233] Based on the preset mapping relationship between each reference overflow value and each reference rejection probability, the reference rejection probability corresponding to the overflow ratio is determined as the request rejection probability.
[0234] Optionally, the reference overflow value is positively correlated with the reference rejection probability.
[0235] Optionally, the mapping relationship is a piecewise quadratic function, and for each reference overflow value, multiple first segment overflow values that are less than the segment threshold: multiple first segment overflow values and their corresponding reference rejection probabilities satisfy the first segment quadratic function, and the first segment overflow value is positively correlated with the slope of the first segment quadratic function.
[0236] Optionally, the mapping relationship is a piecewise quadratic function, and for each reference overflow value, there are multiple second segment overflow values that are not less than the segment threshold: the multiple second segment overflow values and their respective corresponding reference rejection probabilities satisfy the second segment quadratic function, and the second segment overflow value is negatively correlated with the slope of the second segment quadratic function.
[0237] Optionally, the mapping relationship satisfies the following formula:
[0238]
[0239] Where x represents a reference overflow value and p represents a reference rejection probability.
[0240] Optionally, each historical service request is received by multiple request receiving processes, and the total transmission traffic is determined by a data processing process associated with a flow control policy.
[0241] The processing module 802 is specifically used for:
[0242] The data processing process associated with a flow control policy is invoked. When the total transmission traffic reaches the traffic threshold indicated by the flow control policy, the request rejection probability corresponding to the flow control policy is determined based on the traffic threshold.
[0243] Invoke multiple request receiving processes, each of which performs the following: based on the request rejection probability, receive at least one target service request containing a flow control object within a second time period.
[0244] Optionally, the first duration is the duration within any period with the third duration as the period, and the third duration is not less than the first duration.
[0245] Please refer to Figure 9 This is a computer device 900 provided in the embodiments of this application. The computer device 900 can, for example, be... Figure 1B The client 102 or server 101 in the system. The current and historical versions of the data storage program and the application software corresponding to the data storage program can be installed on a computer device 900, which includes a processor 980 and a memory 920. In some embodiments, the computer device 900 may include a display unit 940, which includes a display panel 941 for displaying a user-interactive interface, etc.
[0246] In one possible embodiment, the display panel 941 may be configured in the form of a liquid crystal display (LCD) or an organic light-emitting diode (OLED).
[0247] The processor 980 is used to read a computer program and then execute the methods defined by the computer program. For example, the processor 980 reads a data storage program or file, thereby running the data storage program on the computer device 900 and displaying the corresponding interface on the display unit 940. The processor 980 may include one or more general-purpose processors, and may also include one or more DSPs (Digital Signal Processors) for performing related operations to implement the technical solutions provided in the embodiments of this application.
[0248] The memory 920 generally includes main memory and secondary storage. Main memory can be random access memory (RAM), read-only memory (ROM), and cache, etc. Secondary storage can be a hard disk, optical disk, USB flash drive, floppy disk, or magnetic tape drive, etc. The memory 920 is used to store computer programs and other data. The computer programs include applications corresponding to each client, and other data may include data generated after the operating system or applications are run, including system data (e.g., operating system configuration parameters) and user data. In this embodiment, the computer program is stored in the memory 920, and the processor 980 executes the computer program in the memory 920 to implement any of the methods described in the preceding figures.
[0249] The aforementioned display unit 940 is used to receive input digital information, character information, or contact touch operations / non-contact gestures, and to generate signal inputs related to user settings and function control of the computer device 900. Specifically, in this embodiment, the display unit 940 may include a display panel 941. The display panel 941, for example, is a touch screen, which can collect touch operations performed by the user on or near it (such as operations performed by the user using a finger, stylus, or any suitable object or accessory on or on the display panel 941), and drive corresponding connection devices according to a pre-set program.
[0250] In one possible embodiment, the display panel 941 may include two parts: a touch detection device and a touch controller. The touch detection device detects the player's touch position and the signal generated by the touch operation, and transmits the signal to the touch controller. The touch controller receives touch information from the touch detection device, converts it into touch point coordinates, and sends it to the processor 980. It can also receive and execute commands from the processor 980.
[0251] The display panel 941 can be implemented using various types such as resistive, capacitive, infrared, and surface acoustic wave. In addition to the display unit 940, in some embodiments, the computer device 900 may also include an input unit 930. The input unit 930 may include an image input device 931 and other input devices 932, wherein the other input devices may include, but are not limited to, one or more of the following: a physical keyboard, function keys (such as volume control buttons, power buttons, etc.), a trackball, a mouse, and a joystick.
[0252] In addition to the above, the computer device 900 may also include a power supply 990 for powering other modules, an audio circuit 960, a near-field communication module 970, and an RF circuit 910. The computer device 900 may also include one or more sensors 950, such as an accelerometer, a light sensor, and a pressure sensor. The audio circuit 960 specifically includes a speaker 961 and a microphone 962, for example, the computer device 900 can use the microphone 962 to collect the user's voice and perform corresponding operations.
[0253] As one embodiment, the number of processors 980 can be one or more, and the processors 980 and the memory 920 can be coupled together or relatively independent.
[0254] As one example, Figure 9 The processor 980 in the middle can be used to implement, for example Figure 8 The functions of the processing module 802 and the acquisition module 801.
[0255] As one example, Figure 9 The processor 980 in the text can be used to implement the functions of the server or terminal devices discussed above.
[0256] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by a computer program. The aforementioned computer program can be stored in a computer-readable storage medium. When the computer program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0257] Alternatively, if the integrated units of this invention are implemented as software functional modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of this invention, or the parts that contribute to the prior art, can be embodied in the form of software products, for example, through computer program products. These computer program products are stored in a storage medium and include computer programs used to cause a computer device to execute all or part of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, ROM, RAM, magnetic disks, or optical disks.
[0258] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.
Claims
1. A flow control method, characterized in that, Applied to cloud object storage clusters, including: Obtain each historical service request received within a first time period; wherein each historical service request is used to read and write data to the cloud object storage cluster; For at least one preset flow control policy, perform the following operations respectively: Traffic statistics are performed on each flow control service request selected from the historical service requests to obtain the comprehensive transmission traffic of each flow control service request; wherein, each flow control service request is a historical service request containing a flow control object with a flow control policy indication; When the total transmission traffic reaches the traffic threshold indicated by the traffic control policy, the system receives each target service request containing the flow control object within a second duration according to the traffic threshold; wherein the start time of the second duration is later than the end time of the first duration.
2. The method according to claim 1, characterized in that, The step of performing traffic statistics on each flow control service request selected from the historical service requests to obtain the comprehensive transmission traffic of each flow control service request includes: For each historical service request, the following steps are performed: extract at least one request field from a historical service request, and if there is a request field in the at least one request field that matches the flow control object, then treat the historical service request as a flow control service request. Traffic statistics are performed on each obtained flow control service request to obtain the comprehensive transmission traffic of each flow control service request.
3. The method according to claim 2, characterized in that, The step of performing traffic statistics on each obtained flow control service request to obtain the comprehensive transmission traffic of each flow control service request includes any of the following methods: When the traffic threshold includes a quantity threshold, the total number of requests for each flow control service request within a unit of time is statistically obtained to obtain the comprehensive transmission traffic of each flow control service request. When the traffic threshold includes a data volume threshold, the total data volume occupied by each flow control service request per unit time is statistically obtained to obtain the comprehensive transmission traffic of each flow control service request.
4. The method according to claim 1, characterized in that, Each historical service request is received by multiple request receiving processes; The step of performing traffic statistics on each flow control service request selected from the historical service requests to obtain the comprehensive transmission traffic of each flow control service request includes: The multiple request receiving processes are invoked to perform the following: filter out at least one flow control service request from the multiple received historical service requests, and perform traffic statistics on the at least one flow control service request to obtain the intra-process transmission traffic; The data processing process associated with the flow control policy is invoked to perform the following: integrate the intra-process transmission traffic statistics of the multiple request receiving processes to obtain the comprehensive transmission traffic of each flow control service request.
5. The method according to any one of claims 1 to 4, characterized in that, Receiving each target service request containing the flow control object according to the flow threshold within the second time period includes: Determine the traffic difference between the total transmission traffic and the traffic threshold; Based on the preset mapping relationship between each reference overflow value and each reference rejection probability, the reference rejection probability corresponding to the traffic difference is determined as the request rejection probability; Based on the request rejection probability, each target service request containing the flow control object is received within the second time period.
6. The method according to claim 5, characterized in that, The determination of the request rejection probability corresponding to the traffic difference based on the preset mapping relationship between each reference overflow value and each reference rejection probability includes: The overflow ratio of the overall transmission traffic is determined based on the ratio between the traffic difference and the overflow limit preset for the traffic control strategy. Based on the preset mapping relationship between each reference overflow value and each reference rejection probability, the reference rejection probability corresponding to the overflow ratio is determined as the request rejection probability.
7. The method according to claim 5, characterized in that, The reference overflow value is positively correlated with the reference rejection probability.
8. The method according to claim 5, characterized in that, The mapping relationship is a piecewise quadratic function, and for each of the reference overflow values, there are multiple first segment overflow values that are less than the segment threshold: the multiple first segment overflow values and their respective corresponding reference rejection probabilities satisfy the first piecewise quadratic function, and the first segment overflow value is positively correlated with the slope of the first piecewise quadratic function.
9. The method according to claim 5, characterized in that, The mapping relationship is a piecewise quadratic function, and for each of the reference overflow values, there are multiple second segment overflow values that are not less than the segment threshold: the multiple second segment overflow values and their respective corresponding reference rejection probabilities satisfy the second segment quadratic function, and the second segment overflow value is negatively correlated with the slope of the second segment quadratic function.
10. The method according to claim 5, characterized in that, The mapping relationship satisfies the following formula: Where x represents a reference overflow value and p represents a reference rejection probability.
11. The method according to any one of claims 1 to 4, characterized in that, Each historical service request is received by multiple request receiving processes, and the overall transmission traffic is determined by the data processing process associated with the traffic control policy. When the overall transmission traffic is determined to reach the traffic threshold indicated by the traffic control policy, receiving each target service request containing the flow control object within the second time period according to the traffic threshold includes: The data processing process associated with the aforementioned traffic control strategy is invoked, and when the total transmission traffic reaches the traffic threshold indicated by the traffic control strategy, the request rejection probability corresponding to the traffic control strategy is determined based on the traffic threshold. The plurality of request receiving processes are invoked to perform the following: based on the request rejection probability, receive at least one target service request containing the flow control object within a second time period.
12. The method according to any one of claims 1 to 4, characterized in that, The first duration is the duration within any period of the third duration, and the third duration is not less than the first duration.
13. A flow control device, characterized in that, Applied to cloud object storage clusters, including: Acquisition module: used to acquire each historical service request received within a first time period; wherein each historical service request is used to read and write data to the cloud object storage cluster; Processing module: Used to perform the following operations for at least one preset flow control policy: The processing module is specifically used to: perform traffic statistics on each flow control service request selected from the historical service requests to obtain the comprehensive transmission traffic of each flow control service request; wherein, each flow control service request is: a historical service request containing a flow control object with a flow control policy indication; The processing module is specifically used to: when the overall transmission traffic reaches the traffic threshold indicated by the traffic control policy, receive each target service request containing the flow control object within a second duration according to the traffic threshold; wherein the start time of the second duration is later than the end time of the first duration.
14. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the method as described in any one of claims 1 to 12.
15. A computer device, characterized in that, include: Memory, used to store program instructions; A processor is configured to invoke program instructions stored in the memory and execute the method as described in any one of claims 1 to 12 according to the obtained program instructions.
16. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions for causing a computer to perform the method as described in any one of claims 1 to 12.