CN114443240A - Input and output request processing method and electronic device - Google Patents
Input and output request processing method and electronic device Download PDFInfo
- Publication number
- CN114443240A CN114443240A CN202110983851.2A CN202110983851A CN114443240A CN 114443240 A CN114443240 A CN 114443240A CN 202110983851 A CN202110983851 A CN 202110983851A CN 114443240 A CN114443240 A CN 114443240A
- Authority
- CN
- China
- Prior art keywords
- priority
- electronic device
- requests
- services
- processing
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; 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/48—Program initiating; Program switching, e.g. by interrupt
- G06F9/4806—Task transfer initiation or dispatching
- G06F9/4843—Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
- G06F9/4881—Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2209/00—Indexing scheme relating to G06F9/00
- G06F2209/48—Indexing scheme relating to G06F9/48
- G06F2209/484—Precedence
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Telephone Function (AREA)
Abstract
Description
技术领域technical field
本申请涉及终端领域,尤其涉及输入输出请求处理方法和电子设备。The present application relates to the field of terminals, and in particular, to a method and electronic device for processing input and output requests.
背景技术Background technique
在运行多个应用程序的场景下,手机、平板电脑等电子设备的读写调度模块可接收到上述多个应用程序下发的多个读操作请求或写操作请求,即输入输出请求(简称IO请求)。In the scenario of running multiple application programs, the read-write scheduling module of electronic devices such as mobile phones and tablet computers can receive multiple read operation requests or write operation requests issued by the above-mentioned multiple application programs, that is, input and output requests (referred to as IO for short). ask).
现有的基于优先级的IO请求调度方法保障了底层设备优先响应前台应用下发的IO请求的需求,一定程度上提升了底层设备响应前台应用的IO请求的效率。但是,由于不同类型的读写操作所附带的其他操作的耗时影响,例如加密、解密、压缩、解压缩、数据校验等操作,高优先级的IO请求的响应时间仍然高于低优先级的IO请求。The existing priority-based IO request scheduling method ensures that the underlying device preferentially responds to the IO request issued by the foreground application, and to a certain extent improves the efficiency of the underlying device responding to the IO request of the foreground application. However, due to the time-consuming effects of other operations attached to different types of read and write operations, such as encryption, decryption, compression, decompression, data verification, etc., the response time of high-priority IO requests is still higher than that of low-priority IO requests IO request.
这也就是说,单纯的基于优先级的IO请求调度方法并不能保障高优先级的IO请求一定具有较低的平均响应时间。即,在优先处理前台应用程序下发的高优先级的IO请求的情况下,后台运行的应用程序对IO资源的占用仍然对前台应用程序有较大影响。That is to say, the pure priority-based IO request scheduling method cannot guarantee that high-priority IO requests must have a lower average response time. That is, in the case where the high-priority IO request issued by the foreground application is preferentially processed, the occupation of IO resources by the application running in the background still has a great influence on the foreground application.
发明内容SUMMARY OF THE INVENTION
本申请提供了一种输入输出请求处理方法和电子设备。实施该输入输出IO请求处理方法的电子设备可以实时地检测的电子设备处理不同优先级的IO业务处理时间。当高优先级的IO业务的处理时间长于低优先级的IO业务的处理时间时,电子设备可以增加高优先级IO业务对IO资源的占有率,从而提升高优先级IO业务的处理效率,避免堵塞。The present application provides an input and output request processing method and electronic device. The electronic device implementing the input/output IO request processing method can detect in real time that the electronic device processes the IO service processing time of different priorities. When the processing time of high-priority IO services is longer than the processing time of low-priority IO services, the electronic device can increase the occupancy rate of high-priority IO services to IO resources, thereby improving the processing efficiency of high-priority IO services and avoiding blocked.
第一方面,本申请实施例提供了一种输入输出IO处理方法,该方法应用于电子设备,该方法包括:第一时间,从多个队列中取出多个IO业务;多个队列中,一个队列用于存储一个或多个相同IO处理优先级的IO业务,不同队列存储的IO业务的IO处理优先级不同;按IO处理优先级对取出的多个IO业务进行IO处理;确定IO处理中多个IO业务的处理时延,一个IO业务的处理时延用于指示一个IO业务从检测到一个IO业务的到来到应用程序接收到一个IO业务的IO处理结果的耗时;第二时间,从多个队列中取出多个IO业务;第二时间在第一时间之后;如果高IO处理优先级的IO业务的处理时延长于低IO处理优先级的IO业务的处理时延,则第二时间取出的多个IO业务中高优先级IO业务的占比高于第一时间取出的多个IO业务中高优先级的占比。In a first aspect, an embodiment of the present application provides an input and output IO processing method, the method is applied to an electronic device, and the method includes: at the first time, taking out multiple IO services from multiple queues; The queue is used to store one or more IO services with the same IO processing priority. The IO processing priorities of IO services stored in different queues are different; IO processing is performed on multiple IO services retrieved according to the IO processing priority; The processing delay of multiple IO services, the processing delay of one IO service is used to indicate the time taken by an IO service from detecting the arrival of an IO service to the application receiving the IO processing result of an IO service; the second time, Take out multiple IO services from multiple queues; the second time is after the first time; if the processing time of IO services with high IO processing priority is longer than the processing delay of IO services with low IO processing priority, the second time The proportion of high-priority IO services among the multiple IO services retrieved at the first time is higher than the proportion of high-priority IO services among the multiple IO services retrieved at the first time.
实施第一方面提供的方法,电子设备可以实时地检测的电子设备处理不同优先级的IO业务处理时间。当高优先级的IO业务的处理时间长于低优先级的IO业务的处理时间时,电子设备可以增加高优先级IO业务对IO资源的占有率,使得在相同时间内该电子设备可以处理更多高优先级的IO请求,从而提升高优先级IO业务的处理效率,响应时间过长影响用户体验。By implementing the method provided by the first aspect, the electronic device can detect in real time the processing time of the electronic device processing IO services of different priorities. When the processing time of the high-priority IO service is longer than the processing time of the low-priority IO service, the electronic device can increase the occupancy rate of the IO resource by the high-priority IO service, so that the electronic device can process more IO resources in the same time. High-priority IO requests, thereby improving the processing efficiency of high-priority IO services, and the long response time affects user experience.
结合第一方面提供的实施例,在一些实施例中,在第二时间,从多个队列中取出多个IO业务之后,该方法还包括:将低IO处理优先级的IO业务的处理结果滞留第一时长后,返回给发起低IO处理优先级的IO业务的应用程序。With reference to the embodiments provided in the first aspect, in some embodiments, after the multiple IO services are taken out from the multiple queues at the second time, the method further includes: holding the processing results of the IO services with low IO processing priority After the first time period, it returns to the application that initiates the IO service with low IO processing priority.
实施上述实施例提供的方法,电子设备还可以通过限制低优先级IO业务的返回速率,降低后台应用等时延要求低的应用程序的活跃度,使得电子设备能够更快的处理高优先级的IO业务。By implementing the method provided by the above embodiment, the electronic device can also reduce the activity of applications with low latency requirements such as background applications by limiting the return rate of low-priority IO services, so that the electronic device can process high-priority services faster. IO business.
结合第一方面提供的实施例,在一些实施例中,将低优先级的IO请求的处理结果滞留第一时长后,返回给发起低优先级的IO请求的应用程序,具体包括:确定电子设备的中央处理器CPU的当前负载;如果当前负载高于第一阈值,则将低优先级的IO请求的处理结果滞留第一时长后,返回给发起低优先级的IO请求的应用程序,第一阈值是预设的。With reference to the embodiments provided in the first aspect, in some embodiments, after the processing result of the low-priority IO request is retained for a first time period, it is returned to the application that initiated the low-priority IO request, specifically including: determining the electronic device The current load of the central processing unit CPU; if the current load is higher than the first threshold, the processing result of the low-priority IO request will be held for the first time, and then returned to the application that initiated the low-priority IO request. The threshold is preset.
实施上述实施例提供的方法,电子设备可以通过CPU的当前负载,判断是否需要限制优先级IO业务的返回速率。当CPU的当前负载过高时,即便高优先级的IO业务所占有的IO的IO资源足够,也可因为CPU资源不够导致不能得到及时的处理。因此,此时,电子设备可以限制优先级IO业务的返回速率,降低后台应用等时延要求低的应用程序的活跃度,从而保证高优先级的IO业务拥有足够的CPU资源。By implementing the method provided by the above embodiment, the electronic device can judge whether it is necessary to limit the return rate of the priority IO service according to the current load of the CPU. When the current load of the CPU is too high, even if the IO resources occupied by the high-priority IO services are sufficient, they may not be processed in time due to insufficient CPU resources. Therefore, at this time, the electronic device can limit the return rate of priority IO services and reduce the activity of applications with low latency requirements such as background applications, thereby ensuring that high-priority IO services have sufficient CPU resources.
结合第一方面提供的实施例,在一些实施例中,第一时间,从多个队列中取出多个IO业务,具体包括:第一时间,按第一比值从多个队列中取出多个IO业务;第二时间,从多个队列中取出多个IO业务,具体包括:第二时间,按第二比值从多个队列中取出多个IO业务。With reference to the embodiments provided in the first aspect, in some embodiments, taking out multiple IO services from multiple queues at a first time, specifically including: taking out multiple IO services from multiple queues at a first ratio at a first time services; at the second time, taking out multiple IO services from multiple queues, specifically including: at the second time, taking out multiple IO services from multiple queues according to a second ratio.
实施上述实施例提供的方法,电子设备可以通过预设的比例取获取不同数量的IO业务,且在一次获取的不同数量的IO业务中,不同优先级的IO业务的数量不同。这样,当上述比例调整是,电子设备可相应地获取调整一次获取不同优先级的IO业务的数量。By implementing the method provided by the above embodiment, the electronic device can obtain different numbers of IO services by taking a preset ratio, and among the different numbers of IO services obtained at one time, the number of IO services with different priorities is different. In this way, when the above ratio is adjusted, the electronic device can accordingly obtain and adjust the quantity of IO services with different priorities obtained at one time.
结合第一方面提供的实施例,在一些实施例中,第一比值的比例项的数量等于第二比值的比例项的数量。With reference to the embodiments provided by the first aspect, in some embodiments, the number of proportional items of the first ratio is equal to the number of proportional items of the second ratio.
结合第一方面提供的实施例,在一些实施例中,第一比值的第一比例项的数值低于第二比值的第一比例项的数值,第一比例项用于指示获取高IO处理优先级的IO业务的数量。With reference to the embodiments provided in the first aspect, in some embodiments, the value of the first proportional item of the first ratio is lower than the value of the first proportional item of the second ratio, and the first proportional item is used to indicate that obtaining high IO processing priority The number of level IO services.
实施上述实施例提供的方法,相比于按照第一比值获取不同优先级的IO业务,当电子设备按照第二比值获取不同优先级的IO业务时,电子设备可以获取到更多的高优先级的IO业务。By implementing the method provided by the above embodiment, compared with obtaining IO services with different priorities according to the first ratio, when the electronic device obtains IO services with different priorities according to the second ratio, the electronic device can obtain more high-priority services. IO business.
结合第一方面提供的实施例,在一些实施例中,按第一比值从多个队列中取出多个IO业务,具体包括:取出的多个IO业务的数量等于或大于第一比值的各比例项的数值之和,且取出的多个IO业务中不同IO处理优先级的IO业务的数量的比值与第一比值一致;或,取出的多个IO业务的数量小于第一比值的各比例项的数值之和。With reference to the embodiments provided in the first aspect, in some embodiments, taking out multiple IO services from multiple queues according to a first ratio specifically includes: the number of the taken out multiple IO services is equal to or greater than each ratio of the first ratio The sum of the values of the items, and the ratio of the number of IO services with different IO processing priorities among the multiple IO services taken out is consistent with the first ratio; or, the number of multiple IO services taken out is less than the first ratio. the sum of the values.
实施上述实施例提供的方法,电子设备依次获取的不同优先级的IO业务的数量,可以与第一比值中各比例项数值相等;也可以大于该第一比值中各比例项数值,但与该第一比值中各比例项数值成倍数关系;当某一优先级的IO业务的数量不足该第一比值中对应比例项指示的数量时,电子设备获取的该优先级的IO业务的数量也可小于该第一比值中对应比例项指示的数量。Implementing the method provided by the above embodiment, the number of IO services of different priorities acquired by the electronic device in turn may be equal to the value of each proportional item in the first ratio; The value of each proportional item in the first ratio is in a multiple relationship; when the number of IO services of a certain priority is less than the number indicated by the corresponding proportional item in the first ratio, the number of IO services of the priority obtained by the electronic device may also be is less than the amount indicated by the corresponding proportional term in the first ratio.
结合第一方面提供的实施例,在一些实施例中,处理时延,具体包括:从检测到一个IO业务的到来到应用程序接收到一个IO业务的IO处理结果的耗时;或,从检测到多个一个IO业务的到来到应用程序接收到多个一个IO业务的IO处理结果的耗时的平均值,多个一个IO业务是与一个IO业务相同IO处理优先级的IO业务。With reference to the embodiments provided in the first aspect, in some embodiments, the processing delay specifically includes: the time taken from detecting the arrival of an IO service to when the application receives an IO processing result of an IO service; The average time taken for the application to receive the IO processing results of multiple one IO services after the arrival of multiple one IO services. Multiple one IO services are IO services with the same IO processing priority as one IO service.
实施上述实施例提供的方法,在判断高优先级IO业务的处理时延是否长于低优先级的IO业务的处理时延是,电子设备可以使用该高优先级IO业务的实际处理时延与该低优先级IO业务的实际处理时延相比较,也可以使用该高优先级IO业务所属优先级的全部IO业务的平均处理时延与该低优先级IO业务所属优先级的全部IO业务的平均处理时延相比较。Implementing the method provided by the above embodiment, when judging whether the processing delay of the high-priority IO service is longer than the processing delay of the low-priority IO service, the electronic device can use the actual processing delay of the high-priority IO service and this. Compared with the actual processing delay of low-priority IO services, the average processing delay of all IO services of the priority to which the high-priority IO service belongs and the average processing delay of all IO services of the priority of the low-priority IO service can also be used. Compare processing delays.
第二方面,本申请提供了一种电子设备,该电子设备包括一个或多个处理器和一个或多个存储器;其中,一个或多个存储器与一个或多个处理器耦合,一个或多个存储器用于存储计算机程序代码,计算机程序代码包括计算机指令,当一个或多个处理器执行计算机指令时,使得电子设备执行如第一方面以及第一方面中任一可能的实现方式描述的方法。In a second aspect, the present application provides an electronic device comprising one or more processors and one or more memories; wherein the one or more memories are coupled to the one or more processors, and the one or more memories The memory is used to store computer program code, and the computer program code includes computer instructions, which when executed by one or more processors, cause the electronic device to perform the method described in the first aspect and any possible implementation of the first aspect.
第三方面,本申请提供一种计算机可读存储介质,包括指令,当上述指令在电子设备上运行时,使得上述电子设备执行如第一方面以及第一方面中任一可能的实现方式描述的方法。In a third aspect, the present application provides a computer-readable storage medium, comprising instructions, when the above-mentioned instructions are executed on an electronic device, the above-mentioned electronic device is made to execute the first aspect and any possible implementation manner of the first aspect. method.
第四方面,本申请提供一种包含指令的计算机程序产品,当上述计算机程序产品在电子设备上运行时,使得上述电子设备执行如第一方面以及第一方面中任一可能的实现方式描述的方法。In a fourth aspect, the present application provides a computer program product containing instructions, when the computer program product is executed on an electronic device, the electronic device is made to execute the first aspect and any possible implementation manner of the first aspect. method.
可以理解地,上述第二方面提供的电子设备、第三方面提供的计算机存储介质、第四方面提供的计算机程序产品均用于执行本申请所提供的方法。因此,其所能达到的有益效果可参考对应方法中的有益效果,此处不再赘述。Understandably, the electronic device provided in the second aspect, the computer storage medium provided in the third aspect, and the computer program product provided in the fourth aspect are all used to execute the method provided in this application. Therefore, for the beneficial effects that can be achieved, reference may be made to the beneficial effects in the corresponding method, which will not be repeated here.
附图说明Description of drawings
图1是本申请实施例提供的一种电子设备的软件架构示意图;1 is a schematic diagram of a software architecture of an electronic device provided by an embodiment of the present application;
图2是本申请实施例提供的一种电子设备的硬件结构示意图;2 is a schematic diagram of a hardware structure of an electronic device provided by an embodiment of the present application;
图3A-图3B是本申请实施例提供的电子设备的软件架构示意图;3A-3B are schematic diagrams of a software architecture of an electronic device provided by an embodiment of the present application;
图4A-图4B是本申请实施例提供的一种电子设备按照调度策略处理IO请求的示意图;4A-4B are schematic diagrams of processing an IO request according to a scheduling policy by an electronic device provided by an embodiment of the present application;
图4C是本申请实施例提供的一种电子设备确定返回控制策略的流程图;4C is a flowchart of determining a return control strategy by an electronic device according to an embodiment of the present application;
图5A-图5C是本申请实施例提供的一组用户界面示意图;5A-5C are schematic diagrams of a group of user interfaces provided by an embodiment of the present application;
图6是本申请实施例提供的一种电子设备的处理流程图。FIG. 6 is a processing flowchart of an electronic device provided by an embodiment of the present application.
具体实施方式Detailed ways
本申请以下实施例中所使用的术语只是为了描述特定实施例的目的,而并非旨在作为对本申请的限制。The terms used in the following embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to be used as limitations of the present application.
手机、平板电脑等电子设备(后简称电子设备100)可同时运行多个应用程序。应用程序可发起IO请求。响应于该请求,电子设备100可执行与上述IO请求对应的读写操作。Electronic devices such as mobile phones and tablet computers (hereinafter referred to as the electronic device 100 ) can run multiple application programs at the same time. Applications can initiate IO requests. In response to the request, the electronic device 100 may perform read and write operations corresponding to the above-mentioned IO request.
图1示例性示出了电子设备100的软件架构。FIG. 1 exemplarily shows the software architecture of the electronic device 100 .
电子设备100的软件系统可以采用分层架构,事件驱动架构,微核架构,微服务架构,或云架构。本申请实施例以分层架构的Android系统为例,示例性说明电子设备100的软件结构。The software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture. The embodiments of the present application take an Android system with a layered architecture as an example to exemplarily describe the software structure of the electronic device 100 .
分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。一般的,Android的分层架构包括:应用层,框架层,内核层、安卓运行时(Android runtime)和系统库等等。在本申请实施例中,图1所示的电子设备100的软件架构包括:应用层、内核层设备层。其中,内核层包括文件系统(file system)、块(Block)。The layered architecture divides the software into several layers, and each layer has a clear role and division of labor. Layers communicate with each other through software interfaces. Generally, the layered architecture of Android includes: an application layer, a framework layer, a kernel layer, an Android runtime (Android runtime), a system library, and the like. In this embodiment of the present application, the software architecture of the electronic device 100 shown in FIG. 1 includes: an application layer and a kernel layer device layer. The kernel layer includes a file system and a block.
应用层和内核层之下为设备层,即响应各个IO请求的硬件器件,包括各类存储设备,例如多媒体卡(Multi media card,MMC)/嵌入式多媒体卡(Embedded multi mediacard,eMMC)、SCSI(Small Computer System Interface)硬盘\通用闪存存储(UniversalFlash Storage,UFS)等等。Below the application layer and the kernel layer is the device layer, that is, the hardware devices that respond to each IO request, including various storage devices, such as Multi media card (MMC)/Embedded Multi Media Card (eMMC), SCSI (Small Computer System Interface) hard disk \ Universal Flash Storage (Universal Flash Storage, UFS) and so on.
应用层可安装有多个应用程序。以应用程序1(APP1)为例,响应于用户操作,应用程序1可发起一个或多个IO请求。一个IO请求指示一个IO操作。上述IO请求包括写请求(write)、读请求(read)、同步请求(fsync)、写回(writeback)请求、强制缓冲区清除请求(flush)等等。例如播放视频的过程中,执行上述播放视频的功能的应用程序可发起一个读(read)请求,响应于上述请求,上述应用程序可以读取存储中存储的视频数据,从而播放视频。The application layer can have multiple applications installed. Taking application 1 (APP1) as an example, in response to a user operation, application 1 may initiate one or more IO requests. An IO request indicates an IO operation. The above IO requests include a write request (write), a read request (read), a synchronization request (fsync), a writeback (writeback) request, a forced buffer clearing request (flush), and the like. For example, in the process of playing a video, an application program performing the function of playing the video may initiate a read request, and in response to the request, the application program may read the video data stored in the storage, thereby playing the video.
被发起的IO请求可经过文件系统,达到块(Block)中的读写调度层(IO schedulerlayer)。然后,读写调度层可根据预设的调度规则对该层中处于等待状态的IO请求进行排序,确定处理各个IO请求的优先级。然后,电子设备100的存储设备可根据上述确定的处理优先级,依次响应上述IO请求,执行上述IO请求指示的输入输出操作。块(Block)还包括通用块层。The initiated IO request can pass through the file system to reach the IO scheduler layer in the block. Then, the read-write scheduling layer may sort the IO requests in the waiting state in the layer according to preset scheduling rules, and determine the priority of processing each IO request. Then, the storage device of the electronic device 100 may sequentially respond to the IO request according to the processing priority determined above, and perform the input and output operations indicated by the IO request. Blocks also include a generic block layer.
读写调度层包括:采用多队列(Multi-queue,MQ)框架的读写调度层和采用单队列(Single-queue,SQ)框架的读写调度层。在本申请实施例中,读写调度层可以是MQ框架下的读写调度层。一般的,读写调度层可采用绝对公平(Completely Fair Queueing)调度算法执行IO请求的调度。此外,调度算法还包括读优先(ROW)算法等等。The read-write scheduling layer includes: a read-write scheduling layer using a multi-queue (Multi-queue, MQ) framework and a read-write scheduling layer using a single-queue (Single-queue, SQ) framework. In this embodiment of the present application, the read-write scheduling layer may be a read-write scheduling layer under the MQ framework. Generally, the read-write scheduling layer can use the absolutely fair (Completely Fair Queueing) scheduling algorithm to perform IO request scheduling. In addition, the scheduling algorithm also includes a read first (ROW) algorithm and so on.
为了提升电子设备100响应用户正在操作的应用程序的效率,提升用户使用体验,电子设备可标记不同类型的应用程序下发的读写请求的优先级。例如,电子设备可以标记用户正在操作的应用程序下发的读写请求为高优先级的读写请求,处于后台运行状态的应用程序下发的读写请求为低优先级的请求。上述用户正在操作的应用程序可简称前台应用;上述后台运行状态的应用程序可简称后台应用。In order to improve the efficiency of the electronic device 100 in responding to the application program being operated by the user and improve the user experience, the electronic device can mark the priorities of read and write requests issued by different types of application programs. For example, the electronic device can mark the read and write requests issued by the application that the user is operating as high-priority read and write requests, and the read and write requests issued by the application running in the background as low-priority requests. The application program that the user is operating may be referred to as a foreground application; the application program in the background running state may be referred to as a background application.
然后,读写调度层可以根据读写请求的优先级,确定底层设备响应各应用程序下发的读写请求的先后顺序。Then, the read and write scheduling layer can determine the order in which the underlying device responds to the read and write requests issued by each application program according to the priority of the read and write requests.
上述基于优先级的IO请求调度方法保障了底层设备优先响应前台应用下发的IO请求的需求,一定程度上提升了底层设备响应前台应用的IO请求的效率。但是,由于不同类型的读写操作所附带的辅助操作的耗时影响,例如加密、解密、压缩、解压缩、数据校验等操作,高优先级的IO请求的响应时间可能仍然高于低优先级的IO请求。The above priority-based IO request scheduling method ensures that the underlying device preferentially responds to the IO request issued by the foreground application, and to a certain extent improves the efficiency of the underlying device responding to the IO request of the foreground application. However, due to the time-consuming impact of auxiliary operations attached to different types of read and write operations, such as encryption, decryption, compression, decompression, data verification, etc., the response time of high-priority IO requests may still be higher than that of low-priority IO requests. level IO request.
如图1所示,文件系统包括:虚拟文件系统(Virtual File Systems,VFS)、第四代扩展文件系统(Fourth extended File System,ext4)、Flash友好文件系统(Flash-Friendly File System,F2FS)以及可扩展只读文件系统(Extendable Read-Only FileSystem,EROFS)等。As shown in FIG. 1, the file system includes: Virtual File System (VFS), Fourth Extended File System (ext4), Flash-Friendly File System (F2FS) and Extendable Read-Only File System (EROFS), etc.
在执行写入(或写出)数据的操作时,不同类型的文件系统会同时对被写入(或写出)的数据执行辅助操作,以提升写入(或写出)操作的准确定和安全性。上述辅助操作例如前述介绍的加密、解密、压缩、解压缩、数据校验等操作。When performing the operation of writing (or writing out) data, different types of file systems will perform auxiliary operations on the data being written (or written out) at the same time, so as to improve the accuracy of the writing (or writing out) operation. safety. The above-mentioned auxiliary operations are, for example, operations such as encryption, decryption, compression, decompression, and data verification described above.
例如,当通过F2FS向存储器写入(或写出)数据时,电子设备100需要对被写入(或写出)的数据进行加密(或解密)操作。这时,加密、解密等辅助操增加了电子设备100处理IO请求的耗时。因此,当高优先级的IO请求涉及加密、解密、压缩等多个辅助操作时,该高优先级的IO请求的响应时间可能比低优先级的IO请求的响应时间更长。For example, when data is written (or written) to the memory through F2FS, the electronic device 100 needs to perform an encryption (or decryption) operation on the written (or written) data. At this time, auxiliary operations such as encryption and decryption increase the time required for the electronic device 100 to process the IO request. Therefore, when a high-priority IO request involves multiple auxiliary operations such as encryption, decryption, and compression, the response time of the high-priority IO request may be longer than that of a low-priority IO request.
因此,对于高优先级的IO请求而言,其平均响应时间可能高于低优先级的IO请求。这也就是说,单纯的基于优先级的IO请求调度方法并不能保障高优先级的IO请求一定具有较低的响应时间,进而导致用户使用体验。Therefore, for high-priority IO requests, the average response time may be higher than for low-priority IO requests. That is to say, the pure priority-based IO request scheduling method cannot guarantee that high-priority IO requests must have a lower response time, which will lead to user experience.
为了进一步确保前台应用获得足够的IO资源,降低高优先级的读写请求的平均响应时间,本申请实施例提供了一种输入输出请求处理方法。该方法可应用于手机、平板电脑等具备存储能力的且需要进行频繁的读写操作的电子设备中。在后续实施例的介绍中,上述手机、平板电脑等电子设备简称为电子设备100。In order to further ensure that the foreground application obtains sufficient IO resources and reduce the average response time of high-priority read and write requests, an embodiment of the present application provides a method for processing input and output requests. The method can be applied to electronic devices such as mobile phones and tablet computers that have storage capabilities and need to perform frequent read and write operations. In the introduction of the following embodiments, the above-mentioned electronic devices such as mobile phones and tablet computers are simply referred to as electronic devices 100 .
不限于手机、平板电脑,电子设备100还可以是桌面型计算机、膝上型计算机、手持计算机、笔记本电脑、超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本,以及蜂窝电话、个人数字助理(personal digital assistant,PDA)、增强现实(augmented reality,AR)设备、虚拟现实(virtual reality,VR)设备、人工智能(artificial intelligence,AI)设备、可穿戴式设备、车载设备、智能家居设备和/或智慧城市设备,本申请实施例对该电子设备的具体类型不作特殊限制。Not limited to cell phones, tablet computers, the electronic device 100 may also be a desktop computer, a laptop computer, a handheld computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, and a cellular phone, personal digital Assistant (personal digital assistant, PDA), augmented reality (augmented reality, AR) devices, virtual reality (virtual reality, VR) devices, artificial intelligence (artificial intelligence, AI) devices, wearable devices, in-vehicle devices, smart home devices and/or smart city equipment, the embodiments of the present application do not specifically limit the specific type of the electronic equipment.
实施本申请实施例提供的输入输出请求处理方法,电子设备100可实时地检测不同优先级的IO请求的平均响应时间。当高优先级的IO请求的平均响应时间高于低优先级的IO请求的平均响应时间时,电子设备100可提升高优先级组的IO调配比例,降低低优先级组的IO调配比例。By implementing the input and output request processing method provided by the embodiment of the present application, the electronic device 100 can detect the average response time of IO requests of different priorities in real time. When the average response time of high-priority IO requests is higher than the average response time of low-priority IO requests, the electronic device 100 may increase the IO allocation ratio of the high-priority group and decrease the IO allocation ratio of the low-priority group.
这样,在相同时间内,电子设备100可处理更多的高优先级的IO请求,从而减少等待的高优先级的IO请求的数量,确保越高优先级的IO请求的平均响应时间低于低优先级的IO请求的平均响应时间,为前台应用提供更多的IO资源,避免堵塞,提升用户使用体验。In this way, in the same time, the electronic device 100 can process more high-priority IO requests, thereby reducing the number of waiting high-priority IO requests, and ensuring that the average response time of higher-priority IO requests is lower than that of low-priority IO requests. The average response time of priority IO requests provides more IO resources for foreground applications to avoid congestion and improve user experience.
首先,图2示例性示出了电子设备100的硬件结构示意图。First, FIG. 2 exemplarily shows a schematic diagram of the hardware structure of the electronic device 100 .
电子设备100可以包括处理器110,外部存储器接口120,内部存储器121,通用串行总线(universal serial bus,USB)接口130,充电管理模块140,电源管理模块141,电池142,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180,按键190,马达191,指示器192,摄像头193,显示屏194,以及用户标识模块(subscriber identification module,SIM)卡接口195等。其中传感器模块180可以包括压力传感器180A,陀螺仪传感器180B,气压传感器180C,磁传感器180D,加速度传感器180E,距离传感器180F,接近光传感器180G,指纹传感器180H,温度传感器180J,触摸传感器180K,环境光传感器180L,骨传导传感器180M等。The electronic device 100 may include a
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processingunit,GPU),图像信号处理器(image signal processor,ISP),控制器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。The
控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。The controller can generate an operation control signal according to the instruction operation code and timing signal, and complete the control of fetching and executing instructions.
处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。A memory may also be provided in the
在一些实施例中,处理器110可以包括一个或多个接口。接口可以包括集成电路(inter-integrated circuit,I2C)接口,集成电路内置音频(inter-integrated circuitsound,I2S)接口,脉冲编码调制(pulse code modulation,PCM)接口,通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口,移动产业处理器接口(mobile industry processor interface,MIPI),通用输入输出(general-purposeinput/output,GPIO)接口,用户标识模块(subscriber identity module,SIM)接口,和/或通用串行总线(universal serial bus,USB)接口等。In some embodiments, the
I2C接口是一种双向同步串行总线,包括一根串行数据线(serial data line,SDA)和一根串行时钟线(derail clock line,SCL)。在一些实施例中,处理器110可以包含多组I2C总线。处理器110可以通过不同的I2C总线接口分别耦合触摸传感器180K,充电器,闪光灯,摄像头193等。例如:处理器110可以通过I2C接口耦合触摸传感器180K,使处理器110与触摸传感器180K通过I2C总线接口通信,实现电子设备100的触摸功能。The I2C interface is a bidirectional synchronous serial bus that includes a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the
I2S接口可以用于音频通信。在一些实施例中,处理器110可以包含多组I2S总线。处理器110可以通过I2S总线与音频模块170耦合,实现处理器110与音频模块170之间的通信。在一些实施例中,音频模块170可以通过I2S接口向无线通信模块160传递音频信号,实现通过蓝牙耳机接听电话的功能。The I2S interface can be used for audio communication. In some embodiments, the
PCM接口也可以用于音频通信,将模拟信号抽样,量化和编码。在一些实施例中,音频模块170与无线通信模块160可以通过PCM总线接口耦合。在一些实施例中,音频模块170也可以通过PCM接口向无线通信模块160传递音频信号,实现通过蓝牙耳机接听电话的功能。所述I2S接口和所述PCM接口都可以用于音频通信。The PCM interface can also be used for audio communications, sampling, quantizing and encoding analog signals. In some embodiments, the
UART接口是一种通用串行数据总线,用于异步通信。该总线可以为双向通信总线。它将要传输的数据在串行通信与并行通信之间转换。在一些实施例中,UART接口通常被用于连接处理器110与无线通信模块160。例如:处理器110通过UART接口与无线通信模块160中的蓝牙模块通信,实现蓝牙功能。在一些实施例中,音频模块170可以通过UART接口向无线通信模块160传递音频信号,实现通过蓝牙耳机播放音乐的功能。The UART interface is a universal serial data bus used for asynchronous communication. The bus may be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, a UART interface is typically used to connect the
MIPI接口可以被用于连接处理器110与显示屏194,摄像头193等外围器件。MIPI接口包括摄像头串行接口(camera serial interface,CSI),显示屏串行接口(displayserial interface,DSI)等。在一些实施例中,处理器110和摄像头193通过CSI接口通信,实现电子设备100的拍摄功能。处理器110和显示屏194通过DSI接口通信,实现电子设备100的显示功能。The MIPI interface can be used to connect the
GPIO接口可以通过软件配置。GPIO接口可以被配置为控制信号,也可被配置为数据信号。在一些实施例中,GPIO接口可以用于连接处理器110与摄像头193,显示屏194,无线通信模块160,音频模块170,传感器模块180等。GPIO接口还可以被配置为I2C接口,I2S接口,UART接口,MIPI接口等。The GPIO interface can be configured by software. The GPIO interface can be configured as a control signal or as a data signal. In some embodiments, the GPIO interface may be used to connect the
USB接口130是符合USB标准规范的接口,具体可以是Mini USB接口,Micro USB接口,USB Type C接口等。USB接口130可以用于连接充电器为电子设备100充电,也可以用于电子设备100与外围设备之间传输数据。也可以用于连接耳机,通过耳机播放音频。该接口还可以用于连接其他电子设备,例如AR设备等。The USB interface 130 is an interface that conforms to the USB standard specification, and may specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, and the like. The USB interface 130 can be used to connect a charger to charge the electronic device 100, and can also be used to transmit data between the electronic device 100 and peripheral devices. It can also be used to connect headphones to play audio through the headphones. The interface can also be used to connect other electronic devices, such as AR devices.
可以理解的是,本发明实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对电子设备100的结构限定。在本申请另一些实施例中,电子设备100也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。It can be understood that the interface connection relationship between the modules illustrated in the embodiment of the present invention is only a schematic illustration, and does not constitute a structural limitation of the electronic device 100 . In other embodiments of the present application, the electronic device 100 may also adopt different interface connection manners in the foregoing embodiments, or a combination of multiple interface connection manners.
充电管理模块140用于从充电器接收充电输入。其中,充电器可以是无线充电器,也可以是有线充电器。在一些有线充电的实施例中,充电管理模块140可以通过USB接口130接收有线充电器的充电输入。在一些无线充电的实施例中,充电管理模块140可以通过电子设备100的无线充电线圈接收无线充电输入。充电管理模块140为电池142充电的同时,还可以通过电源管理模块141为电子设备供电。The
电源管理模块141用于连接电池142,充电管理模块140与处理器110。电源管理模块141接收电池142和/或充电管理模块140的输入,为处理器110,内部存储器121,显示屏194,摄像头193,和无线通信模块160等供电。电源管理模块141还可以用于监测电池容量,电池循环次数,电池健康状态(漏电,阻抗)等参数。在其他一些实施例中,电源管理模块141也可以设置于处理器110中。在另一些实施例中,电源管理模块141和充电管理模块140也可以设置于同一个器件中。The power management module 141 is used for connecting the battery 142 , the
电子设备100的无线通信功能可以通过天线1,天线2,移动通信模块150,无线通信模块160,调制解调处理器以及基带处理器等实现。The wireless communication function of the electronic device 100 may be implemented by the antenna 1, the antenna 2, the
天线1和天线2用于发射和接收电磁波信号。电子设备100中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 may be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, the antenna 1 can be multiplexed as a diversity antenna of the wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
移动通信模块150可以提供应用在电子设备100上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块150可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(low noise amplifier,LNA)等。移动通信模块150可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块150还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。在一些实施例中,移动通信模块150的至少部分功能模块可以被设置于处理器110中。在一些实施例中,移动通信模块150的至少部分功能模块可以与处理器110的至少部分模块被设置在同一个器件中。The
调制解调处理器可以包括调制器和解调器。其中,调制器用于将待发送的低频基带信号调制成中高频信号。解调器用于将接收的电磁波信号解调为低频基带信号。随后解调器将解调得到的低频基带信号传送至基带处理器处理。低频基带信号经基带处理器处理后,被传递给应用处理器。应用处理器通过音频设备(不限于扬声器170A,受话器170B等)输出声音信号,或通过显示屏194显示图像或视频。在一些实施例中,调制解调处理器可以是独立的器件。在另一些实施例中,调制解调处理器可以独立于处理器110,与移动通信模块150或其他功能模块设置在同一个器件中。The modem processor may include a modulator and a demodulator. Wherein, the modulator is used to modulate the low frequency baseband signal to be sent into a medium and high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low frequency baseband signal. Then the demodulator transmits the demodulated low-frequency baseband signal to the baseband processor for processing. The low frequency baseband signal is processed by the baseband processor and passed to the application processor. The application processor outputs sound signals through audio devices (not limited to the
无线通信模块160可以提供应用在电子设备100上的包括无线局域网(wirelesslocal area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。无线通信模块160可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块160经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器110。无线通信模块160还可以从处理器110接收待发送的信号,对其进行调频,放大,经天线2转为电磁波辐射出去。The wireless communication module 160 can provide wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), and global navigation satellite systems applied on the electronic device 100 . (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), near field communication technology (near field communication, NFC), infrared technology (infrared, IR) and other wireless communication solutions. The wireless communication module 160 may be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2 , frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the
在一些实施例中,电子设备100的天线1和移动通信模块150耦合,天线2和无线通信模块160耦合,使得电子设备100可以通过无线通信技术与网络以及其他设备通信。所述无线通信技术可以包括全球移动通讯系统(global system for mobile communications,GSM),通用分组无线服务(general packet radio service,GPRS),码分多址接入(codedivision multiple access,CDMA),宽带码分多址(wideband code division multipleaccess,WCDMA),时分码分多址(time-division code division multiple access,TD-SCDMA),长期演进(long term evolution,LTE),BT,GNSS,WLAN,NFC,FM,和/或IR技术等。所述GNSS可以包括全球卫星定位系统(global positioning system,GPS),全球导航卫星系统(global navigation satellite system,GLONASS),北斗卫星导航系统(beidounavigation satellite system,BDS),准天顶卫星系统(quasi-zenith satellitesystem,QZSS)和/或星基增强系统(satellite based augmentation systems,SBAS)。In some embodiments, the antenna 1 of the electronic device 100 is coupled with the
电子设备100通过GPU,显示屏194,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。The electronic device 100 implements a display function through a GPU, a display screen 194, an application processor, and the like. The GPU is a microprocessor for image processing, and is connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering.
显示屏194用于显示图像,视频等。显示屏194包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic light-emittingdiode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrixorganic light emitting diode的,AMOLED),柔性发光二极管(flex light-emittingdiode,FLED),Miniled,MicroLed,Micro-oLed,量子点发光二极管(quantum dot lightemitting diodes,QLED)等。在一些实施例中,电子设备100可以包括1个或N个显示屏194,N为大于1的正整数。Display screen 194 is used to display images, videos, and the like. Display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (active-matrix organic light-emitting diode). , AMOLED), flexible light-emitting diode (flex light-emitting diode, FLED), Miniled, MicroLed, Micro-oLed, quantum dot light-emitting diodes (quantum dot light emitting diodes, QLED) and so on. In some embodiments, the electronic device 100 may include one or N display screens 194 , where N is a positive integer greater than one.
电子设备100可以通过ISP,摄像头193,视频编解码器,GPU,显示屏194以及应用处理器等实现拍摄功能。The electronic device 100 may implement a shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, an application processor, and the like.
ISP用于处理摄像头193反馈的数据。例如,拍照时,打开快门,光线通过镜头被传递到摄像头感光元件上,光信号转换为电信号,摄像头感光元件将所述电信号传递给ISP处理,转化为肉眼可见的图像。ISP还可以对图像的噪点,亮度,肤色进行算法优化。ISP还可以对拍摄场景的曝光,色温等参数优化。在一些实施例中,ISP可以设置在摄像头193中。The ISP is used to process the data fed back by the camera 193 . For example, when taking a photo, the shutter is opened, the light is transmitted to the camera photosensitive element through the lens, the light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing, and converts it into an image visible to the naked eye. ISP can also perform algorithm optimization on image noise, brightness, and skin tone. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, the ISP may be provided in the camera 193 .
摄像头193用于捕获静态图像或视频。物体通过镜头生成光学图像投射到感光元件。感光元件可以是电荷耦合器件(charge coupled device,CCD)或互补金属氧化物半导体(complementary metal-oxide-semiconductor,CMOS)光电晶体管。感光元件把光信号转换成电信号,之后将电信号传递给ISP转换成数字图像信号。ISP将数字图像信号输出到DSP加工处理。DSP将数字图像信号转换成标准的RGB,YUV等格式的图像信号。在一些实施例中,电子设备100可以包括1个或N个摄像头193,N为大于1的正整数。Camera 193 is used to capture still images or video. The object is projected through the lens to generate an optical image onto the photosensitive element. The photosensitive element may be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then transmits the electrical signal to the ISP to convert it into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. DSP converts digital image signals into standard RGB, YUV and other formats of image signals. In some embodiments, the electronic device 100 may include 1 or N cameras 193 , where N is a positive integer greater than 1.
数字信号处理器用于处理数字信号,除了可以处理数字图像信号,还可以处理其他数字信号。例如,当电子设备100在频点选择时,数字信号处理器用于对频点能量进行傅里叶变换等。A digital signal processor is used to process digital signals, in addition to processing digital image signals, it can also process other digital signals. For example, when the electronic device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy and so on.
视频编解码器用于对数字视频压缩或解压缩。电子设备100可以支持一种或多种视频编解码器。这样,电子设备100可以播放或录制多种编码格式的视频,例如:动态图像专家组(moving picture experts group,MPEG)1,MPEG2,MPEG3,MPEG4等。Video codecs are used to compress or decompress digital video. The electronic device 100 may support one or more video codecs. In this way, the electronic device 100 can play or record videos in various encoding formats, for example, moving picture experts group (MPEG) 1, MPEG2, MPEG3, MPEG4, and so on.
NPU为神经网络(neural-network,NN)计算处理器,通过借鉴生物神经网络结构,例如借鉴人脑神经元之间传递模式,对输入信息快速处理,还可以不断的自学习。通过NPU可以实现电子设备100的智能认知等应用,例如:图像识别,人脸识别,语音识别,文本理解等。The NPU is a neural-network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transfer mode between neurons in the human brain, it can quickly process the input information, and can continuously learn by itself. Applications such as intelligent cognition of the electronic device 100 can be implemented through the NPU, such as image recognition, face recognition, speech recognition, text understanding, and the like.
内部存储器121可以包括一个或多个随机存取存储器(random access memory,RAM)和一个或多个非易失性存储器(non-volatile memory,NVM)。The internal memory 121 may include one or more random access memories (RAM) and one or more non-volatile memories (NVM).
随机存取存储器可以包括静态随机存储器(static random-access memory,SRAM)、动态随机存储器(dynamic random access memory,DRAM)、同步动态随机存储器(synchronous dynamic random access memory,SDRAM)、双倍资料率同步动态随机存取存储器(double data rate synchronous dynamic random access memory,DDR SDRAM,例如第五代DDR SDRAM一般称为DDR5 SDRAM)等。非易失性存储器可以包括磁盘存储器件、快闪存储器(flash memory)。Random access memory may include static random-access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous Dynamic random access memory (double data rate synchronous dynamic random access memory, DDR SDRAM, for example, fifth-generation DDR SDRAM is generally referred to as DDR5 SDRAM) and the like. Non-volatile memory may include magnetic disk storage devices, flash memory.
快闪存储器按照运作原理划分可以包括NOR FLASH、NAND FLASH、3D NAND FLASH等,按照存储单元电位阶数划分可以包括单阶存储单元(single-level cell,SLC)、多阶存储单元(multi-level cell,MLC)、三阶储存单元(triple-level cell,TLC)、四阶储存单元(quad-level cell,QLC)等,按照存储规范划分可以包括通用闪存存储(英文:universalflash storage,UFS)、嵌入式多媒体存储卡(embedded multi media Card,eMMC)等。Flash memory can be divided into NOR FLASH, NAND FLASH, 3D NAND FLASH, etc. according to the operation principle, and can include single-level memory cell (SLC), multi-level memory cell (multi-level memory cell, SLC) according to the level of storage cell potential. cell, MLC), triple-level cell (TLC), quad-level cell (QLC), etc., according to storage specifications, it can include universal flash storage (English: universal flash storage, UFS), Embedded multimedia memory card (embedded multi media Card, eMMC) and so on.
随机存取存储器可以由处理器110直接进行读写,可以用于存储操作系统或其他正在运行中的程序的可执行程序(例如机器指令),还可以用于存储用户及应用程序的数据等。The random access memory can be directly read and written by the
非易失性存储器也可以存储可执行程序和存储用户及应用程序的数据等,可以提前加载到随机存取存储器中,用于处理器110直接进行读写。The non-volatile memory can also store executable programs and store data of user and application programs, etc., and can be loaded into the random access memory in advance for the
外部存储器接口120可以用于连接外部的非易失性存储器,实现扩展电子设备100的存储能力。外部的非易失性存储器通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将音乐,视频等文件保存在外部的非易失性存储器中。The
在本申请实施例中,响应应用层下发的IO请求,执行与该IO请求匹配的输入输出操作的存储设备包括:内部存储器121、外部存储器接口122连接的外部存储器。In this embodiment of the present application, in response to an IO request issued by the application layer, a storage device that performs input and output operations matching the IO request includes: an internal memory 121 and an external memory connected to the external memory interface 122 .
电子设备100可以通过音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,以及应用处理器等实现音频功能。例如音乐播放,录音等。The electronic device 100 may implement audio functions through an
音频模块170用于将数字音频信息转换成模拟音频信号输出,也用于将模拟音频输入转换为数字音频信号。音频模块170还可以用于对音频信号编码和解码。在一些实施例中,音频模块170可以设置于处理器110中,或将音频模块170的部分功能模块设置于处理器110中。The
扬声器170A,也称“喇叭”,用于将音频电信号转换为声音信号。电子设备100可以通过扬声器170A收听音乐,或收听免提通话。
受话器170B,也称“听筒”,用于将音频电信号转换成声音信号。当电子设备100接听电话或语音信息时,可以通过将受话器170B靠近人耳接听语音。The
麦克风170C,也称“话筒”,“传声器”,用于将声音信号转换为电信号。当拨打电话或发送语音信息时,用户可以通过人嘴靠近麦克风170C发声,将声音信号输入到麦克风170C。电子设备100可以设置至少一个麦克风170C。在另一些实施例中,电子设备100可以设置两个麦克风170C,除了采集声音信号,还可以实现降噪功能。在另一些实施例中,电子设备100还可以设置三个,四个或更多麦克风170C,实现采集声音信号,降噪,还可以识别声音来源,实现定向录音功能等。The
耳机接口170D用于连接有线耳机。耳机接口170D可以是USB接口130,也可以是3.5mm的开放移动电子设备平台(open mobile terminal platform,OMTP)标准接口,美国蜂窝电信工业协会(cellular telecommunications industry association of the USA,CTIA)标准接口。The earphone jack 170D is used to connect wired earphones. The earphone port 170D may be the USB port 130 or a 3.5mm open mobile terminal platform (OMTP) standard port, a cellular telecommunications industry association of the USA (CTIA) standard port.
电子设备100可还包括压力传感器180A、陀螺仪传感器180B、气压传感器180C、磁传感器180D、加速度传感器180E、距离传感器180F、接近光传感器180G、环境光传感器180L、指纹传感器180H、温度传感器180J、骨传导传感器180M。The electronic device 100 may further include a pressure sensor 180A, a gyro sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, an ambient light sensor 180L, a fingerprint sensor 180H, a temperature sensor 180J, a bone Conductive sensor 180M.
触摸传感器180K,也称“触控器件”。触摸传感器180K可以设置于显示屏194,由触摸传感器180K与显示屏194组成触摸屏,也称“触控屏”。触摸传感器180K用于检测作用于其上或附近的触摸操作。触摸传感器可以将检测到的触摸操作传递给应用处理器,以确定触摸事件类型。可以通过显示屏194提供与触摸操作相关的视觉输出。在另一些实施例中,触摸传感器180K也可以设置于电子设备100的表面,与显示屏194所处的位置不同。Touch sensor 180K, also called "touch device". The touch sensor 180K may be disposed on the display screen 194 , and the touch sensor 180K and the display screen 194 form a touch screen, also called a “touch screen”. The touch sensor 180K is used to detect a touch operation on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to touch operations may be provided through display screen 194 . In other embodiments, the touch sensor 180K may also be disposed on the surface of the electronic device 100 , which is different from the location where the display screen 194 is located.
在本申请实施例中,电子设备100检测作用于手机屏幕的操作,例如点击某一应用程序图标运行该应用程序的操作(参考图5A所示的用户界面),可通过触摸传感器180K完成。In this embodiment of the present application, the electronic device 100 detects an operation acting on the screen of the mobile phone, such as clicking an application icon to run the application (refer to the user interface shown in FIG. 5A ), which can be accomplished by the touch sensor 180K.
按键190包括开机键,音量键等。按键190可以是机械按键。也可以是触摸式按键。电子设备100可以接收按键输入,产生与电子设备100的用户设置以及功能控制有关的键信号输入。The keys 190 include a power-on key, a volume key, and the like. Keys 190 may be mechanical keys. It can also be a touch key. The electronic device 100 may receive key inputs and generate key signal inputs related to user settings and function control of the electronic device 100 .
马达191可以产生振动提示。马达191可以用于来电振动提示,也可以用于触摸振动反馈。例如,作用于不同应用(例如拍照,音频播放等)的触摸操作,可以对应不同的振动反馈效果。作用于显示屏194不同区域的触摸操作,马达191也可对应不同的振动反馈效果。不同的应用场景(例如:时间提醒,接收信息,闹钟,游戏等)也可以对应不同的振动反馈效果。触摸振动反馈效果还可以支持自定义。Motor 191 can generate vibrating cues. The motor 191 can be used for vibrating alerts for incoming calls, and can also be used for touch vibration feedback. For example, touch operations acting on different applications (such as taking pictures, playing audio, etc.) can correspond to different vibration feedback effects. The motor 191 can also correspond to different vibration feedback effects for touch operations on different areas of the display screen 194 . Different application scenarios (for example: time reminder, receiving information, alarm clock, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.
指示器192可以是指示灯,可以用于指示充电状态,电量变化,也可以用于指示消息,未接来电,通知等。The indicator 192 can be an indicator light, which can be used to indicate the charging state, the change of the power, and can also be used to indicate a message, a missed call, a notification, and the like.
SIM卡接口195用于连接SIM卡。SIM卡可以通过插入SIM卡接口195,或从SIM卡接口195拔出,实现和电子设备100的接触和分离。电子设备100可以支持1个或N个SIM卡接口,N为大于1的正整数。SIM卡接口195可以支持Nano SIM卡,Micro SIM卡,SIM卡等。同一个SIM卡接口195可以同时插入多张卡。所述多张卡的类型可以相同,也可以不同。SIM卡接口195也可以兼容不同类型的SIM卡。SIM卡接口195也可以兼容外部存储卡。电子设备100通过SIM卡和网络交互,实现通话以及数据通信等功能。在一些实施例中,电子设备100采用eSIM,即:嵌入式SIM卡。eSIM卡可以嵌在电子设备100中,不能和电子设备100分离。The
可以理解的是,本发明实施例示意的结构并不构成对电子设备100的具体限定。在本申请另一些实施例中,电子设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。It can be understood that, the structures illustrated in the embodiments of the present invention do not constitute a specific limitation on the electronic device 100 . In other embodiments of the present application, the electronic device 100 may include more or less components than shown, or combine some components, or separate some components, or arrange different components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
下面具体介绍本申请实施例提供的输入输出请求处理方法。The following describes the input and output request processing method provided by the embodiment of the present application in detail.
在图1所示的电子设备100的软件架构基础之上,本申请实施例提供了图3A所示的改进的电子设备100的软件架构示意图。下面结合图3A具体说明:在实施本申请实施例提供的输入输出请求处理方法的过程中,电子设备100的软件和硬件的工作流程。Based on the software architecture of the electronic device 100 shown in FIG. 1 , an embodiment of the present application provides a schematic diagram of the software architecture of the improved electronic device 100 shown in FIG. 3A . The following describes in detail with reference to FIG. 3A : in the process of implementing the input and output request processing method provided by the embodiment of the present application, the work flow of the software and hardware of the electronic device 100 is described.
如图3A所示,电子设备100的软件架构同样可分为3层:应用层、内核层和设备层。As shown in FIG. 3A , the software architecture of the electronic device 100 can also be divided into three layers: an application layer, a kernel layer and a device layer.
应用层可包括一个或多个应用程序和时延检测模块211。上述一个或多个应用程序例如应用程序1(APP1)、应用程序2(APP2)。上述应用程序可以是系统提供的应用程序,也可以是第三方应用程序。The application layer may include one or more application programs and a delay detection module 211 . The above-mentioned one or more application programs are, for example, application program 1 (APP1), application program 2 (APP2). The above-mentioned applications can be applications provided by the system or third-party applications.
在运行应用程序的过程中,该应用程序可发起一个或多个进程。例如,在运行影音类应用程序播放视频的过程中,该应用程序维护的进程可包括:用户操作监测进程、视频数据获取进程、图像数据渲染进程、音频处理进程等等。对于任一进程而言,该进程又可发起一个或多个IO请求。因此,电子设备100可同时检测到一个或多个应用程序发起的多个IO请求。In the process of running an application, the application may initiate one or more processes. For example, in the process of running an audio-visual application to play a video, the processes maintained by the application may include: a user operation monitoring process, a video data acquisition process, an image data rendering process, an audio processing process, and the like. For any process, the process can initiate one or more IO requests. Therefore, the electronic device 100 can simultaneously detect multiple IO requests initiated by one or more applications.
时延检测模块211可用于检测不同优先级的IO请求的平均响应时间。具体的,当检测到某一进程发起一个IO请求后,时延检测模块211可获取该进程发起该IO请求的时间戳(发起时刻)。当执行完上述IO请求指示的输入输出操作后,存储设备217可向应用层返回处理结果后。该处理结果可包括存储设备217执行完上述IO请求的时间戳(响应时刻)。此时,时延检测模块211可从上述处理结果中获取响应时刻。The delay detection module 211 can be used to detect the average response time of IO requests of different priorities. Specifically, after detecting that a certain process initiates an IO request, the delay detection module 211 may obtain the timestamp (initiating time) at which the process initiated the IO request. After performing the input and output operations indicated by the above IO request, the storage device 217 may return the processing result to the application layer. The processing result may include a time stamp (response time) when the storage device 217 completes the execution of the above-mentioned IO request. At this time, the delay detection module 211 can obtain the response time from the above processing result.
发起时刻到响应时刻之间的耗时为电子设备处理该IO请求的响应时间。时延检测模块211可按优先级的类型,对应用层下发的众多IO请求的响应时间进行分组统计,进而计算同一优先级的IO请求的平均响应时间。The time-consuming between the initiation time and the response time is the response time for the electronic device to process the IO request. The delay detection module 211 may perform group statistics on the response times of numerous IO requests issued by the application layer according to the type of priority, and then calculate the average response time of the IO requests of the same priority.
内核层包括文件系统212(File System)和块(Block)。The kernel layer includes a file system 212 (File System) and a block (Block).
文件系统212反映了存储设备上组织文件的方法和形式。不同文件系统212组织和管理文件的形式不同。在电子设备100的存储设备执行应用层下发的IO请求之前,上述IO请求会经过文件系统212。文件系统212会按照自身预设的组织和管理文件的形式,对上述IO请求进行处理,使上述IO请求成为该IO请求的目标存储空间可操作的数据。File system 212 reflects the method and form in which files are organized on a storage device. Different file systems 212 organize and manage files differently. Before the storage device of the electronic device 100 executes the IO request issued by the application layer, the above-mentioned IO request will pass through the file system 212 . The file system 212 will process the above-mentioned IO request according to the form of organization and management files preset by itself, so that the above-mentioned IO request becomes the operable data of the target storage space of the IO request.
例如,当文件系统212的类型为F2FS时,在接收到应用层下发的某一IO请求(input请求或output请求)后,F2FS可对该IO请求进行加密操作,使该IO请求对应的数据能够更安全地被写入(或写出)到存储设备。For example, when the type of the file system 212 is F2FS, after receiving an IO request (input request or output request) sent by the application layer, F2FS can encrypt the IO request, so that the data corresponding to the IO request can be encrypted. Can be written to (or written to) more securely to the storage device.
参考图1的介绍,文件系统212的类型众多。由于不同文件系统212对IO请求处理的方法的不同,经过不同文件系统212的IO请求后端时延不同。上述后端时延即指文件系统212按照自身预设的组织和管理文件的方法,将IO请求成为该IO请求的目标存储空间可操作的数据的耗时。后端时延是影响IO请求的响应时间的重要因素。Referring to the introduction of FIG. 1, there are many types of file systems 212. Due to the different methods of processing IO requests by different file systems 212, the backend delays of IO requests passing through different file systems 212 are different. The above-mentioned back-end delay refers to the time taken by the file system 212 to convert the IO request into operable data of the target storage space of the IO request according to its own preset method of organizing and managing files. Backend latency is an important factor affecting the response time of IO requests.
块(Block)包括分组配额模块213、返回控制模块214和读写调度模块215。The block (Block) includes a grouping quota module 213 , a return control module 214 and a read-write scheduling module 215 .
分组配额模块213可根据不同优先级的IO请求的平均响应时间,动态地调整不同优先级的IO请求对IO资源的占有比,即动态的调整IO资源的调度配比。返回控制模块214可用于控制IO处理结果的返回速率。这里,返回速率是指IO处理结果从内核层Block返回到发起该IO请求的应用程序的速率。读写调度模块215可根据分组配额模块213预设的调度策略,确定电子设备100的处理不同优先级IO请求的数量和先后顺序(即处理优先级)。The grouping quota module 213 can dynamically adjust the occupancy ratio of IO requests with different priorities to IO resources according to the average response time of IO requests with different priorities, that is, dynamically adjust the scheduling ratio of IO resources. The return control module 214 may be used to control the return rate of IO processing results. Here, the return rate refers to the rate at which the IO processing result is returned from the kernel layer Block to the application that initiated the IO request. The read-write scheduling module 215 can determine the number and sequence (ie, processing priority) of the electronic device 100 to process IO requests with different priorities according to the scheduling policy preset by the grouping quota module 213 .
后续实施例将会详细介绍分组配额模块213、返回控制模块214和读写调度模块215的工作原理,这里先不展开。Subsequent embodiments will introduce the working principles of the group quota module 213 , the return control module 214 , and the read-write scheduling module 215 in detail, which will not be expanded here.
设备层包括存储设备217。上述存储设备包括易失性存储设备和非易失性存储设备。其中,非易失性存储设备可以是SSD、MMC/eMMC等等,具体可参考图1的介绍,这里不再赘述。可控制存储设备217执行IO请求指示的输入输出操作。The device layer includes storage devices 217 . The above-mentioned storage devices include volatile storage devices and non-volatile storage devices. The non-volatile storage device may be an SSD, MMC/eMMC, etc. For details, reference may be made to the introduction in FIG. 1 , which will not be repeated here. The controllable storage device 217 performs the input and output operations indicated by the IO request.
在图3A所示的软件架构图的基础上,电子设备100处理应用程序下发的IO请求的过程可参考图3B。Based on the software architecture diagram shown in FIG. 3A , reference may be made to FIG. 3B for the process of the electronic device 100 processing the IO request issued by the application.
如图3B所示,APP1可以为一个前台应用(用户直接操作的应用程序);APP2可以为一个后台应用(非用户直接操作的应用程序)。As shown in FIG. 3B , APP1 may be a foreground application (an application directly operated by the user); APP2 may be a background application (an application not directly operated by the user).
一般的,由于前台应用需要及时给用户反馈,因此,前台应用发起的IO请求的时延忍耐度较低(即时延要求较高)。上述时延忍耐度是指接收响应延迟的程度。在检测到前台应用发起的IO请求后,电子设备100需要在尽可能短的时间内处理该IO请求。而后台应用由于不需要给用户即时的反馈,因此,后台应用的时延忍耐度较高(即时延要求较低)。在检测到后台应用发起的IO请求后,电子设备100可以不那么紧急的去处理该IO请求。Generally, since the foreground application needs to give feedback to the user in time, the latency tolerance of the IO request initiated by the foreground application is low (that is, the latency requirement is high). The above-mentioned delay tolerance refers to the degree of delay in receiving the response. After detecting the IO request initiated by the foreground application, the electronic device 100 needs to process the IO request in the shortest possible time. However, since the background application does not need to give immediate feedback to the user, the background application has a higher latency tolerance (that is, a lower latency requirement). After detecting the IO request initiated by the background application, the electronic device 100 may process the IO request less urgently.
因此,在同时检测到延要求较高的IO请求和时延要求较低IO请求后,电子设备100可优先处理延要求较高的IO请求。Therefore, after simultaneously detecting an IO request with a higher latency requirement and an IO request with a lower latency requirement, the electronic device 100 may preferentially process the IO request with a higher latency requirement.
例如,APP1可发起一个IO请求(IO1);APP2可发起两个IO请求(IO2、IO3)。IO1的时延要求例如5ms,IO2的时延要求例如10ms,IO3的时延要求例如15ms。因此,IO1可以为高优先级的IO请求,IO2、IO3为低优先级的IO请求。其中,IO2的优先级又可高于IO3。即优先级IO1高于IO2高于IO3。这里,我们用优先级A、B、C(A>B>C)分别表示电子设备100处理上述3个IO请求的处理优先级。其中,IO1的优先级为A;IO2的优先级为B;IO3的优先级为C。可以理解的,上述时延要求与IO处理优先级的对应关系仅为示例性例举,不应构成对本申请实施例的限制。For example, APP1 can initiate one IO request (IO1); APP2 can initiate two IO requests (IO2, IO3). The delay requirement of IO1 is for example 5ms, the delay requirement of IO2 is for example 10ms, and the delay requirement of IO3 is for example 15ms. Therefore, IO1 can be a high-priority IO request, and IO2 and IO3 can be low-priority IO requests. Among them, the priority of IO2 can be higher than that of IO3. That is, the priority IO1 is higher than IO2 and higher than IO3. Here, we use priorities A, B, and C (A>B>C) to represent the processing priorities of the electronic device 100 for processing the above three IO requests, respectively. Among them, the priority of IO1 is A; the priority of IO2 is B; the priority of IO3 is C. It can be understood that the above-mentioned corresponding relationship between the delay requirement and the IO processing priority is only an example, and should not constitute a limitation on the embodiments of the present application.
在电子设备100同时运行视频应用和图库应用的场景下:处于后台运行状态的视频应用可以发起写入请求,向存储设备217写入下载视频数据(IO3);IO2可以是一些系统应用或进程发起的IO请求;处于前台运行状态的图库应用可以发起读请求,从存储设备217中读取某一图片(IO1)。可以理解的,同一应用的不同进程的时延要求也可不同,因此,上述3个IO请求也可以是同一个应用程序发起的。In the scenario where the electronic device 100 runs a video application and a gallery application at the same time: the video application in the background running state can initiate a write request to write and download video data to the storage device 217 (IO3); IO2 can be initiated by some system applications or processes IO request; the gallery application in the foreground running state can initiate a read request to read a certain picture (IO1) from the storage device 217. It can be understood that the delay requirements of different processes of the same application may also be different. Therefore, the above three IO requests may also be initiated by the same application.
以IO1为例,在APP1发起IO1后,时延检测模块211可检测到IO1的到来,此时,时延检测模块211可记录当前时间作为IO1的发起时间。同样的,时延检测模块211可记录APP2发起IO2、IO3的时间,即IO2、IO3各自的发起时间。Taking IO1 as an example, after APP1 initiates IO1, the delay detection module 211 can detect the arrival of IO1. At this time, the delay detection module 211 can record the current time as the initiation time of IO1. Similarly, the delay detection module 211 can record the time when APP2 initiates IO2 and IO3, that is, the respective initiation times of IO2 and IO3.
应用层下发的IO请求经过文件系统,可达到块(Block)。这一个下发的过程的时延可记为△t1。结合图1的介绍,由于不同IO请求的目标存储空间所使用的文件组织形式不同,即IO请求经过的文件系统不同,不同IO请求的△t1的取值不同。这也是导致高优先级的总时延可能长于低优先级的总时延的重要因素。The IO request issued by the application layer can reach the block through the file system. The time delay of this delivery process can be recorded as Δt1. Combined with the introduction in Figure 1, due to the different file organization forms used in the target storage space of different IO requests, that is, the file systems that the IO requests pass through are different, and the values of Δt1 for different IO requests are different. This is also an important factor that causes the total delay of high priority to be longer than that of low priority.
在IO请求达到Block后,读写调度模块215可根据IO请求的所属的优先级,确定底层存储设备217处理上述IO请求的先后顺序。IO请求在读写调度模块215等待被处理的耗时可记为△t2。在本申请实施例中,读写调度模块215在确定存储设备217处理IO请求的先后顺序的过程中,还依赖分组配额模块213。After the IO request reaches the Block, the read/write scheduling module 215 may determine the order in which the underlying storage device 217 processes the IO request according to the priority of the IO request. The time spent waiting for the IO request to be processed in the read/write scheduling module 215 may be recorded as Δt2. In this embodiment of the present application, the read/write scheduling module 215 also relies on the group quota module 213 in the process of determining the order in which the storage device 217 processes IO requests.
具体的,分组配额模块213和读写调度模块215的工作原理如下:Specifically, the working principles of the group quota module 213 and the read-write scheduling module 215 are as follows:
分组配额模块213中可记录有电子设备100在一个周期内处理不同优先级的IO请求的数量的比例,简称调度配比。读写调度模块215可根据分组配额模块213中记录的调度配比,从接收应用层下发的IO请求的缓存区中获取特定数量的IO请求,并确定将上述特定数量的IO请求的下发给存储设备217的顺序。The group quota module 213 may record the ratio of the number of IO requests with different priorities processed by the electronic device 100 in one cycle, which is referred to as the scheduling ratio for short. The read-write scheduling module 215 can obtain a specific number of IO requests from the buffer area that receives the IO requests issued by the application layer according to the scheduling ratio recorded in the grouping quota module 213, and determine to issue the above-mentioned specific number of IO requests. order to storage device 217.
图4A示例性示出了读写调度模块215按照分组配额模块213中记录的调度配比处理接收到的IO请求的过程。FIG. 4A exemplarily shows the process that the read-write scheduling module 215 processes the received IO request according to the scheduling ratio recorded in the group quota module 213 .
与优先级A、B、C对应的,接收应用层下发的IO请求的缓存区可包括3个缓冲队列,分别为A队列、B队列和C队列。上述3个队列用于缓存上述3类优先级不同的IO请求。其中,A队列可用于缓存优先级为A的IO请求(A类IO请求);B队列可用于缓存优先级为B的IO请求(B类IO请求);C队列可用于缓存优先级为C的IO请求(C类IO请求)。Corresponding to the priorities A, B, and C, the buffer area for receiving the IO request issued by the application layer may include three buffer queues, namely the A queue, the B queue, and the C queue. The above three queues are used to cache the above three types of IO requests with different priorities. Among them, queue A can be used to cache IO requests with priority A (type A IO requests); queue B can be used to cache IO requests with priority B (type B IO requests); queue C can be used to cache IO requests with priority C IO request (type C IO request).
在检测到应用层下发的IO请求后,电子设备100可识别该IO请求的优先级,然后,电子设备100可将该IO请求缓存到对应优先级的队列中,等待底层存储设备的响应。After detecting the IO request sent by the application layer, the electronic device 100 can identify the priority of the IO request, and then the electronic device 100 can cache the IO request in a queue corresponding to the priority, and wait for a response from the underlying storage device.
结合图3B所示的IO1(A)、IO2(B)、IO3(C),当检测到的IO1时,电子设备100可将IO1插入到A队列中;当检测到的IO2时,电子设备100可将IO2插入到B队列中;当检测到的IO3时,电子设备100可将IO3插入到C队列中。Combined with IO1 (A), IO2 (B), and IO3 (C) shown in FIG. 3B , when IO1 is detected, the electronic device 100 can insert IO1 into the A queue; when IO2 is detected, the electronic device 100 IO2 may be inserted into the B queue; when IO3 is detected, the electronic device 100 may insert IO3 into the C queue.
可以理解的,根据不同的划分原则,或将上述3类优先级进行合并或拆分,电子设备100中IO请求的优先级类型还可以是其他形式,即包括更多或更少的优先级分级。相应地,电子设备100可根据新的优先级分类标记不同应用程序或进程发起的IO请求。本申请实施例对此不作限制。在其他实施例中,不同优先级的IO请求也可缓存在一个存储区域内。It can be understood that, according to different division principles, or by combining or splitting the above three types of priorities, the priority types of the IO requests in the electronic device 100 may also be in other forms, that is, including more or less priority classifications. . Accordingly, the electronic device 100 may mark IO requests initiated by different applications or processes according to the new priority classification. This embodiment of the present application does not limit this. In other embodiments, IO requests with different priorities can also be cached in one storage area.
电子设备100还可包括调度队列Q。调度队列Q也用于缓存IO请求。从A队列、B队列和C队列出队的IO请求可被缓存到调度队列Q。调度队列Q中IO请求的排列顺序可指示存储设备217实际处理IO请求的顺序。The electronic device 100 may also include a scheduling queue Q. The dispatch queue Q is also used to buffer IO requests. IO requests dequeued from queue A, queue B, and queue C can be buffered to dispatch queue Q. The order in which the IO requests are arranged in the dispatch queue Q may indicate the order in which the storage device 217 actually processes the IO requests.
在IO1、IO2、IO3到达缓冲队列后,IO1、IO2、IO3可在缓冲队列中等待。此时,读写调度模块215可向分组配额模块213获取当前的调度配比。然后,电子设备100可按照分组配额模块213中记录的调度配比,依次从A队列、B队列和C队列调取对应数量的A类IO请求、B类IO请求、C类IO请求,并将上述IO请求依次插入调度队列Q。在不同优先级的IO请求缓存在一个存储区域中的情况下,读写调度模块215可根据各IO请求的优先级标识识别上述IO请求,并确定是否将其存入调度队列Q。After IO1, IO2, and IO3 arrive at the buffer queue, IO1, IO2, and IO3 can wait in the buffer queue. At this time, the read-write scheduling module 215 may obtain the current scheduling ratio from the grouping quota module 213 . Then, according to the scheduling ratio recorded in the grouping quota module 213, the electronic device 100 can sequentially fetch a corresponding number of A-type IO requests, B-type IO requests, and C-type IO requests from the A queue, B-queue and C-queue, and send The above IO requests are sequentially inserted into the scheduling queue Q. When IO requests with different priorities are buffered in one storage area, the read/write scheduling module 215 can identify the above IO requests according to the priority identifiers of each IO request, and determine whether to store them in the scheduling queue Q.
一般的,电子设备100需要优先处理优先级高的IO请求。因此,在大多数情况下,电子设备100需要为高优先级的IO请求分配更多的IO资源。所以,一般的,在预设的调度配比中,指示A类IO请求的比值项的数值会较大。这样,电子设备100可以将更多的IO资源分配给高优先级的A类IO请求,以快速地响应用户的请求。Generally, the electronic device 100 needs to prioritize IO requests with high priorities. Therefore, in most cases, the electronic device 100 needs to allocate more IO resources for high-priority IO requests. Therefore, in general, in the preset scheduling ratio, the value of the ratio item indicating the type A IO request will be larger. In this way, the electronic device 100 can allocate more IO resources to high-priority class A IO requests to quickly respond to the user's request.
例如,假设分组配额模块213中记录的调度配比为5:3:2。此时,在一个周期内,根据上述调度配比,读写调度模块215可从上述缓存队列A、B、C中分别获取5个A类IO请求、3个B类IO请求和2个C类IO请求,并依次将上述IO请求插入调度队列Q中。上述5个A类IO请求、3个B类IO请求和2个C类IO请求就分别包括在缓冲队列A、B、C中等待的IO1、IO2、IO3。在其他实施例中,根据调度配比5:3:2,读写调度模块215也可从上述缓存区内获取10个A类IO请求、6个B类IO请求和4个C类IO请求(10:6:4=5:3:2)等等。For example, it is assumed that the scheduling ratio recorded in the group quota module 213 is 5:3:2. At this time, in one cycle, according to the above-mentioned scheduling ratio, the read-write scheduling module 215 can obtain 5 A-type IO requests, 3 B-type IO requests and 2 C-type IO requests respectively from the above-mentioned cache queues A, B, and C. IO requests, and sequentially insert the above IO requests into the scheduling queue Q. The above-mentioned 5 A-type IO requests, 3 B-type IO requests, and 2 C-type IO requests respectively include IO1, IO2, and IO3 waiting in the buffer queues A, B, and C. In other embodiments, according to the scheduling ratio of 5:3:2, the read-write scheduling module 215 can also obtain 10 A-type IO requests, 6 B-type IO requests and 4 C-type IO requests ( 10:6:4 = 5:3:2) and so on.
然后,读写调度模块215可按照调度队列Q中各类IO请求的顺序依次下发到存储设备217。响应于上述IO请求,存储设备217可执行该IO请求指示的输入输出操作。Then, the read-write scheduling module 215 can sequentially deliver the various IO requests in the scheduling queue Q to the storage device 217 in sequence. In response to the above IO request, the storage device 217 may perform the input and output operations indicated by the IO request.
回到图3B,在存储设备217处理完IO请求后,存储设备217可向发起该IO请求的应用程序返回该IO请求的处理结果。存储设备217处理IO请求的耗时可记为△t3。存储设备217返回处理IO请求到应用程序接受到上述IO处理结果的耗时可记为△t4。影响△t3的主要因素为存储设备的类型,因此,在本申请实施例中,存储设备217响应不同IO请求执行输入输出操作的时间可视为相同,即不同IO请求的△t3可视为相同。Returning to FIG. 3B , after the storage device 217 finishes processing the IO request, the storage device 217 may return the processing result of the IO request to the application that initiated the IO request. The time taken by the storage device 217 to process the IO request can be recorded as Δt3. The time required for the storage device 217 to return to process the IO request until the application program receives the above-mentioned IO processing result may be recorded as Δt4. The main factor affecting Δt3 is the type of the storage device. Therefore, in this embodiment of the present application, the time for the storage device 217 to perform input and output operations in response to different IO requests can be regarded as the same, that is, the Δt3 of different IO requests can be regarded as the same .
例如,在存储设备217依次执行IO1、IO2、IO3指示的输入输出操作后,存储设备217可向应用层返回IO1、IO2、IO3的处理结果(IO处理结果)。上述处理结果包括确认字符(例如ACK),和/或,输入或输出的数据。For example, after the storage device 217 sequentially performs the input and output operations indicated by IO1, IO2, and IO3, the storage device 217 may return the processing results (IO processing results) of IO1, IO2, and IO3 to the application layer. The above processing results include acknowledgement characters (eg, ACK), and/or input or output data.
在传回应用层之前,IO处理结果会经过返回控制模块214。图4B示出了返回控制模块214的工作原理。Before returning to the application layer, the IO processing result will go through the return control module 214 . FIG. 4B shows the working principle of the return control module 214 .
如图4B所示,返回控制模块214可检测到存储设备217传回的IO处理结果。首先,返回控制模块214可识别上述处理结果所述的优先级,进而,返回控制模块214可根据当前返回控制策略,控制低优先级的IO请求的处理结果的返回速率。As shown in FIG. 4B , the return control module 214 can detect the IO processing result returned by the storage device 217 . First, the return control module 214 can identify the priority of the above processing result, and then the return control module 214 can control the return rate of the processing result of the low priority IO request according to the current return control policy.
结合图4A所示的调度队列Q中的多个IO请求,如图4B所示,返回控制模块214可依次接收到存储设备217返回的上述IO请求(5个A类IO请求、3个B类IO请求和2个C类IO请求)的处理结果。这里,图4B中的标记有“IO”的矩形块与图4A的表意不同,其中图4A中一个标记有“IO”的矩形块表示一个IO请求,而图4B中一个标记有“IO”的矩形块表示存储设备217处理一个IO请求后生成的处理结果。Combined with multiple IO requests in the scheduling queue Q shown in FIG. 4A , as shown in FIG. 4B , the return control module 214 can sequentially receive the above-mentioned IO requests (5 type A IO requests, 3 type B IO requests, 3 type B IO requests) returned by the storage device 217 in sequence. IO request and 2 class C IO requests) processing results. Here, the rectangular block marked "IO" in Figure 4B has a different meaning from that of Figure 4A, where a rectangular block marked "IO" in Figure 4A represents an IO request, and a rectangular block marked "IO" in Figure 4B The rectangular blocks represent processing results generated after the storage device 217 processes an IO request.
对于上述IO请求中任一IO请求,在接收到该IO请求的处理结果后,返回控制模块214可根据该处理结果中的IO请求的标识,确定该处理结果所述的IO请求,以及该IO请求的优先级。For any IO request among the above IO requests, after receiving the processing result of the IO request, the return control module 214 can determine the IO request described in the processing result and the IO request according to the identifier of the IO request in the processing result. The priority of the request.
在限制低优先级IO处理结果的返回速率的场景下,若上述处理结果为低优先级IO处理结果,返回控制模块214可延迟向文件系统212、应用层发送该处理结果。In a scenario where the return rate of the low-priority IO processing result is limited, if the above-mentioned processing result is a low-priority IO processing result, the return control module 214 may delay sending the processing result to the file system 212 and the application layer.
例如,在的限制C类优先级的IO处理结果的返回速率的场景下,当接收到的IO处理结果为A类优先级的IO请求的处理结果(或B类优先级的IO请求的处理结果)时,返回控制模块214可正常地将上述IO处理结果传回应用层。当接收到的IO处理结果为C类优先级的IO请求的处理结果时,返回控制模块214可将该IO处理结果滞留在返回控制模块214迟一段时间,然后再将该IO处理结果传回应用层。上述一段时间是预设的,例如0.1ms等等。For example, in the scenario of limiting the return rate of the IO processing result of class C priority, when the received IO processing result is the processing result of the IO request of class A priority (or the processing result of the IO request of class B priority) ), the return control module 214 can normally return the above IO processing result to the application layer. When the received IO processing result is the processing result of the IO request with the C-class priority, the return control module 214 can delay the IO processing result in the return control module 214 for a period of time, and then transmit the IO processing result back to the application Floor. The above period of time is preset, such as 0.1ms and so on.
对于任一IO请求而言,若其IO处理结果在返回应用层时,收到返回控制模块214的限制,则其返回应用层的时间△t4会延长。这样,由于延迟收到该低优先级的IO请求的处理结果,发起该IO请求的应用程序的活跃度会降低,进而提升电子设备100处理高优先级的IO请求的效率。For any IO request, if the IO processing result is restricted by the return control module 214 when the IO processing result is returned to the application layer, the time Δt4 for returning to the application layer will be extended. In this way, due to the delayed receipt of the processing result of the low-priority IO request, the activity of the application that initiates the IO request will be reduced, thereby improving the efficiency of the electronic device 100 in processing the high-priority IO request.
下面首先具体介绍返回控制模块214确定返回控制策略的工作原理。以前述图4A所示的3级优先级分类(A、B、C)为例,图4C示出了电子设备100根据CPU的当前负载确定返回控制策略的流程图。The working principle of the return control module 214 for determining the return control strategy is first described in detail below. Taking the aforementioned three-level priority classification (A, B, C) shown in FIG. 4A as an example, FIG. 4C shows a flowchart of the electronic device 100 determining the return control strategy according to the current load of the CPU.
S101:电子设备100查询CPU的当前负载H0。S101: The electronic device 100 queries the current load H0 of the CPU.
电子设备100可通过系统提供的查询CPU工作状态的函数确定CPU的当前负载,记为H0,包括CPU的占用情况,等待CPU资源的进程数等等。The electronic device 100 can determine the current load of the CPU through a function provided by the system to query the CPU working state, which is recorded as H0, including the occupancy of the CPU, the number of processes waiting for CPU resources, and the like.
例如,当CPU的所有处理核均被占用,且存在大量等待CPU处理的进程,此时,电子设备100可确定CPU负载较高(繁忙)。上述函数例如Linux提供的vmstat()函数、mpstat()函数等等,本申请实施例对此不作限制。For example, when all processing cores of the CPU are occupied and there are a large number of processes waiting for processing by the CPU, at this time, the electronic device 100 may determine that the CPU load is high (busy). The above functions are, for example, the vmstat() function, the mpstat() function, etc. provided by Linux, which are not limited in this embodiment of the present application.
然后,电子设备100可比较当前负载与预设的负载阈值的大小,确定是否限制低优先级的IO请求的返回速率。Then, the electronic device 100 may compare the size of the current load with the preset load threshold, and determine whether to limit the return rate of the low-priority IO request.
电子设备100可设置有负载阈值H1、和负载阈值H2。其中,H1<H2。上述分两级设置的负载阈值可以反映:电子设备100限制低优先级IO请求返回速率的不同程度。当然,电子设备100还可设置更多或更少的负载阈值。本申请实施例对此不作限制。The electronic device 100 may be provided with a load threshold H1 and a load threshold H2. Among them, H1<H2. The load thresholds set in two levels above may reflect different degrees to which the electronic device 100 limits the return rate of low-priority IO requests. Of course, the electronic device 100 may also set more or less load thresholds. This embodiment of the present application does not limit this.
在获取到CPU的当前负载后,电子设备100可比较当前负载与负载阈值(H1、H2)的大小。首先,S102:电子设备100可比较当前负载与阈值H2的大小,判断CPU的当前负载是否高于阈值H2。After acquiring the current load of the CPU, the electronic device 100 may compare the current load with the load thresholds ( H1 , H2 ). First, S102: The electronic device 100 may compare the magnitude of the current load with the threshold H2, and determine whether the current load of the CPU is higher than the threshold H2.
若当前负载高于H2,即H2<H0,则电子设备100的CPU非常繁忙。此时,S103:电子设备100可限制全部低优先级的IO请求的返回速率(例如,限制优先级为B和C的IO请求的返回速率)。体现在应用程序上,电子设备100可限制非前台类应用程序发起的IO请求,包括系统应用程序和后台应用程序的IO请求的返回速率。If the current load is higher than H2, that is, H2<H0, the CPU of the electronic device 100 is very busy. At this time, S103: The electronic device 100 may limit the return rate of all low-priority IO requests (eg, limit the return rate of IO requests with priorities B and C). Reflected on the application, the electronic device 100 can limit the IO requests initiated by non-foreground applications, including the return rate of IO requests of system applications and background applications.
若当前负载低于H2,H0<H2,则S104:电子设备100可继续比较当前负载与阈值H1的大小,判断CPU的当前负载是否高于阈值H1。If the current load is lower than H2, and H0<H2, then S104: The electronic device 100 may continue to compare the current load with the threshold H1 to determine whether the current CPU load is higher than the threshold H1.
若当前负载高于H1,即H1<H0<H2,则电子设备100的CPU比较繁忙。此时,S105:电子设备100可限制部分低优先级的IO请求的返回速率(例如,仅限制优先级为C的IO请求的返回速率)。体现在应用程序上,电子设备100可仅限制后台类应用程序发起的IO请求的返回速率,而不限制系统类应用程序发起的IO请求的返回速率。If the current load is higher than H1, that is, H1<H0<H2, the CPU of the electronic device 100 is relatively busy. At this time, S105: The electronic device 100 may limit the return rate of some low-priority IO requests (for example, only limit the return rate of IO requests with priority C). Reflected on the application, the electronic device 100 may only limit the return rate of IO requests initiated by background applications, but not the return rate of IO requests initiated by system applications.
若当前负载低于H1,即H0<H1,则电子设备100的CPU可视为空闲。此时,S106:电子设备100可不限制任何IO请求的返回速率。If the current load is lower than H1, that is, H0<H1, the CPU of the electronic device 100 may be regarded as idle. At this time, S106: The electronic device 100 may not limit the return rate of any IO request.
这样,当电子设备100的处理器繁忙,但IO资源空闲时,电子设备100可以通过控制低优先级的IO请求的返回速率,降低后台应用的CPU资源占用,提升前台应用处理性能。同时,从返回端限制后台应用,可以提升IO资源的利用率。In this way, when the processor of the electronic device 100 is busy but the IO resources are idle, the electronic device 100 can reduce the CPU resource occupation of the background application and improve the processing performance of the foreground application by controlling the return rate of the low-priority IO request. At the same time, restricting background applications from the return side can improve the utilization of IO resources.
回到图3B,在经过返回控制模块214后,经过文件系统212、时延检测模块211,IO处理结果可返回发起该IO请求的应用程序。例如,IO1可返回APP1,IO2、IO3可返回APP2。Returning to FIG. 3B , after passing through the return control module 214 , through the file system 212 and the delay detection module 211 , the IO processing result can be returned to the application that initiated the IO request. For example, IO1 can return APP1, IO2, IO3 can return APP2.
在IO处理结果经过时延检测模块211时,时延检测模块211可确定当前时间为电子设备100处理完该IO处理结果对应的IO请求的时间(结束时间)。同样以IO1为例,在IO1的处理结果达到时延检测模块211后,时延检测模块211可确定当前时间为电子设备100处理完IO1的时间。结合前述介绍的,在APP1发起IO1后,时延检测模块211检测到IO1的时间(发起时间),通过上述两次时间(发起时间和结束时间),时延检测模块211可确定电子设备100处理IO1的总时间,即响应时间,记为T1。When the IO processing result passes through the delay detection module 211 , the delay detection module 211 may determine that the current time is the time (end time) when the electronic device 100 completes the processing of the IO request corresponding to the IO processing result. Also taking IO1 as an example, after the processing result of IO1 reaches the delay detection module 211, the delay detection module 211 may determine that the current time is the time when the electronic device 100 finishes processing IO1. In combination with the above description, after APP1 initiates IO1, the time delay detection module 211 detects the time (initiation time) of IO1, and through the above two times (initiation time and end time), the delay detection module 211 can determine the electronic device 100 to process The total time of IO1, that is, the response time, is recorded as T1.
依次类推,时延检测模块211可依次确定一个IO处理周期内电子设备100处理个IO请求的时间,即各IO请求的响应时间。这样,时延检测模块211可确定IO2的响应时间为T2,IO3的响应时间为T3。By analogy, the delay detection module 211 can sequentially determine the time for the electronic device 100 to process each IO request in one IO processing cycle, that is, the response time of each IO request. In this way, the delay detection module 211 can determine that the response time of IO2 is T2, and the response time of IO3 is T3.
一般的,电子设备100优先处理A类IO请求,因此A类IO请求的响应时间应该最短。在IO1、IO2、IO3中,IO1、IO2、IO3的响应时间T1、T2、T3应该满足:T1<T2<T3。但是由于△t1、△t2等路径上的耗时,特别是不同IO请求经过的文件系统212不同(△t2不同),这就可能导致高优先级的IO请求的响应时间反而会长于低优先级的IO请求的响应时间。这是由于不同文件系统对数据附加的处理不同(加密、解密、压缩、解压缩、数据校验等操作)。Generally, the electronic device 100 preferentially processes the A-type IO request, so the response time of the A-type IO request should be the shortest. In IO1, IO2, IO3, the response time T1, T2, T3 of IO1, IO2, IO3 should satisfy: T1<T2<T3. However, due to the time consuming on paths such as Δt1 and Δt2, especially the file systems 212 that different IO requests pass through are different (Δt2 is different), this may cause the response time of high-priority IO requests to be longer than low-priority requests. The response time of the IO request. This is due to the different processing of data attachment (encryption, decryption, compression, decompression, data verification, etc.) in different file systems.
例如,IO1由于加密、压缩操作,其△t1可能会大于IO2的△t1,因此IO1的响应时间会长于IO1的响应时间。For example, the Δt1 of IO1 may be greater than the Δt1 of IO2 due to encryption and compression operations, so the response time of IO1 will be longer than that of IO1.
例如,T1=△t1(IO1)+△t2(IO1)+△t3(IO1)+△t4(IO1)=10ms;For example, T1=△t1(IO1)+△t2(IO1)+△t3(IO1)+△t4(IO1)=10ms;
T2=△t1(IO2)+△t2(IO2)+△t3(IO2)+△t4(IO2)=9ms;T2=△t1(IO2)+△t2(IO2)+△t3(IO2)+△t4(IO2)=9ms;
T3=△t1(IO3)+△t2(IO3)+△t3(IO3)+△t4(IO3)=11ms;T3=△t1(IO3)+△t2(IO3)+△t3(IO3)+△t4(IO3)=11ms;
其中,T1>T2不满足T1<T2。Among them, T1>T2 does not satisfy T1<T2.
此时,分组配额模块213可获取到上述不同IO请求的响应时间。进一步的,分组配额模块213可确定上述不同IO请求的响应时间是否满足:高优先级的IO请求的响应时间少于低优先级的IO请求的响应时间。At this time, the group quota module 213 can obtain the response time of the above-mentioned different IO requests. Further, the grouping quota module 213 can determine whether the response time of the above-mentioned different IO requests is satisfied: the response time of the IO request of high priority is shorter than the response time of IO request of low priority.
可选的,在时延检测模块211确定各IO请求的响应时间后,时延检测模块211还可确定同一优先级的IO请求的平均响应时间。Optionally, after the delay detection module 211 determines the response time of each IO request, the delay detection module 211 may also determine the average response time of the IO requests of the same priority.
例如,按照调度队列Q中IO请求的顺序,存储设备217可首先处理上述5个A类IO请求。在每处理完一个IO请求后,存储设备217可生成该IO请求的处理结果。该处理结果中可包括存储设备217处理完该IO请求的时间戳(响应时刻)。此时,结合应用程序发其他该IO请求的发起时刻,时延检测模块211可确定电子设备100响应该IO请求的总耗时,即响应时间。在执行完上述5个A类IO请求后,时延检测模块211可确定A类IO请求的平均响应时间,记为AvgT1。For example, according to the order of the IO requests in the scheduling queue Q, the storage device 217 may first process the above-mentioned five A-type IO requests. After each IO request is processed, the storage device 217 may generate a processing result of the IO request. The processing result may include a time stamp (response time) when the storage device 217 finishes processing the IO request. At this time, in conjunction with the initiation time of the other IO request sent by the application, the delay detection module 211 can determine the total time it takes for the electronic device 100 to respond to the IO request, that is, the response time. After the above-mentioned five A-type IO requests are executed, the delay detection module 211 can determine the average response time of the A-type IO requests, which is recorded as AvgT1.
同样的,参考上述处理方法,电子设备100可依次确定B类IO请求和C类IO请求的平均响应时间,记为AvgT2、AvgT3。此时,电子设备100可确定A类IO请求、B类IO请求和C类IO请求的平均响应时间,分别为AvgT1、AvgT2和AvgT3。Similarly, with reference to the above processing method, the electronic device 100 can sequentially determine the average response time of the B-type IO request and the C-type IO request, which are recorded as AvgT2 and AvgT3. At this time, the electronic device 100 may determine the average response time of the A-type IO request, the B-type IO request and the C-type IO request, which are AvgT1, AvgT2 and AvgT3, respectively.
此时,分组配额模块213可获取到上述不同优先级的IO请求的平均响应时间。进一步的,分组配额模块213可确定上述平均响应时间是否满足:高优先级的IO请求的平均响应时间少于低优先级的IO请求的平均响应时间。At this time, the group quota module 213 can obtain the average response time of the above-mentioned IO requests with different priorities. Further, the grouping quota module 213 may determine whether the above-mentioned average response time satisfies: the average response time of high-priority IO requests is less than the average response time of low-priority IO requests.
以平均响应时间为例,在确定AvgT1、AvgT2、AvgT3后,电子设备100可根据上述平均响应时间调整分组配额模块213中的调度配比。Taking the average response time as an example, after determining AvgT1, AvgT2, and AvgT3, the electronic device 100 may adjust the scheduling ratio in the packet quota module 213 according to the above-mentioned average response time.
具体的,分组配额模块213可从时延检测模块211获取各优先级的IO请求的平均响应时间。然后,分组配额模块213可检查高优先级的IO请求的平均响应时间是否低于低优先级的IO请求的平均响应时间。当高优先级的IO请求的平均响应时间低于低优先级的IO请求的平均响应时间时,分组配额模块213可判断:当前处理高优先级IO请求的效率无法满足用户希望尽快响应高优先级IO请求的需求。此时,电子设备100需要调整IO资源的分配,将更多的IO资源提供给高优先级的IO请求,即提升调度配比中高优先级的比例,以进一步满足前台应用的需求,避免响应时间过长影响用户体验。Specifically, the grouping quota module 213 may obtain the average response time of the IO requests of each priority from the delay detection module 211 . Then, the packet quota module 213 may check whether the average response time of high-priority IO requests is lower than the average response time of low-priority IO requests. When the average response time of high-priority IO requests is lower than the average response time of low-priority IO requests, the group quota module 213 may determine that the current efficiency of processing high-priority IO requests cannot satisfy the user's desire to respond to high-priority requests as soon as possible IO request requirements. At this time, the electronic device 100 needs to adjust the allocation of IO resources and provide more IO resources to high-priority IO requests, that is, to increase the ratio of high-priority in the scheduling ratio to further meet the needs of foreground applications and avoid response time Too long affects the user experience.
例如,在调度配比为5:3:2的情况下,如果AvgT1>AvgT2,即A类IO请求的平均响应时间高于B类IO请求的平均响应时间,电子设备100可将上述调度配比调整为6:2:2。这样,电子设备100可由原来的1ms处理5个A类IO请求,提升到1ms处理6个A类IO请求。这样,在相同的单位时间内,电子设备100可处理更多的A类IO请求,那么,A类IO请求的平均响应时间可降低。For example, in the case where the scheduling ratio is 5:3:2, if AvgT1>AvgT2, that is, the average response time of class A IO requests is higher than the average response time of class B IO requests, the electronic device 100 can match the above scheduling ratio Adjusted to 6:2:2. In this way, the electronic device 100 can process 5 A-type IO requests from the original 1 ms, and can process 6 A-type IO requests in 1 ms. In this way, in the same unit time, the electronic device 100 can process more A-type IO requests, so the average response time of A-type IO requests can be reduced.
同样的,如果AvgT2>AvgT3,电子设备100可提升B类IO请求的IO资源占有比,降低C类IO请求的IO资源占有比,例如电子设备100可将上述调度配比(5:3:2)调整为5:4:1,使得电子设备100可以处理更多的B类IO请求。Similarly, if AvgT2>AvgT3, the electronic device 100 can increase the IO resource occupancy ratio of B-type IO requests and decrease the IO resource occupancy ratio of C-type IO requests. For example, the electronic device 100 can make the above scheduling ratio (5:3:2 ) is adjusted to 5:4:1, so that the electronic device 100 can handle more class B IO requests.
这样,当高优先级的IO请求的平均响应时间高于低优先级的IO请求的平均响应时间时,电子设备100可判断当前分配给高优先级IO请求的IO资源不能满足该高优先级IO请求的需要。因此,电子设备100可重新调整IO资源的分配,为高优先级IO请求分配更多的IO资源,以降低高优先级IO请求的平均响应时间。In this way, when the average response time of high-priority IO requests is higher than the average response time of low-priority IO requests, the electronic device 100 may determine that the IO resources currently allocated to high-priority IO requests cannot satisfy the high-priority IO requests request needs. Therefore, the electronic device 100 may readjust the allocation of IO resources, and allocate more IO resources for high-priority IO requests, so as to reduce the average response time of high-priority IO requests.
分组配额模块213还可根据单个IO请求的响应时间调整调度配比。例如,在分组配额模块213获取到IO1、IO2、IO3的响应时间T1、T2、T3后,在确定T1>T2后,分组配额模块213也可提升调度配比中IO1所述项的比值,具体可参考上述平均响应时间的调整方法,这里不再赘述。The grouping quota module 213 may also adjust the scheduling ratio according to the response time of a single IO request. For example, after the group quota module 213 obtains the response times T1, T2, and T3 of IO1, IO2, and IO3, and after determining that T1>T2, the group quota module 213 can also increase the ratio of the items described in IO1 in the scheduling ratio. Specifically, Refer to the above-mentioned adjustment method of the average response time, which will not be repeated here.
在一些实施例中,当关闭前台应用或前台应用对IO资源的需求明显降低时,A类IO请求的数量会降低。此时,电子设备100可重新调整调度配比,适当地降低A类IO请求对IO资源占有的比例,提升B类IO请求和C类IO请求的比例。In some embodiments, when the foreground application is closed or the foreground application's demand for IO resources is significantly reduced, the number of Class A IO requests will decrease. At this time, the electronic device 100 may readjust the scheduling ratio, appropriately reduce the proportion of the IO resource occupied by the A-type IO request, and increase the proportion of the B-type IO request and the C-type IO request.
例如,在电子设备100按6:2:2的调度配比获取各组IO请求的过程中,如果多次检测到A队列中的处于等待状态的A类IO请求的数量低于上述调度配比指示的数量时,电子设备100可降低A类IO请求对IO资源占有的比例,例如将调度配比恢复为5:3:2,或者进一步降低A类IO请求对IO资源占有的比例,例如将调度配比调整为4:4:2或4:3:3等等。本申请实施例对此不作限制。For example, in the process that the electronic device 100 obtains each group of IO requests according to the scheduling ratio of 6:2:2, if the number of Type A IO requests that are in the waiting state in the A queue is detected for many times lower than the above scheduling ratio When the number is indicated, the electronic device 100 can reduce the proportion of Class A IO requests to IO resources, for example, restore the scheduling ratio to 5:3:2, or further reduce the proportion of Class A IO requests to IO resources, for example, The scheduling ratio is adjusted to 4:4:2 or 4:3:3, etc. This embodiment of the present application does not limit this.
当然,在其他实施例中,当关闭前台应用或前台应用对IO资源的需求明显降低时,电子设备100也可继续使用前述调度配比,这里不再赘述。Of course, in other embodiments, when the foreground application is closed or the demand for IO resources of the foreground application is significantly reduced, the electronic device 100 may continue to use the aforementioned scheduling ratio, which will not be repeated here.
然后读写调度模块可按照新的调度配比,从缓冲队列A、B、C中获取不同优先级的IO请求。Then the read-write scheduling module can obtain IO requests with different priorities from the buffer queues A, B, and C according to the new scheduling ratio.
在其他实施例中,在获取时延检测模块211中的数据后,分组配额模块213可以通过检验各IO请求的响应时间是否符合自身的时延要求。当响应时间不满足自身的时延要求时,分组配额模块213也可调整不同优先级的调度配比。例如,IO1的响应时间为10ms,其自身的时延要求为5ms,即IO1的响应时间不满足自身的时延要求,这时,分组配额模块213可提升调度配比中IO1所属优先级的比值。In other embodiments, after acquiring the data in the delay detection module 211, the group quota module 213 may check whether the response time of each IO request meets its own delay requirement. When the response time does not meet its own delay requirement, the grouping quota module 213 can also adjust the scheduling ratio of different priorities. For example, the response time of IO1 is 10ms, and its own delay requirement is 5ms, that is, the response time of IO1 does not meet its own delay requirement. At this time, the group quota module 213 can increase the priority ratio of IO1 in the scheduling ratio. .
可以理解的是,本发明实施例示意的结构并不构成对电子设备100的具体限定。在本申请另一些实施例中,电子设备100可以包括比图示更多或更少的层级结构和功能模块,或者组合某些层级结构和功能模块,或者拆分某些层级结构和功能模块,或者不同的层级结构和功能模块的布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。It can be understood that, the structures illustrated in the embodiments of the present invention do not constitute a specific limitation on the electronic device 100 . In other embodiments of the present application, the electronic device 100 may include more or less hierarchical structures and functional modules than shown, or combine some hierarchical structures and functional modules, or split some hierarchical structures and functional modules, Or different hierarchies and arrangements of functional modules. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
图5A-图5B示例性示出了电子设备100上运行应用的用户界面。5A-5B exemplarily show user interfaces of applications running on the electronic device 100 .
图5A示出了电子设备100展示已安装应用程序的用户界面。如图5A所示,该用户界面可包括状态栏413、一个或多个应用程序图标412,常用应用程序图标托盘413、页面指示符414等等。FIG. 5A shows the user interface of the electronic device 100 presenting an installed application. As shown in FIG. 5A, the user interface may include a
其中,状态栏411可包括:移动通信信号(又可称为蜂窝信号)的一个或多个信号强度指示符、高保真无线通信(wi re less fide l ity,Wi-Fi)信号的一个或多个信号强度指示符,电池状态指示符、时间指示符等。Wherein, the
一个或多个应用程序图标412可包括:设置(Setting)、应用市场(APP store)、图库(Photos)、浏览器(Browser)等应用程序的图标。当检测到作用于上述任一图标的用户操作后,电子设备100可运行该图标指示的应用程序。例如,当检测到作用于图库(Photos)应用程序的图标的用户操作后,上述操作例如点击操作,电子设备100可运行图库应用程序。The one or
常用应用程序图标托盘413中可显示一个或多个应用程序的图标。上述一个或多个应用程序为用户设置的用户经常实用的应用程序,例如相机、通讯录、电话、信息等应用程序。常用应用程序图标托盘413中的应用程序图标在页面切换时保持显示。上述托盘图标是可选的,本申请实施例对此不作限定。页面指示符414可用于指示可用于指示当前显示的页面与其他页面的位置关系。Icons of one or more applications may be displayed in the frequently used
一个或多个应用程序图标412可分布在多个页面,页面指示符414还可以用于指示用户当前浏览的是哪一个页面中的应用程序。用户可以左右滑动其他应用程序图标的区域,来浏览其他页面中的应用程序图标。One or
在一些实施例中,图5A所示的用户界面可以为电子设备100展示应用程序的主页面(home)。可以理解的是,图5A仅仅示例性示出了电子设备100的一个可能的用户界面,不应构成对本申请实施例的限定。In some embodiments, the user interface shown in FIG. 5A may present the home page of the application for the electronic device 100 . It can be understood that FIG. 5A only exemplarily shows a possible user interface of the electronic device 100 , and should not constitute a limitation to the embodiments of the present application.
响应于作用于在任一应用程序图标的用户操作,电子设备100可运行该图标指示的应用程序。在运行图库应用程序的过程中,该应用程序可发起多个IO请求。上述IO请求包括获取该应用程序运行所必需的计算机程序代码、系统数据和用户数据的IO请求。In response to a user operation acting on any application icon, the electronic device 100 may execute the application indicated by the icon. In the process of running the gallery application, the application can initiate multiple IO requests. The above IO requests include IO requests to obtain computer program codes, system data and user data necessary for running the application.
图5B示出了电子设备100运行图库应用程序的一个用户界面。如图5B所示,该用户界面包括搜索栏421、一个或多个相册的图标422、菜单栏423等等。FIG. 5B shows a user interface of the electronic device 100 running the gallery application. As shown in FIG. 5B, the user interface includes a
搜索栏421可用于搜索图片。例如,用户可在搜索栏421中输入关键字“花”。电子设备100可检测到作用于搜索栏421的用户操作,响应于该操作,电子设备100可在图库存储的所有图片中查找图片内容包括“花”的图片。The
一个或多个相册的图标422可表示一个或多个存储图像数据的文件夹。如图5B所示,相册包括相机(Cmera)、截屏(ScreenShot)、下载(Download)等等。相册图标中显示的图像可以为该相册中的任意一张图片。One or
菜单栏423可包括一个或多个控件,例如照片控件、相册控件、时刻控件。上述控件可为用户提供按不同的排列方式展示图库中存储的图像的功能。例如,当检测到作用于时刻控件上的用户操作后,电子设备100可按照各图像的时间的先后顺序展示图库中的全部图像。
在电子设备100运行图库应用程序的过程中,图库应用程序可发起多个IO请求。响应于上述多个IO请求,图库应用程序可获取图库应用程序的计算机程序代码、系统数据和用户数据。During the process of running the gallery application on the electronic device 100, the gallery application may initiate multiple IO requests. In response to the above-mentioned multiple IO requests, the gallery application may obtain computer program code, system data, and user data of the gallery application.
例如,当图库应用程序需要显示图5B所示的用户界面时,图库应用程序可发起一个IO请求读取该用户界面的代码,包括页面布局的代码。在显示图5B所示的用户界面时,图库应用程序可发起一个读取控件图标资源的IO请求。另外,图库应用程序可发起读取存储设备中存储的图像的IO请求。这样,图5B所示的用户界面中可显示电子设备100上保存的众多图片、动态图片、视频等图像数据。For example, when the gallery application needs to display the user interface shown in FIG. 5B , the gallery application can initiate an IO request to read the code of the user interface, including the page layout code. When the user interface shown in FIG. 5B is displayed, the gallery application may initiate an IO request to read the control icon resource. In addition, the gallery application can initiate IO requests to read images stored in the storage device. In this way, the user interface shown in FIG. 5B can display image data such as numerous pictures, dynamic pictures, and videos saved on the electronic device 100 .
电子设备100可检测到多个用户点击某一应用程序图标的操作,响应于上述用户操作,电子设备100可运行多个应用程序。对于上述多个应用程序而言,一些应用程序是用户正在操作的应用程序,即前台应用,而另一些应用程序则是后台运行的应用程序,即后台应用。同时,电子设备100还运行有一些为前台应用和/或后台应用提供服务的系统应用、进程或服务。The electronic device 100 may detect operations of multiple users clicking on an icon of an application program, and in response to the above user operations, the electronic device 100 may execute multiple application programs. For the above-mentioned multiple applications, some applications are applications that the user is operating, that is, foreground applications, while other applications are applications that are running in the background, that is, background applications. Meanwhile, the electronic device 100 also runs some system applications, processes or services that provide services for foreground applications and/or background applications.
在显示图5B所示的用户界面的过程中,电子设备100可检测到某一用户操作,响应于该操作,电子设备100可显示正在运行的应用程序。例如,如图5B所示,电子设备100可检测到用户从屏幕底部向上滑动的操作。响应于上述操作,电子设备100可显示图5C所示的用户界面。In the process of displaying the user interface shown in FIG. 5B , the electronic device 100 may detect a certain user operation, and in response to the operation, the electronic device 100 may display a running application. For example, as shown in FIG. 5B , the electronic device 100 may detect that the user swipes up from the bottom of the screen. In response to the above operations, the electronic device 100 may display the user interface shown in FIG. 5C .
如图5C所示,该用户界面包括页面431。页面431可表示响应于前述图5A、图5B所示的用户操作运行的图库应用(Photos)。此外,该用户界面还包括页面432、页面433。页面432可表示正在运行的浏览器应用(Browser);页面433可表示正在运行的设置应用(Settings)。As shown in FIG. 5C , the user interface includes
不限于上述浏览器应用、设置应用,电子设备100还可运行其他更多的应用程序,即图5C所示的用户界面还可显示有更多的页面。Not limited to the above browser application and setting application, the electronic device 100 can also run other more application programs, that is, the user interface shown in FIG. 5C can also display more pages.
上述图库应用(用户正在直接操作操作的应用程序)可称为前台应用。上述浏览器应用、设置应用等其他不是用户当前正在直接操作的应用程序可称为后台应用。The above-mentioned gallery application (the application that the user is directly operating) may be referred to as a foreground application. The above browser application, setting application and other applications that are not currently directly operated by the user may be referred to as background applications.
不同IO请求的时延要求可能不同。通常情况下,时延忍耐度低的应用程序发起的IO请求的时延要求较高。前台应用的时延忍耐度较低。因此,前台应用发起的IO请求的时延要求高,即电子设备100处理此类IO请求的优先级高。电子设备100需要尽快地处理这一类IO请求。相比于上述前台应用发起的IO请求,后台应用发起的IO请求的处理优先级比较低。例如,上述图库应用发起的IO请求的优先级要高于上述浏览器应用、设置应用发起的IO请求。The latency requirements of different IO requests may be different. Generally, IO requests initiated by applications with low latency tolerance have higher latency requirements. The latency tolerance of foreground applications is low. Therefore, the latency requirement of the IO request initiated by the foreground application is high, that is, the electronic device 100 has a high priority for processing such IO request. The electronic device 100 needs to process this type of IO request as quickly as possible. Compared with the IO request initiated by the above-mentioned foreground application, the processing priority of the IO request initiated by the background application is relatively low. For example, the priority of the IO request initiated by the above gallery application is higher than that of the IO request initiated by the above browser application and setting application.
这样,当接受到多个IO请求后,电子设备100可根据不同IO请求的处理优先级,按优先级从高到低依次处理上述多个IO请求,以尽可能使时延要求不同的IO请求均能在各自时延要求内得到电子设备100的响应。In this way, after receiving multiple IO requests, the electronic device 100 can process the above multiple IO requests in order from high to low according to the processing priorities of different IO requests, so as to make the IO requests with different delay requirements as much as possible Both can obtain the response of the electronic device 100 within the respective delay requirements.
图6示例性示出了电子设备100实施本申请实施例提供的输入输出处理方法的流程图。FIG. 6 exemplarily shows a flowchart of the electronic device 100 implementing the input and output processing method provided by the embodiment of the present application.
S201:电子设备100按预设的调度配比处理不同优先级的IO请求。S201: The electronic device 100 processes IO requests of different priorities according to a preset scheduling ratio.
在完成初始化后,电子设备100可按照预设的调度配比为不同优先级的IO请求分配IO资源,即确定一个处理周期内电子设备100处理不同优先级的IO请求的数量。After completing the initialization, the electronic device 100 may allocate IO resources to IO requests of different priorities according to a preset scheduling ratio, that is, to determine the number of IO requests of different priorities processed by the electronic device 100 in one processing cycle.
具体的,结合图3A,应用层发起的IO请求可被下发到内核层Block。一般的,Block会同时接受到多个IO请求。在接收到IO请求后,电子设备100可确定该IO请求的时延要求。对于时延要求较高的IO请求,即要求尽快响应的IO请求,Block会优先将该IO请求下发到该IO请求目标存储的存储器驱动(storage driver)。Specifically, with reference to FIG. 3A , the IO request initiated by the application layer can be delivered to the kernel layer Block. Generally, Block will receive multiple IO requests at the same time. After receiving the IO request, the electronic device 100 may determine the latency requirement of the IO request. For IO requests with high latency requirements, that is, IO requests that require an early response, Block will give priority to delivering the IO request to the storage driver of the target storage of the IO request.
为了避免低优先级的IO请求一直被高优先级的IO请求抢占IO资源,因此,电子设备100可按照预设的调度配比处理不同优先级的IO请求,以保障低优先级的IO请求不会被堵塞。In order to prevent low-priority IO requests from always preempting IO resources by high-priority IO requests, the electronic device 100 can process IO requests with different priorities according to a preset scheduling ratio to ensure that low-priority IO requests do not will be blocked.
例如,如图4A所示的,在单位时间内,电子设备100可依次处理5个高优先级(A)的IO请求、3个中等优先级(B)的IO请求、2个低优先级(C)的IO请求。在该单位时间内,在电子设备100处理完高优先级的IO请求后,即使Block中还存在其他高优先级IO请求,电子设备100也会先处理部分中等优先级和低优先级的IO请求,以避免中等优先级和低优先级的IO请求被阻塞,从而导致发起该IO请求的应用程序或进程被卡死。For example, as shown in FIG. 4A , within a unit time, the electronic device 100 can sequentially process 5 high-priority (A) IO requests, 3 medium-priority (B) IO requests, and 2 low-priority (B) IO requests. C) IO request. Within the unit time, after the electronic device 100 processes the high-priority IO requests, even if there are other high-priority IO requests in the block, the electronic device 100 will first process some medium-priority and low-priority IO requests , so as to avoid blocking of IO requests with medium and low priorities, causing the application or process that initiated the IO request to be stuck.
在保证较低优先级的IO请求不被堵塞的情况下,电子设备100会尽可能的将更多的IO资源分配给高优先级的IO请求。这是往往是因为发起高优先级IO请求的应用程序或进程多为与用户操作直接相关。如果不尽可能保证高优先级IO请求有较高的响应效率,则会极大地降低用户体验。Under the condition that IO requests with lower priority are not blocked, the electronic device 100 will allocate more IO resources to IO requests with high priority as much as possible. This is often because the applications or processes that initiate high-priority IO requests are mostly directly related to user operations. If high-priority IO requests are not guaranteed to have high response efficiency as much as possible, the user experience will be greatly reduced.
S202:电子设备100实时更新不同优先级的IO请求的平均响应时间。S202: The electronic device 100 updates the average response time of IO requests of different priorities in real time.
在按照预设的调度配比处理不同优先级的IO请求的过程中,电子设备100可实时的检测各优先级IO请求的平均响应时间。In the process of processing IO requests of different priorities according to the preset scheduling ratio, the electronic device 100 can detect the average response time of the IO requests of each priority in real time.
如图3A所示,电子设备100可预设有时延检测模块211。时延检测模块211可在电子设备100处理不同优先级的IO请求的过程中,计算同一优先级的IO请求的平均响应时间。As shown in FIG. 3A , the electronic device 100 may be preset with a delay detection module 211 . The delay detection module 211 can calculate the average response time of the IO requests of the same priority during the process of the electronic device 100 processing the IO requests of different priorities.
具体的,在应用层应用程序或进程发起一个IO请求后,时延检测模块211可确定上述应用程序或进程发起该IO请求的时间戳,标记为该IO请求的发起时刻。当电子设备100的存储设备依照该IO请求的指示,执行了与该IO请求对应的输入输出操作后,应用层可收到设备层返回的处理结果。此时,时延检测模块211可依据上述处理结果确定电子设备100处理完该IO请求的时刻。例如,时延检测模块211可确定应用层接收到上述处理结果的时间为电子设备100处理完该IO请求的时刻(响应时刻)。根据上述发起时刻和响应时刻,时延检测模块211可确定电子设备100处理该IO请求的响应时间。Specifically, after an application-layer application or process initiates an IO request, the delay detection module 211 may determine the time stamp at which the above-mentioned application or process initiated the IO request, and mark it as the initiating time of the IO request. After the storage device of the electronic device 100 performs the input and output operations corresponding to the IO request according to the instruction of the IO request, the application layer can receive the processing result returned by the device layer. At this time, the delay detection module 211 can determine the time when the electronic device 100 finishes processing the IO request according to the above processing result. For example, the delay detection module 211 may determine that the time when the application layer receives the above processing result is the time when the electronic device 100 finishes processing the IO request (response time). According to the above-mentioned initiation time and response time, the delay detection module 211 can determine the response time for the electronic device 100 to process the IO request.
结合图4A所示的示意图,在电子设备100执行调度队列Q中优先级为A的5个IO请求的过程中,时延检测模块211可按照上述方法确定这5个IO请求的响应时间。然后,时延检测模块211可确定这5个优先级为A的IO请求的平均响应时间(AvgT1)。With reference to the schematic diagram shown in FIG. 4A , when the electronic device 100 executes five IO requests with priority A in the scheduling queue Q, the delay detection module 211 can determine the response time of the five IO requests according to the above method. Then, the delay detection module 211 may determine the average response time (AvgT1 ) of the five IO requests with priority A.
同样的,在执行调度队列Q中优先级为B和C的IO请求时,时延检测模块211可依次确定优先级为B的IO请求的平均响应时间(AvgT2),和优先级为C的IO请求的平均响应时间(AvgT3)。一般的,AvgT1<AvgT2<AvgT3。Similarly, when executing the IO requests with priorities B and C in the scheduling queue Q, the delay detection module 211 can sequentially determine the average response time (AvgT2) of the IO requests with the priority B, and the IO requests with the priority C in turn. Average response time for requests (AvgT3). Generally, AvgT1<AvgT2<AvgT3.
S203:电子设备100根据平均响应时间确定是否调整调度配比。S203: The electronic device 100 determines whether to adjust the scheduling ratio according to the average response time.
在确定不同优先级的IO请求的平均响应时间后,电子设备100可根据上述平均响应时间判断高优先级的IO请求的平均响应时间是否高于低优先级的IO请求的平均响应时间。After determining the average response time of IO requests of different priorities, the electronic device 100 may determine whether the average response time of high-priority IO requests is higher than the average response time of low-priority IO requests according to the above average response time.
当高优先级的IO请求的平均响应时间高于低优先级的IO请求的平均响应时间时,电子设备100可确定系统当前分配给高优先级IO请求的IO资源不能满足高先级IO请求的需求。因此,电子设备100需要为高优先级IO请求分配更多的IO资源,以提升高优先级IO请求的平均响应时间。When the average response time of the high-priority IO requests is higher than the average response time of the low-priority IO requests, the electronic device 100 may determine that the IO resources currently allocated by the system to the high-priority IO requests cannot satisfy the high-priority IO requests. need. Therefore, the electronic device 100 needs to allocate more IO resources for high-priority IO requests to improve the average response time of the high-priority IO requests.
结合图4A所示的示意图,如果AvgT1>AvgT2,这说明电子设备处理A类IO请求的平均响应时间长于电子设备处理B类IO请求的平均响应时间。这与期望的A类IO请求的平均响应时间最短不一致。体现在应用程序就是:电子设备100处理系统类应用程序发起的IO请求的平均响应时间要比处理前台类应用程序发起的IO请求的平均响应时间短。这不符合用户的预期。With reference to the schematic diagram shown in FIG. 4A , if AvgT1 >AvgT2 , it means that the average response time of the electronic device for processing Type A IO requests is longer than the average response time for the electronic device to process Type B IO requests. This is inconsistent with the expected shortest average response time for Class A IO requests. The application program is: the average response time of the electronic device 100 for processing IO requests initiated by system applications is shorter than the average response time for processing IO requests initiated by foreground applications. This is not what the user expected.
因此,当出现上述情况时,电子设备100可为A类IO请求分配更多的IO资源,以提升高优先级IO请求的平均响应时间。具体的,电子设备100可提升A类IO请求调度配比,使电子设备100在单位时间内处理更多的A类IO请求。这样,A类IO请求的平均响应时间可降低。Therefore, when the above situation occurs, the electronic device 100 may allocate more IO resources for the A-type IO request, so as to improve the average response time of the high-priority IO request. Specifically, the electronic device 100 can increase the scheduling ratio of class A IO requests, so that the electronic device 100 can process more class A IO requests per unit time. In this way, the average response time for Class A IO requests can be reduced.
例如,在调度配比为5:3:2的场景下,1ms处理5个A类IO请求、3个B类IO请求、2个C类IO请求的场景下,若AvgT2<AvgT1<AvgT3,则电子设备100可将A类IO请求的调度配比由原来的5提升到6,相应地将B类IO请求的比列由原来的3降为2,即调整后的调度配比为6:2:2。进一步的,若想为A类IO请求提供更多的IO资源,电子设备100还可将调度配比调整为7:2:1。For example, in the scenario where the scheduling ratio is 5:3:2, 5 class A IO requests, 3 class B IO requests, and 2 class C IO requests are processed in 1 ms, if AvgT2<AvgT1<AvgT3, then The electronic device 100 can increase the scheduling ratio of Class A IO requests from 5 to 6, and correspondingly reduce the ratio of Class B IO requests from 3 to 2, that is, the adjusted scheduling ratio is 6:2 :2. Further, to provide more IO resources for class A IO requests, the electronic device 100 may also adjust the scheduling ratio to 7:2:1.
同样的,如果AvgT1<AvgT3<AvgT2,电子设备100可以将C类IO请求的部分IO资源分配给B类IO请求,提升B类IO请求的IO资源占有率,进而提升电子设备100处理B类IO请求的效率,降低B类IO请求的平均响应时间。Similarly, if AvgT1<AvgT3<AvgT2, the electronic device 100 can allocate part of the IO resources of the C-type IO request to the B-type IO request, so as to increase the IO resource occupancy rate of the B-type IO request, thereby improving the electronic device 100 to handle the B-type IO request. The efficiency of the request reduces the average response time of class B IO requests.
这里,电子设备100不会调整高优先级的IO资源占有率。例如,电子设备100不会将属于A类IO请求的IO资源分配给B类IO请求。这是因为:降低高优先级的IO请求的IO资源占有率,并提升低优先级的IO请求的IO资源占有率,这极有可能导致高优先级的IO请求的平均响应时间反而低于低优先级的IO请求的平均响应时间。Here, the electronic device 100 does not adjust the high-priority IO resource occupancy rate. For example, the electronic device 100 does not allocate IO resources belonging to class A IO requests to class B IO requests. This is because: reducing the IO resource occupancy rate of high-priority IO requests and increasing the IO resource occupancy rate of low-priority IO requests, it is very likely that the average response time of high-priority IO requests will be lower than that of low-priority IO requests. Average response time for priority IO requests.
可以理解的,若高优先级的IO请求的平均响应时间均低于低优先级的IO请求的平均响应时间,则电子设备100可保持当前调度配比。It can be understood that, if the average response time of high-priority IO requests is lower than the average response time of low-priority IO requests, the electronic device 100 may maintain the current scheduling ratio.
在一些实施例中,电子设备100也可通过单个高优先级的IO请求的响应时间是否低于低优先级的IO请求的响应时间来确定是否调整预设的调度配比。在一些实施例中,电子设备100还可使用高优先级IO请求中最长的响应时间与低优先级IO请求的最短响应时间做比较。本申请实施例对此不作限制。In some embodiments, the electronic device 100 may also determine whether to adjust the preset scheduling ratio according to whether the response time of a single high-priority IO request is lower than the response time of a low-priority IO request. In some embodiments, the electronic device 100 may also use the longest response time of the high-priority IO requests to compare with the shortest response time of the low-priority IO requests. This embodiment of the present application does not limit this.
S204:电子设备100检查中央处理器的负载,确定是否限制低优先级IO请求的返回速率。S204: The electronic device 100 checks the load of the central processing unit to determine whether to limit the return rate of low-priority IO requests.
可选的,在根据平均响应时间调整调度配比的同时,电子设备100还可检查中央处理器的负载,确定是否限制低优先级IO请求的返回速率。Optionally, while adjusting the scheduling ratio according to the average response time, the electronic device 100 may also check the load of the central processing unit to determine whether to limit the return rate of low-priority IO requests.
电子设备100可周期性地检测中央处理器(central processing unit,CPU)的负载,判断CPU是否处于繁忙。若CPU繁忙,则电子设备100可限制低优先级IO请求的处理结果的返回速率。The electronic device 100 can periodically detect the load of a central processing unit (CPU) to determine whether the CPU is busy. If the CPU is busy, the electronic device 100 may limit the return rate of the processing result of the low-priority IO request.
这样,在未收到电子设备100处理低优先级IO请求的处理结果之前,发起该IO请求的应用程序或进程的活跃度会降低。进一步的,该应用程序或进程对CPU资源占用率会降低。因此,电子设备100可以为高优先级的IO请求提供更多的CPU资源,从而提升电子设备100处理高优先级的IO请求效率。In this way, before the electronic device 100 receives the processing result of processing the low-priority IO request, the activity of the application or process that initiates the IO request will decrease. Further, the CPU resource occupancy rate of the application or process will be reduced. Therefore, the electronic device 100 can provide more CPU resources for high-priority IO requests, thereby improving the efficiency of the electronic device 100 in processing high-priority IO requests.
电子设备100内可预设有负载阈值。电子设备100可周期性的获取CPU的当前负载。然后,电子设备100将上述当前负载与预设的负载阈值对比。若上述当前负载未超过负载阈值,则电子设备可确认CPU不繁忙。此时,电子设备100可不限制低优先级IO请求的返回速率。若上述当前负载超过负载阈值,则电子设备可确认CPU繁忙。此时,电子设备100可限制低优先级IO请求的返回速率,降低优先级应用程序或进程的活跃度,为高优先级应用程序或进程提供更多的CPU资源。A load threshold may be preset in the electronic device 100 . The electronic device 100 may periodically acquire the current load of the CPU. Then, the electronic device 100 compares the above-mentioned current load with a preset load threshold. If the above-mentioned current load does not exceed the load threshold, the electronic device may confirm that the CPU is not busy. At this time, the electronic device 100 may not limit the return rate of low-priority IO requests. If the above-mentioned current load exceeds the load threshold, the electronic device may confirm that the CPU is busy. At this time, the electronic device 100 can limit the return rate of low-priority IO requests, reduce the activity of priority applications or processes, and provide more CPU resources for high-priority applications or processes.
具体的,电子设备100确定是否限制低优先级IO处理结果的返回速率,确定限制哪些优先级的IO处理结果的返回速率的过程,可参考图4C的介绍,这里不再赘述。Specifically, the electronic device 100 determines whether to limit the return rate of low-priority IO processing results, and the process of determining which priorities to limit the return rate of IO processing results can refer to the introduction in FIG.
以IO3(优先级IO请求)的处理结果为例,在处理完IO3后,电子设备100可生成该IO请求的处理结果。该处理结果可按原路径返回到Block。此时,Block可延迟一段时间后,例如延迟0.1ms,再将上述处理结果返回给到应用层发起该IO请求的APP2。Taking the processing result of IO3 (priority IO request) as an example, after processing IO3, the electronic device 100 may generate the processing result of the IO request. The processing result can be returned to Block according to the original path. At this time, the Block can be delayed for a period of time, for example, by 0.1 ms, and then return the above processing result to the APP2 that initiated the IO request at the application layer.
由于APP2接收到IO3的处理结果的时间延迟了,那么,APP2的运行状态也相应地放缓,即APP2的活跃度降低。这样,APP2对CPU资源的占用也会降低,从而使得前台应用(例如APP1)可以获得更多的CPU资源,进而提升电子设备100处理APP1的效率。Since the time for APP2 to receive the processing result of IO3 is delayed, the running state of APP2 is also slowed down accordingly, that is, the activity of APP2 is reduced. In this way, the occupation of CPU resources by APP2 is also reduced, so that the foreground application (eg, APP1 ) can obtain more CPU resources, thereby improving the efficiency of the electronic device 100 in processing APP1 .
此外,从返回端处理限制IO请求的返回速率不仅可以降低低优先级应用程序或进程的活跃度,使得前台应用程序或进程获得更多的CPU资源,还可以充分利用IO资源。In addition, processing from the return side to limit the return rate of IO requests can not only reduce the activity of low-priority applications or processes, so that foreground applications or processes can obtain more CPU resources, but also make full use of IO resources.
具体的,如果在检测到应用程序或进程发起的低优先级的IO请求后,电子设备100直接限制该IO请求下发到Block、存储设备的速率。那么,在IO资源不紧张的情况下,即Block、存储设备接收到的IO请求的数量未达到自身处理的最大限额,IO资源的利用率会明显降低,从而在一定程度上造成了IO资源的浪费。Specifically, after detecting a low-priority IO request initiated by an application or process, the electronic device 100 directly limits the rate at which the IO request is sent to the block or storage device. Then, in the case where IO resources are not tight, that is, the number of IO requests received by blocks and storage devices does not reach the maximum limit of their own processing, the utilization rate of IO resources will be significantly reduced, which will cause IO resources to a certain extent. waste.
在本申请实施例中,由于电子设备100是在响应低优先级的IO请求后,限制该IO请求的返回速率,因此,该方法不仅可以充分利用现有的IO资源,避免IO资源的浪费。In the embodiment of the present application, since the electronic device 100 limits the return rate of the IO request after responding to the low-priority IO request, this method can not only make full use of the existing IO resources, but also avoid the waste of the IO resources.
可以理解的,在S202所述的过程中,电子设备100确定不同优先级的IO请求的平均响应时间与S204中返回控制模块214的返回限制策略有关。在本申请实施例中,在时延检测模块211检测一个周期内不同优先级的IO请求的平均响应时间的过程中,分组配额模块213使用的调度配比和返回控制模块214使用的返回控制策略实际是依赖上一次检测到的不同优先级IO请求的平均响应时间确定的。It can be understood that, in the process described in S202, the average response time of the IO requests with different priorities determined by the electronic device 100 is related to the return restriction policy of the return control module 214 in S204. In this embodiment of the present application, in the process of the delay detection module 211 detecting the average response time of IO requests with different priorities in a cycle, the scheduling ratio used by the group quota module 213 and the return control strategy used by the return control module 214 It is actually determined by the average response time of IO requests of different priorities detected last time.
S205:电子设备100按照调整后的调度配比和返回速率,继续处理不同优先级的IO请求。S205: The electronic device 100 continues to process IO requests of different priorities according to the adjusted scheduling ratio and return rate.
在确定新的调度配比后,以及确定是否限制低优先级的IO请求的返回速率后,即新的调度配比和新的返回控制策略。电子设备100可按新的策略,即新的调度配比和IO请求的返回速率处理后续等待处理的IO请求。After determining the new scheduling ratio and determining whether to limit the return rate of low-priority IO requests, that is, the new scheduling ratio and the new return control strategy. The electronic device 100 can process subsequent IO requests waiting to be processed according to a new policy, that is, a new scheduling ratio and a return rate of IO requests.
例如,在将调度配比变更为6:2:2的场景下,电子设备100可在1ms内处理6个A类IO请求、2个B类IO请求、2个C类IO请求。若CPU负载过高,电子设备100还可限制处理B类IO请求,和/或,C类IO请求后的处理结果的返回速率,例如延迟0.1ms上传上述低优先级的处理结果等等。然后,时延检测模块211可重新计算个IO请求的响应时间,以及同一优先级的IO请求的平均响应时间,以指导分组匹配模块213是否再次更新调度配比。For example, in a scenario where the scheduling ratio is changed to 6:2:2, the electronic device 100 can process 6 class A IO requests, 2 class B IO requests, and 2 class C IO requests within 1 ms. If the CPU load is too high, the electronic device 100 may also limit the processing result of the type B IO request and/or the return rate of the processing result after the type C IO request, for example, delay 0.1ms to upload the above-mentioned low-priority processing result and so on. Then, the delay detection module 211 can recalculate the response time of each IO request and the average response time of the IO requests of the same priority, so as to guide the group matching module 213 whether to update the scheduling ratio again.
在一些实施例实施例中,电子设备100也可间隔一个或多个周期再调整调度配比和返回控制策略。本申请实施例对此不作限制。In some embodiments, the electronic device 100 may also readjust the scheduling ratio and the return control strategy at intervals of one or more cycles. This embodiment of the present application does not limit this.
实施本申请实施例提供的输入输出请求处理方法,电子设备100可实时地检测不同优先级的IO请求的平均响应时间。当高优先级的IO请求的平均响应时间高于低优先级的IO请求的平均响应时间时,电子设备100可及时调整IO资源的配比,从而降低高优先级的IO请求的平均响应时间,避免响应时间过长影响用户使用体验。By implementing the input and output request processing method provided by the embodiment of the present application, the electronic device 100 can detect the average response time of IO requests of different priorities in real time. When the average response time of high-priority IO requests is higher than the average response time of low-priority IO requests, the electronic device 100 can adjust the ratio of IO resources in time, thereby reducing the average response time of high-priority IO requests. Avoid too long response time to affect the user experience.
除了直接提升高优先级的IO请求的IO资源的占有率外,电子设备100还可通过限制低优先级的IO请求的返回速率,来降低时延要求低的应用程序的活跃度,从而为时延要求高的应用程序提供更多的CPU资源,提升电子设备100处理该应用程序请求的效率。同时,从返回端限制低优先级的IO请求还可避免IO资源的浪费。In addition to directly increasing the occupancy rate of IO resources of high-priority IO requests, the electronic device 100 can also reduce the activity of applications with low-latency requirements by limiting the return rate of low-priority IO requests, so as to save time Applications with high latency requirements provide more CPU resources to improve the efficiency of the electronic device 100 in processing the application requests. At the same time, limiting low-priority IO requests from the return side can also avoid wasting IO resources.
在本申请实施例中:In the examples of this application:
应用层发起的一个IO请求,以及该请求指示的输入或读出操作可称为一个IO业务。An IO request initiated by the application layer and the input or read operation indicated by the request can be called an IO service.
在S201中,读写调度模块215按预设的调度配比从缓存队列A、B、C中获取的优先级为A、B、C的多个IO业务可称为“从多个队列中取出多个IO业务”。In S201, the multiple IO services with priorities A, B, and C obtained by the read-write scheduling module 215 from the cache queues A, B, and C according to the preset scheduling ratio may be referred to as "fetching from multiple queues" Multiple IO Services".
在S202中,电子设备比较的不同优先级的平均响应时间可作为“一个IO业务的处理时延”。In S202, the average response time of different priorities compared by the electronic devices can be regarded as "the processing delay of one IO service".
在S204中,将低优先级IO业务的延迟0.1ms后返回发起该IO业务的应用程序可称为“将低IO处理优先级的IO业务的处理结果滞留第一时长后,返回给发起所述低IO处理优先级的IO业务的应用程序”。In S204, returning the low-priority IO service to the application that initiated the IO service after a delay of 0.1 ms may be referred to as "returning the processing result of the IO service with the low IO processing priority to the initiating Low IO processing priority IO business applications".
在图4C中,阈值H1可称为第一阈值。In FIG. 4C, the threshold H1 may be referred to as a first threshold.
在S201中,调度配比5:3:2可称为第一比值;在S203中,调度配比6:2:2可称为第二比值。In S201, the scheduling ratio of 5:3:2 may be referred to as the first ratio; in S203, the scheduling ratio of 6:2:2 may be referred to as the second ratio.
在本申请的说明书和所附权利要求书中所使用的那样,单数表达形式“一个”、“一种”、“所述”、“上述”、“该”和“这一”旨在也包括复数表达形式,除非其上下文中明确地有相反指示。还应当理解,本申请中使用的术语“和/或”是指并包含一个或多个所列出项目的任何或所有可能组合。上述实施例中所用,根据上下文,术语“当…时”可以被解释为意思是“如果…”或“在…后”或“响应于确定…”或“响应于检测到…”。类似地,根据上下文,短语“在确定…时”或“如果检测到(所陈述的条件或事件)”可以被解释为意思是“如果确定…”或“响应于确定…”或“在检测到(所陈述的条件或事件)时”或“响应于检测到(所陈述的条件或事件)”。As used in the specification of this application and the appended claims, the singular expressions "a," "an," "the," "above," "the," and "the" are intended to also include Plural expressions unless the context clearly dictates otherwise. It will also be understood that, as used in this application, the term "and/or" refers to and includes any and all possible combinations of one or more of the listed items. As used in the above embodiments, the term "when" may be interpreted to mean "if" or "after" or "in response to determining..." or "in response to detecting..." depending on the context. Similarly, depending on the context, the phrases "in determining..." or "if detecting (the stated condition or event)" can be interpreted to mean "if determining..." or "in response to determining..." or "on detecting (the stated condition or event)" or "in response to the detection of (the stated condition or event)".
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线)或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如DVD)、或者半导体介质(例如固态硬盘)等。In the above-mentioned embodiments, it may be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented in software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present application are generated. The computer may be a general purpose computer, special purpose computer, computer network, or other programmable device. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be downloaded from a website site, computer, server, or data center Transmission to another website site, computer, server, or data center by wire (eg, coaxial cable, optical fiber, digital subscriber line) or wireless (eg, infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, a data center, or the like that includes an integration of one or more available media. The usable media may be magnetic media (eg, floppy disks, hard disks, magnetic tapes), optical media (eg, DVDs), or semiconductor media (eg, solid state drives), and the like.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,该流程可以由计算机程序来指令相关的硬件完成,该程序可存储于计算机可读取存储介质中,该程序在执行时,可包括如上述各方法实施例的流程。而前述的存储介质包括:ROM或随机存储记忆体RAM、磁碟或者光盘等各种可存储程序代码的介质。Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be implemented. The process can be completed by instructing the relevant hardware by a computer program, and the program can be stored in a computer-readable storage medium. When the program is executed , which may include the processes of the foregoing method embodiments. The aforementioned storage medium includes: ROM or random storage memory RAM, magnetic disk or optical disk and other mediums that can store program codes.
Claims (11)
Priority Applications (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202110983851.2A CN114443240B (en) | 2021-08-25 | 2021-08-25 | I/O request processing method and electronic device |
| CN202211362704.4A CN115729684B (en) | 2021-08-25 | 2021-08-25 | Input/output request processing method and electronic equipment |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202110983851.2A CN114443240B (en) | 2021-08-25 | 2021-08-25 | I/O request processing method and electronic device |
Related Child Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202211362704.4A Division CN115729684B (en) | 2021-08-25 | 2021-08-25 | Input/output request processing method and electronic equipment |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN114443240A true CN114443240A (en) | 2022-05-06 |
| CN114443240B CN114443240B (en) | 2022-11-15 |
Family
ID=81362251
Family Applications (2)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202211362704.4A Active CN115729684B (en) | 2021-08-25 | 2021-08-25 | Input/output request processing method and electronic equipment |
| CN202110983851.2A Active CN114443240B (en) | 2021-08-25 | 2021-08-25 | I/O request processing method and electronic device |
Family Applications Before (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202211362704.4A Active CN115729684B (en) | 2021-08-25 | 2021-08-25 | Input/output request processing method and electronic equipment |
Country Status (1)
| Country | Link |
|---|---|
| CN (2) | CN115729684B (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN116700913A (en) * | 2022-09-13 | 2023-09-05 | 荣耀终端有限公司 | Scheduling method, equipment and storage medium of embedded file system |
Citations (10)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103068054A (en) * | 2011-10-21 | 2013-04-24 | 上海无线通信研究中心 | Controllable super-speed wireless local area network channel access method based on time delay |
| CN106469088A (en) * | 2015-08-21 | 2017-03-01 | 华为技术有限公司 | A kind of I/O request scheduling method and scheduler |
| US20170134291A1 (en) * | 2014-07-10 | 2017-05-11 | Sony Corporation | Data processing device, receiving device, data processing method, and program |
| CN107133100A (en) * | 2017-04-26 | 2017-09-05 | 新华三技术有限公司 | Storage system service quality Q oS control methods and device |
| CN109818863A (en) * | 2017-11-22 | 2019-05-28 | 华为技术有限公司 | Link priority setting method and device |
| CN110099012A (en) * | 2019-05-08 | 2019-08-06 | 深信服科技股份有限公司 | A kind of flow control methods, system and electronic equipment and storage medium |
| US20190354496A1 (en) * | 2018-05-18 | 2019-11-21 | International Business Machines Corporation | Selecting a priority queue from which to process an input/output (i/o) request using a machine learning module |
| CN110609743A (en) * | 2018-06-15 | 2019-12-24 | 伊姆西Ip控股有限责任公司 | Method, electronic device and computer program product for configuring resources |
| CN110830391A (en) * | 2018-08-10 | 2020-02-21 | 阿里巴巴集团控股有限公司 | Resource allocation method and device and cluster system |
| CN112749002A (en) * | 2019-10-29 | 2021-05-04 | 北京京东尚科信息技术有限公司 | Method and device for dynamically managing cluster resources |
Family Cites Families (9)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20160029402A1 (en) * | 2010-11-22 | 2016-01-28 | Seven Networks, Llc | Optimization of resource polling intervals to satisfy mobile device requests |
| KR102542375B1 (en) * | 2016-08-19 | 2023-06-14 | 에스케이하이닉스 주식회사 | Data processing system and operating method thereof |
| CN108009006B (en) * | 2016-11-02 | 2022-02-18 | 华为技术有限公司 | Scheduling method and device of I/O (input/output) request |
| US10719245B1 (en) * | 2017-07-13 | 2020-07-21 | EMC IP Holding Company LLC | Transactional IO scheduler for storage systems with multiple storage devices |
| CN110018902B (en) * | 2018-01-10 | 2023-01-31 | Oppo广东移动通信有限公司 | Memory processing method and device, electronic device, computer-readable storage medium |
| CN109684090A (en) * | 2018-12-19 | 2019-04-26 | 三星电子(中国)研发中心 | A kind of resource allocation methods and device |
| CN112527476B (en) * | 2019-09-19 | 2024-03-26 | 华为技术有限公司 | Resource scheduling method and electronic equipment |
| CN112783564B (en) * | 2019-11-01 | 2023-03-03 | 华为技术有限公司 | Method and electronic device for accelerating application program startup |
| CN111026456B (en) * | 2019-11-29 | 2023-07-18 | 惠州Tcl移动通信有限公司 | Application management method and device, storage medium and electronic equipment |
-
2021
- 2021-08-25 CN CN202211362704.4A patent/CN115729684B/en active Active
- 2021-08-25 CN CN202110983851.2A patent/CN114443240B/en active Active
Patent Citations (10)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103068054A (en) * | 2011-10-21 | 2013-04-24 | 上海无线通信研究中心 | Controllable super-speed wireless local area network channel access method based on time delay |
| US20170134291A1 (en) * | 2014-07-10 | 2017-05-11 | Sony Corporation | Data processing device, receiving device, data processing method, and program |
| CN106469088A (en) * | 2015-08-21 | 2017-03-01 | 华为技术有限公司 | A kind of I/O request scheduling method and scheduler |
| CN107133100A (en) * | 2017-04-26 | 2017-09-05 | 新华三技术有限公司 | Storage system service quality Q oS control methods and device |
| CN109818863A (en) * | 2017-11-22 | 2019-05-28 | 华为技术有限公司 | Link priority setting method and device |
| US20190354496A1 (en) * | 2018-05-18 | 2019-11-21 | International Business Machines Corporation | Selecting a priority queue from which to process an input/output (i/o) request using a machine learning module |
| CN110609743A (en) * | 2018-06-15 | 2019-12-24 | 伊姆西Ip控股有限责任公司 | Method, electronic device and computer program product for configuring resources |
| CN110830391A (en) * | 2018-08-10 | 2020-02-21 | 阿里巴巴集团控股有限公司 | Resource allocation method and device and cluster system |
| CN110099012A (en) * | 2019-05-08 | 2019-08-06 | 深信服科技股份有限公司 | A kind of flow control methods, system and electronic equipment and storage medium |
| CN112749002A (en) * | 2019-10-29 | 2021-05-04 | 北京京东尚科信息技术有限公司 | Method and device for dynamically managing cluster resources |
Non-Patent Citations (3)
| Title |
|---|
| E. BETTI等: "Real-Time I/O Management System with COTS Peripherals", 《IEEE TRANSACTIONS ON COMPUTERS》 * |
| 张振浩等: "一种支持业务优先级的卫星网络信道动态接入策略", 《计算机应用研究》 * |
| 赵全等: "大规模短时间任务的低延迟集群调度框架", 《计算机应用》 * |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN116700913A (en) * | 2022-09-13 | 2023-09-05 | 荣耀终端有限公司 | Scheduling method, equipment and storage medium of embedded file system |
| CN116700913B (en) * | 2022-09-13 | 2024-05-31 | 荣耀终端有限公司 | Scheduling method, device and storage medium of embedded file system |
Also Published As
| Publication number | Publication date |
|---|---|
| CN114443240B (en) | 2022-11-15 |
| CN115729684B (en) | 2023-09-19 |
| CN115729684A (en) | 2023-03-03 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN116244067B (en) | Virtual memory management method and electronic equipment | |
| CN111813536B (en) | Task processing method, device, terminal and computer readable storage medium | |
| JP7635859B2 (en) | Method and electronic device for performing drawing operations by an application | |
| CN114443277A (en) | Memory management method and device, electronic equipment and computer readable storage medium | |
| CN112527476B (en) | Resource scheduling method and electronic equipment | |
| US20230385112A1 (en) | Memory Management Method, Electronic Device, and Computer-Readable Storage Medium | |
| CN110636554B (en) | Data transmission method and device | |
| WO2021115112A1 (en) | Installation package downloading method, installation package distribution method, terminal device, server, and system | |
| CN111382087A (en) | A memory management method and electronic device | |
| CN114461589A (en) | Method for reading compressed file, file system and electronic equipment | |
| CN110347455A (en) | A kind of quick interface arrangement method and terminal | |
| CN114443240B (en) | I/O request processing method and electronic device | |
| WO2022033355A1 (en) | Mail processing method and electronic device | |
| CN116700913B (en) | Scheduling method, device and storage medium of embedded file system | |
| CN116414782B (en) | Methods and electronic devices for identifying duplicate files | |
| CN114489471B (en) | An input and output processing method and electronic device | |
| CN113485969B (en) | Storage fragmentation method and device, terminal and computer storage medium | |
| CN113590346B (en) | Method and electronic device for processing business requests | |
| CN118233402A (en) | Data transmission method and electronic equipment | |
| CN114489469A (en) | A data reading method, electronic device and storage medium | |
| CN117707720B (en) | Process scheduling method and device and electronic equipment | |
| WO2023001208A1 (en) | Multi-file synchronization method and electronic device | |
| WO2024045841A1 (en) | Storage method and apparatus, and electronic device | |
| WO2024217062A1 (en) | File storage method and electronic device | |
| CN120335939A (en) | Task management method and related equipment |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant | ||
| TR01 | Transfer of patent right |
Effective date of registration: 20230907 Address after: 201306 building C, No. 888, Huanhu West 2nd Road, Lingang New Area, Pudong New Area, Shanghai Patentee after: Shanghai Glory Smart Technology Development Co.,Ltd. Address before: Unit 3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong 518040 Patentee before: Honor Device Co.,Ltd. |
|
| TR01 | Transfer of patent right |