Multi-level task classification processing method, device, system and storage medium
By monitoring the task status in the Internet of Things system and allocating cache intervals, multi-core processing task scheduling is optimized, and multi-core processing task scheduling is solved, and efficient task processing and simplified scheduling of priority tasks is achieved.
Patent Information
- Application Number
- CN202111424305.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2020-12-31
- Filing Date
- 2021-11-26
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2041-11-26
AI Technical Summary
The prior art has low efficiency in multi-core processing task scheduling in the Internet of Things, and the processing of different types of tasks is complicated.
By monitoring the task status in a multi-core IoT system, tasks are allocated to the corresponding execution core according to priority and cache intervals, segmented management of first-in-first-out cache queues is adopted, allocated to the first-class and second-class cores, and tasks are migrated in the cache intervals to optimize task scheduling.
It improves the data processing efficiency of multi-core processing task scheduling in the Internet of Things system, simplifies the scheduling process of different types of tasks, ensures the processing requirements of priority tasks, and avoids task congestion and idleness of execution cores.
Smart Images

Figure CN114020440B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the field of network technology, and in particular to a multi-level task classification processing method, apparatus, device, and storage medium. Background Art
[0002] The Internet of Things (IoT) is seen as a major opportunity for development and transformation in the information sector, promising revolutionary change. This transformation is widely expected to have a comprehensive impact across a wide range of sectors, including industry, agriculture, property management, urban management, and fire safety. However, from a technical perspective, the IoT not only changes the nature of data transmission but also differs significantly from traditional communications. For example, large-scale IoT is characterized by the sporadic transmission of small packets by a large number of users, unlike traditional cellular communications.
[0003] In order to adapt to the task scheduling needs in the Internet of Things, high-performance embedded nodes are usually designed for large-scale Internet of Things to parallel process the data collected in the Internet of Things, and even use multi-core processing to achieve task scheduling.
[0004] In the process of scheduling tasks through multi-core processing in large-scale Internet of Things, the inventors found that a task may be scheduled multiple times between multiple execution cores, resulting in a large amount of useless scheduling, low scheduling efficiency, and complex processing of different types of tasks. Summary of the Invention
[0005] The present invention provides a multi-level task classification processing method, device, system and storage medium to solve the technical problems of low scheduling efficiency and complex processing of different types of tasks in the prior art Internet of Things multi-core processing task scheduling.
[0006] In a first aspect, an embodiment of the present invention provides a multi-level task classification processing method for a multi-core Internet of Things system, comprising:
[0007] Monitoring the task status of the multi-core IoT system, wherein each execution core of the multi-core IoT system is respectively allocated a common cache interval, wherein the common cache interval is a section of a first-in-first-out cache queue in the multi-core IoT system, and the first-in-first-out cache queue is further provided with a priority cache interval;
[0008] When a new task input is detected, the new task is cached in a first cache interval or a priority cache interval according to the task priority, so as to be allocated to the execution core corresponding to the first cache interval or enter a priority allocation state. The first cache interval is the cache interval with the longest remaining cache queue among the common cache intervals.
[0009] Allocate execution cores into a first type of cores and a second type of cores according to a preset ratio based on the number of tasks in the priority cache interval;
[0010] The first type of cores obtain new tasks from the corresponding normal cache interval for processing, and the second type of cores sequentially obtain new tasks from the priority cache interval and the corresponding normal cache interval for processing.
[0011] Further, the method further includes:
[0012] When it is monitored that there is an idle cache interval in the normal cache interval, at least one task cache is migrated from the second cache interval to the idle cache interval, so as to be correspondingly allocated to the execution core corresponding to the idle cache interval. The idle cache interval is a cache interval from which tasks have been cleared, and the second cache interval is the normal cache interval with the largest number of remaining tasks currently.
[0013] Further, the step of when it is monitored that there is an idle cache interval in the normal cache interval, migrating at least one task cache from the second cache interval to the idle cache interval includes:
[0014] When it is monitored that there is an idle cache interval in the normal cache interval, the second cache interval is sequentially confirmed, and task caches are migrated one by one from the second cache interval to the idle cache interval until the number of tasks in the idle cache interval reaches a preset threshold value, or the number of tasks in all normal cache intervals does not exceed the preset threshold value.
[0015] Further, when there are multiple second cache intervals, one task cache is randomly migrated from one of the second cache intervals to the idle cache interval.
[0016] Further, when there are multiple first cache intervals, the latest task is randomly cached in one of the first cache intervals.
[0017] Further, the lengths of the cache queues corresponding to each execution core are the same.
[0018] In a second aspect, an embodiment of the present invention further provides a multi-level task classification processing device for a multi-core Internet of Things system, including:
[0019] A status monitoring unit for monitoring the task status in the multi-core Internet of Things system. Each execution core of the multi-core Internet of Things system is respectively allocated a normal cache interval, and the normal cache interval is a segment of a first-in-first-out cache queue in the multi-core Internet of Things system. The first-in-first-out cache queue is further provided with a priority cache interval;
[0020] A task cache unit, configured to, when detecting that there is a latest task input, cache the latest task into a first cache range or a priority cache range according to the task priority, so as to correspondingly allocate it to an execution core corresponding to the first cache range or enter a priority allocation state, where the first cache range is the cache range with the longest current remaining cache queue in the normal cache range;
[0021] A core allocation unit, configured to allocate execution cores into a first type of core and a second type of core according to a preset ratio according to the number of tasks in the priority cache range;
[0022] A classification processing unit, configured to enable the first type of core to obtain new tasks from the corresponding normal cache range for processing, and enable the second type of core to obtain new tasks from the priority cache range and the corresponding normal cache range in sequence for processing.
[0023] Further, the device further includes:
[0024] A task migration unit, configured to, when detecting that there is an idle cache range in the normal cache range, migrate at least one task cache from a second cache range to the idle cache range, so as to correspondingly allocate it to an execution core corresponding to the idle cache range, where the idle cache range is a cache range with tasks emptied, and the second cache range is the normal cache range with the most remaining tasks currently.
[0025] Further, when detecting that there is an idle cache range in the normal cache range, migrating at least one task cache from the second cache range to the idle cache range includes:
[0026] When detecting that there is an idle cache range in the normal cache range, sequentially confirm the second cache range, and migrate task caches from the second cache range to the idle cache range one by one until the number of tasks in the idle cache range reaches a preset threshold value, or the number of tasks in all normal cache ranges is not higher than the preset threshold value.
[0027] Further, when there are multiple second cache ranges, randomly migrate one task cache from one of the second cache ranges to the idle cache range.
[0028] Further, when there are multiple first cache ranges, randomly cache the latest task into one of the first cache ranges.
[0029] Further, the lengths of the cache queues corresponding to each execution core are the same.
[0030] In a third aspect, an embodiment of the present invention further provides an Internet of Things system, including:
[0031] One or more processors;
[0032] A memory for storing one or more programs;
[0033] When the one or more programs are executed by the one or more processors, the IoT system implements the multi-level task classification processing method as described in any one of the first aspects.
[0034] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, it implements the multi-level task classification processing method as described in the first aspect.
[0035] For the above multi-level task classification processing method, device, IoT system, and storage medium, the task status in the multi-core IoT system is monitored. Each execution core of the multi-core IoT system is respectively assigned a normal cache interval, and the normal cache interval is a segment of the first-in-first-out cache queue in the multi-core IoT system. The first-in-first-out cache queue is also provided with a priority cache interval; when it is detected that there is a latest task input, the latest task is cached into the first cache interval or the priority cache interval according to the task priority, so as to be correspondingly assigned to the execution core corresponding to the first cache interval or enter the priority allocation state. The first cache interval is the cache interval with the longest current remaining cache queue in the normal cache interval; the execution cores are allocated into a first type of core and a second type of core according to a preset ratio according to the number of tasks in the priority cache interval; the first type of core obtains new tasks from the corresponding normal cache interval for processing, and the second type of core sequentially obtains new tasks from the priority cache interval and the corresponding normal cache interval for processing. This solution reduces the switching process of task allocation by allocating corresponding cache intervals to each execution core and allocating the latest task to the corresponding cache interval according to the number of tasks in the cache interval when receiving the latest task, improves the data processing efficiency of multi-core processing task scheduling in the IoT system, and simplifies the scheduling process of different types of tasks by processing priority tasks for each execution, while ensuring the requirement of priority processing and avoiding task congestion or idle execution cores that may be caused by statically allocating execution cores. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 It is a flowchart of a multi-level task classification processing method provided by Embodiment 1 of the present invention;
[0037] Figure 2 It is a schematic structural diagram of a multi-level task classification processing device provided by Embodiment 2 of the present invention;
[0038] Figure 3 It is a schematic structural diagram of an IoT system provided by Embodiment 3 of the present invention. DETAILED DESCRIPTION
[0039] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It can be understood that the specific embodiments described herein are used to explain the present invention rather than limit the present invention. In addition, it should be noted that, for the convenience of description, only the parts related to the present invention rather than all the structures are shown in the drawings.
[0040] It should be noted that due to space limitations, the description in the specification of this application does not enumerate all optional implementation manners. After reading the specification of this application, those skilled in the art should be able to think that as long as the technical features do not conflict with each other, any combination of technical features can constitute an optional implementation manner.
[0041] The following will describe each embodiment in detail.
[0042] Embodiment 1
[0043] Figure 1 It is a flowchart of a multi-level task classification processing method provided for Embodiment 1 of the present invention. The multi-level task classification processing method provided in the embodiment can be executed by various operating devices for multi-level task classification processing. The operating device can be implemented in software and / or hardware. The operating device can be composed of two or more physical entities or one physical entity.
[0044] Specifically, referring to Figure 1 , the multi-level task classification processing method specifically includes:
[0045] Step S101: Monitor the task status in the multi-core Internet of Things system. Each execution core of the multi-core Internet of Things system is respectively assigned a normal cache area, and the normal cache area is a segment of the first-in-first-out cache queue in the multi-core Internet of Things system. The first-in-first-out cache queue is also provided with a priority cache area.
[0046] In the architecture of the Internet of Things system, the aggregation node is a key component of the architecture. In the specific implementation process, the multi-core Internet of Things system is designed based on an embedded multi-core processor. Multiple execution cores in the embedded multi-core processor can perform operations simultaneously, so as to bring higher processing efficiency for data collection in the multi-core Internet of Things system under limited resource configuration.
[0047] For an embedded multi-core processor, each processing core cannot handle all the tasks assigned to it at the same time. That is, the tasks assigned to an IoT node may need to queue up, and the tasks in the queuing state are temporarily cached in a first-in-first-out cache queue. According to the existing technology, during the queuing process of these tasks, they may be continuously scheduled and switched to different execution cores for waiting execution according to the actual processing progress of the execution cores, which is equivalent to an ineffective scheduling process during the task scheduling arrangement.
[0048] In this solution, to improve the scheduling efficiency, the first-in-first-out cache queue is segmented, and each segment corresponds to an execution core. Specifically, the tasks assigned to a certain execution core are first cached in the corresponding cache interval. Through this method of corresponding assignment between the execution core and the cache interval, the association relationship between the task and the execution core responsible for processing the task is fixed in a relatively static manner to minimize the ineffective task assignment and scheduling process. When specifically segmenting the first-in-first-out cache queue, the cache intervals assigned to each execution core can be set to be the same, that is, the lengths of the cache queues corresponding to each execution core are the same, so as to ensure that the upper limit of the tasks assigned to each execution core is the same and the amount of tasks assigned and scheduled to each execution core is relatively balanced.
[0049] During the actual processing, to meet the requirement of giving priority to the processing of priority tasks, all priority tasks are centrally cached in the corresponding priority cache interval, and all execution cores can obtain priority tasks from the priority cache interval for processing.
[0050] Step S102: When it is detected that there is a latest task input, the latest task is cached in the first cache interval or the priority cache interval according to the task priority, so as to be correspondingly assigned to the execution core corresponding to the first cache interval or enter the priority assignment state. The first cache interval is the cache interval with the longest remaining cache queue among the ordinary cache intervals.
[0051] For an Internet of Things node, when receiving the latest task input, it is necessary to allocate the latest task to an execution core in the embedded multi-core processor of the Internet of Things node. In the existing processing method, when there are tasks waiting to be executed in the current execution cores, the first-in, first-out cache queue is managed as a whole for caching. The allocation process of a task to a specific execution core may be continuously adjusted due to changes in the task processing progress, resulting in the need to continuously monitor the task processing status of all execution cores when the task is cached in the first-in, first-out cache queue, and then continuously make adaptive adjustments to the task allocation. In this solution, ordinary latest tasks are directly allocated to the execution core with the least current processing tasks, and the tasks allocated to each execution core are relatively fixed. The basic processing principle is to process tasks with the initially allocated execution core, reducing the allocation changes during the task waiting process. Priority latest tasks are directly cached in the priority cache interval and are preferably processed by all execution cores by default.
[0052] During specific allocation, to minimize the queuing waiting time of each task as much as possible, for the detected latest task, the current task status of each execution core is first judged. The current task status is confirmed from the cache interval corresponding to the execution core. Generally speaking, the fewer tasks currently cached in the cache interval, the shorter the occupied cache queue and the longer the remaining cache queue. The cache interval with the longest remaining cache queue is identified as the first cache interval, and the latest task is allocated to the first cache interval. After the latest task is cached in the first cache interval, according to the corresponding relationship between the cache interval and the execution core, the execution core to which the latest task is allocated is determined, and it can wait for the corresponding execution core to process in the cache interval.
[0053] In the actual processing process, it is possible that the remaining tasks in multiple cache intervals are the same, that is, it is possible that multiple cache intervals are all the first cache intervals. When there are multiple first cache intervals, the latest task is randomly cached in one of the first cache intervals.
[0054] Step S10: Allocate the execution cores into the first type of cores and the second type of cores according to a preset ratio according to the number of tasks in the priority cache interval.
[0055] When ensuring the processing of tasks with higher priorities, it is also necessary to ensure the orderly processing of ordinary tasks with lower priorities. Therefore, when the execution cores perform task allocation, a relatively flexible dynamic allocation mechanism is adopted, that is, each execution core processes ordinary tasks with lower priorities, and the processing of tasks with higher priorities is allocated according to actual processing needs. That is, the more tasks with higher priorities, the more execution cores for corresponding processing; the more tasks with lower priorities, the fewer execution cores for corresponding processing. In this solution, the execution cores that only process ordinary tasks with lower priorities are defined as the first type of cores, and the execution cores that need to process tasks with higher priorities are defined as the second type of cores. With the total number of execution cores remaining unchanged, the ratio of the first type of cores to the second type of cores is adjusted to meet the processing requirements of different numbers of tasks with higher priorities. Of course, in the actual ratio presetting, not every change in tasks will result in an adjustment of the ratio of the first type of cores to the second type of cores. Instead, in a segmented manner, when the number of tasks with higher priorities is within a certain segmented range, the ratio of the first type of cores to the second type of cores is adjusted to the corresponding ratio within that segmented range. The specific ratios within different segmented ranges are determined according to the processing capabilities of the execution cores, bandwidth allocation, task sizes, and the proportions of tasks with different priorities, and are not specifically limited here.
[0056] Step S104: The first type of cores obtain new tasks from the corresponding ordinary cache intervals for processing, and the second type of cores sequentially obtain new tasks from the priority cache interval and the corresponding ordinary cache intervals for processing.
[0057] In the specific task processing process, each second type of core rotates to obtain new tasks from the priority cache interval and the corresponding ordinary cache intervals for processing, thereby ensuring the orderly processing of ordinary tasks and realizing the priority processing of priority tasks. In terms of actual acquisition results, when the task acquisition from the priority cache interval fails, the task is obtained from the corresponding ordinary cache interval; when the task acquisition from the corresponding ordinary cache interval fails, the task is obtained from the priority cache interval. When the task acquisition fails in both the corresponding ordinary cache interval and the priority cache interval, it enters the idle state until there are new tasks cached in the priority cache interval or the corresponding ordinary cache interval.
[0058] To adapt to the differences in the processing progress of ordinary tasks that may be caused by the differences in the specific task processing process, this solution further includes step S105 to achieve fine-tuning of task allocation.
[0059] Step S105: When it is detected that there is an idle cache range in the general cache range, at least one task cache is migrated from the second cache range to the idle cache range to be correspondingly allocated to the execution core corresponding to the idle cache range. The idle cache range is the cache range from which tasks have been cleared, and the second cache range is the general cache range with the largest number of remaining tasks currently.
[0060] During the process of each execution core processing tasks, due to reasons such as task complexity, data transmission speed, and bandwidth allocation, the processing speed of tasks may not be exactly the same, ultimately resulting in different task queuing situations in the cache ranges. For example, some execution cores may have processed all tasks, that is, the tasks in the corresponding cache range have been cleared; while there are still multiple tasks queuing in the cache ranges corresponding to other execution cores. At this time, one or more tasks can be migrated from the queuing cache ranges to the idle cache range to overall improve the task processing speed and avoid the situation where the execution core is in an idle state.
[0061] When specifically performing task migration, instead of migrating multiple tasks from other cache ranges to the idle cache range at one time, it is migrated sequentially, and the task quantity status in all general cache ranges is judged. Generally speaking, when it is detected that there is an idle cache range in the general cache range, the second cache range is sequentially confirmed, and task caches are migrated one by one from the second cache range to the idle cache range until the number of tasks in the idle cache range reaches a preset threshold value, or the number of tasks in all general cache ranges is not higher than the preset threshold value. During the process of migrating tasks one by one, it will be judged whether the previously confirmed idle cache range reaches the preset threshold value. If it reaches the preset threshold value, it means that there are already a certain number of tasks to be processed in the idle cache range, and no more tasks will be migrated to the idle cache range, just wait for the latest tasks to be allocated to this cache range. At the same time, in order to avoid too few tasks in other cache ranges, when migrating out to a certain extent such that the number of tasks in other cache ranges is not much, that is, when the number of remaining tasks in other cache ranges is not higher than the preset threshold value, the migration stops.
[0062] During the specific processing process, it is possible that the remaining tasks in multiple cache ranges are tied for the most, that is, there are multiple second cache ranges. At this time, instead of directly migrating one task from each second cache range to the idle cache range, a task cache is randomly migrated from one of the second cache ranges to the idle cache range, and the sequential migration and confirmation method is still adopted. After each task is migrated, the remaining tasks in the idle cache range and the tasks in other cache ranges are judged until the set number of tasks is reached and the migration stops. The tasks migrated to the idle cache range can be the latest cached tasks or the earliest cached tasks.
[0063] In addition to the above based on the preset threshold value, the judgment basis for stopping the migration of other cache intervals can also be based on the comparison with the tasks in the idle cache interval. If the remaining tasks in other cache intervals are no more than one more than the tasks in the idle cache interval, the task migration is not performed either.
[0064] It should be noted that the first cache interval and the second cache interval mentioned in this embodiment are not fixed one or more cache intervals. They are only defined differently according to the state of the cache interval at a certain moment. They are special identifiers for the convenience of embodiment description, and their functions are no different from those of other cache intervals. After the current latest task is cached in a certain first cache interval, this first cache interval may no longer be the first cache interval when the next latest task is cached. Moreover, the idle cache interval is defined as the idle cache interval throughout the migration process, rather than necessarily being defined as the idle cache interval when there are no tasks in it. From the perspective of the task queuing state, after the task migration of a certain cache interval is completed, the state definition of its idle cache interval ends.
[0065] At the same time, in this solution, it should be understood that steps S101 - S104 exist as a whole solution. They are not strictly executed in the order described above. When the multi-core Internet of Things system processes tasks, the allocation of the latest tasks and the migration of tasks can be executed according to the actual monitoring results. When the latest task is detected, the latest task is cached; when the idle cache interval is detected, the task is migrated to the idle cache interval. If the latest tasks are continuously detected, steps S102 and S103 are continuously executed to cache and process the tasks. If the idle cache intervals are continuously detected, step S104 is continuously executed to fine-tune the task allocation.
[0066] As described above, the task status in the multi-core Internet of Things system is monitored. Each execution core of the multi-core Internet of Things system is respectively allocated a normal cache range, and the normal cache range is a segment of the first-in-first-out cache queue in the multi-core Internet of Things system. The first-in-first-out cache queue is also provided with a priority cache range; when it is monitored that there is a latest task input, the latest task is cached into the first cache range or the priority cache range according to the task priority, so as to be correspondingly allocated to the execution core corresponding to the first cache range or enter the priority allocation state. The first cache range is the cache range with the longest current remaining cache queue in the normal cache range; the execution cores are allocated into a first type of core and a second type of core according to a preset ratio according to the number of tasks in the priority cache range; the first type of core obtains new tasks from the corresponding normal cache range for processing, and the second type of core obtains new tasks from the priority cache range and the corresponding normal cache range in sequence for processing. Through the allocation of corresponding cache ranges for each execution core, and when receiving the latest task, allocating it to the corresponding cache range according to the number of tasks in the cache range, this solution reduces the switching process of task allocation, improves the data processing efficiency of multi-core processing task scheduling in the Internet of Things system, and the processing of priority tasks by each execution also simplifies the scheduling process of different types of tasks, while ensuring the requirement of priority processing, and avoiding task congestion or idle execution cores that may be caused by static allocation of execution cores.
[0067] Embodiment 2
[0068] Figure 2 It is a schematic structural diagram of a multi-level task classification processing device provided in Embodiment 2 of the present invention. Refer to Figure 2 , the multi-level task classification processing device includes: a status monitoring unit 210, a task caching unit 220, and a task obtaining unit 230.
[0069] Among them, a status monitoring unit 210 is configured to monitor the task status in the multi-core Internet of Things system. Each execution core of the multi-core Internet of Things system is respectively allocated with a normal cache interval, and the normal cache interval is a section of the first-in-first-out cache queue in the multi-core Internet of Things system. The first-in-first-out cache queue is further provided with a priority cache interval. A task cache unit 220 is configured to, when it is detected that a latest task is input, cache the latest task into the first cache interval or the priority cache interval according to the task priority, so as to be correspondingly allocated to the execution core corresponding to the first cache interval or enter the priority allocation state. The first cache interval is the cache interval with the longest remaining cache queue in the normal cache interval. A core allocation unit 230 is configured to allocate the execution cores into a first type of core and a second type of core according to a preset ratio according to the number of tasks in the priority cache interval. A classification processing unit 240 is configured to process new tasks obtained from the corresponding normal cache interval by the first type of core, and the second type of core sequentially obtains new tasks from the priority cache interval and the corresponding normal cache interval for processing.
[0070] Based on the above embodiments, the device further includes:
[0071] A task migration unit is configured to, when it is detected that there is an idle cache interval in the normal cache interval, migrate at least one task cache from the second cache interval to the idle cache interval, so as to be correspondingly allocated to the execution core corresponding to the idle cache interval. The idle cache interval is a cache interval with tasks emptied, and the second cache interval is the normal cache interval with the most remaining tasks currently.
[0072] Based on the above embodiments, when it is detected that there is an idle cache interval in the normal cache interval, migrating at least one task cache from the second cache interval to the idle cache interval includes:
[0073] When it is detected that there is an idle cache interval in the normal cache interval, the second cache interval is sequentially confirmed, and task caches are migrated from the second cache interval to the idle cache interval one by one until the number of tasks in the idle cache interval reaches a preset threshold value, or the number of tasks in all normal cache intervals does not exceed the preset threshold value.
[0074] Based on the above embodiments, when there are multiple second cache intervals, one task cache is randomly migrated from one of the second cache intervals to the idle cache interval.
[0075] Based on the above embodiments, when there are multiple first cache intervals, the latest task is randomly cached into one of the first cache intervals.
[0076] Based on the above embodiments, the lengths of the cache queues corresponding to each of the execution cores are the same.
[0077] The multi-level task classification processing device provided by the embodiments of the present invention is included in a multi-level task classification processing device and can be used to execute any of the multi-level task classification processing methods provided in the first embodiment above, and has corresponding functions and beneficial effects.
[0078] Embodiment III
[0079] Figure 3 FIG. 10 is a schematic structural diagram of an Internet of Things node device provided in Embodiment III of the present invention. The Internet of Things node device is used to form an Internet of Things system, and further comprehensively implement the task scheduling in the present solution. As Figure 3 shown, the Internet of Things node device includes a processor 310, a memory 320, an input device 330, an output device 340, and a communication device 350; the number of processors 310 in the Internet of Things node device may be one or more, Figure 3 and one processor 310 is taken as an example here; the processor 310, the memory 320, the input device 330, the output device 340, and the communication device 350 in the Internet of Things node device may be connected by a bus or other means, Figure 3 and taking connection by a bus as an example here.
[0080] The memory 320, as a computer-readable storage medium, can be used to store software programs, computer-executable programs, and modules, such as program instructions / modules corresponding to the multi-level task classification processing method in the embodiments of the present invention (for example, the state monitoring unit 210, the task caching unit 220, and the task acquisition unit 230 in the multi-level task classification processing device). The processor 310 executes various functional applications and data processing of the Internet of Things node device by running the software programs, instructions, and modules stored in the memory 320, that is, implements the above multi-level task classification processing method.
[0081] The memory ills 320 may mainly include a program storage area and a data storage area. Among them, the program storage area may store an operating system and application programs required for at least one function; the data storage area may store data created according to the use of the Internet of Things node device. In addition, the memory 320 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other non-volatile solid-state storage devices. In some instances, the memory 320 may further include a memory remotely provided with respect to the processor 310, and these remote memories may be connected to the Internet of Things node device through a network. Examples of the above network include but are not limited to the Internet, an enterprise intranet, a local area network, a mobile communication network, and combinations thereof.
[0082] The input device 330 can be used to receive input digital or character information and generate key signal inputs related to user settings and function controls of the Internet of Things node device. The output device 340 can include display devices such as a display screen.
[0083] The above Internet of Things node device includes a multi-level task classification processing device, which can be used to execute any multi-level task classification processing method and has corresponding functions and beneficial effects.
[0084] Embodiment 4
[0085] The embodiment of the present invention also provides a storage medium containing computer-executable instructions. When the computer-executable instructions are executed by a computer processor, they are used to execute the relevant operations in the multi-level task classification processing method provided in any embodiment of the present application and have corresponding functions and beneficial effects.
[0086] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product.
[0087] Therefore, the present application can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk memories, CD-ROMs, optical memories, etc.) containing computer-usable program codes. The present application is described with reference to the flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or block in the flowchart and / or block diagram, and the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing devices generate a device for implementing the functions specified in Figure 1 one process or multiple processes and / or blocks Figure 1 one block or multiple blocks. These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory generate a manufactured product including an instruction device, and the instruction device implements the functions in Figure 1 one process or multiple processes and / or blocks Figure 1the functions specified in one or more boxes. These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to generate a computer-implemented process, and thus the instructions executed on the computer or other programmable device provide for implementing in the process Figure 1 one process or more processes and / or boxes Figure 1 the steps of the functions specified in one box or more boxes.
[0088] In a typical configuration, a computing device includes one or more processors (CPUs), an input / output interface, a network interface, and memory. The memory may include non-permanent memory in the form of computer-readable media, random access memory (RAM), and / or non-volatile memory such as read-only memory (ROM) or flash memory (flash RAM). Memory is an example of computer-readable media.
[0089] Computer-readable media includes permanent and non-permanent, removable and non-removable media that can store information by any method or technology. The information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory computer-readable media such as modulated data signals and carrier waves.
[0090] It should also be noted that the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, commodity or device comprising a series of elements not only includes those elements, but also includes other elements not expressly listed, or also includes elements inherent to such process, method, commodity or device. Without further limitation, an element defined by the statement "comprising one..." does not exclude the existence of additional identical elements in the process, method, commodity or device comprising the element.
[0091] Note that the above is only the preferred embodiment of the present invention and the technical principles applied. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein. Various obvious changes, re-adjustments, and substitutions can be made by those skilled in the art without departing from the protection scope of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments. Without departing from the concept of the present invention, more other equivalent embodiments can be included, and the scope of the present invention is determined by the scope of the appended claims.
Claims
1. A multi-level task classification and processing method for a multi-core Internet of Things system, characterized in that Including: Monitoring the task status in the multi-core Internet of Things system, where each execution core of the multi-core Internet of Things system is respectively assigned a normal cache range, and the normal cache range is a segment of the first-in-first-out cache queue in the multi-core Internet of Things system, and the first-in-first-out cache queue is also provided with a priority cache range; When it is monitored that there is a latest task input, the latest task is cached into the first cache range or the priority cache range according to the task priority, so as to be correspondingly assigned to the execution core corresponding to the first cache range or enter the priority allocation state, and the first cache range is the cache range with the longest remaining cache queue in the normal cache range; Allocating the execution cores into a first type of core and a second type of core according to a preset ratio according to the number of tasks in the priority cache range, and the preset ratio is determined based on the number of tasks with different priorities; The first type of core obtains new tasks from the corresponding normal cache range for processing, and the second type of core sequentially obtains new tasks from the priority cache range and the corresponding normal cache range for processing; when the second type of core fails to obtain a task from the priority cache range, it obtains a task from the corresponding normal cache range; when it fails to obtain a task from the corresponding normal cache range, it obtains a task from the priority cache range, and when it fails to obtain tasks from both the corresponding normal cache range and the priority cache range, it enters the idle state until there are new tasks cached in the priority cache range or the corresponding normal cache range.
2. The method according to claim 1, characterized in that The method further includes: When it is monitored that there is an idle cache range in the normal cache range, migrating at least one task cache from the second cache range to the idle cache range, where the idle cache range is a cache range with tasks emptied, and the second cache range is the normal cache range with the most remaining tasks currently.
3. The method according to claim 2, wherein The step of when it is monitored that there is an idle cache range in the normal cache range, migrating at least one task cache from the second cache range to the idle cache range includes: When it is monitored that there is an idle cache range in the normal cache range, sequentially confirming the second cache range, and migrating task caches from the second cache range to the idle cache range one by one until the number of tasks in the idle cache range reaches a preset threshold value, or the number of tasks in all normal cache ranges does not exceed the preset threshold value.
4. The method according to claim 3, wherein When there are multiple second cache ranges, randomly migrating one task cache from one of the second cache ranges to the idle cache range.
5. The method according to claim 1, wherein When there are multiple first cache ranges, randomly caching the latest task into one of the first cache ranges.
6. The method according to claim 1, wherein The lengths of the cache queues corresponding to each execution core are the same.
7. A multi-level task classification processing device for a multi-core Internet of Things system, characterized in that, Including: A status monitoring unit for monitoring the task status in the multi-core Internet of Things system, where each execution core of the multi-core Internet of Things system is respectively assigned a normal cache range, and the normal cache range is a segment of the first-in-first-out cache queue in the multi-core Internet of Things system, and the first-in-first-out cache queue is also provided with a priority cache range; A task cache unit, configured to, when detecting that there is a latest task input, cache the latest task into a first cache range or a priority cache range according to the task priority, so as to be correspondingly allocated to an execution core corresponding to the first cache range or enter a priority allocation state, where the first cache range is the cache range with the longest current remaining cache queue in the normal cache range; A core allocation unit, configured to allocate execution cores into a first type of core and a second type of core according to a preset ratio according to the number of tasks in the priority cache range, where the preset ratio is determined based on the number of tasks with different priorities; A classification processing unit, configured to enable the first type of core to obtain new tasks from the corresponding normal cache range for processing, and enable the second type of core to obtain new tasks from the priority cache range and the corresponding normal cache range in sequence for processing; when the second type of core fails to obtain a task from the priority cache range, it obtains a task from the corresponding normal cache range; when it fails to obtain a task from the corresponding normal cache range, it obtains a task from the priority cache range, and when it fails to obtain tasks from both the corresponding normal cache range and the priority cache range, it enters an idle state until there are new tasks cached in the priority cache range or the corresponding normal cache range.
8. The device according to claim 7, characterized in that, Further included: A task migration unit, configured to, when detecting that there is an idle cache range in the normal cache range, migrate at least one task cache from a second cache range to the idle cache range, so as to be correspondingly allocated to an execution core corresponding to the idle cache range, where the idle cache range is a cache range with tasks emptied, and the second cache range is the normal cache range with the most remaining tasks currently.
9. An Internet of Things system, characterized in that, Including: One or more processors; A memory, configured to store one or more programs; When the one or more programs are executed by the one or more processors, the Internet of Things system implements the multi-level task classification processing method according to any one of claims 1-6.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by a processor, it implements the multi-level task classification processing method according to any one of claims 1-6.
Citation Information
Patent Citations
Task scheduling method and related non-transitory computer readable medium for dispatching task in multi-core processor system based at least partly on distribution of tasks sharing same data and / or accessing same memory address (ES)
CN104995603A
Caching method and device
CN110493145A