WO2023071101A1 - Io任务处理方法、装置和计算机设备和存储介质 - Google Patents
Io任务处理方法、装置和计算机设备和存储介质 Download PDFInfo
- Publication number
- WO2023071101A1 WO2023071101A1 PCT/CN2022/089352 CN2022089352W WO2023071101A1 WO 2023071101 A1 WO2023071101 A1 WO 2023071101A1 CN 2022089352 W CN2022089352 W CN 2022089352W WO 2023071101 A1 WO2023071101 A1 WO 2023071101A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- tasks
- merging
- time
- processing
- time spent
- Prior art date
Links
- 238000003672 processing method Methods 0.000 title claims abstract description 21
- 238000012545 processing Methods 0.000 claims abstract description 103
- 238000000034 method Methods 0.000 claims abstract description 21
- 230000006872 improvement Effects 0.000 claims description 36
- 238000005457 optimization Methods 0.000 claims description 19
- 230000004044 response Effects 0.000 claims description 7
- 238000012805 post-processing Methods 0.000 claims description 4
- 230000008569 process Effects 0.000 description 4
- 238000010586 diagram Methods 0.000 description 3
- 230000001360 synchronised effect Effects 0.000 description 2
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0602—Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
- G06F3/061—Improving I/O performance
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/14—Handling requests for interconnection or transfer
- G06F13/20—Handling requests for interconnection or transfer for access to input/output bus
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0668—Interfaces specially adapted for storage systems adopting a particular infrastructure
- G06F3/0671—In-line storage system
- G06F3/0673—Single storage device
- G06F3/0674—Disk device
- G06F3/0676—Magnetic disk device
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5061—Partitioning or combining of resources
Definitions
- the present application relates to the field of storage technology, in particular to an IO task processing method, device, computer equipment and storage medium.
- IO IN/OUT
- the simplest processing method is to execute these IO requests individually in sequence, but this method is less efficient. If the IO requests with adjacent read/write positions are combined according to the location information of the read/write disk, and then read/write to the disk, the processing efficiency can be improved to a certain extent.
- the inventor realizes that at present, there are some methods about IO merging, but these methods mainly focus on how to merge IOs, but ignore the time of IO merging.
- One thing that needs to be explained is that the IO merging time is not as long as possible. Because after IO merging is enabled, the host needs to wait for the completion of IO merging before it can read and write to the disk. Sometimes, too long IO merging time will reduce IO processing efficiency. It can be seen that the selection of IO merging time is an urgent problem to be solved.
- the present application provides a method for processing an IO task, the method comprising:
- step S1 also includes:
- Step S2 is performed stably in response to determining the time spent processing different IO tasks according to the above variance; or, in response to determining that the time spent processing different IO tasks is unstable according to the above variance, continue to execute the IO tasks separately in sequence.
- the IO merging time is determined according to the first mean value of the time spent processing a single IO when executed separately in sequence, including:
- the total time spent in statistically processing the merged IO tasks includes reading/writing the merged IO tasks and the remaining unmerged IO tasks;
- the above initialization merging time is taken as the optimal IO merging time.
- the calculation of the second mean value of the time spent processing each IO when merging IO tasks includes:
- the second average value of the time spent on processing each IO when merging the IO tasks is calculated.
- the calculation of the second mean value of the time spent processing each IO when merging IO tasks includes:
- u 2 is the second mean value of the time spent processing each IO when merging IO tasks
- x t is the merging time
- t is the total time spent processing merging IO tasks
- n is the merged IO task and the remaining unmerged IO The total number of tasks for the task.
- the above-mentioned calculation of the efficiency improvement value when merging IO tasks includes:
- ⁇ is the efficiency improvement value
- u1 is the first average value of the time spent processing a single IO when executed separately in sequence
- u2 is the second average value of the time spent processing each IO when merging IO tasks.
- the IO merging time is determined according to the first average value of the time spent processing a single IO when executed sequentially and individually, and further includes:
- the above-mentioned adjustment of the merging time of merging IO tasks includes:
- the above-mentioned adjustment of the merging time of merging IO tasks includes:
- x t is the merge time
- ⁇ is the efficiency improvement value
- an IO task processing device includes a separate execution module, an optimization module, and an optimized post-processing module, wherein:
- the separate execution module is used to receive multiple IO tasks issued by the host and execute them individually in sequence, and count the first average value of the time spent processing a single IO when executing individually in sequence;
- the optimization module is used to continue to receive multiple IO tasks issued by the host and merge the execution of the IO tasks, and determine the best IO merge time according to the first average value of the time spent processing a single IO when the above-mentioned sequential execution is performed separately;
- the optimized post-processing module is used to continue to execute the remaining IO tasks issued by the host according to the above-mentioned optimal IO merging time.
- a computer device comprising a memory, one or more processors, and computer-readable instructions stored on the memory and operable on the processors, when the processor executes the computer-readable instructions Implement the steps of the IO task processing method provided by any one of the above embodiments.
- one or more non-volatile computer-readable storage media storing computer-readable instructions is provided, and when the computer-readable instructions are executed by one or more processors, the IO tasks provided by any one of the above-mentioned embodiments are implemented. The steps of the processing method.
- FIG. 1 is a schematic flowchart of an IO task processing method provided by the present application according to one or more embodiments
- FIG. 2 is a schematic flowchart of a separate execution stage provided by the present application according to one or more embodiments
- Fig. 3 is a schematic flowchart of an optimization stage provided by the present application according to one or more embodiments
- Fig. 4 is a schematic flow chart of the post-optimization processing stage provided by the present application according to one or more embodiments;
- FIG. 5 is a structural block diagram of an IO task processing device provided by the present application according to one or more embodiments
- Fig. 6 is an internal structural diagram of a computer device provided by the present application according to one or more embodiments.
- the present application provides a method for processing an IO task in one embodiment.
- the following uses the application of the method in a computer device as an example for illustration. As shown in FIG. 1, the method includes the following steps:
- the method of this application mainly includes three stages.
- IO merging is not enabled, and the efficiency of processing a single IO is analyzed;
- the IO merging time is optimized through the method of heuristic learning, and the IO obtained in the second stage is used in the third stage.
- Merge time continue to process the IO request issued by the host.
- the IO read/write efficiency of the host can be effectively improved by performing IO merging, thereby saving system resources.
- step S1 also includes:
- step S2 In response to determining that the time spent processing different IO tasks is stable according to the variance, execute step S2; or in response to determining that the time spent processing different IO tasks is unstable according to the variance, continue to execute the IO tasks individually in sequence.
- the IO merging time is determined according to the first mean value of the time spent processing a single IO when executed separately in sequence, including:
- the total time spent when statistically processing the merged IO tasks, the above-mentioned processing merged IO tasks includes performing read/write processing on the merged IO tasks and the remaining unmerged IO tasks;
- the above initialization merging time is taken as the optimal IO merging time.
- the computer device uses the above initialization merging time as the optimal IO merging time.
- the calculation of the second mean value of the time spent processing each IO when merging IO tasks includes:
- u 2 is the second mean value of the time spent processing each IO when merging IO tasks
- x t is the merging time
- t is the total time spent processing merging IO tasks
- n is the merged IO task and the remaining unmerged IO The total number of tasks for the task.
- the calculation of the second mean value of the time spent processing each IO when merging IO tasks includes:
- the second average value of the time spent on processing each IO when merging the IO tasks is calculated.
- the above-mentioned calculation of the efficiency improvement value when merging IO tasks includes:
- ⁇ is the efficiency improvement value
- u 1 is the first average value of the time spent processing a single IO when executed separately in sequence
- u 2 is the second average value of the time spent processing each IO when merging IO tasks.
- the IO merging time is determined according to the first average value of the time spent processing a single IO when executed sequentially and individually, and further includes:
- the above-mentioned adjustment of the merging time of merging IO tasks includes:
- the above-mentioned adjustment of the merging time of merging IO tasks includes:
- x t is the merge time
- ⁇ is the efficiency improvement value
- the second stage includes the following steps:
- the third stage includes the following steps:
- Steps S32 and S33 of this stage are repeated until the host no longer sends an IO request.
- the IO merging time is optimized through heuristic learning, so that the optimal IO merging time can be adaptively determined according to the processed IO tasks, and the IO merging time is not too long or too short to affect the IO processing efficiency.
- an IO task processing device including a separate execution module, an optimization module, and a post-optimization processing module, wherein:
- the separate execution module is used to receive multiple IO tasks issued by the host and execute them individually in sequence, and count the first average value of the time spent processing a single IO when executing individually in sequence;
- the optimization module is used to continue to receive multiple IO tasks issued by the host and merge the execution of the IO tasks, and determine the best IO merge time according to the first average value of the time spent processing a single IO when the above-mentioned sequential execution is performed separately;
- the optimized post-processing module is used to continue to execute the remaining IO tasks issued by the host according to the above-mentioned optimal IO merging time.
- the independent execution module is also used to calculate the time-consuming variance of sequentially executing the IO tasks separately, and determine whether the time spent on processing different IO tasks is stable according to the above-mentioned variance.
- the optimization module is used to:
- the total time spent in statistically processing the merged IO tasks includes reading/writing the merged IO tasks and the remaining unmerged IO tasks;
- the efficiency improvement value is greater than 0, the above initialization merging time is taken as the optimal IO merging time.
- the optimization module calculates the second mean value of the time spent processing each IO when merging IO tasks, including: obtaining the combined IO tasks and the total number of tasks of the remaining unmerged IO tasks; according to the above-mentioned merging time, The total time spent in processing the merged IO tasks and the total number of tasks above are calculated as the second mean value of the time spent in processing each IO when the merged IO tasks are processed.
- the optimization module calculates the second mean value of the time spent processing each IO when merging IO tasks, including:
- u 2 is the second mean value of the time spent processing each IO when merging IO tasks
- x t is the merging time
- t is the total time spent processing merging IO tasks
- n is the merged IO task and the remaining unmerged IO The total number of tasks for the task.
- the optimization module calculates the efficiency improvement value when merging IO tasks, including:
- ⁇ is the efficiency improvement value
- u 1 is the first average value of the time spent processing a single IO when executed separately in sequence
- u 2 is the second average value of the time spent processing each IO when merging IO tasks.
- the optimization module determines the IO merging time according to the first average value of the time spent processing a single IO when executing individually in sequence, and further includes:
- the adjustment of the merging time of merging IO tasks in the optimization module includes: comparing the efficiency improvement value with 0, and adjusting the merging time of merging IO tasks according to the comparison result.
- the merging time of merging IO tasks is adjusted in the optimization module, including:
- x t is the merge time
- ⁇ is the efficiency improvement value
- Each module in the above-mentioned IO task processing device can be fully or partially realized by software, hardware and a combination thereof.
- the above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, and can also be stored in the memory of the computer device in the form of software, so that the processor can invoke and execute the corresponding operations of the above-mentioned modules.
- a computer device is provided.
- the computer device may be a terminal, and its internal structure may be as shown in FIG. 6 .
- the computer device includes a processor, a memory, a network interface, a display screen and an input device connected through a system bus. Wherein, the processor of the computer device is used to provide calculation and control capabilities.
- the memory of the computer device includes a non-volatile storage medium and an internal memory.
- the non-volatile storage medium stores an operating system and computer readable instructions.
- the internal memory provides an environment for the execution of the operating system and computer readable instructions in the non-volatile storage medium.
- the network interface of the computer device is used to communicate with an external terminal via a network connection.
- the display screen of the computer device may be a liquid crystal display screen or an electronic ink display screen
- the input device of the computer device may be a touch layer covered on the display screen, or a button, a trackball or a touch pad provided on the casing of the computer device , and can also be an external keyboard, touchpad, or mouse.
- FIG. 6 is only a block diagram of a part of the structure related to the solution of this application, and does not constitute a limitation on the computer equipment to which the solution of this application is applied.
- the specific computer equipment can be More or fewer components than shown in the figures may be included, or some components may be combined, or have a different arrangement of components.
- a computer device including a memory, one or more processors, and computer-readable instructions stored on the memory and operable on the processor, and the processor implements the above-mentioned The steps of the IO task processing method provided by any one of the embodiments.
- the application provides one or more non-transitory computer-readable storage media storing computer-readable instructions, which, when executed by one or more processors, cause one or more The processor executes the steps of the method for processing an IO task provided in any one of the foregoing embodiments. ;
- Nonvolatile memory can include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory.
- Volatile memory can include random access memory (RAM) or external cache memory.
- RAM random access memory
- RAM is available in many forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Chain Synchlink DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Software Systems (AREA)
- Human Computer Interaction (AREA)
- Debugging And Monitoring (AREA)
Abstract
本申请涉及一种IO任务处理方法、装置和计算机设备和存储介质。所述方法包括:S1,接收主机下发的多个IO任务并依次单独执行,统计依次单独执行时处理单个IO所耗费时间的第一均值;S2,继续接收主机下发的多个IO任务并合并IO任务执行,根据所述依次单独执行时处理单个IO所耗费时间的第一均值确定最佳IO合并时间;S3,根据所述最佳IO合并时间,继续执行主机下发的剩余IO任务。
Description
相关申请的交叉引用
本申请要求于2021年10月25日提交中国专利局,申请号为202111246169.1,申请名称为“IO任务处理方法、装置和计算机设备和存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本申请涉及存储技术领域,特别是涉及一种IO任务处理方法、装置、计算机设备和存储介质。
主机向磁盘读出或写入数据块时,会不断下发IO(IN/OUT)请求,最简单的处理方法就是依次单独执行这些IO请求,但这种方法处理效率较低。如果先根据读/写磁盘的位置信息,将读/写位置相邻的IO请求进行合并,然后再向磁盘进行读/写,则可以在一定程度上提高处理效率。
发明人意识到,目前,已存在一些关于IO合并的方法,但这些方法主要聚焦于如何合并IO,却忽略了IO合并的时间。需要说明的一点是,IO合并时间不是越长越好。因为开启IO合并后,主机需要等待IO合并完成后,才可以向磁盘进行读写。有时,过长的IO合并时间反而会降低IO处理效率。由此可见,IO合并时间的选取是一个急需解决的问题。
发明内容
一方面,本申请提供一种IO任务处理方法,上述方法包括:
S1,接收主机下发的多个IO任务并依次单独执行,统计依次单独执行时处理单个IO所耗费时间的第一均值;
S2,继续接收主机下发的多个IO任务并合并IO任务执行,根据上述依次单独执行时处理单个IO所耗费时间的第一均值确定最佳IO合并时间;及
S3,根据上述最佳IO合并时间,继续执行主机下发的剩余IO任务。
在其中一个实施例中,步骤S1还包括:
计算依次单独执行IO任务时的耗费时间方差;及
响应于根据上述方差确定处理不同IO任务所耗费的时间稳定执行步骤S2;或,响应于根据上述方差确定处理不同IO任务所耗费的时间不稳定,继续保持依次单独执行IO任务。
在其中一个实施例中,根据上述依次单独执行时处理单个IO所耗费时间的第一均值确定IO合并时间,包括:
获取合并IO任务的初始化合并时间;
统计处理合并IO任务时所耗费的总时间,上述处理合并IO任务包括对合并的IO任务及剩余未合并IO任务进行读/写处理;
计算合并IO任务时处理每个IO所耗费时间的第二均值;
根据上述依次单独执行时处理单个IO所耗费时间的第一均值以及上述合并IO任务时处理每个IO所耗费时间的第二均值,计算合并IO任务时的效率提升值;及
在效率提升值大于0时,将上述初始化合并时间作为最佳IO合并时间。
在其中一个实施例中,计算合并IO任务时处理每个IO所耗费时间的第二均值,包括:
获取合并的IO任务及剩余未合并IO任务的总任务数;及
根据上述合并时间、上述处理合并IO任务时所耗费的总时间以及上述总任务数,计算合并IO任务时处理每个IO所耗费时间的第二均值。
在其中一个实施例中,计算合并IO任务时处理每个IO所耗费时间的第二均值,包括:
其中u
2为合并IO任务时处理每个IO所耗费时间的第二均值,x
t为合并时间,t为处理合并IO任务时所耗费的总时间,n为合并的IO任务及剩余未合并IO任务的总任务数。
在其中一个实施例中,上述计算合并IO任务时的效率提升值,包括:
η为效率提升值,u1为依次单独执行时处理单个IO所耗费时间的第一均值,u2为合并IO任务时处理每个IO所耗费时间的第二均值。
在其中一个实施例中,根据上述依次单独执行时处理单个IO所耗费时间的第一均值确定IO合并时间,还包括:
多次调整合并IO任务的合并时间,并计算调整后的多个效率提升值,将最大效率提升值对应的合并时间作为最佳IO合并时间。
在其中一个实施例中,上述调整合并IO任务的合并时间,包括:
将上述效率提升值和0进行比较,根据比较结果调整合并IO任务的合并时间。
在其中一个实施例中,上述调整合并IO任务的合并时间,包括:
其中,x
t为合并时间,η为效率提升值。
另一方面,提供了一种IO任务处理装置,上述装置包括单独执行模块、优化模块、优化后处理模块,其中:
单独执行模块,用于接收主机下发的多个IO任务并依次单独执行,统计依次单独执行时处理单个IO所耗费时间的第一均值;
优化模块,用于继续接收主机下发的多个IO任务并合并IO任务执行,根据上述依次单独执行时处理单个IO所耗费时间的第一均值确定最佳IO合并时间;及
优化后处理模块,用于根据上述最佳IO合并时间,继续执行主机下发的剩余IO任务。
再一方面,提供了一种计算机设备,包括存储器、一个或多个处理器及存储在存储器上并可在处理器上运行的计算机可读指令,所述处理器执行所述计算机可读指令时实现上述任意一个实施例提供的IO任务处理方法的步骤。又一方面,提供了一个或多个存储有计算机可读指令的非易失性计算机可读存储介质,计算机可读指令被一个或多个处理器执行时实现上述任意一个实施例提供的IO任务处理方法的步骤。
本申请的一个或多个实施例的细节在下面的附图和描述中提出。本申请的其它特征和优点将从说明书、附图以及权利要求书变得明显。
图1为本申请根据一个或多个实施例提供的IO任务处理方法的流程示意图;
图2为本申请根据一个或多个实施例提供的单独执行阶段的流程示意图;
图3为本申请根据一个或多个实施例提供的优化阶段的流程示意图;
图4为本申请根据一个或多个实施例提供的优化后处理阶段的流程示意图;
图5为本申请根据一个或多个实施例提供的IO任务处理装置的结构框图;
图6为本申请根据一个或多个实施例提供的计算机设备的内部结构图。
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。
本申请在一个实施例中提供了一种IO任务处理方法,下面以该方法应用于计算机设备为例进行说明,如图1所示,该方法包括以下步骤:
S1,接收主机下发的多个IO任务并依次单独执行,统计依次单独执行时处理单个IO所耗费时间的第一均值;
S2,继续接收主机下发的多个IO任务并合并IO任务执行,根据上述依次单独执行时处理单个IO所耗费时间的第一均值确定最佳IO合并时间;
S3,根据上述最佳IO合并时间,继续执行主机下发的剩余IO任务。
本申请的方法主要包含三个阶段,第一个阶段不开启IO合并,分析处理单个IO的效率;第二阶段通过启发式学习的方法优化IO合并时间,第三阶段采用第二阶段得到的IO合并时间,继续处理主机下发的IO请求。
上述IO任务处理方法中,通过进行IO合并,可以有效提高主机的IO读写效率,从而节省系统资源。
在其中一个实施例中,步骤S1还包括:
计算依次单独执行IO任务时的耗费时间方差;
响应于根据上述方差确定处理不同IO任务所耗费的时间稳定,执行步骤S2;或,响应于根据上述方差确定处理不同IO任务所耗费的时间不稳定时,继续保持依次单独执行IO任务。
具体的,如图2所示,第一阶段,在不开启IO合并的情况下,接收主机下发的多个IO,并分别对IO进行处理。然后统计处理每个IO所耗费时间的均值u
1及方差σ
2。
通过方差来分析处理不同IO所耗费的时间是否稳定,若不稳定,则继续保持IO合并不开启;若方差稳定,则输出单个IO所耗费的时间均值μ1,并进入第二阶段。
在其中一个实施例中,根据上述依次单独执行时处理单个IO所耗费时间的第一均值确定IO合并时间,包括:
获取合并IO任务的初始化合并时间;
统计处理合并IO任务时所耗费的总时间,上述处理合并IO任务包括对合并的IO任 务及剩余未合并IO任务进行读/写处理;
计算合并IO任务时处理每个IO所耗费时间的第二均值;
根据上述依次单独执行时处理单个IO所耗费时间的第一均值以及上述合并IO任务时处理每个IO所耗费时间的第二均值,计算合并IO任务时的效率提升值;
在效率提升值大于0时,将上述初始化合并时间作为最佳IO合并时间。
其中,计算机设备响应于效率提升值大于0,将上述初始化合并时间作为最佳IO合并时间。
在其中一个实施例中,计算合并IO任务时处理每个IO所耗费时间的第二均值,包括:
其中u
2为合并IO任务时处理每个IO所耗费时间的第二均值,x
t为合并时间,t为处理合并IO任务时所耗费的总时间,n为合并的IO任务及剩余未合并IO任务的总任务数。
在其中一个实施例中,计算合并IO任务时处理每个IO所耗费时间的第二均值,包括:
获取合并的IO任务及剩余未合并IO任务的总任务数;
根据上述合并时间、上述处理合并IO任务时所耗费的总时间以及上述总任务数,计算合并IO任务时处理每个IO所耗费时间的第二均值。
在其中一个实施例中,上述计算合并IO任务时的效率提升值,包括:
η为效率提升值,u
1为依次单独执行时处理单个IO所耗费时间的第一均值,u
2为合并IO任务时处理每个IO所耗费时间的第二均值。
在其中一个实施例中,根据上述依次单独执行时处理单个IO所耗费时间的第一均值确定IO合并时间,还包括:
多次调整合并IO任务的合并时间,并计算调整后的多个效率提升值,将最大效率提升值对应的合并时间作为最佳IO合并时间。
在其中一个实施例中,上述调整合并IO任务的合并时间,包括:
将上述效率提升值和0进行比较,根据比较结果调整合并IO任务的合并时间。
在其中一个实施例中,上述调整合并IO任务的合并时间,包括:
其中,x
t为合并时间,η为效率提升值。
具体的,如图3所示,第二阶段,包含以下几个步骤:
S21.输入第一阶段所得均值u
1,初始化IO合并时间x
t=0.1s,初始化空集合S,初始化最大优化次数N=100,初始化当前迭代次数i=1;
S22.接收主机下发的多个IO(IO
1,IO
2,…,IO
n),开启IO合并,在IO合并时间x
t内,对IO进行合并;
S23.IO合并结束后,对合并的IO及剩余未合并IO进行读/写处理,并统计所耗费的总时间t;
S24.计算开启IO合并后,处理每个IO所耗费时间的均值:
S25.统计开启IO合并后,处理IO的效率提升:
S26.存档:将当前的IO合并时间x
t和对应的效率提升η存入集合S中;
S27.调整IO合并时间:
S28.调整当前迭代次数:i=i+1
S29.判断i是否大于最大优化次数N:
如果i≤N,则返回第2步,继续优化IO合并时间;
如果i>N,则从集合S中选出效率提升最大的η(记为η
best)及其对应的IO合并时间x
t;
S2A.如果η
best≤0,则令IO合并时间x
t=0,否则,保持不变;
S2B.输出优化后的IO合并时间x
t,并进入第三阶段。
如图4所示,第三阶段,包括以下几个步骤:
S31.设置IO合并时间为第二阶段输出的IO合并时间x_t;
S32.接收主机下发的多个IO请求,在时间x
t内对IO进行合并;
S33.IO合并时间结束后,对合并的IO及剩余未合并IO进行读/写处理;
S34.重复该阶段的步骤S32,S33,直到主机不再下发IO请求。
应该理解的是,虽然图1-4的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以以其它的顺序执行。而且,图1-4中的至少一部分步骤可以包括多个子步骤或者多个阶段,这些子步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些子步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或者其它步骤的子步骤或者阶段的至少一部分轮流或者交替地执行。
通过启发式学习的方式优化IO合并时间,从而能够根据所处理的IO任务自适应的确定最佳的IO合并时间,避免IO合并时间过长或过短而影响IO处理效率。
在一个实施例中,如图5所示,提供了一种IO任务处理装置,包括单独执行模块、优化模块、优化后处理模块,其中:
单独执行模块,用于接收主机下发的多个IO任务并依次单独执行,统计依次单独执行时处理单个IO所耗费时间的第一均值;
优化模块,用于继续接收主机下发的多个IO任务并合并IO任务执行,根据上述依次单独执行时处理单个IO所耗费时间的第一均值确定最佳IO合并时间;
优化后处理模块,用于根据上述最佳IO合并时间,继续执行主机下发的剩余IO任务。
在其中一个实施例中,单独执行模块还用于计算依次单独执行IO任务时的耗费时间方差,并根据上述方差确定处理不同IO任务所耗费的时间是否稳定。
在其中一个实施例中,优化模块用于:
获取合并IO任务的初始化合并时间;
统计处理合并IO任务时所耗费的总时间,上述处理合并IO任务包括对合并的IO任务及剩余未合并IO任务进行读/写处理;
计算合并IO任务时处理每个IO所耗费时间的第二均值;
根据上述依次单独执行时处理单个IO所耗费时间的第一均值以及上述合并IO任务时处理每个IO所耗费时间的第二均值,计算合并IO任务时的效率提升值;
若效率提升值大于0,则将上述初始化合并时间作为最佳IO合并时间。
在其中一个实施例中,优化模块中计算合并IO任务时处理每个IO所耗费时间的第二均值,包括:获取合并的IO任务及剩余未合并IO任务的总任务数;根据上述合并时间、上述处理合并IO任务时所耗费的总时间以及上述总任务数,计算合并IO任务时处理每个IO所耗费时间的第二均值。
在其中一个实施例中,优化模块中计算合并IO任务时处理每个IO所耗费时间的第二均值,包括:
其中u
2为合并IO任务时处理每个IO所耗费时间的第二均值,x
t为合并时间,t为处理合并IO任务时所耗费的总时间,n为合并的IO任务及剩余未合并IO任务的总任务数。
在其中一个实施例中,优化模块中计算合并IO任务时的效率提升值,包括:
η为效率提升值,u
1为依次单独执行时处理单个IO所耗费时间的第一均值,u
2为合并IO任务时处理每个IO所耗费时间的第二均值。
在其中一个实施例中,优化模块中根据上述依次单独执行时处理单个IO所耗费时间的第一均值确定IO合并时间,还包括:
多次调整合并IO任务的合并时间,并计算调整后的多个效率提升值,将最大效率提升值对应的合并时间作为最佳IO合并时间。
在其中一个实施例中,优化模块中调整合并IO任务的合并时间,包括:将上述效率提升值和0进行比较,根据比较结果调整合并IO任务的合并时间。
在其中一个实施例中,优化模块中调整合并IO任务的合并时间,包括:
其中,x
t为合并时间,η为效率提升值。
关于IO任务处理装置的具体限定可以参见上文中对于IO任务处理方法的限定,在此不再赘述。上述IO任务处理装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于计算机设备中的处理器中,也可以以软件形式存储于计算机设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。
在一个实施例中,提供了一种计算机设备,该计算机设备可以是终端,其内部结构图可以如图6所示。该计算机设备包括通过系统总线连接的处理器、存储器、网络接口、显示屏和输入装置。其中,该计算机设备的处理器用于提供计算和控制能力。该计算机设备的存储器包括非易失性存储介质、内存储器。该非易失性存储介质存储有操作系统和计算机可读指令。该内存储器为非易失性存储介质中的操作系统和计算机可读指令的 运行提供环境。该计算机设备的网络接口用于与外部的终端通过网络连接通信。该计算机可读指令被处理器执行时以实现一种IO任务处理方法。该计算机设备的显示屏可以是液晶显示屏或者电子墨水显示屏,该计算机设备的输入装置可以是显示屏上覆盖的触摸层,也可以是计算机设备外壳上设置的按键、轨迹球或触控板,还可以是外接的键盘、触控板或鼠标等。
本领域技术人员可以理解,图6中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备的限定,具体的计算机设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。
在一个实施例中,提供了一种计算机设备,包括存储器、一个或多个处理器及存储在存储器上并可在处理器上运行的计算机可读指令,处理器执行计算机可读指令时实现上述任意一个实施例提供的IO任务处理方法的步骤。
;在一个实施例中,本申请提供一个或多个存储有计算机可读指令的非易失性计算机可读存储介质,计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器执行上述任意一个实施例提供的IO任务处理方法的步骤。;
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机可读指令来指令相关的硬件来完成,所述的计算机可读指令可存储于一非易失性计算机可读取存储介质中,该计算机可读指令在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和/或易失性存储器。非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM)或者外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDRSDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink)DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)等。
以上实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。
以上所述实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对发明专利范围的限制。应当指出的是,对于本领域的普通技术人员来 说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请专利的保护范围应以所附权利要求为准。
Claims (12)
- 一种IO任务处理方法,其特征在于,包括:S1,接收主机下发的多个IO任务并依次单独执行,统计依次单独执行时处理单个IO所耗费时间的第一均值;S2,继续接收主机下发的多个IO任务并合并IO任务执行,根据所述依次单独执行时处理单个IO所耗费时间的第一均值确定最佳IO合并时间;及S3,根据所述最佳IO合并时间,继续执行主机下发的剩余IO任务。
- 根据权利要求1所述的IO任务处理方法,其特征在于,所述步骤S1还包括:计算依次单独执行IO任务时的耗费时间方差;及响应于根据所述方差确定处理不同IO任务所耗费的时间稳定,执行步骤S2;或,响应于所述方差确定处理不同IO任务所耗费的时间不稳定,继续保持依次单独执行IO任务。
- 根据权利要求1所述的IO任务处理方法,其特征在于,所述根据所述依次单独执行时处理单个IO所耗费时间的第一均值确定最佳IO合并时间,包括:获取合并IO任务的初始化合并时间;统计处理合并IO任务时所耗费的总时间,所述处理合并IO任务包括对合并的IO任务及剩余未合并IO任务进行读/写处理;计算合并IO任务时处理每个IO所耗费时间的第二均值;根据所述依次单独执行时处理单个IO所耗费时间的第一均值以及所述合并IO任务时处理每个IO所耗费时间的第二均值,计算合并IO任务时的效率提升值;及在效率提升值大于0时,将所述初始化合并时间作为最佳IO合并时间。
- 根据权利要求3所述的IO任务处理方法,其特征在于,计算合并IO任务时处理每个IO所耗费时间的第二均值,包括:获取合并的IO任务及剩余未合并IO任务的总任务数;及根据所述合并时间、所述处理合并IO任务时所耗费的总时间以及所述总任务数,计算合并IO任务时处理每个IO所耗费时间的第二均值。
- 根据权利要求3所述的IO任务处理方法,其特征在于,所述根据所述依次单独执行时处理单个IO所耗费时间的第一均值确定最佳IO合并时间,还包括:多次调整合并IO任务的合并时间,并计算调整后的多个效率提升值,将最大效率提升值对应的合并时间作为最佳IO合并时间。
- 根据权利要求7所述的IO任务处理方法,其特征在于,所述调整合并IO任务的合并时间,包括:将所述效率提升值和0进行比较,根据比较结果调整合并IO任务的合并时间。
- 一种IO任务处理装置,其特征在于,所述装置包括单独执行模块、优化模块、优化后处理模块,其中:单独执行模块,用于接收主机下发的多个IO任务并依次单独执行,统计依次单独执行时处理单个IO所耗费时间的第一均值;优化模块,用于继续接收主机下发的多个IO任务并合并IO任务执行,根据所述依次单独执行时处理单个IO所耗费时间的第一均值确定最佳IO合并时间;及优化后处理模块,用于根据所述最佳IO合并时间,继续执行主机下发的剩余IO任务。
- 一种计算机设备,包括存储器、一个或多个处理器及存储在存储器上并可在处理器上运行的计算机可读指令,其特征在于,所述处理器执行所述计算机可读指令时实现 权利要求1至9中任一项所述方法的步骤。
- 一个或多个存储有计算机可读指令的非易失性计算机可读存储介质,计算机可读指令被一个或多个处理器执行时实现权利要求1至9中任一项所述的方法的步骤。
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
US18/567,253 US12124389B2 (en) | 2021-10-25 | 2022-04-26 | IO task processing method and apparatus, and computer device and storage medium |
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111246169.1 | 2021-10-25 | ||
CN202111246169.1A CN113687796B (zh) | 2021-10-25 | 2021-10-25 | Io任务处理方法、装置和计算机设备和存储介质 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2023071101A1 true WO2023071101A1 (zh) | 2023-05-04 |
Family
ID=78587982
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2022/089352 WO2023071101A1 (zh) | 2021-10-25 | 2022-04-26 | Io任务处理方法、装置和计算机设备和存储介质 |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN113687796B (zh) |
WO (1) | WO2023071101A1 (zh) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113687796B (zh) * | 2021-10-25 | 2022-02-18 | 苏州浪潮智能科技有限公司 | Io任务处理方法、装置和计算机设备和存储介质 |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20080155043A1 (en) * | 2006-12-22 | 2008-06-26 | International Business Machines Corporation | Message Hub Apparatus, Program Product, and Method |
CN108804035A (zh) * | 2018-05-22 | 2018-11-13 | 深圳忆联信息系统有限公司 | 降低io延时的方法、装置、计算机设备及存储介质 |
CN111694770A (zh) * | 2019-03-15 | 2020-09-22 | 杭州宏杉科技股份有限公司 | 一种处理io请求的方法及装置 |
CN113031873A (zh) * | 2021-03-26 | 2021-06-25 | 山东英信计算机技术有限公司 | 一种io请求处理方法、装置、设备及可读存储介质 |
CN113687796A (zh) * | 2021-10-25 | 2021-11-23 | 苏州浪潮智能科技有限公司 | Io任务处理方法、装置和计算机设备和存储介质 |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20180041415A1 (en) * | 2016-08-03 | 2018-02-08 | Qualcomm Incorporated | Mitigation of transmission control protocol throughput degradation in communication devices due to predictable radio impairment events |
CN106886368B (zh) * | 2016-12-30 | 2019-08-16 | 北京同有飞骥科技股份有限公司 | 一种块设备写io整形和多控制器同步系统及同步方法 |
CN109471594B (zh) * | 2018-10-09 | 2020-07-10 | 华中科技大学 | 一种mlc闪存读写方法 |
-
2021
- 2021-10-25 CN CN202111246169.1A patent/CN113687796B/zh active Active
-
2022
- 2022-04-26 WO PCT/CN2022/089352 patent/WO2023071101A1/zh active Application Filing
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20080155043A1 (en) * | 2006-12-22 | 2008-06-26 | International Business Machines Corporation | Message Hub Apparatus, Program Product, and Method |
CN108804035A (zh) * | 2018-05-22 | 2018-11-13 | 深圳忆联信息系统有限公司 | 降低io延时的方法、装置、计算机设备及存储介质 |
CN111694770A (zh) * | 2019-03-15 | 2020-09-22 | 杭州宏杉科技股份有限公司 | 一种处理io请求的方法及装置 |
CN113031873A (zh) * | 2021-03-26 | 2021-06-25 | 山东英信计算机技术有限公司 | 一种io请求处理方法、装置、设备及可读存储介质 |
CN113687796A (zh) * | 2021-10-25 | 2021-11-23 | 苏州浪潮智能科技有限公司 | Io任务处理方法、装置和计算机设备和存储介质 |
Non-Patent Citations (1)
Title |
---|
DU JIAN-CHENG, HUANG HAO, CHEN DAO-XU, XIE LI: "Optimum Degree of Parallelism-based Task Dependence Graph Scheduling Scheme", JOURNAL OF SOFTWARE, vol. 10, no. 10, 1 October 1999 (1999-10-01), pages 1038 - 1046, XP093060125 * |
Also Published As
Publication number | Publication date |
---|---|
CN113687796B (zh) | 2022-02-18 |
US20240264958A1 (en) | 2024-08-08 |
CN113687796A (zh) | 2021-11-23 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2020186783A1 (zh) | 数据导入方法、装置、计算机设备和存储介质 | |
WO2019041753A1 (zh) | 信息修改方法、装置、计算机设备及计算机可读存储介质 | |
US9058197B2 (en) | Method for sharing memory of virtual machine and computer system using the same | |
US20190340132A1 (en) | Flushing pages from solid-state storage device | |
US20210247987A1 (en) | Algorithm program loading method and related apparatus | |
KR20140050941A (ko) | 비휘발성 메모리 장치의 데이터 관리 방법 | |
CN111813799B (zh) | 数据库查询语句生成方法、装置、计算机设备和存储介质 | |
EP2763055A1 (en) | A telecommunication method and mobile telecommunication device for providing data to a mobile application | |
KR101577841B1 (ko) | 자바스크립트 그리드에서의 비동기식 멀티-레벨 실행 취소 지원 | |
US11199997B2 (en) | Storage device operations using a die translation table | |
WO2023071101A1 (zh) | Io任务处理方法、装置和计算机设备和存储介质 | |
CN112750027A (zh) | 批量业务处理方法、装置、计算机设备和存储介质 | |
JP6988231B2 (ja) | 情報処理装置、情報処理システム、情報処理方法及び情報処理プログラム | |
WO2021114757A1 (zh) | 计算图的优化方法、装置、计算机设备和存储介质 | |
JPWO2015087651A1 (ja) | メモリの使用可能期間を延ばすための装置、プログラム、記録媒体および方法 | |
CN105740073A (zh) | 一种动态控制操作系统进程数量的方法及装置 | |
CN114116620A (zh) | 一种建筑数据处理方法、装置、终端及存储介质 | |
US11443191B2 (en) | Computing device and parameter synchronization method implemented by computing device | |
CN111125809B (zh) | 建筑钢柱生成方法、装置、计算机设备和存储介质 | |
US12124389B2 (en) | IO task processing method and apparatus, and computer device and storage medium | |
US8296336B2 (en) | Techniques for efficient dataloads into partitioned tables using swap tables | |
CN113127117A (zh) | 基于Qt开发框架的界面分页显示方法、装置、系统及介质 | |
CN110851273A (zh) | 一种基于混合内存的程序处理方法和基于混合内存的设备 | |
CN117806709B (zh) | 系统级芯片的性能优化方法、装置、设备和存储介质 | |
CN113255301B (zh) | 网页文本编辑方法、装置、终端设备及存储介质 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 22885016 Country of ref document: EP Kind code of ref document: A1 |
|
WWE | Wipo information: entry into national phase |
Ref document number: 18567253 Country of ref document: US |
|
NENP | Non-entry into the national phase |
Ref country code: DE |