Data access request processing method, apparatus, device, and storage medium

By using a concurrent leaky bucket mechanism and dynamically adjusted concurrent limit to manage data access requests, the problem of resource consumption by hot files is solved, and efficient processing of both hot and non-hot files is achieved.

CN119496745BActive Publication Date: 2026-05-01CHINA TELECOM CLOUD TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHINA TELECOM CLOUD TECH CO LTD
Filing Date
2024-11-22
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

In cloud storage and data center environments, when one or more files become hotspots, improperly managed data access requests can consume significant amounts of network bandwidth and server processing power, impacting access to non-hotspot files.

Method used

The concurrent leaky bucket mechanism controls data access requests to enter real-time and instantaneous leaky buckets, manages requests based on bucket size and priority, and dynamically adjusts the number of concurrent limits to optimize resource utilization.

Benefits of technology

Effectively manage data access requests for frequently accessed files to ensure rapid response to high-priority requests, while rationally allocating resources to process non-frequently accessed files to avoid overloading network bandwidth and server resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119496745B_ABST
    Figure CN119496745B_ABST
Patent Text Reader

Abstract

The application relates to a data access request processing method and device, computer equipment, a computer readable storage medium and a computer program product. The method comprises the following steps: when a plurality of data access requests are received, selecting candidate data access requests meeting a matching condition from the plurality of data access requests; based on a bucket size of a concurrent leaky bucket corresponding to a current time period, controlling a target data access request in the candidate data access requests to enter the concurrent leaky bucket; the number of the target data access requests is not greater than the bucket size of the concurrent leaky bucket, and the bucket size is equal to a concurrent limit number; performing response processing on each target data access request in the concurrent leaky bucket, and performing blocking processing on the remaining data access requests in the candidate data access requests. By using the method, data access requests for hot files can be limited, and corresponding bandwidth resources can be reserved to process non-hot file access.
Need to check novelty before this filing date? Find Prior Art

Description

Methods, apparatus, devices, and storage media for processing data access requests Technical Field

[0001] This application relates to the field of computer technology, and in particular to a method, apparatus, device, and storage medium for processing data access requests. Background Technology

[0002] In modern cloud storage and data center environments, the management of object storage resource pools is one of the core technologies. Object storage systems address the ever-increasing data demands by providing flexible and scalable storage solutions.

[0003] However, when one or more files suddenly become "hotspots"—that is, when these files are accessed concurrently by a large number of users or systems—these requests, if not properly managed, can consume a significant amount of network bandwidth and server processing power, thereby affecting access to non-hotspot files. Summary of the Invention

[0004] Therefore, it is necessary to provide a method, apparatus, computer device, computer-readable storage medium, and computer program product that can effectively manage data access requests and address the aforementioned technical problems.

[0005] A method for processing data access requests, the method comprising:

[0006] When multiple data access requests are received, candidate data access requests that meet the matching conditions are selected from the multiple data access requests;

[0007] Based on the bucket size of the concurrent leaky bucket corresponding to the current time period, the target data access requests among the candidate data access requests are controlled to enter the concurrent leaky bucket; the number of target data access requests is not greater than the bucket size of the concurrent leaky bucket, and the bucket size is equal to the concurrency limit.

[0008] The system responds to each target data access request in the concurrent leaky bucket and blocks the remaining data access requests among the candidate data access requests.

[0009] In one embodiment, the concurrency limit is H, the concurrency leak bucket includes a real-time leak bucket and an instantaneous leak bucket, the size of the real-time leak bucket is M, the size of the instantaneous leak bucket is N, M and N are integers greater than or equal to 1, and M+N=H; the target data access request includes a first data access request and a second data access request.

[0010] The step of controlling the entry of target data access requests from the candidate data access requests into the concurrent leaky bucket based on the bucket size of the concurrent leaky bucket corresponding to the current time period includes:

[0011] Based on the size of the real-time leak bucket corresponding to the current time period, the first data access request in the candidate data access request is controlled to enter the real-time leak bucket, and based on the size of the instantaneous leak bucket corresponding to the current time period, the second data access request in the candidate data access request is controlled to enter the instantaneous bucket.

[0012] Wherein, the number of the first data access requests is less than or equal to M, the number of the second data access requests is less than or equal to N, and the response processing priority of the real-time leaky bucket is higher than the processing priority of the instantaneous leaky bucket.

[0013] In one embodiment, the number of candidate data access requests is h; controlling the first data access request among the candidate data access requests to enter the real-time leaky bucket, and controlling the second data access request among the candidate data access requests to enter the instantaneous bucket, includes:

[0014] For the i-th candidate data access request, obtain the number m of data access requests that already exist in the current real-time leaky bucket, and compare m with M;

[0015] If m < M, then the i-th candidate data access request is determined as the first data access request, and the first data access request is controlled to enter the real-time leak bucket.

[0016] If m=M, obtain the number n of data access requests that already exist in the instantaneous leaky bucket, and compare n with N. If n<N, determine the i-th candidate data access request as the second data access request, and control the second data access request to enter the instantaneous leaky bucket. If n=N, determine the i-th candidate data access request as the remaining data access request.

[0017] Assign i = i + 1, return the step of obtaining the number m of existing data access requests in the current real-time leaky bucket for the i-th candidate data access request, and comparing m with M, until i = h.

[0018] In one embodiment, the method further includes:

[0019] Select regular data access requests that do not meet the matching conditions from the plurality of data access requests;

[0020] The routine data access request is processed in response.

[0021] In one embodiment, the method further includes:

[0022] After completing the response processing of the current data access request among the multiple data access requests, the time period data traffic within the current time period is obtained; the time period data traffic is the total data traffic corresponding to the data access requests that have been responded to and processed within the current time period, the current time period refers to the time period between the current time and the most recent update time, and the most recent update time refers to the most recent historical time when the concurrency limit was updated.

[0023] If the duration of the current time period is greater than or equal to the preset duration, the bandwidth of the current time period is determined based on the data traffic of the time period;

[0024] The concurrent limit is updated based on the bandwidth to obtain the updated concurrent limit.

[0025] The bucket size of the concurrent leaky bucket is updated based on the updated concurrency limit to obtain the updated bucket size; the updated bucket size is used to guide the processing of new data access requests when new data access requests are received in the next time period.

[0026] In one embodiment, updating the concurrency limit based on the bandwidth to obtain the updated concurrency limit includes:

[0027] Obtain the lower and upper bandwidth limits for a preset bandwidth range;

[0028] If the bandwidth is less than the lower limit of the bandwidth, then the concurrency limit is increased to obtain the updated concurrency limit.

[0029] If the bandwidth is less than the lower bandwidth limit, then the concurrency limit is reduced to obtain the updated concurrency limit.

[0030] If the bandwidth is within the preset bandwidth range, then the concurrency limit is determined as the updated concurrency limit.

[0031] A data access request processing apparatus, the apparatus comprising:

[0032] The data access request selection module is used to select candidate data access requests that meet matching conditions from the multiple data access requests when multiple data access requests are received.

[0033] The leaky bucket control module is used to control the target data access requests among the candidate data access requests to enter the concurrent leaky bucket based on the bucket size of the concurrent leaky bucket corresponding to the current time period; the number of target data access requests is not greater than the bucket size of the concurrent leaky bucket, and the bucket size is equal to the concurrency limit.

[0034] The request-response module is used to respond to each target data access request in the concurrent leaky bucket and to block the remaining data access requests in the candidate data access requests.

[0035] A computer device includes a memory and a processor, the memory storing a computer program, the processor executing the computer program to implement the steps of the method described above.

[0036] A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described above.

[0037] A computer program product includes a computer program that, when executed by a processor, implements the steps of the method described above.

[0038] The aforementioned data access request processing method, apparatus, computer device, computer-readable storage medium, and computer program product, upon receiving multiple data access requests, select candidate data access requests that meet matching conditions from among the multiple data access requests, such as selecting candidate data access requests for hot files. Based on the bucket size of the concurrent leaky bucket corresponding to the current time period, the method controls the target data access requests among the candidate data access requests to enter the concurrent leaky bucket, wherein the number of target data access requests is not greater than the bucket size of the concurrent leaky bucket, and the bucket size is equal to the concurrency limit. The method then responds to each target data access request in the concurrent leaky bucket and blocks the remaining data access requests among the candidate data access requests. This restricts data access requests for hot files, thereby reserving corresponding bandwidth resources to handle access to non-hot files. Attached Figure Description

[0039] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0040] Figure 1 is an application environment diagram of a data access request processing method in one embodiment;

[0041] Figure 2 is a flowchart illustrating a data access request processing method in one embodiment;

[0042] Figure 3 is a flowchart illustrating the step of the sluice box entering the container in one embodiment;

[0043] Figure 4 is a flowchart illustrating the steps for adjusting the concurrency limit in one embodiment;

[0044] Figure 5 is a flowchart illustrating the bandwidth determination step in one embodiment;

[0045] Figure 6 is a flowchart illustrating the data access request processing method in another embodiment;

[0046] Figure 7 is a structural block diagram of a data access request processing device in one embodiment;

[0047] Figure 8 is an internal structure diagram of a computer device in one embodiment. Detailed Implementation

[0048] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0049] The data access request processing method provided in this application embodiment can be applied to the application environment shown in Figure 1. Terminal 102 communicates with server 104 via a network. A data storage system can store the data that server 104 needs to process. The data storage system can be integrated on server 104 or placed on a cloud or other network server. The above-mentioned data access request processing method can be executed independently by the server. Taking execution on server 104 as an example, multiple terminals 102 can send data access requests to server 104 respectively. When server 104 receives multiple data access requests, it selects candidate data access requests that meet the matching conditions from the multiple data access requests; based on the bucket size of the concurrent leaky bucket corresponding to the current time period, it controls the target data access requests in the candidate data access requests to enter the concurrent leaky bucket; the number of target data access requests is not greater than the bucket size of the concurrent leaky bucket, and the bucket size is equal to the concurrency limit; it performs response processing on each target data access request in the concurrent leaky bucket, and blocks the remaining data access requests in the candidate data access requests.

[0050] The terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, smart in-vehicle systems, and projection devices. Portable wearable devices can include smartwatches, smart bracelets, and head-mounted displays. Head-mounted displays can be virtual reality (VR) devices, augmented reality (AR) devices, and smart glasses. The server 104 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services.

[0051] In an exemplary embodiment, as shown in FIG2, a method for processing data access requests is provided. Taking the application of this method to server 104 in FIG1 as an example, the method includes the following steps S202 to S206. Wherein:

[0052] S202, when multiple data access requests are received, select candidate data access requests that meet the matching conditions from the multiple data access requests.

[0053] Data access requests typically refer to operations that request, modify, delete, or store data from a system or service.

[0054] Matching conditions are used to filter data access requests; they can be regular expressions.

[0055] Specifically, different clients can send data access requests to the server through their respective terminals. When the server receives multiple data access requests, it can determine the file or resource that each data access request wants to access, identify the target file or resource that is a hot resource among these files or resources, and determine the data access request corresponding to the target file or resource as a candidate data access request. The data access requests corresponding to the files or resources that are not hot resources among these files or resources are determined as regular data access requests.

[0056] In one embodiment, the process of selecting candidate data access requests that meet matching conditions from multiple data access requests specifically includes the following steps: obtaining the data access paths corresponding to each of the multiple data access requests; determining the regular expression corresponding to each data access path; and selecting candidate data access requests whose regular expressions meet matching conditions from the multiple data access requests.

[0057] The matching criteria can be specific to regular expressions for hot resources.

[0058] The data access path is the specific storage location of the file or resource that the data access request wants to access.

[0059] Specifically, the server extracts the corresponding data access path from each data access request, determines the regular expression for each data access path, and compares the regular expression of each data access request with the regular expression of the hot resource. For any data access request, if the regular expression of the data access request matches the regular expression of the hot resource, the data access request is determined as a candidate data access request; if the regular expression of the data access request does not match the regular expression of the hot resource, the data access request is determined as a regular data access request.

[0060] S204, based on the bucket size of the concurrent leaky bucket corresponding to the current time period, control the target data access requests in the candidate data access requests to enter the concurrent leaky bucket; the number of target data access requests is not greater than the bucket size of the concurrent leaky bucket, and the bucket size is equal to the concurrency limit.

[0061] In this context, the "bucket" in a concurrent leaky bucket is an abstract concept used to describe the mechanism by which the algorithm controls the data flow. The main function of the concurrent leaky bucket is to receive and store incoming data and release or "leak" the data out at a fixed rate. The bucket size refers to the maximum number of data access requests that the bucket can store within any given time. In this embodiment, the bucket size is equal to the concurrency limit, and the concurrency limit refers to the maximum number of candidate data access requests allowed to be processed concurrently, which is the maximum number of concurrent processing requests for data access requests targeting hot resources.

[0062] It should be noted that the size of the concurrent leaky bucket in this embodiment is dynamically changing. Specifically, the concurrent limit for the current time period can be determined based on the bandwidth occupied by the data access requests processed in the most recent time period, and the size of the concurrent leaky bucket for the current time period can be determined based on the concurrent limit for the current time period.

[0063] Specifically, after identifying candidate data access requests, the server can obtain the bucket size of the concurrent leaky bucket in the current time period, as well as the number of data access requests already stored in the concurrent leaky bucket at the current moment, i.e., the occupied number of concurrent leaky buckets. Based on the occupied number and the bucket size, the server determines the target number. When the number of candidate data access requests is less than or equal to the target number, each candidate data access request is directly identified as the target data access request, and the target data access requests are controlled to enter the concurrent leaky bucket. When the number of candidate data access requests is greater than the target number, the server selects the target number of target data access requests from the candidate data access requests and controls the selected target data access requests to enter the concurrent leaky bucket.

[0064] Specifically, selecting the target number of target data access requests from the candidate data access requests can be done randomly or in a sorted manner. Sort selection means first sorting the candidate data access requests according to the corresponding sorting rules, and then selecting the sorted candidate data access requests in sequence until the target number of target data access requests is obtained. The sorting rules can be any one of sorting by priority, sorting by arrival time, and sorting by resource requirements.

[0065] S206, respond to each target data access request in the concurrent leaky bucket, and block the remaining data access requests in the candidate data access requests.

[0066] Specifically, response processing may include performing the data processing operation corresponding to the data access request to obtain the data processing result, generating a response based on the data processing result, and returning the generated response to the sender of the data access request.

[0067] Blocking processing refers to directly rejecting the remaining data access requests that failed to enter the concurrent leaky bucket among the candidate data access requests. Specifically, an error response can be sent to the sender of these remaining data access requests.

[0068] Specifically, for the target data access requests in the concurrent leaky bucket, the system retrieves and performs the required data processing operations one by one according to its processing capacity to obtain the data processing results, generates response data based on the data processing results, and sends the response data back to the sender corresponding to the target data access request; for the remaining data access requests in the candidate data access requests that failed to enter the concurrent leaky bucket, an error response is sent to the sender of the remaining data access requests.

[0069] The above-mentioned data access request processing method involves the server selecting candidate data access requests that meet matching conditions from multiple data access requests, such as selecting candidate data access requests for hot files, and controlling the entry of target data access requests from the candidate data access requests into the concurrent leaky bucket based on the bucket size of the concurrent leaky bucket corresponding to the current time period. The number of target data access requests is not greater than the bucket size of the concurrent leaky bucket, and the bucket size is equal to the concurrency limit. The server then responds to each target data access request in the concurrent leaky bucket and blocks the remaining data access requests from the candidate data access requests. This can limit data access requests for hot files, thereby reserving corresponding bandwidth resources to handle access to non-hot files.

[0070] In one embodiment, the concurrency limit is H, and the concurrent leaky bucket includes a real-time leaky bucket and an instantaneous leaky bucket. The size of the real-time leaky bucket is M, and the size of the instantaneous leaky bucket is N, where M and N are integers greater than or equal to 1, and M+N=H. The target data access request includes a first data access request and a second data access request. The process by which the server controls the target data access request among the candidate data access requests to enter the concurrent leaky bucket based on the bucket size of the concurrent leaky bucket corresponding to the current time period includes the following steps: controlling the first data access request among the candidate data access requests to enter the real-time leaky bucket based on the bucket size of the real-time leaky bucket corresponding to the current time period, and controlling the second data access request among the candidate data access requests to enter the instantaneous bucket based on the bucket size of the instantaneous leaky bucket corresponding to the current time period; wherein, the number of the first data access requests is less than or equal to M, the number of the second data access requests is less than or equal to N, and the response processing priority of the real-time leaky bucket is higher than the processing priority of the instantaneous leaky bucket.

[0071] The real-time leaky bucket is used to handle high-priority data access requests, which typically involve operations with strict response time requirements; the transient leaky bucket is used to handle lower-priority data access requests that can tolerate a certain delay. These requests do not need to be processed immediately and can be processed later depending on the system resource status.

[0072] Specifically, after identifying candidate data access requests, the server can obtain the bucket sizes of the real-time leaky bucket and the instantaneous leaky bucket for the current time period, obtaining the bucket size M of the real-time leaky bucket and the bucket size N of the instantaneous leaky bucket. It also obtains the number of data access requests already stored in the real-time leaky bucket and the number of data access requests already stored in the instantaneous leaky bucket. Based on the number of data access requests already stored in the real-time leaky bucket and the bucket size M, a first target number is determined. Based on the number of data access requests already stored in the instantaneous leaky bucket and the bucket size N, a second target number is determined. When the number of candidate data access requests is less than or equal to the first target number, each candidate data access request is directly identified as the first data access request, and the first data access requests are controlled to enter the real-time leaky bucket. When the number of candidate data access requests is greater than the first target number, the difference between the number of candidate data access requests and the first target number is determined. When this difference is less than or equal to the second target number, each candidate data access request is selected from the first target number. From a pool of candidate data access requests, a first target number of candidate data access requests are selected as the first data access requests. The remaining candidate data access requests from each pool are determined as the second data access requests. The first data access requests are controlled to enter the real-time leaky bucket, and the second data access requests are controlled to enter the instantaneous leaky bucket. When the difference is greater than the second target number, the first target number of candidate data access requests are selected as the first data access requests, and the second target number of candidate data access requests are selected as the second data access requests. The first data access requests are controlled to enter the real-time leaky bucket, and the second data access requests are controlled to enter the instantaneous leaky bucket. For the real-time leaky bucket and the instantaneous leaky bucket, the system can first process each first data access request in the real-time leaky bucket, and after processing each data access request in the real-time leaky bucket, process each second data access request in the instantaneous leaky bucket.

[0073] In the above embodiments, the server distributes requests to two different leaky buckets and manages them dynamically according to their priorities and the system's resource status. This strategy ensures that high-priority requests are not delayed by low-priority requests, while also guaranteeing full utilization of system resources.

[0074] In one embodiment, the number of candidate data access requests is h. The process by which the server controls the first data access request among the candidate data access requests to enter the real-time leaky bucket and controls the second data access request among the candidate data access requests to enter the instantaneous bucket includes the following steps: For the i-th candidate data access request, obtain the number m of data access requests already existing in the current real-time leaky bucket, and compare m with M; if m < M, then determine the i-th candidate data access request as the first data access request, and control the first data access request to enter the real-time leaky bucket; if m = M, obtain the number n of data access requests already existing in the current instantaneous leaky bucket, and compare n with N; if n < N, then determine the i-th candidate data access request as the second data access request, and control the second data access request to enter the instantaneous leaky bucket; if n = N, then determine the i-th candidate data access request as the remaining data access request; assign i = i + 1, return to the step of obtaining the number m of data access requests already existing in the current real-time leaky bucket for the i-th candidate data access request and comparing m with M, until i = h.

[0075] Referring to Figure 3, for example, for the first candidate data access request, the number m of existing data access requests in the current real-time leaky bucket is obtained, and m is compared with M; if m < M, the first candidate data access request is determined as the first data access request, and the first data access request is controlled to enter the real-time leaky bucket; if m = M, the number n of existing data access requests in the current instantaneous leaky bucket is obtained, and n is compared with N; if n < N, the first candidate data access request is determined as the second data access request, and the second data access request is controlled to enter the instantaneous leaky bucket; if n = N, the first candidate data access request is determined as the remaining data access request; for the second candidate data access request, the number m of existing data access requests in the current real-time leaky bucket is obtained, and m is compared with M. The process is compared with M; if m < M, the second candidate data access request is determined as the first data access request, and the first data access request is controlled to enter the real-time leaky bucket; if m = M, the number n of data access requests already existing in the current instantaneous leaky bucket is obtained, and n is compared with N. If n < N, the second candidate data access request is determined as the second data access request, and the second data access request is controlled to enter the instantaneous leaky bucket; if n = N, the second candidate data access request is determined as the remaining data access request. For the third candidate data access request, the process returns to obtaining the number m of data access requests already existing in the current real-time leaky bucket, and m is compared with M, until h candidate data access requests have been processed, thus achieving control over the entry of all candidate data access requests into the bucket.

[0076] In the above embodiments, the server manages and controls the process of candidate data access requests entering the real-time leaky bucket and the instantaneous leaky bucket in a fine manner, giving priority to allocating requests to the real-time leaky bucket. The system ensures that the most urgent and critical data access requests can receive a fast response. By dynamically checking the capacity of the real-time leaky bucket and the instantaneous leaky bucket and allocating requests accordingly, the system can make more efficient use of its processing power and resources.

[0077] In one embodiment, the above-mentioned data access request processing method further includes the following steps: selecting regular data access requests that do not meet the matching conditions from a plurality of data access requests; and performing response processing on the regular data access requests.

[0078] The matching conditions can be regular expressions for hot resources, while regular data access requests are data access requests used to access non-hot resources.

[0079] Specifically, the server extracts the corresponding data access path from each data access request, determines the regular expression for each data access path, and compares the regular expression of each data access request with the regular expression of the hot resource. For any data access request, if the regular expression of the data access request does not match the regular expression of the hot resource, the data access request is determined to be a regular data access request, and the server directly responds to the regular data access request.

[0080] In the above embodiments, the server selects regular data access requests that do not meet the matching conditions from multiple data access requests and processes the regular data access requests, thereby ensuring that the corresponding bandwidth resources are reserved to handle access to non-hotspot files.

[0081] In one embodiment, the above-mentioned data access request processing method further includes the following steps: after completing the response processing of the current data access request among multiple data access requests, obtaining the time period data traffic within the current time period; if the duration of the current time period is greater than or equal to a preset duration, determining the bandwidth of the current time period based on the time period data traffic; updating the concurrency limit based on the bandwidth to obtain the updated concurrency limit; updating the bucket size of the concurrent leaky bucket based on the updated concurrency limit to obtain the updated bucket size; the updated bucket size is used to guide the processing of new data access requests when new data access requests are received in the next time period.

[0082] In this context, time-period data traffic refers to the total data traffic corresponding to data access requests processed within the current time period. The current time period refers to the time interval between the current moment and the most recent update moment, which refers to the most recent historical moment when the concurrency limit was updated. Data traffic typically refers to the total amount of data transmitted over the network, including uploaded and downloaded data. The data traffic corresponding to the current data access request is the data traffic corresponding to the data storage path accessed by the current data access request.

[0083] The current data access request is the data access request that has been processed at the current moment. Specifically, it can be a regular data access request or a data access request retrieved from the concurrent leaky bucket.

[0084] Specifically, referring to Figures 4 and 5, after the server completes the response processing for the current data access request, it can obtain the data traffic corresponding to the current data access request, and update the most recently saved time period data traffic based on this data traffic to obtain the latest time period data traffic. The server then compares the duration of the current time period with the preset duration. If the duration of the current time period is greater than or equal to the preset duration, the ratio of the latest time period data traffic to the current time period is determined as the bandwidth corresponding to the current time period. The server then compares the bandwidth corresponding to the current time period with the preset bandwidth range. Based on the comparison result, the concurrency limit is updated to obtain the updated concurrency limit. Based on the updated concurrency limit, the bucket sizes of the real-time leaky bucket and the instantaneous leaky bucket are updated respectively to obtain the updated bucket sizes of the real-time leaky bucket and the instantaneous leaky bucket.

[0085] It is understandable that the number of concurrent connections is equal to the size of the concurrent leaky bucket. Therefore, when the number of concurrent connections increases or decreases, the size of the concurrent leaky bucket also increases or decreases accordingly.

[0086] In the above embodiments, the server monitors data traffic in real time and adjusts the concurrency limit based on this periodically, thereby periodically adjusting the size of the concurrency leak bucket. As a result, the system can process more requests while making full use of network bandwidth resources without overloading, thus avoiding performance degradation caused by resource idleness or overuse.

[0087] In one embodiment, the process of updating the concurrency limit based on bandwidth to obtain the updated concurrency limit includes the following steps: obtaining the lower limit and upper limit of bandwidth within a preset bandwidth range; if the bandwidth is less than the lower limit, increasing the concurrency limit to obtain the updated concurrency limit; if the bandwidth is less than the lower limit, decreasing the concurrency limit to obtain the updated concurrency limit; if the bandwidth is within the preset bandwidth range, determining the concurrency limit as the updated concurrency limit.

[0088] The preset bandwidth range is a pre-selected reasonable range for bandwidth usage. This range includes a lower bandwidth limit and a higher bandwidth limit, which are used to define the optimized area for network bandwidth usage, thereby providing a reference for the system to dynamically adjust concurrency limits.

[0089] Specifically, as shown in Figure 4, after determining the bandwidth corresponding to the current time period, the server obtains the lower and upper bandwidth limits of the preset bandwidth range. It then compares the bandwidth corresponding to the current time period with these limits. If the bandwidth is less than the lower limit, it indicates that network resources are not being fully utilized, thus increasing the concurrency limit to obtain the updated concurrency limit. If the bandwidth is greater than the lower limit, it indicates that the network or system is facing overload risk, thus decreasing the concurrency limit to obtain the updated concurrency limit. If the bandwidth is within the preset bandwidth range, it indicates that bandwidth usage is reasonable, and the current concurrency limit can remain unchanged, meaning the updated concurrency limit is determined.

[0090] In the above embodiments, by increasing the processing capacity of concurrent requests when bandwidth usage is below the lower limit, the server can ensure that it is not idle when resources are sufficient, and reduce the number of concurrent requests when bandwidth usage is close to the upper limit, thereby avoiding overload and potential service interruptions.

[0091] This application also provides a method for processing data access requests. As shown in Figure 6, a method for processing data access requests is provided, taking the application of this method to server 104 in Figure 1 as an example, and includes the following steps:

[0092] S602, when multiple data access requests are received, select candidate data access requests that meet the matching conditions and regular data access requests that do not meet the matching conditions from the multiple data access requests.

[0093] S604 handles responses to regular data access requests.

[0094] S606, based on the bucket size of the real-time leaky bucket corresponding to the current time period, controls the first data access request in the candidate data access requests to enter the real-time leaky bucket, and based on the bucket size of the instantaneous leaky bucket corresponding to the current time period, controls the second data access request in the candidate data access requests to enter the instantaneous bucket; the sum of the bucket size of the real-time leaky bucket and the bucket size of the loss leaky bucket is equal to the concurrency limit.

[0095] Among them, the number of first data access requests is less than or equal to M, the number of second data access requests is less than or equal to N, and the bucket size is equal to the concurrency limit.

[0096] S608, after completing the response processing of each data access request in the real-time leaky bucket, performs response processing of each data access request in the instantaneous leaky bucket, and blocks the remaining data access requests in the candidate data access requests.

[0097] S610, after completing the response processing of the current data access request among multiple data access requests, obtains the time period data flow within the current time period; the time period data flow is the total data flow corresponding to the data access requests that have been processed within the current time period, the current time period refers to the time period between the current time and the most recent update time, and the most recent update time refers to the most recent historical time when the concurrency limit was updated.

[0098] S612, if the duration of the current time period is greater than or equal to the preset duration, determine the bandwidth of the current time period based on the data traffic of the time period; update the concurrency limit based on the bandwidth to obtain the updated concurrency limit.

[0099] In one embodiment, the lower limit and upper limit of the bandwidth within a preset bandwidth range are obtained; if the bandwidth is less than the lower limit, the number of concurrent connections is increased to obtain the updated number of concurrent connections; if the bandwidth is less than the lower limit, the number of concurrent connections is decreased to obtain the updated number of concurrent connections; if the bandwidth is within the preset bandwidth range, the number of concurrent connections is determined as the updated number of concurrent connections.

[0100] S614, update the bucket size of the concurrent leaky bucket based on the updated concurrency limit, and obtain the updated bucket size; the updated bucket size is used to guide the processing of new data access requests when new data access requests are received in the next time period.

[0101] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0102] Based on the same inventive concept, this application also provides a data access request processing apparatus for implementing the data access request processing method described above. The solution provided by this apparatus is similar to the implementation described in the above method; therefore, the specific limitations in one or more data access request processing apparatus embodiments provided below can be found in the limitations of the data access request processing method described above, and will not be repeated here.

[0103] In an exemplary embodiment, as shown in FIG7, a data access request processing apparatus is provided, including: a data access request selection module 702, a leaky bucket control module 704, and a request response module 706, wherein:

[0104] The data access request selection module 702 is used to select candidate data access requests that meet the matching conditions from multiple data access requests when multiple data access requests are received.

[0105] The leaky bucket control module 704 is used to control the target data access requests in the candidate data access requests to enter the concurrent leaky bucket based on the bucket size of the concurrent leaky bucket corresponding to the current time period; the number of target data access requests is not greater than the bucket size of the concurrent leaky bucket, and the bucket size is equal to the concurrency limit.

[0106] The request-response module 706 is used to respond to each target data access request in the concurrent leaky bucket and to block the remaining data access requests in the candidate data access requests.

[0107] In the above embodiments, when multiple data access requests are received, candidate data access requests that meet the matching conditions are selected from the multiple data access requests, such as candidate data access requests for hot files. Based on the bucket size of the concurrent leaky bucket corresponding to the current time period, the target data access requests in the candidate data access requests are controlled to enter the concurrent leaky bucket. The number of target data access requests is not greater than the bucket size of the concurrent leaky bucket, and the bucket size is equal to the concurrency limit. Each target data access request in the concurrent leaky bucket is responded to, and the remaining data access requests in the candidate data access requests are blocked. In this way, data access requests for hot files can be restricted, so as to reserve the corresponding bandwidth resources to handle access to non-hot files.

[0108] In one embodiment, the concurrency limit is H, and the concurrent leaky bucket includes a real-time leaky bucket and an instantaneous leaky bucket. The size of the real-time leaky bucket is M, and the size of the instantaneous leaky bucket is N, where M and N are integers greater than or equal to 1, and M+N=H. The target data access request includes a first data access request and a second data access request. The leaky bucket control module 704 is further configured to: control the first data access request among the candidate data access requests to enter the real-time leaky bucket based on the size of the real-time leaky bucket corresponding to the current time period, and control the second data access request among the candidate data access requests to enter the instantaneous leaky bucket based on the size of the instantaneous leaky bucket corresponding to the current time period; wherein, the number of the first data access requests is less than or equal to M, the number of the second data access requests is less than or equal to N, and the response processing priority of the real-time leaky bucket is higher than the processing priority of the instantaneous leaky bucket.

[0109] In one embodiment, the number of candidate data access requests is h; the leaky bucket control module 704 is further configured to: for the i-th candidate data access request, obtain the number m of data access requests already existing in the current real-time leaky bucket, and compare m with M; if m < M, then determine the i-th candidate data access request as the first data access request, and control the first data access request to enter the real-time leaky bucket; if m = M, obtain the number n of data access requests already existing in the current instantaneous leaky bucket, and compare n with N; if n < N, then determine the i-th candidate data access request as the second data access request, and control the second data access request to enter the instantaneous leaky bucket; if n = N, then determine the i-th candidate data access request as the remaining data access request; assign i = i + 1, return to the step of obtaining the number m of data access requests already existing in the current real-time leaky bucket and comparing m with M for the i-th candidate data access request, until i = h.

[0110] In one embodiment, the request response module 706 is further configured to: select regular data access requests that do not meet the matching conditions from a plurality of data access requests; and perform response processing on the regular data access requests.

[0111] In one embodiment, the device further includes a concurrency limit adjustment module, which is configured to: after completing the response processing of the current data access request among multiple data access requests, obtain the time period data traffic within the current time period; the time period data traffic is the total data traffic corresponding to the data access requests that have been processed within the current time period, the current time period refers to the time period between the current time and the most recent update time, and the most recent update time refers to the historical time when the concurrency limit was last updated; if the duration of the current time period is greater than or equal to a preset duration, determine the bandwidth of the current time period based on the time period data traffic; update the concurrency limit based on the bandwidth to obtain the updated concurrency limit; update the bucket size of the concurrent leaky bucket based on the updated concurrency limit to obtain the updated bucket size; the updated bucket size is used to guide the processing of new data access requests when new data access requests are received in the next time period.

[0112] In one embodiment, the concurrency limit adjustment module is further configured to: obtain the lower limit value and the upper limit value of the bandwidth of a preset bandwidth range; if the bandwidth is less than the lower limit value, increase the number of concurrency limits to obtain the updated number of concurrency limits; if the bandwidth is less than the lower limit value, decrease the number of concurrency limits to obtain the updated number of concurrency limits; if the bandwidth is within the preset bandwidth range, determine the number of concurrency limits as the updated number of concurrency limits.

[0113] Each module in the aforementioned data access request processing device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.

[0114] In an exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram is shown in Figure 8. The computer device includes a processor, memory, input / output interfaces (I / O), and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is connected to the system bus via the I / O interfaces. The processor of the computer device provides computing and control capabilities. The memory of the computer device includes non-volatile storage media and internal memory. The non-volatile storage media stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database of the computer device stores data to be processed. The I / O interfaces of the computer device are used for exchanging information between the processor and external devices. The communication interface of the computer device is used for communicating with external terminals via a network connection. When the computer program is executed by the processor, it implements a method for processing data access requests.

[0115] Those skilled in the art will understand that the structure shown in Figure 8 is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or may combine certain components, or may have different component arrangements.

[0116] In one embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above method embodiments.

[0117] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above method embodiments.

[0118] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.

[0119] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.

[0120] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.

[0121] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0122] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A method for processing data access requests, characterized in that, The method includes: when multiple data access requests are received, obtaining the data access path corresponding to each of the multiple data access requests; determining the regular expression corresponding to each data access path; selecting candidate data access requests from the multiple data access requests whose regular expressions satisfy a matching condition; the matching condition being a regular expression for hot resources; controlling the target data access requests in the candidate data access requests to enter the concurrent leaky bucket based on the bucket size of the concurrent leaky bucket corresponding to the current time period; the number of target data access requests not exceeding the bucket size of the concurrent leaky bucket, the bucket size being equal to the concurrency limit; performing response processing on each target data access request in the concurrent leaky bucket, and blocking processing on the remaining data access requests in the candidate data access requests; and completing the processing of the current data access requests in the multiple data access requests. After processing the response to the access request, the time period data traffic within the current time period is obtained. The time period data traffic is the total data traffic corresponding to the data access requests that have been processed within the current time period. The current time period refers to the time period between the current moment and the most recent update moment, and the most recent update moment refers to the most recent historical moment when the concurrency limit was updated. If the duration of the current time period is greater than or equal to a preset duration, the bandwidth of the current time period is determined based on the time period data traffic. The concurrency limit is updated based on the bandwidth to obtain the updated concurrency limit. The bucket size of the concurrent leaky bucket is updated based on the updated concurrency limit to obtain the updated bucket size. The updated bucket size is used to guide the processing of new data access requests when they are received in the next time period.

2. The method according to claim 1, characterized in that, The concurrency limit is H, the concurrency leak bucket includes a real-time leak bucket and an instantaneous leak bucket, the size of the real-time leak bucket is M, the size of the instantaneous leak bucket is N, M and N are integers greater than or equal to 1, and M+N=H; the target data access request includes a first data access request and a second data access request. The step of controlling the target data access request among the candidate data access requests to enter the concurrent leaky bucket based on the bucket size of the concurrent leaky bucket corresponding to the current time period includes: controlling the first data access request among the candidate data access requests to enter the real-time leaky bucket based on the bucket size of the real-time leaky bucket corresponding to the current time period, and controlling the second data access request among the candidate data access requests to enter the instantaneous bucket based on the bucket size of the instantaneous leaky bucket corresponding to the current time period; wherein, the number of the first data access requests is less than or equal to M, the number of the second data access requests is less than or equal to N, and the response processing priority of the real-time leaky bucket is higher than the processing priority of the instantaneous leaky bucket.

3. The method according to claim 2, characterized in that, The number of candidate data access requests is h; the step of controlling the first data access request among the candidate data access requests to enter the real-time leaky bucket and controlling the second data access request among the candidate data access requests to enter the instantaneous bucket includes: for the i-th candidate data access request, obtaining the number m of data access requests already existing in the current real-time leaky bucket, and comparing m with M; if m < M, then determining the i-th candidate data access request as the first data access request, and controlling the first data access request to enter the real-time leaky bucket; if m = M, obtaining the number n of data access requests already existing in the current instantaneous leaky bucket, and comparing n with N; if n < N, then determining the i-th candidate data access request as the second data access request, and controlling the second data access request to enter the instantaneous leaky bucket; if n = N, then determining the i-th candidate data access request as the remaining data access request; assigning i = i + 1, returning to the step of obtaining the number m of data access requests already existing in the current real-time leaky bucket for the i-th candidate data access request and comparing m with M, until i = h.

4. The method according to claim 1, characterized in that, The method further includes: selecting regular data access requests that do not meet the matching conditions from the plurality of data access requests; and performing response processing on the regular data access requests.

5. The method according to claim 1, characterized in that, The step of updating the concurrency limit based on the bandwidth to obtain the updated concurrency limit includes: obtaining a lower bandwidth limit and an upper bandwidth limit of a preset bandwidth range; if the bandwidth is less than the lower bandwidth limit, increasing the concurrency limit to obtain the updated concurrency limit; if the bandwidth is greater than the upper bandwidth limit, decreasing the concurrency limit to obtain the updated concurrency limit; and if the bandwidth is within the preset bandwidth range, determining the concurrency limit as the updated concurrency limit.

6. A data access request processing apparatus, characterized in that, The device includes: a data access request selection module, configured to, when multiple data access requests are received, acquire the data access path corresponding to each of the multiple data access requests; determine the regular expression corresponding to each data access path; select candidate data access requests from the multiple data access requests whose regular expressions satisfy a matching condition; wherein the matching condition is a regular expression for hot resources; a leaky bucket control module, configured to, based on the bucket size of the concurrent leaky bucket corresponding to the current time period, control the entry of target data access requests from the candidate data access requests into the concurrent leaky bucket; wherein the number of target data access requests is not greater than the bucket size of the concurrent leaky bucket, and the bucket size is equal to the concurrency limit; a request response module, configured to respond to each target data access request in the concurrent leaky bucket, and block the remaining data access requests from the candidate data access requests; and a concurrency limit adjustment module. This method is used to obtain the time-period data traffic within the current time period after completing the response processing of the current data access request among the multiple data access requests. The time-period data traffic is the total data traffic corresponding to the data access requests that have been processed within the current time period. The current time period refers to the time period between the current moment and the most recent update moment, and the most recent update moment refers to the historical moment when the concurrency limit was last updated. If the duration of the current time period is greater than or equal to a preset duration, the bandwidth of the current time period is determined based on the time-period data traffic. The concurrency limit is updated based on the bandwidth to obtain the updated concurrency limit. The bucket size of the concurrent leaky bucket is updated based on the updated concurrency limit to obtain the updated bucket size. The updated bucket size is used to guide the processing of new data access requests when they are received in the next time period.

7. The apparatus according to claim 6, characterized in that, The concurrency limit is H. The concurrency leaky bucket includes a real-time leaky bucket and an instantaneous leaky bucket. The size of the real-time leaky bucket is M, and the size of the instantaneous leaky bucket is N. M and N are integers greater than or equal to 1, and M + N = H. The target data access request includes a first data access request and a second data access request. The leaky bucket control module is further configured to: control the first data access request among the candidate data access requests to enter the real-time leaky bucket based on the size of the real-time leaky bucket corresponding to the current time period, and control the second data access request among the candidate data access requests to enter the instantaneous leaky bucket based on the size of the instantaneous leaky bucket corresponding to the current time period; wherein, the number of the first data access requests is less than or equal to M, the number of the second data access requests is less than or equal to N, and the response processing priority of the real-time leaky bucket is higher than the processing priority of the instantaneous leaky bucket.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 5.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 5.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Hotspot data flow limiting control method, device and equipment and storage medium

    CN113179222A

  • Interface request processing method and device, server and server cluster

    CN115269643A