A task processing method based on SRB bus and related equipment

By performing task segmentation processing on non-real-time tasks in the SRB bus system, the problem of burst real-time tasks cannot be handled when non-real-time tasks occupy the bus is solved, and the smooth processing of real-time tasks within the maximum waiting time is achieved, and the system stability is improved .

CN119088532BActive Publication Date: 2025-02-18BEIJING ZHONGTIAN STAR CONTROL TECH DEV CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411576819.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-06
Publication Date
2025-02-18
Estimated Expiration
2044-11-06

AI Technical Summary

Technical Problem

In the application of SRB bus, when non-real-time tasks are processed in conjunction with real-time tasks, bursts of real-time tasks occur when non-real-time tasks occupy the bus, resulting in real-time tasks being unable to be processed smoothly, affecting the operating stability of the system.

Method used

By obtaining the task processing status of the transmission bus, it is determined whether the remaining processing time of the non-real-time task is greater than the maximum waiting time of the real-time task. When the remaining processing time is greater than the maximum waiting time, task segmentation is performed on non-real-time tasks to obtain multiple subtasks to ensure that the real-time tasks are processed within the maximum waiting time.

Benefits of technology

It effectively prevents the impact on real-time tasks when non-real-time tasks occupy the bus, ensures that real-time tasks are processed within the specified time, and improves the operating stability of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119088532B_ABST
    Figure CN119088532B_ABST
Patent Text Reader

Abstract

The present application provides a task processing method and related equipment based on SRB bus. In the method, in response to the real-time task processing instruction, the task processing state of the transmission bus is obtained; the task processing state includes: the non-real-time task is being processed; the real-time task processing instruction is used to indicate the processing of the real-time task; when the task processing state of the transmission bus is the non-real-time task is being processed state, it is determined whether the remaining processing time of the non-real-time task is greater than the maximum waiting time of the real-time task; when the remaining processing time is greater than the maximum waiting time, the non-real-time task is divided into tasks according to the maximum waiting time of the real-time task to obtain multiple subtasks, so that the real-time task can be processed within the maximum waiting time; there is a task interval processing time between two adjacent subtasks. In this way, it is ensured that the real-time task can be effectively processed at any time, and the operation stability of the system is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a task processing method based on an SRB bus and related equipment. Background Art

[0002] SRB (Safe Real-time Bus) is a bus architecture specifically designed to ensure high reliability, real-time and fault-tolerant data transmission in safety-critical applications. Through the SRB bus, various pending non-real-time tasks in the system and sudden real-time tasks can be effectively processed. However, in the current application of the SRB bus, non-real-time tasks and real-time tasks are often processed in coordination. If a sudden real-time task occurs while a non-real-time task is occupying the SRB bus, the real-time task cannot be processed smoothly, thus affecting the system's operational stability. Summary of the invention

[0003] Based on the above problems, in order to prevent non-real-time tasks from affecting the normal processing of real-time tasks, an embodiment of the present application provides a task processing method based on an SRB bus and related equipment.

[0004] The embodiments of the present application disclose the following technical solutions:

[0005] In a first aspect, an embodiment of the present application provides a task processing method based on an SRB bus, comprising:

[0006] In response to the real-time task processing instruction, the task processing state of the transmission bus is acquired; the task processing state includes: a non-real-time task being processed state; the real-time task processing instruction is used to instruct the processing of the real-time task;

[0007] When the task processing state of the transmission bus is the non-real-time task being processed state, determining whether the remaining processing time of the non-real-time task is greater than the maximum waiting time of the real-time task;

[0008] When the remaining processing time is greater than the maximum waiting time, the non-real-time task is split according to the maximum waiting time of the real-time task to obtain multiple subtasks, so that the real-time task can be processed within the maximum waiting time; there is a task interval processing time between two adjacent subtasks.

[0009] In a possible implementation, the subtask includes: a currently processed subtask and a to-be-processed subtask; the non-real-time task is split according to the maximum waiting time of the real-time task to obtain a plurality of subtasks, including:

[0010] Perform segmentation preprocessing according to the maximum waiting time of the real-time task to obtain the remaining processing time of the current processing subtask; the remaining processing time of the current processing subtask is less than the maximum waiting time of the real-time task;

[0011] According to the remaining processing time of the currently processed subtask, the bandwidth data of the transmission bus and the maximum processing time of the non-real-time task, the non-real-time task is split into tasks to obtain the multiple subtasks.

[0012] In a possible implementation, after obtaining the multiple subtasks, the method further includes:

[0013] When the real-time task is not processed completely, the task processing status of the plurality of subtasks is set to a waiting processing status.

[0014] In a possible implementation, the real-time task and the non-real-time task are stored in a timer stack and an active timer queue, and the real-time task and the non-real-time task each have a corresponding queue processing time node and a deadline processing time node;

[0015] The timer stack is used to store tasks that have not reached the queue processing time node, and when the tasks reach the queue processing time node, transfer the tasks that have reached the queue processing time node to the active timer queue;

[0016] The active timer queue is used to sort the priorities of the multiple tasks according to the processing deadline nodes to obtain the processing priorities corresponding to the multiple tasks.

[0017] In a possible implementation, the method further includes:

[0018] When the task processing is completed, the task type of the task that has been processed is obtained;

[0019] When the task type is a periodic task, the completed task is copied to obtain a first task; the queue processing time node and the deadline processing time node of the first task are different from the queue processing time node and the deadline processing time node of the completed task;

[0020] The first task is transferred to the timer stack.

[0021] In a possible implementation, the method further includes:

[0022] In response to the task processing instruction, based on the real-time bus parameters of the transmission bus, determining whether the second task corresponding to the task processing instruction can be processed;

[0023] If the second task cannot be processed, the task processing state of the second task is set to a waiting state, and based on the task processing parameters of the second task, the real-time bus parameters of the transmission bus are monitored.

[0024] In a possible implementation, the method further includes:

[0025] For a third task among the plurality of tasks, if the current time exceeds the deadline processing time node of the third task and the third task has not been processed, the task processing state of the third task is recorded as an abnormal state.

[0026] In a second aspect, an embodiment of the present application provides a task processing device based on an SRB bus, comprising:

[0027] An acquisition module, used for acquiring a task processing state of the transmission bus in response to a real-time task processing instruction; the task processing state includes: a non-real-time task being processed state; the real-time task processing instruction is used for instructing the processing of the real-time task;

[0028] A judging module, configured to judge whether the remaining processing time of the non-real-time task is greater than the maximum waiting time of the real-time task when the task processing state of the transmission bus is the processing state of the non-real-time task;

[0029] The splitting module is used to split the non-real-time task according to the maximum waiting time of the real-time task when the remaining processing time is greater than the maximum waiting time, so as to obtain multiple subtasks, so that the real-time task can be processed within the maximum waiting time; there is a task interval processing time between two adjacent subtasks.

[0030] In a third aspect, an embodiment of the present application provides an electronic device, the device comprising: a processor, a memory, and a system bus;

[0031] The processor and the memory are connected via the system bus;

[0032] The memory is used to store one or more programs, and the one or more programs include instructions. When the instructions are executed by the processor, the processor executes any possible SRB bus-based task processing method in the first aspect.

[0033] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any possible SRB bus-based task processing method in the first aspect.

[0034] Compared with the prior art, the present application has the following beneficial effects: the embodiment of the present application provides a task processing method based on the SRB bus and related equipment. In the method, when it is necessary to respond to the real-time task processing instruction to process the real-time task, the task processing state of the transmission bus is first obtained to determine whether the transmission bus is being used to process the non-real-time task. When the transmission bus is being used to process the non-real-time task, in order to prevent the occupation of the transmission bus by the non-real-time task from affecting the processing of the real-time task, it is necessary to further determine whether the remaining processing time of the non-real-time task is greater than the maximum waiting time of the real-time task. When the remaining processing time of the non-real-time task is greater than the maximum waiting time of the real-time task, the non-real-time task is divided into tasks according to the maximum waiting time of the real-time task to obtain multiple subtasks. Since there is a certain task interval processing time between multiple subtasks, after the current subtask processing is completed, the sudden real-time task can be processed by the interval time between the subtasks to ensure that the real-time task can be processed within the maximum waiting time. In this way, even if a sudden real-time task occurs when processing a non-real-time task, the non-real-time task can be split according to the specific time requirements of the real-time task, thereby ensuring the smooth processing of the real-time task and improving the operating stability of the system. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] In order to more clearly illustrate the embodiments of the present application or the technical solutions in 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 only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0036] Figure 1 A schematic diagram of task processing based on an SRB bus provided in an embodiment of the present application;

[0037] Figure 2 A flowchart of a task processing method based on an SRB bus provided in an embodiment of the present application;

[0038] Figure 3 A flowchart of another SRB bus-based task processing method provided in an embodiment of the present application;

[0039] Figure 4 A task partitioning diagram of a non-real-time task provided in an embodiment of the present application;

[0040] Figure 5 A schematic diagram of a task processing scenario and a task scheduling process provided in an embodiment of the present application;

[0041] Figure 6A schematic diagram of the structure of a task processing device based on an SRB bus provided in an embodiment of the present application;

[0042] Figure 7 A structural diagram of a task processing electronic device based on an SRB bus provided in an embodiment of the present application. DETAILED DESCRIPTION

[0043] In order to make the purpose, technical solutions and advantages of this application more clear, the following is a further detailed description of this application in combination with specific embodiments and with reference to the accompanying drawings. It should be noted that the embodiments described in the embodiments of this application are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0044] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the embodiments of the present application should be understood by people with ordinary skills in the field to which the present application belongs. The "first", "second" and similar words used in the embodiments of the present application do not indicate any order, quantity or importance, but are only used to distinguish different components. "Include" or "include" and similar words mean that the elements or objects appearing before the word include the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "Up", "down", "left", "right", etc. are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.

[0045] As described above, however, in the current application of the SRB bus, non-real-time tasks and real-time tasks are often processed collaboratively. If a sudden real-time task occurs when a non-real-time task is occupying the SRB bus, the real-time task cannot be processed smoothly, thereby affecting the operating stability of the system.

[0046] For details, please refer to Figure 1 , which is a schematic diagram of task processing based on the SRB bus provided in an embodiment of the present application, such as Figure 1 As shown in the figure, the real-time task has its corresponding deadline processing time node t, and the real-time task needs to enter the processing state when reaching the time node t. When the real-time task needs to be processed, if the SRB bus is occupied by a non-real-time task, the time node of the real-time task will exceed its corresponding deadline processing time node t, resulting in the real-time task being unable to be processed normally, affecting the operating stability of the system.

[0047] In order to solve the above problems, the embodiment of the present application provides a task processing method based on SRB bus and related equipment. In the method, when it is necessary to respond to the real-time task processing instruction to process the real-time task, the task processing state of the transmission bus is first obtained to determine whether the transmission bus is used to process the non-real-time task. When the transmission bus is used to process the non-real-time task, in order to prevent the occupation of the transmission bus by the non-real-time task from affecting the processing of the real-time task, it is necessary to further determine whether the remaining processing time of the non-real-time task is greater than the maximum waiting time of the real-time task. When the remaining processing time of the non-real-time task is greater than the maximum waiting time of the real-time task, the non-real-time task is divided into tasks according to the maximum waiting time of the real-time task to obtain multiple subtasks. Since there is a certain task interval processing time between multiple subtasks, after the current subtask is processed, the sudden real-time task can be processed by the interval time between the subtasks to ensure that the real-time task can be processed within the maximum waiting time. In this way, even if a sudden real-time task occurs when processing the non-real-time task, the non-real-time task can be divided into tasks according to the specific time requirements of the real-time task, thereby ensuring the smooth processing of the real-time task and improving the operation stability of the system.

[0048] Next, a task processing method based on the SRB bus provided by the embodiment of the present application will be introduced in conjunction with the specific embodiment drawings. Figure 2 , which is a flow chart of a task processing method based on an SRB bus provided in an embodiment of the present application, and specifically includes the following steps:

[0049] S101: In response to a real-time task processing instruction, obtaining a task processing state of a transmission bus; the task processing state includes: a non-real-time task being processed state; the real-time task processing instruction is used to instruct the processing of a real-time task.

[0050] First, when it is necessary to respond to the real-time task processing instruction to process the real-time task, in order to confirm whether the transmission bus is occupied by a non-real-time task at this time, it is necessary to obtain the task processing status of the transmission bus before processing the real-time task, so as to determine whether the real-time task can be processed. Among them, the task processing status of the transmission bus includes the non-real-time task processing status, the real-time task processing status and the idle status. The former two task processing statuses respectively indicate that the transmission bus is processing a non-real-time task or a real-time task, and the idle status indicates that the transmission bus is not processing a task at this time.

[0051] In actual application scenarios, real-time task processing instructions can be issued by a central control unit within the system to which the transmission bus belongs. The central control unit can determine whether a real-time task needs to be executed based on the task running status of the system, thereby controlling the generation of real-time task processing instructions. In addition, real-time task processing instructions can also be sent based on interactive signals outside the system, and interactive terminals independent of the system can also control the processing and execution of real-time tasks. The embodiment of the present application does not limit the source of real-time task processing instructions.

[0052] Similarly, the task processing state of the transmission bus can be determined by accessing the state register of the transmission bus or accessing the task management unit of the system. The state register of the transmission bus can store the actual task processing state of the transmission bus, such as the type of task specifically processed by the transmission bus and whether the transmission bus participates in task processing within a certain time period, etc. The task management unit can also monitor the state of the transmission bus to store the task processing state of the transmission bus.

[0053] S102: When the task processing state of the transmission bus is the non-real-time task being processed state, determine whether the remaining processing time of the non-real-time task is greater than the maximum waiting time of the real-time task.

[0054] After obtaining the task processing state of the transmission bus, the subsequent steps are decided according to the task processing state of the transmission bus. If the task processing state of the transmission bus is an idle state or a real-time task processing state, the transmission bus can be directly controlled to respond to the real-time task processing instruction.

[0055] When the task processing state of the transmission bus is a non-real-time task being processed state, it indicates that the transmission bus is processing the non-real-time task at this time.

[0056] It should be noted that in the actual task processing scenario, both real-time tasks and non-real-time tasks have their own corresponding deadline processing time nodes. When the time node of a task exceeds its corresponding deadline processing time node but is not processed, the task processing failure will be marked. For example, the deadline processing time node of a real-time task is 1 pm. If the time exceeds 1 pm and the real-time task does not enter the processing state, it indicates that the real-time task processing has failed. Therefore, the maximum waiting time of the task can be calculated through the deadline processing time node corresponding to the task itself and the current time.

[0057] Correspondingly, when the task processing state of the transmission bus is the non-real-time task being processed state, if the remaining processing time of the non-real-time task is less than the maximum waiting time of the real-time task, it means that the real-time task can be processed before its corresponding deadline processing time node, and the occupation of the transmission bus by the non-real-time task will not affect the normal processing of the real-time task. On the contrary, if the remaining processing time of the non-real-time task is greater than the maximum waiting time of the real-time task, it means that the occupation of the transmission bus by the non-real-time task will affect the processing of the real-time task.

[0058] Therefore, even if a response to a real-time task processing instruction is required and the transmission bus is processing a non-real-time task, a preliminary judgment is required based on the actual remaining processing time of the non-real-time task and the maximum waiting time of the real-time task to avoid unnecessary adjustments.

[0059] S103: When the remaining processing time is greater than the maximum waiting time, the non-real-time task is split according to the maximum waiting time of the real-time task to obtain a plurality of subtasks, so that the real-time task can be processed within the maximum waiting time; there is a task interval processing time between two adjacent subtasks.

[0060] When it is determined that the remaining processing time of the non-real-time task is greater than the maximum waiting time of the real-time task, it means that the occupation of the transmission bus by the non-real-time task affects the normal processing of the real-time task. In order to ensure that the real-time task can smoothly enter the processing state within its maximum waiting time, it is necessary to perform task segmentation processing on the non-real-time task based on the maximum waiting time of the real-time task, and segment the entire non-real-time task into multiple subtasks with task interval processing time, so that the real-time task can be processed through the task interval processing time between the subtasks, thereby ensuring the normal processing of the real-time task and improving the operation stability of the system.

[0061] Next, the task segmentation process for non-real-time tasks in step S103 will be introduced in conjunction with the accompanying drawings of specific embodiments. Figure 3 , which is a flow chart of another task processing method based on the SRB bus provided in an embodiment of the present application, specifically comprising the following steps:

[0062] S201: performing segmentation preprocessing according to the maximum waiting time of the real-time task to obtain the remaining processing time of the current processing subtask; the remaining processing time of the current processing subtask is less than the maximum waiting time of the real-time task.

[0063] It is understandable that in the process of dividing a non-real-time task into multiple subtasks, each subtask obtained actually constitutes a completed task processing. Therefore, the subtasks can be divided into currently processed subtasks and pending subtasks. Figure 4 A task partitioning diagram of a non-real-time task is disclosed for understanding.

[0064] As shown in the figure, the currently processed subtask is used to represent the non-real-time task currently being processed, that is, D1 in the figure, and the other D2-D4 represent the subtasks to be processed. Although the non-real-time task is split, in order to prevent the interruption of the processing of the non-real-time task from affecting the operation of the system, after the non-real-time task is split, the real-time task needs to be processed only after the processing of the currently split subtask D1 is completed.

[0065] Therefore, even after the non-real-time task is split, if the remaining processing time of the current processing subtask is greater than the maximum waiting time of the real-time task, the real-time task still cannot be processed normally. In order to prevent this situation, before the non-real-time task is split, it is necessary to perform split preprocessing according to the maximum waiting time of the real-time task to determine the reasonable remaining processing time of the current processing subtask, so as to facilitate the subsequent task splitting based on the determined remaining processing time, and prevent the situation where the remaining processing time of the current processing subtask is greater than the maximum waiting time of the real-time task.

[0066] S202: performing task segmentation processing on the non-real-time task according to the remaining processing time of the currently processed subtask, the bandwidth data of the transmission bus, and the maximum processing time of the non-real-time task to obtain the plurality of subtasks.

[0067] It is understandable that in actual application scenarios, the bandwidth data of the transmission bus and the maximum processing time of non-real-time tasks will affect the task interval processing time between each subtask. If multiple subtasks are still divided out when the task interval processing time is long, the overall processing time of the non-real-time task may exceed the maximum processing time of the task, which will also cause the processing of the non-real-time task to fail and affect the operational stability of the system. Similarly, if the number of subtasks divided is large, the bandwidth of the transmission bus may not be able to match the processing of a large number of tasks. Therefore, even when ensuring the normal processing of real-time tasks, it is also necessary to simultaneously consider the task attributes of the non-real-time tasks themselves and the bandwidth of the transmission bus to perform task division.

[0068] Therefore, in the process of task segmentation, in order to ensure that the real-time task can be processed and completed before the arrival of the next subtask, the next subtask needs to enter the processing state after the real-time task is processed. When the real-time task is processed during the task interval processing time between subtasks D1 and D2, as long as the real-time task is not processed, the task processing state of D2 will be set to the waiting processing state.

[0069] Correspondingly, if the processing time of the real-time task itself is long, the interval processing time between the first subtask will be too long. In order to prevent the excessive interval processing time between the subsequent segmented subtasks from affecting the processing of non-real-time tasks, the subsequent D3-D4 task interval processing time can be appropriately reduced according to the bandwidth data of the transmission bus and the maximum processing time of the non-real-time task to ensure the rationality of task segmentation. Therefore, the task interval processing time between the current processing subtask and the adjacent to-be-processed subtask is different from the task interval processing time between the subsequent to-be-processed subtasks. When the real-time task needs to be processed for a long time, in order to ensure the smooth processing of both the real-time task and the non-real-time task while taking into account the actual bandwidth capacity of the transmission bus, the task interval processing time of the former is often greater than the task interval processing time of the latter.

[0070] Next, the task processing scenario and task scheduling process of the embodiment of the present application will be introduced in conjunction with the specific embodiment drawings, see Figure 5 , which is a schematic diagram of a task processing scenario and a task scheduling process provided in an embodiment of the present application.

[0071] As shown in the figure, in the task processing scenario of the embodiment of the present application, in order to improve the scheduling efficiency and processing efficiency of tasks, both real-time tasks and non-real-time tasks have their corresponding queue processing time nodes and deadline processing time nodes, and real-time tasks and non-real-time tasks are stored in a pre-set timer stack and active timer queue. Among them, the queue processing time node is the time node at which the task needs to be included in the queue processing queue, and the deadline processing time node is the final processing time node of the task.

[0072] The timer heap is used to store tasks that have not reached the queue processing time node. At the same time, the timer heap will monitor the time nodes of the tasks it stores. When the tasks stored in it reach their corresponding queue processing time nodes, the corresponding tasks are automatically sent to the active timer queue to ensure the normal scheduling of tasks.

[0073] The activity timer queue is used to store tasks that have reached the queue processing time node. At the same time, the activity timer queue will also prioritize the tasks stored in it according to the deadline processing time node of each task. When scheduling tasks in the activity timer queue, multiple tasks can be processed in an orderly manner through the task processing priority sorted by the activity timer queue to ensure the operation stability of the system. Among them, the processing priority of the task is determined based on the proximity of the deadline processing time node to the current time. The shorter the interval between the deadline processing time node of the task and the current time, the higher the processing priority of the task, so that the priority sorting of multiple tasks can be completed.

[0074] In a possible implementation, if the task being processed is a periodic task, after the task is processed, it is necessary to reprocess the task after its corresponding time period. Therefore, in order to ensure the normal processing of periodic tasks, whenever the task processing in the active timer queue is completed, it is necessary to obtain the task type of the completed task.

[0075] When the task type of the processed task is a periodic task, the processed task is subjected to task amplitude to obtain a first task with the same task content, and the first task is retransmitted to the timer stack, thereby realizing the periodic processing of the task. Among them, in order to ensure the periodic processing of the task, the queue processing time node and the deadline processing time node of the copied first task are different from the values ​​of the initial task, and the queue processing time node and the deadline processing time node of the copied first task need to be set according to the periodic processing time of the periodic task, which will not be elaborated in the embodiment of the present application.

[0076] From the description of the active timer queue in the previous article, it can be known that the active timer queue can prioritize the multiple tasks stored in it, so as to process the tasks in sequence according to the proximity of the deadline processing time node of each task to the current time. However, in actual application scenarios, the processing of some tasks may require the bus parameters of the transmission bus to meet the processing conditions of the task. When the task processing priority comes to this task, if the transmission bus cannot meet the processing conditions of the task at this time, it is necessary to delay the processing priority of this task and monitor the bus parameters of the transmission bus in real time. When the parameters of the transmission bus meet the processing conditions, the task is processed immediately.

[0077] Therefore, when responding to the task processing instruction, it is necessary to judge whether the bus state of the transmission bus at this time can meet the processing conditions of the corresponding task based on the real-time bus parameters of the transmission bus. Among them, the bus parameters of the transmission bus can be the current bandwidth utilization, data transmission delay and data throughput of the transmission bus. Through the bus parameters of the transmission bus, the operation status of the transmission bus can be judged, and then it is determined whether the second task corresponding to the task processing instruction can be processed.

[0078] If it is determined that the second task cannot be processed, the task processing device of the second task will be set to a waiting state, and the real-time bus parameters of the transmission bus will be monitored according to the task processing parameters of the second task itself, so that when the parameters of the transmission bus meet the processing conditions of the second task, the task processing for the second task can be carried out in time, thereby ensuring the operational stability of the system. Among them, the task processing parameters of the second task correspond to the real-time bus parameters of the transmission bus, which can specifically be the bandwidth requirements, transmission delay requirements, and throughput requirements for the bus, etc., which are not limited in the embodiments of the present application.

[0079] In another possible implementation, sometimes a task may not be processed in time. For any third task among multiple tasks, if the current time exceeds the deadline for processing the third task and the third task has not entered the processing state, it means that the third task has not been processed in time. In this case, in order to ensure the traceability of task processing, the task processing state of the third task needs to be recorded as an abnormal state so that remedial measures can be taken later.

[0080] The embodiment of the present application provides a task processing method based on an SRB bus. In the method, when a real-time task processing instruction needs to be responded to in order to process a real-time task, the task processing state of the transmission bus is first obtained to determine whether the transmission bus is being used to process a non-real-time task. When the transmission bus is being used to process a non-real-time task, in order to prevent the occupation of the transmission bus by the non-real-time task from affecting the processing of the real-time task, it is necessary to further determine whether the remaining processing time of the non-real-time task is greater than the maximum waiting time of the real-time task. When the remaining processing time of the non-real-time task is greater than the maximum waiting time of the real-time task, the non-real-time task is task-segmented according to the maximum waiting time of the real-time task to obtain a plurality of subtasks. Since there is a certain task interval processing time between the plurality of subtasks, after the current subtask is processed, the sudden real-time task can be processed by the interval time between the subtasks to ensure that the real-time task can be processed within the maximum waiting time. In this way, even if a sudden real-time task occurs when processing a non-real-time task, the non-real-time task can be task-segmented according to the specific time requirements of the real-time task, thereby ensuring the smooth processing of the real-time task and improving the operational stability of the system.

[0081] A task processing device based on an SRB bus provided in an embodiment of the present application is introduced below. The task processing device based on an SRB bus described below and the task processing method based on an SRB bus described above can refer to each other.

[0082] See also Figure 6 , which is a schematic diagram of the structure of a task processing device based on an SRB bus provided in an embodiment of the present application, including the following modules:

[0083] The acquisition module 100 is used to acquire the task processing state of the transmission bus in response to the real-time task processing instruction; the task processing state includes: the non-real-time task is being processed; the real-time task processing instruction is used to instruct the processing of the real-time task;

[0084] The judging module 200 is used to judge whether the remaining processing time of the non-real-time task is greater than the maximum waiting time of the real-time task when the task processing state of the transmission bus is the non-real-time task being processed state;

[0085] The splitting module 300 is used to split the non-real-time task according to the maximum waiting time of the real-time task when the remaining processing time is greater than the maximum waiting time, so as to obtain multiple sub-tasks, so that the real-time task can be processed within the maximum waiting time; there is a task interval processing time between two adjacent sub-tasks.

[0086] In a possible implementation, the segmentation module 300 is used to:

[0087] Perform segmentation preprocessing according to the maximum waiting time of the real-time task to obtain the remaining processing time of the current processing subtask; the remaining processing time of the current processing subtask is less than the maximum waiting time of the real-time task;

[0088] According to the remaining processing time of the currently processed subtask, the bandwidth data of the transmission bus and the maximum processing time of the non-real-time task, the non-real-time task is split into tasks to obtain the multiple subtasks.

[0089] In a possible implementation manner, the device further includes:

[0090] The state control module is used to set the task processing state of the multiple subtasks to a waiting state when the real-time task is not processed completely.

[0091] The real-time task and the non-real-time task are stored in a timer stack and an active timer queue, and the real-time task and the non-real-time task each have a corresponding queuing processing time node and a deadline processing time node;

[0092] The timer stack is used to store tasks that have not reached the queue processing time node, and when the tasks reach the queue processing time node, transfer the tasks that have reached the queue processing time node to the active timer queue;

[0093] The active timer queue is used to sort the priorities of the multiple tasks according to the processing deadline nodes to obtain the processing priorities corresponding to the multiple tasks.

[0094] In a possible implementation, the device further includes: a periodic task processing module; the periodic task processing module is used to:

[0095] When the task processing is completed, the task type of the task that has been processed is obtained;

[0096] When the task type is a periodic task, the completed task is copied to obtain a first task; the queue processing time node and the deadline processing time node of the first task are different from the queue processing time node and the deadline processing time node of the completed task;

[0097] The first task is transferred to the timer stack.

[0098] In a possible implementation, the device further includes: a condition determination module, the condition determination module being configured to:

[0099] In response to the task processing instruction, based on the real-time bus parameters of the transmission bus, determining whether the second task corresponding to the task processing instruction can be processed;

[0100] If the second task cannot be processed, the task processing state of the second task is set to a waiting state, and based on the task processing parameters of the second task, the real-time bus parameters of the transmission bus are monitored.

[0101] In a possible implementation, the device further includes:

[0102] The exception recording module is used for recording the task processing status of the third task as an abnormal status for a third task among the multiple tasks if the current time exceeds the deadline processing time node of the third task and the third task has not been processed.

[0103] See also Figure 7 , which is a structural diagram of a task processing electronic device based on an SRB bus provided in an embodiment of the present application, including:

[0104] A memory 11, used for storing computer programs;

[0105] The processor 12 is used to implement the steps of a task processing method based on the SRB bus described in any of the above method embodiments when executing the computer program.

[0106] In this embodiment, the device may be a vehicle-mounted computer, a PC (Personal Computer), or a terminal device such as a smart phone, a tablet computer, a PDA, or a portable computer.

[0107] The device may include a memory 11 , a processor 12 , and a bus 13 .

[0108] Among them, 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 device, such as a hard disk of the device. In other embodiments, the memory 11 can also be an external storage device of the device, such as a plug-in hard disk equipped on the device, 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 of the device and an external storage device. The memory 11 can not only be used to store application software installed in the device and various types of data, such as program codes for executing fault prediction methods, etc., but can also be used to temporarily store data that has been output or is to be output. The processor 12 can be a central processing unit (CPU) in some embodiments.

[0109] In some embodiments, the processor 12 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor or other data processing chip, and is used to run program codes or process data stored in the memory 11, such as program codes for executing a fault prediction method.

[0110] The bus 13 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 7 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0111] Furthermore, the device may also include a network interface 14, which may optionally include a wired interface and / or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is generally used to establish a communication connection between the device and other electronic devices.

[0112] Optionally, the device may further include a user interface 15, which may include a display (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 15 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 device and to display a visual user interface.

[0113] Figure 7 Only the device with components 11-15 is shown, and it can be understood by those skilled in the art that Figure 7 The structure shown does not constitute a limitation of the device, and may include fewer or more components than shown, or combine certain components, or arrange the components differently.

[0114] Based on the same inventive concept, corresponding to any of the above-mentioned embodiment methods, an embodiment of the present application also provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to perform the SRB bus-based task processing as described in any of the above embodiments.

[0115] The computer-readable media of the embodiments of the present application include permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device.

[0116] The computer instructions stored in the storage medium of the above embodiment are used to enable the computer to perform the task processing based on the SRB bus as described in any of the above embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.

[0117] It should be noted that each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for methods, devices, electronic devices and media, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments. The methods, devices, electronic devices and media described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components indicated as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0118] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A task processing method based on SRB bus, characterized in that: include: In response to the real-time task processing instruction, acquiring the task processing state of the transmission bus; The task processing state includes: a non-real-time task being processed state; the real-time task processing instruction is used to instruct the processing of the real-time task; When the task processing state of the transmission bus is the non-real-time task being processed state, determining whether the remaining processing time of the non-real-time task is greater than the maximum waiting time of the real-time task; When the remaining processing time is greater than the maximum waiting time, the non-real-time task is split according to the maximum waiting time of the real-time task to obtain a plurality of subtasks, so that the real-time task can be processed within the maximum waiting time; there is a task interval processing time between two adjacent subtasks; The subtasks include: a currently processed subtask and a pending subtask; the non-real-time task is split according to the maximum waiting time of the real-time task to obtain a plurality of subtasks, including: Perform segmentation preprocessing according to the maximum waiting time of the real-time task to obtain the remaining processing time of the current processing subtask; the remaining processing time of the current processing subtask is less than the maximum waiting time of the real-time task; According to the remaining processing time of the currently processed subtask, the bandwidth data of the transmission bus and the maximum processing time of the non-real-time task, the non-real-time task is split into tasks to obtain the multiple subtasks; The real-time task and the non-real-time task are stored in a timer stack and an active timer queue, and the real-time task and the non-real-time task each have a corresponding queuing processing time node and a deadline processing time node; The timer stack is used to store tasks that have not reached the queue processing time node, and when the tasks reach the queue processing time node, transfer the tasks that have reached the queue processing time node to the active timer queue; The active timer queue is used to sort the priorities of the multiple tasks according to the processing deadline nodes to obtain the processing priorities corresponding to the multiple tasks.

2. The method according to claim 1, characterized in that After obtaining the plurality of subtasks, the method further includes: When the real-time task is not processed completely, the task processing status of the plurality of subtasks is set to a waiting processing status.

3. The method according to claim 1, characterized in that The method further comprises: When the task processing is completed, the task type of the task that has been processed is obtained; When the task type is a periodic task, the completed task is copied to obtain a first task; the queue processing time node and the deadline processing time node of the first task are different from the queue processing time node and the deadline processing time node of the completed task; The first task is transferred to the timer stack.

4. The method according to claim 1, characterized in that: The method further comprises: In response to the task processing instruction, based on the real-time bus parameters of the transmission bus, determining whether the second task corresponding to the task processing instruction can be processed; If the second task cannot be processed, the task processing state of the second task is set to a waiting state, and based on the task processing parameters of the second task, the real-time bus parameters of the transmission bus are monitored.

5. The method according to claim 1, characterized in that The method further comprises: For a third task among the plurality of tasks, if the current time exceeds the deadline processing time node of the third task and the third task has not been processed, the task processing state of the third task is recorded as an abnormal state.

6. A task processing device based on SRB bus, characterized in that: The device is used to implement the task processing method of the SRB bus according to claim 1, comprising: An acquisition module, used for acquiring a task processing state of the transmission bus in response to a real-time task processing instruction; the task processing state includes: a non-real-time task being processed state; the real-time task processing instruction is used for instructing the processing of the real-time task; A judging module, configured to judge whether the remaining processing time of the non-real-time task is greater than the maximum waiting time of the real-time task when the task processing state of the transmission bus is the processing state of the non-real-time task; The splitting module is used to split the non-real-time task according to the maximum waiting time of the real-time task when the remaining processing time is greater than the maximum waiting time, so as to obtain multiple subtasks, so that the real-time task can be processed within the maximum waiting time; there is a task interval processing time between two adjacent subtasks.

7. An electronic device, characterized in that: The device comprises: a processor, a memory and a system bus; The processor and the memory are connected via the system bus; The memory is used to store one or more programs, and the one or more programs include instructions. When the instructions are executed by the processor, the processor executes the SRB bus-based task processing method according to any one of claims 1 to 5.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the SRB bus-based task processing method described in any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • Task processing method and device

    CN113327053A

  • Task processing method and system and related equipment

    CN113360263A