CN116700913A - Scheduling method, equipment and storage medium of embedded file system - Google Patents

Scheduling method, equipment and storage medium of embedded file system Download PDF

Info

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
scheduling request
task
queue
time
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.)
Pending
Application number
CN202211110805.2A
Other languages
Chinese (zh)
Inventor
万锋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Honor Device Co Ltd
Original Assignee
Honor Device Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Honor Device Co Ltd filed Critical Honor Device Co Ltd
Priority to CN202211110805.2A priority Critical patent/CN116700913A/en
Publication of CN116700913A publication Critical patent/CN116700913A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/48Indexing scheme relating to G06F9/48
    • G06F2209/484Precedence
    • YGENERAL 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
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE 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/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The application discloses a scheduling method, equipment and storage medium of an embedded file system, and the method is applied to electronic equipment integrated with an embedded operating system. In the method, when a plurality of scheduling requests of the embedded file system initiated by a plurality of tasks are received, the most urgent scheduling request is selected from the scheduling requests which are not responded each time to respond according to the priority of the tasks corresponding to each scheduling request and/or the waiting time of each scheduling request, so that the aim of reasonably responding the plurality of scheduling requests is fulfilled.

Description

Scheduling method, equipment and storage medium of embedded file system
Technical Field
The present application relates to the field of embedded operating systems, and in particular, to a scheduling method, device and storage medium for an embedded file system.
Background
In an electronic device with an embedded operating system, the embedded operating system receives scheduling requests to a file system initiated by a plurality of tasks generated by an upper layer application at the same time or in a short time, and how to schedule the embedded file system to perform file operations aiming at the scheduling requests, so that the tasks are executed in time is a problem to be solved.
Disclosure of Invention
The application discloses a scheduling method, equipment and storage medium of an embedded file system, and the method is applied to electronic equipment integrated with an embedded operating system. In the method, when a plurality of scheduling requests of the embedded file system initiated by a plurality of tasks are received, the most urgent scheduling request is selected from the scheduling requests which are not responded each time to respond according to the priority of the tasks corresponding to each scheduling request and/or the waiting time of each scheduling request, so that the aim of reasonably responding the plurality of scheduling requests is fulfilled.
In a first aspect, the present application provides a method for scheduling an embedded file system, where the method is applied to an electronic device, and the electronic device includes an embedded file system, and the method includes: the electronic device generates 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 requests for scheduling the embedded file system to perform corresponding file operations; the electronic device responds to the plurality of scheduling requests in turn according to the priority of the task to which the scheduling request belongs and the waiting time of the scheduling request.
After the method provided in the first aspect is implemented, the electronic device can determine a reasonable request response sequence according to a certain scheduling policy, and schedule the embedded file system according to the sequence to perform file operation so as to complete the corresponding task.
In combination with the method provided in the first aspect, the electronic device sequentially responds to the plurality of scheduling requests, specifically including: sequentially selecting a scheduling request from the plurality of scheduling requests to respond, and selecting one scheduling request at a time to respond; wherein, the process of selecting one scheduling request at a time comprises the following steps: when the second queue is empty or the duration of the continuous response of the scheduling requests in the second queue is greater than or equal to the full time, selecting one scheduling request of the task with the highest priority from the first queue to respond; when the second queue is not empty or the time length of the continuous response of the scheduling requests in the second queue is less than the full time, selecting one scheduling request of the task with the highest priority from the second queue to respond; the first queue includes: waiting for a scheduling request with a duration less than the starvation time; the second queue includes: scheduling requests that are not responded to and have a waiting period greater than or equal to starvation time; scheduling requests belonging to the same task correspond to the same starvation time.
Therefore, the embedded file system scheduling method adopted by the application has real-time performance on file operation services provided by upper-layer applications. That is, the priorities corresponding to different types of tasks initiated by the application and the first threshold value of the waiting time of the scheduling request from the task are set, so that the scheduling request initiated by the application with higher priority and higher response time requirement can be responded preferentially. In addition, the embedded file system scheduling method adopted by the application has fairness for file operation services provided by upper-layer applications. That is, the total operation time of the scheduling request to be preferentially responded is limited, so that the request of the task with low real-time requirement can be responded to while the real-time requirement is met.
In combination with the method provided in the first aspect, the electronic device selects one scheduling request from the first queue as a scheduling request with earliest time from tasks with highest priority in the first queue; and the electronic equipment generates the scheduling request with the earliest time from the tasks with the highest priority in the second queue as one scheduling request selected from the second queue.
Therefore, when the same task comprises a plurality of scheduling requests, the priorities of the tasks corresponding to the plurality of scheduling requests are the same, the scheduling request which arrives earliest can be selected for response, and further, the priority response of the scheduling request which arrives earlier can be ensured under the condition of the same priority.
In combination with the method provided in the first aspect, the priority of the task is preset by the electronic device, and specifically, the frequency of generating the task according to the application counted in the development stage, and/or a value preset by the real-time requirement of the task; alternatively, the priority of the task is dynamically adjusted by the electronic device according to any one or more of: the number of times the history of the task is not successfully executed, the time used when the history of the task is successfully executed, the waiting time of the scheduling request of the task in the first queue, and the history generation frequency of the task.
In this way, in the running process of the electronic device, the adopted priority parameters when the sequence of selecting the scheduling request for response is adjusted in real time according to the dynamic change of the service characteristics (namely the use requirement of the user) of the application initiating task, so that the scheduling request is responded according to a more reasonable sequence.
In combination with the method provided in the first aspect, the starvation time of the scheduling request is preset by the electronic device, and specifically, the frequency of generating tasks according to the application counted in the development stage and/or a value preset by the real-time requirement of the tasks; or dynamically adjusted by the electronic device according to any one or more of: the number of times that the history of the task to which the scheduling request belongs is not successfully executed, the time length used when the history of the task to which the scheduling request belongs is successfully executed, the waiting time length of the scheduling request of the task to which the scheduling request belongs in the first queue, and the history generation frequency of the task to which the scheduling request belongs.
In this way, in the running process of the electronic device, the starvation time parameter adopted when the sequence of selecting the scheduling request for response is adjusted in real time according to the dynamic change of the service characteristics (namely the use requirement of the user) of the application initiating task, so that the scheduling request is responded according to a more reasonable sequence.
With reference to the method provided in the first aspect, the saturation time is preset by the electronic device; or dynamically adjusting by the electronic device according to the duration of the historical continuous response to the scheduling request in the second queue.
In this way, in the running process of the electronic device, the adopted saturation time when the sequence of selecting the scheduling request for response is adjusted in real time according to the dynamic change of the service characteristics (namely the use requirement of the user) of the application initiating task, so that the scheduling request is responded according to a more reasonable sequence.
In combination with the method provided in the first aspect, the file operation performed by the embedded file system includes any one or more of the following: create, open, read and write, close, delete, modify a file, or transfer a file storage location.
Thus, the electronic device can respond to a plurality of scheduling requests in sequence according to a specific sequence to schedule the embedded file system to execute a corresponding plurality of file operations, and the application scene of the method is expanded.
In a second aspect, the present application provides an electronic device, the electronic device including a file system scheduling service, an embedded file system; the file system scheduling service is used for receiving a plurality of scheduling requests from a plurality of tasks, and sequentially scheduling the embedded file system to respond to the plurality of scheduling requests according to the priority of the task to which the scheduling request belongs and the waiting time of the scheduling request; one of the tasks corresponds to one or more of the scheduling requests; the embedded file system is used for responding to the scheduling request to execute corresponding file operation.
After the electronic equipment provided by the second aspect is adopted, the electronic equipment can determine a reasonable request response sequence according to a certain scheduling strategy, and sequentially schedule the embedded file system to perform file operation so as 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 plurality of scheduling requests, and specifically includes: the file system scheduling service sequentially selects scheduling requests from the plurality of scheduling requests to schedule the embedded file system for response, and selects one scheduling request at a time to schedule the embedded file system for response; wherein, the process of selecting one scheduling request at a time comprises the following steps: when the second queue is empty or the duration of the continuous response of the scheduling requests in the second queue is greater than or equal to the full time, the file system scheduling service selects one scheduling request of the task with the highest priority from the first queue to schedule the embedded file system to respond; when the second queue is not empty or the time length of the continuous response of the scheduling requests in the second queue is less than the full time, selecting one scheduling request of the task with the highest priority from the second queue to respond; the first queue includes: waiting for a scheduling request with a duration less than the starvation time; the second queue includes: scheduling requests that are not responded to and have a waiting period greater than or equal to starvation time; scheduling requests belonging to the same task correspond to the same starvation time.
Therefore, the electronic equipment adopted by the application has real-time performance on file operation services provided by upper-layer applications. That is, the priorities corresponding to different types of tasks initiated by the application and the first threshold value of the waiting time of the scheduling request from the task are set, so that the scheduling request initiated by the application with higher priority and higher response time requirement can be responded preferentially. In addition, the embedded file system scheduling method adopted by the application has fairness for file operation services provided by upper-layer applications. That is, the total operation time of the scheduling request to be preferentially responded is limited, so that the request of the task with low real-time requirement can be responded to while the real-time requirement is met.
In combination with the electronic device provided in the second aspect, the file system scheduling service generates the scheduling request with the earliest time from the tasks with the highest priority in the first queue, where the scheduling request is selected from the first queue; the file system scheduling service selects one scheduling request from the second queue as the scheduling request with the earliest time from the tasks with the highest priority of the second queue.
Therefore, when the same task comprises a plurality of scheduling requests, the priorities of the tasks corresponding to the plurality of scheduling requests are the same, the scheduling request which arrives earliest can be selected for response, and further, the priority response of the scheduling request which arrives earlier can be ensured under the condition of the same priority.
In combination with the electronic device provided in the second aspect, the priority of the task is preset by the electronic device, and specifically, the frequency of generating the task according to the application counted in the development stage, and/or a value preset by the real-time requirement of the task; alternatively, 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 is not successfully executed, the time used when the history of the task is successfully executed, the waiting time of the scheduling request of the task in the first queue, and the history generation frequency of the task.
In this way, in the running process of the electronic device, the adopted priority parameters when the sequence of selecting the scheduling request for response is adjusted in real time according to the dynamic change of the service characteristics (namely the use requirement of the user) of the application initiating task, so that the scheduling request is responded according to a more reasonable sequence.
In combination with the electronic device provided in the second aspect, the starvation time of the scheduling request is preset by the electronic device, and specifically, the frequency of generating tasks according to the application counted in the development stage, and/or a value preset by the real-time requirement of the tasks; alternatively, the scheduling service is dynamically adjusted by the file system according to any one or more of the following: the number of times that the history of the task to which the scheduling request belongs is not successfully executed, the time length used when the history of the task to which the scheduling request belongs is successfully executed, the waiting time length of the scheduling request of the task to which the scheduling request belongs in the first queue, and the history generation frequency of the task to which the scheduling request belongs.
In this way, in the running process of the electronic device, the starvation time parameter adopted when the sequence of selecting the scheduling request for response is adjusted in real time according to the dynamic change of the service characteristics (namely the use requirement of the user) of the application initiating task, so that the scheduling request is responded according to a more reasonable sequence.
With reference to the electronic device provided in the second aspect, the saturation time is preset by the electronic device; alternatively, the scheduling service is dynamically adjusted by the file system based on the historical succession of durations in response to scheduling requests in the second queue.
In this way, in the running process of the electronic device, the adopted saturation time when the sequence of selecting the scheduling request for response is adjusted in real time according to the dynamic change of the service characteristics (namely the use requirement of the user) of the application initiating task, so that the scheduling request is responded according to a more reasonable sequence.
With reference to the electronic device provided in the second aspect, the file operation performed by the embedded file system includes any one or more of the following: create, open, read and write, close, delete, modify a file, or transfer a file storage location.
Thus, the electronic device can respond to a plurality of scheduling requests in sequence according to a specific sequence to schedule the embedded file system to execute a corresponding plurality of file operations, and the application scene of the method is expanded.
In a third aspect, the present application provides an electronic device comprising an embedded file system, a memory, one or more processors; the memory is coupled to the one or more processors, the memory for storing computer program code, the computer program code comprising computer instructions that the one or more processors call 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 requests for scheduling the embedded file system to perform corresponding file operations; and responding to the plurality of scheduling requests in turn according to the priority of the task to which the scheduling request belongs and the waiting time of the scheduling request.
After the electronic equipment provided by the second aspect is adopted, a file system scheduling service contained in the electronic equipment can determine a reasonable request response sequence according to a certain scheduling policy, and an embedded file system is scheduled to perform file operation according to the sequence so as to complete corresponding tasks.
With reference to the electronic device provided in the third aspect, the one or more processors call the computer instructions to cause the electronic device to sequentially respond to the plurality of scheduling requests, specifically including: sequentially selecting a scheduling request from the plurality of scheduling requests to respond, and selecting one scheduling request at a time to respond; wherein, the process of selecting one scheduling request at a time comprises the following steps: when the second queue is empty or the duration of the continuous response of the scheduling requests in the second queue is greater than or equal to the full time, selecting one scheduling request of the task with the highest priority from the first queue to respond; when the second queue is not empty or the time length of the continuous response of the scheduling requests in the second queue is less than the full time, selecting one scheduling request of the task with the highest priority from the second queue to respond; the first queue includes: waiting for a scheduling request with a duration less than the starvation time; the second queue includes: scheduling requests that are not responded to and have a waiting period greater than or equal to starvation time; scheduling requests belonging to the same task correspond to the same starvation time.
Therefore, the file system scheduling service adopted by the application has real-time performance on the file operation service provided by the upper application. That is, the priorities corresponding to different types of tasks initiated by the application and the first threshold value of the waiting time of the scheduling request from the task are set, so that the scheduling request initiated by the application with higher priority and higher response time requirement can be responded preferentially. In addition, the file system scheduling service adopted by the application has fairness on file operation services provided by upper-layer applications. That is, the total operation time of the scheduling request to be preferentially responded is limited, so that the request of the task with low real-time requirement can be responded to while the real-time requirement is met. With reference to the electronic device provided in the third aspect, the one or more processors call the computer instructions to cause the electronic device to generate, for a task with a highest priority in the first queue, a scheduling request with an earliest time, where the scheduling request is selected from the first queue; the one or more processors invoke the computer instructions to cause the electronic device to generate the earliest scheduling request from the highest priority task in the second queue.
Therefore, when the same task comprises a plurality of scheduling requests, the priorities of the tasks corresponding to the plurality of scheduling requests are the same, the scheduling request which arrives earliest can be selected for response, and further, the priority response of the scheduling request which arrives earlier can be ensured under the condition of the same priority.
In combination with the electronic device provided in the third aspect, the priority of the task is preset by the electronic device, and specifically, the frequency of generating the task according to the application counted in the development stage, and/or a value preset by the real-time requirement of the task; alternatively, the priority of the task is dynamically adjusted by the electronic device according to any one or more of: the number of times the history of the task is not successfully executed, the time used when the history of the task is successfully executed, the waiting time of the scheduling request of the task in the first queue, and the history generation frequency of the task.
In this way, in the running process of the electronic device, the adopted priority parameters when the sequence of selecting the scheduling request for response is adjusted in real time according to the dynamic change of the service characteristics (namely the use requirement of the user) of the application initiating task, so that the scheduling request is responded according to a more reasonable sequence.
In combination with the electronic device provided in the third aspect, the starvation time of the scheduling request is preset by the electronic device, and specifically, the frequency of generating the task according to the application counted in the development stage, and/or a value preset by the real-time requirement of the task; or dynamically adjusted by the electronic device according to any one or more of: the number of times that the history of the task to which the scheduling request belongs is not successfully executed, the time length used when the history of the task to which the scheduling request belongs is successfully executed, the waiting time length of the scheduling request of the task to which the scheduling request belongs in the first queue, and the history generation frequency of the task to which the scheduling request belongs.
In this way, in the running process of the electronic device, the starvation time parameter adopted when the sequence of selecting the scheduling request for response is adjusted in real time according to the dynamic change of the service characteristics (namely the use requirement of the user) of the application initiating task, so that the scheduling request is responded according to a more reasonable sequence.
With reference to the electronic device provided in the third aspect, the saturation time is preset by the electronic device; or the electronic equipment is dynamically adjusted according to the time length of the scheduling request in the second queue continuously according to the history.
In this way, in the running process of the electronic device, the adopted saturation time when the sequence of selecting the scheduling request for response is adjusted in real time according to the dynamic change of the service characteristics (namely the use requirement of the user) of the application initiating task, so that the scheduling request is responded according to a more reasonable sequence.
With reference to the electronic device provided in the third aspect, the file operation performed by the embedded file system includes any one or more of the following: create, open, read and write, close, delete, modify a file, or transfer a file storage location.
Thus, the electronic device can respond to a plurality of scheduling requests in sequence according to a specific sequence to schedule the embedded file system to execute a corresponding plurality of file operations, and the application scene of the method is expanded.
In a fourth aspect, the present application provides a chip for application to an electronic device, the chip comprising one or more processors for invoking computer instructions to cause the electronic device to perform a method as described in any of the first aspects.
In a fifth aspect, the present application provides a computer readable storage medium comprising instructions which, when run on an electronic device, cause the electronic device to perform a method as described in any of the first aspects.
Drawings
FIGS. 1A-1C are logic diagrams of scheduling an embedded file system in two task scenarios;
fig. 2 is a schematic diagram of a hardware architecture of an electronic device according to an embodiment of the present application;
fig. 3 is a schematic diagram of an electronic device software architecture (embedded system architecture) according to an embodiment of the present application;
FIG. 4 is a flowchart of a method for scheduling a file system in an embedded system according to an embodiment of the present application;
FIG. 5 is a schematic diagram of a file system scheduling policy in an embedded system according to an embodiment of the present application;
FIG. 6 is a schematic diagram of a file system scheduling policy in an embedded system according to an embodiment of the present application;
FIG. 7 is a logic diagram of scheduling an embedded file system in a two task scenario according to an embodiment of the present application;
fig. 8 is a block diagram of a scheduling request response logic for a file system in an embedded system according to an embodiment of the present application.
Detailed Description
The technical solutions of the embodiments of the present application will be clearly and thoroughly described below with reference to the accompanying drawings. Wherein, in the description of the embodiments of the present application, unless otherwise indicated, "/" means or, for example, a/B may represent a or B; the text "and/or" is merely an association relation describing the associated object, and indicates that three relations may exist, for example, a and/or B may indicate: a exists alone, A and B exist together, and B exists alone.
The terms "first," "second," and the like, are used below for descriptive purposes only and are not to be construed as implying or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include one or more such feature, and in the description of embodiments of the application, unless otherwise indicated, the meaning of "a plurality" is two or more.
Reference in the specification to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the application. The appearances of such phrases 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. Those of skill in the art will explicitly and implicitly appreciate that the described embodiments of the application may be combined with other embodiments.
First, terms related to the present application will be explained as follows:
an embedded operating system: an embedded operating system (Embedded Operating System, abbreviated as EOS) refers to an operating system applied in an embedded device. An embedded device (also called an embedded system) is a device composed of hardware and software and capable of operating independently, and includes software contents of a software running environment and an operating system thereof, and hardware contents including a processor, a memory, a communication module and the like.
In an embedded device, software running on top of the embedded operating system may directly access the hardware of the device. It can be seen that the upper layer application can directly schedule the underlying embedded file system to access the external memory module, i.e. 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, read and write the file stored by the external memory module through a write function, a read function, etc.
Therefore, the embedded operating system reduces the coupling degree of software and hardware, and the dispatching and management of the upper application on the hardware do not depend on the bottom hardware, so that the embedded operating system has the characteristics of portability, tailorable software and hardware, configurable and the like. In addition, compared with rich resources and powerful software configurations required by other non-embedded operating systems, the embedded operating system has low power consumption and is more suitable for small-sized devices, such as wearable devices, internet of things devices and the like.
Non-embedded operating system: the non-embedded operating system is also called a general-purpose operating system, and refers to an operating system used in a general-purpose (legacy) system.
Notably, in non-embedded systems, most of the software running on top of the non-embedded operating system cannot directly access the hardware of the device, i.e., the upper layer application cannot directly schedule the underlying file system interface to access the external memory module. Specifically, since the non-embedded system divides the storage space into a user space and a kernel space, the application program runs in the user space, and the non-embedded operating system and the 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 that the non-embedded operating system and the driver program cannot simply use the pointer to transfer data. That is, 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 mode to the kernel mode, and then the file system interface can be called to access the external memory module, that is, the files stored by different external memory modules can be accessed through the write and read functions.
Embedded file system: is an important component in embedded operating systems, which are methods used by embedded operating systems to explicitly store files on devices. The embedded file system is also used to: the storage space of the file is managed and scheduled, the logical structure, the physical structure and the storage method of the file are provided, the mapping from the identification to the actual address of the file is realized, and the control operation and the access operation (including the services of creating, opening, reading and writing, closing, withdrawing the file and the like) of the file are realized.
The embedded file system mainly comprises three parts: an interface of a file system, a software set for controlling and managing objects, objects and attributes. From the system perspective, an embedded file system is a system for organizing and allocating the space of a file storage device, taking charge of file storage and protecting and retrieving stored files. Specifically, it is responsible for creating files, storing, reading out, modifying, dumping files, controlling access to files for users.
File operation: is the operation of the pointer to create, open, read and write, close, delete and modify, transfer and save files, etc. Functions that need to be invoked when performing file operations include, but are not limited to: open, write, read, close, seek-read, random-read, etc. The embodiment of the application does not limit the specific file operation.
In particular, the file operation is specifically an operation of the pointer on a file stored in an external module of the electronic device, and is not an operation on data in the memory, because the data in the memory can be directly read and written by the CPU.
Task (Task): refers to an operation system of an electronic device, that is, a task refers to a series of operations that achieve a certain purpose.
In the embodiment of the application, the task is initiated by an application, a service and the like running on the embedded operating system in the electronic equipment, and one application can initiate one or more tasks.
The kinds of tasks include, but are not limited to: sensor tasks, display tasks, over-the-air tasks, audio tasks, navigation (e.g., global positioning system (Global Positioning System, GPS)) tasks, input tasks, capability tasks, and the like.
The electronic device executing tasks specifically include: after the application and the service initiate a certain task, the application and the service initiate one or more scheduling requests to the embedded operating system through creating threads, and the embedded operating system responds to the one or more scheduling requests to schedule the embedded file system to execute corresponding one or more file operations, so that the task is completed. That is, when a task contains instructions for performing one or more file operations, then the task corresponds to one or more scheduling requests.
Thread (Thread): is the minimum unit that the operating system can perform operation scheduling. It is included in the process and is the actual unit of operation in the process. One thread refers to a single sequential control flow in a process, and multiple threads may be concurrent in a process, each thread for performing a different task.
With the wide application of wearable small-sized devices, the embedded operating system is widely applied to the wearable small-sized devices due to the unique characteristics of small power consumption, portability, tailorable, configurable and the like. In addition, the embedded file system is an important component of the embedded operating system, and plays an important role in realizing the storage of files and the management of various operations in the embedded system.
One feature that embedded devices possess is the ability to accomplish different tasks through different threads. Specifically, when an upper layer application or service of the electronic device initiates a plurality of tasks, the electronic device creates a plurality of threads for executing the corresponding tasks, and the order of executing the plurality of tasks is substantially determined according to the arrival sequence of the scheduling request corresponding to each task. For ease of understanding, scheduling logic for an embedded file system is described below in the context of two tasks, respectively.
1A-1C, FIGS. 1A-1C illustrate scheduling logic for an embedded file system in two task scenarios.
FIG. 1A illustrates the processing of two read tasks.
As shown in fig. 1A, after an upper layer application or service of the electronic device initiates the read task 1 and the read task 2, threads Thread1-read may be created to execute the read task 1, and threads Thread2-read may be created to execute the read task 2. When read task 1 includes 4 file operations (e.g., r1, r2, r3, r 4), then read task 1 corresponds to 4 scheduling requests for the embedded file system. When the read task 2 includes 4 file operations (e.g., r1, r2, r3, r 4), then the read task 1 corresponds to 4 scheduling requests for the embedded file system. When the arrival time of the scheduling request of the task 1 is earlier than that of the task 2 (denoted as "Thread1-read > Thread 2-read") the electronic device preferentially responds to the scheduling request of the task 1, and then responds to the scheduling request of the task 2, that is, the electronic device executes 4 file operations included in the read task 2 after executing 4 file operations included in the read task 1. This is because, when read task 1 is executed through Thread1-read, thread1-read preempts the task lock, and only after Thread1-read executes read task 1 will the task be released for Thread2-read to preempt the task lock and thus execute read task 2.
FIG. 1B illustrates the processing of two write tasks.
As shown in fig. 1B, after an upper layer application or service of the electronic device initiates the write task 1 and the write task 2, threads Thread1-write may be created to execute the write task 1, and threads Thread2-write may be created to execute the read task 2. Similarly, according to the sequence of arrival times of the scheduling requests corresponding to the writing task 1 and the writing task 2, the electronic device preferentially responds to the scheduling request of the writing task 1 to execute the writing task 1 which arrives earlier, and then responds to the scheduling request of the writing task 2 to execute the writing task 2 which arrives later, and the specific execution process can refer to the description of fig. 1A and is not repeated herein. FIG. 1C illustrates the processing of one read task and one write task.
As shown in fig. 1C, after an upper layer application or service of the electronic device initiates the read task 1 and the write task 2, threads Thread1-read may be created to execute the write task 1, and threads Thread2-write may be created to execute the read task 2. Similarly, according to the sequence of arrival times of the scheduling requests corresponding to the reading task 1 and the writing task 2, the electronic device preferentially responds to the scheduling request of the reading task 1 to execute the reading task 1 which arrives earlier, and then responds to the scheduling request of the writing task 2 to execute the writing task 2 which arrives later, and the specific execution process can refer to the description of fig. 1A and is not repeated herein.
In view of the above-described scenario illustrated in fig. 1A to 1C, when an upper layer application or service of an electronic device initiates a plurality of tasks, the electronic device sequentially responds to a scheduling request of each task according to a sequence in which the scheduling request corresponding to each task arrives, so as to execute the plurality of tasks. Therefore, the waiting time of the scheduling request of the later task is longer, the later task cannot be responded in time, and if the scheduling request of the later task has high real-time requirements, the thread for executing the task is starved, so that the problems of blocking, even dead halt and the like of the electronic equipment are caused.
In addition, since most of embedded devices are single-core devices, namely only one CPU is provided, when a plurality of tasks to be executed are faced, the scheduling requests of the tasks which are queued later are more likely to wait for a long time and still cannot be responded because only one CPU executes the tasks, so that the problems of blocking, even dead halt and the like of the electronic device occur, and the user experience is affected.
In order to solve the problems, the application provides 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 the method, when a plurality of scheduling requests to a file system initiated by a task created by an application are received, the most urgent scheduling request is selected for response from the scheduling requests which are not responded each time according to the priority of the task corresponding to each scheduling request and/or the waiting time of each scheduling request, so that the aim of reasonably responding the plurality of scheduling requests is fulfilled.
Wherein, selecting the most urgent scheduling request includes: selecting a scheduling request with the highest corresponding task priority from a plurality of scheduling requests as the most urgent scheduling request (hereinafter also referred to as a target scheduling request);
or selecting a scheduling request with waiting time greater than a corresponding first threshold value (hereinafter also referred to as starvation time) from a plurality of scheduling requests as the most urgent scheduling request;
or setting a first queue with low priority and a second queue with high priority, and adding all scheduling requests to the first queue; then adding the scheduling request which is not responded in the first queue and has the waiting time reaching the corresponding first threshold value into a second queue; and preferentially selecting the scheduling request with the highest priority of the corresponding task from the second queue to respond, and switching to select the scheduling request with the highest priority of the corresponding task from the first queue to respond when the second queue is empty or the total duration of continuous response of the second queue reaches a second threshold (hereinafter also referred to as the full time).
Further, in another possible implementation manner of the present application, in addition to setting the first queue and the second queue, more queues with different priorities may be set, a plurality of time thresholds are set correspondingly as starvation time of the scheduling request, the scheduling request with waiting time in different threshold ranges is added to the corresponding queue, a plurality of time thresholds are set correspondingly as satiation time of each queue, and after reaching the satiation time of a certain queue, the scheduling request is switched to other queues for response, so that finer and more reasonable scheduling can be achieved.
Further, in another possible implementation manner of the present application, parameters such as the priority of the task corresponding to each scheduling request, the first threshold corresponding to each scheduling request, and the second threshold continuously responding to a certain queue are dynamically changed according to the service characteristics of the upper layer application (i.e. the use requirement of the user), so that the scheduling policy can be dynamically adjusted according to the change of the service characteristics of the upper layer application, and further the scheduling requests can be responded according to a more reasonable sequence.
Next, the custom vocabulary related to the present application is explained, specifically as follows:
priority of a task (which may also be referred to as priority of a scheduling request to which the task corresponds): the method is characterized in that the fixed value is defined by a developer according to the dependency degree of an upper application initiating the task on the file system, and when the value corresponding to the priority of the task is higher, the application which indicates that the request of the task belongs to has higher priority to schedule the embedded file system. Alternatively, the priority of the task may also be a numerical value dynamically adjusted by analyzing design-for-testability (DFT) data collected periodically during the operation of the electronic device, which may be specifically referred to in the description of the method embodiments below.
Wherein the degree of dependency of the upper layer application on the file system is characterized by any one or more of the following factors: and the developer schedules the embedded file system according to the obtained frequency of task scheduling and the real-time requirement of the task on scheduling the embedded file system. It can be understood that: in order to ensure that when an application runs normally, if the application needs to frequently schedule the embedded file system to execute corresponding operations on the file, or when the real-time requirement of the response of the application to the scheduling request is higher, the application is indicated to have high dependency on the embedded file system, so that the priority of a task initiated by the application can be defined as high priority, and conversely, the priority is defined as low priority. For the grading of the priorities of the tasks, reference may be made specifically to the description in the method embodiments hereinafter, which is not repeated here.
In the application, when other conditions are the same, the task with high priority can schedule the embedded file system to operate the file preferentially. That is, under certain other conditions, when the embedded operating system receives the scheduling requests of the tasks with different priorities to the embedded file system, the scheduling requests are sequentially responded and the embedded file system is scheduled to execute the corresponding file operations according to the order of the priorities from high to low. It is to be understood that other conditions must include, but are not limited to: and when the waiting time of the tasks with different priorities to the scheduling requests of the embedded file system is smaller than the corresponding first threshold value or is larger than or equal to the first threshold value, other conditions are the same. Regarding the implementation process of responding to the file scheduling request according to the priority of the task, specific reference may be made to the description in the method embodiment hereinafter, which is not described in detail herein.
A first threshold value: refers to a "starvation time" defined by a developer based on the dependency of an upper layer application on an embedded file system, where "starvation time" refers to a threshold of latency for scheduling requests to the file system initiated by tasks in the application. It can be understood that, in order to ensure user experience, the triggered scheduling request is prevented from being unresponsive for a long time, the process/thread created by the application is starved, the application cannot normally run, and meanwhile, the system is prevented from being running due to the fact that the scheduling request which is not scheduled for a long time always occupies system resources. A scheduling request is typically assigned a timeout, i.e. the maximum time waiting to be scheduled, when it is generated. Therefore, the starvation time provided by the application can be set according to the overtime corresponding to the scheduling request, for example, the starvation time is set to be smaller than or equal to the overtime. Alternatively, the first threshold may also be a value dynamically adjusted by analyzing Design For Test (DFT) data collected periodically during operation of the electronic device, which may be specifically referred to in the description of the method embodiments below.
Wherein the degree of dependency of the upper layer application on the file system is characterized by any one or more of the following factors: and the developer schedules the embedded file system according to the obtained frequency of task scheduling and the real-time requirement of the task on scheduling the embedded file system. It can be understood that: when an application needs to frequently schedule the embedded file system to execute corresponding operations on a file in the normal running process, or the application has higher real-time requirement on response to a scheduling request, the application is indicated to have high dependency on the embedded file system, so that the first threshold of the scheduling request of the task initiated by the application on the embedded file system can be defined as shorter time, and conversely, the first threshold of the scheduling request of the task initiated by the application on the embedded file system is defined as longer time. For the specific setting of the first threshold, reference may be made specifically to the description in the method embodiment hereinafter, which is not described in detail herein.
In the application, the first thresholds corresponding to the task requests initiated by different applications may be the same or different, and the first thresholds corresponding to the different task requests initiated by the same application may be the same or different.
A second threshold value: refers to the upper time, also known as "saturation time", defined by the developer to continue to respond to requests in the second queue in order to ensure relative fairness with which task requests initiated by the respective applications are responded to. This is because the request in the second queue is urgent and therefore is executed preferentially relative to the request in the first queue, but when there are more requests in the second queue, if the task corresponding to the request in the second queue is executed for a long time, the request in the first queue waits for too long to be responded, so that the scheduling request in the first queue reaches the corresponding timeout time. Therefore, in order to ensure that the normal requests in the first queue can also be responded to, the present application therefore requires defining an upper limit value of the total running time of the requests in the second queue, i.e. the second threshold value. Alternatively, the second threshold may be a value dynamically adjusted by analyzing Design For Test (DFT) data collected periodically during operation of the electronic device, which may be specifically referred to later in the description of the method embodiment.
Therefore, after the scheduling method of the embedded file system provided by the application is implemented, the following technical effects can be brought:
(1) For a plurality of scheduling requests to the embedded file system, a reasonable request response sequence can be determined according to a scheduling policy, and the embedded file system is scheduled to perform file operation according to the sequence so as to complete corresponding tasks, so that file system services without priority concept have priority capability.
(2) The scheduling strategy adopted by the application has real-time performance on file operation service provided by upper application. That is, the priorities corresponding to different types of tasks initiated by the application and the first threshold value of the waiting time of the scheduling request from the task are set, so that the scheduling request initiated by the application with higher priority and higher response time requirement can be responded preferentially.
(3) The scheduling strategy adopted by the application has fairness to the file operation service provided by the upper layer application. That is, the total operation time of the scheduling request to be preferentially responded is limited, so that the request of the task with low real-time requirement can be responded to while the real-time requirement is met.
(4) The scheduling strategy adopted by the application is dynamically changed, and the requirements of different application scenes can be flexibly met.
(5) The embedded file system scheduling method provided by the application is specially used for the electronic equipment carrying the embedded operating system, so that the embedded file system scheduling method provided by the application can be provided as a loadable option of the embedded system, and has the characteristics of scalability, tailorability, portability, configurability and the like.
Next, the form, software and hardware architecture of the electronic device provided by the application are described.
The electronic equipment provided by the application is embedded equipment. Embedded operating systems include, but are not limited to: palm (Palm) Embedded->Windows />Etc. The embedded device may be, for example, a wearable device (e.g., with smart watches/bracelets, smart glasses, real wireless stereo (True Wireless Stereo, TWS) headphones, etc.), a super mobile personal computer (ultra-mobile personal computer, UMPC), a netbook, a personal digital assistant (personal digital assistant, PDA), an augmented reality (augmented reality, AR) device, a Virtual Reality (VR) device, an artificial intelligence (artificial intelligence, AI) device, a vehicle-mounted device, a smart home device, and/or a smart city device, among others. In addition, most internet of things (Internet of Things, IOT) devices also belong to embedded devices.
Referring to fig. 2, fig. 2 illustrates a hardware configuration diagram of an electronic device.
As shown in fig. 2, the electronic device may include: processor 110, external memory interface 120, internal memory 121, universal Serial Bus (USB) interface 130, charge management module 140, power management module 141, battery 142, antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, headset interface 170D, sensor module 180, keys 190, motor 191, indicator 192, camera 193, display 194, and Subscriber Identity Module (SIM) interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a touch sensor 180B, among others. Or the sensor module further includes a gyroscope sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity sensor, a fingerprint sensor, a temperature sensor, an ambient light sensor, a bone conduction sensor, and the like, which are not shown.
It should be understood that the structure illustrated in the embodiments of the present application does not constitute a specific limitation on the electronic device. In other embodiments of the application, the electronic device may include more or less components than illustrated, or certain components may be combined, or certain components may be split, or different arrangements of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
The processor 110 may include one or more processing units, such as: the processor 110 may include an Application Processor (AP), a modem processor, a Graphics Processor (GPU), an Image Signal Processor (ISP), a controller, a memory, a video codec, a Digital Signal Processor (DSP), a baseband processor, and/or a neural-Network Processor (NPU), etc. Wherein the different processing units may be separate devices or may be integrated in one or more processors.
The controller can be a neural center and a command center of the electronic device. The controller can generate operation control signals according to the instruction operation codes and the time sequence signals to finish the control of instruction fetching and instruction execution.
A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in the 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 reuse the instruction or data, it can be called directly from the memory. Repeated accesses are avoided and the latency of the processor 110 is reduced, thereby improving the efficiency of the system.
In the embodiment of the present application, after the processor 110 receives a plurality of scheduling requests of a task initiated by an upper layer application to a file system, the scheduling requests may be ordered according to a scheduling policy, and the requests are sequentially responded in order to schedule the embedded file system to perform file operations, and after the corresponding task is completed, the processor 110 may further control the corresponding module to output a result of executing the task. 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, the processor 110 may schedule the embedded file system to read a corresponding music file according to a scheduling policy, and then the processor 110 may control the audio module 170 to play music; after that, the processor 110 schedules the embedded file system to write the GPS data into the corresponding GPS file according to the scheduling policy, and optionally, the processor 110 may control the display screen 194 to display the prompt message of successful recording.
In particular, the electronic device provided by the present application is an electronic device integrated with an embedded operating system, and based on the above description of the scenario illustrated in fig. 1A-1C, the embedded device cannot execute the multi-tasks through the multi-threads in parallel when executing the multi-tasks through the multi-threads, so the technical problem mentioned above easily occurs, but after the processor 110 adopts the scheduling policy provided by the present application, the processor 110 can call the file system service at small intervals for a plurality of tasks to be executed, so as to achieve the effect of executing the plurality of tasks through the multi-threads similarly in parallel, thereby avoiding the thread from being starved and causing the application to be blocked.
For a specific implementation method of the processor 110 for ordering the plurality of scheduling requests according to the scheduling policy, reference may be made to the detailed description of the method flow hereinafter, which is not described herein in detail.
In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit (I2S) interface, a Pulse Code Modulation (PCM) interface, a universal asynchronous receiver/transmitter (UART) interface, a Mobile Industry Processor Interface (MIPI), a general-purpose input/output (GPIO) interface, a Subscriber Identity Module (SIM) interface, and/or a Universal Serial Bus (USB) interface, etc.
It should be understood that the connection relationship between the modules illustrated in the embodiments of the present application is only illustrative, and does not limit the structure of the electronic device. In other embodiments of the present application, the electronic device may also use different interfacing manners, or a combination of multiple interfacing manners in the foregoing embodiments.
The charge management module 140 is configured to receive a charge input from a charger. The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charge management module 140 may receive a charging input of a wired charger through the USB interface 130. In some wireless charging embodiments, the charge management module 140 may receive wireless charging input through a wireless charging coil of the electronic device. The charging management module 140 may also supply power to the electronic device through the power management module 141 while charging the battery 142.
The power management module 141 is used for connecting the battery 142, and the charge management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and/or the charge management module 140 and provides power to the processor 110, the internal memory 121, the external memory, the display 194, the camera 193, the wireless communication module 160, and the like. The power management module 141 may also be configured to monitor battery capacity, battery cycle number, battery health (leakage, impedance) and other parameters. In other embodiments, the power management module 141 may also be provided in the processor 110. In other embodiments, the power management module 141 and the charge management module 140 may be disposed in the same device.
The wireless communication function of the electronic device may be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, a modem processor, a baseband processor, and the like.
The antennas 1 and 2 are used for transmitting and receiving electromagnetic wave signals. Each antenna in the electronic device may be used to cover a single or multiple communication bands. Different antennas may also be multiplexed to improve the utilization of the antennas. For example: the antenna 1 may be multiplexed into a diversity antenna of a wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
The mobile communication module 150 may provide a solution for wireless communication including 2G/3G/4G/5G, etc. applied on an electronic device. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (low noise amplifier, LNA), etc. The mobile communication module 150 may receive electromagnetic waves from the antenna 1, perform processes such as filtering, amplifying, and the like on the received electromagnetic waves, and transmit the processed electromagnetic waves to the modem processor for demodulation. The mobile communication module 150 can amplify the signal modulated by the modem processor, and convert the signal into electromagnetic waves through the antenna 1 to radiate. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be disposed in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be provided in the same device as at least some of the modules of the processor 110.
The modem processor may include a modulator and a demodulator. The modulator is used for modulating the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used for demodulating the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low frequency baseband signal to the baseband processor for processing. The low frequency baseband signal is processed by the baseband processor and then transferred to the application processor. The application processor outputs sound signals through an audio device (not limited to the speaker 170A, the receiver 170B, etc.), or displays images or video through the display screen 194. In some embodiments, the modem processor may be a stand-alone device. In other embodiments, the modem processor may be provided in the same device as the mobile communication module 150 or other functional module, independent of the processor 110.
The wireless communication module 160 may provide solutions for wireless communication including wireless local area network (wireless local area networks, WLAN) (e.g., wireless fidelity (wireless fidelity, wi-Fi) network), bluetooth (BT), global navigation satellite system (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), near field wireless communication technology (near field communication, NFC), infrared technology (IR), etc. for application on an electronic device. The wireless communication module 160 may be one or more devices that integrate 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 transmits the processed signals to the processor 110. The wireless communication module 160 may also receive a signal to be transmitted from the processor 110, frequency modulate it, amplify it, and convert it to electromagnetic waves for radiation via the antenna 2.
In some embodiments, the antenna 1 and the mobile communication module 150 of the electronic device are coupled, and the antenna 2 and the wireless communication module 160 are coupled, so that the electronic device can communicate with the network and other devices through wireless communication technology. The wireless communication techniques may include the Global System for Mobile communications (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 division multiple access (wideband code division multiple access, WCDMA), time division code division multiple access (time-division code division multiple access, TD-SCDMA), long term evolution (long term evolution, LTE), BT, GNSS, WLAN, NFC, FM, and/or IR techniques, among others. The GNSS may include a global satellite positioning system (global positioning system, GPS), a global navigation satellite system (global navigation satellite system, GLONASS), a beidou satellite navigation system (beidou navigation satellite system, BDS), a quasi zenith satellite system (quasi-zenith satellite system, QZSS) and/or a satellite based augmentation system (satellite based augmentation systems, SBAS).
In the embodiment of the present application, the electronic device may communicate with other electronic devices, servers, etc. through the mobile communication module 150 and the wireless communication module 160, so as to receive and download file resources, and store the file resources in the local external memory module, so that the subsequent electronic device may read and write the file resources, etc.
The electronic device implements display functions via a GPU, a display screen 194, an application processor, and the like. The GPU is a microprocessor for image processing, and is connected to the display 194 and the application processor. The GPU is 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.
The display screen 194 is used to display images, videos, and the like. The display 194 includes a display panel. The display panel may employ a liquid crystal display (liquid crystal display, LCD). The display panel may also be manufactured using organic light-emitting diode (OLED), active-matrix organic light-emitting diode (AMOLED), flexible light-emitting diode (flex-emitting diode), mini, micro-OLED, quantum dot light-emitting diode (quantum dot light emitting diodes, QLED), or the like. In some embodiments, the electronic device may include 1 or N display screens 194, N being a positive integer greater than 1.
In the embodiment of the present application, the display screen 194 of the electronic device may be used for displaying a user interface of a task execution result, for example, when a request of a task initiated by an upper layer application is a request to open a gallery, a memo, and other contents, after the electronic device finishes executing a corresponding file reading operation, information such as an image included in the gallery, an event recorded in the memo, and the like may be displayed through the display screen 194.
The electronic device may implement shooting functions through an ISP, a camera 193, a video codec, a GPU, a display screen 194, an application processor, and the like.
The ISP is used to process data fed back by the camera 193. For example, when photographing, the shutter is opened, light is transmitted to the camera photosensitive element through the lens, the optical signal is converted into an electric signal, and the camera photosensitive element transmits the electric signal to the ISP for processing and is converted into an image visible to naked eyes. ISP can also optimize the noise, brightness and skin color of the image. The ISP can also optimize parameters such as exposure, color temperature and the like of a shooting scene. In some embodiments, the ISP may be provided in the camera 193.
The camera 193 is used to capture still images or video. The object generates an optical image through the lens and projects the optical image onto the photosensitive element. The photosensitive element may be a charge coupled device (charge coupled device, CCD) or a Complementary Metal Oxide Semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, which is then transferred to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV, or the like format. In some embodiments, the electronic device may include 1 or N cameras 193, N being a positive integer greater than 1.
In an embodiment of the present application, the image captured by the camera 193 may be stored in a gallery file of the external memory module, so that the processor 110 may view, delete, edit, change the position of the image, etc. by operating on the gallery file.
The digital signal processor is used for processing digital signals, and can process other digital signals besides digital image signals. For example, when the electronic device selects a frequency bin, the digital signal processor is used to fourier transform the frequency bin energy, and so on.
Video codecs are used to compress or decompress digital video. The electronic device may support one or more video codecs. In this way, the electronic device may play or record video in a variety of encoding formats, such as: dynamic picture experts group (moving picture experts group, MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
In the embodiment of the present application, in the scenes of sharing a screen, remote control, screen projection, etc., the electronic device needs to encode the content displayed on the current display screen 194 into a video stream by using a video codec, and then send the video stream to other electronic devices.
The internal memory 121 may include one or more random access memories (random access memory, RAM) and one or more non-volatile memories (NVM).
The random access memory may include a static random-access memory (SRAM), a dynamic random-access memory (dynamic random access memory, DRAM), a synchronous dynamic random-access memory (synchronous dynamic random access memory, SDRAM), a double data rate synchronous dynamic random-access memory (double data rate synchronous dynamic random access memory, DDR SDRAM, such as fifth generation DDR SDRAM is commonly referred to as DDR5 SDRAM), etc.;
the nonvolatile memory may include a disk storage device, a flash memory (flash memory).
The FLASH memory may include NOR FLASH, NAND FLASH, 3D NAND FLASH, etc. divided according to an operation principle, may include single-level memory cells (SLC), multi-level memory cells (MLC), triple-level memory cells (TLC), quad-level memory cells (QLC), etc. divided according to a storage specification, may include universal FLASH memory (english: universal FLASH storage, UFS), embedded multimedia memory cards (embedded multi media Card, eMMC), etc. divided according to a storage specification.
The random access memory may be read directly from and written to by the processor 110, may be used to store executable programs (e.g., machine instructions) for an operating system or other on-the-fly programs, may also be used to store data for users and applications, and the like.
The nonvolatile memory may store executable programs, store data of users and applications, and the like, and may be loaded into the random access memory in advance for the processor 110 to directly read and write.
The external memory interface 120 may be used to connect external non-volatile memory to enable expansion of the memory capabilities of the electronic device. The external nonvolatile 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 nonvolatile memory.
In an embodiment of the present application, the external memory module includes: a nonvolatile memory built in the electronic device and an external nonvolatile memory to which the electronic device is connected through the external memory interface 120. The external memory module refers to a memory that the processor 110 of the electronic device cannot directly read and write, and not simply refers to a memory that is external to the electronic device in a spatial structure. The external memory module can be used for storing music, video or files of various logs, etc. The electronic device may implement audio functions through an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, an application processor, and the like. Such as music playing, recording, etc.
The audio module 170 is used to convert digital audio information into an analog audio signal output and also to convert an analog audio input into a 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 disposed in the processor 110, or a portion of the functional modules of the audio module 170 may be disposed in the processor 110.
The speaker 170A, also referred to as a "horn," is used to convert audio electrical signals into sound signals. The electronic device may listen to music, or to hands-free conversations, through speaker 170A.
A receiver 170B, also referred to as a "earpiece", is used to convert the audio electrical signal into a sound signal. When the electronic device picks up a phone call or voice message, the voice can be picked up by placing the receiver 170B close to the human ear.
Microphone 170C, also referred to as a "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or transmitting voice information, the user can sound near the microphone 170C through the mouth, inputting a sound signal to the microphone 170C. The electronic device may be provided with at least one microphone 170C. In other embodiments, the electronic device may be provided with two microphones 170C, and may implement a noise reduction function in addition to collecting sound signals. In other embodiments, the electronic device may also be provided with three, four, or more microphones 170C to enable collection of sound signals, noise reduction, identification of sound sources, directional recording functions, etc.
The earphone interface 170D is used to connect a wired earphone. The headset interface 170D may be a USB interface 130 or a 3.5mm open mobile electronic device platform (open mobile terminal platform, OMTP) standard interface, a american cellular telecommunications industry association (cellular telecommunications industry association of the USA, CTIA) standard interface.
In the embodiment of the present application, after the electronic device reads the music file from the external memory module, the digital audio information of the music file may be converted into an analog audio signal through the audio module 170, and then the music may be output through the speaker 170A or the receiver 170B.
The pressure sensor 180A is used to sense a pressure signal, and may convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A may be disposed on the display screen 194. The pressure sensor 180A is of various types, such as a resistive pressure sensor, an inductive pressure sensor, a capacitive pressure sensor, and the like. The capacitive pressure sensor may be a capacitive pressure sensor comprising at least two parallel plates with conductive material. The capacitance between the electrodes changes when a force is applied to the pressure sensor 180A. The electronics determine the strength of the pressure from the change in capacitance. When a touch operation is applied to the display screen 194, the electronic apparatus detects the intensity of the touch operation according to the pressure sensor 180A. The electronic device may also calculate the location of the touch based on the detection signal of the pressure sensor 180A. In some embodiments, touch operations that act on the same touch location, but at different touch operation strengths, may correspond to different operation instructions. For example: and executing an instruction for checking the short message when the touch operation with the touch operation intensity smaller than the first pressure threshold acts on the short message application icon. And executing an instruction for newly creating the short message when the touch operation with the touch operation intensity being greater than or equal to the first pressure threshold acts on the short message application icon.
The touch sensor 180B, also referred to as a "touch panel". The touch sensor 180B may be disposed on the display 194, and the touch sensor 180B and the display 194 form a touch screen, which is also referred to as a "touch screen". The touch sensor 180B is used to detect a touch operation acting thereon or thereabout. The touch sensor may communicate the detected touch operation to the application processor to determine the touch event type. Visual output related to touch operations may be provided through the display 194. In other embodiments, the touch sensor 180B may also be disposed on the surface of the electronic device at a different location than the display 194.
In an embodiment of the present application, the pressure sensor 180A and the touch sensor 180B may be used to collect relevant data of clicking, pressing, sliding or long-pressing operations acting on the display screen 194, and report the data to the processor 110, so that the processor 110 determines corresponding events according to the data, so as to control corresponding modules of the electronic device to execute the corresponding events. For example, the touch sensor 180B of the electronic device may collect data related to a touch operation on a control provided by the music application and playing local music, report the data to the processor 110, and through analysis, the processor 110 may determine that the music application initiates a request for playing a task of music, and in response to the request, the processor 110 may read a corresponding music file from the external memory module to perform the task of playing music.
The keys 190 include a power-on key, a volume key, etc. The keys 190 may be mechanical keys. Or may be a touch key. The electronic device may receive key inputs, generating key signal inputs related to user settings and function controls of the electronic device.
The motor 191 may generate a vibration cue. The motor 191 may be used for incoming call vibration alerting as well as for touch vibration feedback. For example, touch operations acting on different applications (e.g., photographing, audio playing, etc.) may correspond to different vibration feedback effects. The motor 191 may also correspond to different vibration feedback effects by touching different areas of the display screen 194. Different application scenarios (such as time reminding, receiving information, alarm clock, game, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect may also support customization.
The indicator 192 may be an indicator light, may be used to indicate a state of charge, a change in charge, a message indicating a missed call, a notification, etc.
The SIM card interface 195 is used to connect a SIM card. The SIM card may be inserted into the SIM card interface 195, or removed from the SIM card interface 195 to enable contact and separation with the electronic device. The electronic device may support 1 or N SIM card interfaces, N being a positive integer greater than 1. The SIM card interface 195 may support Nano SIM cards, micro SIM cards, and the like. The same SIM card interface 195 may be used to insert multiple cards simultaneously. The types of the plurality of cards may be the same or different. The SIM card interface 195 may also be compatible with different types of SIM cards. The SIM card interface 195 may also be compatible with external memory cards. The electronic equipment interacts with the network through the SIM card, so that the functions of communication, data communication and the like are realized. In some embodiments, the electronic device employs esims, namely: an embedded SIM card. The eSIM card can be embedded in the electronic device and cannot be separated from the electronic device.
Referring to fig. 3, fig. 3 is a block diagram of a software system of an electronic device according to an embodiment of the present application.
As shown in fig. 3, the software system of the electronic device integrating the embedded operating system adopts a hierarchical architecture. The layered architecture divides the software into a plurality of layers, and each layer has clear roles and division. The layers communicate with each other through a software interface. In some implementations, the embedded operating system is divided into four layers, from top to bottom, an application layer, an application framework layer, algorithms and internal libraries, and a kernel layer, respectively.
The application layer may include a series of application packages. To integrate an embedded operating system, applications may be, for example: maps, music, gallery, cameras, and calendars, not shown, talk, navigation, WLAN, bluetooth, video, short messages, alarm clocks, sports health, weather, etc. These applications run on top of the embedded operating system, typically separately from the embedded operating system. The application software is used for realizing the control function of the controlled object, and the application software layer is used for facing the controlled object and the user and is used for providing a man-machine interaction interface for facilitating the operation of the user.
The Framework layer provides an application programming interface (application programming interface, API) and programming Framework for the application of the application layer, i.e., the application layer accesses/invokes services provided by the application Framework layer through the Framework API, including, for example, the system basic capability services, hardware services, underlying software services, etc. shown in fig. 3.
In particular, in the embodiment of the present application, in order to implement reasonable scheduling of a file system in an embedded operating system, a file system scheduling service is newly added, where the file system scheduling service may be specifically integrated in an underlying software service, that is, the file system service originally in the underlying software service (i.e., the file system in the present application) is at the same level, and communication is implemented between the two by using a message service request manner. Alternatively, the file system scheduling service may be independently provided at an application framework layer, an algorithm, an internal library or kernel layer, etc., which is not limited in any way by the embodiment of the present application.
It will be appreciated that, in addition to the file system service and the file system scheduling service, the underlying software service may further include a content management service, a log service, a sensor management service, a bluetooth management service, etc., which are not listed herein, and the present application is not limited thereto.
In the embodiment of the application, when an upper application initiates a task or other services in an application program framework layer initiates a task, if the task comprises one or more file operation instructions, the file system scheduling service can receive a plurality of call requests to a file system with the file operation instructions as granularity. For example, when task a includes file operation instruction 1, file operation instruction 2, and file operation instruction 3, the application may carry file operation instruction 1 in scheduling request 1, file operation instruction 2 in scheduling request 2, file operation instruction 3 in scheduling request 3, and send scheduling request 1, scheduling request 2, and scheduling request 3 to the file system scheduling service. And then, the file system scheduling service orders the calling requests of the upper layer application file system according to the scheduling strategy, so that the current most urgent scheduling request is selected, the most urgent scheduling request is sent to the file system service, and the file system service performs file scheduling according to the file operation instruction carried in the scheduling request, 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 finishes scheduling, the obtained result is transmitted to the file system scheduling service through an interface between the file system service and the file system scheduling service after the corresponding result is obtained, and then the file system scheduling service returns to a provider of the scheduling request, namely a corresponding task.
The specific implementation method of the file system scheduling service for ordering the plurality of call requests according to the scheduling policy may refer to the description of the method embodiments hereinafter, which is not repeated herein.
Algorithms and internal libraries are used to manage various algorithms, such as living body detection algorithms, gesture algorithms, wear detection algorithms, dimming algorithms, etc., various basic libraries, such as basic libraries of security classes, bar codes, payment classes, and protocol stacks provided by chip manufacturers, 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 the present embodiment, and is not to be taken as the only limitation of the present embodiment.
The kernel layer comprises a kernel core, a Hardware Abstraction Layer (HAL) and a hardware driving layer. In particular to practical applications, the kernel core may interact with the upper layer through a microcontroller software interface standard (Cortex Microcontroller Software Interface Standard, CMSIS) API, and the hardware abstraction layer may interact with the upper layer through a HAL API.
The HAL can separate the upper-layer software from the lower-layer hardware of the system, so that a developer of the upper-layer software of the system does not need to care about the condition of the lower-layer hardware, and the development is only needed according to an interface provided by the HAL. HAL may also be understood as part of the hardware driver layer. In some embodiments, the application layer may directly call the hardware driver layer through the framework layer, in other embodiments, the hardware adaptation layer is configured to reply to the situation that the electronic device adopts multi-platform hardware, and the hardware adaptation layer encapsulates the hardware driver interfaces provided by the multiple platforms again, so as to maintain a uniform external interface, so that software developers on an upper layer of the system do not need to care about the situation of the bottom hardware, and develop the hardware driver interfaces according to the interface provided by the HAL.
The kernel layer contains all the drivers needed by the normal operation of the on-board hardware resources and provides APIs for the upper layer call. The kernel layer includes, for example, display drivers, camera drivers, audio drivers, sensor drivers, and the like.
Based on the above description of the software and hardware architecture of the electronic device, the following describes a flowchart of a scheduling method of an embedded file system provided by the application.
As shown in fig. 4, the method flow includes the steps of:
s101, the electronic device generates a plurality of tasks, wherein one task comprises one or more scheduling requests.
Specifically, one or more applications or services in the electronic device may trigger itself during execution or trigger generation of multiple tasks according to user operations, and the electronic device may execute the multiple tasks by creating multiple threads. One of the tasks may include one or more file operations, each corresponding to a scheduling request for scheduling the embedded file system to perform the corresponding file operation. That is, the dispatch requests corresponding to each task are generated with granularity of file operations included in each task. Further, the plurality of scheduling requests may be generated by the electronic device simultaneously or in a short time.
In a specific example, when an application such as music, navigation, etc. is installed in an electronic device, when the music is receiving an operation for playing the music entered by a user, then the music application creates a thread for executing a task for playing the music, which task may involve operations for reading music files, so that a file system scheduling service in an embedded operating system of the electronic device may receive a plurality of scheduling requests for the file system initiated by the task in the music application. When the navigation application receives an operation input by a user for starting the GPS function, the navigation application creates a thread for executing a task for recording GPS data, the task relates to a plurality of operations for writing GPS files, and therefore a file system scheduling service in an embedded operating system of the electronic device can receive a plurality of scheduling requests for a file system initiated by the task in the navigation application.
S102, the electronic equipment sequentially responds to a plurality of scheduling requests according to the priority of the tasks and/or the waiting time of the scheduling requests.
Specifically, an application or service in the electronic device sends a plurality of scheduling requests corresponding to a plurality of tasks to a file system scheduling service, and the file system scheduling service sequentially responds to the plurality of scheduling requests according to the priority of the tasks and/or the waiting time of the scheduling requests, namely sequentially schedules the corresponding file systems to execute corresponding file operations.
The file system scheduling service responds to the plurality of scheduling requests in sequence according to the priority of the task and/or the waiting time of the scheduling requests, and specifically responds to the following three strategies.
Strategy one: each time a scheduling request corresponding to a task with highest priority is selected from a plurality of non-responded scheduling requests to be responded as a target scheduling request (also called the most urgent scheduling request), if a plurality of scheduling requests corresponding to the task with highest priority exist, the scheduling requests are sequentially responded according to the sequence from front to back of the arrival time of the scheduling requests.
Strategy II: each time a scheduling request with the waiting time reaching a corresponding first threshold value is selected from a plurality of scheduling requests to be responded as a target scheduling request (also called the most urgent scheduling request), if a plurality of scheduling requests with the waiting time reaching the corresponding first threshold value exist, the scheduling requests are responded in sequence according to the sequence from front to back of the arrival time of the scheduling requests.
Strategy III: considering that when multiple scheduling requests are received simultaneously or in a short time under the condition of busy traffic, the multiple scheduling requests may have multiple scheduling requests corresponding to tasks with the same priority, and may also have multiple scheduling requests with waiting time greater than the corresponding first threshold, so that two factors of task priority and waiting time may be considered simultaneously to sequentially select a target scheduling request from the scheduling requests which are not responded to respond, and the method specifically includes the following steps shown in fig. 5:
S1031, the electronic device adds the plurality of scheduling requests to the first queue.
Specifically, the file system scheduling service of the electronic device first adds the received plurality of scheduling requests to the first queue. Optionally, the file system scheduling service may sequentially add a plurality of corresponding scheduling requests to the first queue according to the order of the priorities of the tasks from high to low.
In the present application, the first queue is also called a normal queue.
S1032, the electronic device selects the scheduling request with the highest priority from the scheduling requests which are not responded in the first queue to respond.
Specifically, in the initial situation, the waiting time of the scheduling request which is not responded in the first queue is generally shorter, and the corresponding first threshold value (also called starvation dead time) is not reached yet, so that the file system scheduling service of the electronic device selects the scheduling request with the highest priority from the scheduling requests which are not responded in the first queue to respond. And if a plurality of scheduling requests corresponding to the tasks with the highest priority are provided, selecting the scheduling request with the highest priority and the first arrival time according to the arrival time of the scheduling request to respond.
S1033, the electronic device determines whether the waiting time of the scheduling request that is not responded to in the first queue reaches a first threshold.
Specifically, as the waiting time of the scheduling request which is not responded in the first queue increases gradually in the process of the electronic device responding to the scheduling request in the first queue, in order to avoid that the scheduling request which is not responded for a long time, so that the scheduling request which is waiting for the time to reach (be greater than or equal to) the first threshold value is detected in time, and a subsequent policy of timely response is implemented.
If the electronic device determines that there is a scheduling request in the first queue for which the waiting time of the unresponsive scheduling request reaches the first threshold, the electronic device executes subsequent steps S1034-S1036; otherwise, the electronic device loops through S1032-S1033.
At S1034, the electronic device adds the scheduling request which is not responded to in the first queue and has the waiting time reaching the first threshold to the second queue.
Specifically, as the electronic device responds to the scheduling request in the first queue, the waiting time of the scheduling request which is not responded in the first queue generally gradually increases, that is, the waiting time of one or more scheduling requests reaches the corresponding starvation time, so that one or more scheduling requests with the file system scheduling service waiting time of the electronic device reaching the corresponding starvation time move to the second queue for being responded preferentially. In the present application, the second queue is also called VIP queue.
S1035, the electronic equipment selects the scheduling request with the highest priority from the scheduling requests which are not responded in the second queue to respond.
Specifically, since the scheduling requests in the second queue are all scheduling requests that reach the corresponding starvation time, that is, scheduling requests that have a high real-time requirement and are fast in time-out, compared with the scheduling requests that do not reach the corresponding starvation time in the first queue, the file system scheduling service of the electronic device should preferentially select the scheduling request with the highest priority from among the scheduling requests that are not responded in the first queue to respond. And if a plurality of scheduling requests corresponding to the tasks with the highest priority are provided, selecting the scheduling request with the highest priority and the first arrival time according to the arrival time of the scheduling request to respond. Thus, the scheduling request with high priority and high real-time performance can be responded as soon as possible.
(optional step) S1036, the electronic device determines whether the second queue is empty or whether a duration of continuous response to the scheduling request in the second queue exceeds a second threshold.
Specifically, in the process of responding to the scheduling request in the second queue, the file system scheduling service of the electronic device records the duration of continuously responding to the scheduling request in the second queue, and determines whether the second queue is still empty.
When it is determined that the second queue is empty, or the duration of continuous response to the scheduling request in the second queue reaches the second threshold (also referred to as the saturation time), the electronic device jumps to execute S1032. When it is determined that the second queue is not empty and the duration of the continuous response to the scheduling request in the second queue does not reach (is less than) the second threshold (also referred to as the saturation time), the electronic device jumps to step S1035.
Alternatively, after the electronic device performs step S1035, step S1035 may be continued until the second queue has no unresponsive scheduling request, and the process jumps to step S1032. That is, the electronic device does not need to consider the saturation time of the second queue, and as long as there is a scheduling request waiting for the starvation time in the second queue, the electronic device continuously responds to the scheduling request in the second queue until the second queue is empty.
The priority of the task corresponding to the scheduling request (may also be referred to as the priority of the scheduling request) is determined according to the dependency of the upper layer application that initiates the task on the file system. For example, for applications that initiate sensor tasks, display tasks, over-the-air tasks, audio tasks, GPS tasks, these applications typically rely heavily on the file system, thus prioritizing such tasks higher; for applications that initiate input, capability tasks (e.g., bluetooth transport tasks, tasks for drivers in the platform), and log tasks, these applications have low dependencies on the file system, the priority of such tasks may be set lower. Particularly, the scheduling request corresponding to the sensor task and the scheduling request corresponding to the display task have high real-time requirements, so that the priorities of the sensor task and the display task can be set to be higher; the real-time requirement of the scheduling request corresponding to the log task of the data generated in the running process of the system/program is low, so that the priority of the log task can be set lower.
For prioritization of tasks, reference may be made specifically to table 1.
Table 1 priority policy table
Task (Task) Priority (higher priority with larger value)
Sensor task (Sensor task) 37
Display task (Display task) 36
Input task (Input task) 34
Air download task (Ota task) 34
Audio task (Audio task) 33
Capability task (Abilitytask) 25
Log task (Log task) 0
It should be understood that the above description and the text shown in table 1 are only examples listed for better understanding of the technical solution of the present embodiment, and are not the only limitation of the present embodiment.
Through the above description on the setting of the priorities of different tasks, the starvation time configured in the scheduling request corresponding to the different tasks may also be set according to the priorities, for example, the higher the priority is, the higher the real-time requirement is indicated, the smaller the corresponding starvation time is, and the lower the priority is, the lower the real-time requirement is indicated, the larger the starvation time is indicated. Based on this principle, starvation times configured for scheduling requests corresponding to different tasks may be as shown in table 2.
Table 2 starvation time policy table
It will be appreciated that the starvation times corresponding to tasks with different priorities recorded in table 2 are merely examples listed for better understanding of the technical solution of the present embodiment, and are not the only limitation of the present embodiment. In practical application, the starvation time strategy can be recorded in a form of a table or any form such as XML, which can reflect the relation between the priority and the starvation time.
Optionally, the method illustrated in fig. 5 may further include the steps of: after step S1036 is performed and the process jumps to step S1032, a duration of continuous response to the scheduling request in the first queue is recorded, and when the duration reaches the saturation time of the first queue, the process may also switch to response to the scheduling request in the second queue.
Optionally, the common queues and VIP queues included in the method flow described in fig. 5 are only examples, and in other examples of the present application, further queues may be set, where different queues have different priorities and different saturation times of the different queues. Setting a plurality of starvation times of each scheduling request, adding the scheduling requests with waiting time in different ranges into the corresponding queues, wherein the scheduling requests in the queues with higher priority can be responded preferentially, and switching to respond to the scheduling requests in the queues with lower priority than the current queue when the total time length of the scheduling requests in a certain queue continuously responded reaches the corresponding saturation time.
Optionally, the method flow shown in fig. 5 may further include the following steps:
on the basis of the file system scheduling service provided by the application, any one or more of the priority of the task corresponding to the scheduling request, the starvation time corresponding to each scheduling request, the full time corresponding to each queue and the like can be dynamically adjusted, so that the file system scheduling service can adapt to the change of the service characteristics (namely the use requirement of a user) of upper-layer application, and when the target scheduling request is selected each time, the target scheduling request can be selected according to a more reasonable scheduling strategy, and the scheduling capability of the file system service is further improved.
Specifically, the priority, hunger time and satiety time adjustment method may be dynamically adjusted according to DFT data periodically collected during the use of the electronic device by a user, for example. In this embodiment, the DFT data includes, but is not limited to, any one or more of the following: the scheduler statistics information (i.e. TaskId or application identifier of the upper layer application), the number of file requests (recording the number of times each file is scheduled), the upper layer application with the largest request in a preset time (such as 1 second), the number of times of failure of the scheduling request corresponding to the upper layer application, the response time from the triggering of the scheduling request to the completion of processing by the upper layer application, the waiting time of each scheduling request in a common queue, the total running time of the VIP queue, and the like.
In order to collect the DFT data, so as to update a file service scheduling policy followed by a file system scheduling service according to the collected DFT data, a DFT data collection module is introduced in the structure of the file system scheduling service according to the embodiment. Illustratively, in some implementations, the DFT data collection module can be one; in other implementations, the DFT data collection module can be multiple. The content collected in the DFT data listed above can be known that the caller statistics information and the file request times are obtained at the encapsulation module in the file system scheduling service, and other information can be obtained at the scheduling module or the encapsulation module.
As can be seen from the description of the flowchart of the scheduling method of the embedded file system shown in fig. 5, the scheduling method of the embedded file system provided by the present application considers not only the real-time requirement of each scheduling request, but also the fairness requirement of the whole scheduling request. Specifically, by setting a plurality of queues with different priorities, such as a common queue (low priority) and a VIP queue (high priority), the queue with high priority is used for accommodating the scheduling request with waiting time length about to reach the service requirement time length, and the queue with lower priority is used for accommodating the scheduling request with waiting time length not reaching the service requirement time length yet, so as to ensure the real-time requirement of the scheduling request, and the scheduling request in the high priority queue is responded preferentially. In addition, in order to ensure fairness of the overall scheduling request, a total time threshold for responding to the scheduling request in the high-priority queue is set, and the scheduling request in the low-priority queue is switched to be responded after the total time threshold is reached. In order to further satisfy the required time length of the service to which each scheduling request belongs, that is, further satisfy the real-time requirement of each scheduling request, when responding to the scheduling request in each queue, the scheduling requests are sequentially responded according to the order from high to low (the priority of the task corresponding to the scheduling request is from high to low) of the urgency degree.
Next, taking a specific method for selecting the target scheduling request for response in the third policy in step S102 as an example, the scheduling method of the embedded file system provided by the present application is described in detail with reference to the embedded system architecture described in fig. 3.
Referring to fig. 6, fig. 6 illustrates a file system scheduling frame diagram in an embedded system according to an embodiment of the present application.
As shown in fig. 6, the file system scheduling service in the embedded system architecture may include: the device comprises a packaging module, a scheduling module and an executing module.
The encapsulation module is used for receiving a plurality of scheduling requests of tasks initiated by an upper layer application to a file system, extracting information such as file operation instructions, task identification numbers and the like from the scheduling requests, encapsulating the extracted information into a structural body according to a preset format, and enabling the scheduling requests to be transmitted in the embedded operation system in the form of the structural body. The plurality of scheduling requests may include, for example, the scheduling request of task 1, task 2, task 3, task 4, etc. shown in fig. 6, or may further include more or less scheduling requests, which the present application is not limited to.
It should be understood that, in the implementation of the present application, the scheduling request refers to a scheduling request provided by a task triggered by an upper layer application or other service, where a task may include one or more scheduling requests, and for an exemplary file reading task, the file reading task may include any one or several file operation instructions of r1, r2, r3, and r4 as described above, so that the file operation instruction is used as granularity to initiate a corresponding one or more scheduling requests by the one or more file operation instructions.
In one embodiment, the encapsulation module encapsulates each scheduling request to obtain a structure including, but not limited to, the following parameters: file object structure (FIP), file name (FileName), file operation instruction (OperaCmd), task identification number of upper application (TsakId), file information structure (filif), current scheduled state (EnuFlag), timeout waiting time (WaitTime), starvation time (HungtryTime), file operation return result (FileOperaErr), etc. Parameters FIP, fileName, operaCmd, tsakId, waitTime and the like can be assigned in the encapsulation module, and specifically, the encapsulation module extracts information from the received scheduling request to assign. The other parameters can be assigned by the corresponding modules. That is, only the parameters FIP, fileName, operaCmd, tsakId, waitTime, hungtryTimeEnuFlag, fileOperaErr, of the scheduling request output by the encapsulation module, i.e., the scheduling request transmitted in (2) of fig. 6, are specifically informative.
The scheduling module selects the most urgent scheduling request (scheduling request with highest priority) from the plurality of scheduling requests as a target scheduling request, and sends the selected target scheduling request to the execution module. In step (3) in fig. 6, that is, the step specifically included in the step of selecting, by the scheduling module, the target scheduling request to send to the scheduling module may refer to the descriptions in the foregoing steps S1031-S1036, which are not described herein in detail.
The method for acquiring the priority and starvation time of the task comprises the following steps: the scheduling module may obtain the priority of the task corresponding to each scheduling request according to a specific parameter, i.e. TsakId, in the structure body representing each scheduling request, or may also obtain the priority of the task corresponding to each scheduling request according to a specific parameter, i.e. HungtryTime, in the structure body of each scheduling request, or the starvation time corresponding to the scheduling request.
The scheduling module is further configured to assign values to specific parameters in the structure representing each scheduling request, including the EnuFlag and HungtryTime values. Specifically, the scheduling module may obtain, according to the TsakId of the scheduling request, the starvation time corresponding to the scheduling request, so as to assign a value to HungtryTime, and the scheduling module assigns a value to EnuFlag according to whether the scheduling request is responded, for example, a 0 flag is not responded, a 1 flag is responded, and so on.
The execution module is configured to receive a target scheduling request selected by the scheduling module, respond to the target scheduling request, send the target scheduling request to a file system service, that is, execute step (4), schedule, by the file system service, a corresponding interface of a file system to execute a corresponding file operation, and send a processing result to the execution module after obtaining the processing result, that is, execute step (5). And after the execution module obtains the processing result returned by the file system service, the execution module also sends the information containing the processing result to the encapsulation module.
Or in another possible implementation method, after receiving the target scheduling request selected by the scheduling module, the executing module may directly schedule the interface of the corresponding file system to execute the corresponding file operation in response to the target scheduling request, and after the executing module obtains the processing result, the executing module sends the processing result to the packaging module, that is, execute step (6).
The execution module is further configured to assign a specific parameter in the structure body representing each scheduling request, including a FileOperaErr parameter. Specifically, after the file system is scheduled to respond to the scheduling request, the execution module can acquire an execution result returned by the file system, and the execution module is a FileOperaErr parameter value according to the execution result.
And finally, the execution module returns the information containing the execution result to the upper layer application through the encapsulation module. Specifically, the execution module may first return information including the returned result to the encapsulation module, where the information including the returned result may be, for example, a structure body that represents each scheduling request after the FileOperaErr parameter has been assigned. In some examples, the returned execution result may be, for example, the actual read data.
Next, the technical effects that can be achieved by the method provided by the present application will be described with reference to fig. 7.
Referring to fig. 7, fig. 7 illustrates a scheduling logic diagram for an embedded file system in a two task scenario according to an embodiment of the present application.
As shown in fig. 7, after an upper layer application or service of the electronic device initiates task1 and task2 in sequence, threads Thread1-task1 may be created to execute task1, threads Thread1-task2 may be created to execute task2,
when 3 files contained in the task1 are operated, three scheduling requests of Req1, req2 and Req3 are correspondingly generated. When the task2 contains 2 files, two scheduling requests of Req4 and Req5 are correspondingly generated.
For the order of arrival times of the scheduling requests corresponding to task1 and task2, reference is made to the description of fig. 8 below.
Fig. 8 is a schematic diagram illustrating a response logic diagram of a scheduling request to a file system in an embedded system according to an embodiment of the present application.
Referring to (1) in fig. 8, in the initial case, when the electronic device has no scheduling request to be responded, both the normal queue and VIP queue are empty.
Referring to fig. 8 (2), when the file system scheduling service of the electronic device receives the scheduling requests Req1, req2, req3 from task1, since these 3 scheduling requests come from the same task, in one implementation, their priorities may be the same, and for this scenario they may be added to the normal queue in the order of the order received between these 3 scheduling requests, such as in the order of Req1 first, req2 then Req3, while the VIP queue is still empty.
Referring to fig. 8 (3), the file system scheduling service of the electronic device may select the most urgent scheduling request from the normal queue as the target scheduling request according to the scheduling method described above. Because the tasks corresponding to the Req1, the Req2 and the Req3 are all task 1, the priorities are the same, and the Req1 is selected to respond according to the sequence of the Req1, the Req2 and the Req3, and then the unresponsive scheduling request in the normal queue includes the Req2 and the Req3, and if the electronic device receives the scheduling request Req4 and the Req5 from the task2 in the process of responding to the Req1, the unresponsive scheduling request in the normal queue also includes the Req4 and the Req5.
Referring to fig. 8 (4), according to the foregoing scheduling method, the file system scheduling service of the electronic device records the waiting time of the scheduling request that is not responded in the normal queue, and when detecting that the waiting time of the scheduling request reaches the corresponding starvation time, moves the scheduling request to the VIP queue. For example, when the waiting time of Req4, req5 is detected to reach the corresponding starvation time, req4, req5 is moved into the VIP queue.
With continued reference to fig. 8, after moving Req4 and Req5 from the normal queue to the VIP queue, the file system scheduling service of the electronic device selects the scheduling request in the VIP queue in fig. 8 (4) to respond. Since Req4, req5 come from the same task, task2, in one implementation, their priorities may be the same, and for this scenario may be moved into the VIP queue in the order of the order received between Req4, req5, e.g., in the order of Req4 first, then Req5. And responds in the order of Req4 followed by Req5.
Particularly, when the electronic equipment calls the file system service to respond to Req4 first, the total duration of responding to the scheduling request in the VIP queue is recorded at the same time, and when the total duration reaches the full time, the electronic equipment is switched to the common queue, and the scheduling request is selected from the common queue to respond.
For example, as shown in fig. 7 (1), before the electronic device invokes the file system service to respond to Req5, if it is detected that the total duration of the scheduling requests in the response VIP queue reaches the saturation time, the electronic device switches to the normal queue, and selects the sequential scheduling requests Req2 and Req3 from the normal queue to respond, that is, executes the file operation instruction 2 and the file operation instruction 3, until the scheduling requests in the normal queue are empty, or the waiting time in the normal queue is longer than the scheduling request corresponding to the starvation time, or switches to the VIP queue after the total duration of the scheduling requests in the response normal queue reaches the corresponding saturation time, and selects Req5 from the VIP queue to respond, that is, executes the file operation instruction 5.
For example, as shown in fig. 7 (2), before the electronic device invokes the file system service to respond to Req5, if it is detected that the total duration of the scheduling request in the response VIP queue has not reached the corresponding saturation time, the electronic device continues to respond to Req5 in the VIP queue, that is, execute the file operation instruction 5, until the scheduling request in the VIP queue is empty, or after the total duration of the scheduling request in the response normal queue reaches the corresponding saturation time, switch to the normal queue, and select Req2 and Req3 from the normal queue to respond, that is, execute the file operation instruction 2 and the file operation instruction 3.
As can be seen from analysis of fig. 7, after implementing the scheduling method of the embedded file system provided by the present application, in the case that multiple tasks initiate multiple scheduling requests, multiple queues with different priorities, such as a common queue (low priority) and a VIP queue (high priority), are set, where a queue with a high priority is used to accommodate a scheduling request that reaches starvation time (i.e., is about to reach service requirement duration), and a queue with a low priority is used to accommodate a scheduling request that has not reached starvation time (i.e., has not reached service requirement duration for long time), so as to ensure real-time requirements of the scheduling request, and preferentially respond to the scheduling request in the high priority queue. In addition, in order to ensure fairness of the overall scheduling request, a total time threshold for responding to the scheduling request in the high-priority queue is set, and the scheduling request in the low-priority queue is switched to be responded after the total time threshold is reached. In order to further meet the required time length of the service to which each scheduling request belongs, namely further meet the real-time requirement of each scheduling request, when the scheduling requests in each queue are responded, the requests are sequentially responded according to the order from high to low of the urgency (the priority of the task corresponding to the scheduling request is from high to low), and when the priorities are the same, the responses are performed according to the sequence of the arrival time of the scheduling requests. Therefore, the electronic device can consider the real-time requirement of each scheduling request (for example, req4 with higher priority response real-time requirement shown in fig. 7 (1) and (2)) in a very short time, and also ensure the fairness requirement of the overall scheduling request, so as to avoid starving the threads to be scheduled for a long time (for example, req2 and Req3 with lower priority response real-time requirement but longer waiting time are considered after Req4 with higher priority response real-time requirement shown in fig. 7 (2)).
It should be understood that each step in the above method embodiments provided by the present application may be implemented by an integrated logic circuit of hardware in a processor or an instruction in software form. The steps of the method disclosed in connection with the embodiments of the present application may be embodied directly in a hardware processor for execution, or in a combination of hardware and software modules in the processor for execution.
The present application also provides an electronic device, which may include: memory and a processor. Wherein the memory is operable to store a computer program; the processor may be operative to invoke a computer program in said memory to cause the electronic device to perform the method of any of the embodiments described above.
The application also provides a chip system comprising at least one processor for implementing the functions involved in the method performed by the electronic device in any of the above embodiments.
In one possible design, the system on a chip further includes a memory to hold program instructions and data, the memory being located either within the processor or external to the processor.
The chip system may be formed of a chip or may include a chip and other discrete devices.
Alternatively, the processor in the system-on-chip may be one or more. The processor may be implemented in hardware or in software. When implemented in hardware, the processor may be a logic circuit, an integrated circuit, or the like. When implemented in software, the processor may be a general purpose processor, implemented by reading software code stored in a memory.
Alternatively, the memory in the system-on-chip may be one or more. The memory may be integral with the processor or separate from the processor, and embodiments of the present application are not limited. The memory may be a non-transitory processor, such as a ROM, which may be integrated on the same chip as the processor, or may be separately provided on different chips, and the type of memory and the manner of providing the memory and the processor are not particularly limited in the embodiments of the present application.
Illustratively, the system-on-chip may be a field programmable gate array (field programmable gate array, FPGA), an application specific integrated chip (application specific integrated circuit, ASIC), a system on chip (SoC), a central processing unit (central processor unit, CPU), a network processor (network processor, NP), a digital signal processing circuit (digital signal processor, DSP), a microcontroller (micro controller unit, MCU), a programmable controller (programmable logic device, PLD) or other integrated chip.
The present application also provides a computer program product comprising: a computer program (which may also be referred to as code, or instructions), which when executed, causes a computer to perform the method performed by the electronic device in any of the embodiments described above.
The present application also provides a computer-readable storage medium storing a computer program (which may also be referred to as code, or instructions). The computer program, when executed, causes a computer to perform the method performed by the electronic device in any of the embodiments described above.
The embodiments of the present application may be arbitrarily combined to achieve different technical effects.
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, 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 a computer, the processes or functions in accordance with the present application are produced in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by a wired (e.g., coaxial cable, fiber optic, digital subscriber line), or wireless (e.g., infrared, wireless, microwave, etc.). 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, data center, etc. that contains an integration of one or more available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid State Disk), etc.
Those of ordinary skill in the art will appreciate that implementing all or part of the above-described method embodiments may be accomplished by a computer program to instruct related hardware, the program may be stored in a computer readable storage medium, and the program may include the above-described method embodiments when executed. And the aforementioned storage medium includes: ROM or random access memory RAM, magnetic or optical disk, etc.
In summary, the foregoing description is only exemplary embodiments of the present invention and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, improvement, etc. made according to the disclosure of the present invention should be included in the protection scope of the present invention.

Claims (23)

1. An embedded file system scheduling method, wherein the method is applied to an electronic device, the electronic device comprising an embedded file system, the method comprising:
the electronic equipment generates a plurality of scheduling requests from a plurality of tasks, one task corresponds to one or more scheduling requests, and the scheduling requests are used for scheduling the embedded file system to execute corresponding file operations;
And the electronic equipment sequentially responds to the plurality of scheduling requests according to the priority of the task to which the scheduling request belongs and the waiting time of the scheduling request.
2. The method of claim 1, wherein the electronic device sequentially responds to the plurality of scheduling requests, specifically comprising:
sequentially selecting scheduling requests from the plurality of scheduling requests to respond, and selecting one scheduling request at a time to respond;
wherein, the process of selecting one scheduling request at a time comprises the following steps:
when the second queue is empty or the duration of the continuous response of the scheduling requests in the second queue is greater than or equal to the full time, selecting one scheduling request of the task with the highest priority from the first queue to respond;
when the second queue is not empty or the continuous response time of the scheduling requests in the second queue is less than the full time, selecting one scheduling request of the task with the highest priority from the second queue for response;
the first queue includes: waiting for a scheduling request with a duration less than the starvation time; the second queue includes: scheduling requests that are not responded to and have a waiting period greater than or equal to starvation time; scheduling requests belonging to the same task correspond to the same starvation time.
3. The method of claim 2, wherein the step of determining the position of the substrate comprises,
the electronic equipment selects one scheduling request from the first queue as a scheduling request with earliest time from tasks with highest priority of the first queue;
and the electronic equipment selects one scheduling request from the second queue as a scheduling request with the earliest time from tasks with highest priority in the second queue.
4. A method according to any one of claims 1 to 3, wherein,
the priority of the task is preset by the electronic equipment;
alternatively, the priorities of the tasks are dynamically adjusted by the electronic device according to any one or more of the following: the number of times that the history of the task is not successfully executed, the time length used when the history of the task is successfully executed, the waiting time length of the scheduling request of the task in the first queue and the history generation frequency of the task.
5. The method according to any one of claims 1 to 4, wherein,
the starvation time of the scheduling request is preset by the electronic equipment;
or dynamically adjusted by the electronic device according to any one or more of: the number of times that the history of the task to which the scheduling request belongs is not successfully executed, the time length used when the history of the task to which the scheduling request belongs is successfully executed, the waiting time length of the scheduling request of the task to which the scheduling request belongs in the first queue, and the history generation frequency of the task to which the scheduling request belongs.
6. The method according to any one of claims 1 to 5, wherein,
the satiation time is preset by the electronic equipment; or dynamically adjusting by the electronic device according to the time length of the historical continuous response scheduling request in the second queue.
7. The method according to any one of claims 1 to 6, wherein,
the file operation executed by the embedded file system comprises any one or more of the following: create, open, read and write, close, delete, modify a file, or transfer a file storage location.
8. An electronic device, wherein the electronic device comprises a file system scheduling service and an embedded file system;
the file system scheduling service is used for receiving a plurality of scheduling requests from a plurality of tasks, and sequentially scheduling the embedded file system to respond to the plurality of scheduling requests according to the priority of the task to which the scheduling request belongs and the waiting time of the scheduling request; one of the tasks corresponds to one or more of the scheduling requests;
the embedded file system is used for responding to the scheduling request to execute corresponding file operation.
9. The electronic device of claim 8, wherein the file system scheduling service sequentially schedules the embedded file system in response to the plurality of scheduling requests, comprising:
The file system scheduling service sequentially selects scheduling requests from the plurality of scheduling requests to schedule the embedded file system for response, and selects one scheduling request at a time to schedule the embedded file system for response;
wherein, the process of selecting one scheduling request at a time comprises the following steps:
when the second queue is empty or the duration that the scheduling request in the second queue is continuously responded is greater than or equal to the full time, the file system scheduling service selects one scheduling request of the task with the highest priority from the first queue to schedule the embedded file system to respond;
when the second queue is not empty or the continuous response time of the scheduling requests in the second queue is less than the full time, selecting one scheduling request of the task with the highest priority from the second queue for response;
the first queue includes: waiting for a scheduling request with a duration less than the starvation time; the second queue includes: scheduling requests that are not responded to and have a waiting period greater than or equal to starvation time; scheduling requests belonging to the same task correspond to the same starvation time.
10. The electronic device of claim 9, wherein the electronic device comprises a memory device,
The file system scheduling service generates the scheduling request with the earliest time in the task with the highest priority in the first queue as one scheduling request selected from the first queue;
and the file system scheduling service generates the scheduling request with the earliest time from the task with the highest priority in the second queue as one scheduling request selected from the second queue.
11. The electronic device according to any one of the claims 8-10, characterized in that,
the priority of the task is preset by the electronic equipment;
alternatively, the priority of the tasks is dynamically adjusted by the file system scheduling service according to any one or more of the following: the number of times that the history of the task is not successfully executed, the time length used when the history of the task is successfully executed, the waiting time length of the scheduling request of the task in the first queue and the history generation frequency of the task.
12. The electronic device according to any one of the claims 8-11, characterized in that,
the starvation time of the scheduling request is preset by the electronic equipment;
alternatively, the scheduling service is dynamically adjusted by the file system according to any one or more of the following: the number of times that the history of the task to which the scheduling request belongs is not successfully executed, the time length used when the history of the task to which the scheduling request belongs is successfully executed, the waiting time length of the scheduling request of the task to which the scheduling request belongs in the first queue, and the history generation frequency of the task to which the scheduling request belongs.
13. The electronic device of any of claims 8-12, wherein the electronic device comprises a memory device,
the satiation time is preset by the electronic equipment; or, the file system scheduling service dynamically adjusts the time length of the scheduling request in the second queue according to the history continuous response.
14. The electronic device of any of claims 8-13, wherein the electronic device comprises a memory device,
the file operation executed by the embedded file system comprises any one or more of the following: create, open, read and write, close, delete, modify a file, or transfer a file storage location.
15. An electronic device comprising an embedded file system, a memory, one or more processors; the memory is coupled with the one or more processors, the memory is for storing computer program code, the computer program code comprising computer instructions that the one or more processors call 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 requests being used to schedule the embedded file system to perform corresponding file operations;
And sequentially responding to the plurality of scheduling requests according to the priority of the task to which the scheduling request belongs and the waiting time of the scheduling request.
16. The method of claim 15, wherein the one or more processors invoke the computer instructions to cause the electronic device to respond to the plurality of scheduling requests in sequence, specifically comprising:
sequentially selecting scheduling requests from the plurality of scheduling requests to respond, and selecting one scheduling request at a time to respond;
wherein, the process of selecting one scheduling request at a time comprises the following steps:
when the second queue is empty or the duration of the continuous response of the scheduling requests in the second queue is greater than or equal to the full time, selecting one scheduling request of the task with the highest priority from the first queue to respond;
when the second queue is not empty or the continuous response time of the scheduling requests in the second queue is less than the full time, selecting one scheduling request of the task with the highest priority from the second queue for response;
the first queue includes: waiting for a scheduling request with a duration less than the starvation time; the second queue includes: scheduling requests that are not responded to and have a waiting period greater than or equal to starvation time; scheduling requests belonging to the same task correspond to the same starvation time.
17. The method of claim 16, wherein the step of determining the position of the probe comprises,
the one or more processors call the computer instructions to enable the electronic equipment to select one scheduling request from the first queue as a scheduling request with the earliest time from tasks with highest priority in the first queue;
and the one or more processors call the computer instructions to enable the electronic equipment to select one scheduling request from the second queue as a scheduling request with the earliest time from tasks with the highest priority in the second queue.
18. The method according to any one of claims 15-17, wherein,
the priority of the task is preset by the electronic equipment;
alternatively, the priorities of the tasks are dynamically adjusted by the electronic device according to any one or more of the following: the number of times that the history of the task is not successfully executed, the time length used when the history of the task is successfully executed, the waiting time length of the scheduling request of the task in the first queue and the history generation frequency of the task.
19. The method according to any one of claims 15-18, wherein,
The starvation time of the scheduling request is preset by the electronic equipment;
or dynamically adjusted by the electronic device according to any one or more of: the number of times that the history of the task to which the scheduling request belongs is not successfully executed, the time length used when the history of the task to which the scheduling request belongs is successfully executed, the waiting time length of the scheduling request of the task to which the scheduling request belongs in the first queue, and the history generation frequency of the task to which the scheduling request belongs.
20. The method according to any one of claims 15-19, wherein,
the satiation time is preset by the electronic equipment; or dynamically adjusting by the electronic device according to the time length of the historical continuous response scheduling request in the second queue.
21. The method according to any one of claims 15-20, wherein,
the file operation executed by the embedded file system comprises any one or more of the following: create, open, read and write, close, delete, modify a file, or transfer a file storage location.
22. A chip for application to an electronic device, wherein the chip comprises one or more processors for invoking computer instructions to cause the electronic device to perform the method of any of claims 1-7.
23. A computer readable storage medium comprising instructions which, when run on an electronic device, cause the electronic device to perform the method of any of claims 1-7.
CN202211110805.2A 2022-09-13 2022-09-13 Scheduling method, equipment and storage medium of embedded file system Pending CN116700913A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211110805.2A CN116700913A (en) 2022-09-13 2022-09-13 Scheduling method, equipment and storage medium of embedded file system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211110805.2A CN116700913A (en) 2022-09-13 2022-09-13 Scheduling method, equipment and storage medium of embedded file system

Publications (1)

Publication Number Publication Date
CN116700913A true CN116700913A (en) 2023-09-05

Family

ID=87843954

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211110805.2A Pending CN116700913A (en) 2022-09-13 2022-09-13 Scheduling method, equipment and storage medium of embedded file system

Country Status (1)

Country Link
CN (1) CN116700913A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
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)

* Cited by examiner, † Cited by third party
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 中国移动通信有限公司研究院 Resource scheduling method and device and electronic equipment
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

Patent Citations (15)

* Cited by examiner, † Cited by third party
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 中国移动通信有限公司研究院 Resource scheduling method and device and electronic equipment
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)

* Cited by examiner, † Cited by third party
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)

* Cited by examiner, † Cited by third party
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

Similar Documents

Publication Publication Date Title
CN112527476B (en) Resource scheduling method and electronic equipment
CN113553130B (en) Method for executing drawing operation by application and electronic equipment
WO2021115112A1 (en) Installation package downloading method, installation package distribution method, terminal device, server, and system
WO2021052204A1 (en) Address book-based device discovery method, audio and video communication method, and electronic device
CN112181616B (en) Task processing method and related device
CN110636554B (en) Data transmission method and device
WO2022078105A1 (en) Memory management method, electronic device, and computer-readable storage medium
CN110413383B (en) Event processing method, device, terminal and storage medium
CN116700913A (en) Scheduling method, equipment and storage medium of embedded file system
CN111104209B (en) Task processing method and related equipment
CN115729684B (en) Input/output request processing method and electronic equipment
CN117130773A (en) Resource allocation method, device and equipment
CN114489471B (en) Input and output processing method and electronic equipment
WO2022100141A1 (en) Plug-in management method, system and apparatus
CN113590346B (en) Method and electronic equipment for processing service request
CN112783418B (en) Method for storing application program data and mobile terminal
CN114911400A (en) Method for sharing pictures and electronic equipment
CN112286596A (en) Message display method and electronic equipment
WO2024007970A1 (en) Thread scheduling method and electronic device
WO2024078315A1 (en) Application control method, electronic device and system
WO2024032430A1 (en) Memory management method and electronic device
WO2023051056A1 (en) Memory management method, electronic device, computer storage medium, and program product
WO2024045841A1 (en) Storage method and apparatus, and electronic device
CN117724860A (en) Data processing method and electronic equipment
CN117707720A (en) Process scheduling method and device and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination