CN109976885B - Event processing method and device based on multitask operating system and storage medium - Google Patents

Event processing method and device based on multitask operating system and storage medium Download PDF

Info

Publication number
CN109976885B
CN109976885B CN201711464111.8A CN201711464111A CN109976885B CN 109976885 B CN109976885 B CN 109976885B CN 201711464111 A CN201711464111 A CN 201711464111A CN 109976885 B CN109976885 B CN 109976885B
Authority
CN
China
Prior art keywords
event
processed
category
events
current
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.)
Active
Application number
CN201711464111.8A
Other languages
Chinese (zh)
Other versions
CN109976885A (en
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.)
China Mobile Communications Group Co Ltd
China Mobile IoT Co Ltd
Original Assignee
China Mobile Communications Group Co Ltd
China Mobile IoT 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 China Mobile Communications Group Co Ltd, China Mobile IoT Co Ltd filed Critical China Mobile Communications Group Co Ltd
Priority to CN201711464111.8A priority Critical patent/CN109976885B/en
Publication of CN109976885A publication Critical patent/CN109976885A/en
Application granted granted Critical
Publication of CN109976885B publication Critical patent/CN109976885B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/48Indexing scheme relating to G06F9/48
    • G06F2209/484Precedence

Abstract

The embodiment of the invention provides an event processing method based on a multitask operating system, which comprises the following steps: when the set clock period comes, determining a current response event according to the current priority of each category of events to be processed in the event array; and executing a corresponding program according to the current response event, and processing the current response event. The embodiment of the invention also provides an event processing device and a storage medium based on the multitask operating system.

Description

Event processing method and device based on multitask operating system and storage medium
Technical Field
The invention relates to the technical field of Internet of things, in particular to an event processing method and device based on a multitask operating system and a storage medium.
Background
The internet of things is a wide area network market generally concerned by the industry, and the core of the internet of things is various intelligent devices. To enable the intelligent devices to be networked, an internet of things operating system is required, so all the internet of things devices are target users of the internet of things operating system. Meanwhile, most of internet of things equipment is required to have the characteristics of small volume, low power consumption, high integration level and the like, so that an operating system running on the equipment is determined to be capable of running on extremely limited resources, and a multitask operating system such as a Contiki operating system has the characteristics and is widely applied to various types of internet of things equipment at present.
At present, in a multitask operating system, events sent by all threads are placed by using a static array, the number of bits of the static array is a fixed value, and each bit can correspondingly store one event, so that the number of the maximum events that can be accommodated is a fixed value, and then after each clock cycle arrives, corresponding events are taken out from the static array accommodating the events to be respectively processed, and the response to each event is completed.
The event occurrence time of each thread is not fixed, if a plurality of events generated by a plurality of threads at the same time point exceed the maximum length contained by the array, the generated events are discarded, so that the events are lost, and in an extreme case, if the events are extremely important events, the lost events cannot be normally processed, so that the application threads fail to operate, or the control fails.
Disclosure of Invention
In order to solve the existing technical problem, embodiments of the present invention provide an event processing method and apparatus based on a multitasking operating system, and a storage medium, which can avoid event loss.
In order to achieve the purpose, the technical scheme of the invention is realized as follows:
the embodiment of the invention provides an event processing method based on a multitask operating system, which comprises the following steps: when the set clock period comes, determining a current response event according to the current priority of each category of events to be processed in the event array; and executing a corresponding program according to the current response event, and processing the current response event.
When the set clock cycle comes, determining the time before the current response event according to the priority of each category of events to be processed in the event array, further comprising: detecting the occurrence condition of event dynamics; when an event dynamic state occurs, determining the events to be processed of the corresponding category in the event array according to the type of the event dynamic state and the category attribute of the corresponding event, and updating the current priority of the events to be processed of the category.
When an event dynamic state occurs, determining the to-be-processed event of the corresponding category in the event array according to the type of the event dynamic state and the category attribute of the corresponding event, and updating the current priority of the to-be-processed event of the category, including: when an event occurs, determining the event to be processed of the corresponding category in the event array according to the category attribute of the event, and updating the counting attribute value of the event to be processed of the corresponding category, wherein the counting attribute value comprises a counter; and updating the current priority of the events to be processed of the corresponding category according to the counting attribute value of the events to be processed of the corresponding category.
Wherein the counter includes an event counter and an event fusion counter, and the updating the count attribute value of the to-be-processed event of the corresponding category includes: adding 1 to the value of the event counter; when the value of the event counter exceeds a set first threshold value, adding 1 to the value of the event fusion counter, and clearing the value of the event counter; the updating the current priority of the to-be-processed event of the corresponding category according to the count attribute value of the to-be-processed event of the corresponding category includes: and when the value of the event fusion counter exceeds a set second threshold value, updating the current priority of the events to be processed of the corresponding category.
When an event dynamic state occurs, determining the to-be-processed event of the corresponding category in the event array according to the type of the event dynamic state and the category attribute of the corresponding event, and updating the current priority of the to-be-processed event of the category, including: when a set clock period comes, determining a non-current response event corresponding to each type of events to be processed in an event array, and respectively updating a waiting attribute value corresponding to each type of non-current response events; and updating the current priority of the non-current response events of each category according to the waiting attribute value of the non-current response event of each category.
When an event dynamic state occurs, determining the to-be-processed event of the corresponding category in the event array according to the type of the event dynamic state and the category attribute of the corresponding event, and updating the current priority of the to-be-processed event of the category, including: when an event is processed, determining the event to be processed of the corresponding category in the event array according to the category attribute corresponding to the event, and updating the processing attribute value of the event to be processed of the corresponding category; and updating the current priority of the events to be processed of the corresponding category according to the processing attribute value of the events to be processed of the corresponding category.
Wherein, the determining the current response event according to the current priority of each category of events to be processed in the event array comprises: determining the type of the event to be processed with the highest current priority as the current response event according to the current priority of each type of the event to be processed in the event array; and/or sorting the to-be-processed events of a plurality of categories with relatively high current priority according to the current priority of the to-be-processed events of each category in the event array, and determining the to-be-processed events of the plurality of categories as current response events.
Wherein, the determining the current response event according to the current priority of each category of events to be processed in the event array comprises: the method comprises the steps of obtaining the current priority of each category of events to be processed in an event array, obtaining the service weight of at least two categories of events when the current priority of at least two categories of events to be processed in the event array is the same, and determining the current response event according to the service weight.
The embodiment of the invention provides an event processing device based on a multitask operating system, which comprises: a determining module and a processing module; the determining module is used for determining a current response event according to the current priority of each category of events to be processed in the event array when the set clock period comes; and the processing module is used for executing a corresponding program according to the current response event and processing the current response event.
The embodiment of the invention provides an event processing device based on a multitask operating system, which comprises: a processor and a memory for storing a computer program capable of running on the processor; when the processor is used for running the computer program, the event processing method based on the multitask operating system according to any embodiment of the invention is realized.
The embodiment of the invention provides a computer storage medium, wherein a computer program is stored in the computer storage medium, and when being executed by a processor, the computer program realizes the event processing method based on the multitask operating system in any embodiment of the invention.
According to the event processing method, device and storage medium based on the multitask operating system, when a set clock period comes, a current response event is determined according to the current priority of each type of event to be processed in an event array; executing a corresponding program according to the current response event, and processing the current response event, wherein the events to be processed in the event array are stored in different categories, so that more events can be stored in a limited static array, the same category of events are prevented from being lost, the priority of the events to be processed in each category of the event array is set, the events to be processed in the same category have the same priority, and the current response event is determined according to the current priority of the events to be processed in each category, so that the emergency event can be processed quickly.
Drawings
Fig. 1 is a schematic flowchart of an event processing method based on a multitasking operating system according to an embodiment of the present invention;
FIG. 2 is a schematic structural diagram of an event processing apparatus based on a multitasking operating system according to an embodiment of the present invention;
FIG. 3 is a flowchart illustrating an event processing method based on a multitasking operating system according to another embodiment of the present invention;
FIG. 4 is a flow chart illustrating updating the current priority of pending events according to an embodiment of the present invention;
FIG. 5 is a flow chart illustrating updating the current priority of pending events according to another embodiment of the present invention;
FIG. 6 is a flow chart illustrating updating the current priority of pending events according to another embodiment of the present invention;
fig. 7 is a schematic structural diagram of an event processing apparatus based on a multitasking operating system according to another embodiment of the present invention.
Detailed Description
The technical scheme of the invention is further elaborated by combining the drawings and the specific embodiments in the specification. Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. The terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used herein, the term "and/or" includes any and all combinations of one or more of the associated listed items.
As shown in fig. 1, an embodiment of the present invention provides an event processing method based on a multitasking operating system, including the following steps:
step 101: when the set clock period comes, determining a current response event according to the current priority of each category of events to be processed in the event array;
here, when each clock cycle comes, the multitask operating system determines the corresponding event to be processed from the event array as the current response event to be processed. Specifically, a clock cycle is set in the multitask operating system, and when the set clock cycle arrives, the multitask operating system may determine the category to-be-processed event with the highest priority among the categories to-be-processed events in the event array, and determine that the category to-be-processed event is the current response event.
In practical applications, the clock period may be set according to the processing capability or the running environment of the multitasking operating system, for example, the clock period may be set to 1 ms. When a clock period comes, the multitask operating system determines that the event to be processed of the category with the highest priority in the current priorities in the event array is the current response event; when the next period comes, the multitask operating system judges the event to be processed of the category with the highest priority among the current priorities in the event array as the current response event again.
Here, each category in the event array refers to that the events to be processed of the same category are classified according to the category attribute of the events to be processed, and then the events to be processed of the same category are stored in the same position in the event array. The event array refers to events sent by all threads in the multitask operating system, and the number of bits in the event array is a fixed value. The multi-task operating system classifies the events according to the category attributes of the events to be processed in the event array, and the events belonging to the same category are placed at the same position in the event array; by classifying the events and placing the events of the same category in an array, the same or similar events only need to occupy one position in the event array when a plurality of events are generated by a plurality of threads in one clock cycle, so that the maximum number contained in the event array cannot be exceeded when the events are stored, and the same or similar events cannot be lost. It is understood that the events to be processed in the same category may refer to events with the same category attribute, that is, the same event; it can also refer to similar events whose category attribute meets the set association requirement, i.e. homogeneous events.
Here, when the multitask operating system classifies the events in the event array, when the clock cycle arrives, the current response event is determined according to the highest priority of the current events to be processed in each category.
Step 102: and executing a corresponding program according to the current response event, and processing the current response event.
Specifically, the multitask operating system searches according to the preset corresponding relationship between each category event and the program, determines the current response event and the corresponding execution program, and processes the current response event.
Here, when determining the current response event according to the current priority of each category of events to be processed in the event array, it is described that when one cycle arrives, the multitask operating system has already determined the highest priority response event in the current cycle and processes the highest priority response event according to the corresponding program.
In the above embodiment of the present invention, when the set clock cycle arrives, the multitasking operating system determines the current response event according to the current priority of each category of events to be processed in the event array; and executing a corresponding program according to the current response event, and processing the current response event. Therefore, the current priority order of each category of events to be processed in the event array is determined, and the emergency can be processed quickly. Compared with the method in the prior art that when each clock cycle arrives, all events which arrive in sequence according to the time sequence are taken out from the event array for accommodating the events and are respectively processed, and the response to each event is completed, in the implementation method, the events in the event array are classified, the priority is preset for all classified events, and when the set clock cycle arrives, the event with higher current priority in the current events to be processed can be preferentially processed; secondly, the events to be processed in the same category only occupy one position in the event array, so that the capacity of the events to be processed in the event array is greatly improved, and the events are prevented from being lost.
In another specific embodiment, when the set clock cycle comes, the method may further include determining, according to the priority of each category of events to be processed in the event array, that is before the current response event, where:
detecting the occurrence condition of event dynamics;
when an event dynamic state occurs, determining the events to be processed of the corresponding category in the event array according to the type of the event dynamic state and the category attribute of the corresponding event, and updating the current priority of the events to be processed of the category.
Here, event dynamics refers to a change in event state, such as event occurrence, event processing, event non-processing (event delay), and the like. Specifically, the multitask operating system may correspondingly update the current priority of the event to be processed in the event array corresponding to the event whose event state change has been updated according to the event state change conditions such as event occurrence, event processing, event delay, and the like when the previous clock cycle ends and the next clock cycle arrives, so that the current priority of the event to be processed in each category in the event array is updated in real time according to the change of the event state, and it is ensured that the current priority of the event to be processed in each category can accurately reflect the emergency degree of the event to be processed in each category when each time cycle arrives. In one embodiment, the multitasking operating system detecting the occurrence of event dynamics comprises: when the multi-task operating system is from the end of the last clock cycle to the arrival of the next clock cycle, detecting according to the received event occurrence, event processing or event delay conditions, when the event is dynamic, determining the event to be processed of the corresponding category in the event array according to the type of the event dynamic and the category attribute of the corresponding event, and updating the current priority of the event to be processed of the category of the event dynamic according to the corresponding priority rule preset by the multi-task operating system.
Here, the current priority of the pending event for updating the category of the occurrence event dynamics may be the current priority of the pending event plus n or minus n, where n is 1,2 …; the adjustment can be specifically performed according to a rule preset by the multitask operating system.
Therefore, the priorities are set for the events to be processed in different categories, and the corresponding current priorities are updated in real time according to the event dynamic occurrence conditions of the events to be processed in the same category, so that the emergency can be rapidly processed.
In a specific embodiment, when an event dynamic state occurs, determining a to-be-processed event of a corresponding category in the event array according to the type of the event dynamic state and the category attribute of the corresponding event, and updating the current priority of the to-be-processed event of the category includes:
when an event occurs, determining the event to be processed of the corresponding category in the event array according to the category attribute of the event, and updating the counting attribute value of the event to be processed of the corresponding category, wherein the counting attribute value comprises a counter;
and updating the current priority of the events to be processed of the corresponding category according to the counting attribute value of the events to be processed of the corresponding category.
Here, the attributes of the events include a count attribute, and the count attribute value refers to the number of events to be processed in the same category in the event array. Here, the counting of the count attribute value may be realized by a counter. In one embodiment, when an event occurs, the multitask operating system determines the events to be processed in the same category corresponding to the event in the event array according to the category attribute of the event, and adds 1 to the counter value of the corresponding events to be processed in the same category.
Here, the multitasking operating system may preset a correspondence between a count attribute value of each category of the to-be-processed event and a current priority of the event. If so, updating the current priority of the corresponding to-be-processed event of the same category when the counting attribute value of the to-be-processed event reaches a preset threshold value, and if so, adding 1 to the value of the current priority of the to-be-processed event of the category.
Therefore, when the number of events in a certain category is excessive and the events are not processed, through the setting of the counting attribute value, when the counting attribute value reaches a preset threshold value, the current priority of the events to be processed corresponding to the category is increased, so that the current priority of the events to be processed can accurately reflect the emergency degree of the events, and when the current priority of the events to be processed meets the condition of determining the current response event when each clock cycle arrives, the events in the same category can be processed in time, so that excessive accumulation of the events in the same category is avoided and the events are not processed. Meanwhile, the events of the same category only occupy one spatial position in the event array at the same time, so that various types of events can exist in the limited static variable range of the event array, and the same event is prevented from being lost.
In another specific embodiment, the counter includes an event counter and an event fusion counter, and the updating the count attribute value of the to-be-processed event of the corresponding category includes:
adding 1 to the value of the event counter;
when the value of the event counter exceeds a set first threshold value, adding 1 to the value of the event fusion counter, and clearing the value of the event counter;
the updating the current priority of the to-be-processed event of the corresponding category according to the count attribute value of the to-be-processed event of the corresponding category includes:
and when the value of the event fusion counter exceeds a set second threshold value, updating the current priority of the events to be processed of the corresponding category.
In this way, by setting the event counter and the fusion counter, the event counter performs cumulative counting with each occurrence of an event, the fusion counter performs cumulative counting when the count of the event counter reaches a set value, the fusion counter can be used as a carry of the event counter, and the maximum value of counting events of the same category can be increased by the fusion counter, for example, the maximum value of counting events of the same category by the event counter is 9, and the maximum value of counting events of the same category by the event counter and the fusion counter is 99. Therefore, for events which are frequently generated in the system and have low importance, the events can be processed after the counting attributes of the events are accumulated to a certain degree, so that the problem that the importance of some events is not high but the events are frequently generated is effectively avoided, and the whole system is busy with processing the events when each clock cycle arrives, which easily causes the hysteresis processing of some important events.
In another specific embodiment, when an event dynamic state occurs, determining a to-be-processed event of a corresponding category in the event array according to the type of the event dynamic state and the category attribute of the corresponding event, and updating the current priority of the to-be-processed event of the category includes:
when a set clock period comes, determining a non-current response event corresponding to each type of events to be processed in an event array, and respectively updating a waiting attribute value corresponding to each type of non-current response events;
and updating the current priority of the non-current response events of each category according to the waiting attribute value of the non-current response event of each category.
Here, the attribute of the event includes a wait attribute, and the wait attribute value is an attribute value that reflects a state in which the event to be processed of the same category in the event array is delayed. When the set clock cycle comes, determining other events except the current response event in the various categories of events to be processed in the event array as non-current response events, and delaying processing of the non-current response events in the current clock cycle when the current priority does not meet the condition of the current response event, which is called event delay in the embodiment of the invention. It can be understood that the occurrence of an event delay corresponds to one clock cycle, and when each clock cycle arrives, the waiting attribute values of the pending events of each category that are not processed in the current cycle may be updated, the waiting attribute values corresponding to the non-current response events of each category may be determined, and the waiting attribute values corresponding to the non-current response events may be updated. Here, counting of the waiting attribute value may be realized by a counter.
Here, the multitasking operating system may preset a correspondence between a waiting attribute value of each class of the non-current response event and a current priority of the event. And when the waiting attribute value of the non-current response event reaches a preset threshold value, updating the current priority of the non-current response event of the corresponding category. Here, it may be that 1 is added to the value of the current priority of the pending event of the category corresponding to the non-current response event.
Therefore, by setting the waiting attribute value, when the event to be processed of a certain category arrives at a plurality of clock cycles and is not processed all the time, the waiting attribute value can be continuously increased, when the waiting attribute value reaches the set condition, the current priority of the event to be processed of the category is improved, so that the current priority of the event to be processed can accurately reflect the emergency degree of the event, when the current priority of the event to be processed accords with the condition of determining the current response event when each clock cycle arrives, the event can be processed in time, the emergency degree of the event to be processed of each category in the event array can be dynamically updated in real time, and the multi-task operating system can be processed in time according to the actual emergency degree.
In another specific embodiment, when an event dynamic state occurs, determining a to-be-processed event of a corresponding category in the event array according to the type of the event dynamic state and the category attribute of the corresponding event, and updating the current priority of the to-be-processed event of the category includes:
when an event is processed, determining the event to be processed of the corresponding category in the event array according to the category attribute corresponding to the event, and updating the processing attribute value of the event to be processed of the corresponding category;
and updating the current priority of the events to be processed of the corresponding category according to the processing attribute value of the events to be processed of the corresponding category.
Here, the attribute of the event includes a process attribute, and the process attribute value refers to an attribute value reflecting a state of whether or not the event to be processed of the same category in the event array is processed. When a set clock cycle comes, determining that the current priority of each category of events to be processed in the event array meets the condition as a current response event, wherein the response event is processed in the current clock cycle, which is referred to as event processing in the embodiment of the invention. It can be understood that the processing of an event corresponds to a clock cycle, when each clock cycle comes, the processing attribute value of the to-be-processed event of the processed category in the current cycle can be updated, when the event is processed, the to-be-processed event corresponding to the corresponding category in the event array is determined according to the category attribute corresponding to the processing event, and the processing attribute values of the to-be-processed events of the corresponding category are respectively updated. Here, the counting of the process attribute value may be realized by a counter.
Here, the multitasking operating system may previously set a correspondence relationship between a processing attribute value and a current priority of an event. When the event is processed and the processing attribute value of the category corresponding to the processed event reaches a preset threshold value, updating the current priority of the current response event of the category corresponding to the processed event. Here, the current priority of the pending event of the category corresponding to the processed event may be subtracted by 1.
Therefore, by setting the processing attribute value, when a clock cycle arrives, the processing attribute value can be increased after a certain category of events to be processed is processed, and when the processing attribute value reaches a set condition, the current priority of the category of events to be processed is reduced, so that the current priority of the events to be processed can accurately reflect the emergency degree of the events, the emergency degree of the events to be processed in each category of event array can be dynamically updated in real time, and the multi-task operating system can be timely processed according to the actual emergency degree.
In another specific embodiment, the determining a current response event according to the current priority of each category of events to be processed in the event array includes:
determining the type of the event to be processed with the highest current priority as the current response event according to the current priority of each type of the event to be processed in the event array; and/or the presence of a gas in the gas,
according to the current priority of each category of events to be processed in the event array, sorting the events to be processed of a plurality of categories with relatively high current priority, and determining the events to be processed of the plurality of categories as current response events.
The primary ways in which the multitasking operating system determines the current response event include: firstly, events to be processed of the same category with the highest current priority in an event array are processed; secondly, the events to be processed with a plurality of categories with the current priority ranked in the top are processed in the event array. The two modes can be set according to actual conditions, for example, the multitask operating system can set to process a category of events to be processed and/or process a plurality of categories of events to be processed, which are set according to the conditions of the corresponding categories of events to be processed. The two manners may also be determined by the multitasking operating system according to the length of the clock cycle and the determined number of the current response events, for example, the clock cycle is 1ms, and when the number of the events to be processed of the same category with the highest current priority does not satisfy the set number, the number of the events to be processed of the same category with the next highest current priority may be further determined according to the current priority ranking, and the number of the events to be processed of the same category with the next highest current priority may be sequentially determined until the number of the events to be processed determined as the current response events satisfies the set number.
In another specific embodiment, the determining a current response event according to the current priority of each category of events to be processed in the event array includes:
the method comprises the steps of obtaining the current priority of each category of events to be processed in an event array, obtaining the service weight of at least two categories of events when the current priority of at least two categories of events to be processed in the event array is the same, and determining the current response event according to the service weight.
Here, the attributes of the event further include a service weight for characterizing a second priority of each category of event in the event array. And when the current priorities of at least two types of events in the types of events to be processed in the event array are the same, determining the current response event according to the preset service weight, namely the second-layer priority relationship, and the preset second-layer priority relationship of the types of events with the same current priorities.
Therefore, through the preset service weight, the current response event is determined when the current priorities of at least two types of events in the types of events to be processed are the same. The method and the device ensure that the multitask operating system can process the current events to be processed with higher emergency degree at any time.
Referring to fig. 2, an embodiment of the present invention further provides an event processing apparatus based on a multitasking operating system, including: a determination module 10 and a processing module 11; wherein the content of the first and second substances,
the determining module 10 is configured to determine a current response event according to a current priority of each category of to-be-processed events in the event array when the set clock cycle arrives;
the processing module 11 is configured to execute a corresponding program according to the current response event, and process the current response event.
In the above embodiment of the present invention, when the set clock cycle arrives, the determining module 10 determines the current response event according to the current priority of each category of events to be processed in the event array; and the processing module executes a corresponding program according to the current response event and processes the current response event. Therefore, the priority order of the events to be processed in each category in the event array is determined, and the emergency can be processed quickly. Compared with the method in the prior art that when each clock cycle arrives, all events which arrive in sequence according to the time sequence are taken out from the event array for accommodating the events and are respectively processed, and the response to each event is completed, in the implementation method, the events in the event array are classified, the priority is preset for all classified events, and when the set clock cycle arrives, the event with higher current priority in the current events to be processed can be preferentially processed; secondly, the events to be processed in the same category only occupy one position in the event array, so that the capacity of the events to be processed in the event array is greatly improved, and the events are prevented from being lost.
In another embodiment, the apparatus may further comprise: a detection module 12 and an update module 13; wherein the content of the first and second substances,
the detection module 12 is configured to detect occurrence of event dynamics;
the updating module 13 is configured to, when an event dynamic state occurs, determine a to-be-processed event of a corresponding category in the event array according to the type of the event dynamic state and the category attribute of the corresponding event, and update the current priority of the to-be-processed event of the category.
Therefore, the priorities are set for the events of different types, and the corresponding current priorities are updated in real time according to the event dynamic occurrence conditions of the events of the same type, so that the emergency can be rapidly processed.
In another specific embodiment, the updating module 13 is further configured to:
when an event occurs, determining the event to be processed of the corresponding category in the event array according to the category attribute of the event, and updating the counting attribute value of the event to be processed of the corresponding category, wherein the counting attribute value comprises a counter;
and updating the current priority of the events to be processed of the corresponding category according to the counting attribute value of the events to be processed of the corresponding category.
Therefore, when the number of events in a certain category is excessive and the events are not processed, through the setting of the counting attribute value, when the counting attribute value reaches a preset threshold value, the current priority of the events to be processed corresponding to the category is increased, so that the current priority of the events to be processed can accurately reflect the emergency degree of the events, and when the current priority of the events to be processed meets the condition of determining the current response event when each clock cycle arrives, the events in the same category can be processed in time, so that excessive accumulation of the events in the same category is avoided and the events are not processed. Meanwhile, the events of the same category only occupy one spatial position in the event array at the same time, so that various types of events can exist in the limited static variable range of the event array, and the same event is prevented from being lost.
In a specific embodiment, the counter includes an event counter and an event fusion counter, and the updating the count attribute value of the to-be-processed event of the corresponding category includes:
adding 1 to the value of the event counter;
when the value of the event counter exceeds a set first threshold value, adding 1 to the value of the event fusion counter, and clearing the value of the event counter;
the updating the current priority of the to-be-processed event of the corresponding category according to the counting attribute value of the to-be-processed event of the corresponding category includes:
and when the value of the event fusion counter exceeds a set second threshold value, updating the current priority of the events to be processed of the corresponding category.
Therefore, for events which are frequently generated in the system and have low importance, the events can be processed after the counting attributes of the events are accumulated to a certain degree, so that the problem that the importance of some events is not high but the events are frequently generated is effectively avoided, and the whole system is busy with processing the events when each clock cycle arrives, which easily causes the hysteresis processing of some important events.
In another specific embodiment, the updating module 13 is further configured to:
when a set clock period comes, determining a non-current response event corresponding to each type of events to be processed in an event array, and respectively updating a waiting attribute value corresponding to each type of non-current response events;
and updating the current priority of the non-current response events of each category according to the waiting attribute value of the non-current response event of each category.
Therefore, by setting the waiting attribute value, when the event to be processed of a certain category arrives at a plurality of clock cycles and is not processed all the time, the waiting attribute value can be continuously increased, when the waiting attribute value reaches the set condition, the current priority of the event to be processed of the category is improved, so that the current priority of the event to be processed can accurately reflect the emergency degree of the event, when the current priority of the event to be processed accords with the condition of determining the current response event when each clock cycle arrives, the event can be processed in time, the emergency degree of the event to be processed of each category in the event array can be dynamically updated in real time, and the multi-task operating system can be processed in time according to the actual emergency degree.
In another specific embodiment, the updating module 13 is further configured to:
when an event is processed, determining the event to be processed of the corresponding category in the event array according to the category attribute corresponding to the event, and updating the processing attribute value of the event to be processed of the corresponding category;
and updating the current priority of the events to be processed of the corresponding category according to the processing attribute value of the events to be processed of the corresponding category.
Therefore, by setting the processing attribute value, when a clock cycle arrives, the processing attribute value can be increased after a certain category of events to be processed is processed, and when the processing attribute value reaches a set condition, the current priority of the category of events to be processed is reduced, so that the current priority of the events to be processed can accurately reflect the emergency degree of the events, the emergency degree of the events to be processed in each category of event array can be dynamically updated in real time, and the multi-task operating system can be timely processed according to the actual emergency degree.
In another specific embodiment, the determining module 10 is further configured to:
determining the type of the event to be processed with the highest current priority as the current response event according to the current priority of each type of the event to be processed in the event array; and/or the presence of a gas in the gas,
according to the current priority of each category of events to be processed in the event array, sorting the events to be processed of a plurality of categories with relatively high current priority, and determining the events to be processed of the plurality of categories as current response events.
In another specific embodiment, the determining module 10 is further configured to:
the method comprises the steps of obtaining the current priority of each category of events to be processed in an event array, obtaining the service weight of at least two categories of events when the current priority of at least two categories of events to be processed in the event array is the same, and determining the current response event according to the service weight.
Therefore, through the preset service weight, the current response event is determined when the current priorities of at least two types of events in the types of events to be processed are the same. The method and the device ensure that the multitask operating system can process the current events to be processed with higher emergency degree at any time.
Referring to fig. 3, the following describes in further detail the event processing method based on the multitask operating system according to the embodiment by using a specific example, where the multitask operating system specifically uses a Contiki operating system as an example, tasks processed by the Contiki operating system are represented as threads or processes, and in the processing, the tasks are represented as processing a series of events, and one task needs to be composed of multiple events to complete one task. The Contiki operating system uses an event array to place events sent by all threads, wherein the event array is a static array, and the bit number of the event array is a fixed value. The event processing method based on the multitask operating system comprises the following steps of:
step S21: initializing the priority of each category of events in the event array as an initial priority;
step S22: detecting the occurrence condition of event dynamics;
step S23: when an event dynamic state occurs, determining the events to be processed of the corresponding category in the event array according to the type of the event dynamic state and the category attribute of the corresponding event, and updating the current priority of the events to be processed of the category;
step S24: when the set clock period comes, determining a current response event according to the current priority of each category of events to be processed in the event array;
here, when the current priorities of at least two category events in the to-be-processed events of each category in the event array are the same, each category event with the same current priority determines a current response event according to a preset service weight relationship. Events with high service weight values are processed first, and then events with low service weight values are processed.
Step S25: and executing a corresponding program according to the current response event, and processing the current response event.
Therefore, the problem of event loss caused by the fact that a plurality of events are generated at the same time point in the Contiki operating system can be solved, all the events can be guaranteed to be processed, and the congestion problem of the emergency event is solved; meanwhile, the current priority order of each category of events to be processed in the event array is determined, so that the emergency can be processed quickly; the events to be processed in the same category only occupy one position in the event array, so that the capacity of the events to be processed in the event array is greatly improved, and the loss of the events is avoided; the method effectively avoids the problem that some events are not high in importance but frequently generated, and the whole system is busy with processing the events when each clock cycle arrives, which easily causes the hysteresis processing of some important events.
In step S23, the method for updating the current priority of the pending time mainly includes the following three cases.
First, referring to fig. 4, when the occurrence dynamics is event occurrence, the determining, according to the type of the event dynamics and the category attribute of the corresponding event, a to-be-processed event of a corresponding category in the event array, and updating the current priority of the to-be-processed event of the category specifically includes:
step S31: an event occurs; the multitasking operating system detects whether an event occurs.
Step S32: judging the events to be processed of the system type corresponding to the events; when an event occurs, the multitask operating system determines the category of the event to be processed corresponding to the event in the event array according to the category attribute of the event.
Step S33: adding 1 to the value of the event counter; the multitask operating system updates an event count attribute in attributes of the events to be processed of the corresponding category in the event array, and specifically, adds 1 to the value of the event counter.
Here, when an event occurs, the Contiki operating system determines the event to be processed of the same category corresponding to the event in the event array according to the category attribute of the event that occurs, and adds 1 to the value of the counter of the event to be processed of the corresponding same category.
Step S34: exceeding a first threshold set by an event counter;
step S35: adding 1 to the value of the event fusion counter; here, the event count attribute among the attributes of the event to be processed further includes an event fusion counter to which a carry is carried when a value of the event counter exceeds a first threshold value. Specifically, if the value of the event counter exceeds the preset threshold value of the event counter, the value of the event fusion counter is increased by 1, the value of the event counter is cleared, and a new round of counting is started;
step S36: exceeding a second threshold set by the event fusion counter;
step S37: and updating the current priority of the class of processing events.
When the value of the event fusion counter exceeds a preset threshold value of the event fusion count, the priority of the event to be processed corresponding to the event is automatically increased by 1, and the value of the event fusion counter is cleared; a new round of counting is started.
Secondly, referring to fig. 5, when an event occurrence dynamics is event unprocessed (event delay), the determining, according to the type of the event dynamics and the category attribute of the corresponding event, a to-be-processed event of a corresponding category in the event array, and updating the current priority of the to-be-processed event of the category specifically includes:
step S41: when a clock cycle comes;
here, the other events except the current response event determined in the various categories of events to be processed in the event array are all determined as non-current response events.
Step S42: judging whether the current response event is not;
step S43: the value of the wait counter is increased by 1; and the multitask operating system updates the event waiting attribute in the attributes of the events to be processed of the corresponding category in the event array, and specifically, adds 1 to the value of the waiting counter.
Here, when each clock cycle of the system comes, the non-current response event corresponding to each category of events to be processed in the event array is determined, and 1 is added to the value of the event waiting counter corresponding to each category of non-current response events.
Step S44: exceeding the preset threshold value of the waiting counter;
step S45: and updating the current priority of the class of the events to be processed.
When the value of the event waiting timer exceeds a preset threshold value, the priority of the event to be processed of the category corresponding to the event is automatically increased by 1, and then the value of the event waiting counter is cleared; a new round of counting is started.
Thirdly, referring to fig. 6, when the occurrence dynamics is event processing, the determining, according to the type of the event dynamics and the category attribute of the corresponding event, a to-be-processed event of a corresponding category in the event array, and updating the current priority of the to-be-processed event of the category specifically includes:
step S51: when the event is processed;
here, when the current priority of each category of events to be processed in the event array meets the condition, the event is determined as a current response event, and the response event is processed in the current clock cycle.
Step S52: judging whether the current response event is present;
step S53: adding 1 to the value of the processing counter; the multitask operating system updates the event processing attribute in the attribute of the event to be processed of the corresponding category in the event array, and specifically, adds 1 to the value of the processing counter.
Here, when the event is processed, the to-be-processed event of the corresponding category in the event array is determined according to the category attribute corresponding to the event, and 1 is added to the value of the event processing count timer corresponding to the to-be-processed event of the category.
Step S54: exceeding a preset threshold value of a processing counter;
step S55: and updating the current priority of the class of the events to be processed.
When the value of the event processing counter exceeds a preset threshold value, the priority of the event to be processed of the category corresponding to the event is automatically reduced by 1 until the value of the event processing counter is cleared; a new round of counting is started.
In the embodiment of the invention, the events to be processed in the Contiki operating system are classified in advance according to the category attribute of the events to be processed, the events to be processed in the same category are stored in the same position in an event array, presetting initial priority for each category of events to be processed, setting event counter, event fusion counter, event waiting counter, event processing counter and service weight for each category of events to be processed, event occurrence dynamics based on event occurrence, event processing, or event non-processing (event delay), updating the priority of each category of events to be processed in the event array in real time to obtain the updated current priority, the current response event when each clock period arrives is determined according to the current priority of event occurrence dynamic real-time update, so that the emergency can be rapidly processed; the events to be processed in the same category only occupy one position in the event array, so that the capacity of the events to be processed in the event array is greatly improved, and the event loss is avoided.
Referring to fig. 7, regarding a hardware structure of an event processing device based on a multitasking operating system, an optional hardware structure diagram of the event processing device based on the multitasking operating system according to an embodiment of the present invention is shown, where the event processing device includes: at least one processor 110 and a memory 111 for storing computer programs capable of running on the processor 110; the processor 110 illustrated in fig. 7 is not used to refer to the number of processors as one, but is only used to refer to the position relationship of the processor with respect to other devices, and in practical applications, the number of processors may be one or more; similarly, the memory 111 illustrated in fig. 7 is also used in the same sense, i.e. it is only used to refer to the position relationship of the memory with respect to other devices, and in practical applications, the number of the memory may be one or more.
Wherein, when the processor 110 is used to run the computer program, the following steps are executed:
when the set clock period comes, determining a current response event according to the current priority of each category of events to be processed in the event array;
and executing a corresponding program according to the current response event, and processing the current response event.
In an alternative embodiment, the processor 110 is further configured to execute the following steps when the computer program is executed:
detecting the occurrence condition of event dynamics;
when an event dynamic state occurs, determining the events to be processed of the corresponding category in the event array according to the type of the event dynamic state and the category attribute of the corresponding event, and updating the current priority of the events to be processed of the category.
In an alternative embodiment, the processor 110 is further configured to execute the following steps when the computer program is executed:
when an event occurs, determining the event to be processed of the corresponding category in the event array according to the category attribute of the event, and updating the counting attribute value of the event to be processed of the corresponding category, wherein the counting attribute value comprises a counter;
and updating the current priority of the events to be processed of the corresponding category according to the counting attribute value of the events to be processed of the corresponding category.
In an alternative embodiment, the processor 110 is further configured to execute the following steps when the computer program is executed:
adding 1 to the value of the event counter;
when the value of the event counter exceeds a set first threshold value, adding 1 to the value of the event fusion counter, and clearing the value of the event counter;
the updating the current priority of the to-be-processed event of the corresponding category according to the count attribute value of the to-be-processed event of the corresponding category includes:
and when the value of the event fusion counter exceeds a set second threshold value, updating the current priority of the events to be processed of the corresponding category.
In an alternative embodiment, the processor 110 is further configured to execute the following steps when the computer program is executed:
when a set clock period comes, determining a non-current response event corresponding to each type of events to be processed in an event array, and respectively updating a waiting attribute value corresponding to each type of non-current response events;
and updating the current priority of the non-current response events of each category according to the waiting attribute value of the non-current response event of each category.
In an alternative embodiment, the processor 110 is further configured to execute the following steps when the computer program is executed:
when an event is processed, determining the event to be processed of the corresponding category in the event array according to the category attribute corresponding to the event, and updating the processing attribute value of the event to be processed of the corresponding category;
and updating the current priority of the events to be processed of the corresponding category according to the processing attribute value of the events to be processed of the corresponding category.
In an alternative embodiment, the processor 110 is further configured to execute the following steps when the computer program is executed:
determining the type of the event to be processed with the highest current priority as the current response event according to the current priority of each type of the event to be processed in the event array; and/or the presence of a gas in the gas,
according to the current priority of each category of events to be processed in the event array, sorting the events to be processed of a plurality of categories with relatively high current priority, and determining the events to be processed of the plurality of categories as current response events.
In an alternative embodiment, the processor 110 is further configured to execute the following steps when the computer program is executed:
the method comprises the steps of obtaining the current priority of each category of events to be processed in an event array, obtaining the service weight of at least two categories of events when the current priority of at least two categories of events to be processed in the event array is the same, and determining the current response event according to the service weight.
The connection optimization apparatus further includes: at least one network interface 112. The various components in the connection optimization apparatus are coupled together by a bus system 113. It will be appreciated that the bus system 113 is used to enable communications among the components. The bus system 113 includes a power bus, a control bus, and a status signal bus in addition to the data bus. For clarity of illustration, however, the various buses are labeled as bus system 113 in FIG. 7.
The memory 111 may be a volatile memory or a nonvolatile memory, or may include both volatile and nonvolatile memories. Among them, the nonvolatile Memory may be a Read Only Memory (ROM), a Programmable Read Only Memory (PROM), an Erasable Programmable Read-Only Memory (EPROM), an Electrically Erasable Programmable Read-Only Memory (EEPROM), a magnetic random access Memory (FRAM), a Flash Memory (Flash Memory), a magnetic surface Memory, an optical disk, or a Compact Disc Read-Only Memory (CD-ROM); the magnetic surface storage may be disk storage or tape storage. Volatile Memory can be Random Access Memory (RAM), which acts as external cache Memory. By way of illustration and not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Synchronous Static Random Access Memory (SSRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic Random Access Memory (SDRAM), Double Data Rate Synchronous Dynamic Random Access Memory (DDRSDRAM), Enhanced Synchronous Dynamic Random Access Memory (ESDRAM), Enhanced Synchronous Dynamic Random Access Memory (Enhanced DRAM), Synchronous Dynamic Random Access Memory (SLDRAM), Direct Memory (DRmb Access), and Random Access Memory (DRAM). The memory 111 described in connection with the embodiments of the invention is intended to comprise, without being limited to, these and any other suitable types of memory.
The memory 111 in the embodiment of the present invention is used to store various types of data to support the operation of the event processing device based on the multitasking operating system. Examples of such data include: any computer program for operating on a multitasking operating system based event processing device, such as operating systems and application programs; contact data; telephone book data; a message; a picture; video, etc. The operating system includes various system programs, such as a framework layer, a core library layer, a driver layer, and the like, and is used for implementing various basic services and processing hardware-based tasks. The application programs may include various application programs such as a Media Player (Media Player), a Browser (Browser), etc. for implementing various application services. Here, the program that implements the method of the embodiment of the present invention may be included in an application program.
The present embodiment further provides a computer storage medium, for example, comprising a memory 111 storing a computer program, which can be executed by a processor 110 in the connection optimization apparatus to perform the steps of the aforementioned method. The computer storage medium can be FRAM, ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface Memory, optical disk, or CD-ROM; or may be a variety of devices including one or any combination of the above memories, such as a mobile phone, computer, tablet device, personal digital assistant, etc.
A computer storage medium having a computer program stored therein, the computer program, when executed by a processor, performing the steps of:
when the set clock period comes, determining a current response event according to the current priority of each category of events to be processed in the event array;
and executing a corresponding program according to the current response event, and processing the current response event.
In an alternative embodiment, the computer program, when executed by the processor, further performs the steps of:
detecting the occurrence condition of event dynamics;
when an event dynamic state occurs, determining the events to be processed of the corresponding category in the event array according to the type of the event dynamic state and the category attribute of the corresponding event, and updating the current priority of the events to be processed of the category.
In an alternative embodiment, the computer program, when executed by the processor, further performs the steps of:
when an event occurs, determining the event to be processed of the corresponding category in the event array according to the category attribute of the event, and updating the counting attribute value of the event to be processed of the corresponding category, wherein the counting attribute value comprises a counter;
and updating the current priority of the events to be processed of the corresponding category according to the counting attribute value of the events to be processed of the corresponding category.
In an alternative embodiment, the computer program, when executed by the processor, further performs the steps of:
adding 1 to the value of the event counter;
when the value of the event counter exceeds a set first threshold value, adding 1 to the value of the event fusion counter, and clearing the value of the event counter;
the updating the current priority of the to-be-processed event of the corresponding category according to the count attribute value of the to-be-processed event of the corresponding category includes:
and when the value of the event fusion counter exceeds a set second threshold value, updating the current priority of the events to be processed of the corresponding category.
In an alternative embodiment, the computer program, when executed by the processor, further performs the steps of:
when a set clock period comes, determining a non-current response event corresponding to each type of events to be processed in an event array, and respectively updating a waiting attribute value corresponding to each type of non-current response events;
and updating the current priority of the non-current response events of each category according to the waiting attribute value of the non-current response event of each category.
In an alternative embodiment, the computer program, when executed by the processor, further performs the steps of:
when an event is processed, determining the event to be processed of the corresponding category in the event array according to the category attribute corresponding to the event, and updating the processing attribute value of the event to be processed of the corresponding category;
and updating the current priority of the events to be processed of the corresponding category according to the processing attribute value of the events to be processed of the corresponding category.
In an alternative embodiment, the computer program, when executed by the processor, further performs the steps of:
determining the type of the event to be processed with the highest current priority as the current response event according to the current priority of each type of the event to be processed in the event array; and/or the presence of a gas in the gas,
according to the current priority of each category of events to be processed in the event array, sorting the events to be processed of a plurality of categories with relatively high current priority, and determining the events to be processed of the plurality of categories as current response events.
In an alternative embodiment, the computer program, when executed by the processor, further performs the steps of:
the method comprises the steps of obtaining the current priority of each category of events to be processed in an event array, obtaining the service weight of at least two categories of events when the current priority of at least two categories of events to be processed in the event array is the same, and determining the current response event according to the service weight.
The above description is only a preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, and improvement made within the spirit and scope of the present invention are included in the protection scope of the present invention.

Claims (8)

1. An event processing method based on a multitask operating system, which is characterized by comprising the following steps:
detecting the occurrence condition of event dynamics;
when an event dynamic state occurs, determining the to-be-processed event of the corresponding category in the event array according to the type of the event dynamic state and the category attribute of the corresponding event, and updating the current priority of the to-be-processed event of the category, wherein the method comprises the following steps: when an event occurs, determining the event to be processed of the corresponding category in the event array according to the category attribute of the event, and adding 1 to the value of the event counter of the event to be processed of the corresponding category; when the value of the event counter exceeds a set first threshold value, adding 1 to the value of the event fusion counter of the event to be processed of the corresponding category, and clearing the value of the event counter; when the value of the event fusion counter exceeds a set second threshold value, updating the current priority of the events to be processed of the corresponding category;
when the set clock period comes, determining a current response event according to the current priority of each category of events to be processed in the event array;
and executing a corresponding program according to the current response event, and processing the current response event.
2. The method according to claim 1, wherein when an event dynamics occurs, determining a pending event of a corresponding category in an event array according to a type of the event dynamics and a category attribute of the corresponding event, and updating a current priority of the pending event of the category, further comprising:
when a set clock period comes, determining a non-current response event corresponding to each category of events to be processed in the event array, and respectively updating a waiting attribute value corresponding to each category of non-current response events;
and updating the current priority of each type of non-current response event according to the waiting attribute value of each type of non-current response event.
3. The method according to claim 1, wherein when an event dynamics occurs, determining a pending event of a corresponding category in an event array according to a type of the event dynamics and a category attribute of the corresponding event, and updating a current priority of the pending event of the category, further comprising:
when an event is processed, determining the event to be processed of the corresponding category in the event array according to the category attribute corresponding to the event, and updating the processing attribute value of the event to be processed of the corresponding category;
and updating the current priority of the events to be processed of the corresponding category according to the processing attribute value of the events to be processed of the corresponding category.
4. The method according to any one of claims 1-3, wherein the determining a current response event according to the current priority of each category of pending events in the event array comprises:
determining the type of the event to be processed with the highest current priority as the current response event according to the current priority of each type of the event to be processed in the event array; alternatively, the first and second electrodes may be,
according to the current priority of each category of events to be processed in the event array, sorting the events to be processed of a plurality of categories with relatively high current priority, and determining the events to be processed of the plurality of categories as current response events.
5. The method according to any one of claims 1-3, wherein the determining a current response event according to the current priority of each category of pending events in the event array comprises:
the method comprises the steps of obtaining the current priority of each category of events to be processed in an event array, obtaining the service weight of at least two categories of events when the current priority of at least two categories of events to be processed in the event array is the same, and determining the current response event according to the service weight.
6. An event processing apparatus based on a multitasking operating system, the apparatus comprising: the device comprises a detection module, an updating module, a determination module and a processing module; wherein the content of the first and second substances,
the detection module is used for detecting the dynamic occurrence condition of the event;
the updating module is configured to determine, when an event dynamic state occurs, a to-be-processed event of a corresponding category in an event array according to a type of the event dynamic state and a category attribute of the corresponding event, and update a current priority of the to-be-processed event of the category, and includes: when an event occurs, determining the event to be processed of the corresponding category in the event array according to the category attribute of the event, and adding 1 to the value of the event counter of the event to be processed of the corresponding category; when the value of the event counter exceeds a set first threshold value, adding 1 to the value of the event fusion counter of the event to be processed of the corresponding category, and clearing the value of the event counter; when the value of the event fusion counter exceeds a set second threshold value, updating the current priority of the events to be processed of the corresponding category;
the determining module is used for determining a current response event according to the current priority of each category of events to be processed in the event array when the set clock period comes;
and the processing module is used for executing a corresponding program according to the current response event and processing the current response event.
7. An event processing apparatus based on a multitasking operating system, comprising: a processor and a memory for storing a computer program capable of running on the processor;
wherein the processor is configured to implement the event processing method based on the multitask operating system according to any one of claims 1 to 5 when the computer program is executed.
8. A computer storage medium, in which a computer program is stored, wherein the computer program, when executed by a processor, implements an event processing method of a multitasking operating system according to any one of claims 1 to 5.
CN201711464111.8A 2017-12-28 2017-12-28 Event processing method and device based on multitask operating system and storage medium Active CN109976885B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711464111.8A CN109976885B (en) 2017-12-28 2017-12-28 Event processing method and device based on multitask operating system and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711464111.8A CN109976885B (en) 2017-12-28 2017-12-28 Event processing method and device based on multitask operating system and storage medium

Publications (2)

Publication Number Publication Date
CN109976885A CN109976885A (en) 2019-07-05
CN109976885B true CN109976885B (en) 2021-07-06

Family

ID=67075090

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711464111.8A Active CN109976885B (en) 2017-12-28 2017-12-28 Event processing method and device based on multitask operating system and storage medium

Country Status (1)

Country Link
CN (1) CN109976885B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20220283990A1 (en) * 2019-08-06 2022-09-08 Siemens Aktiengesellschaft Method for configuring priority level, cloud platform, system, computing device, and medium
CN113778711B (en) * 2021-09-09 2024-04-16 恒安嘉新(北京)科技股份公司 Event processing method and device, electronic equipment and storage medium

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101510164B (en) * 2009-03-25 2013-05-22 北京中星微电子有限公司 Multi-service scheduling method, apparatus and system
CN102567086B (en) * 2010-12-30 2014-05-07 中国移动通信集团公司 Task scheduling method, equipment and system
US9448847B2 (en) * 2011-07-15 2016-09-20 Throughputer, Inc. Concurrent program execution optimization
CN102394932A (en) * 2011-11-04 2012-03-28 浪潮(北京)电子信息产业有限公司 Cloud sea operating system and resource scheduling method thereof
CN103530173B (en) * 2012-07-06 2018-07-17 上海宝信软件股份有限公司 Changeable weight event handling system and method
CN104679575B (en) * 2013-11-28 2018-08-24 阿里巴巴集团控股有限公司 The control system and its method of iostream
CN105511950A (en) * 2015-12-10 2016-04-20 天津海量信息技术有限公司 Dispatching management method for task queue priority of large data set
US9898341B2 (en) * 2016-02-25 2018-02-20 Western Digital Technologies, Inc. Adjustable priority ratios for multiple task queues
CN106201695A (en) * 2016-07-15 2016-12-07 郑州飞机装备有限责任公司 It is applicable to the multi-task scheduling method of embedded software system

Also Published As

Publication number Publication date
CN109976885A (en) 2019-07-05

Similar Documents

Publication Publication Date Title
JP3944154B2 (en) Method and system for dynamically adjusting a thread pool in a multi-threaded server
US10311108B2 (en) Cloud-based file prefetching on electronic devices
JP3817541B2 (en) Response time based workload distribution technique based on program
CN106230997B (en) Resource scheduling method and device
US9798584B1 (en) Methods and apparatus for IO sizing based task throttling
CN111078733B (en) Batch task processing method, device, computer equipment and storage medium
CN109033814B (en) Intelligent contract triggering method, device, equipment and storage medium
CN109976885B (en) Event processing method and device based on multitask operating system and storage medium
US10642585B1 (en) Enhancing API service schemes
CN112965823A (en) Call request control method and device, electronic equipment and storage medium
US8904093B1 (en) Managing lifetime of limited usage storage devices in a caching system
CN112558872A (en) Data processing method and device, storage medium and electronic equipment
CN113032119A (en) Task scheduling method and device, storage medium and electronic equipment
CN110764705B (en) Data reading and writing method, device, equipment and storage medium
CN111782409A (en) Task processing method, risk identification task processing device and electronic equipment
CN114153760B (en) Method, system and storage medium for eliminating healthy value storage cache based on weight
US20220217097A1 (en) Method and system for allocating and managing cloud resources
CN115499513A (en) Data request processing method and device, computer equipment and storage medium
CN115037789A (en) Current limiting method, device, apparatus, storage medium and program product
CN111459653B (en) Cluster scheduling method, device and system and electronic equipment
CN113225265A (en) Flow control method, device, equipment and computer storage medium
CN111258754A (en) Resource processing method, device, medium and system based on time window
US11275668B2 (en) Dynamically enhancing the performance of a foreground application
US20240078136A1 (en) Operating a distributed worker pool to conserve computing resources
CN110083405B (en) Function starting method and device

Legal Events

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