Write request processing method and device, equipment, storage medium and program product
By determining write request priorities and establishing priority queues, the method optimizes DMA write request processing, enhancing transmission efficiency and reducing delays.
Patent Information
- Application Number
- CN202411230233.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-03
- Publication Date
- 2024-12-27
AI Technical Summary
Existing technologies lack flexibility and efficiency in processing write requests, particularly in DMA systems, leading to suboptimal transmission rates and delays.
A method and device that determine the priority of write requests based on judgment criteria, establish priority queues, and set transmission orders to optimize DMA write request processing, splitting tasks into subtasks when necessary.
Improves write request transmission efficiency by ensuring high-priority requests are processed promptly, reducing delays and enhancing system throughput.
Smart Images

Figure CN119201381A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method, device, equipment, storage medium and program product for processing a write request. Background Art
[0002] DMA (Direct Memory Access) is a technology used in electronic devices for high-speed data transmission and processing. DMA allows external devices to directly access the host memory without the participation of the host's central processing unit (CPU), thereby reducing the workload of the host CPU and improving data transmission efficiency.
[0003] Currently, write requests are accelerated through multiple channels in DMA and written to the destination address of the SSD. When DMA processes a write request, it splits the transfer task into multiple subtasks based on whether the transfer task corresponding to the write request is an aligned task or an unaligned task, and improves the DMA transfer rate by transferring multiple subtasks.
[0004] However, the existing technology cannot process write requests flexibly and efficiently. Summary of the invention
[0005] The present application provides a write request processing method, device, equipment, storage medium and program product to solve the technical problem of low write request processing efficiency in the prior art.
[0006] In a first aspect, the present application provides a method for processing a write request, comprising:
[0007] Acquire multiple write requests sent by the host, wherein the write requests include a priority determination basis;
[0008] Determine the priority level of each write request based on the priority judgment criteria;
[0009] Establishing multiple priority queues according to the priority corresponding to each write request, wherein each priority queue includes at least one write request with the same priority;
[0010] The transmission order of each write request is determined according to the order of priorities corresponding to each priority queue and a preset transmission strategy.
[0011] In a possible implementation, the priority determination basis includes a data volume determination basis;
[0012] Accordingly, the priority corresponding to each write request is determined according to the priority judgment basis, including:
[0013] Get the data size of each write request;
[0014] Based on the data size judgment basis and the data size of each write request, each write request is compared and processed to determine the priority corresponding to each write request.
[0015] In a possible implementation, the priority determination basis includes taking priority information preset by the host as a determination basis;
[0016] Accordingly, the priority corresponding to each write request is determined according to the priority judgment basis, including:
[0017] Get the priority information preset by the host side in each write request;
[0018] The priority level of each write request is determined based on the priority information preset by the host.
[0019] In a possible implementation, the priority determination basis includes a logical address area determination basis;
[0020] Accordingly, the priority corresponding to each write request is determined according to the priority judgment basis, including:
[0021] Get the logical address area of each write request;
[0022] The priority level corresponding to each write request is determined according to the logical address region judgment basis and the logical address region of each write request.
[0023] In a possible implementation, the preset transmission strategy includes a preset single maximum data transmission amount;
[0024] Accordingly, according to the order of priorities corresponding to each priority queue and the preset transmission strategy, the transmission order of each write request is determined, including:
[0025] Get the data size of each write request;
[0026] According to a preset single maximum data transmission amount, determining a first write request whose data amount is larger than the preset single maximum data transmission amount, and determining a second write request whose data amount is not larger than the preset single maximum data transmission amount;
[0027] According to a preset single maximum data transmission amount, each first write request is split and processed to obtain multiple sub-requests corresponding to each first write request;
[0028] Each first write request is removed from the corresponding priority queue, and multiple sub-requests corresponding to each first write request are added to the priority queue;
[0029] The transmission order of each sub-request and each second write request is determined according to the order of priorities corresponding to each priority queue and a preset transmission strategy.
[0030] In a possible implementation, the preset transmission strategy includes a weighted polling strategy;
[0031] Accordingly, according to the order of priorities corresponding to each priority queue and the preset transmission strategy, the transmission order of each sub-request and each second write request is determined, including:
[0032] According to the weighted polling strategy, determine the polling weight corresponding to each priority queue;
[0033] The transmission order of each sub-request and each second write request is determined according to the polling weight corresponding to each priority queue and the order of the priorities corresponding to each priority queue.
[0034] In a possible implementation, after determining the transmission order of each sub-request and each second write request according to the polling weight corresponding to each priority queue and the order of the priorities corresponding to each priority queue, the method further includes:
[0035] According to the transmission order, the sub-request and the second write request are taken out from the corresponding priority queue and transmitted;
[0036] Get the number of requests remaining to be transmitted in each priority queue;
[0037] According to the number of remaining requests to be transmitted, it is determined whether to adjust the polling weight.
[0038] In a second aspect, the present application provides a write request processing device, comprising:
[0039] An acquisition module, used for acquiring multiple write requests sent by the host, wherein the write requests include a priority determination basis;
[0040] A first determination module, used to determine the priority corresponding to each write request according to a priority judgment basis;
[0041] A queue establishment module, used to establish multiple priority queues according to the priority corresponding to each write request, wherein each priority queue includes at least one write request with the same priority;
[0042] The second determination module is used to determine the transmission order of each write request according to the order of priorities corresponding to each priority queue and a preset transmission strategy.
[0043] In a third aspect, the present application provides a write request processing device, including:
[0044] at least one processor; and
[0045] a memory communicatively connected to at least one processor; wherein,
[0046] The memory stores instructions that can be executed by at least one processor, and the instructions are executed by at least one processor so that the at least one processor can execute the first aspect or various possible implementations of the first aspect as described above.
[0047] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the first aspect or various possible implementation methods of the first aspect as described above.
[0048] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the above first aspect or various possible implementation methods of the first aspect.
[0049] The present application provides a method, device, equipment, storage medium and program product for processing a write request. By obtaining a write request from the host side, based on the priority judgment basis in the write request, the priority corresponding to each write request is determined, and a corresponding priority queue is established. According to the order of the priority corresponding to each priority queue and the preset transmission strategy, the transmission order of the write request is determined. Compared with the prior art, when DMA processes a write request, based on whether the transmission task corresponding to the write request is an aligned task or an unaligned task, the transmission task is split into multiple subtasks and transmitted, or the write request is accelerated through multiple channels in DMA and written to the destination address of the solid-state hard disk. The present application determines the priority corresponding to each write request based on the priority judgment basis in the write request, flexibly processes write requests of different priorities, so that the write request can be transmitted in time, and establishes a corresponding priority queue for the write request, and determines the transmission order of the write request according to the order of the priority corresponding to each priority queue and the preset transmission strategy, thereby realizing efficient transmission of the write request. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0051] Figure 1 A write request processing system architecture diagram provided in an embodiment of the present application;
[0052] Figure 2 A flowchart of a method for processing a write request provided in an embodiment of the present application;
[0053] Figure 3A flowchart of a method for processing a write request provided in an embodiment of the present application;
[0054] Figure 4 A flowchart of a method for processing a write request provided in an embodiment of the present application;
[0055] Figure 5 A flowchart of a method for processing a write request provided in an embodiment of the present application;
[0056] Figure 6 A flowchart of a method for processing a write request provided in an embodiment of the present application;
[0057] Figure 7 A flowchart of a method for processing a write request provided in an embodiment of the present application;
[0058] Figure 8 A schematic diagram of the structure of a write request processing device provided in an embodiment of the present application;
[0059] Fig. 9 A schematic diagram of the structure of a write request processing device provided in an embodiment of the present application.
[0060] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0061] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0062] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0063] In actual use, a solid-state drive will receive multiple write requests from the host. For these write requests, DMA can be used to process the write requests to reduce the workload of the host CPU and data transmission efficiency.
[0064] In the prior art, write requests are accelerated through multiple channels in DMA or split according to preset types. However, the prior art lacks a judgment standard for write request priority and a corresponding transmission strategy, and cannot achieve flexible and efficient transmission of write requests.
[0065] Based on this, in the prior art, there is a problem of low processing efficiency of write requests.
[0066] In order to solve the above problems, the core concept of the present application is: by obtaining write requests from the host side, based on the priority judgment basis in the write request, determine the priority corresponding to each write request to realize the priority division of the write request, and establish a corresponding priority queue, according to the order of the priority corresponding to each priority queue and the preset transmission strategy, determine the transmission order of the write request, so that the write request can be transmitted in a reasonable transmission order, reducing the delay of the write request transmission, thereby improving the transmission efficiency of the write request.
[0067] Optional, Figure 1 A schematic diagram of a write request processing system architecture provided in an embodiment of the present application, wherein the write request processing system is a computer device. Figure 1 In the above framework, the above framework includes at least one of a data acquisition device 101, a processing device 102, and a display device 103.
[0068] It is understandable that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the system architecture for processing write requests. In other feasible implementations of the present application, the above architecture may include more or fewer components than shown in the figure, or combine certain components, or split certain components, or arrange the components differently, which can be determined according to the actual application scenario and is not limited here. Figure 1 The components shown may be implemented in hardware, software, or a combination of software and hardware.
[0069] In a specific implementation process, the data acquisition device 101 may include an input / output interface and may also include a communication interface. The data acquisition device 101 may be connected to the processing device via the input / output interface or the communication interface.
[0070] The processing device 102 can determine the priority corresponding to each write request based on the priority judgment basis in the write request from the host side, and establish a corresponding priority queue. According to the order of the priorities corresponding to each priority queue and the preset transmission strategy, the transmission order of the write requests is determined, thereby improving the transmission efficiency of the write requests.
[0071] The display device 103 may also be a touch display screen or a screen of a terminal device, which is used to receive user instructions while displaying the above content to achieve interaction with the user.
[0072] It should be understood that the above-mentioned processing device can be implemented by a processor reading instructions in a memory and executing the instructions, or it can be implemented by a chip circuit.
[0073] In addition, the network architecture and business scenarios described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Ordinary technicians in this field can know that with the evolution of network architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0074] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0075] Figure 2 A flowchart of a method for processing a write request provided in an embodiment of the present application is shown as follows: Figure 2 As shown, the method includes:
[0076] S201. Acquire multiple write requests sent by a host, wherein the write requests include a basis for determining a priority.
[0077] In this embodiment, the write request refers to an operation request for storing data on the solid state drive, wherein the write request includes a starting logical block address, a data length (also referred to as the number of logical blocks), and priority information.
[0078] S202: Determine the priority level corresponding to each write request according to a priority determination criterion.
[0079] In this embodiment, the priority level corresponding to each write request is determined based on the priority judgment basis so that high priority write requests can be processed first, thereby reducing delays, reducing system throughput, and improving write request processing efficiency.
[0080] S203. Establish multiple priority queues according to the priority corresponding to each write request, wherein each priority queue includes at least one write request with the same priority.
[0081] In this embodiment, the priority queue may refer to a data structure that determines the order in which elements are processed, and each priority queue is used to process write requests with the same priority.
[0082] For example, the priority queue may be a high priority queue and a low priority queue, or an nth priority queue, where n is an integer greater than 0.
[0083] S204: Determine the transmission order of each write request according to the order of priorities corresponding to each priority queue and a preset transmission strategy.
[0084] In this embodiment, the transmission order of each write request is determined based on the priority order corresponding to each priority queue and the preset transmission strategy, which can ensure that high-priority write requests can be processed in a timely manner, reduce the delay of write requests, and improve user experience; at the same time, it can avoid low-priority write requests being in a state of waiting for transmission, thereby reducing the waiting time and response time of write request transmission, improving the system's resource utilization, and avoiding resource waste.
[0085] In this embodiment, the priority judgment basis of multiple write requests sent by the machine is obtained to determine the priority of each write request, and a corresponding priority queue is established. According to the priority order corresponding to each priority queue and the preset transmission strategy, the transmission order of each write request is determined, thereby reducing the delay of the write request and the throughput of the system, and realizing the improvement of the processing efficiency of the write request.
[0086] Figure 3 A flowchart of a method for processing a write request provided in an embodiment of the present application is provided in the above Figure 2 Based on the embodiment shown in Figure 3 As shown, the priority determination basis in the above S202 includes a data volume determination basis;
[0087] Accordingly, the priority corresponding to each write request is determined according to the priority judgment basis, including:
[0088] S301. Obtain the data size of each write request.
[0089] In this embodiment, the data size of the write request refers to the data length of the write request.
[0090] For example, there are five write requests, and the data size of each write request is 8KB, 4KB, 4KB, 16KB, and 64KB respectively.
[0091] S302: Based on the data size judgment basis and the data size of each write request, compare and process each write request to determine the priority corresponding to each write request.
[0092] In this embodiment, the basis for determining the data size refers to the preset data size. If the data size of the write request is not higher than the preset data size, the priority of the write request is high priority. If the data size of the write request is higher than the preset data size, the priority of the write request is low priority.
[0093] For example, if the data size determination basis is 8KB, the high priority write requests include write requests with data sizes of 8KB, 4KB, and 4KB, and the low priority write requests include write requests with data sizes of 16KB and 64KB.
[0094] In this embodiment, the priority of the write request is determined by the data size of the write request and the basis for determining the data size, so that more write requests can be transmitted per unit time, thereby improving the transmission efficiency of the write request.
[0095] Figure 4 A flowchart of a method for processing a write request provided in an embodiment of the present application is provided in the above Figure 2 Based on the embodiment shown in Figure 4 As shown, the priority determination basis in the above S202 includes taking the priority information preset by the host as the determination basis;
[0096] Accordingly, the priority corresponding to each write request is determined according to the priority judgment basis, including:
[0097] S401. Obtain priority information preset by the host side in each write request.
[0098] In this embodiment, the priority information preset by the host is stored in the priority information of the write request.
[0099] S402: Determine the priority corresponding to each write request according to the priority information preset by the host.
[0100] For example, if the content of the priority information preset by the host side in the write request is high priority, the write request is assigned to the high priority queue; if the content of the priority information preset by the host side in the write request is low priority, the write request is assigned to the low priority queue.
[0101] In this embodiment, the priority corresponding to the write request can be directly determined by using the priority information preset by the host side carried in the write request, thereby improving the speed of determining the priority of the write request.
[0102] Figure 5 A flowchart of a method for processing a write request provided in an embodiment of the present application is provided in the above Figure 2 Based on the embodiment shown in Figure 5As shown, the priority determination basis in the above S202 includes a logic address area determination basis;
[0103] Accordingly, the priority corresponding to each write request is determined according to the priority judgment basis, including:
[0104] S501: Obtain a logical address area for each write request.
[0105] In this embodiment, for example, the logical address area of a 4KB write request is LBA 100000.
[0106] S502: Determine the priority corresponding to each write request according to the logical address region judgment basis and the logical address region of each write request.
[0107] In this embodiment, for example, the basis for determining the logical address area may be that the logical address area from 0 to 1T is a high priority logical address area, and other logical address areas are low priority logical address areas. If a 4KB write request with a logical address of LBA100000 is located in the high priority logical address area, the priority of the write request is high priority.
[0108] In this embodiment, logical address areas are prioritized, and high-priority write requests can be placed in logical address areas with shorter seek times, thereby improving the read and write performance and speed of write requests, thereby improving the processing efficiency of write requests.
[0109] Figure 6 A flowchart of a method for processing a write request provided in an embodiment of the present application is provided in the above Figure 2 Based on the embodiment shown in Figure 6 As shown, the preset transmission strategy in the above S204 includes a preset single maximum data transmission amount;
[0110] Accordingly, according to the order of priorities corresponding to each priority queue and the preset transmission strategy, the transmission order of each write request is determined, including:
[0111] S601: Obtain the data size of each write request.
[0112] In this embodiment, for example, five write requests with data sizes of 8 KB, 4 KB, 4 KB, 16 KB, and 64 KB are obtained.
[0113] S602: According to a preset single maximum data transmission amount, determine a first write request whose data amount is larger than the preset single maximum data transmission amount, and determine a second write request whose data amount is not larger than the preset single maximum data transmission amount.
[0114] In this embodiment, for example, the preset single maximum data transmission amount may be 8KB, then the first write request includes write requests with data amounts of 16KB and 28KB, and the second write request includes write requests with data amounts of 8KB, 4KB, and 4KB.
[0115] S603: Split each first write request according to a preset single maximum data transmission amount to obtain multiple sub-requests corresponding to each first write request.
[0116] In this embodiment, for example, according to the preset single maximum data transmission amount, write requests with data sizes of 16KB and 28KB are split and processed to obtain write requests with data sizes of 4KB, 8KB, 8KB and 8KB. Then, the multiple sub-requests corresponding to each second write request include write requests with data sizes of 4KB, 8KB, 8KB and 8KB.
[0117] S604: Move each first write request out of the corresponding priority queue, and add multiple sub-requests corresponding to each first write request to the priority queue.
[0118] In this embodiment, each first write request is removed from the corresponding priority queue, and multiple sub-requests corresponding to each first write request are added to the priority queue, so as to determine the transmission order of the multiple sub-requests.
[0119] S605 . Determine a transmission order of each sub-request and each second write request according to the order of priorities corresponding to each priority queue and a preset transmission strategy.
[0120] In this embodiment, for example, if the priority queue where the multiple sub-requests corresponding to each first write request are located is a low priority queue, and the queue where each second write request is located is a high priority queue, then according to the order of priorities corresponding to each priority queue and the preset transmission strategy, the transmission order of each sub-request and each second write request is determined to first transmit the second write request and then transmit the sub-request.
[0121] In this embodiment, by splitting the write requests, write requests with a larger data size can be split for transmission, thereby avoiding the write requests with a larger data size occupying the transmission channel for a long time, thereby improving the transmission efficiency of the write requests.
[0122] Figure 7 A flowchart of a method for processing a write request provided in an embodiment of the present application is provided in the above Figure 6 Based on the embodiment shown in Figure 7 As shown, the preset transmission strategy in the above S605 includes a weighted polling strategy;
[0123] Accordingly, according to the order of priorities corresponding to each priority queue and the preset transmission strategy, the transmission order of each sub-request and each second write request is determined, including:
[0124] S701. Determine the polling weight corresponding to each priority queue according to a weighted polling strategy.
[0125] In this embodiment, the weighted polling strategy refers to assigning a corresponding polling weight to each priority queue.
[0126] For example, the priority queue where the second write request is located has a weight of 2, and the priority queue where the sub-request is located has a weight of 1.
[0127] S702: Determine a transmission order of each sub-request and each second write request according to a polling weight corresponding to each priority queue and an order of priorities corresponding to each priority queue.
[0128] In this embodiment, for example, according to the polling weight corresponding to each priority queue and the order of the priority corresponding to each priority queue, determining the transmission order of each sub-request and each second write request can mean transmitting one sub-request after every two second write requests.
[0129] Optionally, after determining the transmission order of each sub-request and each second write request according to the polling weight corresponding to each priority queue and the order of the priorities corresponding to each priority queue, the method further includes:
[0130] S703 . According to the transmission order, take out the sub-request and the second write request from the corresponding priority queue and transmit them.
[0131] In this embodiment, for example, two second write requests are taken out from the high priority queue and transmitted, and then one sub-request is taken out from the low priority queue and transmitted.
[0132] S704: Obtain the number of requests to be transmitted remaining in each priority queue.
[0133] In this embodiment, for example, if no new write requests are added to the priority queue, the number of remaining requests to be transmitted is the difference between the total number of write requests and the number of transmitted write requests. If new write requests are added to the priority queue, the number of remaining requests to be transmitted is the difference between the total number of write requests and the number of transmitted write requests plus the number of new write requests.
[0134] S705: Determine whether to adjust the polling weight according to the number of remaining requests to be transmitted.
[0135] In this embodiment, for example, if the number of requests to be transmitted in the high priority queue is too large, the polling weight of the low priority queue may be reduced, or the polling weight of the high priority queue may be increased.
[0136] In this embodiment, by assigning different polling weights to different priority queues and determining the transmission order of write requests based on these polling weights, it is avoided that write requests of the same priority level occupy the transmission channel for a long time, resulting in other write requests being unable to be transmitted. The polling weights are adjusted according to the number of write requests in the priority queue, thereby flexibly improving the transmission efficiency of the write requests.
[0137] Figure 8 A schematic diagram of a write request processing device provided in an embodiment of the present application is shown in FIG. Figure 8 As shown, the write request processing device includes:
[0138] The acquisition module 801 is used to acquire multiple write requests sent by the host, wherein the write requests include priority determination criteria.
[0139] The first determination module 802 is used to determine the priority corresponding to each write request according to the priority judgment basis.
[0140] The queue establishment module 803 is used to establish multiple priority queues according to the priority corresponding to each write request, wherein each priority queue includes at least one write request with the same priority.
[0141] The second determination module 804 is used to determine the transmission order of each write request according to the order of priorities corresponding to each priority queue and a preset transmission strategy.
[0142] Fig. 9 A schematic diagram of the structure of a write request processing device provided in an embodiment of the present application. Fig. 9 As shown, the write request processing device provided in this embodiment includes:
[0143] At least one processor 901 and a memory 902. Optionally, the device further includes a communication component 903. The processor 901, the memory 902 and the communication component 903 are connected via a bus 904.
[0144] In a specific implementation process, at least one processor 901 executes the computer execution instructions stored in the memory 902, so that at least one processor 901 executes the above method.
[0145] The specific implementation process of the processor 901 can be found in the above method embodiment, and its implementation principle and technical effect are similar, so this embodiment will not be repeated here.
[0146] In the above embodiments, it should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the invention may be directly implemented as being executed by a hardware processor, or may be executed by a combination of hardware and software modules in the processor.
[0147] The memory may include a high-speed memory (Random Access Memory, RAM), and may also include a non-volatile memory (Non-volatile Memory, NVM), such as at least one disk memory.
[0148] The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of the present application is not limited to only one bus or one type of bus.
[0149] The present application also provides a computer program product, including a computer program, which implements the above method when executed by a processor.
[0150] The present application also provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the above method is implemented.
[0151] The above-mentioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The readable storage medium can be any available medium that can be accessed by a general or special-purpose computer.
[0152] An exemplary readable storage medium is coupled to a processor so that the processor can read information from the readable storage medium and write information to the readable storage medium. Of course, the readable storage medium can also be an integral part of the processor. The processor and the readable storage medium can be located in a dedicated integrated circuit. Of course, the processor and the readable storage medium can also exist in a device as discrete components.
[0153] The division of units is only a logical function division, and there may be other divisions in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interface, device or unit, which can be electrical, mechanical or other forms.
[0154] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0155] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0156] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a disk or an optical disk, and other media that can store program codes.
[0157] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.
[0158] Finally, it should be noted that those skilled in the art will readily conceive of other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. The present invention is intended to cover any variations, uses or adaptations of the present invention, which follow the general principles of the present invention and include common knowledge or customary technical means in the art not disclosed by the present invention, are not limited to the precise structure described above and shown in the drawings, and may be modified and changed in various ways without departing from the scope thereof. The scope of the present invention is limited only by the appended claims.
Claims
1. A method for processing a write request, characterized in that: include: Acquire multiple write requests sent by the host, wherein the write requests include a priority determination basis; Determine the priority level of each write request according to the priority judgment basis; Establishing a plurality of priority queues according to the priority corresponding to each of the write requests, wherein each of the priority queues includes at least one write request with the same priority; The transmission order of each write request is determined according to the order of priorities corresponding to each priority queue and a preset transmission strategy.
2. The method according to claim 1, characterized in that The priority determination basis includes a data volume determination basis; Accordingly, determining the priority corresponding to each of the write requests according to the priority judgment basis includes: Obtaining the data size of each write request; Based on the data size determination basis and the data size of each write request, each write request is compared and processed to determine the priority corresponding to each write request.
3. The method according to claim 1, characterized in that The priority determination basis includes taking priority information preset by the host as a determination basis; Correspondingly, determining the priority corresponding to each of the write requests according to the priority judgment basis includes: Obtaining priority information preset by the host side in each of the write requests; The priority level corresponding to each of the write requests is determined according to the priority level information preset by the host.
4. The method according to claim 1, characterized in that: The priority determination basis includes a logic address area determination basis; Correspondingly, determining the priority corresponding to each of the write requests according to the priority judgment basis includes: Obtaining a logical address region of each of the write requests; The priority level corresponding to each of the write requests is determined according to the logical address region determination basis and the logical address region of each of the write requests.
5. The method according to any one of claims 1 to 4, characterized in that: The preset transmission strategy includes a preset single maximum data transmission amount; Accordingly, determining the transmission order of each of the write requests according to the order of priorities corresponding to each of the priority queues and a preset transmission strategy includes: Obtaining the data size of each write request; According to the preset single maximum data transmission amount, determining a first write request whose data amount is larger than the preset single maximum data transmission amount, and determining a second write request whose data amount is not larger than the preset single maximum data transmission amount; According to the preset single maximum data transmission amount, split each of the first write requests to obtain multiple sub-requests corresponding to each of the first write requests; removing each of the first write requests from a corresponding priority queue, and adding a plurality of sub-requests corresponding to each of the first write requests to the priority queue; The transmission order of each of the sub-requests and each of the second write requests is determined according to the order of priorities corresponding to each of the priority queues and a preset transmission strategy.
6. The method according to claim 5, characterized in that The preset transmission strategy includes a weighted polling strategy; Correspondingly, determining the transmission order of each of the sub-requests and each of the second write requests according to the order of priorities corresponding to each of the priority queues and a preset transmission strategy includes: Determine the polling weight corresponding to each priority queue according to the weighted polling strategy; The transmission order of each of the sub-requests and each of the second write requests is determined according to the polling weight corresponding to each of the priority queues and the order of the priorities corresponding to each of the priority queues.
7. The method according to claim 6, characterized in that After determining the transmission order of each of the sub-requests and each of the second write requests according to the polling weight corresponding to each of the priority queues and the order of the priorities corresponding to each of the priority queues, the method further includes: According to the transmission order, taking out the sub-request and the second write request from the corresponding priority queue and transmitting them; Obtaining the number of requests to be transmitted remaining in each priority queue; Determine whether to adjust the polling weight according to the number of remaining requests to be transmitted.
8. A write request processing device, characterized in that: include: An acquisition module, used for acquiring a plurality of write requests sent by a host, wherein the write requests include a priority determination basis; A first determination module, configured to determine the priority level corresponding to each of the write requests according to the priority determination basis; A queue establishment module, used to establish a plurality of priority queues according to the priority corresponding to each of the write requests, wherein each of the priority queues includes at least one write request with the same priority; The second determination module is used to determine the transmission order of each of the write requests according to the order of priorities corresponding to each of the priority queues and a preset transmission strategy.
9. A write request processing device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method for processing a write request according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement the method for processing a write request according to any one of claims 1 to 7.
11. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method for processing a write request according to any one of claims 1 to 7 is implemented.
