A multi-task scheduling method, system and product for a voyage data recorder
By building an acquisition task objective importance model in the navigation data recorder, calculating comprehensive priority and adopting preemptive scheduling, the problem that task scheduling in the road system is difficult to meet the real-time acquisition needs, and the real-time and computing performance of data acquisition are improved.
Patent Information
- Application Number
- CN202411466414.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-21
- Publication Date
- 2025-02-28
- Estimated Expiration
- 2044-10-21
AI Technical Summary
Under the road system, traditional task scheduling methods are difficult to meet the real-time data acquisition needs of navigation data loggers, especially when dealing with high-important tasks.
By constructing a collection task objective importance model, comprehensively considering the task objective importance, task priority and task latest deadline, comprehensive priority is calculated, and dynamically sorted and dispatched using preemptive scheduling method.
It improves the real-time nature of data acquisition, reduces frequent CPU task scheduling, fully explores the computing performance of the channel system, and adapts to the needs of large-capacity data.
Smart Images

Figure CN118963978B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of task scheduling, and in particular to a multi-task scheduling method, system and product for a navigation data recorder. Background Art
[0002] The voyage data recorder needs to collect data information from the entire ship for post-accident analysis and evidence collection. The multi-source real-time data in the voyage data recorder mainly comes from six major business systems, and its data has the characteristics of hybrid, discrete, and large capacity. At present, compared with non-domestic platforms, the computing power of domestic software and hardware platforms has dropped significantly. At present, the domestic software platforms used by voyage data recorders are mostly road systems. In the face of the orderly collection and storage of a large amount of ship data, the traditional task scheduling method based on the earliest deadline priority algorithm or the task priority deadline algorithm on the road system has been difficult to meet the real-time collection requirements. The traditional earliest deadline priority algorithm dynamically determines the task priority through a single parameter, and lacks the estimation of the dynamic task target; and although the task priority deadline algorithm introduces the idea of a priority table and combines the task working mode priority with the task latest deadline, there is a problem of excessive subjectivity caused by artificial division of task priorities, and it cannot be dynamically adjusted according to the task running status in real time. These two algorithms have the following problems: First, they regard the task importance as a fixed parameter equivalent to the task priority, without considering the dynamic change of task importance over time; second, they do not fully consider the real-time nature of task scheduling and its impact on task functions, especially the real-time nature of tasks with high importance. Therefore, in order to fully tap the computing performance, it is necessary to optimize the existing task scheduling method under the system to adapt to the needs of large-capacity data and improve the real-time nature of data collection. Summary of the invention
[0003] The present invention aims to solve the problem that it is difficult to meet the real-time collection requirements of the navigation data recorder under the road system. To this end, the present invention provides a multi-task scheduling method, system and product for the navigation data recorder, which constructs a collection task target importance model, integrates the task target importance, task priority and the latest task deadline, calculates the comprehensive priority, and then dynamically sorts the collection tasks, puts them into the task request queue, and performs scheduling operations based on the preemptive scheduling method of the road system.
[0004] The present invention provides a multi-task scheduling method for a voyage data recorder, and the technical solution adopted is as follows: comprising the following steps:
[0005] Step 1: Get the collection task of the voyage data recorder;
[0006] Step 2: Normalize the parameters of the acquisition task to obtain standardized parameters;
[0007] Step 3: Calculate the information entropy weight of the parameters of the acquisition task based on the normalized parameters;
[0008] Step 4: Calculate the comprehensive weight according to the information entropy weight;
[0009] Step 5: Calculate the task objective importance of the collection task based on the comprehensive weight and normalized parameters;
[0010] Step 6: Calculate the comprehensive priority of the collection task based on the initial priority of the task, the latest deadline of the task, and the importance of the task target;
[0011] Step 7: Sort the collection tasks from high to low according to the comprehensive priority, and then put them into the task request queue;
[0012] Step 8: Under the road system, the task request queue is scheduled using a preemptive scheduling method to obtain the task execution queue of the navigation data recorder.
[0013] Furthermore, the parameters of the acquisition task include heading, speed, range, flow rate, draft depth and acquisition target type.
[0014] Furthermore, the acquisition target types include integrated devices, real-time devices, inertial devices and odometer devices, and their importance levels are quantized as 4, 3, 2, and 1 respectively; the acquisition target types do not need to be normalized.
[0015] Furthermore, the calculation formula for normalization is:
[0016]
[0017] in, represents the jth normalized parameter of the i-th acquisition task, represents the jth parameter of the i-th acquisition task, , , m is the total number of acquisition tasks, and n is the total number of parameters.
[0018] Furthermore, the calculation formula of information entropy weight is:
[0019]
[0020] in, represents the information entropy weight of the jth parameter, Indicates the ratio value of the jth parameter of the i-th acquisition task, represents the jth normalized parameter of the i-th acquisition task,
[0021] ;
[0022] The calculation formula of comprehensive weight is:
[0023]
[0024] in, represents the comprehensive weight of the jth parameter; represents the subjective weight of the jth parameter;
[0025] The calculation formula for the importance of task objectives is:
[0026]
[0027] in, Represents the importance of the task objective of the i-th collection task.
[0028] Furthermore, the calculation formula of the comprehensive priority is:
[0029]
[0030] in, represents the comprehensive priority of the i-th collection task, represents the initial priority of the i-th collection task, Indicates the latest deadline of the i-th collection task, Represents a weighted value.
[0031] Further, the step 8 comprises:
[0032] Step 8.1: Take out the collection task from the task request queue and calculate whether the collection task meets the scheduling requirements of the current scheduling interval; if so, plan its actual execution time according to the expected execution time and the required execution time, insert the collection task into the feasible queue, and then execute step 8.3; if not, execute step 8.2;
[0033] Step 8.2: Determine whether the sum of the latest deadline of the collection task and the required execution time is greater than or equal to the end time of the current scheduling interval; if so, insert the collection task into the waiting queue; if not, put the collection task into the suspended queue;
[0034] Step 8.3: Check whether the task request queue is empty. If it is not empty, execute step 8.1; if it is empty, execute step 8.4;
[0035] Step 8.4: Allocate execution time to the feasible queues to obtain the task execution queue of the voyage data recorder.
[0036] Furthermore, the actual execution time of the collection task is planned according to the expected execution time and the required execution time, and then the process of inserting the collection task into the feasible queue is as follows:
[0037] The actual execution time is calculated based on the expected execution time and the required execution time.
[0038] Determine whether the actual execution time is occupied by other acquisition tasks with higher comprehensive priority;
[0039] If not, insert the collection task into the feasible queue;
[0040] If so, the actual execution time of the collection task is offset, and then the collection task is inserted into the feasible queue.
[0041] The present invention also provides a multi-task scheduling system for a navigation data recorder, which adopts the following technical solution: comprising: a collection task target importance model and a road system scheduling module, wherein the collection task target importance model is connected to the road system scheduling module,
[0042] The acquisition task target importance model is used to obtain the acquisition task of the navigation data recorder; the parameters of the acquisition task are normalized to obtain standardized parameters; the information entropy weight of the parameters of the acquisition task is calculated according to the standardized parameters; the comprehensive weight is calculated according to the information entropy weight; the task target importance of the acquisition task is calculated according to the comprehensive weight and the standardized parameters; the comprehensive priority is calculated according to the initial task priority, the latest task deadline and the task target importance of the acquisition task; the acquisition tasks are sorted from high to low according to the comprehensive priority, and then put into the task request queue;
[0043] The road system scheduling module is used to schedule the task request queue in the road system in a preemptive scheduling manner to obtain the task execution queue of the navigation data recorder.
[0044] The present invention also provides a computer program product, comprising a computer program, which implements the above-mentioned multi-task scheduling method for a navigation data recorder when executed by a processor.
[0045] The above one or more technical solutions in the embodiments of the present invention have at least one of the following technical effects:
[0046] The present invention analyzes the respective shortcomings of the two typical algorithms, namely the earliest deadline priority algorithm and the task priority deadline algorithm in multi-task scheduling, and then constructs a collection task target importance model in combination with the characteristics of the system, combines the task target importance, task priority and the latest task deadline, calculates the comprehensive priority of the task in real time, and then schedules the task according to the real-time comprehensive priority, thereby reducing the frequent task scheduling of the CPU and improving the real-time performance of data collection.
[0047] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0049] Figure 1 It is a flow chart of the method provided by the present invention. DETAILED DESCRIPTION
[0050] In order to make the purpose, technical scheme and advantages of the present invention clearer, the technical scheme of the present invention will be clearly and completely described below in conjunction with the drawings in the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present invention. The following embodiments are used to illustrate the present invention, but cannot be used to limit the scope of the present invention.
[0051] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the embodiment of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.
[0052] Combine the following Figure 1The present invention is further described in detail, and a multi-task scheduling method, system and product for a voyage data recorder of the present invention are described:
[0053] In this embodiment, Figure 1 As shown, a multi-task scheduling method for a voyage data recorder is provided, comprising the following steps:
[0054] Step 1: Get the collection task of the voyage data recorder.
[0055] The content of the collection task includes parameters, task type, expected execution time and the latest deadline of the task. The task type determines the residence time of the collection task, the required execution time and the initial priority of the task. The latest deadline of the task indicates the latest time when the task can be executed. If it is executed later than this time point, data loss may occur.
[0056] Generally, the voyage data recorder collects data from multiple collection targets at the same time, and multiple collection tasks can be obtained from each collection target. The collection tasks have different task types. According to the task function, the task type is divided into collection, processing, storage, log, display, etc.
[0057] Step 2: Normalize the parameters of the acquisition task to obtain standardized parameters.
[0058] The parameters of the acquisition task include heading, speed, range, current velocity, draft depth and acquisition target type. Heading refers to the angle between the true north line and the heading line on the true horizon of the ship during navigation, in degrees; speed, in knots; range, in nautical miles; current velocity, in knots; draft depth refers to the deepest length of the submerged part of the ship in the water, in meters; acquisition target types include integrated equipment, real-time equipment, inertial equipment and log equipment, and their importance levels are quantified as 4, 3, 2, 1 in turn.
[0059] The calculation formula for normalization is:
[0060]
[0061] in, represents the jth normalized parameter of the i-th acquisition task, represents the jth parameter of the i-th acquisition task, , , m is the total number of acquisition tasks, and n is the total number of parameters.
[0062] During normalization, only the heading, speed, distance, current velocity and draft depth are processed. The acquisition target type is a quantitative value and does not require normalization.
[0063] Step 3: Calculate the information entropy weight of the parameters of the acquisition task based on the normalized parameters. The calculation formula is:
[0064]
[0065] in, represents the information entropy weight of the jth parameter, Indicates the ratio value of the jth parameter of the i-th acquisition task,
[0066] .
[0067] Step 4: Obtain the comprehensive weight based on the information entropy weight calculation. In order to avoid the defect of unreasonable weights caused by the information entropy decision-making method due to the absolute objectivity of the parameters, a calculation method combining the information entropy decision-making method with the subjective weight is adopted to obtain the comprehensive weight. The calculation formula is:
[0068]
[0069] in, represents the comprehensive weight of the jth parameter; Represents the subjective weight of the jth parameter, which is given by a large amount of data experience.
[0070] Step 5: Calculate the task target importance of the collection task based on the comprehensive weight and normalized parameters. The calculation formula is:
[0071]
[0072] in, Represents the importance of the task objective of the i-th collection task.
[0073] Step 6: Calculate the comprehensive priority based on the task target importance, task initial priority and task deadline of the collection task. The calculation formula is:
[0074]
[0075] in, represents the comprehensive priority of the i-th collection task, represents the initial priority of the i-th collection task, Indicates the latest deadline of the i-th collection task, Represents a weighted value. By selecting different weighted values, you can increase or decrease the impact of the task goal importance and the task initial priority. Since the task goal importance, the task initial priority and the task latest deadline have different dimensions, they are normalized in the calculation formula.
[0076] Step 7: Sort the collection tasks according to the comprehensive priority from high to low, and then put them into the task request queue.
[0077] Step 8: Under the system, the task request queue is scheduled in a preemptive manner to obtain the task execution queue of the voyage data recorder and complete the scheduling of the collection task. The core of the task scheduling strategy based on comprehensive priority is two points: one is to schedule as many tasks as possible in principle; the other is to make the task execution time as close to its expected time as possible in principle.
[0078] The specific process is:
[0079] Step 8.1: Sequentially take out the collection tasks from the task request queue, and calculate whether the collection tasks meet the scheduling requirements of the current scheduling interval. The scheduling requirement is that the required execution time length of the collection task is not greater than the interval time of the scheduling interval.
[0080] If it is satisfied, the actual execution time of the collection task is planned according to the expected execution time and the required execution time, the collection task is inserted into the feasible queue, and then step 8.3 is executed.
[0081] The actual execution time of the collection task is planned according to the expected execution time and the required execution time, and then the process of inserting the collection task into the feasible queue is as follows:
[0082] The actual execution time is calculated based on the expected execution time and the required execution time.
[0083] Determine whether the actual execution time is occupied by other acquisition tasks with higher comprehensive priority;
[0084] If not, insert the collection task into the feasible queue;
[0085] If so, the actual execution time of the collection task is offset, and then the collection task is inserted into the feasible queue.
[0086] If not satisfied, proceed to step 8.2.
[0087] Step 8.2: Determine whether the sum of the latest deadline of the collection task and the required execution time is greater than or equal to the end time of the current scheduling interval.
[0088] If so, it means that the current scheduling interval does not meet its execution, and the collection task is inserted into the waiting queue to wait for the task scheduling of the next scheduling interval.
[0089] If not, it means that the collection task is expected to be scheduled within the current scheduling interval, but the collection task does not meet the scheduling conditions within the current scheduling interval, and the collection task is put into the suspension queue.
[0090] Step 8.3: Check whether the task request queue is empty. If it is not empty, execute step 8.1; if it is empty, execute step 8.4.
[0091] Step 8.4: Allocate execution time to the feasible queues to obtain the task execution queue of the voyage data recorder.
[0092] In order to verify the effectiveness of this method, this embodiment carried out simulation implementation and performance evaluation.
[0093] In order to judge the scheduling performance, the general time utilization rate and scheduling success rate are introduced as the basis. The time utilization rate is the ratio of the sum of the residence time of successfully scheduled tasks to the total scheduling time, and the scheduling success rate is the ratio of the total number of successfully scheduled tasks to the total number of all requested tasks.
[0094] The total simulation duration is set to 500ms, the scheduling interval is set to 50ms, and the request parameters of different task types are shown in Table 1. The collection task is a resident task, which is the same as the current collection target quantity. Set to:
[0095] , which correspond to heading, speed, range, current velocity, draft depth and acquisition target type respectively.
[0096] Weighted Values in Comprehensive Priority Design Take 0.8, focusing on the impact of task goal importance and task initial priority.
[0097] Table 1 Request parameters for different task types
[0098]
[0099] Based on the above simulation parameters, 100 Monte Carlo simulations were performed on the task priority deadline algorithm and this method, and the scheduling performance indicators of the two strategies were obtained. The results are shown in Table 2. Traditional Scheduling Strategy
[0100] Table 2 Simulation results
[0101]
[0102] On the whole, this method is superior to the traditional task priority deadline algorithm in terms of time utilization and scheduling success rate, with performance improved by 4.5% and 0.2% respectively, ensuring the execution of tasks with high real-time navigation priority, meeting actual needs, and improving the real-time performance of data collection from the navigation data recorder of the road system.
[0103] In this embodiment, a multi-task scheduling system for a navigation data recorder is also provided, and the technical solution adopted is as follows: it includes: a collection task target importance model and a road system scheduling module, and the collection task target importance model is connected to the road system scheduling module.
[0104] The acquisition task target importance model is used to obtain the acquisition task of the navigation data recorder; the parameters of the acquisition task are normalized to obtain standardized parameters; the information entropy weight of the parameters of the acquisition task is calculated based on the standardized parameters; the comprehensive weight is calculated based on the information entropy weight; the task target importance of the acquisition task is calculated based on the comprehensive weight and the standardized parameters; the comprehensive priority is calculated based on the initial task priority, the latest task deadline and the task target importance of the acquisition task; the acquisition tasks are sorted from high to low according to the comprehensive priority, and then put into the task request queue. Then the task request queue is sent to the road system scheduling module.
[0105] The present invention designs a collection task target importance model, which can calculate the task target importance of the collection task. The task target importance is the importance of the collected signal to the navigation data recorder, which is generally related to the parameters of the collected signal, and the main parameters include heading, speed, flow rate, etc. The present invention uses the parameters of the target signal to calculate the relative importance of the target signal; at the same time, considering the parameter diversification caused by signal diversification, a method combining the subjective weight method and the information entropy comprehensive decision method is used to realize the calculation of the importance of the target signal.
[0106] The road system scheduling module is used to schedule the task request queue in the road system in a preemptive scheduling manner to obtain the task execution queue of the navigation data recorder.
[0107] In this embodiment, a computer program product is also provided, including a computer program, and when the computer program is executed by a processor, the multi-task scheduling method for a navigation data recorder is implemented.
[0108] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A multi-task scheduling method for a voyage data recorder, characterized in that: The following steps are involved: Step 1: Get the collection task of the voyage data recorder; Step 2: Normalize the parameters of the acquisition task to obtain standardized parameters; Step 3: Calculate the information entropy weight of the parameters of the acquisition task based on the normalized parameters; The calculation formula of information entropy weight is: in, represents the information entropy weight of the jth parameter, Indicates the ratio value of the jth parameter of the i-th acquisition task, represents the jth normalized parameter of the ith acquisition task, m is the total number of acquisition tasks, n is the total number of parameters, ; Step 4: Calculate the comprehensive weight according to the information entropy weight; The calculation formula of comprehensive weight is: in, represents the comprehensive weight of the jth parameter; represents the subjective weight of the jth parameter; Step 5: Calculate the task objective importance of the collection task based on the comprehensive weight and normalized parameters; The calculation formula for the importance of task objectives is: in, Indicates the importance of the task objective of the i-th collection task; Step 6: Calculate the comprehensive priority of the collection task based on the initial priority of the task, the latest deadline of the task, and the importance of the task target; The calculation formula for the comprehensive priority is: in, represents the comprehensive priority of the i-th collection task, represents the initial priority of the i-th collection task, Indicates the latest deadline of the i-th collection task, represents the weighted value; Step 7: Sort the collection tasks from high to low according to the comprehensive priority, and then put them into the task request queue; Step 8: Under the road system, the task request queue is scheduled using a preemptive scheduling method to obtain the task execution queue of the navigation data recorder.
2. A multi-task scheduling method for a voyage data recorder according to claim 1, characterized in that: The parameters of the acquisition task include heading, speed, range, flow rate, draft depth and acquisition target type.
3. A multi-task scheduling method for a voyage data recorder as claimed in claim 2, characterized in that: The acquisition target types include integrated devices, real-time devices, inertial devices and odometer devices, and their importance levels are quantified as 4, 3, 2, and 1 respectively; the acquisition target types do not need to be normalized.
4. A multi-task scheduling method for a voyage data recorder as claimed in claim 1, characterized in that: The calculation formula for normalization is: in, represents the jth normalized parameter of the i-th acquisition task, represents the jth parameter of the i-th acquisition task, , .
5. A multi-task scheduling method for a voyage data recorder as claimed in claim 1, characterized in that: The step 8 comprises: Step 8.1: Take out the collection task from the task request queue and calculate whether the collection task meets the scheduling requirements of the current scheduling interval; if so, plan its actual execution time according to the expected execution time and the required execution time, insert the collection task into the feasible queue, and then execute step 8.3; if not, execute step 8.2; Step 8.2: Determine whether the sum of the latest deadline of the collection task and the required execution time is greater than or equal to the end time of the current scheduling interval; if so, insert the collection task into the waiting queue; if not, put the collection task into the suspended queue; Step 8.3: Check whether the task request queue is empty. If it is not empty, execute step 8.1; if it is empty, execute step 8.4; Step 8.4: Allocate execution time to the feasible queues to obtain the task execution queue of the voyage data recorder.
6. A multi-task scheduling method for a voyage data recorder as claimed in claim 5, characterized in that: The actual execution time of the collection task is planned according to the expected execution time and the required execution time, and then the process of inserting the collection task into the feasible queue is as follows: The actual execution time is calculated based on the expected execution time and the required execution time. Determine whether the actual execution time is occupied by other acquisition tasks with higher comprehensive priority; If not, insert the collection task into the feasible queue; If so, the actual execution time of the collection task is offset, and then the collection task is inserted into the feasible queue.
7. A multi-task scheduling system for a voyage data recorder, characterized in that: A method for executing a multi-task scheduling method for a navigation data recorder according to any one of claims 1 to 6, comprising: a collection task target importance model and a road system scheduling module, wherein the collection task target importance model is connected to the road system scheduling module, The acquisition task target importance model is used to obtain the acquisition task of the navigation data recorder; the parameters of the acquisition task are normalized to obtain standardized parameters; the information entropy weight of the parameters of the acquisition task is calculated according to the standardized parameters; the comprehensive weight is calculated according to the information entropy weight; the task target importance of the acquisition task is calculated according to the comprehensive weight and the standardized parameters; the comprehensive priority is calculated according to the initial task priority, the latest task deadline and the task target importance of the acquisition task; the acquisition tasks are sorted from high to low according to the comprehensive priority, and then put into the task request queue; The calculation formula of information entropy weight is: in, represents the information entropy weight of the jth parameter, Indicates the ratio value of the jth parameter of the i-th acquisition task, represents the jth normalized parameter of the ith acquisition task, m is the total number of acquisition tasks, n is the total number of parameters, ; The calculation formula of comprehensive weight is: in, represents the comprehensive weight of the jth parameter; represents the subjective weight of the jth parameter; The calculation formula for the importance of task objectives is: in, Indicates the importance of the task objective of the i-th collection task; The calculation formula for the comprehensive priority is: in, represents the comprehensive priority of the i-th collection task, represents the initial priority of the i-th collection task, Indicates the latest deadline of the i-th collection task, represents the weighted value; The road system scheduling module is used to schedule the task request queue in the road system in a preemptive scheduling manner to obtain the task execution queue of the navigation data recorder.
8. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, a multi-task scheduling method for a navigation data recorder according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Unmanned platform-mounted multifunctional radar task comprehensive priority calculation method
CN112130978A