Read-write control method and device, equipment and medium
By setting the total restricted traffic for the specified service and dynamically allocating traffic based on the proportion of read and write requests within the historical unit time slice, the problem of waste of traffic and low processing efficiency in IO requests is solved, and more efficient read and write control is achieved.
Patent Information
- Application Number
- CN202410009399.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-02
- Publication Date
- 2025-07-04
AI Technical Summary
In the prior art, the read and write control of IO requests has problems such as waste of traffic and low processing efficiency, resulting in poor reliability.
By setting a total restricted traffic for the specified service and dynamically allocating the traffic of read and write requests based on the proportion of read and write requests within the historical unit time slice to ensure full utilization of the total traffic.
It realizes adaptive dynamic allocation of traffic, avoids traffic waste, improves the accuracy and flexibility of traffic allocation, and improves the processing efficiency of read and write requests.
Smart Images

Figure CN120255783A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technologies, and more particularly, to a read / write control method, a read / write control device, an electronic device, and a computer-readable medium. Background Art
[0002] Currently, the processing of I / O in the input / output (I / O) stack is a crucial part in the field of computer technologies. It is used to process data requested by users, such as reading data from a disk or writing data to a disk. Among them, reading data from a disk is to process a read I / O request, and writing data to a disk is to process a write I / O request.
[0003] It can be understood that both processing a read I / O request and a write I / O request require allocating a limited traffic for them. In the related art, a limited traffic is allocated for the read I / O request to process the read I / O request with the allocated limited traffic. Correspondingly, a limited traffic is allocated for the write I / O request to process the write I / O request with the allocated limited traffic. Among them, allocating limited traffic for the read I / O request and the write I / O request respectively easily results in the phenomenon that the traffic cannot be fully utilized, thus causing traffic waste. At the same time, it also reduces the processing efficiency of the read I / O request or the write I / O request to a certain extent, and the flexibility is poor; that is, the reliability of read / write control in the related art is low.
[0004] Therefore, how to improve the reliability of read / write control is an urgent problem to be solved. Summary of the Invention
[0005] Embodiments of this application provide a read / write control method, device, equipment, and medium, which improve the reliability of read / write control.
[0006] In a first aspect, embodiments of this application provide a read / write control method, where the method includes: obtaining a total limited traffic set for read requests and write requests of a specified service; obtaining a ratio between the read requests and the write requests issued by the specified service within a historical unit time slice; calculating traffic allocation information for the read requests and traffic allocation information for the write requests at the current time point based on the total limited traffic and the ratio; allocating traffic matching the traffic allocation information for the read requests to the read requests, and allocating traffic matching the traffic allocation information for the write requests to the write requests; where the sum of the traffic allocated to the read requests and the traffic allocated to the write requests is less than or equal to the total limited traffic.
[0007] Second aspect, an embodiment of the present application provides a read-write control device, the device includes: a first acquisition module configured to acquire the total restricted traffic set for the read requests and write requests of a specified service; a second acquisition module configured to acquire the ratio between the read requests and write requests issued by the specified service within a historical unit time slice; a calculation module configured to calculate the traffic allocation information for the read requests and the traffic allocation information for the write requests at the current time point based on the total restricted traffic and the ratio; an allocation module configured to allocate traffic matching the traffic allocation information for the read requests to the read requests and allocate traffic matching the traffic allocation information for the write requests to the write requests; wherein, the sum of the traffic allocated to the read requests and the traffic allocated to the write requests is less than or equal to the total restricted traffic.
[0008] In an embodiment of the present application, based on the foregoing solution, the first acquisition module is specifically configured to: acquire the total restricted traffic matching the identification information of the specified service from the storage area; wherein, the storage area stores the identification information of multiple services and the total restricted traffic corresponding to the identification information of each service.
[0009] In an embodiment of the present application, based on the foregoing solution, before acquiring the total restricted traffic matching the identification information of the specified service from the storage area, the first acquisition module is further specifically configured to: if a setting request sent by a specified object is received, then display a traffic setting interface; in response to a setting operation received in the traffic setting interface, acquire the total restricted traffic set for the read requests and write requests of the service in the setting operation, and the identification information of the service; and associatively store the total restricted traffic and the identification information of the service in the storage area.
[0010] In an embodiment of the present application, based on the foregoing solution, the historical unit time slice includes multiple candidate unit time slices earlier than the current time point; the second acquisition module is specifically configured to: select a candidate unit time slice adjacent to the current time point from the multiple candidate unit time slices and use the selected candidate unit time slice as the target unit time slice; and acquire the ratio between the read requests and write requests issued by the specified service within the target unit time slice.
[0011] In an embodiment of the present application, based on the foregoing solution, the second acquisition module is further specifically configured to: acquire the quantity corresponding to the read requests issued by the specified service within the target unit time slice, and acquire the quantity corresponding to the write requests issued by the specified service within the target unit time slice; perform a division operation on the quantity corresponding to the read requests and the quantity corresponding to the write requests to obtain the ratio between the read requests and write requests.
[0012] In one embodiment of the present application, based on the foregoing solution, the ratio includes a ratio value corresponding to a read request and a ratio value corresponding to a write request; the calculation module is specifically configured to: perform a multiplication operation on the total restricted traffic and the ratio value corresponding to the read request to obtain the traffic allocation information of the read request at the current time point; and perform a multiplication operation on the total restricted traffic and the ratio value corresponding to the write request to obtain the traffic allocation information of the write request at the current time point.
[0013] In one embodiment of the present application, based on the foregoing solution, the ratio includes a ratio value corresponding to a read request and a ratio value corresponding to a write request; the calculation module is specifically configured to: increase the ratio value corresponding to the read request and decrease the ratio value corresponding to the write request to obtain an adjusted ratio; and calculate the traffic allocation information of the read request and the traffic allocation information of the write request at the current time point based on the total restricted traffic and the adjusted ratio.
[0014] In one embodiment of the present application, based on the foregoing solution, the calculation module is further specifically configured to: obtain the traffic used to send the write request of the specified service to the disk within the historical unit time slice; if the obtained traffic matches the total restricted traffic and the ratio value corresponding to the read request in the ratio is greater than zero, increase the ratio value corresponding to the read request and decrease the ratio value corresponding to the write request to obtain an adjusted ratio.
[0015] In one embodiment of the present application, based on the foregoing solution, after allocating traffic matching the traffic allocation information of the read request to the read request and allocating traffic matching the traffic allocation information of the write request to the write request, the read-write control device further includes: a first sending module configured to allocate a specified unit time slice to the read request and use the traffic allocated to the read request to send the read request to the disk within the allocated specified unit time slice; wherein, the time interval between the sending times of every two adjacent read requests is a specified duration; and a second sending module configured to allocate a specified unit time slice to the write request and use the traffic allocated to the write request to send the write request to the disk within the allocated specified unit time slice; wherein, the time interval between the sending times of every two adjacent write requests is a specified duration.
[0016] In one embodiment of the present application, based on the foregoing solution, the first sending module is specifically configured to: obtain the number of the read requests and allocate a specified unit time slice matching the number of the read requests to the read requests.
[0017] In one embodiment of the present application, based on the foregoing solution, the second sending module is specifically configured to: obtain the number of the write requests, and allocate a specified unit time slice matching the number of the write requests for the write requests.
[0018] In one embodiment of the present application, based on the foregoing solution, the second obtaining module is specifically configured to: estimate the traffic required to send the read requests and the write requests to the disk at the current time point based on the number of the read requests and the number of the write requests sent by the specified service at the current time; if the required traffic is greater than the total limited traffic, obtain the ratio between the read requests and the write requests sent by the specified service within the historical unit time slice.
[0019] In a third aspect, an embodiment of the present application provides an electronic device, including one or more processors; a memory for storing one or more programs, and when the one or more programs are executed by the one or more processors, enabling the electronic device to implement the read-write control method as described above.
[0020] In a fourth aspect, an embodiment of the present application provides a computer-readable medium, on which a computer program is stored, and when the computer program is executed by a processor, the read-write control method as described above is implemented.
[0021] In a fifth aspect, an embodiment of the present application provides a computer program product, including computer instructions, and when the computer instructions are executed by a processor, the read-write control method as described above is implemented.
[0022] In the technical solution provided by the embodiment of the present application:
[0023] A total limited traffic is set for the read requests and the write requests (i.e., IO requests) of the specified service, and based on the ratio between the read requests and the write requests actually sent by the specified service within the historical unit time slice and the total limited traffic, traffic is allocated for the read requests and traffic is allocated for the write requests. In this way, the adaptive dynamic allocation of traffic is achieved, avoiding the phenomenon of traffic waste caused by the insufficient utilization of traffic that is likely to occur when traffic matching the limited traffic is respectively allocated for the read requests and the write requests in the related art, improving the accuracy and flexibility of traffic allocation, and at the same time, since the traffic can be fully utilized, the processing efficiency of the read requests or the write requests is also improved to a certain extent; it can be seen that the read-write control in the technical solution of the present application has high reliability.
[0024] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1It is a schematic diagram of an exemplary implementation environment to which the technical solution of the embodiments of the present application can be applied.
[0026] Figure 2 It is a flowchart of a read-write control method shown in an exemplary embodiment of the present application.
[0027] Figure 3 It is a flowchart of a read-write control method shown in another exemplary embodiment of the present application.
[0028] Figure 4 It is a schematic diagram of a traffic setting interface shown in an exemplary embodiment of the present application.
[0029] Figure 5 It is a flowchart of a read-write control method shown in another exemplary embodiment of the present application.
[0030] Figure 6 It is a schematic diagram of a historical unit time slice shown in an exemplary embodiment of the present application.
[0031] Figure 7 It is a flowchart of a read-write control method shown in another exemplary embodiment of the present application.
[0032] Figure 8 It is a schematic diagram of a read-write control method shown in another exemplary embodiment of the present application.
[0033] Figure 9 It is a schematic diagram of the average distribution of read requests to disks shown in an exemplary embodiment of the present application.
[0034] Figure 10 It is a schematic diagram of the average distribution of write requests to disks shown in an exemplary embodiment of the present application.
[0035] Figure 11 It is a flowchart of a read-write control method shown in another exemplary embodiment of the present application.
[0036] Figure 12 It is a schematic diagram of a Cgroup hierarchy shown in an exemplary embodiment of the present application.
[0037] Figure 13 It is a schematic diagram of the coexistence of read requests and write requests shown in an exemplary embodiment of the present application.
[0038] Figure 14 It is a schematic diagram of the separate existence of read requests or write requests shown in an exemplary embodiment of the present application.
[0039] Figure 15 It is a schematic diagram of the coexistence of read requests and write requests with priority given to read requests shown in an exemplary embodiment of the present application.
[0040] Figure 16 It is a block diagram of a read / write control device shown in an exemplary embodiment of the present application.
[0041] Figure 17 It is a schematic structural diagram of a computer system of an electronic device suitable for implementing the embodiments of the present application. Detailed implementation manners
[0042] Here, the exemplary embodiments will be described in detail, and the examples are shown in the drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementation manners described in the following exemplary embodiments do not represent all the implementation manners of the present application. On the contrary, they are only examples of devices and methods that are the same as some aspects of the present application as detailed in the appended claims.
[0043] In the embodiments of the present application, the term "module" or "unit" refers to a computer program with a predetermined function or a part of a computer program, which works together with other related parts to achieve a predetermined goal, and can be fully or partially implemented by using software, hardware (such as a processing circuit or a memory), or a combination thereof. Similarly, one processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be a part of the overall module or unit that includes the function of the module or unit.
[0044] The block diagrams shown in the drawings are only functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities can be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0045] The flowcharts shown in the drawings are only exemplary illustrations, and do not necessarily include all the contents and operations / steps, nor do they necessarily need to be executed in the described order. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined. Therefore, the actual execution order may change according to the actual situation.
[0046] It should be noted that the "multiple" mentioned in the present application refers to two or more. "And / or" describes the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. The character " / " generally represents an "or" relationship between the associated objects before and after.
[0047] Currently, the processing of I / O in the input / output stack is a crucial part in the field of computer technology. It is used to process the data requested by users, such as reading data from a disk or writing data to a disk. Among them, reading data from a disk is to process a read I / O request, and writing data to a disk is to process a write I / O request.
[0048] It can be understood that both processing a read I / O request and a write I / O request require allocating a limited traffic for them. In the related art, a limited traffic is allocated for the read I / O request to process the read I / O request by using the allocated limited traffic. Correspondingly, a limited traffic is allocated for the write I / O request to process the write I / O request by using the allocated limited traffic. Among them, allocating limited traffic for the read I / O request and the write I / O request respectively easily results in the phenomenon that the traffic cannot be fully utilized, thus causing traffic waste. At the same time, it also reduces the processing efficiency of the read I / O request or the write I / O request to a certain extent, and the flexibility is poor; that is, the reliability of read / write control in the related art is low.
[0049] Therefore, in order to improve the reliability of read / write control and avoid phenomena such as traffic waste, low read / write processing efficiency, and poor flexibility, the present application provides a read / write control solution. Please refer to Figure 1 , Figure 1 which is a schematic diagram of an implementation environment involved in the present application. This implementation environment mainly includes a terminal device 101 and a server 102. Among them, the terminal device 101 and the server 102 communicate through a wired or wireless network.
[0050] The terminal device 101 refers to an electronic device that can receive read requests and / or write requests issued by a service provider for a specified service. Among them, the service provider can be any object with the need to process the specified service, such as a user.
[0051] Exemplarily, the terminal device includes but is not limited to a computer, a tablet, a laptop, a smart phone, a smart wearable device, etc.
[0052] The server 102 refers to a server that can interact with the terminal device. It can receive read requests and / or write requests issued by the service provider through the terminal device for a specified service, and perform corresponding processing based on the received corresponding requests, etc.
[0053] Exemplarily, the server may be a server cluster or a distributed system composed of multiple physical servers, where the server cluster or the distributed system includes cloud servers for providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms; Exemplarily, the server may also be an independent physical server, which is not limited herein.
[0054] It should be noted that Figure 1 the numbers of the terminal device 101 and the server 102 in are merely illustrative, and according to actual needs, there may be any number of terminal devices 101 and servers 102.
[0055] In an embodiment of the present application, the read-write control method may be executed by the terminal device 101.
[0056] Exemplarily, the terminal device obtains the total limited traffic set for the read requests and write requests of a specified service; then obtains the ratio between the read requests and write requests issued for the specified service within a historical unit time slice; then calculates the traffic allocation information for the read requests and the traffic allocation information for the write requests at the current time point based on the total limited traffic and the ratio; then allocates traffic matching the traffic allocation information for the read requests to the read requests, and allocates traffic matching the traffic allocation information for the write requests to the write requests, where the sum of the traffic allocated to the read requests and the traffic allocated to the write requests is less than or equal to the total limited traffic.
[0057] In an embodiment of the present application, the read-write control method may be executed by the server 102.
[0058] Exemplarily, the server obtains the total limited traffic set for the read requests and write requests of a specified service; then obtains the ratio between the read requests and write requests issued for the specified service within a historical unit time slice; then calculates the traffic allocation information for the read requests and the traffic allocation information for the write requests at the current time point based on the total limited traffic and the ratio; then allocates traffic matching the traffic allocation information for the read requests to the read requests, and allocates traffic matching the traffic allocation information for the write requests to the write requests, where the sum of the traffic allocated to the read requests and the traffic allocated to the write requests is less than or equal to the total limited traffic.
[0059] In an embodiment of the present application, the read-write control method may also be executed by the interaction between the terminal device 101 and the server 102, which will not be elaborated herein.
[0060] Figure 1The technical solutions of the illustrated embodiments can be applied to various scenarios, including but not limited to intelligent transportation, assisted driving, cloud technology, artificial intelligence, etc.; in actual applications, corresponding adjustments can be made according to specific application scenarios.
[0061] It should be noted that in the specific embodiments of this application, when it comes to user-related data, when the embodiments of this application are applied to specific products or technologies, user permission or consent needs to be obtained, and the collection, use, and processing of relevant data need to comply with relevant laws, regulations, and standards in relevant countries and regions.
[0062] The following elaborates in detail on various implementation details of the technical solutions of the embodiments of this application:
[0063] Please refer to Figure 2 , Figure 2 which is a flowchart of a read-write control method shown in an embodiment of this application, and this read-write control method can be executed by the server 102. As Figure 2 shown, this read-write control method at least includes S201 to S204, which are introduced in detail as follows:
[0064] S201, Obtain the total limited traffic set for the read requests and write requests of a specified service.
[0065] In the embodiments of this application, a total limited traffic is set for the read requests (i.e., read IO requests) and write requests (i.e., write IO requests) of a specified service. Therefore, when there is a need, the total limited traffic set for the read requests and write requests of a specified service can be obtained.
[0066] In the embodiments of this application, the total limited traffic refers to the total limited traffic set for the read requests and write requests of a specified service; for example, the total limited traffic corresponding to read requests + write requests is A1. Among them, the limited traffic includes but is not limited to the amount of data read and written per second (byte per second, BPS), the number of IOs per second (io per second, IOPS).
[0067] S202, Obtain the ratio between the read requests and write requests issued by a specified service within a historical unit time slice.
[0068] In the embodiments of this application, after / before / at the same time as obtaining the total limited traffic set for the read requests and write requests of a specified service, the ratio between the read requests and write requests issued by a specified service within a historical unit time slice can be obtained.
[0069] In the embodiments of this application, the historical unit time slice refers to a unit duration earlier than the current time point relative to the current time point, that is, a past unit duration; for example, the current time point is T0, and the historical unit time slice is [T2 - T1], where T2 > T1 > T0, > indicating earlier than.
[0070] In the embodiments of the present application, the read requests and write requests issued by the specified service refer to the read requests and write requests that the specified service expects to process, and there is a certain ratio between the read requests and the write requests; for example, read request:write request = 2:3, 1:1, 1:0, 0:1, etc.
[0071] It can be understood that due to reasons such as the limited processing capacity of the disk per unit time, in actual situations, the read requests and write requests that the specified service expects to process usually cannot be processed together, that is, the read requests and write requests that the specified service expects cannot be issued to the disk together to read data from the disk and / or write data to the disk; at the same time, the read requests and write requests that the specified service expects to process fluctuate. Therefore, in the related art, allocating limited traffic for read requests and write requests respectively will cause phenomena such as traffic waste, low read / write processing efficiency, and poor flexibility.
[0072] In an embodiment of the present application, the process of obtaining the ratio between the read requests and write requests issued by the specified service within the historical unit time slice in S202 may include:
[0073] Based on the number of read requests and write requests issued by the specified service at the current time point, estimate the traffic required to issue the read requests and write requests to the disk at the current time point;
[0074] If the required traffic is greater than the total limited traffic, obtain the ratio between the read requests and write requests issued by the specified service within the historical unit time slice.
[0075] That is, in the alternative embodiment, based on the number of read requests and write requests issued by the specified service at the current time point, estimate the traffic required to issue the read requests and write requests to the disk at the current time point, and then compare the estimated required traffic with the total limited traffic, and determine whether to obtain the ratio between the read requests and write requests issued by the specified service within the historical unit time slice based on the comparison result.
[0076] Among them, in the alternative embodiment, determining whether to obtain the ratio between the read requests and write requests issued by the specified service within the historical unit time slice based on the comparison result includes two cases:
[0077] Case 1, if the required traffic is greater than the total limited traffic, it indicates that speed limit needs to be imposed on the read requests and write requests at this time. Therefore, the step of obtaining the ratio between the read requests and write requests issued by the specified service within the historical unit time slice can be triggered to improve the reliability of read / write control.
[0078] Case 2, if the required traffic is less than or equal to the total restricted traffic, it indicates that there is no need to limit the read requests and write requests at this time. Therefore, the step of obtaining the ratio between the read requests and write requests issued for a specified service within a historical unit time slice may not be triggered for execution.
[0079] By implementing the optional embodiment, the ratio between the read requests and write requests issued for a specified service within a historical unit time slice is obtained only when the read requests and write requests are traffic-limited, saving computing resources and having high flexibility.
[0080] S203. Calculate the traffic allocation information for read requests and the traffic allocation information for write requests at the current time point based on the total restricted traffic and the ratio.
[0081] In the embodiments of the present application, the total restricted traffic and the ratio corresponding to the read requests and write requests are obtained. Subsequently, based on the total restricted traffic and the ratio, the traffic allocation information for read requests and the traffic allocation information for write requests at the current time point can be calculated.
[0082] In the embodiments of the present application, the traffic allocation information refers to the traffic information to be allocated. Specifically, the traffic allocation information for read requests refers to how much / what size of traffic is allocated for read requests, and the traffic allocation information for write requests refers to how much / what size of traffic is allocated for write requests.
[0083] In an embodiment of the present application, the ratio includes the ratio value corresponding to read requests and the ratio value corresponding to write requests; for example, taking read requests:write requests = 2:3 as an example, 2 / (2 + 3) is the ratio value corresponding to read requests, and 3 / (2 + 3) is the ratio value corresponding to write requests.
[0084] Correspondingly, the process of calculating the traffic allocation information for read requests and the traffic allocation information for write requests at the current time point based on the total restricted traffic and the ratio in S203 may include:
[0085] Perform a multiplication operation on the total restricted traffic and the ratio value corresponding to read requests to obtain the traffic allocation information for read requests at the current time point; and
[0086] Perform a multiplication operation on the total restricted traffic and the ratio value corresponding to write requests to obtain the traffic allocation information for write requests at the current time point.
[0087] That is, in the optional embodiment, a multiplication operation is performed on the total restricted traffic and the ratio value corresponding to read requests in the ratio to obtain the traffic allocation information for read requests at the current time point, and a multiplication operation is performed on the total restricted traffic and the ratio value corresponding to write requests in the ratio to obtain the traffic allocation information for write requests at the current time point.
[0088] For example, for a specified service 1, assume that the total restricted traffic corresponding to the read request + write request is A1, and the ratio of the read request to the write request is 2:3. Then, the traffic allocation information for the read request is 40% of A1 (i.e., 2 / (2 + 3)), and the traffic allocation information for the write request is 60% of A1 (i.e., 3 / (2 + 3)).
[0089] By implementing the optional embodiment, it is possible to simply and accurately calculate the traffic allocation information for the read request and the traffic allocation information for the write request at the current time point, thereby providing strong support for traffic allocation.
[0090] In an embodiment of the present application, the process of calculating the traffic allocation information for the read request and the traffic allocation information for the write request at the current time point based on the total restricted traffic and the ratio in S203 may include:
[0091] If the number of read requests and the number of write requests issued for the specified service at the current time point are both greater than zero, then obtain the protection traffic set for the read requests of the specified service;
[0092] Based on the obtained protection traffic corresponding to the read requests, the total restricted traffic, and the ratio, calculate the traffic allocation information for the read request and the traffic allocation information for the write request at the current time point.
[0093] That is, in the optional embodiment, when both read requests and write requests are issued for the specified service at the current time point, the protection traffic corresponding to the read requests of the specified service can be obtained, and then, based on the obtained protection traffic corresponding to the read requests, the total restricted traffic, and the ratio, the traffic allocation information for the read request and the traffic allocation information for the write request at the current time point can be calculated.
[0094] Among them, in the optional embodiment, when a total restricted traffic is set for the read requests and write requests of the specified service, a protection traffic can also be set for the read requests to give priority to satisfying the processing of the read requests.
[0095] For example, continuing with the previous example, assume that the protection traffic corresponding to the read requests is not less than 50% of the total traffic. Then, the traffic allocation information for the read requests should be 50% of A1 (max(2 / (2 + 3), 50%)), and correspondingly, the traffic allocation information for the write requests is 50% of A1 (i.e., 100% of A1 - 50% of A1).
[0096] By implementing the optional embodiment, when both read requests and write requests are issued for the specified service at the current time point, the protection traffic corresponding to the read requests, the total restricted traffic, and the ratio are used together to calculate the traffic allocation information for the read request and the traffic allocation information for the write request at the current time point, so as to allocate more traffic to the read requests, give priority to ensuring the read requests, which conforms to the processing characteristics of the read requests and write requests and is applicable to many extensive scenarios.
[0097] S204, allocate traffic that matches the traffic allocation information of the read request for the read request, and allocate traffic that matches the traffic allocation information of the write request for the write request; wherein, the sum of the traffic allocated for the read request and the traffic allocated for the write request is less than or equal to the total restricted traffic.
[0098] In the embodiment of the present application, the traffic allocation information of the read request and the traffic allocation information of the write request at the current time point are calculated. Subsequently, traffic that matches the traffic allocation information of the read request can be allocated for the read request based on the traffic allocation information of the read request, and traffic that matches the traffic allocation information of the write request can be allocated for the write request based on the traffic allocation information of the write request.
[0099] For example, continuing with the previous example, if the traffic allocation information of the read request is 40% A1, then 40% A1 of the traffic is allocated for the read request. If the traffic allocation information of the write request is 60% A1, then 60% A1 of the traffic is allocated for the write request.
[0100] In the embodiment of the present application, the sum of the traffic allocated for the read request and the traffic allocated for the write request is less than or equal to the total restricted traffic; for example, in the previous example, the sum of the 40% A1 of the traffic allocated for the read request and the 60% A1 of the traffic allocated for the write request is equal to 100% A1.
[0101] In the embodiment of the present application, a total restricted traffic is set for the read requests and write requests (i.e., IO requests) of a specified service. Based on the ratio between the actual read requests and write requests issued for the specified service within the historical unit time slice and this total restricted traffic, traffic is allocated for the read requests and traffic is allocated for the write requests. This realizes the adaptive dynamic allocation of traffic, avoids the phenomenon of traffic waste caused by the insufficient utilization of traffic that easily occurs in the related art when allocating traffic that matches the restricted traffic for the read requests and write requests respectively, improves the accuracy and flexibility of traffic allocation, and at the same time, since the traffic can be fully utilized, to a certain extent, the processing efficiency of the read requests or write requests is also improved; that is, the reliability of read-write control in the embodiment of the present application is high.
[0102] In an embodiment of the present application, another read-write control method is provided, and this read-write control method can be executed by the server 102. As Figure 3 shown, this read-write control method may include S301, S202 to S204.
[0103] S301 is introduced in detail as follows:
[0104] S301, obtain the total restricted traffic that matches the identification information of the specified service from the storage area; wherein, the storage area stores the identification information of multiple services, and the total restricted traffic corresponding to the identification information of each service.
[0105] In the embodiments of the present application, the total restricted traffic matching the identification information of a specified service can be obtained from a storage area, where the storage area stores the identification information of multiple services and the total restricted traffic corresponding to the identification information of each service.
[0106] For example, please refer to Table 1, which is an example of the storage situation in a storage area.
[0107] Service 1 Total Limited Traffic A1 Service 2 Total Limited Traffic A2 Service 3 Total Limited Traffic A3 …… ……
[0108] Table 1
[0109] As shown in Table 1, the storage area stores the total restricted traffic A1 corresponding to Service 1, the total restricted traffic A2 corresponding to Service 2, the total restricted traffic A3 corresponding to Service 3... In actual applications, the storage situation in the storage area can be adjusted according to specific application scenarios. The identification information of a service is used to uniquely identify the service, including but not limited to the number / sequence number of the service, the name of the service, etc.
[0110] For example, assume that the identification information of the specified service is Service 1. Therefore, the total restricted traffic A1 matching Service 1 can be obtained from the storage area shown in Table 1.
[0111] It can be understood that the foregoing embodiments introduce that the storage area already stores the identification information of multiple services and the total restricted traffic corresponding to the identification information of each service. Next, the origin process of the identification information of the services in the storage area and the total restricted traffic corresponding to the identification information of the services will be introduced.
[0112] In an embodiment of the present application, before the process of obtaining the total restricted traffic matching the identification information of a specified service from the storage area in S301, it may further include:
[0113] If a setting request sent by a specified object is received, display a traffic setting interface;
[0114] In response to the setting operation received in the traffic setting interface, obtain the total restricted traffic set for the read request and write request for the service in the setting operation, as well as the identification information of the service;
[0115] Associate and store the total restricted traffic and the identification information of the service in the storage area.
[0116] That is, in an alternative embodiment, if a setting request sent by a specified object is received, display a traffic setting interface, and then in response to the setting operation received in the traffic setting interface, obtain the total restricted traffic set for the read request and write request for the service in the setting operation, as well as the identification information of the service, and associate and store the total restricted traffic and the identification information of the service in the storage area.
[0117] Among them, in an alternative embodiment, the specified object may be a service provider or a service manager, etc. For example, it may be an administrator.
[0118] Among them, in an alternative embodiment, the traffic setting interface refers to an interface for setting traffic for a service, which includes controls / components related to the setting; for example, please refer to Figure 4 for a schematic diagram of a traffic setting interface.
[0119] Among them, in an alternative embodiment, when the specified object has a need to set a total restricted traffic for a service (it may be setting a total restricted traffic for a new service or modifying the total restricted traffic set for an existing service, etc.), it can issue a setting request, and then issue a setting operation in the traffic setting interface. Correspondingly, in response to the setting operation, the total restricted traffic and the identification information of the service set in the read request and write request in the setting operation are associated and stored in the storage area.
[0120] By implementing the alternative embodiment, based on the setting operation of the specified object on the displayed traffic setting interface, the service and the total restricted traffic can be simply and accurately associated and stored in the storage area, thereby providing strong support for obtaining the total restricted traffic of the specified service.
[0121] It can be understood that the process of setting the protected traffic for the read request in the foregoing embodiment can refer to the process of setting the total restricted traffic for the read request and write request in the embodiment of the present application, which will not be elaborated here.
[0122] It should be noted that Figure 3 For the detailed introduction of S202 to S204 shown, please refer to Figure 2 S202 to S204 shown, which will not be elaborated here.
[0123] In the embodiment of the present application, the storage area stores the identification information of multiple services and the total restricted traffic corresponding to the identification information of each service, so that the total restricted traffic matching the identification information of the specified service can be obtained from the storage area, providing strong support for calculating the traffic allocation information of the read request and write request at the current time point.
[0124] In an embodiment of the present application, another read / write control method is provided, and this read / write control method can be executed by the server 102. As Figure 5 shown, this read / write control method may include S501 to S502, S201, S203 to S204.
[0125] In the embodiment of the present application, the historical unit time slice includes multiple candidate unit time slices earlier than the current time point; for example, please refer to Figure 6, the current time point is T0, the historical unit time slice is [T2 - T1], and the historical unit time slice [T2 - T1] includes candidate unit time slices [T2 - t1'], [t1' - t2'], and [t2' - T1], etc. It can be understood that the minimum time unit is separated between T0 and T1.
[0126] S501 to S502 are introduced in detail as follows:
[0127] S501, select a candidate unit time slice adjacent to the current time point from multiple candidate unit time slices, and use the selected candidate unit time slice as the target unit time slice.
[0128] In the embodiments of the present application, a candidate unit time slice adjacent to the current time point can be selected from multiple candidate unit time slices, and the selected candidate unit time slice is used as the target unit time slice.
[0129] In the embodiments of the present application, the target unit time slice refers to a candidate unit time slice selected from multiple candidate unit time slices that is adjacent to the current time point, that is, the unit time slice closest to the current time point.
[0130] Illustrate with an example. For example, continuing with the previous Figure 6 Example, among the candidate unit time slices [T2 - t1'], [t1' - t2'], and [t2' - T1], the one adjacent to the current time point T0 is the candidate unit time slice [t2' - T1]. Then, the candidate unit time slice [t2' - T1] is selected from the candidate unit time slices [T2 - t1'], [t1' - t2'], and [t2' - T1]. At this time, the candidate unit time slice [t2' - T1] is the target unit time slice.
[0131] S502, obtain the ratio between the read requests and write requests issued by a specified service within the target unit time slice.
[0132] In the embodiments of the present application, after determining the target unit time slice, the ratio between the read requests and write requests issued by a specified service within the target unit time slice can be obtained, that is, the ratio between the read requests and write requests issued by a specified service within the unit time slice closest to the current time point.
[0133] Illustrate with an example. For example, continuing with the previous example, obtain the ratio between the read requests and write requests issued by a specified service within the target unit time slice [t2' - T1].
[0134] In one embodiment of the present application, the process of obtaining the ratio between the read requests and write requests issued by a specified service within a target unit time slice in S502 may include:
[0135] Obtain the quantity corresponding to the read requests issued by the specified service within the target unit time slice, and obtain the quantity corresponding to the write requests issued by the specified service within the target unit time slice;
[0136] Perform a division operation on the quantity corresponding to the read requests and the quantity corresponding to the write requests to obtain the ratio between the read requests and the write requests.
[0137] That is, in an alternative embodiment, it is to obtain the quantity corresponding to the read requests issued by the specified service within the target unit time slice, and obtain the quantity corresponding to the write requests issued by the specified service within the target unit time slice, and then perform a division operation on the quantity corresponding to the read requests and the quantity corresponding to the write requests to obtain the ratio between the read requests and the write requests.
[0138] Illustrate with an example. For example, continuing with the previous example, assume that the quantity corresponding to the read requests issued by the specified service within the target unit time slice [t2’ - T1] is n1, and the quantity corresponding to the write requests issued by the specified service within the target unit time slice [t2’ - T1] is n2. Then, perform a division operation on the quantity n1 corresponding to the read requests and the quantity n2 corresponding to the write requests to obtain the ratio between the read requests and the write requests.
[0139] By implementing the alternative embodiment, the ratio between the read requests and the write requests can be calculated simply and accurately, thereby improving the accuracy of traffic allocation.
[0140] It should be noted that Figure 5 For the detailed introduction of S201, S203 to S204 shown, please refer to Figure 2 S201, S203 to S204 shown, which will not be elaborated here.
[0141] In the embodiment of the present application, traffic allocation is based on the ratio between the read requests and the write requests issued by the specified service within the unit time slice closest to the current time point. Since the time interval is the closest, it can provide an accurate traffic allocation reference for the current time point to the greatest extent, thereby improving the accuracy of traffic allocation and further enhancing the reliability of read-write control.
[0142] In one embodiment of the present application, another read-write control method is provided, and this read-write control method can be executed by the server 102. As Figure 7 shown, this read-write control method may include S701 to S702, S201 to S202, S204.
[0143] As introduced in the foregoing embodiments, the ratios in the embodiments of the present application include the ratio value corresponding to the read request and the ratio value corresponding to the write request; for example, taking the read request:write request = 2:3 as an example, 2 / (2 + 3) is the ratio value corresponding to the read request, and 3 / (2 + 3) is the ratio value corresponding to the write request.
[0144] S701 to S702 are introduced in detail as follows:
[0145] S701, increase the ratio value corresponding to the read request and decrease the ratio value corresponding to the write request to obtain an adjusted ratio.
[0146] In the embodiments of the present application, the ratio between the read requests and the write requests issued by a specified service within a historical unit time slice is obtained, and then the ratio value corresponding to the read request and the ratio value corresponding to the write request in the ratio can be adjusted to obtain an adjusted ratio; specifically, the ratio value corresponding to the read request in the ratio can be increased, and the ratio value corresponding to the write request in the ratio can be decreased.
[0147] Illustrate with an example. For example, continuing with the foregoing example, assuming that the obtained read request:write request = 2:3, then the ratio value 2 / (2 + 3) corresponding to the read request can be increased, and the ratio value 3 / (2 + 3) corresponding to the write request can be decreased to obtain an adjusted read request:write request = 3:2.
[0148] It can be understood that since the total restricted traffic is fixed, when increasing the ratio value corresponding to the read request, it will involve correspondingly decreasing the ratio value corresponding to the write request; at the same time, in practical applications, the unit amount increased for the read request and the unit amount decreased for the write request can be flexibly adjusted according to specific application scenarios.
[0149] In an embodiment of the present application, the process of increasing the ratio value corresponding to the read request and decreasing the ratio value corresponding to the write request in S701 to obtain an adjusted ratio may include:
[0150] Obtain the traffic used to send the write requests of the specified service to the disk within a historical unit time slice;
[0151] If the obtained traffic matches the total restricted traffic and the ratio value corresponding to the read request in the ratio is greater than zero, increase the ratio value corresponding to the read request and decrease the ratio value corresponding to the write request to obtain an adjusted ratio.
[0152] That is, in the alternative embodiment, in addition to obtaining the ratio between the read requests and write requests issued for the specified service within the historical unit time slice, it is also possible to obtain the traffic used to issue the write requests of the specified service to the disk within the historical unit time slice, and then detect the relationship between the obtained traffic and the total limited traffic, and detect whether the ratio value corresponding to the read requests in the obtained ratio is greater than zero, and determine whether to adjust the obtained ratio based on the detection result.
[0153] Among them, determining whether to adjust the obtained ratio based on the detection result in the alternative embodiment includes two cases:
[0154] Case 1, if the obtained traffic matches the total limited traffic, and the ratio value corresponding to the read requests in the ratio is greater than zero, the obtained ratio can be adjusted.
[0155] It can be understood that the obtained traffic refers to the traffic used to issue the write requests of the specified service to the disk within the historical unit time slice (that is, the traffic allocated for the write requests of the specified service to the disk in the historical unit time slice), and this is allocated based on the ratio between the read requests and write requests issued for the specified service within the historical unit time slice thereof.
[0156] Among them, the obtained traffic matching the total limited traffic means that the ratio value corresponding to the read requests in the ratio between the read requests and write requests issued for the specified service within the historical unit time slice thereof is zero, while the ratio value corresponding to the read requests in the ratio between the read requests and write requests issued for the specified service within the historical unit time slice at the current time point is greater than zero, which means that the read requests issued for the specified service have changed / fluctuated, from none to some, so the read requests issued for the specified service may further increase; therefore, in the embodiment of the present application, it is considered to adjust the ratio between the read requests and write requests issued for the specified service within the historical unit time slice at the current time point (that is, increase the ratio value corresponding to the read requests and decrease the ratio value corresponding to the write requests).
[0157] Case 2, if the obtained traffic does not match the total limited traffic, and / or the ratio value corresponding to the read requests in the ratio is equal to zero, there is no need to adjust the obtained ratio.
[0158] By implementing the alternative embodiment, only when the traffic used to issue the write requests of the specified service to the disk within the historical unit time slice matches the total limited traffic, and the ratio value corresponding to the read requests in the ratio between the read requests and write requests issued for the specified service within the historical unit time slice is greater than zero, will the ratio between the read requests and write requests issued for the specified service within the obtained historical unit time slice be adjusted, which conforms to the fluctuation situation of the read requests and write requests issued for the specified service, thereby improving the accuracy of traffic allocation.
[0159] S702. Calculate the traffic allocation information for read requests and the traffic allocation information for write requests at the current time point based on the total restricted traffic and the adjusted ratio.
[0160] In the embodiments of the present application, after obtaining the adjusted ratio, the traffic allocation information for read requests and the traffic allocation information for write requests at the current time point can be calculated based on the total restricted traffic and the adjusted ratio.
[0161] In an embodiment of the present application, the process of calculating the traffic allocation information for read requests and the traffic allocation information for write requests at the current time point based on the total restricted traffic and the adjusted ratio in S702 may include:
[0162] Perform a multiplication operation on the ratio value corresponding to the read request in the total restricted traffic and the adjusted ratio to obtain the traffic allocation information for read requests at the current time point; and
[0163] Perform a multiplication operation on the ratio value corresponding to the write request in the total restricted traffic and the adjusted ratio to obtain the traffic allocation information for write requests at the current time point.
[0164] That is, in an alternative embodiment, the traffic allocation information for read requests at the current time point is obtained by performing a multiplication operation on the ratio value corresponding to the read request in the total restricted traffic and the adjusted ratio, and the traffic allocation information for write requests at the current time point is obtained by performing a multiplication operation on the ratio value corresponding to the write request in the total restricted traffic and the adjusted ratio.
[0165] For example, for a specified service 1, assume that the total restricted traffic corresponding to read requests + write requests is A1, and after adjustment, the ratio of read requests: write requests = 3:2. Then the traffic allocation information for read requests is 60% A1 (i.e., 3 / (2 + 3)), and the traffic allocation information for write requests is 40% A1 (i.e., 2 / (2 + 3)).
[0166] It should be noted that Figure 7 For the detailed introduction of S201 to S202 and S204 shown, please refer to Figure 7 S201 to S202 and S204 shown, which will not be elaborated here.
[0167] In the embodiments of the present application, the ratio value corresponding to the read request in the ratio is increased, and the ratio value corresponding to the write request in the ratio is decreased, that is, more traffic is allocated to the read requests, giving priority to ensuring the read requests, which conforms to the processing characteristics of read requests and write requests and is applicable to many extensive scenarios.
[0168] In an embodiment of the present application, another read-write control method is provided, and this read-write control method can be executed by the server 102. As Figure 8As shown, after S204, the read-write control method may further include S801 to S802.
[0169] S801 to S802 are introduced in detail as follows:
[0170] S801 allocates a specified unit time slice for the read request, and uses the traffic allocated for the read request to issue the read request to the disk within the allocated specified unit time slice; wherein, the time interval between the issuance times of every two adjacent read requests is a specified duration.
[0171] In the embodiment of the present application, after allocating traffic matching the traffic allocation information of the read request for the read request, a specified unit time slice can be allocated for the read request, and the read request is issued to the disk within the allocated specified unit time slice using the traffic allocated for the read request, and the time interval between the issuance times of every two adjacent read requests is a specified duration. That is to say, in the embodiment of the present application, the read requests are evenly issued to the disk within the allocated specified unit time slice using the traffic allocated for the read request, so as to reduce the phenomenon of read request jitter.
[0172] For example, please refer to Figure 9 , the read requests are evenly issued to the disk within the allocated specified unit time slice using the traffic allocated for the read request, and the time interval between the issuance times of every two adjacent read requests is t.
[0173] In an embodiment of the present application, the process of allocating a specified unit time slice for the read request in S801 may include:
[0174] Obtain the number of read requests, and allocate a specified unit time slice matching the number of read requests for the read requests.
[0175] That is to say, in an alternative embodiment, the number of read requests issued by a specified service is obtained, and a specified unit time slice matching the number of read requests is allocated for the read requests based on the number of read requests issued by the specified service.
[0176] Among them, in an alternative embodiment, the number of read requests is proportional to the allocated specified unit time slice, that is, the more the number of read requests, the longer the allocated specified unit time slice, and vice versa, the fewer the number of read requests, the shorter the allocated specified unit time slice.
[0177] By implementing the alternative embodiment, allocating a specified unit time slice for the read requests based on the number of read requests issued by the specified service is more accurate and appropriate, can avoid the phenomenon of read request jitter, and improves the reliability of read control.
[0178] S802 allocates a specified unit time slice for the write request, and uses the traffic allocated for the write request to issue the write request to the disk within the allocated specified unit time slice; wherein, the time interval between the issuance times of every two adjacent write requests is a specified duration.
[0179] In the embodiment of the present application, after allocating traffic matching the traffic allocation information of the write request for the write request, a specified unit time slice can be allocated for the write request, and the write request can be issued to the disk within the allocated specified unit time slice by using the traffic allocated for the write request, where the time interval between the issuance times of every two adjacent write requests is a specified duration. That is to say, in the embodiment of the present application, the write requests are evenly issued to the disk within the allocated specified unit time slice by using the traffic allocated for the write request, so as to reduce the phenomenon of write request jitter.
[0180] For example, please refer to Figure 10 , by evenly issuing the write requests to the disk within the allocated specified unit time slice by using the traffic allocated for the write request, where the time interval between the issuance times of every two adjacent write requests is t.
[0181] In an embodiment of the present application, the process of allocating a specified unit time slice for the write request in S802 may include:
[0182] Obtain the number of write requests, and allocate a specified unit time slice matching the number of write requests for the write requests.
[0183] That is to say, in an alternative embodiment, the number of write requests issued by a specified service is obtained, and a specified unit time slice matching the number of write requests is allocated for the write requests based on the number of write requests issued by the specified service.
[0184] Among them, in an alternative embodiment, the number of write requests is directly proportional to the allocated specified unit time slice, that is, the more the number of write requests, the longer the allocated specified unit time slice; conversely, the fewer the number of write requests, the shorter the allocated specified unit time slice.
[0185] By implementing the alternative embodiment, allocating a specified unit time slice for the write requests based on the number of write requests issued by a specified service is more accurate and appropriate, can avoid the phenomenon of write request jitter, and improves the reliability of write control.
[0186] It can be understood that the specified unit time slice allocated for the read request and the specified unit time slice allocated for the write request can be the same or different, and at the same time, the time interval between the issuance times of every two adjacent read requests and the time interval between the issuance times of every two adjacent write requests can be the same or different.
[0187] In an embodiment of the present application, after obtaining the total limited traffic set for the read requests and write requests of a specified service, the read requests and write requests can be queued (i.e., a common queue for read requests and write requests), and processed in the order of first in first out, that is, the read requests and write requests are sent to the disk in the order of first in first out.
[0188] That is, in an alternative embodiment, the traffic is adaptively allocated to the read requests and write requests based on the total limited traffic, so that it is not necessary to rely on the ratio between the actual read requests and write requests sent for the specified service within a historical unit time slice, and the allocation is more convenient and accurate.
[0189] It should be clear that since the read requests and write requests are sent to the disk in the order of first in first out in the alternative embodiment, the sending order of the read requests and write requests is fixed, which is not convenient to adjust the situation of sending the read requests and write requests to the disk, and is more suitable for scenarios where there are no corresponding requirements for sending the read requests and write requests to the disk.
[0190] It should be noted that Figure 8 in the illustration, S801 and S802 can be executed either first or later or simultaneously, and at the same time Figure 8 for the detailed introduction of S201 to S204 shown, please refer to Figure 2 S201 to S204 shown, which will not be elaborated here.
[0191] In the embodiment of the present application, by using the traffic allocated to the read requests to evenly send the read requests to the disk within the allocated specified unit time slice, and by using the traffic allocated to the write requests to evenly send the write requests to the disk within the allocated specified unit time slice, the phenomenon of read-write request jitter is avoided, and the reliability of read-write control is further improved.
[0192] The following details the specific scenarios of the embodiments of the present application:
[0193] The read-write control method in the embodiment of the present application can be applied to a scenario based on Cgroup, where Cgroup is a technology used by the Linux kernel for resource management and isolation. Each cgroup represents a resource management unit, which manages a part of system resources such as memory or IO.
[0194] Please refer to Figure 11 , Figure 11 which is a flowchart of the read-write control method shown in an embodiment of the present application.
[0195] As Figure 11 shown, the read-write control method at least includes S1101 to S1107, and the detailed introduction is as follows:
[0196] S1101, if a read request and a write request (i.e., an IO request) issued by a specified service are received at the current time point, obtain the total restricted traffic set for the read request and the write request of the specified service.
[0197] In an embodiment of the present application, the process of obtaining the total restricted traffic set for the read request and the write request of the specified service may include: obtaining, from the storage area, the total restricted traffic that matches the identification information of the specified service, where the storage area stores the identification information of multiple services and the total restricted traffic corresponding to the identification information of each service.
[0198] In an embodiment of the present application, the origin process of the identification information of the service stored in the storage area and the total restricted traffic corresponding to the identification information of the service may include: if a setting request sent by a specified object is received, display a traffic setting interface, and then, in response to the setting operation received in the traffic setting interface, obtain the total restricted traffic set for the read request and the write request of the service in the setting operation, as well as the identification information of the service, and associatively store the total restricted traffic and the identification information of the service in the storage area.
[0199] Exemplarily, the specified service may be a service related to an application system or a file system.
[0200] Exemplarily, the total restricted traffic set for the read request and the write request of the specified service may be adjusted based on the time slices corresponding to the read request and the write request issued by the specified service.
[0201] S1102, based on the number of read requests and write requests issued by the specified service at the current time point, estimate the traffic required to issue the read requests and write requests to the disk at the current time point.
[0202] In an embodiment of the present application, based on the number of read requests and write requests issued by the specified service at the current time point (which may be the number within the time slices corresponding to the read requests and write requests issued by the specified service), estimate the traffic required to issue the read requests and write requests to the disk at the current time point.
[0203] S1103, if the required traffic is greater than the total restricted traffic, obtain the ratio between the read requests and the write requests issued by the specified service within the target unit time slice closest to the current time point.
[0204] In an embodiment of the present application, if the required traffic is greater than the total restricted traffic, it indicates that speed limiting of the read requests and write requests is required at this time. Therefore, in an embodiment of the present application, traffic can be adaptively and dynamically allocated, that is, obtain the ratio between the read requests and the write requests issued by the specified service within the target unit time slice closest to the current time point to achieve adaptive dynamic allocation of traffic.
[0205] In the embodiments of the present application, if the required traffic is less than or equal to the total restricted traffic, it indicates that there is no need to limit the speed of read requests and write requests at this time. Therefore, in the embodiments of the present application, the traffic can be allocated according to the relevant technical solutions; correspondingly, the IO requests (read requests or write requests) are counted, and the unit time slice for sending the IO requests to the disk is adjusted to avoid the phenomenon of IO request jitter.
[0206] S1104, perform a multiplication operation on the total restricted traffic and the proportion value corresponding to the read requests in the proportion to obtain the traffic allocation information of the read requests at the current time point, and allocate traffic matching the traffic allocation information of the read requests to the read requests.
[0207] In the embodiments of the present application, perform a multiplication operation on the total restricted traffic and the proportion value corresponding to the read requests in the proportion to obtain the traffic allocation information of the read requests at the current time point, and allocate traffic matching the traffic allocation information of the read requests to the read requests.
[0208] In an embodiment of the present application, obtain the proportion between the read requests and the write requests issued by a specified service within the target unit time slice closest to the current time point, and then the obtained proportion can be adjusted, that is, allocate relatively more traffic to the read requests and relatively less traffic to the write requests to preferentially guarantee the read requests.
[0209] S1105, allocate a specified unit time slice to the read requests, and use the traffic allocated to the read requests to send the read requests to the disk within the allocated specified unit time slice; wherein, the time interval between the issuance times of every two adjacent read requests is a specified duration.
[0210] In an embodiment of the present application, the process of allocating a specified unit time slice to the read requests may include: obtaining the number of read requests, and allocating a specified unit time slice matching the number of read requests to the read requests.
[0211] It can be understood that, please refer to Figure 12 , in the scenario based on Cgroup, there is a tree-shaped cgroup hierarchical relationship; therefore, the child cgroup will forward the read requests to its upper-level parent cgroup until they are forwarded to the top-level parent cgroup (i.e., Root cgroup), so as to realize sending the read requests to the disk.
[0212] S1106, perform a multiplication operation on the total restricted traffic and the proportion value corresponding to the write requests in the proportion to obtain the traffic allocation information of the write requests at the current time point, and allocate traffic matching the traffic allocation information of the write requests to the write requests.
[0213] In the embodiment of the present application, the total restricted traffic and the proportional value corresponding to the write request in the ratio are multiplied to obtain the traffic allocation information of the write request at the current time point, and the traffic matching the traffic allocation information of the write request is allocated to the write request.
[0214] In an embodiment of the present application, the ratio between the read requests and the write requests issued by a specified service within the target unit time slice closest to the current time point is obtained, and then the obtained ratio can be adjusted, that is, relatively more traffic is allocated to the read requests and relatively less traffic is allocated to the write requests to preferentially guarantee the read requests.
[0215] S1107, allocate a specified unit time slice for the write request, and use the traffic allocated to the write request to issue the write request to the disk within the allocated specified unit time slice; wherein, the time interval between the issuance times of every two adjacent write requests is a specified duration.
[0216] In an embodiment of the present application, the process of allocating a specified unit time slice for the write request may include: obtaining the number of write requests, and allocating a specified unit time slice matching the number of write requests for the write request.
[0217] It can be understood that, please refer to Figure 12 , in the scenario based on Cgroup, there is a tree-shaped cgroup hierarchical relationship; therefore, the child cgroup will forward the write request to its upper-level parent cgroup until it is forwarded to the top-level parent cgroup (i.e., Root cgroup), so as to realize issuing the write request to the disk.
[0218] Among them, Figure 12 the total amount of IO request issuances of all child cgroups does not exceed the total restricted traffic of its parent cgroup, and at the same time Figure 12 the Cgroup-based scenario shown may be Cgroup v1.
[0219] It should be noted that Figure 11 in S1104 to S1105 and S1106 to S1107 shown, any one of them can be executed first or any one of them can be executed later or they can be executed in parallel, and at the same time Figure 11 for the detailed introduction of S1101 to S1106 shown, please refer to the foregoing embodiment introduction, and details are not described herein again.
[0220] Next, several scenarios to which the foregoing read-write control method can be applied are exemplified.
[0221] Scenario 1, please refer to Figure 13 , for the scenario where read requests (i.e., read IOs, the same below) and write requests (i.e., write IOs, the same below) coexist, such as Figure 13 shown:
[0222] At time t0, the ratio between the read requests and write requests issued by the specified service = 2:1. At this time, it exceeds the total limit traffic (also known as the read-write speed limit threshold, the same below) set for the read requests and write requests of the specified service. Among them, the ratio of the traffic allocated to the read requests and write requests = 1:1. At this time, the ratio of the read requests and write requests issued to the disk = 1:1. It can be understood that in the initial stage, the traffic can be evenly divided, and the duration corresponding to the initial stage is short, that is, it will quickly enter the t1 moment.
[0223] At time t1, the ratio between the read requests and write requests issued by the specified service = 2:1. At this time, it also exceeds the total limit traffic set for the read requests and write requests of the specified service, triggering adaptive dynamic traffic allocation. That is, based on the ratio between the read requests and write requests issued by the specified service at time t0 = 2:1, traffic is allocated to the read requests and write requests. Among them, the ratio of the traffic allocated to the read requests and write requests = 2:1. At this time, the ratio of the read requests and write requests issued to the disk = 2:1.
[0224] Scenario 2, please refer to Figure 14 , for the scenario where only read requests or write requests exist, such as Figure 14 shown as:
[0225] At time t0, the ratio between the read requests and write requests issued by the specified service = 0:1. At this time, it exceeds the total limit traffic set for the read requests and write requests of the specified service. Among them, the ratio of the traffic allocated to the read requests and write requests = 1:1. It can be understood that in the most recent unit time slice before time t0, the ratio between the read requests and write requests issued by the specified service = 1:1. Therefore, at time t0, the ratio of the traffic allocated to the read requests and write requests = 1:1.
[0226] It should be noted that since there are no read requests, at this time, the write requests only use 50% of the total amount (that is, the traffic corresponding to 50% of the read-write speed limit threshold). In other words, the ratio of the read requests and write requests issued to the disk = 0:1.
[0227] At time t1, the ratio between the read requests and write requests issued by the specified service = 1:1. At this time, it also exceeds the total limit traffic set for the read requests and write requests of the specified service, triggering adaptive dynamic traffic allocation. That is, based on the ratio between the read requests and write requests issued by the specified service at time t0 = 0:1, traffic is allocated to the read requests and write requests. Among them, the ratio of the traffic allocated to the read requests and write requests = 0:1.
[0228] It should be noted that at this time, the write requests can monopolize 100% of the total amount (that is, the traffic corresponding to 100% of the read-write speed limit threshold). In other words, the ratio of the read requests and write requests issued to the disk = 0:1.
[0229] Scenario 3, please refer to Figure 15 , which is a scenario where read requests and write requests coexist and read requests are preferentially guaranteed, such as Figure 15 shown as follows:
[0230] At time t0, the ratio between the read requests and write requests issued by the specified service = 1:8. At this time, it exceeds the total restricted traffic set for the read requests and write requests of the specified service, where the ratio of the traffic allocated to the read requests and write requests = 0:1. It can be understood that in the most recent unit time slice before time t0, the ratio between the read requests and write requests issued by the specified service = 0:1. Therefore, at time t0, the ratio of the traffic allocated to the read requests and write requests = 0:1, and at this time, the ratio of the read requests and write requests issued to the disk = 0:1.
[0231] At time t1, the ratio between the read requests and write requests issued by the specified service = 1:8. At this time, it also exceeds the total restricted traffic set for the read requests and write requests of the specified service, triggering adaptive dynamic traffic allocation, that is, based on the ratio between the read requests and write requests issued by the specified service at time t0 = 1:8, traffic is allocated to the read requests and write requests, where the ratio of the traffic allocated to the read requests and write requests = 1:1.
[0232] It should be noted that the normal ratio of the traffic allocated to the read requests and write requests = 1:8. In order to preferentially guarantee the read requests, the traffic that can completely process the read requests is allocated to the read requests, and part of the traffic is reserved for the read requests. At this time, the ratio of the read requests and write requests issued to the disk = 1:2.
[0233] Scenario 4 is a scenario for dynamically adjusting the time slice, where:
[0234] As Figure 9 shown, by using the traffic allocated to the read requests, the read requests are evenly issued to the disk within the allocated specified unit time slice, where the time interval between the issuance of every two adjacent read requests is t.
[0235] As Figure 10 shown, by using the traffic allocated to the write requests, the write requests are evenly issued to the disk within the allocated specified unit time slice, where the time interval between the issuance of every two adjacent write requests is t.
[0236] By implementing the solution of the present application, there are at least the following beneficial effects:
[0237] (1) It realizes the adaptive dynamic allocation of traffic, avoiding the phenomenon of traffic waste caused by the underutilization of traffic that easily occurs in the related art when allocating traffic that matches the restricted traffic for read requests and write requests respectively, improving the accuracy and flexibility of traffic allocation. At the same time, since the traffic can be fully utilized, to a certain extent, the processing efficiency of read requests or write requests is also improved.
[0238] (2) By taking the ratio between the read requests and write requests issued by the specified service within the nearest unit time slice to the current time point as the basis for the adaptive dynamic allocation of traffic, because the time interval is the closest, it can provide an accurate traffic allocation reference for the current time point to the greatest extent, further improving the accuracy of traffic allocation.
[0239] (3) Allocate more traffic to read requests, giving priority to ensuring read requests, which conforms to the processing characteristics of read requests and write requests and is applicable to many extensive scenarios.
[0240] (4) By using the traffic allocated to read requests to evenly distribute the read requests to the disk within the allocated specified unit time slice, and by using the traffic allocated to write requests to evenly distribute the write requests to the disk within the allocated specified unit time slice, the phenomenon of read-write request jitter is avoided, and the reliability of read-write control is high.
[0241] Figure 16 It is a block diagram of a read-write control device shown in an embodiment of the present application. As Figure 16 shown, the read-write control device includes:
[0242] The first acquisition module 1601 is configured to acquire the total restricted traffic set for the read requests and write requests of the specified service;
[0243] The second acquisition module 1602 is configured to acquire the ratio between the read requests and write requests issued by the specified service within the historical unit time slice;
[0244] The calculation module 1603 is configured to calculate the traffic allocation information for read requests and the traffic allocation information for write requests at the current time point based on the total restricted traffic and the ratio;
[0245] The allocation module 1604 is configured to allocate traffic that matches the traffic allocation information for the read requests to the read requests, and allocate traffic that matches the traffic allocation information for the write requests to the write requests; wherein, the sum of the traffic allocated to the read requests and the traffic allocated to the write requests is less than or equal to the total restricted traffic.
[0246] In an embodiment of the present application, based on the foregoing solution, the first acquisition module 1601 is specifically configured to:
[0247] Obtain the total restricted traffic that matches the identification information of the specified service from the storage area; wherein, the identification information of multiple services and the total restricted traffic corresponding to the identification information of each service are stored in the storage area.
[0248] In an embodiment of the present application, based on the foregoing solution, before obtaining the total restricted traffic that matches the identification information of the specified service from the storage area, the first acquisition module 1601 is further specifically configured to:
[0249] If a setting request sent by a specified object is received, display a traffic setting interface;
[0250] In response to the setting operation received in the traffic setting interface, obtain the total restricted traffic set for the read request and write request for the service in the setting operation, and the identification information of the service;
[0251] Associate and store the total restricted traffic and the identification information of the service in the storage area.
[0252] In an embodiment of the present application, based on the foregoing solution, the historical unit time slice includes multiple candidate unit time slices earlier than the current time point; the second acquisition module 1602 is specifically configured to:
[0253] Select a candidate unit time slice adjacent to the current time point from the multiple candidate unit time slices, and use the selected candidate unit time slice as the target unit time slice;
[0254] Obtain the ratio between the read requests and write requests issued by the specified service within the target unit time slice.
[0255] In an embodiment of the present application, based on the foregoing solution, the second acquisition module 1602 is further specifically configured to:
[0256] Obtain the number of read requests issued by the specified service within the target unit time slice, and obtain the number of write requests issued by the specified service within the target unit time slice;
[0257] Perform a quotient operation on the number corresponding to the read request and the number corresponding to the write request to obtain the ratio between the read request and the write request.
[0258] In an embodiment of the present application, based on the foregoing solution, the ratio includes a ratio value corresponding to the read request and a ratio value corresponding to the write request; the calculation module 1603 is specifically configured to:
[0259] Multiply the total restricted traffic by the ratio value corresponding to the read request to obtain the traffic allocation information for the read request at the current time point; and
[0260] Multiply the total restricted traffic by the ratio value corresponding to the write request to obtain the traffic allocation information for the write request at the current time point.
[0261] In an embodiment of the present application, based on the foregoing solution, the ratio includes the ratio value corresponding to the read request and the ratio value corresponding to the write request; the calculation module 1603 is specifically configured to:
[0262] Increase the ratio value corresponding to the read request and decrease the ratio value corresponding to the write request to obtain an adjusted ratio;
[0263] Based on the total restricted traffic and the adjusted ratio, calculate the traffic allocation information for the read request and the traffic allocation information for the write request at the current time point.
[0264] In an embodiment of the present application, based on the foregoing solution, the calculation module 1603 is further specifically configured to:
[0265] Obtain the traffic used to send the write request of the specified service to the disk within the historical unit time slice;
[0266] If the obtained traffic matches the total restricted traffic and the ratio value corresponding to the read request in the ratio is greater than zero, increase the ratio value corresponding to the read request and decrease the ratio value corresponding to the write request to obtain an adjusted ratio.
[0267] In an embodiment of the present application, based on the foregoing solution, after allocating traffic matching the traffic allocation information for the read request to the read request and allocating traffic matching the traffic allocation information for the write request to the write request, the read-write control device further includes:
[0268] The first sending module is configured to allocate a specified unit time slice for the read request and use the traffic allocated for the read request to send the read request to the disk within the allocated specified unit time slice; wherein, the time interval between the sending times of every two adjacent read requests is a specified duration; and
[0269] The second sending module is configured to allocate a specified unit time slice for the write request and use the traffic allocated for the write request to send the write request to the disk within the allocated specified unit time slice; wherein, the time interval between the sending times of every two adjacent write requests is a specified duration.
[0270] In an embodiment of the present application, based on the foregoing solution, the first distribution module is specifically configured to: obtain the number of the read requests, and allocate a specified unit time slice that matches the number of the read requests for the read requests.
[0271] In an embodiment of the present application, based on the foregoing solution, the second distribution module is specifically configured to: obtain the number of the write requests, and allocate a specified unit time slice that matches the number of the write requests for the write requests.
[0272] In an embodiment of the present application, based on the foregoing solution, the second acquisition module 1602 is specifically configured to:
[0273] Based on the number of read requests and write requests issued by the specified service at the current time, estimate the traffic required to issue the read requests and the write requests to the disk at the current time point;
[0274] If the required traffic is greater than the total limit traffic, obtain the ratio between the read requests and the write requests issued by the specified service within the historical unit time slice.
[0275] It should be noted that the device provided in the foregoing embodiment and the method provided in the foregoing embodiment belong to the same concept, and the specific manners in which each module and unit perform operations have been described in detail in the method embodiment.
[0276] An embodiment of the present application further provides an electronic device, including: one or more processors; a memory for storing one or more programs, and when the one or more programs are executed by the one or more processors, enabling the electronic device to implement the read-write control method as described above.
[0277] Figure 17 It is a schematic structural diagram of a computer system of an electronic device suitable for implementing the embodiments of the present application.
[0278] It should be noted that Figure 17 The computer system 1700 of the electronic device shown is only an example, and should not bring any limitation to the functions and usage scopes of the embodiments of the present application.
[0279] Such as Figure 17As shown, computer system 1700 includes a Central Processing Unit (CPU) 1701, which can perform various appropriate actions and processes according to the program stored in the Read-Only Memory (ROM) 1702 or the program loaded from the storage section 1708 into the Random Access Memory (RAM) 1703, such as executing the methods in the above embodiments. In the RAM 1703, various programs and data required for system operation are also stored. The CPU 1701, ROM 1702, and RAM 1703 are connected to each other via a bus 1704. An Input / Output (I / O) interface 1705 is also connected to the bus 1704.
[0280] The following components are connected to the I / O interface 1705: an input section 1706 including a keyboard, a mouse, etc.; an output section 1707 including, for example, a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), etc. and a speaker, etc.; a storage section 1708 including a hard disk, etc.; and a communication section 1709 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 1709 performs communication processing via a network such as the Internet. A drive 1710 is also connected to the I / O interface 1705 as needed. A removable medium 1711, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1710 as needed so that a computer program read from it can be installed into the storage section 1708 as needed.
[0281] Specifically, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network via the communication section 1709, and / or installed from the removable medium 1711. When the computer program is executed by the Central Processing Unit (CPU) 1701, various functions defined in the system of the present application are executed.
[0282] It should be noted that the computer-readable medium shown in the embodiments of the present application can be a computer-readable signal medium, a computer-readable storage medium, or any combination of the two. The computer-readable medium can be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of the computer-readable medium may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, the computer-readable medium can be any tangible medium that contains or stores a program, and the program can be used by or in conjunction with an instruction execution system, apparatus, or device. In the present application, the computer-readable signal medium can include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable computer program. Such a propagated data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer-readable signal medium can also be any computer-readable medium other than the computer-readable storage medium, and the computer-readable medium can send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device. The computer program contained on the computer-readable medium can be transmitted by any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0283] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present application. Among them, each block in the flowchart or block diagram can represent a module, a program segment, or a part of code, and the above module, program segment, or part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in an order different from that marked in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram or flowchart, and the combination of blocks in the block diagram or flowchart, can be implemented by a dedicated hardware-based system for performing the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.
[0284] The units involved in the embodiments described in this application can be implemented in software or in hardware, and the described units can also be provided in a processor. Among them, the names of these units do not constitute a limitation on the units themselves in some cases.
[0285] Another aspect of this application also provides a computer-readable medium, on which a computer program is stored. When the computer program is executed by a processor, the read-write control method as described above is implemented. The computer-readable medium can be included in the electronic device described in the above embodiments, or can exist alone without being assembled into the electronic device.
[0286] Another aspect of this application also provides a computer program product or a computer program. The computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable medium. The processor of the computer device reads the computer instructions from the computer-readable medium, and the processor executes the computer instructions, so that the computer device executes the read-write control methods provided in the above various embodiments.
[0287] The above content is only a preferred exemplary embodiment of this application and is not used to limit the implementation of this application. Those of ordinary skill in the art can easily make corresponding adaptations or modifications according to the main ideas and spirits of this application. Therefore, the protection scope of this application should be subject to the protection scope required by the claims.
Claims
1. A read-write control method, characterized in that, Including: Obtain the total limited traffic set for read requests and write requests of a specified service; Obtain the ratio between the read requests and write requests issued by the specified service within a historical unit time slice; Based on the total limited traffic and the ratio, calculate the traffic allocation information for read requests and the traffic allocation information for write requests at the current time point; Allocate traffic that matches the traffic allocation information for the read request to the read request, and allocate traffic that matches the traffic allocation information for the write request to the write request; wherein, the sum of the traffic allocated to the read request and the traffic allocated to the write request is less than or equal to the total limited traffic.
2. The method according to claim 1, wherein The obtaining the total limited traffic set for read requests and write requests of a specified service includes: Obtain the total limited traffic that matches the identification information of the specified service from a storage area; wherein, the storage area stores the identification information of multiple services and the total limited traffic corresponding to the identification information of each service.
3. The method according to claim 2, characterized in that, Before obtaining the total limited traffic that matches the identification information of the specified service from the storage area, the method further includes: If a setting request sent by a specified object is received, display a traffic setting interface; In response to a setting operation received in the traffic setting interface, obtain the total limited traffic set for read requests and write requests of the service in the setting operation, and the identification information of the service; Associate and store the total limited traffic and the identification information of the service in the storage area.
4. The method according to claim 1, wherein The historical unit time slice includes multiple candidate unit time slices earlier than the current time point; The obtaining the ratio between the read requests and write requests issued by the specified service within a historical unit time slice includes: Select a candidate unit time slice adjacent to the current time point from the multiple candidate unit time slices, and use the selected candidate unit time slice as the target unit time slice; Obtain the ratio between the read requests and write requests issued by the specified service within the target unit time slice.
5. The method according to claim 4, wherein The obtaining the ratio between the read requests and write requests issued by the specified service within the target unit time slice includes: Obtain the number of read requests issued by the specified service within the target unit time slice, and obtain the number of write requests issued by the specified service within the target unit time slice; Perform a quotient operation on the number corresponding to the read request and the number corresponding to the write request to obtain the ratio between the read request and the write request.
6. The method according to claim 1, wherein The ratio includes a ratio value corresponding to the read request and a ratio value corresponding to the write request; the calculating the traffic allocation information for read requests and the traffic allocation information for write requests at the current time point based on the total limited traffic and the ratio includes: Perform a multiplication operation on the total limited traffic and the ratio value corresponding to the read request to obtain the traffic allocation information for read requests at the current time point; and Perform a multiplication operation on the total limited traffic and the ratio value corresponding to the write request to obtain the traffic allocation information for write requests at the current time point.
7. The method according to any one of claims 1 to 6, characterized in that The ratio includes a ratio value corresponding to a read request and a ratio value corresponding to a write request; calculating the traffic allocation information for the read request and the traffic allocation information for the write request at the current time point based on the total restricted traffic and the ratio includes: Increasing the ratio value corresponding to the read request and decreasing the ratio value corresponding to the write request to obtain an adjusted ratio; Calculating the traffic allocation information for the read request and the traffic allocation information for the write request at the current time point based on the total restricted traffic and the adjusted ratio.
8. The method according to claim 7, wherein The increasing the ratio value corresponding to the read request and decreasing the ratio value corresponding to the write request to obtain an adjusted ratio includes: Obtaining the traffic used to send the write requests of the specified service to the disk within the historical unit time slice; If the obtained traffic matches the total restricted traffic and the ratio value corresponding to the read request in the ratio is greater than zero, increasing the ratio value corresponding to the read request and decreasing the ratio value corresponding to the write request to obtain an adjusted ratio.
9. The method according to any one of claims 1 to 6, characterized in that, After allocating traffic matching the traffic allocation information for the read request to the read request and allocating traffic matching the traffic allocation information for the write request to the write request, the method further includes: Allocating a specified unit time slice to the read request and using the traffic allocated to the read request to send the read request to the disk within the allocated specified unit time slice; wherein, the time interval between the sending times of every two adjacent read requests is a specified duration; and Allocating a specified unit time slice to the write request and using the traffic allocated to the write request to send the write request to the disk within the allocated specified unit time slice; wherein, the time interval between the sending times of every two adjacent write requests is a specified duration.
10. The method according to claim 9, wherein The allocating a specified unit time slice to the read request includes: Obtaining the number of the read requests and allocating a specified unit time slice matching the number of the read requests to the read requests; The allocating a specified unit time slice to the write request includes: Obtaining the number of the write requests and allocating a specified unit time slice matching the number of the write requests to the write requests.
11. The method according to any one of claims 1 to 6, characterized in that, The obtaining the ratio between the read requests and the write requests issued by the specified service within the historical unit time slice includes: Based on the number of read requests and the number of write requests issued by the specified service at the current time, estimating the traffic required to send the read requests and the write requests to the disk at the current time point; If the required traffic is greater than the total restricted traffic, obtaining the ratio between the read requests and the write requests issued by the specified service within the historical unit time slice.
12. A read-write control device, characterized in that, Includes: A first obtaining module configured to obtain the total restricted traffic set for the read requests and the write requests of the specified service; A second obtaining module configured to obtain the ratio between the read requests and the write requests issued by the specified service within the historical unit time slice; A calculating module configured to calculate the traffic allocation information for the read request and the traffic allocation information for the write request at the current time point based on the total restricted traffic and the ratio; A distribution module, configured to distribute traffic that matches the traffic distribution information of the read request for the read request, and distribute traffic that matches the traffic distribution information of the write request for the write request; wherein the sum of the traffic distributed for the read request and the traffic distributed for the write request is less than or equal to the total limit traffic.
13. An electronic device, characterized in that, Comprising: One or more processors; A memory for storing one or more programs, which when executed by the electronic device, cause the electronic device to implement the read-write control method according to any one of claims 1 to 11.
14. A computer-readable medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the read-write control method according to any one of claims 1 to 11.
15. A computer program product comprising computer instructions, characterized in that, When the computer instruction is executed by a processor, it implements the read-write control method according to any one of claims 1 to 11.