CN116700913A - Scheduling method, equipment and storage medium of embedded file system - Google Patents
Scheduling method, equipment and storage medium of embedded file system Download PDFInfo
- Publication number
- CN116700913A CN116700913A CN202211110805.2A CN202211110805A CN116700913A CN 116700913 A CN116700913 A CN 116700913A CN 202211110805 A CN202211110805 A CN 202211110805A CN 116700913 A CN116700913 A CN 116700913A
- Authority
- CN
- China
- Prior art keywords
- scheduling
- task
- queue
- time
- electronic device
- 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
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/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; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/16—File or folder operations, e.g. details of user interfaces specifically adapted to file systems
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/18—File system types
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR 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
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Software Systems (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Human Computer Interaction (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
本申请公开了一种嵌入式文件系统的调度方法、设备及存储介质,该方法应用于集成嵌入式操作系统的电子设备中。在该方法中,当接收到多个任务发起的对嵌入式文件系统的多个调度请求时,根据每个调度请求对应的任务的优先级和/或每个调度请求的等待时间,每次从未被响应的调度请求中选取最紧迫的调度请求进行响应,从而达到合理的响应多个调度请求的目的。
The application discloses a scheduling method, equipment and storage medium of an embedded file system, and the method is applied to electronic equipment integrating an embedded operating system. In this method, when receiving multiple scheduling requests initiated by multiple tasks to the embedded file system, according to the priority of each scheduling request corresponding to the task and/or the waiting time of each scheduling request, each time from Select the most urgent scheduling request to respond to the scheduling requests that have not been responded, so as to achieve the purpose of responding to multiple scheduling requests reasonably.
Description
技术领域technical field
本申请涉及嵌入式操作系统技术领域,尤其涉及一种嵌入式文件系统的调度方法、设备及存储介质。The present application relates to the technical field of embedded operating system, in particular to a scheduling method, device and storage medium of an embedded file system.
背景技术Background technique
在搭载嵌入式操作系统的电子设备中,嵌入式操作系统会同时或者短时间内接收到上层应用生成的多个任务发起的对文件系统的调度请求,针对多个调度请求,如何调度嵌入式文件系统进行文件操作,进而及时执行该多个任务,则是亟待解决的问题。In an electronic device equipped with an embedded operating system, the embedded operating system will receive scheduling requests to the file system initiated by multiple tasks generated by upper-layer applications at the same time or in a short period of time. For multiple scheduling requests, how to schedule embedded files It is an urgent problem to be solved that the system performs file operations, and then executes the multiple tasks in a timely manner.
发明内容Contents of the invention
本申请公开了一种嵌入式文件系统的调度方法、设备及存储介质,该方法应用于集成嵌入式操作系统的电子设备中。在该方法中,当接收到多个任务发起的对嵌入式文件系统的多个调度请求时,根据每个调度请求对应的任务的优先级和/或每个调度请求的等待时间,每次从未被响应的调度请求中选取最紧迫的调度请求进行响应,从而达到合理的响应多个调度请求的目的。The application discloses a scheduling method, equipment and storage medium of an embedded file system, and the method is applied to electronic equipment integrating an embedded operating system. In this method, when receiving multiple scheduling requests initiated by multiple tasks to the embedded file system, according to the priority of each scheduling request corresponding to the task and/or the waiting time of each scheduling request, each time from Select the most urgent scheduling request to respond to the scheduling requests that have not been responded, so as to achieve the purpose of responding to multiple scheduling requests reasonably.
第一方面,本申请提供了一种嵌入式文件系统调度方法,该方法应用于电子设备,该电子设备包括嵌入式文件系统,该方法包括:该电子设备生成来自多个任务的多个调度请求,一个该任务对应一个或多个该调度请求,该调度请求用于调度该嵌入式文件系统以执行对应的文件操作;该电子设备根据该调度请求所属的任务的优先级、该调度请求的等待时间,依次响应该多个调度请求。In a first aspect, the present application provides an embedded file system scheduling method, the method is applied to an electronic device, the electronic device includes an embedded file system, and the method includes: the electronic device generates multiple scheduling requests from multiple tasks , one task corresponds to one or more scheduling requests, and the scheduling requests are used to schedule the embedded file system to perform corresponding file operations; time, and respond to the multiple scheduling requests in turn.
实施第一方面提供的方法后,所述电子设备可以按照一定的调度策略确定出合理的请求响应顺序,并按顺序调度嵌入式文件系统进行文件操作,以完成对应的任务。After implementing the method provided in the first aspect, the electronic device can determine a reasonable sequence of request responses according to a certain scheduling strategy, and schedule the embedded file system to perform file operations in order to complete corresponding tasks.
结合第一方面提供的方法,电子设备依次响应该多个调度请求,具体包括:从该多个调度请求中依次选取调度请求来响应,一次选取一个调度请求来响应;其中,每一次选取一个调度请求的过程包括:在第二队列为空,或,该第二队列中的调度请求被连续响应的时长大于或等于吃饱时间的情况下,从第一队列中选取优先级最高的任务的一个调度请求进行响应;在该第二队列不为空,或,该第二队列中的调度请求被连续响应的时长小于吃饱时间的情况下,从该第二队列中选取优先级最高的任务的一个调度请求进行响应;该第一队列包括:等待时长小于饿死时间的调度请求;该第二队列包括:未被响应且等待时长大于或等于饿死时间的调度请求;属于相同任务的调度请求对应同一个饿死时间。In combination with the method provided in the first aspect, the electronic device responds to the multiple scheduling requests in sequence, specifically including: sequentially selecting scheduling requests from the multiple scheduling requests to respond to, and selecting one scheduling request to respond at a time; wherein, selecting one scheduling request at a time The requesting process includes: when the second queue is empty, or when the scheduling request in the second queue is continuously responded to for a duration greater than or equal to the full time, select one of the tasks with the highest priority from the first queue Respond to the scheduling request; if the second queue is not empty, or the duration of the continuous response of the scheduling request in the second queue is less than the full time, select the task with the highest priority from the second queue A scheduling request responds; the first queue includes: scheduling requests whose waiting time is less than the starvation time; the second queue includes: scheduling requests that have not been responded and whose waiting time is greater than or equal to the starvation time; scheduling requests belonging to the same task Corresponding to the same starvation time.
可见,本申请采用的嵌入式文件系统调度方法对上层应用提供的文件操作服务具有实时性。即,设置了应用发起的不同类型的任务对应的优先级、和来自该任务的调度请求的等待时间的第一阈值,保证优先级较高的、对响应时间要求较高的应用发起的调度请求能够被优先响应。此外,本申请采用的嵌入式文件系统调度方法对上层应用提供的文件操作服务具有公平性。即,限制了优先被响应的调度请求的总运行时间,从而在满足实时性要求的同时,对于实时性要求低的任务的请求,也能得到响应服务。It can be seen that the embedded file system scheduling method adopted in this application is real-time for the file operation service provided by the upper layer application. That is, the priority corresponding to the different types of tasks initiated by the application and the first threshold of the waiting time of the scheduling request from the task are set to ensure that the scheduling requests initiated by applications with higher priority and higher response time requirements be prioritized for response. In addition, the embedded file system scheduling method adopted in this application is fair to the file operation service provided by the upper layer application. That is, the total running time of the scheduling requests that are prioritized to be responded is limited, so that while satisfying real-time requirements, response services can also be obtained for requests for tasks with low real-time requirements.
结合第一方面提供的方法,该电子设备从该第一队列中选取的一个调度请求为,该第一队列的优先级最高的任务中,生成时间最早的调度请求;该电子设备从该第二队列中选取的一个调度请求为,该第二队列的优先级最高的任务中,生成时间最早的调度请求。In combination with the method provided in the first aspect, the scheduling request selected by the electronic device from the first queue is the scheduling request with the earliest generation time among the tasks with the highest priority in the first queue; A scheduling request selected in the queue is a scheduling request with the earliest generation time among the tasks with the highest priority in the second queue.
这样,当同一任务的包含多个调度请求时,该多个调度请求对应的任务的优先级相同,则可以选取其中最早到达的调度请求进行响应,进而能够保证在优先级相同的情况下,优先响应早到达的调度请求。In this way, when the same task contains multiple scheduling requests, the priorities of the tasks corresponding to the multiple scheduling requests are the same, and the scheduling request that arrives earliest can be selected to respond, thereby ensuring that in the case of the same priority, priority Respond to scheduling requests that arrive early.
结合第一方面提供的方法,该任务的优先级由该电子设备预设,具体根据开发阶段统计到的应用生成任务的频次,和/或,所述任务的实时性要求而预先设定的值;或者,该任务的优先级由该电子设备根据以下任一项或多项动态调整:该任务的历史未被成功执行的次数,该任务历史被成功执行时所用的时长、该任务的调度请求在该第一队列的等待时长、该任务的历史生成频次。In combination with the method provided in the first aspect, the priority of the task is preset by the electronic device, specifically according to the frequency of the application generation task counted in the development stage, and/or, the value preset according to the real-time requirements of the task ; or, the priority of the task is dynamically adjusted by the electronic device according to any one or more of the following: the number of times the history of the task has not been successfully executed, the time taken for the history of the task to be successfully executed, the scheduling request of the task The waiting time in the first queue and the historical generation frequency of the task.
这样,在电子设备运行过程中,可以根据应用发起任务的业务特性(即用户的使用需求)的动态变化,来实时调整选取调度请求进行响应的顺序时的所采用的优先级参数,进而按照更加合理的顺序来响应调度请求。In this way, during the operation of the electronic device, according to the dynamic change of the service characteristic of the task initiated by the application (that is, the user's use demand), the priority parameter used when selecting the order of dispatching requests for response can be adjusted in real time, and then according to a more Reasonable order to respond to scheduling requests.
结合第一方面提供的方法,该调度请求的饿死时间由该电子设备预设,具体根据开发阶段统计到的应用生成任务的频次,和/或,所述任务的实时性要求而预先设定的值;或者,由该电子设备根据以下任一项或多项动态调整:该调度请求所属任务的历史未被成功执行的次数,该调度请求所属任务历史被成功执行时所用的时长、该调度请求所属任务的调度请求在该第一队列的等待时长、该调度请求所属任务的历史生成频次。In combination with the method provided in the first aspect, the starvation time of the scheduling request is preset by the electronic device, specifically according to the frequency of application generation tasks counted in the development stage, and/or, the real-time requirements of the tasks are preset or, dynamically adjusted by the electronic device according to any one or more of the following: the number of times the history of the task to which the scheduling request belongs has not been successfully executed, the time taken for the history of the task to which the scheduling request belongs to be successfully executed, the scheduling The waiting time of the scheduling request of the task to which the request belongs in the first queue, and the historical generation frequency of the task to which the scheduling request belongs.
这样,在电子设备运行过程中,可以根据应用发起任务的业务特性(即用户的使用需求)的动态变化,来实时调整选取调度请求进行响应的顺序时的所采用的饥饿时间参数,进而按照更加合理的顺序来响应调度请求。In this way, during the operation of the electronic device, according to the dynamic change of the service characteristics of the task initiated by the application (that is, the user's use demand), the starvation time parameter used when selecting the order in which the scheduling request is responded to can be adjusted in real time, and then according to a more Reasonable order to respond to scheduling requests.
结合第一方面提供的方法,该吃饱时间由该电子设备预设;或者,由该电子设备根据历史连续响应该第二队列中的调度请求的时长来动态调整。In combination with the method provided in the first aspect, the eating time is preset by the electronic device; or, it is dynamically adjusted by the electronic device according to the historical duration of continuously responding to the scheduling requests in the second queue.
这样,在电子设备运行过程中,可以根据应用发起任务的业务特性(即用户的使用需求)的动态变化,来实时调整选取调度请求进行响应的顺序时的所采用的吃饱时间,进而按照更加合理的顺序来响应调度请求。In this way, during the operation of the electronic device, according to the dynamic change of the business characteristics of the task initiated by the application (that is, the user's use demand), the full time used when selecting the order of scheduling requests for response can be adjusted in real time, and then according to a more Reasonable order to respond to scheduling requests.
结合第一方面提供的方法,该嵌入式文件系统执行的文件操作包括以下任意一项或多项:创建、打开、读写、关闭、删除、修改文件或者转移文件存储位置。In combination with the method provided in the first aspect, the file operations performed by the embedded file system include any one or more of the following: creating, opening, reading and writing, closing, deleting, modifying files or transferring file storage locations.
这样,电子设备可以按照特定顺序依次响应多个调度请求以调度嵌入式文件系统执行对应的多种文件操作,扩展本身方法的应用场景。In this way, the electronic device can sequentially respond to multiple scheduling requests in a specific order to schedule the embedded file system to execute various corresponding file operations, expanding the application scenarios of the method itself.
第二方面,本申请提供了一种电子设备,该电子设备包括文件系统调度服务、嵌入式文件系统;该文件系统调度服务,用于接收来自多个任务的多个调度请求,根据该调度请求所属的任务的优先级、该调度请求的等待时间,依次调度该嵌入式文件系统来响应该多个调度请求;一个该任务对应一个或多个该调度请求;该嵌入式文件系统,用于响应该调度请求,以执行对应的文件操作。In a second aspect, the present application provides an electronic device, which includes a file system scheduling service and an embedded file system; the file system scheduling service is used to receive multiple scheduling requests from multiple tasks, and according to the scheduling request The priority of the task to which it belongs, the waiting time of the scheduling request, and sequentially schedule the embedded file system to respond to the multiple scheduling requests; one task corresponds to one or more scheduling requests; the embedded file system is used to respond to The request should be dispatched to perform the corresponding file operation.
采用第二方面提供的电子设备后,该电子设备可以按照一定的调度策略确定出合理的请求响应顺序,并按顺序调度嵌入式文件系统进行文件操作,以完成对应的任务。After using the electronic device provided by the second aspect, the electronic device can determine a reasonable sequence of request responses according to a certain scheduling strategy, and schedule the embedded file system to perform file operations in order to complete corresponding tasks.
结合第二方面提供的电子设备,该文件系统调度服务依次调度该嵌入式文件系统来响应该多个调度请求,具体包括:该文件系统调度服务从该多个调度请求中依次选取调度请求调度该嵌入式文件系统来响应,一次选取一个调度请求调度该嵌入式文件系统来响应;其中,每一次选取一个调度请求的过程包括:在第二队列为空,或,该第二队列中的调度请求被连续响应的时长大于或等于吃饱时间的情况下,该文件系统调度服务从第一队列中选取优先级最高的任务的一个调度请求调度该嵌入式文件系统进行响应;在该第二队列不为空,或,该第二队列中的调度请求被连续响应的时长小于吃饱时间的情况下,从该第二队列中选取优先级最高的任务的一个调度请求进行响应;该第一队列包括:等待时长小于饿死时间的调度请求;该第二队列包括:未被响应且等待时长大于或等于饿死时间的调度请求;属于相同任务的调度请求对应同一个饿死时间。In combination with the electronic device provided in the second aspect, the file system scheduling service sequentially schedules the embedded file system to respond to the multiple scheduling requests, specifically including: the file system scheduling service sequentially selects a scheduling request from the multiple scheduling requests to schedule the The embedded file system responds, and selects a scheduling request to schedule the embedded file system to respond; wherein, the process of selecting a scheduling request each time includes: the second queue is empty, or the scheduling request in the second queue When the duration of the continuous response is greater than or equal to the full time, the file system scheduling service selects a scheduling request of the task with the highest priority from the first queue to schedule the embedded file system to respond; is empty, or, when the scheduling request in the second queue is continuously responded to for less than the full time, a scheduling request of the task with the highest priority is selected from the second queue to respond; the first queue includes : Scheduling requests whose waiting time is less than the starvation time; the second queue includes: scheduling requests that have not been responded and whose waiting time is greater than or equal to the starvation time; scheduling requests belonging to the same task correspond to the same starvation time.
可见,本申请采用的电子设备对上层应用提供的文件操作服务具有实时性。即,设置了应用发起的不同类型的任务对应的优先级、和来自该任务的调度请求的等待时间的第一阈值,保证优先级较高的、对响应时间要求较高的应用发起的调度请求能够被优先响应。此外,本申请采用的嵌入式文件系统调度方法对上层应用提供的文件操作服务具有公平性。即,限制了优先被响应的调度请求的总运行时间,从而在满足实时性要求的同时,对于实时性要求低的任务的请求,也能得到响应服务。It can be seen that the electronic device used in this application has real-time performance on the file operation service provided by the upper layer application. That is, the priority corresponding to the different types of tasks initiated by the application and the first threshold of the waiting time of the scheduling request from the task are set to ensure that the scheduling requests initiated by applications with higher priority and higher response time requirements be prioritized for response. In addition, the embedded file system scheduling method adopted in this application is fair to the file operation service provided by the upper layer application. That is, the total running time of the scheduling requests that are prioritized to be responded is limited, so that while satisfying real-time requirements, response services can also be obtained for requests for tasks with low real-time requirements.
结合第二方面提供的电子设备,该文件系统调度服务从该第一队列中选取的一个调度请求为,该第一队列的优先级最高的任务中,生成时间最早的调度请求;该文件系统调度服务从该第二队列中选取的一个调度请求为,该第二队列的优先级最高的任务中,生成时间最早的调度请求。In combination with the electronic device provided in the second aspect, the scheduling request selected by the file system scheduling service from the first queue is the scheduling request with the earliest generation time among the tasks with the highest priority in the first queue; the file system scheduling service The scheduling request selected by the service from the second queue is the scheduling request with the earliest generation time among the tasks with the highest priority in the second queue.
这样,当同一任务的包含多个调度请求时,该多个调度请求对应的任务的优先级相同,则可以选取其中最早到达的调度请求进行响应,进而能够保证在优先级相同的情况下,优先响应早到达的调度请求。In this way, when the same task contains multiple scheduling requests, the priorities of the tasks corresponding to the multiple scheduling requests are the same, and the scheduling request that arrives earliest can be selected to respond, thereby ensuring that in the case of the same priority, priority Respond to scheduling requests that arrive early.
结合第二方面提供的电子设备,该任务的优先级由该电子设备预设,具体根据开发阶段统计到的应用生成任务的频次,和/或,所述任务的实时性要求而预先设定的值;或者,该任务的优先级由该文件系统调度服务根据以下任一项或多项动态调整:该任务的历史未被成功执行的次数,该任务历史被成功执行时所用的时长、该任务的调度请求在该第一队列的等待时长、该任务的历史生成频次。In combination with the electronic device provided in the second aspect, the priority of the task is preset by the electronic device, specifically according to the frequency of the application generation task counted in the development stage, and/or, the real-time requirement of the task is preset value; or, the priority of the task is dynamically adjusted by the file system scheduling service according to any one or more of the following: the number of times the history of the task has not been successfully executed, the time taken for the history of the task to be successfully executed, the task The waiting time of the scheduling request in the first queue, and the historical generation frequency of the task.
这样,在电子设备运行过程中,可以根据应用发起任务的业务特性(即用户的使用需求)的动态变化,来实时调整选取调度请求进行响应的顺序时的所采用的优先级参数,进而按照更加合理的顺序来响应调度请求。In this way, during the operation of the electronic device, according to the dynamic change of the service characteristic of the task initiated by the application (that is, the user's use demand), the priority parameter used when selecting the order of dispatching requests for response can be adjusted in real time, and then according to a more Reasonable order to respond to scheduling requests.
结合第二方面提供的电子设备,该调度请求的饿死时间由该电子设备预设,具体根据开发阶段统计到的应用生成任务的频次,和/或,所述任务的实时性要求而预先设定的值;或者,由该文件系统调度服务根据以下任一项或多项动态调整:该调度请求所属任务的历史未被成功执行的次数,该调度请求所属任务历史被成功执行时所用的时长、该调度请求所属任务的调度请求在该第一队列的等待时长、该调度请求所属任务的历史生成频次。In combination with the electronic device provided in the second aspect, the starvation time of the scheduling request is preset by the electronic device, specifically according to the frequency of application generation tasks counted in the development stage, and/or, the real-time requirements of the tasks Or, the file system scheduling service dynamically adjusts according to any one or more of the following: the number of times the history of the task to which the scheduling request belongs is not successfully executed, and the time it takes for the history of the task to which the scheduling request belongs to be successfully executed , the waiting time of the scheduling request of the task to which the scheduling request belongs in the first queue, and the historical generation frequency of the task to which the scheduling request belongs.
这样,在电子设备运行过程中,可以根据应用发起任务的业务特性(即用户的使用需求)的动态变化,来实时调整选取调度请求进行响应的顺序时的所采用的饥饿时间参数,进而按照更加合理的顺序来响应调度请求。In this way, during the operation of the electronic device, according to the dynamic change of the service characteristics of the task initiated by the application (that is, the user's use demand), the starvation time parameter used when selecting the order in which the scheduling request is responded to can be adjusted in real time, and then according to a more Reasonable order to respond to scheduling requests.
结合第二方面提供的电子设备,该吃饱时间由该电子设备预设;或者,由该文件系统调度服务根据历史连续响应该第二队列中的调度请求的时长动态调整。In combination with the electronic device provided in the second aspect, the full time is preset by the electronic device; or, the file system scheduling service dynamically adjusts the duration of continuously responding to the scheduling requests in the second queue according to history.
这样,在电子设备运行过程中,可以根据应用发起任务的业务特性(即用户的使用需求)的动态变化,来实时调整选取调度请求进行响应的顺序时的所采用的吃饱时间,进而按照更加合理的顺序来响应调度请求。In this way, during the operation of the electronic device, according to the dynamic change of the business characteristics of the task initiated by the application (that is, the user's use demand), the full time used when selecting the order of scheduling requests for response can be adjusted in real time, and then according to a more Reasonable order to respond to scheduling requests.
结合第二方面提供的电子设备,该嵌入式文件系统执行的文件操作包括以下任意一项或多项:创建、打开、读写、关闭、删除、修改文件或者转移文件存储位置。In combination with the electronic device provided in the second aspect, the file operations performed by the embedded file system include any one or more of the following: creating, opening, reading and writing, closing, deleting, modifying files or transferring file storage locations.
这样,电子设备可以按照特定顺序依次响应多个调度请求以调度嵌入式文件系统执行对应的多种文件操作,扩展本身方法的应用场景。In this way, the electronic device can sequentially respond to multiple scheduling requests in a specific order to schedule the embedded file system to execute various corresponding file operations, expanding the application scenarios of the method itself.
第三方面,本申请提供了一种电子设备,该电子设备包括嵌入式文件系统、存储器、一个或多个处理器;该存储器与该一个或多个处理器耦合,该存储器用于存储计算机程序代码,该计算机程序代码包括计算机指令,该一个或多个处理器调用该计算机指令以使得该电子设备执行:生成来自多个任务的多个调度请求,一个该任务对应一个或多个该调度请求,该调度请求用于调度该嵌入式文件系统以执行对应的文件操作;根据该调度请求所属的任务的优先级、该调度请求的等待时间,依次响应该多个调度请求。In a third aspect, the present application provides an electronic device, which includes an embedded file system, memory, and one or more processors; the memory is coupled to the one or more processors, and the memory is used to store computer programs Code, the computer program code includes computer instructions, the one or more processors invoke the computer instructions to cause the electronic device to perform: generating a plurality of scheduling requests from a plurality of tasks, one of the tasks corresponding to one or more of the scheduling requests , the scheduling request is used to schedule the embedded file system to execute the corresponding file operation; according to the priority of the task to which the scheduling request belongs and the waiting time of the scheduling request, respond to the multiple scheduling requests in sequence.
采用第二方面提供的电子设备后,该电子设备包含的文件系统调度服务可以按照一定的调度策略确定出合理的请求响应顺序,并按顺序调度嵌入式文件系统进行文件操作,以完成对应的任务。After using the electronic device provided by the second aspect, the file system scheduling service included in the electronic device can determine a reasonable request response sequence according to a certain scheduling strategy, and schedule the embedded file system to perform file operations in order to complete the corresponding task .
结合第三方面提供的电子设备,该一个或多个处理器调用该计算机指令以使得该电子设备依次响应该多个调度请求,具体包括:从该多个调度请求中依次选取调度请求来响应,一次选取一个调度请求来响应;其中,每一次选取一个调度请求的过程包括:在第二队列为空,或,该第二队列中的调度请求被连续响应的时长大于或等于吃饱时间的情况下,从第一队列中选取优先级最高的任务的一个调度请求进行响应;在该第二队列不为空,或,该第二队列中的调度请求被连续响应的时长小于吃饱时间的情况下,从该第二队列中选取优先级最高的任务的一个调度请求进行响应;该第一队列包括:等待时长小于饿死时间的调度请求;该第二队列包括:未被响应且等待时长大于或等于饿死时间的调度请求;属于相同任务的调度请求对应同一个饿死时间。With reference to the electronic device provided in the third aspect, the one or more processors call the computer instruction so that the electronic device responds to the multiple scheduling requests in sequence, specifically including: sequentially selecting a scheduling request from the multiple scheduling requests to respond, Select one scheduling request at a time to respond; wherein, the process of selecting one scheduling request each time includes: the second queue is empty, or, the duration of continuous response of the scheduling requests in the second queue is greater than or equal to the full time In this case, select a scheduling request of the task with the highest priority from the first queue to respond; when the second queue is not empty, or the duration of the continuous response of the scheduling requests in the second queue is less than the full time Next, select a scheduling request of the task with the highest priority from the second queue to respond; the first queue includes: the scheduling request whose waiting time is less than the starvation time; the second queue includes: no response and the waiting time is longer than Or scheduling requests equal to the starvation time; scheduling requests belonging to the same task correspond to the same starvation time.
可见,本申请采用的文件系统调度服务对上层应用提供的文件操作服务具有实时性。即,设置了应用发起的不同类型的任务对应的优先级、和来自该任务的调度请求的等待时间的第一阈值,保证优先级较高的、对响应时间要求较高的应用发起的调度请求能够被优先响应。此外,本申请采用的文件系统调度服务对上层应用提供的文件操作服务具有公平性。即,限制了优先被响应的调度请求的总运行时间,从而在满足实时性要求的同时,对于实时性要求低的任务的请求,也能得到响应服务。结合第三方面提供的电子设备,该一个或多个处理器调用该计算机指令以使得该电子设备从该第一队列中选取的一个调度请求为,该第一队列的优先级最高的任务中,生成时间最早的调度请求;该一个或多个处理器调用该计算机指令以使得该电子设备从该第二队列中选取的一个调度请求为,该第二队列的优先级最高的任务中,生成时间最早的调度请求。It can be seen that the file system scheduling service adopted in this application has real-time performance on the file operation service provided by the upper layer application. That is, the priority corresponding to the different types of tasks initiated by the application and the first threshold of the waiting time of the scheduling request from the task are set to ensure that the scheduling requests initiated by applications with higher priority and higher response time requirements be prioritized for response. In addition, the file system scheduling service adopted in this application is fair to the file operation service provided by the upper layer application. That is, the total running time of the scheduling requests that are prioritized to be responded is limited, so that while satisfying real-time requirements, response services can also be obtained for requests for tasks with low real-time requirements. In combination with the electronic device provided in the third aspect, the one or more processors invoke the computer instruction so that the electronic device selects a scheduling request from the first queue as, among the tasks with the highest priority in the first queue, The scheduling request with the earliest generation time; the one or more processors invoke the computer instruction so that the electronic device selects a scheduling request from the second queue as, among the tasks with the highest priority in the second queue, the generation time Earliest scheduling request.
这样,当同一任务的包含多个调度请求时,该多个调度请求对应的任务的优先级相同,则可以选取其中最早到达的调度请求进行响应,进而能够保证在优先级相同的情况下,优先响应早到达的调度请求。In this way, when the same task contains multiple scheduling requests, the priorities of the tasks corresponding to the multiple scheduling requests are the same, and the scheduling request that arrives earliest can be selected to respond, thereby ensuring that in the case of the same priority, priority Respond to scheduling requests that arrive early.
结合第三方面提供的电子设备,该任务的优先级由该电子设备预设,具体根据开发阶段统计到的应用生成任务的频次,和/或,所述任务的实时性要求而预先设定的值;或者,该任务的优先级由该电子设备根据以下任一项或多项动态调整:该任务的历史未被成功执行的次数,该任务历史被成功执行时所用的时长、该任务的调度请求在该第一队列的等待时长、该任务的历史生成频次。In combination with the electronic device provided in the third aspect, the priority of the task is preset by the electronic device, specifically according to the frequency of the application generation task counted in the development stage, and/or, the real-time requirement of the task is preset value; or, the priority of the task is dynamically adjusted by the electronic device according to any one or more of the following: the number of times the history of the task has not been successfully executed, the time taken for the history of the task to be successfully executed, the scheduling of the task The waiting time of the request in the first queue and the historical generation frequency of the task.
这样,在电子设备运行过程中,可以根据应用发起任务的业务特性(即用户的使用需求)的动态变化,来实时调整选取调度请求进行响应的顺序时的所采用的优先级参数,进而按照更加合理的顺序来响应调度请求。In this way, during the operation of the electronic device, according to the dynamic change of the service characteristic of the task initiated by the application (that is, the user's use demand), the priority parameter used when selecting the order of dispatching requests for response can be adjusted in real time, and then according to a more Reasonable order to respond to scheduling requests.
结合第三方面提供的电子设备,该调度请求的饿死时间由该电子设备预设,具体根据开发阶段统计到的应用生成任务的频次,和/或,所述任务的实时性要求而预先设定的值;或者,由该电子设备根据以下任一项或多项动态调整:该调度请求所属任务的历史未被成功执行的次数,该调度请求所属任务历史被成功执行时所用的时长、该调度请求所属任务的调度请求在该第一队列的等待时长、该调度请求所属任务的历史生成频次。In combination with the electronic device provided in the third aspect, the starvation time of the scheduling request is preset by the electronic device, specifically according to the frequency of application generation tasks counted in the development stage, and/or the real-time requirements of the tasks Or, the electronic device dynamically adjusts according to any one or more of the following: the number of times the history of the task to which the dispatching request belongs has not been successfully executed, the time it takes for the history of the task to which the dispatching request belongs to be successfully executed, the The waiting time of the scheduling request of the task to which the scheduling request belongs in the first queue, and the historical generation frequency of the task to which the scheduling request belongs.
这样,在电子设备运行过程中,可以根据应用发起任务的业务特性(即用户的使用需求)的动态变化,来实时调整选取调度请求进行响应的顺序时的所采用的饥饿时间参数,进而按照更加合理的顺序来响应调度请求。In this way, during the operation of the electronic device, according to the dynamic change of the service characteristics of the task initiated by the application (that is, the user's use demand), the starvation time parameter used when selecting the order in which the scheduling request is responded to can be adjusted in real time, and then according to a more Reasonable order to respond to scheduling requests.
结合第三方面提供的电子设备,该吃饱时间由该电子设备预设;或者,由该电子设备根据历史连续响应该第二队列中的调度请求的时长动态调整。In combination with the electronic device provided in the third aspect, the time to be full is preset by the electronic device; or, the electronic device dynamically adjusts the time length of continuously responding to the scheduling request in the second queue according to history.
这样,在电子设备运行过程中,可以根据应用发起任务的业务特性(即用户的使用需求)的动态变化,来实时调整选取调度请求进行响应的顺序时的所采用的吃饱时间,进而按照更加合理的顺序来响应调度请求。In this way, during the operation of the electronic device, according to the dynamic change of the business characteristics of the task initiated by the application (that is, the user's use demand), the full time used when selecting the order of scheduling requests for response can be adjusted in real time, and then according to a more Reasonable order to respond to scheduling requests.
结合第三方面提供的电子设备,该嵌入式文件系统执行的文件操作包括以下任意一项或多项:创建、打开、读写、关闭、删除、修改文件或者转移文件存储位置。In combination with the electronic device provided by the third aspect, the file operations performed by the embedded file system include any one or more of the following: creating, opening, reading and writing, closing, deleting, modifying files or transferring file storage locations.
这样,电子设备可以按照特定顺序依次响应多个调度请求以调度嵌入式文件系统执行对应的多种文件操作,扩展本身方法的应用场景。In this way, the electronic device can sequentially respond to multiple scheduling requests in a specific order to schedule the embedded file system to execute various corresponding file operations, expanding the application scenarios of the method itself.
第四方面,本申请提供了一种芯片,该芯片应用于电子设备,该芯片包括一个或多个处理器,该处理器用于调用计算机指令以使得该电子设备执行如第一方面中任一项描述的方法。In a fourth aspect, the present application provides a chip, the chip is applied to an electronic device, the chip includes one or more processors, and the processor is used to invoke computer instructions so that the electronic device performs any one of the first aspects described method.
第五方面,本申请提供了一种计算机可读存储介质,该计算机可读存储介质包括指令,当该指令在电子设备上运行时,使得该电子设备执行如第一方面中任一项描述的方法。In a fifth aspect, the present application provides a computer-readable storage medium, the computer-readable storage medium includes an instruction, and when the instruction is run on an electronic device, the electronic device executes the method described in any one of the first aspect. method.
附图说明Description of drawings
图1A-图1C为两个任务场景下对嵌入式文件系统的调度逻辑图;Figures 1A-1C are logic diagrams for scheduling embedded file systems in two task scenarios;
图2为本申请实施例提供的一种电子设备硬件架构示意图;FIG. 2 is a schematic diagram of a hardware architecture of an electronic device provided by an embodiment of the present application;
图3为本申请实施例提供的一种电子设备软件架构(嵌入式系统架构)示意图;FIG. 3 is a schematic diagram of an electronic device software architecture (embedded system architecture) provided by an embodiment of the present application;
图4为本申请实施例提供的一种嵌入式系统中的文件系统调度方法流程图;FIG. 4 is a flow chart of a file system scheduling method in an embedded system provided in an embodiment of the present application;
图5为本申请实施例提供的一种嵌入式系统中的文件系统调度策略图;FIG. 5 is a file system scheduling strategy diagram in an embedded system provided by an embodiment of the present application;
图6为本申请实施例提供的一种嵌入式系统中的文件系统调度策略图;FIG. 6 is a file system scheduling strategy diagram in an embedded system provided by an embodiment of the present application;
图7为本申请实施例提供的一种两个任务场景下对嵌入式文件系统的调度逻辑图;FIG. 7 is a logic diagram for scheduling embedded file systems in two task scenarios provided by the embodiment of the present application;
图8为本申请实施例提供的嵌入式系统中的对文件系统的调度请求响应逻辑。FIG. 8 shows the scheduling request response logic for the file system in the embedded system provided by the embodiment of the present application.
具体实施方式Detailed ways
下面将结合附图对本申请实施例中的技术方案进行清楚、详尽地描述。其中,在本申请实施例的描述中,除非另有说明,“/”表示或的意思,例如,A/B可以表示A或B;文本中的“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。The technical solutions in the embodiments of the present application will be described clearly and in detail below in conjunction with the accompanying drawings. Among them, in the description of the embodiments of this application, unless otherwise specified, "/" means or means, for example, A/B can mean A or B; "and/or" in the text is only a description of associated objects The association relationship of indicates that there may be three kinds of relationships, for example, A and/or B may indicate: A exists alone, A and B exist simultaneously, and B exists independently.
以下,术语“第一”、“第二”仅用于描述目的,而不能理解为暗示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者更多个该特征,在本申请实施例的描述中,除非另有说明,“多个”的含义是两个或两个以上。Hereinafter, the terms "first" and "second" are used for descriptive purposes only, and cannot be understood as implying or implying relative importance or implicitly specifying the quantity of indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of these features. In the description of the embodiments of the present application, unless otherwise specified, the "multiple" The meaning is two or more.
在本申请中提及“实施例”意味着,结合实施例描述的特定特征、结构或特性可以包含在本申请的至少一个实施例中。在说明书中的各个位置出现该短语并不一定均是指相同的实施例,也不是与其它实施例互斥的独立的或备选的实施例。本领域技术人员显式地和隐式地理解的是,本申请所描述的实施例可以与其它实施例相结合。Reference in this application to an "embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the present application. The occurrences of this phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is understood explicitly and implicitly by those skilled in the art that the embodiments described in this application can be combined with other embodiments.
首先,对本申请涉及的术语进行解释,具体如下:First, explain the terms involved in this application, as follows:
嵌入式操作系统:嵌入式操作系统(Embedded Operating System,简称:EOS)是指应用在嵌入式设备中的操作系统。嵌入式设备(又称嵌入式系统),是指由硬件和软件组成,能够独立进行运作的器件,包括软件运行环境及其操作系统的软件内容,以及包括处理器、存储器、通信模块等硬件内容。Embedded Operating System: Embedded Operating System (Embedded Operating System, EOS for short) refers to an operating system applied in embedded devices. Embedded devices (also known as embedded systems) refer to devices that are composed of hardware and software and can operate independently, including the software content of the software operating environment and its operating system, as well as hardware content such as processors, memories, and communication modules. .
在嵌入式设备中,运行在嵌入式操作系统之上的软件可以直接访问设备的硬件。可见,上层应用可以直接调度底层的嵌入式文件系统来访问外存模块,即,当上层应用需要访问外存模块时,应用可以直接调用文件系统接口来访问外存模块,例如通过write函数和read函数等来读写外存模块存储的文件。In an embedded device, software running on an embedded operating system can directly access the device's hardware. It can be seen that the upper-layer application can directly schedule the underlying embedded file system to access the external memory module, that is, when the upper-layer application needs to access the external memory module, the application can directly call the file system interface to access the external memory module, for example, through the write function and read functions to read and write files stored in the external memory module.
可见,使用嵌入式操作系统,降低了软件与硬件的耦合度,上层应用对硬件的调度和管理不依赖底层硬件,因此,嵌入式操作系统具备可移植、软硬件可裁剪、可配置等特点。此外,嵌入式操作系统相对其他非嵌入式操作系统所需要的丰富资源和强大软件配置来说,嵌入式操作系统的功耗小,更加适用于小型设备,例如穿戴设备和物联网设备等。It can be seen that the use of embedded operating systems reduces the coupling between software and hardware, and the scheduling and management of hardware by upper-layer applications does not depend on the underlying hardware. Therefore, embedded operating systems have the characteristics of portability, tailorable software and hardware, and configurability. In addition, compared with the rich resources and powerful software configuration required by other non-embedded operating systems, embedded operating systems consume less power and are more suitable for small devices, such as wearable devices and Internet of Things devices.
非嵌入式操作系统:非嵌入式操作系统又称通用操作系统,是指用在通用系统(传统)系统中的操作系统。Non-embedded operating system: Non-embedded operating system, also known as general-purpose operating system, refers to the operating system used in general-purpose (traditional) systems.
值得注意的,在非嵌入式系统中,运行在非嵌入式操作系统之上的大部分软件不可以直接访问设备的硬件,即上层应用不能直接调度底层的文件系统接口来访问外存模块。具体的,由于,非嵌入式系统将存储空间分为用户空间和内核空间,应用程序运行在用户空间中,非嵌入式操作系统和驱动程序则运行在内核空间中,当内核空间使用用户空间指针时,可能在外存模块中找不到对应的文件,因此两者不能简单地使用指针传递数据。也就是说,当上层应用需要访问外存模块时,上层应用创建的进程/线程需从用户态转化为内核态,然后才能调用文件系统接口来访问外存模块,即通过write和read函数访问不同的外存模块存储的文件。It is worth noting that in non-embedded systems, most software running on non-embedded operating systems cannot directly access the hardware of the device, that is, upper-layer applications cannot directly schedule the underlying file system interface to access external memory modules. Specifically, because the non-embedded system divides the storage space into user space and kernel space, the application program runs in the user space, and the non-embedded operating system and driver program run in the kernel space. When the kernel space uses the user space pointer , the corresponding file may not be found in the external memory module, so the two cannot simply use pointers to transfer data. That is to say, when the upper-layer application needs to access the external memory module, the process/thread created by the upper-layer application needs to be converted from the user state to the kernel state, and then the file system interface can be called to access the external memory module, that is, the access to the external memory module is different through the write and read functions. files stored in the external memory module.
嵌入式文件系统:是嵌入式操作系统中的重要组成部分,嵌入式文件系统是嵌入式操作系统用于明确存储设备上的文件的方法。嵌入式文件系统还用于:管理和调度文件的存储空间,提供文件的逻辑结构、物理结构和存储方法、实现文件从标识到实际地址的映射、实现文件的控制操作和存取操作(包括创建、打开、读写、关闭和撤销文件等服务)。Embedded file system: It is an important part of the embedded operating system. The embedded file system is a method used by the embedded operating system to explicitly store files on the device. The embedded file system is also used to: manage and schedule the storage space of the file, provide the logical structure, physical structure and storage method of the file, realize the mapping of the file from the identifier to the actual address, realize the control operation and the access operation of the file (including creating , open, read, write, close, and revoke files, etc.).
嵌入式文件系统主要由三部分组成:文件系统的接口,对对象操纵和管理的软件集合,对象及属性。从系统角度来看,嵌入式文件系统是对文件存储设备的空间进行组织和分配,负责文件存储并对存入的文件进行保护和检索的系统。具体地说,它负责为用户建立文件,存入、读出、修改、转储文件,控制文件的存取。The embedded file system is mainly composed of three parts: the interface of the file system, the software collection for object manipulation and management, objects and attributes. From a system point of view, the embedded file system is a system that organizes and allocates the space of the file storage device, is responsible for file storage, and protects and retrieves the stored files. Specifically, it is responsible for creating files for users, storing, reading, modifying, and dumping files, and controlling file access.
文件操作:是指针对文件的创建、打开、读写、关闭、删除修改、转存文件等的操作。执行文件操作时需要调用的函数包括但不限于:open、write、read、close、seek-read、random-read等等。本申请实施例对具体的文件操作不作限制。File operation: refers to the operations of creating, opening, reading and writing, closing, deleting and modifying files, and dumping files. The functions that need to be called when performing file operations include but are not limited to: open, write, read, close, seek-read, random-read, etc. The embodiment of the present application does not limit specific file operations.
特别的是,文件操作具体是指针对电子设备的外侧模块中存储的文件的操作,而非针对内存中的数据的操作,因为内存中的数据可以直接由CPU进行读写。In particular, the file operation specifically refers to the operation on the file stored in the external module of the electronic device, rather than the operation on the data in the memory, because the data in the memory can be directly read and written by the CPU.
任务(Task):是指由电子设备的操作系统,也就是说,任务指的是一系列达到某一目的操作。Task: refers to the operating system of an electronic device, that is to say, a task refers to a series of operations to achieve a certain purpose.
在本申请实施例中,任务是指由电子设备中运行在嵌入式操作系统之上的应用、服务等发起的,一个应用可以发起一种或多种任务。In this embodiment of the present application, a task refers to an application or service initiated by an electronic device running on an embedded operating system, and one application may initiate one or more tasks.
任务的种类包括但不限于:传感器任务、显示任务、空中下载任务、音频任务、导航(如全球定位系统(Global Positioning System,GPS))任务、输入任务、能力任务等等。Types of tasks include but are not limited to: sensor tasks, display tasks, over-the-air tasks, audio tasks, navigation (such as Global Positioning System (Global Positioning System, GPS)) tasks, input tasks, capability tasks, and so on.
电子设备执行任务具体包括:在应用、服务发起某个任务之后,应用、服务通过创建线程来向嵌入式操作系统发起一个或多个调度请求,嵌入式操作系统响应该一个或多个调度请求以调度嵌入式文件系统执行对应的一个或多个文件操作,进而完成该任务。也就是说,当一个任务包含用于执行多一个或多个文件操作的指令时,则该一个任务对应有一个或多个调度请求。The electronic device execution task specifically includes: after the application or service initiates a certain task, the application or service initiates one or more scheduling requests to the embedded operating system by creating threads, and the embedded operating system responds to the one or more scheduling requests with The embedded file system is scheduled to execute one or more corresponding file operations to complete the task. That is to say, when a task includes instructions for performing one or more file operations, the task corresponds to one or more scheduling requests.
线程(Thread):是操作系统能够进行运算调度的最小单位。它被包含在进程之中,是进程中的实际运作单位。一条线程指的是进程中一个单一顺序的控制流,一个进程中可以并发多个线程,每条线程用于执行不同的任务。Thread (Thread): It is the smallest unit that the operating system can perform operation scheduling. It is included in the process and is the actual operating unit in the process. A thread refers to a single sequential flow of control in a process. Multiple threads can run concurrently in a process, and each thread is used to perform a different task.
随着可穿戴等小型设备的广泛应用,嵌入式操作系统凭其独有的功耗小、可移植、可裁剪、可配置等特点,因而被广泛应用在可穿戴等小型设备中。此外,嵌入式文件系统作为嵌入式操作系统的重要组成部分,对于实现嵌入式系统中文件的存储和各种操作的管理,有着重要的作用。With the wide application of small devices such as wearables, embedded operating systems are widely used in small devices such as wearables due to their unique characteristics of low power consumption, portability, tailorability, and configurability. In addition, the embedded file system, as an important part of the embedded operating system, plays an important role in realizing the storage of files and the management of various operations in the embedded system.
嵌入式设备所具备的一个特性是能够通过不同线程完成不同任务。具体的,当电子设备的上层应用或者服务发起多个任务时,电子设备则创建多个线程用于执行对应任务,执行多个任务的顺序实质是根据每个任务对应的调度请求到达的先后顺序确定的。为了便于理解,接下来分别以两个任务的场景下,对嵌入式文件系统的调度逻辑进行说明。A characteristic of embedded devices is the ability to perform different tasks through different threads. Specifically, when the upper-layer application or service of the electronic device initiates multiple tasks, the electronic device creates multiple threads for executing the corresponding tasks, and the order in which multiple tasks are executed is essentially based on the order in which the scheduling requests corresponding to each task arrive. definite. In order to facilitate understanding, the scheduling logic of the embedded file system will be described in the context of two tasks respectively.
参考图1A-图1C,图1A-图1C示例性示出在两个任务场景下对嵌入式文件系统的调度逻辑图。Referring to FIG. 1A-FIG. 1C, FIG. 1A-FIG. 1C exemplarily show a scheduling logic diagram for an embedded file system in two task scenarios.
图1A示例性示出了两个读任务的处理过程。FIG. 1A exemplarily shows the processing process of two read tasks.
如图1A所示,电子设备的上层应用或服务先后发起读任务1和读任务2后,则可以分别创建线程Thread1-read来执行读任务1,创建线程Thread2-read用于执行读任务2。当读任务1包括4个文件操作(例如r1、r2、r3、r4)时,则读任务1对应有4个对嵌入式文件系统的调度请求。当读任务2包括4个文件操作(例如r1、r2、r3、r4)时,则读任务1对应有4个对嵌入式文件系统的调度请求。在任务1的调度请求到达时间先于任务2的调度请求时(图中记作“Thread1-read>Thread2-read”),则电子设备优先响应任务1的调度请求,后响应任务2的调度请求,也就是说,电子设备执行完读任务1包括的4个文件操作后才会执行读任务2包括的4个文件操作。这是因为,通过Thread1-read执行读任务1时,Thread1-read抢占了任务锁,只有在Thread1-read执行读任务1后才会释放任务,以供Thread2-read才能够抢占任务锁,进而执行读任务2。As shown in FIG. 1A , after the upper layer application or service of the electronic device successively initiates the read task 1 and the read task 2, a thread Thread1-read can be created to execute the read task 1, and a thread Thread2-read can be created to execute the read task 2. When the read task 1 includes 4 file operations (for example r1, r2, r3, r4), then the read task 1 corresponds to 4 scheduling requests to the embedded file system. When the read task 2 includes 4 file operations (eg r1, r2, r3, r4), then the read task 1 corresponds to 4 scheduling requests to the embedded file system. When the scheduling request of task 1 arrives earlier than the scheduling request of task 2 (denoted as "Thread1-read>Thread2-read" in the figure), the electronic device responds to the scheduling request of task 1 first, and then responds to the scheduling request of task 2 , that is to say, the electronic device will not execute the four file operations included in the read task 2 until the electronic device finishes executing the four file operations included in the read task 1. This is because, when Thread1-read executes read task 1, Thread1-read seizes the task lock, and only after Thread1-read executes read task 1, the task will be released so that Thread2-read can seize the task lock and execute Read task 2.
图1B示例性示出了两个写任务的处理过程。FIG. 1B exemplarily shows the processing process of two writing tasks.
如图1B所示,电子设备的上层应用或服务先后发起写任务1和写任务2后,则可以分别创建线程Thread1-write来执行写任务1,创建线程Thread2-write用于执行读任务2。同理,电子设备按照写任务1和写任务2对应的调度请求到达时间的先后顺序,优先响应写任务1的调度请求以执行早达到的写任务1,之后再响应写任务2的调度请求以执行后达到的写任务2,具体执行过程可以参考前文对图1A的描述,在此暂不赘述。图1C示例性示出了一个读任务和一个写任务的处理过程。As shown in FIG. 1B , after the upper-layer application or service of the electronic device successively initiates the write task 1 and the write task 2, a thread Thread1-write can be created to execute the write task 1, and a thread Thread2-write can be created to execute the read task 2. Similarly, according to the order of arrival time of the scheduling requests corresponding to writing task 1 and writing task 2, the electronic device responds first to the scheduling request of writing task 1 to execute the earlier arriving writing task 1, and then responds to the scheduling request of writing task 2 to For the write task 2 achieved after execution, the specific execution process can refer to the description of FIG. 1A above, and will not be repeated here. FIG. 1C exemplarily shows the processing process of a read task and a write task.
如图1C所示,电子设备的上层应用或服务先后发起读任务1和写任务2后,则可以分别创建线程Thread1-read来执行写任务1,创建线程Thread2-write用于执行读任务2。同理,电子设备按照读任务1和写任务2对应的调度请求到达时间的先后顺序,优先响应读任务1的调度请求以执行早达到的读任务1,之后再响应写任务2的调度请求以执行后达到的写任务2,具体执行过程可以参考前文对图1A的描述,在此暂不赘述。As shown in FIG. 1C , after the upper-layer application or service of the electronic device successively initiates the read task 1 and the write task 2, a thread Thread1-read can be created to execute the write task 1, and a thread Thread2-write can be created to execute the read task 2. Similarly, according to the order of arrival time of the scheduling requests corresponding to the reading task 1 and writing task 2, the electronic device responds to the scheduling request of the reading task 1 first to execute the earlier arriving reading task 1, and then responds to the scheduling request of the writing task 2 to For the write task 2 achieved after execution, the specific execution process can refer to the description of FIG. 1A above, and will not be repeated here.
通过上述图1A-图1C示出的场景来看,当电子设备的上层应用或者服务发起多个任务时,电子设备则根据每个任务对应的调度请求到达的先后顺序来依次响应每个任务的调度请求以执行该多个任务。这样会导致后到的任务的调度请求等待时间较长,不能及时响应后到的任务,若后到的任务的调度请求对实时性要求高,则会导致执行该任务的线程被饿死,从而导致电子设备卡顿、甚至死机等问题。From the above scenarios shown in Figures 1A-1C, when the upper-layer application or service of the electronic device initiates multiple tasks, the electronic device responds to each task in turn according to the order in which the scheduling requests corresponding to each task arrive. Requests are scheduled to perform the plurality of tasks. This will lead to a long waiting time for the scheduling request of the task that arrives later, and cannot respond to the task that arrives in time. If the scheduling request of the task that arrives later has high requirements for real-time performance, the thread executing the task will be starved to death, thus This can lead to problems such as electronic equipment freezing or even crashing.
此外,由于大多数嵌入式设备都是单核设备,即只具有一个CPU,在面临多个待执行的任务时,由于只有一个CPU执行该多个任务,则更容易导致后续排队的任务的调度请求等待很长时间仍然得不到响应,从而使得电子设备出现卡顿、甚至死机等问题,影响用户体验感。In addition, since most embedded devices are single-core devices, that is, only have one CPU, when faced with multiple tasks to be executed, since only one CPU executes the multiple tasks, it is easier to cause the scheduling of subsequent queued tasks The request waits for a long time and still does not get a response, which causes problems such as freezing or even crashing of the electronic device, which affects the user experience.
为了解决上述问题,本申请提供了一种嵌入式文件系统的调度方法、设备及存储介质,该方法应用于集成嵌入式操作系统的电子设备中。在该方法中,当接收到应用创建的任务所发起的对文件系统的多个调度请求时,根据每个调度请求对应的任务的优先级和/或每个调度请求的等待时间,每次从未被响应的调度请求中选取最紧迫的调度请求进行响应,从而达到合理的响应多个调度请求的目的。In order to solve the above problems, the present application provides a scheduling method, device and storage medium of an embedded file system, and the method is applied to an electronic device integrated with an embedded operating system. In this method, when multiple scheduling requests to the file system initiated by the tasks created by the application are received, according to the priority of the task corresponding to each scheduling request and/or the waiting time of each scheduling request, each time from Select the most urgent scheduling request to respond to the scheduling requests that have not been responded, so as to achieve the purpose of responding to multiple scheduling requests reasonably.
其中,选取最紧迫的调度请求包括:从多个调度请求中选取对应的任务优先级最高的调度请求作为最紧迫的调度请求(后文也称目标调度请求);Wherein, selecting the most urgent scheduling request includes: selecting the scheduling request with the highest corresponding task priority from multiple scheduling requests as the most urgent scheduling request (hereinafter also referred to as the target scheduling request);
或者,从多个调度请求中选取等待时间大于对应的第一阈值(后文也称饥饿时间)的调度请求作为最紧迫的调度请求;Or, select the scheduling request whose waiting time is greater than the corresponding first threshold (hereinafter also referred to as the starvation time) from the multiple scheduling requests as the most urgent scheduling request;
或者,设置低优先级的第一队列,和高优先级的第二队列,先将所有调度请求加入至第一队列;然后将第一队列中未被响应的并且等待时间达到对应第一阈值的调度请求加入第二队列;优先从第二队列中选取对应任务的优先级最高的调度请求进行响应,直至第二队列为空或者持续响应第二队列的总时长达到第二阈值(后文也称吃饱时间)的情况下,切换至从第一队列中选取对应任务的优先级最高的调度请求进行响应。Or, set the first queue with low priority and the second queue with high priority, first add all scheduling requests to the first queue; The scheduling request is added to the second queue; the priority is to select the scheduling request with the highest priority corresponding to the task from the second queue to respond until the second queue is empty or the total duration of continuous response to the second queue reaches the second threshold (hereinafter also referred to as In the case of full time), switch to select the scheduling request with the highest priority corresponding to the task from the first queue to respond.
进一步的,在本申请另一种可能实现的方式中,除了设置第一队列和第二队列外,还可以设置更多不同优先级的队列,并相应设置多个时间阈值作为该调度请求的饥饿时间,将等待时间处于不同阈值范围内的调度请求加入至对应的队列中,以及相应设置多个时间阈值作为每个队列的吃饱时间,在达到某个队列的吃饱时间后切换至其他队列中进行选取调度请求进行响应,从而能够达到更精细合理的调度。Further, in another possible implementation mode of this application, in addition to setting the first queue and the second queue, more queues with different priorities can be set, and multiple time thresholds can be set accordingly as the starvation of the scheduling request Time, add scheduling requests whose waiting time is within different threshold ranges to the corresponding queues, and set multiple time thresholds accordingly as the full time of each queue, and switch to other queues after reaching the full time of a certain queue Select a scheduling request to respond to, so as to achieve more refined and reasonable scheduling.
进一步的,在本申请另一种可能实现的方式中,本申请采用的调度策略中所涉及的,每个调度请求对应的任务的优先级、每个调度请求对应的第一阈值以及持续响应某个队列第二阈值等参数是根据上层应用的业务特性(即用户的使用需求)动态变化的,从而能够随着上层应用的业务特性的变化,动态调整调度策略,进而按照更加合理的顺序来响应调度请求。Further, in another possible implementation mode of the present application, the scheduling strategy adopted in the present application involves the priority of the task corresponding to each scheduling request, the first threshold corresponding to each scheduling request, and the continuous response to a certain Parameters such as the second threshold of a queue are dynamically changed according to the business characteristics of the upper-layer application (that is, the user's usage requirements), so that the scheduling strategy can be dynamically adjusted with the change of the business characteristics of the upper-layer application, and then respond in a more reasonable order. Scheduling requests.
接下来,对本申请涉及的自定义词汇进行解释,具体如下:Next, explain the custom vocabulary involved in this application, as follows:
任务的优先级(又可以称为任务对应的调度请求的优先级):是指由开发人员根据发起该任务的上层应用对文件系统的依赖程度而定义的固定数值,当任务的优先级对应的数值越高时,则说明该类任务的请求所属应用拥有更高的优先权来调度嵌入式文件系统。或者,任务的优先级还可以是电子设备在运行过程中,通过分析周期性采集的可测性设计(DFT)数据来动态调整的数值,具体可以参考后文方法实施例的描述。Task priority (also called the priority of the scheduling request corresponding to the task): refers to a fixed value defined by the developer based on the dependence of the upper-layer application that initiates the task on the file system. When the priority of the task corresponds to A higher value indicates that the application that requests this type of task has a higher priority to schedule the embedded file system. Alternatively, the task priority may also be a value dynamically adjusted by analyzing periodically collected Design for Test (DFT) data during the operation of the electronic device. For details, refer to the description of the method embodiments below.
其中,上层应用对文件系统的依赖程度用以下任一种或多种因素表征:开发人员通过调研获取到的所述任务调度所述嵌入式文件系统的频次、所述任务对调度所述嵌入式文件系统的实时性要求。可以理解为:为保障某个应用在正常运行时,若该应用需要频繁调度嵌入式文件系统对文件执行对应的操作,或者,该应用对调度请求响应的实时性要求较高时,则说明该应用对嵌入式文件系统的依赖程度高,因此可以将该应用发起的任务的优先级定义为高优先级,反之则定定义为低优先级。关于任务的优先级的等级划分,具体可以参考后文方法实施例中的描述,在此暂不赘述。Wherein, the dependence degree of the upper-layer application on the file system is characterized by any one or more of the following factors: the frequency of the task scheduling the embedded file system obtained by the developer through research, the task's impact on the scheduling of the embedded file system The real-time requirements of the file system. It can be understood as: In order to ensure that an application is running normally, if the application needs to frequently schedule the embedded file system to perform corresponding operations on the file, or if the application has high real-time requirements for scheduling request responses, it means that the The application has a high degree of dependence on the embedded file system, so the priority of the task initiated by the application can be defined as a high priority, otherwise it can be defined as a low priority. Regarding the classification of task priorities, for details, refer to the description in the method embodiments below, and details will not be repeated here.
在本申请中,当其他条件相同的情况下,优先级高的任务可以优先调度嵌入式文件系统对文件进行操作。也就是说,在其他条件一定情况下,当嵌入式操作系统接收到多个不同优先级的任务对嵌入式文件系统的调度请求时,则按照优先级由高到低的顺序,依次响应调度请求并调度嵌入式文件系统以执行对应的文件操作。可以理解的是,其他条件一定包括但不限于:不同优先级的任务对嵌入式文件系统的调度请求的等待时间,都小于对应的第一阈值时,或者,都大于或等于第一阈值时,即为其他条件相同。关于,根据任务的优先级来响应文件调度请求的实现过程,具体可以参考后文方法实施例中的描述,在此暂不赘述。In the present application, when other conditions are the same, tasks with higher priority can be prioritized to schedule the embedded file system to operate files. That is to say, under certain other conditions, when the embedded operating system receives multiple scheduling requests from tasks with different priorities to the embedded file system, it responds to the scheduling requests in order of priority from high to low. And schedule the embedded file system to perform corresponding file operations. It can be understood that other conditions must include but are not limited to: when the waiting time of tasks with different priorities to the scheduling requests of the embedded file system is less than the corresponding first threshold, or when both are greater than or equal to the first threshold, That is, other conditions are the same. As for the implementation process of responding to the file scheduling request according to the priority of the task, for details, refer to the description in the method embodiment below, and details will not be repeated here.
第一阈值:是指由开发人员根据上层应用对嵌入式文件系统的依赖程度定义出的“饥饿时间”,该“饥饿时间”是指应用中的任务发起的对文件系统的调度请求的等待时间的一个阈值。可以理解的是,为了保证用户体验,避免被触发的调度请求出现长时间无响应,应用创建的进程/线程被饿死,应用无法正常运行,同时避免长时间没有被调度的调度请求一直占用系统资源,导致系统奔溃。通常在生成调度请求的时候会为其赋值一个超时时间,即等待被调度的最大时间。因此,本申请提供的饥饿时间可以根据调度请求对应的超时时间进行设置,如设置饥饿时间小于或等于超时时间。或者,第一阈值还可以是电子设备在运行过程中,通过分析周期性采集的可测性设计(Design For Test,DFT)数据来动态调整的数值,具体可以参考后文方法实施例的描述。The first threshold: refers to the "starvation time" defined by the developer according to the dependence of the upper application on the embedded file system. The "starvation time" refers to the waiting time for the scheduling request to the file system initiated by the task in the application a threshold of . It is understandable that in order to ensure the user experience and avoid long-term unresponsiveness of the triggered scheduling request, the process/thread created by the application will be starved to death, and the application cannot run normally, and at the same time, avoid the long-term unscheduled scheduling request from occupying the system. resources, causing the system to crash. Usually, when a scheduling request is generated, a timeout period is assigned to it, which is the maximum time to wait for being scheduled. Therefore, the starvation time provided in this application can be set according to the timeout time corresponding to the scheduling request, for example, the starvation time is set to be less than or equal to the timeout time. Alternatively, the first threshold may also be a value that is dynamically adjusted by analyzing periodically collected Design For Test (DFT) data during the operation of the electronic device. For details, refer to the description of the method embodiments below.
其中,上层应用对文件系统的依赖程度用以下任一种或多种因素表征:开发人员通过调研获取到的所述任务调度所述嵌入式文件系统的频次、所述任务对调度所述嵌入式文件系统的实时性要求。可以理解为:当某个应用在正常运行过程中,若该应用需要频繁调度嵌入式文件系统对文件执行对应的操作,或者,该应用对调度请求响应的实时性要求较高时,则说明该应用对嵌入式文件系统的依赖程度高,因此可以将这类应用发起的任务对嵌入式文件系统的调度请求的第一阈值定义为较短的时间,反之则定定义为较长的时间。关于第一阈值的具体设置,具体可以参考后文方法实施例中的描述,在此暂不赘述。Wherein, the dependence degree of the upper-layer application on the file system is characterized by any one or more of the following factors: the frequency of the task scheduling the embedded file system obtained by the developer through research, the task's impact on the scheduling of the embedded file system The real-time requirements of the file system. It can be understood as: when an application is running normally, if the application needs to frequently schedule the embedded file system to perform corresponding operations on the file, or if the application has high real-time requirements for scheduling request responses, it means that the Applications are highly dependent on the embedded file system, so the first threshold of scheduling requests to the embedded file system for tasks initiated by such applications can be defined as a shorter time, otherwise it can be defined as a longer time. Regarding the specific setting of the first threshold, reference may be made to the description in the method embodiments later, and details are not repeated here.
在本申请中,不同应用发起的任务请求对应的第一阈值可能相同或者不同,同一应用发起的不同任务请求对应的第一阈值也可能相同或者不同。In this application, the first thresholds corresponding to task requests initiated by different applications may be the same or different, and the first thresholds corresponding to different task requests initiated by the same application may also be the same or different.
第二阈值:是指为了保证各个应用发起的任务请求被响应的相对公平性,由开发人员定义的持续响应第二队列中的请求的上限时间,又称“吃饱时间”。这是因为,第二队列中的请求相对于第一队列中的请求来说是较紧急的,因此是被优先执行的,但当第二队列中的请求较多时,若长时间执行第二队列中的请求对应的任务,则会导致第一队列中的请求等待过长的时间无法得到响应,从而造成第一队列中的调度请求达到对应的超时时间。因此,为了保证第一队列中的普通请求也能被响应,因此本申请需要定义第二队列中的请求的总运行时间的上限值即第二阈值。或者,第二阈值还可以是电子设备在运行过程中,通过分析周期性采集的可测性设计(Design For Test,DFT)数据来动态调整的数值,具体可以参考后文方法实施例的描述。The second threshold: refers to the upper limit time defined by developers to continuously respond to requests in the second queue in order to ensure the relative fairness of the response to task requests initiated by each application, also known as "satisfaction time". This is because the requests in the second queue are more urgent than the requests in the first queue, so they are executed first, but when there are many requests in the second queue, if the second queue is executed for a long time The task corresponding to the request in the first queue will cause the request in the first queue to wait for too long to get a response, thus causing the scheduling request in the first queue to reach the corresponding timeout period. Therefore, in order to ensure that ordinary requests in the first queue can also be responded to, the application needs to define the upper limit of the total running time of the requests in the second queue, that is, the second threshold. Alternatively, the second threshold may also be a value dynamically adjusted by analyzing periodically collected Design For Test (DFT) data during the operation of the electronic device. For details, refer to the description of the method embodiments below.
可见,实施本申请提供的嵌入式文件系统调度方法后,可以带来以下技术效果:It can be seen that after implementing the embedded file system scheduling method provided by this application, the following technical effects can be brought about:
(1)针对多个对嵌入式文件系统的调度请求,可以按照调度策略确定出合理的请求响应顺序,并按顺序调度嵌入式文件系统进行文件操作,以完成对应的任务,让本来无优先级概念的文件系统服务具备优先级的能力。(1) For multiple scheduling requests to the embedded file system, a reasonable request response sequence can be determined according to the scheduling policy, and the embedded file system is scheduled to perform file operations in order to complete the corresponding tasks, so that there is no priority The conceptual file system service has the ability to prioritize.
(2)本申请采用的调度策略对上层应用提供的文件操作服务具有实时性。即,设置了应用发起的不同类型的任务对应的优先级、和来自该任务的调度请求的等待时间的第一阈值,保证优先级较高的、对响应时间要求较高的应用发起的调度请求能够被优先响应。(2) The scheduling strategy adopted in this application is real-time for the file operation service provided by the upper layer application. That is, the priority corresponding to the different types of tasks initiated by the application and the first threshold of the waiting time of the scheduling request from the task are set to ensure that the scheduling requests initiated by applications with higher priority and higher response time requirements be prioritized for response.
(3)本申请采用的调度策略对上层应用提供的文件操作服务具有公平性。即,限制了优先被响应的调度请求的总运行时间,从而在满足实时性要求的同时,对于实时性要求低的任务的请求,也能得到响应服务。(3) The scheduling strategy adopted in this application is fair to the file operation service provided by the upper layer application. That is, the total running time of the scheduling requests that are prioritized to be responded is limited, so that while satisfying real-time requirements, response services can also be obtained for requests for tasks with low real-time requirements.
(4)本申请采用的调度策略是动态变化的,能够灵活满足不同应用场景的需求。(4) The scheduling policy adopted in this application is dynamic and can flexibly meet the requirements of different application scenarios.
(5)本申请提供的嵌入式文件系统调度方法专用于搭载嵌入式操作系统的电子设备,因此本申请提供的嵌入式文件系统调度方法可以作为嵌入式系统的可加载选项提供,其具备可伸缩、可裁剪、可移植、可配置等特性。(5) The embedded file system scheduling method provided by this application is dedicated to electronic devices equipped with an embedded operating system, so the embedded file system scheduling method provided by this application can be provided as a loadable option of an embedded system, and it has a scalable , tailorable, portable, configurable and other features.
接下来,介绍本申请提供的电子设备形态、软硬件架构。Next, the form, software and hardware architecture of the electronic equipment provided by this application is introduced.
本申请提供的电子设备是指嵌入式设备。嵌入式操作系统包括但不限于:Palm 嵌入式/>Windows />等。嵌入式设备例如可以是,可穿戴式设备(例如有智能手表/手环、智能眼镜、真正无线立体声(True WirelessStereo,TWS)耳机等)、超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本,个人数字助理(personal digital assistant,PDA)、增强现实(augmented reality,AR)设备、虚拟现实(virtual reality,VR)设备、人工智能(artificial intelligence,AI)设备、车载设备、智能家居设备和/或智慧城市设备等等。此外,大部分物联网(Internet ofThings,IOT)设备也都属于嵌入式设备。The electronic device provided in this application refers to an embedded device. Embedded operating systems include but are not limited to: Palm Embedded /> Windows /> wait. The embedded device can be, for example, a wearable device (such as a smart watch/bracelet, smart glasses, a true wireless stereo (True Wireless Stereo, TWS) headset, etc.), an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), Netbooks, personal digital assistants (personal digital assistant, PDA), augmented reality (augmented reality, AR) equipment, virtual reality (virtual reality, VR) equipment, artificial intelligence (artificial intelligence, AI) equipment, vehicle equipment, smart home equipment and / or smart city equipment, etc. In addition, most Internet of Things (Internet of Things, IOT) devices are also embedded devices.
参考图2,图2示例性示出了电子设备的硬件结构示意图。Referring to FIG. 2 , FIG. 2 exemplarily shows a schematic diagram of a hardware structure of an electronic device.
如图2所示,电子设备可以包括:处理器110,外部存储器接口120,内部存储器121,通用串行总线(universalserialbus,USB)接口130,充电管理模块140,电源管理模块141,电池142,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180,按键190,马达191,指示器192,摄像头193,显示屏194,以及用户标识模块(subscriberidentificationmodule,SIM)卡接口195等。其中,传感器模块180可以包括压力传感器180A,触摸传感器180B。或者传感器模块还包括未示出的陀螺仪传感器,气压传感器,磁传感器,加速度传感器,距离传感器,接近光传感器,指纹传感器,温度传感器,环境光传感器和骨传导传感器等。As shown in Figure 2, the electronic device may include: a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (universalserialbus, USB) interface 130, a charging management module 140, a power management module 141, a battery 142, and an antenna 1. Antenna 2, mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, earphone jack 170D, sensor module 180, button 190, motor 191, indicator 192, camera 193, display screen 194, and a subscriber identification module (subscriber identification module, SIM) card interface 195 and so on. Wherein, the sensor module 180 may include a pressure sensor 180A and a touch sensor 180B. Or the sensor module further includes a gyro sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, an ambient light sensor, a bone conduction sensor, etc., which are not shown.
可以理解的是,本申请实施例示意的结构并不构成对电子设备的具体限定。在本申请另一些实施例中,电子设备可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。It can be understood that, the structure shown in the embodiment of the present application does not constitute a specific limitation on the electronic device. In other embodiments of the present application, the electronic device may include more or fewer components than shown in the illustrations, or combine certain components, or separate certain components, or arrange different components. The illustrated components can be realized in hardware, software or a combination of software and hardware.
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(applicationprocessor,AP),调制解调处理器,图形处理器(graphicsprocessingunit,GPU),图像信号处理器(imagesignalprocessor,ISP),控制器,存储器,视频编解码器,数字信号处理器(digitalsignalprocessor,DSP),基带处理器,和/或神经网络处理器(neural-networkprocessingunit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。The processor 110 may include one or more processing units, for example: the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processing unit (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), controller, memory, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural network processor (neural-network processing unit, NPU), etc. Wherein, different processing units may be independent devices, or may be integrated in one or more processors.
其中,控制器可以是电子设备的神经中枢和指挥中心。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。Wherein, the controller may be the nerve center and command center of the electronic equipment. The controller can generate an operation control signal according to the instruction opcode and timing signal, and complete the control of fetching and executing the instruction.
处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. The memory may hold instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to use the instruction or data again, it can be called directly from the memory. Repeated access is avoided, and the waiting time of the processor 110 is reduced, thereby improving the efficiency of the system.
在本申请实施例中,处理器110接收到上层应用发起的任务对文件系统的多个调度请求后,可以根据调度策略对多个调度请求进行排序,并按照顺序依次响应请求以调度嵌入式文件系统进行文件操作,在完成对应的任务之后,处理器110还可以控制相应的模块输出任务执行的结果。例如,当处理器110接收到音乐应用发起的播放音乐的请求,以及接收到导航应用发起的记录GPS数据的请求后,则可以按照调度策略先调度嵌入式文件系统读取对应的音乐文件,然后处理器110可以控制音频模块170播放音乐;之后,处理器110按照调度策略后调度嵌入式文件系统将GPS数据写入对应的GPS文件中,可选的,处理器110可以控制显示屏194显示记录成功的提示信息。In this embodiment of the application, after the processor 110 receives multiple scheduling requests for the file system from tasks initiated by the upper-layer application, it can sort the multiple scheduling requests according to the scheduling policy, and respond to the requests in order to schedule the embedded file system. The system performs file operations, and after completing the corresponding task, the processor 110 can also control the corresponding module to output the result of task execution. For example, when the processor 110 receives a request for playing music initiated by a music application and a request for recording GPS data initiated by a navigation application, it can first schedule the embedded file system to read the corresponding music file according to the scheduling strategy, and then The processor 110 can control the audio module 170 to play music; afterward, the processor 110 schedules the embedded file system to write the GPS data into the corresponding GPS file according to the scheduling strategy. Optionally, the processor 110 can control the display screen 194 to display the record Successful prompt message.
特别的是,本申请提供的电子设备是以集成了嵌入式操作系统的电子设备为例,基于上文对图1A-图1C所述的场景描述,嵌入式设备在通过多线程执行多任务时,无法并行执行通过多线程来执行多任务,因此容易出现前文提到的技术问题,但在处理器110采用本申请提供的调度策略后,对于多个待执行的任务,处理器110会小间隔的调用文件系统服务以达到类似并行通过多线程执行多个任务的效果,从而避免线程被饿死,导致应用卡顿。In particular, the electronic device provided in this application is an electronic device integrated with an embedded operating system as an example. Based on the description of the scenarios described in Figures 1A-1C above, when an embedded device executes multiple tasks through multiple threads , it is impossible to perform multiple tasks in parallel through multiple threads, so the technical problems mentioned above are prone to occur, but after the processor 110 adopts the scheduling strategy provided by this application, for multiple tasks to be executed, the processor 110 will Call the file system service to achieve the effect of executing multiple tasks in parallel through multiple threads, so as to avoid the starvation of threads and cause the application to freeze.
关于,处理器110根据调度策略对多个调度请求进行排序的具体实现方法可以参考后文方法流程的详细描述,在此暂不赘述。Regarding the specific implementation method for the processor 110 to sort the multiple scheduling requests according to the scheduling policy, reference may be made to the detailed description of the method flow in the following text, which will not be repeated here.
在一些实施例中,处理器110可以包括一个或多个接口。接口可以包括集成电路(inter-integratedcircuit,I2C)接口,集成电路内置音频(inter-integratedcircuitsound,I2S)接口,脉冲编码调制(pulsecodemodulation,PCM)接口,通用异步收发传输器(universalasynchronousreceiver/transmitter,UART)接口,移动产业处理器接口(mobileindustryprocessorinterface,MIPI),通用输入输出(general-purposeinput/output,GPIO)接口,用户标识模块(subscriberidentitymodule,SIM)接口,和/或通用串行总线(universalserialbus,USB)接口等。In some embodiments, processor 110 may include one or more interfaces. The interface may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuits sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous receiver/transmitter (universal asynchronous receiver/transmitter, UART) interface , mobile industry processor interface (mobile industry processor interface, MIPI), general-purpose input and output (general-purpose input/output, GPIO) interface, subscriber identity module (subscriber identity module, SIM) interface, and/or universal serial bus (universal serial bus, USB) interface, etc. .
可以理解的是,本申请实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对电子设备的结构限定。在本申请另一些实施例中,电子设备也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。It can be understood that the interface connection relationship between the modules shown in the embodiment of the present application is only a schematic illustration, and does not constitute a structural limitation of the electronic device. In other embodiments of the present application, the electronic device may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
充电管理模块140用于从充电器接收充电输入。其中,充电器可以是无线充电器,也可以是有线充电器。在一些有线充电的实施例中,充电管理模块140可以通过USB接口130接收有线充电器的充电输入。在一些无线充电的实施例中,充电管理模块140可以通过电子设备的无线充电线圈接收无线充电输入。充电管理模块140为电池142充电的同时,还可以通过电源管理模块141为电子设备供电。The charging management module 140 is configured to receive a charging input from a charger. Wherein, the charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 can receive charging input from the wired charger through the USB interface 130 . In some wireless charging embodiments, the charging management module 140 may receive wireless charging input through a wireless charging coil of the electronic device. While the charging management module 140 is charging the battery 142 , it can also supply power to the electronic device through the power management module 141 .
电源管理模块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 charging management module 140 and the processor 110 . The power management module 141 receives the input from the battery 142 and/or the charging management module 140 to provide power for the processor 110 , the internal memory 121 , the external memory, the display screen 194 , the camera 193 , and the wireless communication module 160 . The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle times, and battery health status (leakage, impedance). In some other embodiments, the power management module 141 may also be disposed in the processor 110 . In some other embodiments, the power management module 141 and the charging management module 140 may also be set in the same device.
电子设备的无线通信功能可以通过天线1,天线2,移动通信模块150,无线通信模块160,调制解调处理器以及基带处理器等实现。The wireless communication function of the electronic device can be realized by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
天线1和天线2用于发射和接收电磁波信号。电子设备中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in an electronic device can be used to cover a single or multiple communication frequency bands. Different antennas can also be multiplexed to improve the utilization of the antennas. For example: Antenna 1 can be multiplexed as a diversity antenna of a wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
移动通信模块150可以提供应用在电子设备上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块150可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(low noise amplifier,LNA)等。移动通信模块150可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块150还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。在一些实施例中,移动通信模块150的至少部分功能模块可以被设置于处理器110中。在一些实施例中,移动通信模块150的至少部分功能模块可以与处理器110的至少部分模块被设置在同一个器件中。The mobile communication module 150 can provide wireless communication solutions including 2G/3G/4G/5G applied to electronic devices. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (low noise amplifier, LNA) and the like. The mobile communication module 150 can receive electromagnetic waves through the antenna 1, filter and amplify the received electromagnetic waves, and send them to the modem processor for demodulation. The mobile communication module 150 can also amplify the signals modulated by the modem processor, and convert them into electromagnetic waves and radiate them through the antenna 1 . In some embodiments, at least part of the functional modules of the mobile communication module 150 may be set in the processor 110 . In some embodiments, at least part of the functional modules of the mobile communication module 150 and at least part of the modules of the processor 110 may be set in the same device.
调制解调处理器可以包括调制器和解调器。其中,调制器用于将待发送的低频基带信号调制成中高频信号。解调器用于将接收的电磁波信号解调为低频基带信号。随后解调器将解调得到的低频基带信号传送至基带处理器处理。低频基带信号经基带处理器处理后,被传递给应用处理器。应用处理器通过音频设备(不限于扬声器170A,受话器170B等)输出声音信号,或通过显示屏194显示图像或视频。在一些实施例中,调制解调处理器可以是独立的器件。在另一些实施例中,调制解调处理器可以独立于处理器110,与移动通信模块150或其他功能模块设置在同一个器件中。A modem processor may include a modulator and a demodulator. Wherein, the modulator is used for modulating the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low frequency baseband signal. Then the demodulator sends the demodulated low-frequency baseband signal to the baseband processor for processing. The low-frequency baseband signal is passed to the application processor after being processed by the baseband processor. The application processor outputs sound signals through audio equipment (not limited to speaker 170A, receiver 170B, etc.), or displays images or videos through display screen 194 . In some embodiments, the modem processor may be a stand-alone device. In some other embodiments, the modem processor may be independent of the processor 110, and be set in the same device as the mobile communication module 150 or other functional modules.
无线通信模块160可以提供应用在电子设备上的包括无线局域网(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 (wireless local area networks, WLAN) (such as wireless fidelity (Wi-Fi) network), bluetooth (bluetooth, BT), global navigation satellite system ( Global navigation satellite system (GNSS), frequency modulation (frequency modulation, FM), near field communication (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 , demodulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110 . The wireless communication module 160 can also receive the signal to be sent from the processor 110 , frequency-modulate it, amplify it, and convert it into electromagnetic waves through the antenna 2 for radiation.
在一些实施例中,电子设备的天线1和移动通信模块150耦合,天线2和无线通信模块160耦合,使得电子设备可以通过无线通信技术与网络以及其他设备通信。所述无线通信技术可以包括全球移动通讯系统(global system for mobile communications,GSM),通用分组无线服务(general packet radio service,GPRS),码分多址接入(code divisionmultiple access,CDMA),宽带码分多址(wideband code division multiple access,WCDMA),时分码分多址(time-division code division multiple access,TD-SCDMA),长期演进(long term evolution,LTE),BT,GNSS,WLAN,NFC,FM,和/或IR技术等。所述GNSS可以包括全球卫星定位系统(global positioning system,GPS),全球导航卫星系统(globalnavigation satellite system,GLONASS),北斗卫星导航系统(beidou navigationsatellite system,BDS),准天顶卫星系统(quasi-zenith satellite system,QZSS)和/或星基增强系统(satellite based augmentation systems,SBAS)。In some embodiments, the antenna 1 of the electronic device is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (general packet radio service, GPRS), code division multiple access (code division multiple access, CDMA), wideband code wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and/or IR technology, etc. The GNSS may include a global positioning system (global positioning system, GPS), a global navigation satellite system (globalnavigation satellite system, GLONASS), a Beidou satellite navigation system (beidou navigationsatellite system, BDS), a quasi-zenith satellite system (quasi-zenith) satellite system (QZSS) and/or satellite based augmentation systems (SBAS).
在本申请实施例中,电子设备可以通过移动通信模块150、无线通信模块160与其它电子设备、服务器等通信,以接收、下载文件资源,并将这些文件资源存储在本地的外存模块中,以供后续电子设备可以对这些文件资源进行读写等。In the embodiment of the present application, the electronic device can communicate with other electronic devices, servers, etc. through the mobile communication module 150 and the wireless communication module 160 to receive and download file resources, and store these file resources in the local external memory module, For subsequent electronic devices to read and write these file resources.
电子设备通过GPU,显示屏194,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。The electronic device realizes the display function through the GPU, the display screen 194, and the application processor. The GPU is a microprocessor for image processing, and is connected to the display screen 194 and the application processor. GPUs are used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
显示屏194用于显示图像,视频等。显示屏194包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD)。显示屏面板还可以采用有机发光二极管(organic light-emitting diode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrix organic light emitting diode,AMOLED),柔性发光二极管(flexlight-emitting diode,FLED),miniled,microLed,micro-oled,量子点发光二极管(quantum dot light emitting diodes,QLED)等制造。在一些实施例中,电子设备可以包括1个或N个显示屏194,N为大于1的正整数。The display screen 194 is used to display images, videos and the like. The display screen 194 includes a display panel. The display panel may be a liquid crystal display (LCD). The display panel can also use organic light-emitting diodes (organic light-emitting diode, OLED), active-matrix organic light-emitting diodes or active-matrix organic light-emitting diodes (active-matrix organic light emitting diode, AMOLED), flexible light-emitting diodes (flexlight-emitting diode, FLED), miniled, microLed, micro-oled, quantum dot light emitting diodes (quantum dot light emitting diodes, QLED), etc. In some embodiments, the electronic device may include 1 or N display screens 194, where N is a positive integer greater than 1.
在本申请实施例中,电子设备的显示屏194可用于显示任务执行结果的用户界面,例如,当上层应用发起的任务的请求是请求打开图库、备忘录等内容时,则电子设备在执行完对应的读取文件操作后,则可以通过显示屏194显示图库中包含的图像、备忘录中记录的事件等信息。In this embodiment of the present application, the display screen 194 of the electronic device can be used to display the user interface of the task execution result. For example, when the task request initiated by the upper-layer application is to request to open the gallery, memo, etc., the electronic device will execute the corresponding After the operation of reading the file, information such as images contained in the gallery and events recorded in the memorandum can be displayed through the display screen 194 .
电子设备可以通过ISP,摄像头193,视频编解码器,GPU,显示屏194以及应用处理器等实现拍摄功能。The electronic device can realize the shooting function through ISP, camera 193 , video codec, GPU, display screen 194 and application processor.
ISP用于处理摄像头193反馈的数据。例如,拍照时,打开快门,光线通过镜头被传递到摄像头感光元件上,光信号转换为电信号,摄像头感光元件将所述电信号传递给ISP处理,转化为肉眼可见的图像。ISP还可以对图像的噪点,亮度,肤色进行算法优化。ISP还可以对拍摄场景的曝光,色温等参数优化。在一些实施例中,ISP可以设置在摄像头193中。The ISP is used for processing the data fed back by the camera 193 . For example, when taking a picture, open the shutter, the light is transmitted to the photosensitive element of the camera through the lens, and the light signal is converted into an electrical signal, and the photosensitive element of the camera 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 color. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, the ISP may be located in the camera 193 .
摄像头193用于捕获静态图像或视频。物体通过镜头生成光学图像投射到感光元件。感光元件可以是电荷耦合器件(charge coupled device,CCD)或互补金属氧化物半导体(complementary metal-oxide-semiconductor,CMOS)光电晶体管。感光元件把光信号转换成电信号,之后将电信号传递给ISP转换成数字图像信号。ISP将数字图像信号输出到DSP加工处理。DSP将数字图像信号转换成标准的RGB,YUV等格式的图像信号。在一些实施例中,电子设备可以包括1个或N个摄像头193,N为大于1的正整数。Camera 193 is used to capture still images or video. The object generates an optical image through the lens and projects it to the photosensitive element. The photosensitive element may be a charge coupled device (charge coupled device, CCD) or a complementary metal-oxide-semiconductor (complementary metal-oxide-semiconductor, CMOS) phototransistor. The photosensitive element converts the light 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 image signals. In some embodiments, the electronic device may include 1 or N cameras 193, where N is a positive integer greater than 1.
在本申请实施例中摄像头193拍摄的图像可被存储在外存模块的图库文件中,以供处理器110通过对图库文件操作,实现查看、删除、编辑图片,更改图片位置等。In the embodiment of the present application, the images captured by the camera 193 can be stored in the gallery file of the external storage module, so that the processor 110 can view, delete, edit pictures, change the position of pictures, etc. by operating the gallery file.
数字信号处理器用于处理数字信号,除了可以处理数字图像信号,还可以处理其他数字信号。例如,当电子设备在频点选择时,数字信号处理器用于对频点能量进行傅里叶变换等。Digital signal processors are used to process digital signals. In addition to digital image signals, they can also process other digital signals. For example, when an electronic device selects a frequency point, a digital signal processor is used to perform Fourier transform on the frequency point energy, etc.
视频编解码器用于对数字视频压缩或解压缩。电子设备可以支持一种或多种视频编解码器。这样,电子设备可以播放或录制多种编码格式的视频,例如:动态图像专家组(moving picture experts group,MPEG)1,MPEG2,MPEG3,MPEG4等。Video codecs are used to compress or decompress digital video. An electronic device may support one or more video codecs. In this way, the electronic device can play or record videos in various encoding formats, such as: moving picture experts group (moving picture experts group, MPEG) 1, MPEG2, MPEG3, MPEG4 and so on.
在本申请实施例中,电子设备在共享屏幕、远程控制以及投屏等场景下,需要通过视频编解码器将当前显示屏194所显示的内容编码成视频流后发送至其他电子设备中。In the embodiment of the present application, in scenarios such as screen sharing, remote control, and screen projection, the electronic device needs to use a video codec to encode the content currently displayed on the display screen 194 into a video stream and then send it to other electronic devices.
内部存储器121可以包括一个或多个随机存取存储器(random access memory,RAM)和一个或多个非易失性存储器(non-volatile memory,NVM)。The internal memory 121 may include one or more random access memories (random access memory, RAM) and one or more non-volatile memories (non-volatile memory, 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)等;Random access memory may include static random-access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (synchronous dynamic random access memory, SDRAM), double data rate synchronous Dynamic random access memory (double data rate synchronous dynamic random access memory, DDR SDRAM, such as the fifth generation DDR SDRAM is generally called DDR5 SDRAM), etc.;
非易失性存储器可以包括磁盘存储器件、快闪存储器(flash memory)。Non-volatile memory may include magnetic disk storage devices, flash memory (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)等。According to the operating principle, flash memory can include NOR FLASH, NAND FLASH, 3D NAND FLASH, etc. According to the potential order of storage cells, it can include single-level storage cells (single-level cell, SLC), multi-level storage cells (multi-level cell, MLC), triple-level cell (TLC), quad-level cell (QLC), etc., can include universal flash storage (English: universal flash storage, UFS), An embedded multimedia memory card (embedded multi media Card, eMMC), etc.
随机存取存储器可以由处理器110直接进行读写,可以用于存储操作系统或其他正在运行中的程序的可执行程序(例如机器指令),还可以用于存储用户及应用程序的数据等。The random access memory can be directly read and written by the processor 110, and can be used to store executable programs (such as machine instructions) of an operating system or other running programs, and can also be used to store data of users and application programs.
非易失性存储器也可以存储可执行程序和存储用户及应用程序的数据等,可以提前加载到随机存取存储器中,用于处理器110直接进行读写。The non-volatile memory can also store executable programs and data of users and application programs, etc., and can be loaded into the random access memory in advance for the processor 110 to directly read and write.
外部存储器接口120可以用于连接外部的非易失性存储器,实现扩展电子设备的存储能力。外部的非易失性存储器通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将音乐,视频等文件保存在外部的非易失性存储器中。The external memory interface 120 can be used to connect an external non-volatile memory, so as to expand the storage capacity of the electronic device. The external non-volatile memory communicates with the processor 110 through the external memory interface 120 to implement a data storage function. For example, files such as music and video are stored in an external non-volatile memory.
在本申请实施例中,外存模块包含:电子设备内置的非易失性存储器和电子设备通过外部存储器接口120连接的外部的非易失性存储器。外存模块是指电子设备的处理器110无法直接进行读写的存储器,而非单纯指空间结构中的处于电子设备外部的存储器。外存模块可用于存储音乐,视频或者各种日志的文件等。电子设备可以通过音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,以及应用处理器等实现音频功能。例如音乐播放,录音等。In the embodiment of the present application, the external memory module includes: a built-in nonvolatile memory of the electronic device and an external nonvolatile memory connected to the electronic device through the external memory interface 120 . The external memory module refers to a memory that cannot be directly read and written by the processor 110 of the electronic device, rather than simply referring to a memory outside the electronic device in a spatial structure. The external memory module can be used to store music, video or various log files, etc. The electronic device can implement audio functions through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, and the application processor. Such as music playback, recording, etc.
音频模块170用于将数字音频信息转换成模拟音频信号输出,也用于将模拟音频输入转换为数字音频信号。音频模块170还可以用于对音频信号编码和解码。在一些实施例中,音频模块170可以设置于处理器110中,或将音频模块170的部分功能模块设置于处理器110中。The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signal. The audio module 170 may also be used to encode and decode audio signals. In some embodiments, the audio module 170 may be set in the processor 110 , or some functional modules of the audio module 170 may be set in the processor 110 .
扬声器170A,也称“喇叭”,用于将音频电信号转换为声音信号。电子设备可以通过扬声器170A收听音乐,或收听免提通话。Speaker 170A, also referred to as a "horn", is used to convert audio electrical signals into sound signals. The electronic device can listen to music through speaker 170A, or listen to hands-free calls.
受话器170B,也称“听筒”,用于将音频电信号转换成声音信号。当电子设备接听电话或语音信息时,可以通过将受话器170B靠近人耳接听语音。Receiver 170B, also called "earpiece", is used to convert audio electrical signals into sound signals. When the electronic device receives a call or a voice message, it can listen to the voice by placing the receiver 170B close to the human ear.
麦克风170C,也称“话筒”,“传声器”,用于将声音信号转换为电信号。当拨打电话或发送语音信息时,用户可以通过人嘴靠近麦克风170C发声,将声音信号输入到麦克风170C。电子设备可以设置至少一个麦克风170C。在另一些实施例中,电子设备可以设置两个麦克风170C,除了采集声音信号,还可以实现降噪功能。在另一些实施例中,电子设备还可以设置三个,四个或更多麦克风170C,实现采集声音信号,降噪,还可以识别声音来源,实现定向录音功能等。The microphone 170C, also called "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a phone call or sending a voice message, the user can put his mouth close to the microphone 170C to make a sound, and input the sound signal to the microphone 170C. The electronic device may be provided with at least one microphone 170C. In other embodiments, the electronic device can be provided with two microphones 170C, which can also implement a noise reduction function in addition to collecting sound signals. In some other embodiments, the electronic device can also be equipped with three, four or more microphones 170C to realize the collection of sound signals, noise reduction, identification of sound sources, and realization of directional recording functions, etc.
耳机接口170D用于连接有线耳机。耳机接口170D可以是USB接口130,也可以是3.5mm的开放移动电子设备平台(open mobile terminal platform,OMTP)标准接口,美国蜂窝电信工业协会(cellular telecommunications industry association of the USA,CTIA)标准接口。The earphone interface 170D is used for connecting wired earphones. The earphone interface 170D may be the USB interface 130, or a 3.5mm open mobile terminal platform (OMTP) standard interface, or a cellular telecommunications industry association of the USA (CTIA) standard interface.
在本申请实施例中,电子设备从外存模块中读取到的音乐文件后,可以通过音频模块170将音乐文件数字音频信息转换成模拟音频信号,然后通过扬声器170A或者受话器170B输出音乐。In this embodiment of the application, after the electronic device reads the music file from the external storage module, the audio module 170 can convert the digital audio information of the music file into an analog audio signal, and then output the music through the speaker 170A or the receiver 170B.
压力传感器180A用于感受压力信号,可以将压力信号转换成电信号。在一些实施例中,压力传感器180A可以设置于显示屏194。压力传感器180A的种类很多,如电阻式压力传感器,电感式压力传感器,电容式压力传感器等。电容式压力传感器可以是包括至少两个具有导电材料的平行板。当有力作用于压力传感器180A,电极之间的电容改变。电子设备根据电容的变化确定压力的强度。当有触摸操作作用于显示屏194,电子设备根据压力传感器180A检测所述触摸操作强度。电子设备也可以根据压力传感器180A的检测信号计算触摸的位置。在一些实施例中,作用于相同触摸位置,但不同触摸操作强度的触摸操作,可以对应不同的操作指令。例如:当有触摸操作强度小于第一压力阈值的触摸操作作用于短消息应用图标时,执行查看短消息的指令。当有触摸操作强度大于或等于第一压力阈值的触摸操作作用于短消息应用图标时,执行新建短消息的指令。The pressure sensor 180A is used to sense the pressure signal and convert the pressure signal into an electrical signal. In some embodiments, pressure sensor 180A may be disposed on display screen 194 . There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, and capacitive pressure sensors. A capacitive pressure sensor may be comprised of at least two parallel plates with conductive material. When a force is applied to the pressure sensor 180A, the capacitance between the electrodes changes. Electronics determine the strength of the pressure based on the change in capacitance. When a touch operation acts on the display screen 194, the electronic device detects the intensity of the touch operation according to the pressure sensor 180A. The electronic device may also calculate the touched position according to the detection signal of the pressure sensor 180A. In some embodiments, touch operations acting on the same touch position but with different touch operation intensities may correspond to different operation instructions. For example: when a touch operation with a touch operation intensity less than the first pressure threshold acts on the short message application icon, an instruction to view short messages is executed. When a touch operation whose intensity is greater than or equal to the first pressure threshold acts on the icon of the short message application, the instruction of creating a new short message is executed.
触摸传感器180B,也称“触控面板”。触摸传感器180B可以设置于显示屏194,由触摸传感器180B与显示屏194组成触摸屏,也称“触控屏”。触摸传感器180B用于检测作用于其上或附近的触摸操作。触摸传感器可以将检测到的触摸操作传递给应用处理器,以确定触摸事件类型。可以通过显示屏194提供与触摸操作相关的视觉输出。在另一些实施例中,触摸传感器180B也可以设置于电子设备的表面,与显示屏194所处的位置不同。The touch sensor 180B is also called "touch panel". The touch sensor 180B can be disposed on the display screen 194, and the touch sensor 180B and the display screen 194 form a touch screen, also called “touch screen”. The touch sensor 180B 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 the touch operation can be provided through the display screen 194 . In some other embodiments, the touch sensor 180B may also be disposed on the surface of the electronic device, which is different from the position of the display screen 194 .
在本申请实施例中,压力传感器180A和触摸传感器180B可用于采集作用于显示屏194上的点击、按压、滑动或者长按操作的相关数据,并将这些数据上报至处理器110,用于处理器110根据这些数据确定对应的事件,以控制电子设备相应的模块执行对应的事件。例如,电子设备的触摸传感器180B可以采集到作用于音乐应用提供的播放本地音乐的控件上的触摸操作的相关数据,并将该数据上报至处理器110,通过分析,处理器110则可以判断到音乐应用发起播放音乐的任务的请求,响应于该请求,处理器110则可以从外存模块中读取对应的音乐文件,以执行播放音乐的任务。In the embodiment of the present application, the pressure sensor 180A and the touch sensor 180B can be used to collect data related to click, press, slide or long press operations on the display screen 194, and report these data to the processor 110 for processing The controller 110 determines corresponding events according to these data, so as to control corresponding modules of the electronic device to execute corresponding events. For example, the touch sensor 180B of the electronic device can collect data related to the touch operation on the control provided by the music application to play local music, and report the data to the processor 110. Through analysis, the processor 110 can determine that The music application initiates a request for the task of playing music, and in response to the request, the processor 110 may read a corresponding music file from the external storage module to execute the task of playing music.
按键190包括开机键,音量键等。按键190可以是机械按键。也可以是触摸式按键。电子设备可以接收按键输入,产生与电子设备的用户设置以及功能控制有关的键信号输入。The keys 190 include a power key, a volume key and the like. The key 190 may be a mechanical key. It can also be a touch button. The electronic device can receive key input and generate key signal input related to user settings and function control of the electronic device.
马达191可以产生振动提示。马达191可以用于来电振动提示,也可以用于触摸振动反馈。例如,作用于不同应用(例如拍照,音频播放等)的触摸操作,可以对应不同的振动反馈效果。作用于显示屏194不同区域的触摸操作,马达191也可对应不同的振动反馈效果。不同的应用场景(例如:时间提醒,接收信息,闹钟,游戏等)也可以对应不同的振动反馈效果。触摸振动反馈效果还可以支持自定义。The motor 191 can generate a vibrating reminder. The motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. For example, touch operations applied to different applications (such as taking pictures, playing audio, etc.) may correspond to different vibration feedback effects. The motor 191 may also correspond to different vibration feedback effects for touch operations acting 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, and can be used to indicate charging status, power change, and can also be used to indicate messages, missed calls, notifications, and the like.
SIM卡接口195用于连接SIM卡。SIM卡可以通过插入SIM卡接口195,或从SIM卡接口195拔出,实现和电子设备的接触和分离。电子设备可以支持1个或N个SIM卡接口,N为大于1的正整数。SIM卡接口195可以支持Nano SIM卡,Micro SIM卡,SIM卡等。同一个SIM卡接口195可以同时插入多张卡。所述多张卡的类型可以相同,也可以不同。SIM卡接口195也可以兼容不同类型的SIM卡。SIM卡接口195也可以兼容外部存储卡。电子设备通过SIM卡和网络交互,实现通话以及数据通信等功能。在一些实施例中,电子设备采用eSIM,即:嵌入式SIM卡。eSIM卡可以嵌在电子设备中,不能和电子设备分离。The SIM card interface 195 is used for connecting a SIM card. The SIM card can be inserted into the SIM card interface 195 or pulled out from the SIM card interface 195 to realize contact and separation with the electronic device. The electronic device can support 1 or N SIM card interfaces, where N is a positive integer greater than 1. SIM card interface 195 can support Nano SIM card, Micro SIM card, SIM card and so on. Multiple cards can be inserted into the same SIM card interface 195 at the same time. The types of the multiple cards may be the same or different. The SIM card interface 195 is also compatible with different types of SIM cards. The SIM card interface 195 is also compatible with external memory cards. The electronic device interacts with the network through the SIM card to realize functions such as calling and data communication. In some embodiments, the electronic device adopts an eSIM, that is, an embedded SIM card. The eSIM card can be embedded in the electronic device and cannot be separated from the electronic device.
参考图3,图3是本申请实施例的电子设备的软件系统结构框图。Referring to FIG. 3 , FIG. 3 is a structural block diagram of a software system of an electronic device according to an embodiment of the present application.
如图3所示,集成嵌入式操作系统的电子设备的软件系统采用的是分层架构。其中,分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在一些实现方式中,将嵌入式操作系统分为四层,从上至下分别为应用程序层,应用程序框架层,算法和内部库,以及内核层。As shown in FIG. 3 , the software system of the electronic device integrated with the embedded operating system adopts a layered architecture. Among them, the layered architecture divides the software into several layers, and each layer has a clear role and division of labor. Layers communicate through software interfaces. In some implementations, the embedded operating system is divided into four layers, which are application program layer, application program framework layer, algorithm and internal library, and kernel layer from top to bottom.
应用程序层可以包括一系列应用程序包。以集成嵌入式操作系统,应用程序例如可以有:地图,音乐,图库,相机,以及未示出的日历,通话,导航,WLAN,蓝牙,视频,短信息、闹钟、运动健康、天气等。这些应用程序运行在嵌入式操作系统之上,一般情况下是与嵌入式操作系统是分开的。应用软件用来实现对被控制对象的控制功能,应用软件层是要面对被控对象和用户,为方便用户操作,通常会提供人机交互界面。The application layer can consist of a series of application packages. With the integrated embedded operating system, the application program can include, for example: map, music, gallery, camera, and calendar not shown, call, navigation, WLAN, Bluetooth, video, short message, alarm clock, sports health, weather, etc. These applications run on the embedded operating system, and are generally separate from the embedded operating system. The application software is used to realize the control function of the controlled object. The application software layer is to face the controlled object and the user. To facilitate the user's operation, a human-computer interaction interface is usually provided.
框架层为应用程序层的应用程序提供应用编程接口(application programminginterface,API)和编程框架,即应用程序层通过Framework API访问/调用应用程序框架层提供的服务,例如包括图3所示的系统基本能力服务、硬件服务、底层软件服务等。The framework layer provides application programming interface (application programming interface, API) and programming framework for the application program of the application program layer, that is, the application program layer accesses/calls the services provided by the application program framework layer through the Framework API, for example, including the basic system shown in Figure 3 Capability services, hardware services, underlying software services, etc.
特别的,在本申请实施例中,为了实现嵌入式操作系统中文件系统的合理性调度,新增了文件系统调度服务,该文件系统调度服务具体可以集成在底层软件服务中,即与原本处于底层软件服务中的文件系统服务(即本申请所说的文件系统)是处于同一级别,并且二者之间通过消息服务请求的方式实现通信。或者,文件系统调度服务也可以被独立设置在应用程序框架层、算法和内部库或内核层等,本申请实施例对此不作任何限制。In particular, in the embodiment of the present application, in order to realize the reasonable scheduling of the file system in the embedded operating system, a new file system scheduling service is added. The file system scheduling service can be integrated in the underlying software service, that is, it is different from The file system service (that is, the file system mentioned in this application) in the underlying software service is at the same level, and the communication between the two is realized through the message service request. Alternatively, the file system scheduling service may also be independently set at the application framework layer, algorithm and internal library or kernel layer, etc., which is not limited in this embodiment of the present application.
可理解的,除了上述所说的文件系统服务、文件系统调度服务,底层软件服务中还可以包括内容管理服务、日志服务、传感器管理服务、蓝牙管理服务等,此处不再一一列举,本申请对此不作限制。Understandably, in addition to the above-mentioned file system services and file system scheduling services, the underlying software services may also include content management services, log services, sensor management services, Bluetooth management services, etc., which will not be listed here. Applications are not limited to this.
在本申请实施例中,当上层应用发起任务,或者应用程序框架层中的其他服务发起任务时,若该任务包括一个或多个文件操作指令时,则文件系统调度服务可以接收到以文件操作指令为粒度的多个对文件系统的调用请求。例如,当任务A包括文件操作指令1、文件操作指令2和文件操作指令3,应用可将文件操作指令1携带在调度请求1中,将文件操作指令2携带在调度请求2中,将文件操作指令3携带在调度请求3中,并将调度请求1、调度请求2和调度请求3发送给文件系统调度服务。然后,文件系统调度服务根据调度策略对上层应用文件系统的调用请求进行排序,从而选出当前最紧迫的调度请求,将该最紧迫的调度请求发送给文件系统服务由文件系统服务根据调度请求中携带的文件操作指令进行文件调度,相当于文件系统调度服务将该最紧迫的调度请求发送给实际的嵌入式文件系统以进行文件操作。相应地,当文件系统服务完成调度,得到对应的结果后,会将得到的结果通过与文件系统调度服务之间的接口传输给文件系统调度服务,进而由文件系统调度服务返回给调度请求的提供者,即对应的任务。In this embodiment of the application, when the upper layer application initiates a task, or other services in the application framework layer initiate a task, if the task includes one or more file operation instructions, the file system scheduling service can receive the file operation instruction Instructions are multiple call requests to the file system at the granularity. For example, when task A includes file operation instruction 1, file operation instruction 2, and file operation instruction 3, the application can carry file operation instruction 1 in scheduling request 1, file operation instruction 2 in scheduling request 2, and file operation instruction 2 in scheduling request 2. Instruction 3 is carried in scheduling request 3, and sends scheduling request 1, scheduling request 2, and scheduling request 3 to the file system scheduling service. Then, the file system scheduling service sorts the calling requests of the upper-layer application file system according to the scheduling policy, so as to select the most urgent scheduling request at present, and send the most urgent scheduling request to the file system service. The carried file operation command performs file scheduling, which is equivalent to the file system scheduling service sending the most urgent scheduling request to the actual embedded file system for file operation. Correspondingly, when the file system service completes the scheduling and obtains the corresponding result, it will transmit the obtained result to the file system scheduling service through the interface with the file system scheduling service, and then the file system scheduling service will return it to the provider of the scheduling request. or, the corresponding task.
关于文件系统调度服务根据调度策略对多个调用请求进行排序的具体实现方法可以参考后文的方法实施例的介绍,在此暂不赘述。For the specific implementation method of sorting multiple invocation requests by the file system scheduling service according to the scheduling policy, reference may be made to the introduction of the method embodiments below, and details will not be repeated here.
算法和内部库用于管理各种算法,如活体检测算法、手势算法、佩戴检测算法、调光算法等,各种基础库,如安全类、条形码、支付类的基础库,以及芯片厂商提供的协议栈,如传统蓝牙协议栈、低功耗协议栈等。Algorithms and internal libraries are used to manage various algorithms, such as liveness detection algorithms, gesture algorithms, wearing detection algorithms, dimming algorithms, etc., and various basic libraries, such as basic libraries for security, barcode, and payment, as well as those provided by chip manufacturers. Protocol stacks, such as traditional Bluetooth protocol stacks, low-power protocol stacks, etc.
应当理解的是,上述说明仅是为了更好的理解本实施例的技术方案而列举的示例,不作为对本实施例的唯一限制。It should be understood that the above description is only an example for better understanding of the technical solution of this embodiment, and is not the only limitation to this embodiment.
内核层包括内核核心、硬件抽象层(HAL)、硬件驱动层。具体到实际应用中,内核核心可以通过微控制器软件接口标准(Cortex Microcontroller Software InterfaceStandard,CMSIS)API与上层进行交互,硬件抽象层可以通过HAL API与上层进行交互。The kernel layer includes the kernel core, the hardware abstraction layer (HAL), and the hardware driver layer. In practical applications, the kernel core can interact with the upper layer through the Cortex Microcontroller Software Interface Standard (CMSIS) API, and the hardware abstraction layer can interact with the upper layer through the HAL API.
HAL可以将系统上层软件和底层硬件分离开来,使系统上层软件开发人员无需关心底层硬件的情况,根据HAL提供的接口来开发即可。也可以将HAL理解为硬件驱动层的一部分。在一些实施例中,应用层可以通过框架层直接调用硬件驱动层,在另一些实施例中,硬件适配层的出现是为了应对电子设备采用多平台硬件的情况,硬件适配层对多个平台提供的硬件驱动接口进行再次封装,保持统一的对外接口,进而使得系统上层软件开发人员无需关心底层硬件的情况,根据HAL提供的接口来开发即可。HAL can separate the upper-layer software of the system from the underlying hardware, so that developers of the upper-layer software of the system do not need to care about the situation of the underlying hardware, and can develop according to the interface provided by HAL. HAL can also be understood as part of the hardware driver layer. In some embodiments, the application layer can directly call the hardware driver layer through the framework layer. In other embodiments, the appearance of the hardware adaptation layer is to deal with the situation that the electronic device adopts multi-platform hardware. The hardware driver interface provided by the platform is re-encapsulated to maintain a unified external interface, so that the upper-level software developers of the system do not need to care about the underlying hardware, and can develop according to the interface provided by HAL.
内核层包含板载硬件资源正常运行所需的所有驱动程序,并提供API给上层调用。内核层例如包含显示驱动,摄像头驱动,音频驱动,传感器驱动等。The kernel layer contains all the drivers required for the normal operation of onboard hardware resources, and provides APIs for upper layer calls. The kernel layer includes display drivers, camera drivers, audio drivers, sensor drivers, etc., for example.
基于上文对电子设备的软硬件架构的介绍,接下来介绍本申请提供的一种嵌入式文件系统的调度方法流程图。Based on the above introduction to the software and hardware architecture of the electronic device, a flow chart of a scheduling method for an embedded file system provided by the present application is introduced next.
如图4所示,该方法流程包括以下步骤:As shown in Figure 4, the method flow includes the following steps:
S101,电子设备生成多个任务,一个任务包括一个或多个调度请求。S101. The electronic device generates multiple tasks, and one task includes one or more scheduling requests.
具体的,电子设备中的一个或多个应用或服务在运行过程中可以自触发的或者根据用户操作触发生成多个任务,电子设备通过创建多个线程以执行该多个任务。其中一个任务可以包含一个多个文件操作,相应的每个文件操作对应一个调度请求,该调度请求用于调度嵌入式文件系统执行对应的文件操作。也就是说,每个任务对应的件调度请求是以每个任务包含的文件操作为粒度而生成的。此外,上述多个调度请求可以是电子设备同时或者在短时间内生成的。Specifically, one or more applications or services in the electronic device may generate multiple tasks by self-triggering or triggering according to user operations during operation, and the electronic device creates multiple threads to execute the multiple tasks. One of the tasks may include multiple file operations, and each file operation corresponds to a scheduling request, and the scheduling request is used to schedule the embedded file system to execute the corresponding file operation. That is to say, the file scheduling request corresponding to each task is generated at the granularity of the file operations included in each task. In addition, the above multiple scheduling requests may be generated by the electronic device simultaneously or within a short period of time.
以一个具体的示例来看,当电子设备中安装有音乐、导航等应用时,当音乐在接收到用户输入的用于播放音乐的操作时,则音乐应用会创建线程用于执行播放音乐的任务,该任务可能涉及多个读音乐文件的操作,因此电子设备的嵌入式操作系统中的文件系统调度服务可以接收到音乐应用中的任务发起的对文件系统的多个调度请求。当导航应用在接收到用户输入的用于开启GPS功能的操作时,则导航应用会创建线程用于执行记录GPS数据的任务,该任务涉及多个写GPS文件的操作,因此电子设备的嵌入式操作系统中的文件系统调度服务可以接收到导航应用中的任务发起的对文件系统的多个调度请求。Taking a specific example, when music, navigation and other applications are installed in the electronic device, when the music receives an operation input by the user for playing music, the music application will create a thread to perform the task of playing music , the task may involve multiple operations for reading music files, so the file system scheduling service in the embedded operating system of the electronic device may receive multiple scheduling requests to the file system initiated by tasks in the music application. When the navigation application receives the operation input by the user to enable the GPS function, the navigation application will create a thread to perform the task of recording GPS data. This task involves multiple operations of writing GPS files, so the embedded The file system scheduling service in the operating system may receive multiple scheduling requests to the file system initiated by tasks in the navigation application.
S102,电子设备根据任务的优先级和/或调度请求的等待时间依次响应多个调度请求。S102, the electronic device sequentially responds to multiple scheduling requests according to the priority of the tasks and/or the waiting time of the scheduling requests.
具体的,电子设备中的应用或服务将多个任务对应的多个调度请求发送至文件系统调度服务中,文件系统调度服务根据任务的优先级和/或调度请求的等待时间依次响应多个调度请求,即依次调度对应的文件系统以执行对应的文件操作。Specifically, the application or service in the electronic device sends multiple scheduling requests corresponding to multiple tasks to the file system scheduling service, and the file system scheduling service responds to multiple scheduling requests in sequence according to the priority of the task and/or the waiting time of the scheduling request. Request, that is, sequentially schedule the corresponding file system to execute the corresponding file operation.
其中,文件系统调度服务根据任务的优先级和/或调度请求的等待时间依次响应多个调度请求具体按照以下三种策略进行响应。Wherein, the file system scheduling service responds to multiple scheduling requests sequentially according to the priority of the task and/or the waiting time of the scheduling request, and specifically responds according to the following three strategies.
策略一:每次从多个未被响应的调度请求中选取优先级最高的任务优对应的调度请求作为目标调度请求(也称最紧迫的调度请求)进行响应,若优先级最高的任务对应的调度请求有多个时,则按照调度请求的到达时间由前到后的顺序依次响应。Strategy 1: Select the scheduling request corresponding to the task with the highest priority from multiple unresponsed scheduling requests each time as the target scheduling request (also called the most urgent scheduling request) to respond, if the task with the highest priority corresponds to When there are multiple scheduling requests, they will be responded in sequence according to the arrival time of the scheduling requests from front to back.
策略二:每次从多个调度请求中选取等待时间达到对应的第一阈值的调度请求作为目标调度请求(也称最紧迫的调度请求)进行响应,若等待时间达到对应的第一阈值的调度请求有多个时,则按照调度请求的到达时间由前到后的顺序依次响应。Strategy 2: Select the scheduling request whose waiting time reaches the corresponding first threshold from multiple scheduling requests each time as the target scheduling request (also called the most urgent scheduling request) to respond, if the scheduling request whose waiting time reaches the corresponding first threshold When there are multiple requests, they will be responded in sequence according to the arrival time of the scheduling requests from front to back.
策略三:考虑到在业务繁忙的情况下,会同时或短时间内接收到多个调度请求时,该多个调度请求可能存在同一优先级的任务对应的多个调度请求,也可能还存在等待时间大于对应的第一阈值的多个调度请求,因此可以同时考虑任务优先级和等待时间这两个因素,来依次从未被响应的调度请求中选取目标调度请求进行响应,具体包括图5示出的以下步骤:Strategy 3: Considering that in the case of busy business, when multiple scheduling requests are received at the same time or in a short period of time, there may be multiple scheduling requests corresponding to tasks of the same priority in the multiple scheduling requests, or there may be waiting Multiple scheduling requests whose time is greater than the corresponding first threshold, so the two factors of task priority and waiting time can be considered at the same time to select the target scheduling request from the unresponsed scheduling requests to respond, specifically including Out of the following steps:
S1031,电子设备将多个调度请求加入至第一队列。S1031. The electronic device adds multiple scheduling requests to the first queue.
具体的,电子设备的文件系统调度服务先将接收到的多个调度请求都加入至第一队列。可选的,文件系统调度服务可以按照任务的优先级由高到低的顺序依次将对应的多个调度请求按序加入至第一队列中。Specifically, the file system scheduling service of the electronic device first adds multiple received scheduling requests to the first queue. Optionally, the file system scheduling service may sequentially add multiple corresponding scheduling requests to the first queue in order of priority of tasks from high to low.
在本申请,第一队列又称普通队列。In this application, the first queue is also called a common queue.
S1032,电子设备从第一队列中未被响应的调度请求中选取优先级最高的调度请求进行响应。S1032. The electronic device selects a scheduling request with the highest priority from the unresponded scheduling requests in the first queue to respond.
具体的,在初始情况下,第一队列中未被响应的调度请求的等待时间通常较短,还未达到对应的第一阈值(又称饿死时间),因此电子设备的文件系统调度服务从第一队列中未被响应的调度请求中选取优先级最高的调度请求进行响应。若优先级最高的任务对应的调度请求有多个时,则按照调度请求的到达时间选取最先到的并且优先级最高的调度请求进行响应。Specifically, in the initial situation, the waiting time of unresponsive scheduling requests in the first queue is usually short, and has not yet reached the corresponding first threshold (also known as the starvation time), so the file system scheduling service of the electronic device starts from Select the scheduling request with the highest priority from the scheduling requests that have not been responded in the first queue to respond. If there are multiple scheduling requests corresponding to the task with the highest priority, the scheduling request that arrives first and has the highest priority is selected for response according to the arrival time of the scheduling request.
S1033,电子设备判断第一队列中未被响应的调度请求的等待时间是否达到第一阈值。S1033. The electronic device judges whether the waiting time of unresponsed scheduling requests in the first queue reaches a first threshold.
具体的,随着电子设备响应第一队列中的调度请求的过程中,第一队列中未被响应的调度请求的等待时间通常逐渐增长,为了避免未被响应的调度请求长时间等到都得不到响应,因此要及时检测出等到时间达到(大于或等于)第一阈值的调度请求,以实施后续的及时响应的策略。Specifically, as the electronic device responds to the scheduling requests in the first queue, the waiting time of the unresponsed scheduling requests in the first queue usually gradually increases. Therefore, it is necessary to detect in time the scheduling request whose waiting time reaches (greater than or equal to) the first threshold, so as to implement the subsequent strategy of timely response.
若电子设备判断到第一队列中存在未被响应的调度请求的等待时间达到第一阈值的调度请求,则电子设备执行后续的步骤S1034-S1036;否则,电子设备循环执行S1032-S1033。If the electronic device determines that there are unresponsive scheduling requests whose waiting time reaches the first threshold in the first queue, the electronic device executes subsequent steps S1034-S1036; otherwise, the electronic device executes S1032-S1033 in a loop.
S1034,电子设备将第一队列中未被响应的且等待时间达到第一阈值的调度请求加入至第二队列。S1034. The electronic device adds scheduling requests that have not been responded to in the first queue and whose waiting time reaches the first threshold to the second queue.
具体的,随着电子设备响应第一队列中的调度请求的过程中,第一队列中未被响应的调度请求的等待时间通常逐渐增长,即出现一个或多个调度请求的等待时间达到对应的饿死时间,因此电子设备的文件系统调度服务等待时间达到对应的饿死时间的一个或多个调度请求移至第二队列中,用于后续被优先响应。在本申请,第二队列又称VIP队列。Specifically, as the electronic device responds to the scheduling requests in the first queue, the waiting time of the unresponded scheduling requests in the first queue usually increases gradually, that is, the waiting time of one or more scheduling requests reaches the corresponding starvation time, therefore, one or more scheduling requests whose waiting time of the file system scheduling service of the electronic device reaches the corresponding starvation time are moved to the second queue for subsequent priority response. In this application, the second queue is also called the VIP queue.
S1035,电子设备从第二队列中未被响应的调度请求中选取优先级最高的调度请求进行响应。S1035. The electronic device selects a scheduling request with the highest priority from the unresponded scheduling requests in the second queue to respond.
具体的,由于第二队列中的调度请求都是达到对应饥饿时间的调度请求,也即对实时性要求较高且快超时的调度请求,因此相对于第一队列中还未达到对应饥饿时间的调度请求来说,电子设备的文件系统调度服务应当优先从第而队列中未被响应的调度请求中选取优先级最高的调度请求进行响应。若优先级最高的任务对应的调度请求有多个时,则按照调度请求的到达时间选取最先到的并且优先级最高的调度请求进行响应。这样,可以保证高优先级、高实时性要求的调度请求能够尽早被响应。Specifically, since the scheduling requests in the second queue are all scheduling requests that have reached the corresponding starvation time, that is, scheduling requests that have high real-time requirements and are about to time out, compared with those in the first queue that have not reached the corresponding starvation time For scheduling requests, the file system scheduling service of the electronic device should give priority to selecting the scheduling request with the highest priority from the scheduling requests that have not been responded to in the second queue to respond. If there are multiple scheduling requests corresponding to the task with the highest priority, the scheduling request that arrives first and has the highest priority is selected for response according to the arrival time of the scheduling request. In this way, it can be guaranteed that scheduling requests with high priority and high real-time requirements can be responded as soon as possible.
(可选步骤)S1036,电子设备判断第二队列是否为空,或者连续响应第二队列中的调度请求的时长是否超过第二阈值。(Optional step) S1036. The electronic device determines whether the second queue is empty, or whether the duration of continuously responding to the scheduling requests in the second queue exceeds a second threshold.
具体的,电子设备的文件系统调度服务在响应第二队列中的调度请求的过程中,会记录连续响应第二队列中的调度请求的时长,以及判断第二队列是否还为空。Specifically, during the process of responding to the scheduling request in the second queue, the file system scheduling service of the electronic device will record the duration of continuously responding to the scheduling request in the second queue, and determine whether the second queue is still empty.
当判断到第二队列为空,或者连续响应第二队列中的调度请求的时长达到第二阈值(又称吃饱时间)时,则电子设备跳转至执行S1032。当判断到第二队列非空,且连续响应第二队列中的调度请求的时长未达到(小于)第二阈值(又称吃饱时间)时,则电子设备跳转至前述步骤S1035。When it is judged that the second queue is empty, or the duration of continuously responding to the scheduling requests in the second queue reaches a second threshold (also known as the full time), the electronic device jumps to execute S1032. When it is determined that the second queue is not empty, and the duration of continuously responding to the scheduling requests in the second queue does not reach (less than) the second threshold (also known as the full time), the electronic device jumps to the aforementioned step S1035.
可选的,在电子设备执行完步骤S1035之后,可以继续步骤S1035,直至第二队列中没有未被响应的调度请求时,在跳转至执行S1032。也就是说,电子设备无需考虑第二队列的吃饱时间,只要第二队列中存在等待时间到饥饿时间的调度请求时,则持续响应第二队列中的调度请求,直至第二队列为空。Optionally, after the electronic device executes step S1035, it may continue to step S1035 until there is no unresponsive scheduling request in the second queue, and then jump to execute S1032. That is to say, the electronic device does not need to consider the full time of the second queue, as long as there are scheduling requests from the waiting time to the starvation time in the second queue, it will continue to respond to the scheduling requests in the second queue until the second queue is empty.
上述调度请求对应的任务的优先级(也可也称为调度请求的优先级),是根据发起该任务的上层应用对文件系统的依赖程度确定的。例如,对于发起传感器任务、显示任务、空中下载任务、音频任务、GPS任务的应用来说,这些应用通常对文件系统的依赖程度较高,因此将这类任务的优先级设置较高;对于发起输入、能力任务(如蓝牙传输任务、平台中各驱动的任务)和日志任务的应用来说,这些应用对文件系统的依赖性低,可以将这类任务的优先级设置较低。特别的是,上述传感器任务对应的调度请求、显示任务对应的调度请求对实时性要求高较高,因此,可以将传感器任务、显示任务的优先级设置更高;而记录系统/程序运行过程中产生的数据的日志任务对应的调度请求实时性要求较低,因此,可以将日志任务的优先级设置更低。The priority of the task corresponding to the scheduling request (also referred to as the priority of the scheduling request) is determined according to the degree of dependence of the upper-layer application initiating the task on the file system. For example, for applications that initiate sensor tasks, display tasks, over-the-air tasks, audio tasks, and GPS tasks, these applications usually have a high degree of dependence on the file system, so the priority of such tasks is set higher; For applications of input, capability tasks (such as Bluetooth transmission tasks, tasks of various drivers in the platform) and log tasks, these applications have low dependence on the file system, and the priority of such tasks can be set lower. In particular, the scheduling requests corresponding to the above sensor tasks and the scheduling requests corresponding to the display tasks have high requirements for real-time performance. Therefore, the priority of the sensor tasks and display tasks can be set higher; while the recording system/program running process The scheduling request corresponding to the log task of the generated data has low real-time requirements, so the priority of the log task can be set lower.
关于任务的优先级划分,具体可以参考表1。For the priority division of tasks, please refer to Table 1 for details.
表1优先级策略表Table 1 priority policy table
应当理解的是,上述说明以及表1所示内文仅是为了更好的理解本实施例的技术方案而列举的示例,不作为对本实施例的唯一限制。It should be understood that the above description and the content shown in Table 1 are only examples for better understanding of the technical solution of this embodiment, and are not intended as the only limitation to this embodiment.
通过上述对不同任务优先级设置的描述,不同任务对应的调度请求中配置的饥饿时间也可以根据优先级来设置,例如优先级越高的,说明实时性要求越高,其对应的饥饿时间可以越小,而优先级低的,说明实时性要求越低,其饥饿时间可以越大。基于这一原理,为不同任务对应的调度请求配置的饥饿时间,可以如表2所示。Through the above description of different task priority settings, the starvation time configured in the scheduling request corresponding to different tasks can also be set according to the priority. For example, the higher the priority, the higher the real-time requirement, and the corresponding starvation time can be The smaller the value, the lower the priority, the lower the real-time requirement and the greater the hunger time. Based on this principle, the starvation time configured for scheduling requests corresponding to different tasks can be shown in Table 2.
表2饥饿时间策略表Table 2 Starvation time strategy table
可理解的,表2中记录的不同优先级的任务对应的饥饿时间,仅是为了更好的理解本实施例的技术方案而列举的示例,不作为对本实施例的唯一限制。在实际应用中,饥饿时间策略可以以表格,或者XML等任意能够体现优先级与饥饿时间二者关系的形式记录。It can be understood that the starvation time corresponding to tasks with different priorities recorded in Table 2 is only an example for better understanding the technical solution of this embodiment, and is not the only limitation to this embodiment. In practical applications, the starvation time policy can be recorded in any form such as a table or XML that can reflect the relationship between the priority and the starvation time.
可选的,图5所述的方法还可以包括以下步骤:在执行完步骤S1036并跳转至执行S1032后,也会记录连续响应第一队列中的调度请求的时长,当该时长达到第一队列的吃饱时间时,也可以切换至响应第二队列中的调度请求。Optionally, the method described in FIG. 5 may further include the following steps: after executing step S1036 and jumping to execute S1032, the duration of continuous response to the scheduling request in the first queue will also be recorded, and when the duration reaches the first When the queue is full, it can also switch to respond to the scheduling request in the second queue.
可选的,图5所述的方法流程所包含的普通队列和VIP队列仅为示例,在本申请另一些示例中,还可以设置更多的队列,不同的队列的优先级不同,不同的队列的吃饱时间不同。设置每个调度请求的多个饿死时间,将等待时间处于不同范围内的调度请求加入至对应的队列中,优先级越高的队列中的调度请求可以被优先响应,当某个队列中的调度请求被连续响应的总时长达到对应的吃饱时间时,则切换至响应至比当前队列优先级较低的队列中的调度请求。Optionally, the ordinary queues and VIP queues included in the method flow described in Figure 5 are only examples. In other examples of this application, more queues can also be set, and different queues have different priorities. Different queues The time to be full is different. Set multiple starvation times for each scheduling request, and add scheduling requests with waiting times in different ranges to corresponding queues. Scheduling requests in queues with higher priorities can be responded to first. When the total duration of the continuous response of the scheduling request reaches the corresponding full time, it will switch to respond to the scheduling request in the queue with a lower priority than the current queue.
可选的,图5所示的方法流程还可以包括以下步骤:Optionally, the method flow shown in Figure 5 may also include the following steps:
在本申请提供的文件系统调度服务的基础上,还可以动态的调整上述调度请求对应的任务的优先级、每个调度请求对应的饥饿时间或者每个队列对应的吃饱时间等中的任一项或多项,进而使得文件系统调度服务能够适应上层应用的业务特性(即用户的使用需求)的变化,在每次选取目标调度请求时,能够根据更加合理的调度策略选择出目标调度请求,进一步地提升文件系统服务的调度能力。On the basis of the file system scheduling service provided by this application, it is also possible to dynamically adjust the priority of the task corresponding to the above scheduling request, the starvation time corresponding to each scheduling request, or the full time corresponding to each queue, etc. One or more items, so that the file system scheduling service can adapt to changes in the business characteristics of the upper-layer application (that is, the user's use requirements). When selecting a target scheduling request each time, the target scheduling request can be selected according to a more reasonable scheduling strategy. Further improve the scheduling capability of file system services.
具体的,关于优先级、饥饿时间以及吃饱时间调整方法例如可以是,根据用户使用该电子设备期间,周期性采集到的DFT数据来动态调整的。在本实施例中DFT数据,包括但不限于以下任意一种或多种:调度者统计信息(即上层应用的TaskId或应用标识)、文件请求次数(记录每个文件被调度的次数)、预设时间内(如1秒内)请求最多的上层应用、上层应用对应的调度请求失败的次数、上层应用触发调度请求到处理完的响应时长、每个调度请求在普通队列的等待时长、VIP队列的总运行时长等。Specifically, the method for adjusting priority, hunger time, and full time may be dynamically adjusted according to DFT data collected periodically during the user's use of the electronic device, for example. In this embodiment, DFT data includes, but is not limited to, any one or more of the following: scheduler statistical information (i.e. TaskId or application identifier of the upper-layer application), file request times (recording the number of times each file is scheduled), scheduled The upper-layer application with the most requests within a set time (for example, within 1 second), the number of failed scheduling requests corresponding to the upper-layer application, the response time from when the upper-layer application triggers the scheduling request to the completion of processing, the waiting time of each scheduling request in the normal queue, and the VIP queue the total running time, etc.
为了实现对上述DFT数据的收集,从而根据收集到的DFT数据更新文件系统调度服务所遵循的文件服务调度策略,本实施例在上述文件系统调度服务的结构中,引入了DFT数据收集模块。示例性的,在一些实现方式中,DFT数据收集模块可以为一个;在另一些实现方式中,DFT数据收集模块也可以是多个。通过上述罗列的DFT数据中收集的内容可知,对于调用者统计信息、文件请求次数是在文件系统调度服务中的封装模块处获取的,而其他信息则可以在调度模块获取,也可以在封装模块获取。In order to collect the above DFT data and update the file service scheduling policy followed by the file system scheduling service according to the collected DFT data, this embodiment introduces a DFT data collection module into the structure of the above file system scheduling service. Exemplarily, in some implementation manners, there may be one DFT data collection module; in other implementation manners, there may be multiple DFT data collection modules. From the content collected in the DFT data listed above, it can be seen that the statistical information of the caller and the number of file requests are obtained from the encapsulation module in the file system scheduling service, while other information can be obtained in the scheduling module or in the encapsulation module Obtain.
通过上文对图5所示的嵌入式文件系统调度方法流程图的介绍可以知道,本申请提供的嵌入式文件系统的调度方法,既考虑到满足每个调度请求的实时性要求,也考虑到保证整体调度请求的公平性要求。具体的,通过设置不同优先级的多个队列如上文中的普通队列(低优先级)和VIP队列(高优先级),优先级高的队列用于容纳等待时长即将达到业务要求时长的调度请求,优先级较低的队列用于容纳等待时长还未达到业务要求时长的调度请求,为保证调度请求的实时性要求,优先响应高优先级队列中的调度请求。此外,为了保证整体调度请求的公平性,还设置了响应高优先级队列中的调度请求的总时间阈值,达到阈值后则切换至响应低优先级队列中的调度请求。并且,为了进一步满足每个调度请求所属业务的要求时长,即进一步满足每个调度请求的实时性要求,在响应每个队列中的调度请求时,按照紧迫程度由高到低(调度请求对应的任务的优先级由高到低)的顺序依次响应。From the above introduction to the flow chart of the embedded file system scheduling method shown in Figure 5, it can be known that the scheduling method of the embedded file system provided by this application not only takes into account the real-time requirements of each scheduling request, but also takes into account Guarantees the fairness requirements of the overall scheduling request. Specifically, by setting multiple queues with different priorities such as the normal queue (low priority) and VIP queue (high priority) above, the queue with high priority is used to accommodate scheduling requests whose waiting time is about to reach the business requirement. The lower-priority queue is used to accommodate scheduling requests whose waiting time has not reached the service requirement. In order to ensure the real-time requirements of scheduling requests, priority is given to responding to scheduling requests in high-priority queues. In addition, in order to ensure the fairness of the overall scheduling request, a total time threshold for responding to scheduling requests in the high-priority queue is also set. When the threshold is reached, it will switch to respond to scheduling requests in the low-priority queue. And, in order to further meet the required duration of the business to which each scheduling request belongs, that is, to further meet the real-time requirements of each scheduling request, when responding to scheduling requests in each queue, the urgency is ranked from high to low (the scheduling request corresponds to The priority of the task is from high to low) to respond in turn.
接下来,以上文步骤S102中策略三所述的一种具体的选取目标调度请求进行响应的方法为例,结合前文图3介绍的嵌入式系统架构,来详细介绍本申请提供的一种嵌入式文件系统的调度方法。Next, take a specific method of selecting a target scheduling request and responding to the target scheduling request described in the third step in step S102 as an example, and combine the embedded system architecture introduced in Figure 3 above to introduce in detail an embedded The scheduling method for the file system.
参考图6,图6示例性示出本申请实施例提供的一种嵌入式系统中的文件系统调度框架图。Referring to FIG. 6 , FIG. 6 schematically shows a file system scheduling framework diagram in an embedded system provided by an embodiment of the present application.
如图6所示,嵌入式系统架构中的文件系统调度服务可包括:封装模块、调度模块和执行模块。As shown in FIG. 6, the file system scheduling service in the embedded system architecture may include: an encapsulation module, a scheduling module and an execution module.
封装模块用于接收上层应用发起的任务对文件系统的多个调度请求,并从调度请求中提取文件操作指令,及任务标识号等信息,并将提取到的信息按照预定格式封装为结构体,使得调度请求以结构体的形式在嵌入式操作系统中传递。该多个调度请求例如包括图6示出的任务1、任务2、任务3、任务4等的调度请求,或者还可以包括更多或者更少的调度请求,本申请对此不作限制。The encapsulation module is used to receive multiple scheduling requests to the file system from tasks initiated by upper-layer applications, and extract information such as file operation instructions and task identification numbers from the scheduling requests, and encapsulate the extracted information into a structure according to a predetermined format. The scheduling request is transmitted in the embedded operating system in the form of a structure. The multiple scheduling requests include, for example, the scheduling requests of task 1, task 2, task 3, and task 4 shown in FIG. 6, or may also include more or fewer scheduling requests, which is not limited in the present application.
可以理解的是,本申请实施中所述的调度请求是指,由上层应用或其他服务触发的任务所提供的调度请求,一个任务可以包含一个或多个调度请求,示例性的,对于读文件任务来说,该读文件任务可以包含如上文所说的r1、r2、r3、r4中的任意一项或几项文件操作指令,因此该一个读任务以文件操作指令为粒度发起对应的一个或多个调度请求。It can be understood that the scheduling request mentioned in the implementation of this application refers to the scheduling request provided by the task triggered by the upper layer application or other services. A task may contain one or more scheduling requests. For example, for reading files In terms of tasks, the file read task can include any one or several file operation instructions in r1, r2, r3, and r4 as mentioned above, so the read task initiates a corresponding one or more file operation instructions at the granularity of the file operation instruction Multiple dispatch requests.
在一种实施方式中,封装模块将每个调度请求封装得到的结构体包括但不限于以下参数:文件对象结构体(FIP)、文件名(FileName)、文件操作指令(OperaCmd)、上层应用的任务标识号(TsakId)、文件信息结构体(FILINF)、当前调度的状态(EnuFlag)、超时等待时间(WaitTime)、饥饿时间(HungtryTime)、文件操作返回结果(FileOperaErr)等。其中,参数FIP、FileName、OperaCmd、TsakId、WaitTime等可以在封装模块中进行赋值,具体由封装模块从接收到的调度请求中提取信息来赋值。其余参数,则可以由后续相应的模块进行赋值。也就是说,封装模块输出的调度请求,即图6中的②中发送的调度请求,仅有FIP、FileName、OperaCmd、TsakId、WaitTime这几个参数是有具体的信息的,而、HungtryTimeEnuFlag、FileOperaErr这几个参数是没有具体信息的。In one embodiment, the structure obtained by encapsulating each scheduling request by the encapsulation module includes but is not limited to the following parameters: file object structure (FIP), file name (FileName), file operation instruction (OperaCmd), upper layer application Task identification number (TsakId), file information structure (FILINF), current scheduling status (EnuFlag), timeout waiting time (WaitTime), hunger time (HungtryTime), file operation return result (FileOperaErr), etc. Among them, the parameters FIP, FileName, OperaCmd, TsakId, WaitTime, etc. can be assigned values in the encapsulation module, specifically, the encapsulation module extracts information from the received scheduling request to assign values. The remaining parameters can be assigned by subsequent corresponding modules. That is to say, the scheduling request output by the encapsulation module, that is, the scheduling request sent in ② in Figure 6, only has specific information on the parameters of FIP, FileName, OperaCmd, TsakId, and WaitTime, while HungtryTimeEnuFlag and FileOperaErr These parameters have no specific information.
调度模块从多个调度请求中选取最紧迫的调度请求(优先级最高的调度请求)作为目标调度请求,并将选取的目标调度请求发送至执行模块。其中,图6中的步骤③,即调度模块选取目标调度请求发送至调度模块具体包括的步骤可以参考前文步骤S1031-S1036的描述,在此暂不赘述。The scheduling module selects the most urgent scheduling request (the scheduling request with the highest priority) from the multiple scheduling requests as the target scheduling request, and sends the selected target scheduling request to the execution module. Wherein, step ③ in FIG. 6 , that is, the specific steps involved in selecting a target scheduling request by the scheduling module and sending it to the scheduling module can refer to the description of steps S1031-S1036 above, and will not be repeated here.
其中,关于任务的优先级、饥饿时间的获取方法包括:调度模块可以根据表示每个调度请求的结构体中的特定参数即TsakId,获取到该调度请求对应的任务的优先级,还可以根据每个调度请求的结构体中的特定参数即HungtryTime,或该调度请求对应的饥饿时间。Among them, the method for obtaining the priority of the task and the starvation time includes: the scheduling module can obtain the priority of the task corresponding to the scheduling request according to the specific parameter TsakId in the structure representing each scheduling request; The specific parameter in the structure of a scheduling request is HungtryTime, or the hunger time corresponding to the scheduling request.
此外,调度模块还用于为表示每个调度请求的结构体中特定参数进行赋值,包括为EnuFlag和HungtryTime赋值。具体的,调度模块可以根据调度请求的TsakId,获取到该调度请求对应的饥饿时间,从而为HungtryTime赋值,以及调度模块根据调度请求是否被响应来为EnuFlag赋值,例如0标识未被响应,1则标识已经被响应等。In addition, the scheduling module is also used to assign values to specific parameters in the structure representing each scheduling request, including assigning values to EnuFlag and HungtryTime. Specifically, the scheduling module can obtain the hunger time corresponding to the scheduling request according to the TsakId of the scheduling request, thereby assigning a value to HungtryTime, and the scheduling module assigns a value to EnuFlag according to whether the scheduling request is responded, for example, 0 indicates that it has not been responded, and 1 means ID has been responded to, etc.
执行模块用于接收调度模块选取的目标调度请求,响应该目标调度请求,执行模块可以将该目标调度请求发送至文件系统服务即执行步骤④,由文件系统服务调度对应的文件系统的接口以执行对应的文件操作,在得到处理结果后,会将处理结果发送给执行模块,即执行步骤⑤。然后执行模块得到文件系统服务返回的处理结果后,则执行模块还将包含处理结果的信息发送至封装模块。The execution module is used to receive the target scheduling request selected by the scheduling module. In response to the target scheduling request, the execution module can send the target scheduling request to the file system service, that is, execute step ④, and the file system service schedules the corresponding file system interface to execute The corresponding file operation, after obtaining the processing result, will send the processing result to the execution module, that is, execute step ⑤. Then, after the execution module obtains the processing result returned by the file system service, the execution module also sends information including the processing result to the encapsulation module.
或者,在另一种可能实现的方法中,执行模块接收调度模块选取的目标调度请求后,响应该目标调度请求,执行模块可以直接调度对应的文件系统的接口以执行对应的文件操作,在执行模块得到处理结果后,会将处理结果发送给封装模块,即执行步骤⑥。Or, in another possible implementation method, after the execution module receives the target scheduling request selected by the scheduling module, in response to the target scheduling request, the execution module can directly schedule the corresponding file system interface to execute the corresponding file operation. After the module obtains the processing result, it will send the processing result to the encapsulation module, that is, execute step ⑥.
此外,执行模块还用于为表示每个调度请求的结构体中特定参数进行赋值,包括为FileOperaErr参数。具体的,执行模块在调度文件系统响应调度请求后,可以获取到文件系统返回的执行结果,则执行模块个根据该执行结果为FileOperaErr参数数值。In addition, the execution module is also used to assign values to specific parameters in the structure representing each scheduling request, including the FileOperaErr parameter. Specifically, after the execution module dispatches the file system to respond to the dispatch request, it can obtain the execution result returned by the file system, and then the execution module sets the value of the FileOperaErr parameter according to the execution result.
最后,执行模块将包含执行结果的信息通过封装模块返回给上层应用。具体的,执行模块可以将包含返回结果的信息先返回至封装模块,该包含返回结果的信息例如可以是已经为FileOperaErr参数赋值后的表示每个调度请求的结构体。在一些实例中,返回的执行结果例如可以是实际读取到的数据。Finally, the execution module returns the information including the execution result to the upper application through the encapsulation module. Specifically, the execution module may return the information including the returned result to the encapsulation module first, and the information including the returned result may be, for example, a structure representing each scheduling request after the FileOperaErr parameter has been assigned a value. In some instances, the returned execution result may be actually read data, for example.
接下来结合图7,来介绍本申请提供的方法后能够达到的技术效果。Next, with reference to FIG. 7 , the technical effects that can be achieved by the method provided by the present application will be introduced.
参考图7,图7示例性示出本申请实施例提供的一种两个任务场景下对嵌入式文件系统的调度逻辑图。Referring to FIG. 7 , FIG. 7 exemplarily shows a scheduling logic diagram for an embedded file system in two task scenarios provided by an embodiment of the present application.
如图7所示,当电子设备的上层应用或服务先后发起task1和task2后,则可以分别创建线程Thread1-task1来执行task1,创建线程Thread1-task2来执行task2,As shown in Figure 7, when the upper-layer application or service of the electronic device initiates task1 and task2 successively, a thread Thread1-task1 can be created to execute task1, and a thread Thread1-task2 can be created to execute task2.
其中,当task1包含的3个个文件操作时则相应的生成Req1、Req2、Req3这三个调度请求。当task2包含的2个文件操作时则相应的生成Req4、Req5这两个个调度请求。Wherein, when the three files included in task1 are operated, three scheduling requests Req1, Req2 and Req3 are correspondingly generated. When the two files included in task2 are operated, two scheduling requests Req4 and Req5 are correspondingly generated.
关于task1和task2对应的调度请求的达到时间的先后顺序可以参考下文对图8的描述。Regarding the sequence of arrival times of scheduling requests corresponding to task1 and task2, reference may be made to the description of FIG. 8 below.
图8示例性示出本申请实施例提供的嵌入式系统中的对文件系统的调度请求响应逻辑图。FIG. 8 exemplarily shows a logic diagram of a scheduling request response to a file system in an embedded system provided by an embodiment of the present application.
参见图8中(1)所示,在初始情况下,电子设备没有待响应的调度请求时,普通队列和VIP队列都是空的。Referring to (1) in FIG. 8 , in an initial situation, when the electronic device has no scheduling request to be responded to, both the common queue and the VIP queue are empty.
参见图8中(2)所示,当电子设备的文件系统调度服务接收到来自task1的调度请求Req1、Req2、Req3时,由于这3个调度请求来自同一个任务,一种实现方式中,它们的优先级可以是相同的,对于这种场景可以按照这3个调度请求之间接收到的先后顺序,如按照先Req1,然后Req2,接着Req3的顺序,添加到普通队列中,而VIP队列依旧是空的。Referring to (2) in Figure 8, when the file system scheduling service of the electronic device receives scheduling requests Req1, Req2, and Req3 from task1, since these three scheduling requests come from the same task, in one implementation, they The priorities can be the same. For this scenario, they can be added to the normal queue according to the order received among the three scheduling requests, such as first Req1, then Req2, and then Req3, while the VIP queue remains the same. is empty.
参见图8中(3)所示,电子设备的文件系统调度服务会按照前文所述的调度方法从普通队列中选取最紧迫的调度请求作为目标调度请求进行响应。由于Req1、Req2、Req3对应的任务都为任务1,因此优先级相同,则按照Req1、Req2、Req3的先后顺序,选取Req1进行响应,则此时普通队列中的未被响应的调度请求包括Req2、Req3,若电子设备在响应Req1的过程中还接收到来自task2的调度请求Req4、Req5,则此时普通队列中的未被响应的调度请求还包括Req4、Req5。Referring to (3) in FIG. 8 , the file system scheduling service of the electronic device will select the most urgent scheduling request from the common queue as the target scheduling request according to the aforementioned scheduling method to respond. Since the tasks corresponding to Req1, Req2, and Req3 are all task 1, and therefore have the same priority, Req1 is selected to respond in the order of Req1, Req2, and Req3, and the unresponsive scheduling requests in the ordinary queue at this time include Req2 , Req3, if the electronic device also receives scheduling requests Req4 and Req5 from task2 during the process of responding to Req1, then the unresponded scheduling requests in the normal queue at this time also include Req4 and Req5.
参见图8中(4)所示,电子设备的文件系统调度服务会按照前文所述的调度方法,记录普通队列中未被响应的调度请求的等待时间,当检测到调度请求等待时间达到对应的饥饿时间时,则将该调度请求移至VIP队列中。例如,当检测到Req4、Req5的等待时间达到对应的饥饿时间,则将Req4、Req5移至VIP队列中。Referring to (4) in Figure 8, the file system scheduling service of the electronic device will record the waiting time of unresponsed scheduling requests in the ordinary queue according to the scheduling method described above. When it is detected that the waiting time of the scheduling request reaches the corresponding During the starvation time, the scheduling request is moved to the VIP queue. For example, when it is detected that the waiting time of Req4 and Req5 reaches the corresponding starvation time, Req4 and Req5 are moved to the VIP queue.
继续参见图8,在将Req4、Req5从普通队列移至VIP队列后,电子设备的文件系统调度服务则会选取图8中(4)中的VIP队列中的调度请求进行响应。由于Req4、Req5来自同一个任务即task2,一种实现方式中,它们的优先级可以是相同的,对于这种场景可以按照Req4、Req5之间接收到的先后顺序,如按照先Req4,然后Req5的顺序移动至VIP队列中。并且按照先Req4,然后Req5的顺序进行响应。Continuing to refer to FIG. 8 , after moving Req4 and Req5 from the common queue to the VIP queue, the file system scheduling service of the electronic device will select the scheduling request in the VIP queue in (4) in FIG. 8 to respond. Since Req4 and Req5 come from the same task, that is, task2, in one implementation, their priorities can be the same. For this scenario, the order of receipt between Req4 and Req5 can be followed, such as Req4 first, then Req5 will be moved to the VIP queue in order. And respond in the order of Req4 first, then Req5.
特别的是,在电子设备调用文件系统服务先响应Req4时,同时会记录响应VIP队列中的调度请求的总时长,当该总时长达到吃饱时间时,则切换至普通队列中,从普通队列中选取调度请求进行响应。In particular, when the electronic device calls the file system service and responds to Req4 first, it will record the total time of responding to the scheduling request in the VIP queue at the same time. When the total time reaches the full time, it will switch to the normal queue. Select a dispatch request to respond to.
例如图7中(1)所示,在电子设备调用文件系统服务先响应Req5之前,若检测到响应VIP队列中的调度请求的总时长达到吃饱时间,则电子设备切换至普通队列中,从普通队列中选取依次调度请求Req2、Req3进行响应,即执行文件操作指令2和文件操作指令3,直至普通队列中的调度请求为空,或者普通队列中的中出现等待时长大于对应饥饿时间的调度请求,或者响应普通队列中的调度请求的总时长达到对应的吃饱时间之后,再切换至VIP队列中,从VIP队列中选取Req5进行响应,即执行文件操作指令5。For example, as shown in (1) in Figure 7, before the electronic device invokes the file system service to respond to Req5 first, if it detects that the total time for responding to the scheduling request in the VIP queue reaches the full time, the electronic device switches to the normal queue, from In the ordinary queue, the scheduling requests Req2 and Req3 are selected in turn to respond, that is, the file operation instruction 2 and the file operation instruction 3 are executed until the scheduling request in the ordinary queue is empty, or there is a scheduling in the ordinary queue whose waiting time is longer than the corresponding starvation time After the total time of requesting or responding to the scheduling request in the ordinary queue reaches the corresponding full time, switch to the VIP queue, and select Req5 from the VIP queue to respond, that is, execute the file operation instruction 5.
例如图7中(2)所示,在电子设备调用文件系统服务先响应Req5之前,若检测到响应VIP队列中的调度请求的总时长还未达到对应的吃饱时间,则电子设备继续响应VIP队列中Req5,即执行文件操作指令5,直至VIP队列中的调度请求为空,或者响应普通队列中的调度请求的总时长达到对应的吃饱时间之后,再切换至普通队列中,从普通队列中选取Req2、Req3进行响应,即执行文件操作指令2和文件操作指令3。For example, as shown in (2) in Figure 7, before the electronic device calls the file system service and responds to Req5 first, if it detects that the total time for responding to the scheduling request in the VIP queue has not reached the corresponding full time, the electronic device continues to respond to the VIP Req5 in the queue, that is, execute file operation command 5, until the scheduling request in the VIP queue is empty, or the total time for responding to the scheduling request in the normal queue reaches the corresponding full time, then switch to the normal queue, from the normal queue Select Req2 and Req3 to respond, that is, execute file operation instruction 2 and file operation instruction 3.
通过对图7的分析可知,实施本申请提供的嵌入式文件系统的调度方法后,在多个任务发起多个调度请求的情况下,通过设置不同优先级的多个队列如上文中的普通队列(低优先级)和VIP队列(高优先级),优先级高的队列用于容纳达到饥饿时间(即将达到业务要求时长)的调度请求,优先级较低的队列用于容纳等待时长还未达到饥饿时间(即等待时长远未业务要求时长)的调度请求,为保证调度请求的实时性要求,优先响应高优先级队列中的调度请求。此外,为了保证整体调度请求的公平性,还设置了响应高优先级队列中的调度请求的总时间阈值,达到阈值后则切换至响应低优先级队列中的调度请求。并且,为了进一步满足每个调度请求所属业务的要求时长,即进一步满足每个调度请求的实时性要求,在响应每个队列中的调度请求时,按照紧迫程度由高到低(调度请求对应的任务的优先级由高到低)的顺序依次响应,当优先级相同时则按照调度请求到达时间的先后顺序进行响应。从而,使得电子设备能够在极短时间内,既兼顾到每个调度请求的实时性要求(例如图7(1)和(2)中示出的优先响应实时性要求较高的Req4),也保证整体调度请求的公平性要求,避免长时间为得到调度的线程被饿死,(例如图7(2)中示出的在优先响应实时性要求较高的Req4之后,兼顾实时性要求不高但等待时间较长的Req2和Req3)。Through the analysis of Fig. 7, it can be seen that after implementing the scheduling method of the embedded file system provided by the present application, when multiple tasks initiate multiple scheduling requests, by setting multiple queues of different priorities such as the ordinary queue above ( Low priority) and VIP queue (high priority), the queue with high priority is used to accommodate scheduling requests that reach the starvation time (about to reach the length of business requirements), and the queue with lower priority is used to accommodate the waiting time that has not yet reached hunger Time (that is, the waiting time is longer than the business requirement time) scheduling request, in order to ensure the real-time requirements of the scheduling request, the scheduling request in the high-priority queue is given priority. In addition, in order to ensure the fairness of the overall scheduling request, a total time threshold for responding to scheduling requests in the high-priority queue is also set. When the threshold is reached, it will switch to respond to scheduling requests in the low-priority queue. And, in order to further meet the required duration of the business to which each scheduling request belongs, that is, to further meet the real-time requirements of each scheduling request, when responding to scheduling requests in each queue, the urgency is ranked from high to low (the scheduling request corresponds to The priority of the task is from high to low), and when the priority is the same, it will respond in the order of the arrival time of the scheduling request. Therefore, the electronic device can take into account the real-time requirements of each scheduling request (such as the priority response Req4 shown in Figure 7 (1) and (2)) in a very short time Guarantee the fairness requirements of the overall scheduling request, and avoid long-term starvation of scheduled threads (for example, after giving priority to responding to Req4 with high real-time requirements as shown in Figure 7 (2), taking into account the low real-time requirements But the waiting time is longer for Req2 and Req3).
应理解,本申请提供的上述方法实施例中的各步骤可以通过处理器中的硬件的集成逻辑电路或者软件形式的指令完成。结合本申请实施例所公开的方法步骤可以直接体现为硬件处理器执行完成,或者用处理器中的硬件及软件模块组合执行完成。It should be understood that each step in the foregoing method embodiments provided in the present application may be implemented by an integrated logic circuit of hardware in a processor or instructions in the form of software. The method steps disclosed in connection with the embodiments of the present application may be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules in the processor.
本申请还提供一种电子设备,该电子设备可以包括:存储器和处理器。其中,存储器可用于存储计算机程序;处理器可用于调用所述存储器中的计算机程序,以使得该电子设备执行上述任意一个实施例中的方法。The present application also provides an electronic device, which may include: a memory and a processor. Wherein, the memory may be used to store a computer program; the processor may be used to call the computer program in the memory, so that the electronic device executes the method in any one of the above embodiments.
本申请还提供了一种芯片系统,所述芯片系统包括至少一个处理器,用于实现上述任意一个实施例中电子设备执行的方法中所涉及的功能。The present application also provides a chip system, where the chip system includes at least one processor, configured to implement the functions involved in the method performed by the electronic device in any one of the above embodiments.
在一种可能的设计中,所述芯片系统还包括存储器,所述存储器用于保存程序指令和数据,存储器位于处理器之内或处理器之外。In a possible design, the chip system further includes a memory, the memory is used to store program instructions and data, and the memory is located inside or outside the processor.
该芯片系统可以由芯片构成,也可以包含芯片和其他分立器件。The system-on-a-chip may consist of chips, or may include chips and other discrete devices.
可选地,该芯片系统中的处理器可以为一个或多个。该处理器可以通过硬件实现也可以通过软件实现。当通过硬件实现时,该处理器可以是逻辑电路、集成电路等。当通过软件实现时,该处理器可以是一个通用处理器,通过读取存储器中存储的软件代码来实现。Optionally, there may be one or more processors in the chip system. The processor can be realized by hardware or by software. When implemented in hardware, the processor may be a logic circuit, an integrated circuit, or the like. When implemented by software, the processor may be a general-purpose processor implemented by reading software codes stored in a memory.
可选地,该芯片系统中的存储器也可以为一个或多个。该存储器可以与处理器集成在一起,也可以和处理器分离设置,本申请实施例并不限定。示例性地,存储器可以是非瞬时性处理器,例如只读存储器ROM,其可以与处理器集成在同一块芯片上,也可以分别设置在不同的芯片上,本申请实施例对存储器的类型,以及存储器与处理器的设置方式不作具体限定。Optionally, there may be one or more memories in the chip system. The memory may be integrated with the processor, or may be configured separately from the processor, which is not limited in this embodiment of the present application. Exemplarily, the memory can be a non-transitory processor, such as a read-only memory ROM, which can be integrated with the processor on the same chip, or can be respectively arranged on different chips. The arrangement manner of the memory and the processor is not specifically limited.
示例性地,该芯片系统可以是现场可编程门阵列(field programmable gatearray,FPGA),可以是专用集成芯片(application specific integrated circuit,ASIC),还可以是系统芯片(system on chip,SoC),还可以是中央处理器(central processorunit,CPU),还可以是网络处理器(network processor,NP),还可以是数字信号处理电路(digital signal processor,DSP),还可以是微控制器(micro controller unit,MCU),还可以是可编程控制器(programmable logic device,PLD)或其他集成芯片。Exemplarily, the chip system may be a field programmable gate array (field programmable gate array, FPGA), may be an application specific integrated circuit (ASIC), may also be a system chip (system on chip, SoC), or It can be a central processor unit (CPU), a network processor (network processor, NP), a digital signal processing circuit (digital signal processor, DSP), or a microcontroller (micro controller unit) , MCU), and may also be a programmable controller (programmable logic device, PLD) or other integrated chips.
本申请还提供一种计算机程序产品,所述计算机程序产品包括:计算机程序(也可以称为代码,或指令),当所述计算机程序被运行时,使得计算机执行上述任一个实施例中电子设备执行的方法。The present application also provides a computer program product, the computer program product including: a computer program (also called code, or instruction), when the computer program is executed, the computer executes the electronic device in any one of the above-mentioned embodiments. method of execution.
本申请还提供一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序(也可以称为代码,或指令)。当所述计算机程序被运行时,使得计算机执行上述任一个实施例中电子设备执行的方法。The present application also provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program (also called a code, or an instruction). When the computer program is executed, the computer is made to execute the method executed by the electronic device in any one of the above embodiments.
本申请的各实施方式可以任意进行组合,以实现不同的技术效果。Various implementation modes of the present application can be combined arbitrarily to achieve different technical effects.
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线)或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如固态硬盘Solid StateDisk)等。In the above embodiments, all or part of them may be implemented by software, hardware, firmware or any combination thereof. When implemented using software, it may 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 the computer, the processes or functions according to the present application will be generated in whole or in part. The computer can be a general purpose computer, a special purpose computer, a computer network, or other programmable devices. 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 transmitted from a website, computer, server or data center Transmission to another website site, computer, server, or data center by wired (eg, coaxial cable, optical fiber, DSL) or wireless (eg, infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that can be accessed by a computer, or a data storage device such as a server or a data center integrated with one or more available media. The available medium may be a magnetic medium (for example, a floppy disk, a hard disk, or a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium (for example, a Solid State Disk).
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,该流程可以由计算机程序来指令相关的硬件完成,该程序可存储于计算机可读取存储介质中,该程序在执行时,可包括如上述各方法实施例的流程。而前述的存储介质包括: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 are realized. The processes can be completed by computer programs to instruct related hardware. The programs can be stored in computer-readable storage media. When the programs are executed , may include the processes of the foregoing method embodiments. The aforementioned storage medium includes: ROM or random access memory RAM, magnetic disk or optical disk, and other various media that can store program codes.
总之,以上所述仅为本发明技术方案的实施例而已,并非用于限定本发明的保护范围。凡根据本发明的揭露,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。In a word, the above description is only an embodiment of the technical solution of the present invention, and is not intended to limit the protection scope of the present invention. All modifications, equivalent replacements, improvements, etc. made according to the disclosure of the present invention shall be included in the protection scope of the present invention.
Claims (23)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211110805.2A CN116700913B (en) | 2022-09-13 | 2022-09-13 | Scheduling method, device and storage medium of embedded file system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211110805.2A CN116700913B (en) | 2022-09-13 | 2022-09-13 | Scheduling method, device and storage medium of embedded file system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN116700913A true CN116700913A (en) | 2023-09-05 |
CN116700913B CN116700913B (en) | 2024-05-31 |
Family
ID=87843954
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211110805.2A Active CN116700913B (en) | 2022-09-13 | 2022-09-13 | Scheduling method, device and storage medium of embedded file system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116700913B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116932232A (en) * | 2023-09-18 | 2023-10-24 | 湖南远跃科技发展有限公司 | Data processing method of development platform based on BS architecture |
Citations (15)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1877534A (en) * | 2006-06-30 | 2006-12-13 | 浙江大学 | Accomplishing method for embedded real-time file system task scheduling |
US20080222640A1 (en) * | 2007-03-07 | 2008-09-11 | International Business Machines Corporation | Prediction Based Priority Scheduling |
CN102594888A (en) * | 2012-02-16 | 2012-07-18 | 西北工业大学 | Method for enhancing real-time performance of network file system |
CN103324525A (en) * | 2013-07-03 | 2013-09-25 | 东南大学 | Task scheduling method in cloud computing environment |
US20140195699A1 (en) * | 2013-01-08 | 2014-07-10 | Apple Inc. | Maintaining i/o priority and i/o sorting |
CN106371903A (en) * | 2016-08-23 | 2017-02-01 | 西安电子科技大学 | Task scheduling method for airborne trusted computing platform |
US20200073707A1 (en) * | 2018-08-29 | 2020-03-05 | Tibco Software Inc. | System and method for managing tasks and task workload items between address spaces and logical partitions |
CN111400022A (en) * | 2019-01-02 | 2020-07-10 | 中国移动通信有限公司研究院 | A resource scheduling method, device and electronic device |
CN112000454A (en) * | 2020-08-27 | 2020-11-27 | 平安国际智慧城市科技股份有限公司 | Multimedia data processing method and equipment |
CN112087503A (en) * | 2020-08-29 | 2020-12-15 | 北京明略昭辉科技有限公司 | Cluster task scheduling method, system, computer and computer readable storage medium |
CN112764904A (en) * | 2021-01-22 | 2021-05-07 | 珠海亿智电子科技有限公司 | Method for preventing starvation of low priority tasks in multitask-based system |
CN113282381A (en) * | 2020-02-19 | 2021-08-20 | 中科寒武纪科技股份有限公司 | Task scheduling method and device, computer equipment and storage medium |
CN114443240A (en) * | 2021-08-25 | 2022-05-06 | 荣耀终端有限公司 | Input/output request processing method and electronic equipment |
CN114924858A (en) * | 2022-05-27 | 2022-08-19 | 中国银行股份有限公司 | Task scheduling method and device, storage medium and electronic equipment |
CN114968509A (en) * | 2021-05-08 | 2022-08-30 | 中移互联网有限公司 | Task execution method and device |
-
2022
- 2022-09-13 CN CN202211110805.2A patent/CN116700913B/en active Active
Patent Citations (15)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1877534A (en) * | 2006-06-30 | 2006-12-13 | 浙江大学 | Accomplishing method for embedded real-time file system task scheduling |
US20080222640A1 (en) * | 2007-03-07 | 2008-09-11 | International Business Machines Corporation | Prediction Based Priority Scheduling |
CN102594888A (en) * | 2012-02-16 | 2012-07-18 | 西北工业大学 | Method for enhancing real-time performance of network file system |
US20140195699A1 (en) * | 2013-01-08 | 2014-07-10 | Apple Inc. | Maintaining i/o priority and i/o sorting |
CN103324525A (en) * | 2013-07-03 | 2013-09-25 | 东南大学 | Task scheduling method in cloud computing environment |
CN106371903A (en) * | 2016-08-23 | 2017-02-01 | 西安电子科技大学 | Task scheduling method for airborne trusted computing platform |
US20200073707A1 (en) * | 2018-08-29 | 2020-03-05 | Tibco Software Inc. | System and method for managing tasks and task workload items between address spaces and logical partitions |
CN111400022A (en) * | 2019-01-02 | 2020-07-10 | 中国移动通信有限公司研究院 | A resource scheduling method, device and electronic device |
CN113282381A (en) * | 2020-02-19 | 2021-08-20 | 中科寒武纪科技股份有限公司 | Task scheduling method and device, computer equipment and storage medium |
CN112000454A (en) * | 2020-08-27 | 2020-11-27 | 平安国际智慧城市科技股份有限公司 | Multimedia data processing method and equipment |
CN112087503A (en) * | 2020-08-29 | 2020-12-15 | 北京明略昭辉科技有限公司 | Cluster task scheduling method, system, computer and computer readable storage medium |
CN112764904A (en) * | 2021-01-22 | 2021-05-07 | 珠海亿智电子科技有限公司 | Method for preventing starvation of low priority tasks in multitask-based system |
CN114968509A (en) * | 2021-05-08 | 2022-08-30 | 中移互联网有限公司 | Task execution method and device |
CN114443240A (en) * | 2021-08-25 | 2022-05-06 | 荣耀终端有限公司 | Input/output request processing method and electronic equipment |
CN114924858A (en) * | 2022-05-27 | 2022-08-19 | 中国银行股份有限公司 | Task scheduling method and device, storage medium and electronic equipment |
Non-Patent Citations (3)
Title |
---|
GEDARE BLOOM 等: "Scheduling and thread management with RTEMS", 《ACM SIGBED REVIEW》, vol. 11, no. 01, 1 February 2014 (2014-02-01), pages 111 - 25 * |
K.埃尔吉耶斯(K.ERCIYES): "《分布式实时系统 理论与实践》", 机械工业出版社, pages: 111 * |
李小群 等: "RFRTOS: 基于Linux 的实时操作系统", 《软件学报》, vol. 14, no. 07, 23 July 2003 (2003-07-23), pages 1203 - 1212 * |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116932232A (en) * | 2023-09-18 | 2023-10-24 | 湖南远跃科技发展有限公司 | Data processing method of development platform based on BS architecture |
CN116932232B (en) * | 2023-09-18 | 2024-01-05 | 湖南远跃科技发展有限公司 | Data processing method of development platform based on BS architecture |
Also Published As
Publication number | Publication date |
---|---|
CN116700913B (en) | 2024-05-31 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2021052263A1 (en) | Voice assistant display method and device | |
CN111813536B (en) | Task processing method, device, terminal and computer readable storage medium | |
CN112527476B (en) | Resource scheduling method and electronic equipment | |
WO2021185244A1 (en) | Device interaction method and electronic device | |
CN116244067B (en) | Virtual memory management method and electronic equipment | |
CN113553130B (en) | Method for executing drawing operation by application and electronic equipment | |
CN111104209B (en) | A method for processing tasks and related equipment | |
CN110413383B (en) | Event processing method, device, terminal and storage medium | |
WO2022100141A1 (en) | Plug-in management method, system and apparatus | |
CN116700913B (en) | Scheduling method, device and storage medium of embedded file system | |
WO2022033355A1 (en) | Mail processing method and electronic device | |
CN117112154B (en) | Thread scheduling method and related device | |
CN115729684B (en) | Input/output request processing method and electronic equipment | |
WO2024007970A1 (en) | Thread scheduling method and electronic device | |
CN114489471B (en) | An input and output processing method and electronic device | |
CN118233402A (en) | Data transmission method and electronic equipment | |
WO2023051036A1 (en) | Method and apparatus for loading shader | |
CN117724860B (en) | Data processing method and electronic device | |
CN115706753B (en) | Application management method, device, electronic device and storage medium | |
WO2023051056A1 (en) | Memory management method, electronic device, computer storage medium, and program product | |
CN117692507B (en) | A desktop function push method and related device | |
WO2023001208A1 (en) | Multi-file synchronization method and electronic device | |
CN117707720A (en) | Process scheduling method, device and electronic equipment | |
CN117271170A (en) | Activity event processing method and related equipment | |
WO2025026077A1 (en) | Method and apparatus for starting application program, and electronic device |
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 | ||
CP03 | Change of name, title or address |
Address after: Unit 3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong 518040 Patentee after: Honor Terminal Co.,Ltd. Country or region after: China Address before: 3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong Patentee before: Honor Device Co.,Ltd. Country or region before: China |
|
CP03 | Change of name, title or address |