Hybrid task cycle deadline assignment method and device

By grouping and allocating periods of tasks to be monitored in the information physics system, the problem that existing systems fail to effectively consider response time is solved, and the system's ability to respond to external changes within a specified time is realized, and the system's reliability and security are improved.

CN114879561BActive Publication Date: 2025-05-06蔡思
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210515803.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-11
Publication Date
2025-05-06
Estimated Expiration
2042-05-11

AI Technical Summary

Technical Problem

When existing systems allocate deadlines and cycles for update tasks and control tasks in the information physics system, they fail to effectively consider the system's response time to changes in the monitored object, resulting in insufficient system in ensuring safety and reliability.

Method used

A hybrid task cycle deadline dispatch method is proposed. By grouping the set of monitoring tasks, the period and deadline of control tasks and update tasks in each group are determined, and the number of update tasks in each group is adjusted to ensure that the system can respond to the state changes of external things within a specified time.

Benefits of technology

Through this method, the system can respond to changes in the state of external things within a specified time, improving the reliability and security of the system, and ensuring the reasonable allocation of update tasks and control tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114879561B_ABST
    Figure CN114879561B_ABST
Patent Text Reader

Abstract

The present invention discloses a hybrid task cycle deadline dispatching method and device, the method comprising: grouping a plurality of tasks to be monitored in a set of tasks to be monitored, determining a plurality of groups, wherein each task to be monitored includes a control task and an update task, wherein the update task corresponding to the data accessed by the same control task is grouped with the same control task; obtaining the number of update tasks in each group; determining the cycle and deadline of the control task in each group according to the number of update tasks in each group; initializing the cycle and deadline of each update task; adjusting the cycle and deadline of each update task according to the number of update tasks in each group; determining the scheduling data of the set of tasks to be monitored according to the cycle and deadline of the control task in each group and the cycle and deadline of each update task. The present application is a system capable of monitoring the state changes of external things, then updating the cycle and deadline of the monitored tasks, and then evaluating whether the adjusted scheduling is executable, thereby improving the reliability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of operating systems, and in particular to a hybrid task cycle deadline dispatching method and device. Background Art

[0002] With the increasing popularity and rapid development of information technology, cyber-physical systems (CPSs) have been widely used in many fields, such as health monitoring, industrial control, and vehicle control. In some practical applications, CPSs need to monitor external objects and respond to each change of each monitored object in a timely manner. For example, a boiler control system needs to monitor the temperature of a high-pressure boiler in real time and close the heating valve within 100ms when the temperature is too high.

[0003] The cyber-physical system needs to monitor external things using a polling method at a fixed period. When the state of the monitored thing changes, the system needs to update the data corresponding to the state of the thing in the database and make corresponding processing according to the new state of the thing. Once the updated data exceeds the threshold, the cyber-physical system performs the corresponding operation. For example, the sewage monitoring system monitors water quality information in real time and periodically updates the water quality information data recorded in the database. Once the water quality data in the database exceeds the threshold, water quality alarm, sewage filtration and other operations are performed.

[0004] The process from the state change of external things to the completion of the corresponding operation of the system is regarded as a complete process. In some scenarios, the system needs to complete the corresponding operation according to the state of the monitored things within a specified time, that is, it is necessary to ensure that the above process can be completed within the specified time. The process of updating the state change of external things to the completion of the corresponding operation of the information-physical system can be divided into two stages: 1) The stage from the change of the state of external things to the update of the corresponding data in the database is called the update stage; 2) The stage from the data update to the completion of the corresponding operation of the system is called the control stage. For example, in an autonomous driving system, once an obstacle is detected ahead, the car control system needs to execute a braking command within 50 milliseconds.

[0005] As can be seen from the above, there are two types of tasks in CPSs: update tasks and control tasks. Update tasks are responsible for monitoring external objects and updating data in the system; control tasks are responsible for reading data from the system and making decisions based on the data obtained. To ensure the safety and reliability of CPSs, the system needs to respond to changes in the monitored objects in a timely manner. Since the response time can be divided into the time required to reflect the change to the system and the time required to make a decision, it is necessary to design an effective method to ensure the reasonable allocation of deadlines and cycles for update tasks and control tasks.

[0006] In existing systems, each state of each monitored object has a valid time interval, and the data recording the state of the monitored object remains valid before the valid time interval of the state expires. However, existing work only focuses on the deadline and deadline allocation of update tasks (such as the detection of an obstacle ahead as mentioned above), but does not consider the system's response time to changes in the monitored object (such as the execution of the brake command as mentioned above). Summary of the invention

[0007] The embodiment of the present application provides a hybrid task cycle deadline dispatching method and device, whose main purpose is to ensure that the system's response to each state change of the monitored object can be completed within the specified time, taking into account the external transaction response time control and system load control, and providing the system with higher reliability.

[0008] To achieve the above object, the present application also provides a hybrid task period deadline assignment method, the method comprising:

[0009] Grouping a plurality of tasks to be monitored in the set of tasks to be monitored to determine a plurality of groups, wherein each task to be monitored includes a control task and an update task, wherein the update task corresponding to the data accessed by the same control task is grouped with the same control task;

[0010] Get the number of update tasks in each group;

[0011] According to the number of update tasks in each group, determine the period and deadline of the control tasks in each group;

[0012] Initialize the cycle and deadline of each update task;

[0013] Adjust the cycle and deadline of each update task according to the number of update tasks in each group;

[0014] The scheduling data of the set of tasks to be monitored is determined according to the period and deadline of the control tasks in each group and the period and deadline of each update task.

[0015] Optionally, the step of grouping a plurality of tasks to be monitored in the set of tasks to be monitored to determine a plurality of groups, wherein each task to be monitored includes a control task and an update task, wherein the update task corresponding to the data accessed by the same control task and the same control task are grouped into one group, including:

[0016] Generate a node corresponding to the control task of each task to be monitored and a node corresponding to the update task of each task to be monitored;

[0017] Traversing the control tasks in the set of tasks to be monitored, connecting the nodes of the update tasks corresponding to the data accessed by the same control task with the nodes corresponding to the same control task, and generating an undirected graph;

[0018] All nodes contained in each connected component of the undirected graph are determined as a group.

[0019] Optionally, determining the period and deadline of the control tasks in each group according to the number of update tasks in each group includes:

[0020] When an update task in group G When the number is one, the update task in group G The worst-case execution time of the update task is equal to The worst-case execution time of and the worst-case execution time of all control tasks in the group satisfy the following formula:

[0021]

[0022] Among them, G is the group, is the update task in G, for The worst case execution time of For the control task in G The worst case execution time of is the sum of the worst-case execution times of all control tasks in the group;

[0023] Make sure that the period of each control task in group G is equal to The period of the control task in group G is equal to deadline.

[0024] Optionally, determining the period and deadline of the control tasks in each group according to the number of update tasks in each group includes:

[0025] When the number of update tasks in a group is greater than one, obtaining each control task in the group, and obtaining a set of data accessed by each control task;

[0026] Obtaining the monitored external object corresponding to each data in the set of data accessed by each control task, and determining a tolerable response delay set corresponding to the monitored external object corresponding to each control task;

[0027] The period and deadline of each control task are determined according to the tolerable response delay set corresponding to the monitored external objects corresponding to each control task.

[0028] Optionally, determining each control task period and deadline according to a tolerable response delay set corresponding to a monitored external object corresponding to each control task includes:

[0029] Determine the monitored external object with the longest tolerable response delay corresponding to each control task, and use half of the tolerable response delay of the monitored external object as the period of each control task;

[0030] The control tasks within the one group are converted into second harmonic tasks, and the period of each control task is determined as a relative deadline of each control task.

[0031] Optionally, the cycle and deadline of initializing each update task include:

[0032] For each update task, determine the tolerable response delay of the object monitored by each update task as the effective time interval of each update task, wherein the effective time interval of each update task is equal to the sum of the period of each update task and the deadline of each update task;

[0033] Based on the effective time interval of each update task, the period and deadline of each update task are initialized.

[0034] Optionally, adjusting the period and deadline of each update task according to the number of update tasks in each group includes:

[0035] When the number of update tasks in one group is one, the worst-case response time of the update tasks in the one group is restored to the original worst-case response time of the update tasks in the one group.

[0036] Optionally, adjusting the period and deadline of each update task according to the number of update tasks in each group includes:

[0037] When the number of update tasks in a group is greater than one, each update task in the group is Indicates that each update task is determined The data that is responsible for updating, and determine the control task with the longest cycle among all control tasks that access this data

[0038] Calculate no less than the update task The deadline is the control task cycle The smallest integer multiple of X, represents the tolerable response delay of the things monitored by each update task;

[0039] If X does not exceed The first preset value of the update task is determined Deadline Satisfy the formula:

[0040] Determine update tasks Cycle Satisfy the formula:

[0041] If X exceeds The first preset value of the update task is determined Deadline Satisfy the formula Determine update tasks Cycle Satisfy the formula

[0042]

[0043] Optionally, determining the scheduling data of the set of tasks to be monitored according to the period and deadline of the control tasks in each group and the period and deadline of each update task includes:

[0044] Determining whether the set of tasks to be monitored is schedulable according to the period and deadline of the control tasks in each group and the period and deadline of each update task;

[0045] If the set of tasks to be monitored is schedulable, based on the first execution condition, an earliest deadline priority scheduling method is executed on the set of tasks to be monitored, and a task scheduling table is determined;

[0046] If the set of tasks to be monitored cannot be scheduled, the period and deadline of the control task in each task to be monitored and the period and deadline of each update task are restored to the values ​​before execution.

[0047] To achieve the above-mentioned purpose, the present application also provides a device, which includes a memory and a processor connected to the memory, and the processor is used to execute a data processing program of a hybrid task stored in the memory. When the data processing program of the hybrid task is executed by the processor, the steps of the hybrid task period deadline dispatching method as described are implemented.

[0048] The hybrid task cycle deadline dispatching method and device proposed in the embodiment of the present application, groups multiple tasks to be monitored in a set of monitored tasks, determines multiple groups, wherein each task to be monitored includes a control task and an update task, wherein the update task corresponding to the data accessed by the same control task is grouped with the same control task; obtains the number of update tasks in each group; determines the cycle and deadline of the control task in each group according to the number of update tasks in each group; initializes the cycle and deadline of each update task; adjusts the cycle and deadline of each update task according to the number of update tasks in each group; determines the scheduling data of the set of tasks to be monitored according to the cycle and deadline of the control task in each group and the cycle and deadline of each update task. The present application is capable of monitoring the state changes of external things, then updating the cycle and deadline of the monitored tasks, and then evaluating whether the adjusted scheduling is executable, thereby improving the reliability of the system. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Figure 1 A flowchart of a hybrid task cycle deadline assignment method provided by an embodiment of the present application;

[0050] Figure 2 A schematic diagram of generating an undirected graph in an application scenario of a water quality monitoring system according to an embodiment of the present application;

[0051] Figure 3 A schematic diagram of the deadline and period after the task is initialized in the application scenario of the water quality monitoring system of one embodiment of the present application;

[0052] Figure 4 A schematic diagram of the deadline and period after updating task allocation in the application scenario of the water quality monitoring system according to one embodiment of the present application;

[0053] Figure 5 A schematic diagram of a task scheduling table in an application scenario of a water quality monitoring system according to an embodiment of the present application;

[0054] Figure 6 A schematic diagram of a device according to an embodiment of the present application;

[0055] Figure 7 It is a schematic diagram of a module of a device according to an embodiment of the present application.

[0056] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0057] It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0058] The present application provides a hybrid task cycle deadline allocation method. Figure 1 FIG. 1 is a flow chart of a hybrid task cycle deadline allocation method provided by an embodiment of the present application. The method can be executed by a device.

[0059] Cyber-physical systems (CPSs) have been widely used in many fields, such as health monitoring, industrial control, and vehicle control. In some practical applications, CPSs need to monitor external objects and respond to each change of each monitored object in a timely manner. For example, a boiler control system needs to monitor the temperature of a high-pressure boiler in real time and close the heating valve within 100ms when the temperature is too high.

[0060] The embodiments of the present application are applicable to cyber-physical systems (CPSs). There are two types of tasks in CPSs: update tasks and control tasks. The update task is responsible for monitoring external objects and updating data in the system; the control task is responsible for reading data from the system and making decisions based on the obtained data. To ensure the safety and reliability of CPSs, the system needs to respond to changes in the monitored objects in a timely manner. Since the response time can be divided into the time required to reflect the change to the system and the time required to make a decision, it is necessary to design an effective method to ensure the reasonable allocation of deadlines and cycles for update tasks and control tasks.

[0061] The data processing method and device for hybrid tasks proposed in the embodiment of the present application, group multiple tasks to be monitored in a set of monitored tasks, determine multiple groups, wherein each task to be monitored includes a control task and an update task, wherein the update task corresponding to the data accessed by the same control task is grouped with the same control task; obtain the number of update tasks in each group; determine the cycle and deadline of the control task in each group according to the number of update tasks in each group; initialize the cycle and deadline of each update task; adjust the cycle and deadline of each update task according to the number of update tasks in each group; determine the scheduling data of the set of tasks to be monitored according to the cycle and deadline of the control task in each group and the cycle and deadline of each update task. The present application is capable of monitoring the state changes of external things, then updating the cycle and deadline of the monitored tasks, and then evaluating whether the adjusted scheduling is executable, thereby improving the reliability of the system.

[0062] In this embodiment, for better description, the following symbols are represented as follows:

[0063] Each update task Can be abstracted as a triple in, is the worst-case running time of the update task, is the relative deadline of the update task, is the period of updating tasks; in cyber-physical systems, each control task Can be abstracted as a four-tuple in, is the worst-case execution time of the control task, is the relative deadline of the control task, is the period of the control task, is a data set consisting of all the data accessed by the task; each update task Responsible for monitoring an external thing o i ; Each monitored external thing o i Both have a tolerable response delay V i Once o i The state of the system changes, the system needs to i time to respond to this change.

[0064] Specifically, in order to better illustrate the application of each step of the present application, the various steps of the following hybrid task cycle deadline dispatching method are applied to a water quality monitoring system to better illustrate the application of each step, but the hybrid task cycle deadline dispatching method is not only applied to water quality monitoring systems, that is, this example cannot be a limitation on the application of the hybrid task cycle deadline dispatching method.

[0065] The application scenario of the water quality monitoring system is introduced as follows: In the water quality monitoring system, the sensor performs water sampling. Once virus A is found in the sample, the water outlet valve needs to be closed within 500 milliseconds; once bacteria B exceeds the standard, the container needs to be sterilized within 2000 milliseconds; once bacteria C exceeds the standard, the container needs to be sterilized within 2000 milliseconds; once the temperature in the container is lower than 15 degrees and the bacteria C content exceeds the standard, the heating device needs to be turned on within 2500 milliseconds. Therefore, there are 4 update tasks and 3 control tasks in this system, and their respective responsibilities are as follows:

[0066] Update Task 1: Control the sensor to periodically sample and analyze the content of A, and update the content of A to the database;

[0067] Update task 2: Control the sensor to periodically sample and analyze the content of B, and update the content of B to the database;

[0068] Update task 3: Control the sensor to periodically sample and analyze the C content, and update the C content to the database;

[0069] Update Task 4: Control the sensor to periodically sample and analyze the container temperature, and update the container temperature to the database;

[0070] Control task 1: Access the database, and once the value corresponding to the A content is greater than 0, close the water outlet valve;

[0071] Control Task 2: Access the database and start the sterilization system once the content of B or C exceeds the standard;

[0072] Control Task 3: Access the database and turn on the heating device once C exceeds the standard and the temperature is too low.

[0073] Assume that the worst-case execution time of the above update tasks and control tasks are 50 milliseconds, 50 milliseconds, 50 milliseconds, 100 milliseconds, 100 milliseconds, 100 milliseconds, and 100 milliseconds respectively.

[0074] In this embodiment, the hybrid task period deadline assignment method includes:

[0075] Step S10, grouping a plurality of tasks to be monitored in the set of tasks to be monitored, and determining a plurality of groups.

[0076] In this embodiment, each task to be monitored includes a control task and an update task, wherein the update task corresponding to the data accessed by the same control task is grouped with the same control task, including:

[0077] Generate a node corresponding to the control task of each task to be monitored and a node corresponding to the update task of each task to be monitored;

[0078] Traversing the control tasks in the set of tasks to be monitored, connecting the nodes of the update tasks corresponding to the data accessed by the same control task with the nodes corresponding to the same control task, and generating an undirected graph;

[0079] All nodes contained in each connected component of the undirected graph are determined as a group.

[0080] Specifically, for each control task and each update task, a node is generated; then all control tasks are traversed, and for each control task Traverse this task The accessed data set for Each data in o j ,connect Corresponding nodes and update tasks The corresponding node; after completing the traversal of all control tasks, count the connected components in the undirected graph, and for each connected component, let all the nodes it contains form a group.

[0081] In the application scenario of the above-mentioned water quality monitoring system, 7 nodes are first generated, corresponding to each task respectively; then, since update task 1 is responsible for updating the content of A in the database, and control task 1 accesses the content of A in the database, the node corresponding to update task 1 is connected to the node corresponding to control task 1. Since update task 2 is responsible for updating the content of B in the database, update task 3 is responsible for updating the content of C in the database, and control task 2 accesses the contents of B and C in the database, the node corresponding to update task 2 is connected to the node corresponding to control task 2, and the node corresponding to update task 3 is connected to the node corresponding to control task 2. Since update task 3 is responsible for updating the content of C in the database, update task 4 is responsible for updating the temperature data in the database, and control task 3 accesses the content and temperature data of C in the database, the node corresponding to update task 3 is connected to the node corresponding to control task 3, and the node corresponding to update task 4 is connected to the node corresponding to control task 3. Finally, a wireless graph structure is obtained, as shown in the following figure. Figure 2 shown.

[0082] because Figure 2 The graph structure in has two connected components, so the task set is divided into two groups. The first group contains two nodes: update task 1 and control task 1, and the second group contains five nodes: update task 2, update task 3, update task 4, control task 2, and control task 3.

[0083] From the characteristics of this step in the above embodiment, it can be seen that the data accessed by each control task are associated. When a certain data is changed, the subsequent control tasks associated with the data can respond to the change, thereby responding to each change of each monitored object in a timely manner, thereby improving the reliability of the system.

[0084] Step S20: Obtain the number of update tasks in each group.

[0085] In this embodiment, each group is traversed, and the number of update tasks in each group is calculated. Subsequently, the period and deadline of the control task in each group and the period and deadline of each update task are determined according to the number of update tasks in each group.

[0086] Step S30: Determine the period and deadline of the control tasks in each group according to the number of update tasks in each group.

[0087] In this embodiment, when an update task in a group G When the number is one, the update task in group G The worst-case execution time of the update task is equal to The worst-case execution time of and the worst-case execution time of all control tasks in the group satisfy the following formula:

[0088]

[0089] Among them, G is the group, is the update task in G, for The worst case execution time of For the control task in G The worst case execution time of is the sum of the worst-case execution times of all control tasks in the group;

[0090] Make sure that the period of each control task in group G is equal to The period of the control task in group G is equal to deadline.

[0091] When the number of update tasks in a group is greater than one, obtaining each control task in the group, and obtaining a set of data accessed by each control task;

[0092] Obtaining the monitored external object corresponding to each data in the set of data accessed by each control task, and determining a tolerable response delay set corresponding to the monitored external object corresponding to each control task;

[0093] The period and deadline of each control task are determined according to the tolerable response delay set corresponding to the monitored external objects corresponding to each control task.

[0094] Specifically, determining each control task cycle and deadline according to a tolerable response delay set corresponding to a monitored external object corresponding to each control task includes:

[0095] Determine the monitored external object with the longest tolerable response delay corresponding to each control task, and use half of the tolerable response delay of the monitored external object as the period of each control task;

[0096] The control tasks within the one group are converted into second harmonic tasks, and the period of each control task is determined as a relative deadline of each control task.

[0097] In some embodiments, the control tasks within the group may be converted into second harmonic tasks using existing technologies, and the present application does not impose any limitation on this method.

[0098] In the application scenario of the above-mentioned water quality monitoring system, the number of update tasks in each group is calculated, and the number of update tasks in the first group is 1, and the number of update tasks in the second group is 3; since the worst-case execution time of update task 1 is 50 milliseconds, and the worst-case execution time of control task 1 is 100 milliseconds, the worst-case execution time assigned to update task 1 is set to 50+100=150 milliseconds. Since the full set of access data of control task 2 is {B content, C content}, the corresponding set of monitored external objects is {B, C}, the tolerable response delay of B is 2000 milliseconds, and the tolerable response delay of C is 2000 milliseconds. Therefore, the tolerable response delay of C of 2000 milliseconds is the longest tolerable response delay corresponding to control task 2, and the cycle of control task 2 is set to 2000 / 2=1000 milliseconds; since the set of monitored external objects corresponding to control task 3 is {C, temperature}, the tolerable response delay of C is 2000 milliseconds, the tolerable response delay of temperature is 2500 milliseconds. Therefore, the tolerable response delay of temperature of 2500 milliseconds is the longest tolerable response delay corresponding to control task 3. The period of control task 3 is set to 2500 / 2=1250 milliseconds. Finally, the Sr method is used to convert the task set {control task 2, control task 3} into a second harmonic task set. After the conversion, the periods of control task 2 and control task 3 are both 1000 milliseconds, and the deadlines of control task 2 and control task 3 are both equal to 1000 milliseconds.

[0099] In this step, the monitored external object has a tolerable response delay. After the state of any monitored external object changes, the embodiment of the present application can update the cycle and deadline of the control task according to the tolerable response delay of the monitored external object, so as to complete the response to this state change event within the tolerable response delay of the object.

[0100] Step S40: Initialize the period and deadline of each update task.

[0101] In this embodiment, the cycle and deadline for initializing each update task include:

[0102] For each update task, determine the tolerable response delay of the object monitored by each update task as the effective time interval of each update task, wherein the effective time interval of each update task is equal to the sum of the period of each update task and the deadline of each update task;

[0103] Based on the effective time interval of each update task, the period and deadline of each update task are initialized.

[0104] Specifically, first, for each update task Let its validity interval (i.e., the sum of the period and the deadline) be Equal to the tolerable response delay V of the thing it monitors i ,Right now, Then, the existing MDC method is executed to update the task cycle and deadline allocation.

[0105] In the application scenario of the water quality monitoring system, since the tolerable response delay of A is 500 milliseconds, the tolerable response delay of B is 2000 milliseconds, the tolerable response delay of C is 2000 milliseconds, and the tolerable response delay of temperature is 2500 milliseconds, the sum of the period and deadline of update task 1, update task 2, update task 3, and update task 4 is set to be 500 milliseconds, 2000 milliseconds, 2000 milliseconds, and 2500 milliseconds, respectively. The existing MDC method is used to assign deadlines and periods to all update tasks, and the distribution results are as follows: Figure 3 shown.

[0106] In the present embodiment, the monitored external object has a tolerable response delay. The present application can determine the tolerable response delay of the object monitored by each update task as the effective time interval of each update task after the state of any monitored external object changes, and initialize the cycle and deadline of each update task based on the effective time interval of each update task, so as to complete the response to this state change event within the tolerable response delay of the object.

[0107] Step S50: adjusting the period and deadline of each update task according to the number of update tasks in each group.

[0108] In this embodiment, when the number of update tasks in one group is one, the worst-case response time of the update tasks in the one group is restored to the original worst-case response time of the update tasks in the one group.

[0109] When the number of update tasks in a group is greater than one, each update task in the group is Indicates that each update task is determined The data that is responsible for updating, and determine the control task with the longest cycle among all control tasks that access this data

[0110] Calculate no less than the update task The deadline is the control task cycle The smallest integer multiple of X, represents the tolerable response delay of the things monitored by each update task;

[0111] If X does not exceed The first preset value of the update task is determined Deadline Satisfy the formula:

[0112] Determine update tasks Cycle Satisfy the formula:

[0113] If X exceeds The first preset value of the update task is determined Deadline Satisfy the formula Determine update tasks Cycle Satisfy the formula

[0114]

[0115] In this embodiment, the monitored external objects have a tolerable response delay. The present application can adjust the period and deadline of each update task according to the tolerable response of the object monitored by each update task after the state of any monitored external object changes, thereby completing the response to this state change event within the tolerable response delay of the object.

[0116] In the application scenario of the above-mentioned water quality monitoring system, since there is only one update task (i.e., update task 1) in the first group, the worst-case execution time of update task 1 is restored to 50 milliseconds, and the deadline of the control task in the group (i.e., control task 1) is set to 150 milliseconds and the period is set to 350 milliseconds.

[0117] Since the deadline of update task 2 is 200 milliseconds, the longest task cycle in the corresponding control task set {control task 2} is 1000 milliseconds, the minimum value that is not less than 200 and is an integer multiple of 1000 is 1000, and 1000 is not greater than 2000 / 2, therefore, the deadline of update task 2 is set to 1000, and the cycle is set to (2000-1000) / 1000 rounded down and multiplied by 1000, that is, 1000; since the deadline of update task 3 is 250 milliseconds, the longest task cycle in the corresponding control task set {control task 2, control task 3} is 1000 milliseconds, the minimum value that is not less than 250 and is an integer multiple of 1000 is 1000, and 1000 is not greater than 2000 / 2, therefore, the deadline of update task 3 is set to 1 000, and the cycle is set to (2000-1000) / 1000, rounded down and multiplied by 1000, that is, 1000; since the deadline of update task 4 is 350 milliseconds, the longest task cycle in the corresponding control task set {control task 3} is 1000 milliseconds, the minimum value that is not less than 350 and is an integer multiple of 1000 is 1000, and 1000 is not greater than 2500 / 2, therefore, the deadline of update task 3 is set to 1000, and the cycle is set to (2000-1000) / 1000, rounded down and multiplied by 1000, that is, 1000; at this point, the allocation of update task cycles and deadlines is completed, the deadlines of update task 1 cycle are 150 milliseconds and 350 milliseconds respectively, and the deadlines and cycles of the remaining update tasks are all 1000 milliseconds.

[0118] Step S60: Determine the scheduling data of the set of tasks to be monitored according to the period and deadline of the control tasks in each group and the period and deadline of each update task.

[0119] Determining the scheduling data of the set of tasks to be monitored according to the period and deadline of the control tasks in each group and the period and deadline of each update task includes:

[0120] Determining whether the set of tasks to be monitored is schedulable according to the period and deadline of the control tasks in each group and the period and deadline of each update task;

[0121] If the set of tasks to be monitored is schedulable, based on the first execution condition, an earliest deadline priority scheduling method is executed on the set of tasks to be monitored, and a task scheduling table is determined;

[0122] If the set of tasks to be monitored cannot be scheduled, the period and deadline of the control task in each task to be monitored and the period and deadline of each update task are restored to the values ​​before execution.

[0123] In the application scenario of the water quality monitoring system mentioned above, the schedulability of the set of tasks to be monitored is evaluated. If the test result is "schedulable", all the tasks to be monitored can be served. Based on the premise that "when the absolute deadline of the update task is the same as the absolute deadline of the control task, the update task is executed first", the earliest deadline priority method is used to select the set of tasks to be monitored and obtain the task scheduling table. The task scheduling table is as follows: Figure 5 As shown, each cell represents 50 milliseconds. The schedule length is 7000 milliseconds, and the system repeatedly executes tasks according to the schedule with a period of 7000 milliseconds.

[0124] The hybrid task cycle deadline dispatching method and device proposed in the embodiment of the present application, groups multiple tasks to be monitored in a set of monitored tasks, determines multiple groups, wherein each task to be monitored includes a control task and an update task, wherein the update task corresponding to the data accessed by the same control task is grouped with the same control task; obtains the number of update tasks in each group; determines the cycle and deadline of the control task in each group according to the number of update tasks in each group; initializes the cycle and deadline of each update task; adjusts the cycle and deadline of each update task according to the number of update tasks in each group; determines the scheduling data of the set of tasks to be monitored according to the cycle and deadline of the control task in each group and the cycle and deadline of each update task. The present application is capable of monitoring the state changes of external things, then updating the cycle and deadline of the monitored tasks, and then evaluating whether the adjusted scheduling is executable, thereby improving the reliability of the system.

[0125] The present application also provides a data processing device for mixed tasks. Figure 6 , which is a schematic diagram of the internal structure of a data processing device for hybrid tasks provided in one embodiment of the present application.

[0126] In this embodiment, the data processing device 1 of the mixed task can be a PC (Personal Computer), or a terminal device such as a smart phone, a tablet computer, a portable computer, a processing device, a vehicle device, a computing device, etc. The data processing device 1 of the mixed task at least includes a memory 11, a processor 12, a network interface 13 and a communication bus 14.

[0127] The memory 11 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 11 can be an internal storage unit of the data processing device 1 of the hybrid task, such as the hard disk of the data processing device 1 of the hybrid task. In other embodiments, the memory 11 can also be an external storage device of the data processing device 1 of the hybrid task, such as a plug-in hard disk equipped on the data processing device 1 of the hybrid task, a smart memory card (SmartMedia Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. Further, the memory 11 can also include both an internal storage unit and an external storage device of the data processing device 1 of the hybrid task. The memory 11 can not only be used to store application software and various types of data installed in the data processing device 1 of the hybrid task, such as the code of the data processing program 200 of the hybrid task, but also can be used to temporarily store data that has been output or is to be output.

[0128] In some embodiments, the processor 12 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor or other data processing chip, used to run program codes stored in the memory 11 or process data, such as a data processing program 200 that performs mixed tasks.

[0129] The network interface 13 may optionally include a standard wired interface, a wireless interface (such as a WI-FI interface), and is usually used to establish a communication connection between the hybrid task data processing device 1 and other electronic devices.

[0130] The communication bus 14 is used to realize the connection and communication between these components.

[0131] Optionally, the data processing device 1 for the hybrid task may further include a user interface, which may include a display (Display), an input unit such as a keyboard (Keyboard), and the optional user interface may also include a standard wired interface and a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, and an OLED (Organic Light-Emitting Diode) touch device, etc. The display may also be appropriately referred to as a display screen or a display unit, which is used to display information processed in the data processing device 1 for the hybrid task and to display a visual user interface.

[0132] Figure 6Only the mixed task data processing device 1 having the components 11-14 and the mixed task data processing program 200 is shown. It can be understood by those skilled in the art that Figure 6 The structure shown does not constitute a limitation on the mixed-task data processing device 1 , and may include fewer or more components than shown in the figure, or combine some components, or arrange the components differently.

[0133] exist Figure 6 In the embodiment of the data processing device 1 for the hybrid task shown, the memory 11 stores a data processing program 200 for the hybrid task; when the processor 12 executes the data processing program 200 for the hybrid task stored in the memory 11, the following steps are implemented:

[0134] Grouping a plurality of tasks to be monitored in the set of tasks to be monitored to determine a plurality of groups, wherein each task to be monitored includes a control task and an update task, wherein the update task corresponding to the data accessed by the same control task is grouped with the same control task;

[0135] Get the number of update tasks in each group;

[0136] According to the number of update tasks in each group, determine the period and deadline of the control tasks in each group;

[0137] Initialize the cycle and deadline of each update task;

[0138] Adjust the cycle and deadline of each update task according to the number of update tasks in each group;

[0139] The scheduling data of the set of tasks to be monitored is determined according to the period and deadline of the control tasks in each group and the period and deadline of each update task.

[0140] The above steps have been described in detail in the embodiment of the hybrid task cycle deadline dispatching method and will not be repeated here. The hybrid task cycle deadline dispatching method and device proposed in the embodiment of the present application group multiple tasks to be monitored in the monitoring task set, determine multiple groups, wherein each task to be monitored includes a control task and an update task, wherein the update task corresponding to the data accessed by the same control task is grouped with the same control task; obtain the number of update tasks in each group; determine the cycle and deadline of the control task in each group according to the number of update tasks in each group; initialize the cycle and deadline of each update task; adjust the cycle and deadline of each update task according to the number of update tasks in each group; determine the scheduling data of the task set to be monitored according to the cycle and deadline of the control task in each group and the cycle and deadline of each update task. The present application can monitor the state changes of external things, then update the cycle and deadline of the monitored tasks, and then evaluate whether the adjusted scheduling is executable, thereby improving the reliability of the system.

[0141] Optionally, in other embodiments, the data processing program 200 of the hybrid task can also be divided into one or more modules, one or more modules are stored in the memory 11, and are executed by one or more processors (processor 12 in this embodiment) to complete the present application. The module referred to in the present application refers to a series of computer program instruction segments that can perform specific functions, which are used to describe the execution process of the data processing program of the hybrid task in the data processing device of the hybrid task.

[0142] For example, refer to Figure 7 FIG. 1 is a schematic diagram of a program module of a data processing program for a mixed task in an embodiment of a data processing device for a mixed task of the present application. In this embodiment, the data processing program 200 for a mixed task can be divided into, for example:

[0143] The grouping module 10 is used to group a plurality of tasks to be monitored in the set of tasks to be monitored, and determine a plurality of groups, wherein each task to be monitored includes a control task and an update task, wherein the update task corresponding to the data accessed by the same control task is grouped with the same control task;

[0144] The acquisition module 20 is used to obtain the number of update tasks in each group;

[0145] The determination module 30 is used to determine the period and deadline of the control tasks in each group according to the number of update tasks in each group;

[0146] The initialization module 40 is used to initialize the period and deadline of each update task;

[0147] The adjustment module 50 is used to adjust the period and deadline of each update task according to the number of update tasks in each group;

[0148] The determination module 30 is further configured to determine the scheduling data of the set of tasks to be monitored according to the period and deadline of the control tasks in each group and the period and deadline of each update task.

[0149] The functions or operation steps implemented when the above program modules are executed are substantially the same as those in the above embodiments and will not be described in detail here.

[0150] In addition, the embodiment of the present application further proposes a computer-readable storage medium, on which a data processing program for a hybrid task is stored. The data processing program for the hybrid task can be executed by one or more processors to implement the following operations:

[0151] Grouping a plurality of tasks to be monitored in the set of tasks to be monitored to determine a plurality of groups, wherein each task to be monitored includes a control task and an update task, wherein the update task corresponding to the data accessed by the same control task is grouped with the same control task;

[0152] Get the number of update tasks in each group;

[0153] According to the number of update tasks in each group, determine the period and deadline of the control tasks in each group;

[0154] Initialize the cycle and deadline of each update task;

[0155] Adjust the cycle and deadline of each update task according to the number of update tasks in each group;

[0156] The scheduling data of the set of tasks to be monitored is determined according to the period and deadline of the control tasks in each group and the period and deadline of each update task.

[0157] The specific implementation of the computer-readable storage medium of the present application is basically the same as the various embodiments of the data processing device and method for the above-mentioned mixed tasks, and will not be repeated here.

[0158] It should be noted that the serial numbers of the embodiments of the present application are only for description and do not represent the advantages and disadvantages of the embodiments. And the terms "including", "comprising" or any other variants thereof herein are intended to cover non-exclusive inclusion, so that the process, device, article or method including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, device, article or method. In the absence of further restrictions, the elements defined by the sentence "including one..." do not exclude the presence of other identical elements in the process, device, article or method including the element.

[0159] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.

[0160] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.

Claims

1. A hybrid task period deadline assignment method, characterized in that: The method comprises: Grouping a plurality of tasks to be monitored in the set of tasks to be monitored to determine a plurality of groups, wherein each task to be monitored includes a control task and an update task, wherein the update task corresponding to the data accessed by the same control task is grouped with the same control task; Get the number of update tasks in each group; According to the number of update tasks in each group, determine the period and deadline of the control tasks in each group; Initialize the cycle and deadline of each update task; Adjust the cycle and deadline of each update task according to the number of update tasks in each group; The scheduling data of the set of tasks to be monitored is determined according to the period and deadline of the control tasks in each group and the period and deadline of each update task.

2. The hybrid task period deadline assignment method according to claim 1, characterized in that: The method further comprises: grouping a plurality of tasks to be monitored in the set of tasks to be monitored, determining a plurality of groups, wherein each task to be monitored includes a control task and an update task, wherein the update task corresponding to the data accessed by the same control task and the same control task are grouped into one group, including: Generate a node corresponding to the control task of each task to be monitored and a node corresponding to the update task of each task to be monitored; Traversing the control tasks in the set of tasks to be monitored, connecting the nodes of the update tasks corresponding to the data accessed by the same control task with the nodes corresponding to the same control task, and generating an undirected graph; All nodes contained in each connected component of the undirected graph are determined as a group.

3. The hybrid task period deadline assignment method according to claim 1, characterized in that: Determining the period and deadline of the control tasks in each group according to the number of update tasks in each group includes: When an update task in group G When the number is one, the update task in group G The worst-case execution time of the update task is equal to The worst-case execution time of and the worst-case execution time of all control tasks in the group satisfy the following formula: Among them, G is the group, is the update task in G, for The worst case execution time of For the control task in G The worst case execution time of is the sum of the worst-case execution times of all control tasks in the group; Make sure that the period of each control task in group G is equal to The period of the control task in group G is equal to deadline.

4. The hybrid task period deadline assignment method according to claim 1, characterized in that: Determining the period and deadline of the control tasks in each group according to the number of update tasks in each group includes: When the number of update tasks in a group is greater than one, obtaining each control task in the group, and obtaining a set of data accessed by each control task; Obtaining the monitored external object corresponding to each data in the set of data accessed by each control task, and determining a tolerable response delay set corresponding to the monitored external object corresponding to each control task; The period and deadline of each control task are determined according to the tolerable response delay set corresponding to the monitored external objects corresponding to each control task.

5. The hybrid task period deadline assignment method according to claim 4, characterized in that: Determining each control task cycle and deadline according to a tolerable response delay set corresponding to a monitored external object corresponding to each control task includes: Determine the monitored external object with the longest tolerable response delay corresponding to each control task, and use half of the tolerable response delay of the monitored external object as the period of each control task; The control tasks within the one group are converted into second harmonic tasks, and the period of each control task is determined as a relative deadline of each control task.

6. The hybrid task period deadline assignment method according to claim 1, characterized in that: The cycle and deadline of initializing each update task include: For each update task, determine the tolerable response delay of the object monitored by each update task as the effective time interval of each update task, wherein the effective time interval of each update task is equal to the sum of the period of each update task and the deadline of each update task; Based on the effective time interval of each update task, the period and deadline of each update task are initialized.

7. The hybrid task period deadline assignment method according to claim 1, characterized in that: The step of adjusting the period and deadline of each update task according to the number of update tasks in each group includes: When the number of update tasks in one group is one, the worst-case response time of the update tasks in the one group is restored to the original worst-case response time of the update tasks in the one group.

8. The hybrid task period deadline dispatching method as claimed in claim 1, characterized in that: The step of adjusting the period and deadline of each update task according to the number of update tasks in each group includes: When the number of update tasks in a group is greater than one, each update task in the group is Indicates that each update task is determined The data that is responsible for updating, and determine the control task with the longest cycle among all control tasks that access this data Calculate no less than the update task The deadline is the control task cycle The smallest integer multiple of X, represents the tolerable response delay of the things monitored by each update task; If X does not exceed The first preset value of the update task is determined Deadline Satisfy the formula: Determine update tasks Cycle Satisfy the formula: If X exceeds The first preset value of the update task is determined Deadline Satisfy the formula Determine update tasks Cycle Satisfy the formula 9. The hybrid task period deadline assignment method according to claim 1, characterized in that: Determining the scheduling data of the set of tasks to be monitored according to the period and deadline of the control tasks in each group and the period and deadline of each update task includes: Determining whether the set of tasks to be monitored is schedulable according to the period and deadline of the control tasks in each group and the period and deadline of each update task; If the set of tasks to be monitored is schedulable, based on the first execution condition, an earliest deadline priority scheduling method is executed on the set of tasks to be monitored, and a task scheduling table is determined; If the set of tasks to be monitored cannot be scheduled, the period and deadline of the control task in each task to be monitored and the period and deadline of each update task are restored to the values ​​before execution.

10. A device, characterized in that: The device includes a memory and a processor connected to the memory, the processor is used to execute a data processing program of a hybrid task stored in the memory, and when the data processing program of the hybrid task is executed by the processor, the steps of the hybrid task period deadline dispatching method as described in any one of claims 1 to 9 are implemented.

Citation Information

Patent Citations

  • Real-time task scheduling method in multi-agent platform

    CN106155781A

  • System and design method for job task maintenance

    CN107193659A