A soft real-time periodic task delay calculation method based on extended vector model

By using the extended vector model in a multi-core system, the problem of the inaccurate calculation of the delay time of low-priority tasks in soft real-time systems is solved, and the accurate prediction of task completion time and delay is achieved, which improves the research value of system performance evaluation and scheduling algorithms.

CN112882811BActive Publication Date: 2025-04-25XIAN TECH UNIV
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202110256099.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-03-09
Publication Date
2025-04-25
Estimated Expiration
2041-03-09

AI Technical Summary

Technical Problem

In a multi-core architecture, when two or more real-time periodic tasks in a soft real-time system are assigned to the same processor, the delay time caused by preemption cannot be accurately calculated.

Method used

Using an extended vector model method, the periodic tasks with implicit time limits are converted into an initial vector model, and by calculating the migration ratio of the migration task, it is converted into an extended vector to accurately calculate the completion time and delay time of low-priority tasks.

Benefits of technology

The accurate prediction of the completion time and delay time of each execution of low-priority tasks is achieved, providing a theoretical basis for the performance evaluation of soft real-time systems and the performance evaluation of scheduling algorithms.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112882811B_ABST
    Figure CN112882811B_ABST
Patent Text Reader

Abstract

The present invention relates to a soft real-time periodic task delay calculation method based on an extended vector model. The method is for two or more independent real-time periodic tasks with implicit time limits scheduled on the same processor. First, the periodic task model with implicit time limits is converted into an initial vector model, and then the migration ratio of the migration task is calculated. The migration task is then converted into an extended vector. According to the content of the extended vector, the completion time and delay time of each execution of the low-priority task are accurately calculated. The present invention provides relevant theorem proofs, calculation formulas and examples, and can accurately calculate the completion time and delay time of each execution of the low-priority task, providing theoretical support for scheduling algorithm analysis.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of embedded system multi-core, and relates to a performance evaluation study in a soft real-time task scheduling process under an embedded multi-core platform. Background Art

[0002] In the current scheduling methods based on multi-core architecture, the scheduling algorithms for independent real-time periodic tasks are roughly divided into two categories: global scheduling algorithms and task partitioning scheduling algorithms. A typical global scheduling algorithm is GEDF (Global Earliest Deadline First Scheduling). The advantage of this algorithm is high core utilization, but the disadvantage is that thread migration is required to achieve load balancing, and the migration overhead is very high. A typical task partitioning scheduling algorithm is PEDF (Partitioned Earliest Deadline First Scheduling). The advantage of this algorithm is that it can achieve load balancing, but it makes the core utilization rate low. Therefore, many scholars combined the advantages of the two algorithms and proposed a semi-partitioned scheduling algorithm (Semi-Partitioned Scheduling), such as the EDF-os (Earliest Deadline First-based Optimal Semi-partitioned) algorithm. The overall idea of ​​this type of algorithm is to divide the scheduling algorithm into two parts: the offline partitioning stage and the scheduling execution stage. In the offline partitioning stage, tasks are divided into fixed tasks and splitting tasks. Most tasks are fixed tasks, which are assigned to one of the processors and cannot be migrated. Some other small tasks are assigned to different processors according to a certain ratio, which are called splitting tasks. During the scheduling execution stage, the migrated tasks can be migrated between different processors according to the set ratio. The semi-partitioning scheduling algorithm is superior to the simple task partitioning and global scheduling algorithms in theory and practical applications. However, when two or more independent real-time periodic tasks are assigned to the same processor, how to accurately calculate the delay time of each task execution caused by the preemption of the low-priority task is a more difficult problem. At present, most scholars give a maximum delay range in the partitioning algorithm theory, or derive the maximum delay theoretically based on the assumption of the existing delay, but cannot accurately give the completion time and corresponding delay of each execution of the low-priority task in theory. Summary of the invention

[0003] The present invention provides a soft real-time periodic task delay calculation method based on an extended vector model, which solves the problem in the prior art that when two or more real-time periodic tasks with implicit time limits are assigned to the same processor in a soft real-time system, the delay time caused by the low priority task due to preemption cannot be determined.

[0004] In order to achieve the above object, the technical solution of the present invention is as follows:

[0005] A method for calculating the delay of a soft real-time periodic task based on an extended vector model is characterized in that, for two or more independent real-time periodic tasks with implicit deadlines scheduled on the same processor, the periodic task model with implicit deadlines is first converted into an initial vector model, then the migration ratio of the migration task is calculated, and the migration task is converted into an extended vector again. According to the content of the extended vector, the completion time and delay time of each execution of the low-priority task are accurately calculated.

[0006] Further, the method specifically includes the following steps:

[0007] Step 1: Select an already allocated processor and convert the implicit time-limited cycle model allocated on the processor into an initial vector model;

[0008] Step 2: According to the partition scheduling algorithm, the allocation share of the high-priority tasks allocated to the processor and the proportion of the job execution are calculated;

[0009] Step 3: According to step 2, the initial vectors of all high-priority tasks are converted into extended vector models according to the proportion of job allocation;

[0010] Step 4: If there are only two tasks on the same processor, go directly to step 5; otherwise, merge the extension vectors of the high-priority tasks into one extension vector.

[0011] Step 5. Determine whether it is a discrete task model or a general periodic task model with implicit time limit based on the extended vector model of step 4. If it is a discrete task model, calculate the completion time and delay time of the low-priority task according to the discrete delay calculation method. Otherwise, calculate according to the general delay calculation method with implicit time limit. If the system processor has not completed the processing, go to step 1.

[0012] Furthermore, in step 1, the conversion into the initial vector model specifically includes the following steps:

[0013] Step 101: firstly assign tasks to different processors according to a certain divided scheduling algorithm;

[0014] Step 102: Select one of the processors and write the allocated real-time periodic task τ(e, p) with implicit time limit into a p-dimensional vector, where the values ​​of e consecutive elements starting from the first element are all 1, and the rest are all 0.

[0015] Furthermore, in step 2, the partition share s of the high priority task is calculated i,j And the proportion of Job f i,j , specifically including the following steps:

[0016] Step 201: For a high priority task τ on a processor j , the partition share running on the processor is calculated as the utilization share of the processor except for the low-priority tasks, using To calculate, where u i For low-priority tasks assigned to the processor, if the utilization factor of the high-priority task τ j ≥U, then s i,j =U; if τ j <U, then s i,j =τ j ;

[0017] Step 202: According to f i,j =s i,j / u i The formula is used to calculate the distribution ratio of Job.

[0018] Furthermore, in step 3, the initial vector is allocated according to the proportion f of the job i,j Converting to an extended vector model includes the following steps:

[0019] Step 301: f i,j Into the simplest form, recorded as f i,j =a / b, then the initial vector of τ(e, p) of the periodic task is converted into the initial vector of τ′(e×a, p×b);

[0020] Step 302: According to the characteristics of the scheduling algorithm, if the kth job assigned to the task runs on the processor, the starting position of 1 of the initial vector of τ′(e×a, p×b) is relocated to the position of the kth job;

[0021] Step 303: reposition all jobs assigned to the processor according to p×b cycles, and set all element values ​​in other cycles that are not assigned to a job to be 0, which is an extended vector model.

[0022] Furthermore, in step 4, merging the extended vectors specifically includes the following steps:

[0023] Step 401, first find the least common multiple m of the extended vector periods of different high priority tasks;

[0024] Step 402: Expand the high-priority expansion vector again according to m, and then perform addition operation on the corresponding elements; the result after the operation should still be an element of 0 or 1.

[0025] Furthermore, in step 5, selecting different calculation formulas specifically includes the following steps:

[0026] Step 501: According to whether the extended vector of the high priority task has the same properties as the initial vector, i.e., starting from the first position, it is 1, and the positions of the subsequent values ​​of 1 are always continuous, and the positions of the subsequent values ​​of 0 are also continuous, it can be determined that the extended vector is equivalent to a general periodic task with an implicit time limit, i.e., the number of 1s in the extended vector is e1, and the vector dimension is p1 for calculation; in this case, the implicit time limit task delay method is directly used for calculation; if the position of 1 is not continuous, it is determined to be a discrete periodic task, and the discrete task delay method is used for calculation;

[0027] Step 502: If Theorem 1 is used to calculate the delay of a certain execution of a low-priority task, the completion time, absolute deadline, postponement time and delay time of the job are directly calculated according to e1 and p1 in the above steps and the implicit deadline cycle model (e2, p2) of the low-priority task;

[0028] Step 503: If Theorem 2 is used to calculate the delay of a low-priority task execution, the discrete periodic task model of the above extended vector must be written according to Definition 3. According to the positions of all 0s in the above steps, and the implicit time limit cycle model (e2, p2) of the low-priority task, the cycle remainder q of the job execution is calculated first. j value, and then calculate the completion time, absolute deadline, postponement time and delay time.

[0029] Compared with the prior art, the present invention has the following beneficial effects:

[0030] 1. The present invention can predict in advance the time nodes and delays of each completion of a low-priority task of a soft real-time periodic task, and provide a strong theoretical basis for ensuring the execution of safety-critical tasks and analyzing the performance in the scheduling process. This is of great significance for further studying the performance evaluation method of embedded multi-core scheduling algorithms, and will have broad application prospects and important value in the field of automatic control and safety of embedded multi-core devices.

[0031] 2. Based on the characteristics of offline task allocation of the partition scheduling algorithm in soft real-time systems, the present invention proposes a theoretical calculation method for accurately calculating the completion time and delay time of each low-priority task after execution using an extended vector model, providing a reasonable theoretical basis for the performance analysis of multi-core scheduling algorithms and system efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] Figure 1 It is the allocation situation of the offline phase of the EDF-os algorithm example of the present invention;

[0033] Figure 2 This is the scheduling situation of the online execution phase of the EDF-os algorithm of the present invention. DETAILED DESCRIPTION

[0034] The present invention is described in detail below with reference to the accompanying drawings and specific embodiments.

[0035] Part I: Description of the complete steps of the method of the present invention

[0036] The present invention is a method for accurately calculating the completion time and delay time of each execution of a low-priority task using a vector model when two or more independent soft real-time periodic tasks with implicit time limits are assigned to the same processor for scheduling. First, it is necessary to determine three important properties of the real-time periodic tasks with implicit time limits in the soft real-time system - the release time r, the period p and the worst execution time e. The period is also a relative time limit, denoted as τ(r, e, p). If r is released from time 0, it is denoted as τ(e, p). The present invention discusses the latter.

[0037] For a soft real-time system with n real-time periodic tasks τ = {τ1, τ2, τ3..., τ n}, where the i-th task τ i (e i , p i ), and its utilization factor is denoted as u i =e i / p i , every cycle time is called a job, and the j-th job execution of the task is recorded as τ i,j , the time when the jth Job is completed is recorded as End(τ i,j ), the absolute deadline of the jth Job task is Deadline(τ i,j )=p i ×j, the time from the jth job to the absolute deadline is recorded as Lateness (τ i,j )=End(τ i,j )-Deadline(τ i,j), the delay time after the jth job is completed is recorded as Lateness (τ i,j )=max{0,Lateness(τ i,j )}.

[0038] Definition 1. For any real-time periodic task τ(e, p) with an implicit deadline, it can be uniquely matched to a p-dimensional vector, in which the values ​​of e consecutive elements starting from the first element are all 1, and the remaining pe consecutive elements are all 0. For example, τ(3, 5) can be matched to a 5-dimensional vector [1, 1, 1, 0, 0]. This vector is called the original vector of task τ, denoted by I(τ).

[0039] Definition 2. Given an integer value M>N greater than N, we can expand I(τ) into an M-dimensional vector by cyclically repeating all the elements in I(τ), where M should be an integer multiple of N, and record it as the expansion vector E of the original matrix M (τ).

[0040] Theorem 1. If two real-time periodic tasks τ1(e1, p1) and τ2(e2, p2) with implicit deadlines are scheduled to the same processor, and it is known that τ1 takes precedence over τ2, then

[0041]

[0042] Proof: Because τ1 and τ2 are scheduled on the same processor at the same time and τ1 is prioritized to execute the corresponding time unit, τ2 must be executed in the idle time unit of τ1, and the total number of execution time units required in the i jobs of τ2 is i×e2. The number of idle time units in each cycle of τ1 is p1-e1, so the i jobs of τ2 need to be executed to complete τ1 period, then The number of idle time units in a period τ1 is indivual, The total time unit of a cycle is Then the completion time of the i-th job of τ2 is

[0043]

[0044] Corresponding

[0045]

[0046] By Tardiness(τ 2,i )=max{0,Lateness(τ 2,i )} is proved.

[0047] Definition 3. For a real-time periodic task τ1(e1, p1), if the execution time unit of τ1 is not continuous, that is, the execution time unit of e1 is scattered in the p1 period, then τ1 is called a discrete real-time periodic task. or in is called a discrete point set, i.e., θ1, θ2, θ3, …θ k They are respectively the positions of the execution time unit in the first Job of τ1, called discrete point positions. The set is the location set of τ1 idle time units, that is, the location set of non-discrete points.

[0048] For example: τ1 is a discrete real-time periodic task, and the two execution time units in τ1 are executed at times 1 and 7 respectively. Then I(τ1) = [1, 0, 0, 0, 0, 0, 1, 0, 0]. It can also be expressed as

[0049] Theorem 2. If τ1 is a discrete real-time periodic task The non-divergent point position of the first Job of τ1 is and the real-time periodic task τ2(e2, p2) with an implicit deadline are scheduled to the same processor. It is known that τ1 takes precedence over τ2. Then the i-th Job τ 2,i The end time is

[0050]

[0051] Lateness(τ 2,i )=End(τ 2,i )-p2×i

[0052] in

[0053] If j = 0, then q0 = 0;

[0054] When i=1,

[0055]

[0056] If i>1, if Lateness(x 2,i-1 )≥0, then

[0057] If all jobs before the ith job have lateness (τ 2,i-1 )≥0 then

[0058]

[0059] If there is a lateness(x 2,i-1 )<0, then after the i-th Job,

[0060] And among them,

[0061] [End(τ 2,k ), k×p2] time units belong to The set of elements of

[0062] The elements of Each element in The sum is recorded as

[0063] for The number of elements in .

[0064] Proof: Because q j The idle time unit at the jth position is also the time unit that τ2 can execute. The j jobs of τ2 require a total of e2×i time execution units, and these time units need to run at the non-discrete point position of τ1, so there is the following formula:

[0065] e2×i=j×(p1-e1)+j

[0066]

[0067]

[0068] The final end time of the first job is from the release time 0 to the e2th idle time unit, then

[0069]

[0070] If Lateness(τ 2,i-1 )≥0, indicating that the last end time unit End(τ 2,i-1 )≥(i-1)×p2, then there can be no free space before the release time of the i-th task, that is,

[0071] If for all i-1 jobs, the lateness (x 2,i-1 )<0, that is, for all Then there can be no free space before the release time of the i tasks, so

[0072]

[0073] If there is a lateness(x 2,i-1 )<0, it means that the last end time unit End(τ 2,i-1 )<(i-1)×p2, then in [End(τ 2,i-1 ), (i-1)×p2] time period, there may be an idle time unit before the release time of the i-th job (i-1)×p2+1, and this idle time unit is an idle time unit that cannot be used by the i-th job to execute. This time unit must also be The elements in it, and because these elements are idle time units before the release time of the i-th job, they need to be excluded. In order to calculate the position of the idle time units after the i-th job is released, all the idle time units that existed before the previous i-1 jobs were released need to be excluded, so the sum of their numbers needs to be calculated.

[0074] if [End(τ 2,i-1 ), (i-1)×p2] time units belong to The set of elements of . Then The time unit inside is the idle time unit before the release time of the i-th job.

[0075] for The number of elements in is the number of idle time units.

[0076] is the sum of the number of such idle time units before all jobs from 1 to i-1 are published.

[0077]

[0078] Lateness(τ 2,i )=End(τ 2,i )-p2×i

[0079]

[0080] Get the certificate.

[0081] According to Theorem 2, we can calculate Tardiness(τ 2,i )=max{0,Lateness(τ 2,i )}.

[0082] Part 3: Test Cases

[0083] Test case 1: Assume that two real-time periodic tasks τ1(1, 2) and τ2(3, 5) with implicit deadlines are assigned to the same process, and τ1 has a higher priority than τ2. According to Theorem 1, calculate the delay of τ2:

[0084] Calculate the delay of the first job of τ2(3,5):

[0085]

[0086] Lateness(τ 2,1 )=End(τ 2,1 )-5×1=1

[0087] Tardiness(τ 2,1 )=max{0,Lateness(τ 2,1 )}=1

[0088] Calculate the delay of the second job of τ2(3,5):

[0089]

[0090] Lateness(τ 2,2 )=End(τ 2,2 )-5×2=2

[0091] TarDiness(τ 2,2 )=max{0,Lateness(τ 2,2 )}=2

[0092] Calculate the delay of the third job of τ2(3,5):

[0093]

[0094] Lateness(τ 2,3 )=End(τ 2,3 )-5×3=3

[0095] Tardiness(τ 2,3 )=max{0,Lateness(τ 2,3 )}=3

[0096] Test case 2: Assuming a discrete periodic task is a priority task, τ2(2, 3) is a periodic task with an implicit deadline, and they are scheduled on the same processor at the same time. The delay of τ2(2, 3) is calculated according to Theorem 2.

[0097] Calculate the delay of the first job

[0098]

[0099]

[0100] Lateness(τ 2,1 )=2-1×3=-1

[0101] Tardiness(τ 2,1 )=max{0,Lateness(τ 2,1 )}=0

[0102] Calculate the delay of the second job because of Lateness(τ 2,1 )<0 Therefore, there is a time unit 3 between (2, (1×3)] not In the collection.

[0103]

[0104]

[0105]

[0106] Lateness(τ 2,2 )=5-2×3=-1

[0107] Tardiness(τ 2,2 )=max{0,Lateness(τ 2,2 )}=0

[0108] Calculate the delay of the third job

[0109] Because Lateness(τ 2,2 )<0, so there is 1 time unit 6 between (5, (2×3)] In the collection.

[0110]

[0111]

[0112]

[0113] Lateness(τ 2,3 )=8-3×3=-1

[0114] Tardiness(τ 2,3 )=max{0,Lateness(τ 2,3 )}=0

[0115] Calculate the delay of the fourth job:

[0116] Because Lateness(τ 2,3 )<0, so in (End(x 2,3 ), (3×3)] there is a time unit 9 not In the collection.

[0117]

[0118]

[0119] Lateness(τ 2,4 )=13-4×3=1

[0120] Tardiness(τ 2,4 )=max{0,Lateness(τ 2,4 )}=1

[0121] Calculate the delay of the fifth job:

[0122] Because Lateness(τ 2,4 )>0So

[0123]

[0124]

[0125] Lateness(τ 2,5 )=16-5×3=1

[0126] TarDiness(τ 2,5 )=max{0,Lateness(τ 2,5 )}=1

[0127] Calculate the delay of the sixth job:

[0128] Because Lateness(τ 2,5 )>0So

[0129]

[0130]

[0131] Tardiness(τ 2,6 )=18-6×3=0

[0132] Tardiness(τ 2,6)=max{0,Lateness(τ 2,6 )}=0

[0133] Calculate the delay of the seventh job:

[0134] Because Lateness(τ 2,6 )≥0so

[0135]

[0136]

[0137] Lateness(τ 2,7 )=20-7×3=-1

[0138] Tardiness(τ 2,7 )=max{0,Lateness(τ 2,7 )}=0

[0139] Calculate the delay of the eighth job:

[0140] Because Lateness(τ 2,7 )<0Therefore, at (End(τ 2,7 ), (7×3)] there is a time unit 21 not

[0141] In the collection.

[0142]

[0143]

[0144] Lateness(τ 2,8 )=25-8×3=1

[0145] Tardiness(τ 2,8 )=max{0,Lateness(τ 2,8 )}=1

[0146] Part 5: Analysis of Task Delays in the EDF-os Algorithm

[0147] The EDF-os algorithm is a typical algorithm for soft real-time tasks proposed by James H. Anderson. Its basic idea is to divide task allocation into two stages: the first stage is the offline allocation stage and the second stage is the online execution stage. In the offline allocation stage, all tasks are sorted in descending order according to utilization, and then allocated in order according to the number of processors.

[0148] First, the first task assigned to a processor must be a fixed task, and its share assigned to the processor must be the utilization factor of the task.

[0149] Secondly, other tasks are assigned to each processor in order as pre-migration tasks. When assigning, the remaining share on the processor is calculated first. If the remaining share of the processor is greater than the utilization factor of the pre-migration task, the pre-migration task is assigned to the processor as a fixed task. Otherwise, the remaining share on the processor is assigned to the task, and then the remaining utilization factor of the task is assigned to the next processor. The task is a migration task. Repeat the assignment of the remaining tasks until all tasks are assigned.

[0150] According to the example in Table 1, the EDF-os algorithm can be used to obtain Figure 1 The offline allocation results and Figure 2 The online execution results are shown in Table 1. i,j represents the share of the i-th task assigned to the j-th processor during the offline phase, f i,j =s i,j / u i Indicates the proportion of jobs of the i-th task running on the j-th processor during the execution phase.

[0151] According to Theorem 1 and Theorem 2 in the present invention, the completion time and delay time statistics of all tasks can be calculated as shown in Table 2-5.

[0152] Table 1 Example of EDF-os algorithm task attribute table

[0153]

[0154] Table 2 Statistics of Job completion time and delay time of EDF-os algorithm task τ1(5,6)

[0155]

[0156] Table 3 Statistics of Job completion time and delay time of EDF-os algorithm task τ2(4,6)

[0157]

[0158] Table 4 Statistics of Job completion time and delay time of EDF-os algorithm task τ3(2,3)

[0159]

[0160] Table 5 Statistics of job completion time and delay time of EDF-os algorithm task τ4(2,3)

[0161]

[0162] Let's analyze the calculation method of the delay time of Job on the processor in the EDF-os algorithm:

[0163] p1 processor: Figure 1 and Figure 2 It can be seen that two tasks τ5(2, 3) and τ1(5, 6) are allocated to the p1 processor, where τ1 is a fixed task with a lower priority than τ5, and the share of τ5 allocated to p1 is The assigned job execution ratio is That is, run τ5 1 / 4 of the number of jobs and start from the second job. Then the task can be regarded as a discrete task. The expansion matrix of 4 jobs is 12 time units, which is E 12 (τ5) = [0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0] Every 12 time units is a cycle, and 2 time units are executed in each cycle, thus forming a discrete real-time periodic task. According to Theorem 2, the completion time and delay time of the first 10 jobs of τ1 are calculated and shown in Table 2.

[0164] p2 processor: Figure 1 and Figure 2 It can be seen that two tasks τ5(2, 3) and τ2(4, 6) are allocated to the p2 processor, where τ2 is a fixed task with a lower priority than τ5, and the share of τ5 allocated to p1 is The assigned job execution ratio is That is, run τ5 1 / 2 of the number of jobs and execute the next job after one cycle from the first job, then the expansion matrix of 2 jobs is 6 time units, E6(τ5) = [1, 1, 0, 0, 0, 0], and execute 2 time units every 6 time units to form a real-time periodic task τ′5(2, 6) with an implicit time limit. According to Theorem 1, the completion time and delay time of the first 10 jobs of τ1 are calculated as shown in Table 3.

[0165] p3 processor: Figure 1 and Figure 2 It can be seen that three tasks τ5(2,3), τ6(1,2) and τ3(2,3) are allocated to the p3 processor, among which τ3 is a fixed task with a lower priority than τ5 and τ6. τ5 has the highest priority, and the share of τ5 allocated to p3 is The assigned job execution ratio is That is, run τ5 1 / 4 of the number of jobs and start from the fourth job; then the task can be regarded as a discrete task, and the expansion matrix of 4 jobs is 12 time units, which is E 12 (τ5) = [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0]; the share of τ6 allocated to p3 is The assigned job execution ratio is That is, run 1 / 3 of the number of jobs of τ6 and start from the second job; then the task is a discrete task, and the expansion matrix of 3 jobs is 6 time units, which is E6(τ6) = [0, 0, 1, 0, 0, 0]. In order to make E6(τ6) equal to E 12 (τ5) and E6(τ6) can be expanded to 12 time units, namely E 12 (τ6)=[0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0], and E 12 (τ5) merged into E 12 (τ5, τ6) = [0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0], 4 time units are executed in each of the 12 time units to form a distributed real-time periodic task According to Theorem 2, the completion time and delay time of the first 10 jobs of τ3 are calculated and shown in Table 4.

[0166] p4 processor: Figure 1 and Figure 2 It can be seen that two tasks τ6(1, 2) and τ4(2, 3) are allocated to the p4 processor, where τ4 is a fixed task with a lower priority than τ6, and the share of τ6 allocated to p4 is The assigned job execution ratio is That is, run τ6 2 / 3 of the number of jobs and start from the first job. Then the task can be regarded as a discrete task. The three jobs are 6 time units. The expansion matrix is ​​E6(τ6) = [1, 0, 0, 0, 1, 0]. Every 6 time units is a cycle, and 2 time units are executed in each cycle, thus forming a discrete real-time periodic task. According to Theorem 2, the completion time and delay time of the first 10 jobs of τ4 are calculated and shown in Table 5.

[0167] The above is the idea of ​​calculating the job delay for the EDF-os algorithm. Other half-partitioning algorithms can also use this method for calculation. As long as the soft real-time tasks with implicit deadlines are allocated to the processors in a fixed proportion, the theoretical values ​​of the completion time and delay time of the low-priority tasks can be accurately calculated according to Theorem 1 and Theorem 2 in the present invention.

[0168] The above specific examples are used to illustrate the present invention, which is only used to help understand the present invention and is not intended to limit the present invention. Any partial modification or replacement within the technical scope disclosed by the present invention by anyone familiar with the technology should be included in the scope of the present invention.

Claims

1. A soft real-time periodic task delay calculation method based on an extended vector model, characterized in that: For two or more independent real-time periodic tasks with implicit time limits scheduled on the same processor, the following steps are specifically included: Step 1: Select an already allocated processor and convert the implicit time-limited cycle model allocated on the processor into an initial vector model; Step 2: According to the partition scheduling algorithm, the allocation share of the high-priority tasks allocated to the processor and the proportion of the job execution are calculated; In step 2, the partition share s of the high priority task is calculated i,j And the proportion of Job f i,j , where s i,j represents the share of the i-th task assigned to the j-th processor during the offline phase, f i,j =s i,j / u i It indicates the proportion of the number of jobs of the i-th task running on the j-th processor during the execution phase; Step 3: According to step 2, the initial vectors of all high-priority tasks are allocated according to the proportion f of the job i,j Convert to extended vector model; Step 301: f i,j =s i,j / u i Into the simplest form, recorded as f i,j =a / b, then assuming that the period of the periodic task τ is p and the worst execution time is e, the initial vector of τ(e,p) is transformed into the initial vector of τ′(e×a,p×b); Step 302: According to the characteristics of the scheduling algorithm, if the kth job assigned to the task runs on the processor, the starting position of 1 of the initial vector of τ′(e×a,p×b) is relocated to the position of the kth job; Step 303: reposition all jobs assigned to the processor according to p×b cycles, and set all element values ​​in other cycles that are not assigned to jobs to be 0, which is an extended vector model; Step 4: If there are only two tasks on the same processor, go directly to step 5; otherwise, merge the extension vectors of the high-priority tasks into one extension vector; Step 5. Determine whether it is a discrete task model or a general periodic task model with implicit time limit based on the extended vector model of step 4. If it is a discrete task model, calculate the completion time and delay time of the low-priority task according to the discrete delay calculation method. Otherwise, calculate according to the general delay calculation method with implicit time limit. If the system processor has not completed the processing, go to step 1.

2. According to claim 1, a method for calculating soft real-time periodic task delay based on an extended vector model is characterized in that: In step 1, the conversion into the initial vector model specifically includes the following steps: Step 101: firstly assign tasks to different processors according to a certain divided scheduling algorithm; Step 102: Select one of the processors and write the allocated real-time periodic task τ(e,p) with implicit time limit into a p-dimensional vector, where the values ​​of e consecutive elements starting from the first element are all 1, and the rest are all 0.

3. A method for calculating soft real-time periodic task delay based on an extended vector model according to claim 1 or 2, characterized in that: In step 4, merging the extended vectors specifically includes the following steps: Step 401, first find the least common multiple m of the extended vector periods of different high priority tasks; Step 402: Expand the high-priority expansion vector again according to m, and then perform addition operation on the corresponding elements; the result after the operation should still be an element of 0 or 1.

4. The method for calculating soft real-time periodic task delay based on an extended vector model according to claim 3, characterized in that: In step 5, selecting different calculation formulas specifically includes the following steps: Step 501: According to whether the extended vector of the high priority task has the same properties as the initial vector, i.e., starting from the first position, it is 1, and the positions of the subsequent values ​​of 1 are always continuous, and the positions of the subsequent values ​​of 0 are also continuous, it is determined that the extended vector is equivalent to a general periodic task with an implicit time limit, i.e., the number of 1s in the extended vector is e1, and the vector dimension is p1 for calculation; in this case, the implicit time limit task delay method is directly used for calculation; if the position of 1 is not continuous, it is determined to be a discrete periodic task, and the discrete task delay method is used for calculation; Step 502: Calculate the delay of a low-priority task with an implicit deadline for a certain execution. Then, based on e1 and p1 in the above steps and the periodic model τ(e2, p2) of the implicit deadline of the low-priority task, directly calculate the completion time, absolute deadline, postponement time and delay time of the job. Step 503: Calculate the delay of a discrete low-priority task execution. First, write out the discrete periodic task model of the above extended vector. According to the positions of all 0s in the above steps, and the implicit time limit cycle model τ(e2,p2) of the low-priority task, first calculate the cycle remainder q of the job execution j value, and then calculate the completion time, absolute deadline, postponement time and delay time.

Citation Information

Patent Citations

  • Multi-core scheduling method for high utilization task set oriented soft real-time system

    CN109298919A