A method for coordinating and scheduling resources of a regional controller based on TSN time synchronization

By establishing a globally unified time base and joint optimization model within the regional controller, and coordinating the scheduling of computing and communication resources, the timing misalignment problem caused by the independence of computing and communication resources in the regional controller was solved, enabling deterministic execution of critical tasks and improving resource utilization efficiency.

CN123055710APending Publication Date: 2026-11-06CHENKONG ZHIXIN (SUZHOU) INTELLIGENT TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611201902.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-10
Publication Date
2026-11-06

AI Technical Summary

Technical Problem

In a regional controller, the independent scheduling of computing and communication resources leads to misalignment between task execution and network communication timing, increasing end-to-end control latency and system jitter, making it difficult to meet the resource contention and real-time requirements of multi-core heterogeneous platforms.

Method used

By establishing a globally unified time benchmark based on the TSN time synchronization protocol, task attributes are classified and dependencies are analyzed, a joint optimization model is constructed, computing and communication resources are coordinated and scheduled, and scheduling tables and gating lists are generated to ensure the synchronous operation of the computing core and TSN network nodes.

Benefits of technology

It achieves coordinated optimization of computing and communication resources within the regional controller, ensuring deterministic execution of critical control tasks, reducing end-to-end control latency and system jitter, and improving resource utilization efficiency of multi-core heterogeneous processor platforms.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123055710A_ABST
    Figure CN123055710A_ABST
Patent Text Reader

Abstract

This application relates to a resource collaborative scheduling method for regional controllers based on TSN time synchronization. The method includes: establishing a globally unified time base between the regional controller's computing core and TSN network nodes based on the TSN time synchronization protocol; classifying the controller's real-time tasks and TSN streams by attribute; analyzing task data dependencies; obtaining the execution time of each task in the computing core; constructing and solving a joint optimization model based on the unified time base and combining task, TSN stream, dependency, and execution time information, with constraints including task core mapping, execution order, completion time, and TSN stream transmission timing; parsing the scheduling results based on the unified time base; and generating scheduling tables for each computing core and gating lists for network nodes. This method enables collaborative optimization of computing and communication resources within the regional controller.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of automotive electronics and network communication technology, and in particular relates to a method for coordinated scheduling of regional controller resources based on TSN time synchronization. Background Technology

[0002] As automotive electronic and electrical architectures evolve towards regional centralization, control functions previously distributed across multiple ECUs are being integrated into single regional controllers. These regional controllers simultaneously handle traditional functions such as body control, power management, door and window control, and lighting control, as well as diagnostic services, network management, OTA upgrades, data acquisition, and information exchange with the central computing platform. This trend of functional integration significantly improves system resource utilization, but it also exacerbates resource contention within the controller.

[0003] In traditional distributed architectures, each ECU typically runs only a small number of control tasks, resulting in simple coupling between tasks and relatively easy real-time analysis. However, in a regional controller architecture, a single controller may run hundreds of software tasks simultaneously, involving applications across multiple functional domains and ASIL levels. Different tasks exhibit significant differences in real-time requirements, computational load, and communication needs. For example, functions like anti-pinch windows require millisecond-level response times, while diagnostic communication allows for greater latency. When these tasks share CPU, memory, cache, and network resources, problems such as resource contention, priority inversion, and task blocking can easily arise.

[0004] Currently, most vehicle controllers employ traditional static priority scheduling mechanisms, primarily designed for single-core or low-complexity systems. These mechanisms are ill-suited to the evolving needs of multi-core heterogeneous computing platforms in area controllers. As high-performance MCUs and SoCs are increasingly used in area controllers, software tasks are being deployed across cores, leading to frequent inter-task communication and data sharing. Without a proper task allocation and scheduling mechanism, some CPU cores will be overloaded while others remain idle, resulting in a decline in overall system efficiency.

[0005] Meanwhile, there is a tight coupling between task execution within the regional controller and TSN network communication. After a control task completes its calculations, it needs to send control data through the TSN network within a specified time window; the data received by the network then needs to trigger subsequent task execution in a timely manner. If computational resource scheduling and communication resource scheduling are independent, it can easily lead to a misalignment between task execution time and network transmission time, thereby increasing end-to-end control latency and system jitter. Summary of the Invention

[0006] Therefore, it is necessary to provide a TSN-based resource collaborative scheduling method for regional controllers that can achieve collaborative optimization of computing and communication resources within the regional controller, reduce end-to-end control latency and system jitter, and ensure deterministic execution of critical control tasks, in order to address the aforementioned technical problems.

[0007] Firstly, this application provides a method for coordinated scheduling of regional controller resources based on TSN time synchronization, including:

[0008] S1. Based on the TSN time synchronization protocol, establish a globally unified time reference among each computing core and each TSN network node within the regional controller;

[0009] S2. Classify the real-time tasks in the area controller by attributes to obtain a task set. Classify the TSN streams in the area controller by attributes to obtain a stream set. Perform dependency analysis on the data interaction relationships between tasks in the task set to obtain a task dependency relationship set.

[0010] S3. Obtain the execution time information of each task in the task set on each computing core of the regional controller;

[0011] S4. Based on a globally unified time base, the task set, stream set, task dependency set, and execution time information are taken as inputs, and the task-to-core mapping, the execution order of tasks within the core, the task completion time, and the TSN stream sending sequence are taken as constraints to construct a joint optimization model. Based on the joint optimization model, the collaborative scheduling scheme is solved.

[0012] S5. Based on the global unified time base, the collaborative scheduling scheme is parsed and transformed to generate a scheduling table for each computing core and a gating list for each TSN network node, with the global unified time base as the triggering base. The scheduling table and gating list are then sent to the corresponding computing core and TSN network node.

[0013] Secondly, this application also provides a regional controller resource collaborative scheduling device based on TSN time synchronization, comprising:

[0014] The time base establishment module is used to establish a globally unified time base between each computing core and each TSN network node within the regional controller based on the TSN time synchronization protocol.

[0015] The attribute classification and dependency analysis module is used to classify the attributes of real-time tasks in the region controller to obtain a task set, classify the attributes of TSN streams in the region controller to obtain a stream set, and perform dependency analysis on the data interaction relationships between tasks in the task set to obtain a task dependency relationship set.

[0016] The execution time acquisition module is used to acquire the execution time information of each task in the task set on each computing core of the region controller;

[0017] The joint optimization solution module is used to construct a joint optimization model based on a global unified time base, taking the task set, stream set, task dependency set and execution time information as inputs, and the task-to-core mapping, the execution order of tasks within the core, the task completion time and the TSN stream sending time sequence as constraints. Based on the joint optimization model, the coordinated scheduling scheme is solved.

[0018] The parsing, conversion, and sending module is used to parse and convert the collaborative scheduling scheme based on the global unified time base, generate the scheduling table of each computing core and the gating list of each TSN network node with the global unified time base as the triggering base, and send the scheduling table and gating list to the corresponding computing core and TSN network node.

[0019] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of any of the methods described above.

[0020] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the methods described above.

[0021] The aforementioned regional controller resource collaborative scheduling method based on TSN time synchronization establishes a globally unified time base among the computing cores and TSN network nodes within the regional controller. This provides a unified time reference coordinate system for the execution time of computing tasks and the transmission time of TSN streams, reducing scheduling deviations caused by clock asynchrony. The method categorizes real-time tasks by attributes to obtain task sets, TSN streams by attributes to obtain stream sets, and performs dependency analysis on data interaction relationships between tasks to obtain task dependency sets. This transforms the real-time requirements and constraints of the computing and communication sides into a unified mathematical expression that can be processed by optimization algorithms. Furthermore, it obtains the execution time information of each task on each computing core to provide a basis for mapping decisions. The quantitative basis involves using task sets, stream sets, task dependency sets, and execution time information as inputs under a globally unified time benchmark. A joint optimization model is constructed and solved using constraints such as task-to-core mapping, task execution order within a core, task completion time, and TSN stream transmission timing. This integrates computational and communication resource scheduling into the same optimization framework, resolving timing misalignments between the computation and communication sides through the coupling constraint between task completion time and TSN stream transmission timing. The solved collaborative scheduling scheme is parsed and converted into scheduling tables for each computational core and gating lists for each TSN network node, ensuring that both computational cores and TSN network nodes operate collaboratively based on a globally unified time benchmark. This method enables collaborative optimization of computational and communication resources within a regional controller, ensuring deterministic execution of critical control tasks, reducing end-to-end control latency and system jitter, and improving resource utilization efficiency of multi-core heterogeneous processor platforms. Attached Figure Description

[0022] To more clearly illustrate the technical solutions in the embodiments or related technologies of this application, the accompanying drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0023] Figure 1 A flowchart illustrating a method for coordinated scheduling of regional controller resources based on TSN time synchronization, provided as an exemplary embodiment of this application;

[0024] Figure 2 This is a schematic diagram of a regional controller resource collaborative scheduling device based on TSN time synchronization, provided as an exemplary embodiment of this application. Detailed Implementation

[0025] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0026] In one embodiment, such as Figure 1 As shown, a method for coordinated resource scheduling of a regional controller based on TSN time synchronization is provided. This embodiment illustrates the application of this method to a coordinated scheduling terminal. It is understood that this method can also be applied to a coordinated scheduling server, and further to a system including both a coordinated scheduling terminal and a coordinated scheduling server, and is implemented through the interaction between the coordinated scheduling terminal and the coordinated scheduling server. In this embodiment, the method includes the following steps:

[0027] S1. Based on the TSN time synchronization protocol, a globally unified time reference is established among the computing cores and TSN network nodes within the regional controller.

[0028] Specifically, the collaborative scheduling terminal can select a node equipped with a high-stability crystal oscillator and GNSS time synchronization reception capability from all nodes covered by the TSN network as the global master clock. This global master clock broadcasts synchronization messages with precise timestamps to the entire network through precise time synchronization protocol frames defined in the TSN protocol stack according to a pre-configured synchronization period. When the network interface controller of each computing core in the area controller receives the synchronization frame at the physical layer, the built-in hardware timestamp unit immediately records the precise arrival time of the frame at the media access control sublayer. This precise arrival time can be referenced by the local hardware clock counter.

[0029] Furthermore, the collaborative scheduling terminal can obtain the cumulative time correction field and the original timestamp of the master clock carried in the synchronization frame through the time synchronization daemon running on each computing core, and calculate the clock deviation between the local clock and the global master clock by combining it with the reception time recorded by the local hardware. The collaborative scheduling terminal can write the calculated clock deviation and frequency drift rate into the compensation register of the local clock counter, and the hardware will automatically complete the clock phase adjustment and frequency locking. After a preset number of synchronization interactions, the deviation between the local clock of each computing core and the global master clock converges to a preset accuracy range, completing the establishment of a globally unified time base.

[0030] Optionally, the frequency drift rate can be the rate of change of the normalized deviation of the actual frequency of the local clock oscillator relative to the global master clock reference frequency over time.

[0031] S2. Classify the attributes of real-time tasks in the area controller to obtain a task set. Classify the attributes of TSN streams in the area controller to obtain a stream set. Perform dependency analysis on the data interaction relationships between tasks in the task set to obtain a task dependency set.

[0032] Specifically, the collaborative scheduling terminal can read the parameters of all periodic real-time tasks from the application software configuration file of the area controller. The terminal can extract the initial phase, task period, relative deadline, worst-case execution time, security integrity level, communication attribute set, and maximum allowable scheduling jitter for each periodic real-time task. These parameters are then encapsulated according to a preset seven-tuple data structure to obtain the task seven-tuple corresponding to the periodic real-time task. The collaborative scheduling terminal can also obtain the minimum arrival interval for occasional tasks and use this minimum arrival interval as the equivalent period, encapsulating it together with the other six task constraint parameters to form an occasional task seven-tuple.

[0033] Furthermore, the collaborative scheduling terminal can read the flow period, data frame length, maximum allowed end-to-end transmission delay, network priority, and source task index of each TSN flow that the area controller needs to send from the TSN configuration database. It then encapsulates these parameters into a flow 5-tuple according to a preset 5-tuple data structure. The collaborative scheduling terminal can obtain the flow identifier and destination task identifier of each TSN flow that the area controller needs to receive, establish a trigger mapping relationship between the received flow and the task, and stipulate that when the complete data frame of the received flow arrives at the network card and passes verification, the task bound to the received flow switches from a non-ready state to a ready state.

[0034] Furthermore, the collaborative scheduling terminal can traverse all task pairs in the task set, check whether the input data of one task comes from the output data of another task, and when such data interaction is detected, establish a one-way dependency pair from the output task to the input task, and summarize all detected one-way dependency pairs into a task dependency set.

[0035] S3. Obtain the execution time information of each task in the task set on each computing core of the regional controller.

[0036] Specifically, the collaborative scheduling terminal can read the worst-case execution time of each task in the task set on each computing core of the regional controller, and use it as an element of the execution time matrix. Based on the task identifier of each task in the task set, the collaborative scheduling terminal can retrieve the worst-case execution time record corresponding to each task identifier on each computing core from the hardware performance database, read the time value in the record as the worst-case execution time, and fill the corresponding positions in the execution time matrix according to the task number and core number. The resulting execution time matrix is ​​the execution time information. The row index of this execution time matrix corresponds to the task number, the column index corresponds to the computing core number, and each element in the execution time matrix represents the worst-case execution time of a specific task on a specific core.

[0037] Optionally, the hardware performance database can be constructed as follows: Test cases for each task are run on each computing core of the target hardware platform. The number of clock cycles consumed to execute the task under worst-case input conditions is recorded using the hardware performance counters built into each computing core. This number of clock cycles is then converted into the worst-case execution time in microseconds by combining the operating frequency of each computing core. The collaborative scheduling terminal can call static timing analysis tools to perform instruction-level execution path analysis on the compiled binary code of tasks that cannot be tested on the physical platform due to hardware resource limitations. This yields the number of instructions in each execution path. The worst-case execution time is estimated by combining the instruction execution latency model and safety margin coefficient of each computing core, resulting in the worst-case execution time of each task on each computing core. This hardware performance database stores the worst-case execution times of all tasks in the task set on each computing core of the region controller.

[0038] Optionally, the worst-case execution time can be an upper bound of the time required for the task to execute under any combination of input data, which can be used to ensure that the real-time task meets the deadline in any scenario. The value of the upper bound is the execution time measured or estimated when the task is executed on a specific computing core under the conditions of complete cache invalidation and complete branch prediction failure.

[0039] S4. Based on a globally unified time base, the task set, stream set, task dependency set, and execution time information are taken as inputs, and the task-to-core mapping, the execution order of tasks within the core, the task completion time, and the TSN stream sending sequence are taken as constraints to construct a joint optimization model. Based on the joint optimization model, the collaborative scheduling scheme is solved.

[0040] Specifically, the collaborative scheduling terminal can use task sets, stream sets, task dependency sets, and execution time matrices as input data, and the established global unified time benchmark as a unified reference coordinate system for all time parameters to construct a joint optimization model. The joint optimization model is implemented using mixed integer programming, and its construction process is as follows: The collaborative scheduling terminal can define binary mapping variables for each task and each computing core based on the number of tasks and computing cores in the task set. It applies equality constraints based on the actual constraint that each task can only be assigned to one computing core, and imposes a constraint that the total computational load of tasks assigned to each computing core does not exceed the available computing bandwidth of that core, based on the worst-case execution time of each task on each computing core and the cycle of each task. The collaborative scheduling terminal can also apply execution order constraints to tasks assigned to the same core based on dependency pairs in the task dependency set. For two tasks with data dependencies, the dependent task must be completed before its dependent task. The collaborative scheduling terminal can apply coupling constraints to the tasks that generate TSN flows based on the source task index of each flow in the flow set. This constraint adds the task's completion time to the transmission delay of the flow's data frame on the link, setting the transmission delay to not exceed the start time of the transmission window allocated to the TSN flow in the current scheduling period. This aligns the computation completion time with the network transmission window on the timeline. After defining the variables and constructing the constraints, the collaborative scheduling terminal can prioritize minimizing the number of tasks that miss their deadlines and secondarily minimize the weighted sum of the end-to-end control link delays, resulting in a joint optimization model.

[0041] Furthermore, the collaborative scheduling terminal can substitute the specific values ​​from the task set, flow set, dependency set, and execution time matrix into the corresponding parameter positions in the joint optimization model, and solve the problem using a priority-based heuristic method—determining the allocation core and execution order of each task sequentially according to the task's security integrity level from high to low and the relative deadline from short to long. After solving, the collaborative scheduling terminal can summarize the mapping results of each task, the task execution order on each core, and the initial transmission time slot of each TSN flow, and output the collaborative scheduling scheme.

[0042] S5. Based on the global unified time base, the collaborative scheduling scheme is parsed and transformed to generate a scheduling table for each computing core and a gating list for each TSN network node, with the global unified time base as the triggering base. The scheduling table and gating list are then sent to the corresponding computing core and TSN network node.

[0043] Specifically, the collaborative scheduling terminal can extract the mapping results from each task to the target computing core and the execution order of tasks on each core from the collaborative scheduling scheme. The collaborative scheduling terminal can fill the task identifier of each task into the scheduling table entry in sequence according to the execution order of tasks on the computing core, and calculate the expected start time and expected completion time of each task with reference to the global unified time base, and generate the scheduling table of the computing core.

[0044] Furthermore, the collaborative scheduling terminal can extract the initial transmission time slot and period of each TSN flow from the collaborative scheduling scheme, and calculate the start time and duration of the transmission window for each TSN flow within each period according to a preset macro-period length. Each transmission window is converted into an entry in the gating list of the corresponding TSN switch output port. This entry can include the window duration and an 8-bit gating status mask. In the gating status mask, the bit corresponding to the priority queue to which the TSN flow belongs is set to 1 to indicate it is enabled, and the bits corresponding to other queues are set to 0 to indicate it is disabled. The collaborative scheduling terminal can arrange the gating entries of all flows passing through the same output port in chronological order to generate a complete gating list for that port. The collaborative scheduling terminal can load the scheduling table into the scheduler of the corresponding core through the operating system scheduling interface of the computing core, and distribute the gating list to the hardware schedulers of each TSN switch port and terminal node network card through the TSN centralized network configuration protocol, so that all scheduling tables and gating lists use a globally unified time base as the clock source for triggering execution.

[0045] In the aforementioned regional controller resource collaborative scheduling method based on TSN time synchronization, the collaborative scheduling terminal can establish a globally unified time base between each computing core and TSN network node within the regional controller. This provides a unified time reference coordinate system for the execution time of computing tasks and the transmission time of TSN streams, reducing scheduling deviations caused by clock asynchrony. The method also involves classifying real-time tasks by attributes to obtain task sets, classifying TSN streams by attributes to obtain stream sets, and performing dependency analysis on data interaction relationships between tasks to obtain task dependency sets. This transforms the real-time requirements and constraints of the computing and communication sides into a unified mathematical expression that can be processed by optimization algorithms, and obtains the execution time information of each task on each computing core as a mapping. The decision-making process provides quantitative evidence. Under a globally unified time benchmark, the task set, stream set, task dependency set, and execution time information are used as inputs. A joint optimization model is constructed and solved using task-to-core mapping, task execution order within the core, task completion time, and TSN stream transmission timing as constraints. This integrates computing resource scheduling and communication resource scheduling into the same optimization framework. The coupling constraint between task completion time and TSN stream transmission timing resolves timing misalignments between the computing and communication sides. The solved collaborative scheduling scheme is parsed and converted into scheduling tables for each computing core and gating lists for each TSN network node, and then transmitted. This ensures that both computing cores and TSN network nodes operate collaboratively based on a globally unified time benchmark. This method enables collaborative optimization of computing and communication resources within a regional controller, ensuring deterministic execution of critical control tasks, reducing end-to-end control latency and system jitter, and improving resource utilization efficiency of multi-core heterogeneous processor platforms.

[0046] In one embodiment, S2 may include:

[0047] S21. Extract the task attribute parameters of each periodic real-time task, and use the task attribute parameters as attribute items of the periodic real-time task to construct the task seven-tuple corresponding to each periodic real-time task.

[0048] Optionally, real-time tasks may include, but are not limited to, periodic real-time tasks and occasional tasks, and TSN streams may include, but are not limited to, TSN streams to be sent and TSN streams to be received.

[0049] Specifically, the collaborative scheduling terminal can read the configuration records of all periodic real-time tasks from the application software configuration file of the regional controller. The terminal can then extract the initial phase, task period, relative deadline, worst-case execution time, security integrity level, communication attribute set, and maximum allowable scheduling jitter of each configuration record as task attribute parameters. The terminal can then encapsulate these parameters into a preset seven-tuple data structure to obtain the corresponding task seven-tuple. This seven-tuple can then record all time constraints and priority information required for subsequent scheduling optimization in a structured manner.

[0050] Optionally, task attribute parameters may include, but are not limited to, initial phase, task period, relative deadline, worst-case execution time, security integrity level, set of communication attributes, and maximum allowable scheduling jitter.

[0051] Optionally, the task 7-tuple can be used to characterize the scheduling characteristics and timing constraints of periodic real-time tasks.

[0052] S22. Obtain the minimum arrival interval of each occasional task, and use the minimum arrival interval as the equivalent period. Extract the task constraint parameters of each occasional task, and encapsulate the equivalent period and task constraint parameters in a structured manner to obtain the occasional task 7-tuple for each occasional task.

[0053] Specifically, the collaborative scheduling terminal can read all configuration records of occasional tasks from the application software configuration file of the area controller. The terminal can extract the minimum arrival interval from each occasional task's configuration record, using this minimum arrival interval as the equivalent period of the task. It can also extract the initial phase, relative deadline, worst-case execution time, security integrity level, communication attribute set, and maximum allowable scheduling jitter as the task constraint parameters. The terminal can then encapsulate the equivalent period and task constraint parameters using the same seven-tuple data structure as periodic real-time tasks, obtaining the corresponding occasional task seven-tuple.

[0054] Among them, the occasional task 7-tuple is used to characterize the scheduling characteristics and timing constraints of occasional tasks.

[0055] S23. Combine the seven-tuple of tasks and the seven-tuple of occasional tasks to obtain the task set.

[0056] Specifically, the collaborative scheduling terminal can merge the task 7-tuples of all periodic real-time tasks and the occasional task 7-tuples of all occasional tasks into the same data structure. This data structure is maintained in the form of a task list. Each entry in the task list can contain a task identifier and the corresponding 7-tuple data. The task identifier is composed of a unique number assigned to each task by the collaborative scheduling terminal during the merging process. This unique number is used as the index of the task in the set in subsequent steps. After the merging is completed, a task set including all real-time tasks to be scheduled is obtained.

[0057] S24. Obtain the flow communication characteristic parameters of the TSN stream to be sent, and construct the flow communication characteristic parameters in a structured manner to obtain the flow quintuple corresponding to each TSN stream.

[0058] Specifically, the collaborative scheduling terminal can read the configuration records of all TSN flows that the regional controller needs to send in each scheduling cycle. The collaborative scheduling terminal can extract the flow period, data frame length, maximum allowable end-to-end transmission delay, network priority, and the index number of the source task that generated the flow data in the task set as the flow communication feature parameters of the TSN flow to be sent. Then, the flow communication feature parameters are encapsulated according to a preset five-tuple data structure to obtain the flow five-tuple corresponding to the TSN flow to be sent.

[0059] Optionally, the streaming communication characteristic parameters may include, but are not limited to, streaming period, data frame length, maximum allowed end-to-end transmission delay, network priority, and source task index.

[0060] Optionally, the stream quintuple can be used to characterize the communication characteristics and timing constraints of the TSN stream to be sent.

[0061] S25. Match and map the arrival time of the TSN stream to be received with the release time of the corresponding task in the task set to obtain the trigger mapping relationship between the TSN stream to be received and the corresponding task.

[0062] Specifically, the collaborative scheduling terminal can read the configuration records of all TSN streams that the area controller needs to receive. The collaborative scheduling terminal can obtain the stream identifier of the TSN stream to be received and the task identifier of the destination task of the data carried by the TSN stream in the task set, and bind the stream identifier and the task identifier to obtain the trigger mapping relationship from the TSN stream to be received to the corresponding task.

[0063] Optionally, the trigger mapping relationship may record trigger condition parameters. These trigger condition parameters stipulate that when a complete data frame of the TSN stream to be received is fully received by the network card and the cyclic redundancy check passes, the task bound to the TSN stream to be received switches from a non-ready state to a ready state. The release time is set to the time when the data frame is received and the preset protocol stack parsing overhead.

[0064] S26. Combine the five-tuples of each stream with the trigger mapping relationship to obtain the stream set.

[0065] Specifically, the collaborative scheduling terminal can merge the flow 5-tuples of all TSN flows to be sent and the trigger mapping relationships of all TSN flows to be received into the same data structure. This data structure is maintained in the form of a flow list. Each entry in the flow list includes a flow identifier and the 5-tuple data or trigger mapping relationship data corresponding to the TSN flow to be received. After merging, a flow set containing all TSN flows to be scheduled is obtained.

[0066] S27. Traverse the task pairs in the task set. When the input data of one task in a task pair depends on the output data of another task in the task pair, establish a one-way dependency relationship between the task pairs, obtain the dependency relationships of each task, and combine the dependency relationships of each task to obtain a set of task dependencies.

[0067] Specifically, the collaborative scheduling terminal can pair all tasks in the task set. It reads the input data source identifier recorded in the communication attribute set of one task in each task pair, and checks whether this identifier matches the output data identifier recorded in the communication attribute set of the other task. If a match is found, it determines that the input data of the task pair depends on the output data of the other task. The collaborative scheduling terminal can then establish a one-way dependency pair from the task to the input data. After traversing all task pairs, the collaborative scheduling terminal can summarize all one-way dependency pairs into a task dependency set.

[0068] Optionally, each pair of dependencies in the task dependency set can be used to restrict the execution of dependent tasks to take precedence over dependent tasks when building a joint optimization model later.

[0069] In this embodiment, the collaborative scheduling terminal can construct task 7-tuples by extracting task attribute parameters of periodic real-time tasks and occasional tasks, construct flow 5-tuples by extracting flow communication feature parameters of the TSN stream to be sent, establish trigger mapping relationship from the TSN stream to be received to the corresponding task, merge all task 7-tuples and occasional task 7-tuples into a task set, merge all flow 5-tuples and trigger mapping relationship into a flow set, traverse the task pairs in the task set and establish unidirectional dependency relationship based on input and output data identifiers to summarize into a task dependency relationship set. In this way, all real-time requirements and constraints of the computing side and communication side in the area controller as well as the data interaction dependency relationship between tasks are transformed into a unified structured data expression form, providing a complete input data foundation for the construction of the subsequent joint optimization model.

[0070] In one embodiment, S25 may include:

[0071] S251. Based on each TSN stream to be received, identify the associated tasks from the task set that use the arrival of the TSN stream to be received as the release condition, and combine the associated tasks to obtain the associated task set of the TSN stream to be received.

[0072] For example, the collaborative scheduling terminal can sequentially read the flow identifier of each TSN stream to be received. For the currently read TSN stream to be received, the collaborative scheduling terminal can traverse each task in the task set and check the data source type recorded in the communication attribute set of the task's seven-tuple. When the data source type of the task is marked as network input and its dependent flow identifier is consistent with the flow identifier of the current TSN stream to be received, the collaborative scheduling terminal can determine the task as an associated task with the arrival of the TSN stream to be received as the release condition. All tasks determined as associated tasks are arranged in the order of their index in the task set to obtain the associated task set of the TSN stream to be received.

[0073] S252. Bind the stream identifier of the TSN stream to be received to the task identifier of each associated task in the associated task set to obtain the stream task binding relationship, and configure the trigger condition parameters of the stream task binding relationship to obtain the trigger rule.

[0074] For example, the collaborative scheduling terminal can pair the flow identifier of the currently received TSN flow with the task identifier of each associated task in the associated task set corresponding to the flow one by one. Each pairing forms a flow task binding relationship, which records which flow arrival will trigger the release of which task.

[0075] Furthermore, the collaborative scheduling terminal can configure trigger condition parameters for each stream task binding relationship. These trigger condition parameters can include a trigger time calculation method and a trigger validity determination condition. The trigger time calculation method specifies that the instant when a complete data frame of the TSN stream to be received is completely received by the network card and the cyclic redundancy check passes is taken as the trigger time. The trigger time plus the preset protocol stack parsing overhead is taken as the release time of the associated task. The trigger validity determination condition specifies that the trigger rule takes effect when the verification status of the data frame is passed.

[0076] Optionally, the triggering rule can be used to characterize the conditions that trigger the associated task to enter the ready state when the TSN stream to be received arrives.

[0077] S253. Combine the binding relationships of each stream task and the triggering rules corresponding to each stream task binding relationship to obtain the trigger mapping relationship.

[0078] For example, the collaborative scheduling terminal can summarize all the flow task binding relationships corresponding to the same TSN flow to be received and the trigger rules configured for each flow task binding relationship into a data structure entry. This data structure entry can use the flow identifier of the TSN flow to be received as the primary key, and the list of task identifiers of all associated tasks corresponding to the flow identifier and the trigger rules corresponding to each associated task as the value content, so as to obtain the complete trigger mapping relationship from the TSN flow to be received to all its associated tasks.

[0079] Furthermore, the collaborative scheduling terminal can perform the above-mentioned aggregation operation on all TSN streams to be received to obtain the trigger mapping relationship corresponding to each of the TSN streams to be received.

[0080] In this embodiment, the collaborative scheduling terminal can identify associated tasks from the task set that use the arrival of the TSN stream to be received as a release condition and combine them into an associated task set. It can bind the stream identifier of the TSN stream to be received with the task identifier of each associated task in the associated task set and configure trigger condition parameters to obtain trigger rules. Then, it can combine the binding relationship of each stream task and its corresponding trigger rules into a trigger mapping relationship, thereby establishing a complete trigger link from the TSN stream to be received to its associated task. This allows the arrival time of the received stream data to be accurately mapped to the release time of the corresponding task, providing a deterministic release triggering mechanism for tasks in the task set that depend on network input data.

[0081] In one embodiment, the cooperative scheduling scheme obtained by solving the joint optimization model in S4 may include:

[0082] S41. Based on the security integrity level from high to low and the relative deadline from short to long, sort the tasks in the task set in a multi-level order to obtain the task priority sequence.

[0083] For example, the collaborative scheduling terminal can read the security integrity level parameter and relative deadline parameter of each task from the task set. The terminal can first sort all tasks according to their security integrity level from highest to lowest, placing the task with the highest security integrity level at the beginning of the sequence. Within the same security integrity level, the terminal can then sort these tasks a second time according to their relative deadline from shortest to longest, placing the task with the shortest relative deadline at the beginning of the sequence for that security integrity level. After multiple levels of sorting, a task priority sequence is obtained, arranged from highest to lowest priority.

[0084] S42. Based on the task priority sequence, traverse each computing core of the current task, identify the expected completion time of the current task on each computing core, and select the computing core and insertion position that meet the preset deadline requirement as candidate temporary allocation schemes.

[0085] For example, the collaborative scheduling terminal can read the currently assigned tasks sequentially from the first task according to the task priority sequence. Based on the current task, the collaborative scheduling terminal can traverse each computing core in the regional controller and traverse each possible insertion position in the current task execution sequence of each computing core. Based on each combination of computing core and insertion position, the collaborative scheduling terminal can insert the current task into the position, calculate the expected completion time of the current task, and select all combinations of computing cores and insertion positions whose expected completion time is earlier than or equal to the current task's relative deadline as candidate temporary allocation schemes.

[0086] Alternatively, the expected completion time of the current task can be calculated using the following formula:

[0087] ;

[0088] In the formula, Indicates task In the computing core Insertion position The expected completion time at the location, Represents the computing core Insertion position The sum of the execution times of all previously assigned tasks, Indicates task In the computing core Worst-case execution time The unit is microseconds, and its physical meaning is the cumulative time occupied by the core from the start of the scheduling cycle to the start of the current task execution.

[0089] S43. Determine whether the current task is a task that generates a TSN stream. If so, calculate the time deviation between the data frame readiness time and the TSN stream transmission time sequence of the current task based on each candidate temporary allocation scheme. Compare the absolute values ​​of each time deviation to obtain the comparison result. Based on the comparison result, select the candidate temporary allocation scheme with the smallest absolute value as the target allocation scheme of the current task. If not, select the candidate temporary allocation scheme with the earliest expected completion time as the target allocation scheme of the current task.

[0090] For example, the collaborative scheduling terminal can determine whether the network flow identifier of the data to be sent is recorded in the communication attribute set of the corresponding task seven-tuple of the current task. When the network flow identifier of the data to be sent is recorded in the communication attribute set, the current task is determined to be a task that generates TSN flow. The collaborative scheduling terminal can take the expected completion time of the current task in the candidate temporary allocation scheme as the data frame ready time, and read the start time of the sending window of the TSN flow generated by the task in the current scheduling period from the flow set. The time deviation is obtained by subtracting the start time of the sending window from the data frame ready time.

[0091] Furthermore, the collaborative scheduling terminal can calculate the absolute value of the time deviation corresponding to each candidate temporary allocation scheme, sort the absolute values ​​of the time deviation corresponding to each candidate temporary allocation scheme in ascending order, and select the candidate temporary allocation scheme with the smallest absolute value as the target allocation scheme for the current task; when no network flow identifier is recorded in the communication attribute set, the collaborative scheduling terminal can select the scheme with the earliest expected completion time from all candidate temporary allocation schemes as the target allocation scheme for the current task.

[0092] S44. Assign the current task to the target computing core and target insertion position corresponding to the target allocation scheme to obtain the initial scheduling result.

[0093] For example, the collaborative scheduling terminal can read the target computing core number and the target insertion position in the current task execution sequence of the core from the target allocation scheme, write the task identifier, expected start time and expected completion time of the current task into the corresponding position in the task execution sequence of the target computing core according to the insertion sequence, and update the task execution order list of the computing core. After all tasks have completed the above allocation in sequence according to the task priority sequence, the collaborative scheduling terminal can summarize the updated task execution order list of each computing core into an initial scheduling result. The initial scheduling result may include the execution order of all allocated tasks on each core and the expected start time and expected completion time of each task.

[0094] S45. Record the start time of the sending window of the TSN stream to be sent as the initial sending time slot, and optimize the execution order of adjacent tasks by swapping them to obtain the optimized scheduling result.

[0095] For example, the collaborative scheduling terminal can extract the task execution order list for each computing core from the initial scheduling result. The terminal can then sequentially check each pair of adjacent tasks in the task execution order list for each computing core, attempting to swap their execution order and recalculate their completion times. If the completion times of both tasks after the swap are no later than before the swap, and the relative deadline constraints are still satisfied, the terminal can perform the swap operation in the task execution order list and update the task execution order list for that computing core. After performing the above adjacent swap attempts on all computing cores, the optimized scheduling result is obtained. The collaborative scheduling terminal can read the start time of the transmission window for each TSN stream to be sent from the stream set and record this start time as the initial transmission time slot for that stream.

[0096] Alternatively, the start time of the transmission window in subsequent periods can be calculated using the following formula:

[0097] ;

[0098] In the formula, Represents a stream In the The start time of the transmission window within each cycle, Represents a stream The initial transmission time slot, Represents a non-negative integer. Represents a stream The sending cycle.

[0099] S46. Combining the optimized scheduling results and the initial transmission time slots, a collaborative scheduling scheme is obtained.

[0100] For example, the collaborative scheduling terminal can summarize the optimized task execution order list of each core and the initial transmission time slot of each TSN stream to be sent obtained in S45 into the same data structure. This data structure is maintained in the form of a scheduling scheme and includes three main parts: a task mapping field, a task order field, and a stream time slot field. The task mapping field can record the target computing core number to which each task is assigned, the task order field can record the execution order of tasks on each core, and the stream time slot field can record the initial transmission time slot of each TSN stream to be sent in the current scheduling period. After the summary is completed, the output is a complete collaborative scheduling scheme.

[0101] In this embodiment, the collaborative scheduling terminal can generate a task priority sequence by sorting tasks by security integrity level and deadline time in multiple levels. According to the task priority sequence, candidate cores and insertion positions that meet the deadline requirements are selected for each task in turn. For tasks that generate TSN streams, the minimum absolute value of the deviation between the data frame ready time and the start time of the transmission window is used as the basis for selecting the target allocation scheme. For tasks that do not generate TSN streams, the earliest expected completion time is used as the selection basis. After the task is allocated to the target core, the initial scheduling result is optimized by exchanging the execution order of adjacent tasks and the initial transmission time slot of each TSN stream is recorded. The collaborative scheduling scheme is obtained by combining the results, thereby achieving accurate alignment of the calculation completion time and TSN transmission window and reducing end-to-end control latency while meeting the task deadline.

[0102] In one embodiment, the expression for the time offset can be:

[0103] ;

[0104] In the formula, Indicates time deviation, Indicates the time when the data frame for the current task is ready. This indicates the start time of the transmission window allocated to the TSN stream generated by the current task within the current scheduling period.

[0105] Specifically, after determining that the current task is one that generates a TSN stream, the collaborative scheduling terminal can use the expected completion time of the current task in the candidate temporary allocation scheme as the data frame ready time. This data frame ready time is equal to the expected start time of the current task on the target computing core plus the worst-case execution time of the task on that core. The collaborative scheduling terminal can read the start time of the transmission window of the TSN stream generated by the current task within the current scheduling period from the stream set as the upper bound of the time during which the stream is allowed to start transmission within the current period.

[0106] Furthermore, the collaborative scheduling terminal can use the difference between the data frame readiness time of the current task and the start time of the transmission window allocated to the TSN stream generated by the current task within the current scheduling period as the time deviation corresponding to the candidate allocation scheme. This time deviation represents the time interval between the data frame readiness time and the network transmission window opening time. A positive time deviation indicates that the data frame readiness is later than the transmission window opening time, and a negative time deviation indicates that the data frame readiness is earlier than the transmission window opening time. The smaller the absolute value of the time deviation, the closer the calculation completion time and the network transmission time are on the time axis, and the tighter the connection between calculation and communication.

[0107] In this embodiment, the collaborative scheduling terminal can obtain the time deviation by subtracting the expected completion time of the current task in the candidate temporary allocation scheme from the start time of the data frame and reading the start time of the sending window of the corresponding TSN stream from the stream set. The absolute value of the time deviation directly reflects the degree of misalignment between the completion of calculation and the network transmission on the time axis, providing a quantitative comparison basis for selecting the target allocation scheme with the closest connection between calculation and communication from multiple candidate schemes.

[0108] In one embodiment, S5, based on a globally unified time base, performs parsing and transformation on the collaborative scheduling scheme to generate scheduling tables for each computing core and gating lists for each TSN network node, with the globally unified time base as the triggering reference. This may include:

[0109] S51. The mapping results and task execution order are time-slotted to obtain the scheduling table for each computing core.

[0110] Optionally, the collaborative scheduling scheme may include, but is not limited to, the mapping results from each task to the computing core, the task execution order, and the initial transmission time slots of each TSN stream.

[0111] Specifically, the collaborative scheduling terminal can extract the mapping result from each task to the computing core and the execution order of all tasks on each computing core from the collaborative scheduling scheme. The collaborative scheduling terminal can read the task identifier of each task in sequence according to the task execution order of the computing core, and use the global unified time base as the time reference zero point, and set the expected start time of the current task on the computing core as the expected completion time of the previous task on the computing core.

[0112] Furthermore, the collaborative scheduling terminal can set the expected completion time to the expected start time plus the worst-case execution time of the task on the core, and fill the task identifier, expected start time, and expected completion time into the scheduling table entries in the order of execution. The expected start time of the first task on the computing core is set as the start time of the scheduling cycle of the computing core. After all computing cores have completed the filling operation, the scheduling table of each computing core is obtained.

[0113] Optionally, the time parameters of each scheduling table entry can use a globally unified time base as a reference coordinate system to ensure that the scheduling tables of all computing cores have a consistent reference origin on the time axis.

[0114] S52. Expand the window of the initial transmission time slot and the preset transmission period to obtain the gating list of each TSN network node.

[0115] Specifically, the collaborative scheduling terminal can extract the initial transmission time slot and transmission period of each TSN stream to be transmitted from the collaborative scheduling scheme. The collaborative scheduling terminal can use the initial transmission time slot of the TSN stream to be transmitted as the start time of the first transmission window, and repeat the transmission window according to the transmission period of the TSN stream to be transmitted in each subsequent period, that is, the first... The start time of each transmission window is equal to the initial transmission time slot plus... The transmission cycle is twice as long.

[0116] Furthermore, the collaborative scheduling terminal can calculate the duration of each transmission window based on the data frame length of the TSN stream to be transmitted and the link transmission rate of the corresponding output port. The collaborative scheduling terminal can convert all transmission windows of all TSN streams passing through the port within the macro-period into gating list entries. Each gating list entry can include the duration of a transmission window and an 8-bit gating status mask, in which only the bit corresponding to the priority queue to which the transmission window belongs is set to 1, while the other bits are set to 0. The collaborative scheduling terminal can arrange all gating list entries in chronological order of their start times to obtain the complete gating list for the output port. All time parameters can use a globally unified time reference as the coordinate system.

[0117] In this embodiment, the collaborative scheduling terminal can obtain the scheduling table of each computing core by arranging the task mapping results and execution order in the collaborative scheduling scheme according to the global unified time base, and obtain the gating list of each TSN network node by expanding the initial transmission time slot of each TSN stream according to the transmission period. This allows both the scheduling table and the gating list to use the global unified time base as the time reference for triggering execution, thereby realizing the collaborative operation of the computing core and the TSN network node on a unified time axis.

[0118] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0119] Based on the same inventive concept, this application also provides an apparatus for implementing the aforementioned TSN-time synchronization-based regional controller resource collaborative scheduling method. The solution provided by this apparatus is similar to the implementation described in the above method. Therefore, the specific limitations of one or more TSN-time synchronization-based regional controller resource collaborative scheduling apparatus embodiments provided below can be found in the above-described limitations of a TSN-time synchronization-based regional controller resource collaborative scheduling method, and will not be repeated here.

[0120] In one exemplary embodiment, such as Figure 2 As shown, a regional controller resource collaborative scheduling device 10 based on TSN time synchronization is provided, comprising:

[0121] The time base establishment module 11 can be used to establish a globally unified time base between each computing core and each TSN network node within the regional controller based on the TSN time synchronization protocol.

[0122] The attribute classification and dependency analysis module 12 can be used to classify the attributes of real-time tasks in the area controller to obtain a task set, classify the attributes of TSN streams in the area controller to obtain a stream set, and perform dependency analysis on the data interaction relationship between tasks in the task set to obtain a task dependency relationship set.

[0123] The execution time acquisition module 13 can be used to acquire the execution time information of each task in the task set on each computing core of the regional controller;

[0124] The joint optimization solution module 14 can be used to construct a joint optimization model based on a global unified time base, taking the task set, stream set, task dependency set and execution time information as input, and the task-to-core mapping, the execution order of tasks within the core, the task completion time and the TSN stream sending sequence as constraints, and then solve the collaborative scheduling scheme based on the joint optimization model.

[0125] The parsing, conversion, and sending module 15 can be used to parse and convert the collaborative scheduling scheme based on the global unified time base, generate the scheduling table of each computing core and the gated list of each TSN network node with the global unified time base as the triggering base, and send the scheduling table and the gated list to the corresponding computing core and TSN network node.

[0126] In one embodiment, a computer device is provided, including a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the steps of a region controller resource collaborative scheduling method based on TSN time synchronization as described above.

[0127] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, which, when executed by a processor, implements the steps in the above embodiment of a regional controller resource collaborative scheduling method based on TSN time synchronization.

[0128] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to in the description of the method embodiments. The device embodiments described above are merely illustrative. The components described as separate parts may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this disclosure according to actual needs. Those skilled in the art can understand and implement this without creative effort.

[0129] The above-described embodiments are merely illustrative of several implementation methods of the embodiments of this application, and their descriptions are relatively specific and detailed. However, they should not be construed as limiting the scope of the patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the embodiments of this application, and these modifications and improvements all fall within the protection scope of the embodiments of this application.

Claims

1. A method for coordinated resource scheduling of a regional controller based on TSN time synchronization, characterized in that, The method includes: S1. Based on the TSN time synchronization protocol, establish a globally unified time reference among each computing core and each TSN network node within the regional controller; S2. Classify the real-time tasks in the area controller by attributes to obtain a task set, classify the TSN streams in the area controller by attributes to obtain a stream set, and perform dependency analysis on the data interaction relationships between tasks in the task set to obtain a task dependency relationship set. S3. Obtain the execution time information of each task in the task set on each computing core of the region controller; S4. Based on the global unified time base, the task set, the stream set, the task dependency set and each of the execution time information are taken as inputs, and the task-to-core mapping, the execution order of tasks within the core, the task completion time and the TSN stream sending sequence are taken as constraints to construct a joint optimization model, and based on the joint optimization model, a cooperative scheduling scheme is solved. S5. Based on the global unified time base, the collaborative scheduling scheme is parsed and transformed to generate a scheduling table for each computing core and a gating list for each TSN network node, with the global unified time base as the triggering base, and the scheduling table and the gating list are sent to the corresponding computing core and the TSN network node.

2. The method according to claim 1, characterized in that, The real-time tasks include periodic real-time tasks and occasional tasks, and the TSN streams include TSN streams to be sent and TSN streams to be received. The S2 includes: S21. Extract the task attribute parameters of each periodic real-time task, and use the task attribute parameters as attribute items of the periodic real-time task to construct a task seven-tuple corresponding to each periodic real-time task; wherein, the task attribute parameters include initial phase, task period, relative deadline, worst-case execution time, security integrity level, communication attribute set and maximum allowable scheduling jitter, and the task seven-tuple is used to characterize the scheduling characteristics and timing constraints of the periodic real-time task; S22. Obtain the minimum arrival interval of each of the occasional tasks, and use the minimum arrival interval as the equivalent period. Extract the task constraint parameters of each of the occasional tasks, and encapsulate the equivalent period and the task constraint parameters in a structured manner to obtain the occasional task 7-tuple for each of the occasional tasks; wherein, the occasional task 7-tuple is used to characterize the scheduling characteristics and timing constraints of the occasional tasks. S23. Combine the task 7-tuple and the occasional task 7-tuple to obtain the task set; S24. Obtain the flow communication feature parameters of the TSN stream to be sent, and construct the flow communication feature parameters in a structured manner to obtain the flow quintuple corresponding to each TSN stream; wherein, the flow communication feature parameters include flow period, data frame length, maximum allowable end-to-end transmission delay, network priority and source task index, and the flow quintuple is used to characterize the communication characteristics and timing constraints of the TSN stream to be sent; S25. Match and map the arrival time of the TSN stream to be received with the release time of the corresponding task in the task set to obtain the trigger mapping relationship between the TSN stream to be received and the corresponding task. S26. Combine each of the stream quintuples with the trigger mapping relationship to obtain the stream set; S27. Traverse the task pairs in the task set. When the input data of one task in the task pair depends on the output data of another task in the task pair, establish a one-way dependency relationship for the task pair, obtain each task dependency relationship, and combine each task dependency relationship to obtain the task dependency relationship set.

3. The method according to claim 2, characterized in that, The S25 includes: S251. Based on each of the TSN streams to be received, identify the associated tasks from the task set that use the arrival of the TSN stream to be received as a release condition, and combine each of the associated tasks to obtain the associated task set of the TSN stream to be received. S252. Bind the stream identifier of the TSN stream to be received to the task identifier of each associated task in the associated task set to obtain a stream task binding relationship, and configure the trigger condition parameters of the stream task binding relationship to obtain a trigger rule; wherein, the trigger rule is used to characterize the condition for triggering the associated task to enter the ready state when the TSN stream to be received arrives. S253. Combine the binding relationships of each stream task and the triggering rules corresponding to each binding relationship of the stream task to obtain the triggering mapping relationship.

4. The method according to claim 2, characterized in that, In step S4, based on the joint optimization model, a cooperative scheduling scheme is obtained by solving for the following: S41. Based on the security integrity level from high to low and the relative deadline from short to long, sort the tasks in the task set in a multi-level order to obtain a task priority sequence. S42. Based on the task priority sequence, traverse each of the computing cores of the current task, identify the expected completion time of the current task on each computing core, and select the computing core and insertion position whose expected completion time meets the preset deadline requirement as a candidate temporary allocation scheme. S43. Determine whether the current task is a task that generates a TSN stream. If yes, calculate the time deviation between the data frame readiness time of the current task and the TSN stream transmission time sequence based on each of the candidate temporary allocation schemes. Compare the absolute values ​​of each time deviation to obtain a comparison result. Based on the comparison result, select the candidate temporary allocation scheme with the smallest absolute value as the target allocation scheme for the current task. If no, select the candidate temporary allocation scheme with the earliest expected completion time as the target allocation scheme for the current task. S44. Assign the current task to the target computing core and target insertion position corresponding to the target allocation scheme to obtain the initial scheduling result; wherein, the initial scheduling result includes the execution order of adjacent tasks; S45. Record the start time of the transmission window of the TSN stream to be sent as the initial transmission time slot, and optimize the execution order of the adjacent tasks by exchanging them to obtain the optimized scheduling result. S46. Combine the optimized scheduling result and the initial transmission time slot to obtain the cooperative scheduling scheme.

5. The method according to claim 4, characterized in that, The expression for the time deviation is: ; In the formula, This indicates the time deviation. This indicates the time when the data frame for the current task is ready. This indicates the start time of the transmission window allocated to the TSN stream generated by the current task within the current scheduling period.

6. The method according to claim 1, characterized in that, The collaborative scheduling scheme includes the mapping results of each task to the computing core, the task execution order, and the initial transmission time slot of each TSN stream; In step S5, based on the global unified time base, the collaborative scheduling scheme is parsed and transformed to generate a scheduling table for each computing core and a gating list for each TSN network node, with the global unified time base as the triggering reference. This includes: S51. The mapping result and the task execution order are time-slotted to obtain the scheduling table for each computing core; S52. Expand the initial transmission time slot and the preset transmission period by a window to obtain the gating list of each TSN network node.

7. A resource collaborative scheduling device for a regional controller based on TSN time synchronization, characterized in that, The device includes: The time base establishment module is used to establish a globally unified time base between each computing core and each TSN network node within the regional controller based on the TSN time synchronization protocol. The attribute classification and dependency analysis module is used to classify the attributes of real-time tasks in the area controller to obtain a task set, classify the attributes of TSN streams in the area controller to obtain a stream set, and perform dependency analysis on the data interaction relationships between tasks in the task set to obtain a task dependency relationship set. An execution time acquisition module is used to acquire the execution time information of each task in the task set on each computing core of the region controller; The joint optimization solution module is used to construct a joint optimization model based on the global unified time base, taking the task set, the flow set, the task dependency set and each of the execution time information as inputs, and taking the task-to-core mapping, the execution order of tasks within the core, the task completion time and the TSN flow sending sequence as constraints, and then solving the collaborative scheduling scheme based on the joint optimization model. The parsing, conversion, and sending module is used to parse and convert the collaborative scheduling scheme based on the global unified time base, generate a scheduling table for each computing core and a gating list for each TSN network node with the global unified time base as the triggering base, and send the scheduling table and the gating list to the corresponding computing core and the TSN network node.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the method of any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method of any one of claims 1 to 6.