A method for scheduling tasks of a converter control system based on SYS_BIOS
Patent Information
- Application Number
- CN202310219688.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-09
- Publication Date
- 2026-10-23
- Estimated Expiration
- 2043-03-09
AI Technical Summary
[0003]因此,随着变流器系统的复杂程序增加,传统前后台式主控系统调度策略在调度大量任务线程时需要缜密的逻辑处理和实时性处理,系统建立之后往往可维护性也很差,应用难度越来越高,如何在现有硬件平台基础上构建一个可灵活处理多任务复杂系统功能的控制方法成为目前急需解决的一个问题
[0011]本发明的有益效果在于,本发明提供的一种基于SYS_BIOS的变流器控制系统任务调度方法,一方面,仅需对SYS_BIOS进行简单配置,构建模块化的变流器系统复杂功能控制方法。另一方面,以硬件中断和任务为执行线程来承载系统功能,采用信号量和事件相结合的方式进行功能实现线程之间的通信与同步,使系统在实现功率变换、数据处理、通信等多功能多线程的灵活调度,降低系统开发难度,提高了系统的稳定性和实时性。此外,本发明设计原理可靠,结构简单,具有非常广泛的应用前景。
Smart Images

Figure CN116225546B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of converter control technology, specifically relating to a task scheduling method for a converter control system based on SYS_BIOS. Background Technology
[0002] With the development of embedded and power electronics technologies, converter control systems are taking on increasingly complex functions in addition to controlling switching devices to complete power conversion, such as data acquisition and processing, storage, communication, peripheral interaction, and state machine switching. Each function usually has to deal with multiple objects. For example, communication needs to handle human-machine interaction, multi-machine parallel operation, host computer, upper-level device scheduling, and peripheral module interaction. While implementing each function, attention also needs to be paid to the logical relationships between some functions and objects.
[0003] Therefore, as the complexity of converter systems increases, traditional front-end and back-end main control system scheduling strategies require meticulous logic processing and real-time processing when scheduling a large number of task threads. After the system is established, its maintainability is often very poor, and the application difficulty is increasing. How to build a control method that can flexibly handle the functions of multi-task complex systems on the basis of existing hardware platforms has become an urgent problem to be solved. Summary of the Invention
[0004] To address the aforementioned shortcomings of existing technologies, this invention provides a task scheduling method for a converter control system based on SYS_BIOS, thereby solving the aforementioned technical problems.
[0005] This invention provides a task scheduling method for a converter control system based on SYS_BIOS, wherein the SYS_BIOS converter control system includes a DSP that supports the BIOS operating system; the method includes: The functions of the converter are modularized, and functions are assigned to hardware interrupts or task modules according to their function type or response time and operating frequency. The function types include power control threads and power control auxiliary functions. The power control threads of the converter are carried by hardware interrupts, and the power control threads include: power information acquisition and switching control of power devices. The power control auxiliary functions of the converter are carried by task modules, and the power control auxiliary functions include: data processing, data storage, communication, and state switching. Define hardware interrupts and the functions executed by the task module as tasks, and define the specific processing objects that the functions are directed to as events; When multiple tasks enter the execution queue, they are executed in parallel according to the preset execution relationship between tasks and the maximum parallelism of SYS_BIOS; tasks without execution relationship are executed in order of task priority. Once a task is entered, the events belonging to the task are executed according to the preset execution relationship first, and events without execution relationship are executed according to the event priority order; Task priority is determined based on task response time and running frequency; event priority is determined based on event response time and running frequency.
[0006] Furthermore, the allocation of functions to hardware interrupt or task modules based on their response time and operating frequency includes: Define the response time priority coefficient j = task execution frequency / task response time, usually j>10; When the response time priority coefficient is less than the preset coefficient threshold k, the task is executed by the hardware interrupt module, and the smaller the response time priority coefficient, the higher the priority of the task in the hardware interrupt module; when the response time priority coefficient of the task is greater than the coefficient threshold k, the task is executed by the task module, and the higher the task running frequency, the higher the task priority.
[0007] Furthermore, the task priority is determined according to the following method: When a task is executed by a hardware interrupt module, the task response time is considered first. Tasks with shorter response times have higher priority. For tasks with the same response time, the higher the running frequency, the higher the priority; or, tasks with a smaller response time priority coefficient j have higher priority. When a task is executed by a task module, the higher the task execution frequency, the higher the task priority.
[0008] Furthermore, the event priority is determined according to the following method: Determine whether an event is a single-run event, and apply priority processing only to events that do not execute in a loop; Compare the frequency of events; the higher the frequency of an event, the higher its priority.
[0009] Furthermore, the preset execution relationship is sorted and defined according to the interval and importance of tasks / events, and is implemented through the internal mechanism of SYS_BIOS and manual settings.
[0010] Furthermore, it also includes: For any task, at least one event is processed sequentially according to the event priority. Event execution is triggered based on the following conditions: the semaphore of the task to which the event belongs is published; the program runs to the flag check program in the task to which the event belongs; the flag of the event is set. After all events have been completed, the task is finished and it awaits the next semaphore release.
[0011] The beneficial effects of this invention are as follows: The SYS_BIOS-based task scheduling method for a converter control system provides a modular, complex function control method for a converter system that requires only simple configuration of SYS_BIOS. Furthermore, by using hardware interrupts and tasks as execution threads to carry out system functions, and employing a combination of semaphores and events for communication and synchronization between function implementation threads, the system can flexibly schedule multiple functions and threads, including power conversion, data processing, and communication, reducing system development difficulty and improving system stability and real-time performance. In addition, this invention has a reliable design principle, a simple structure, and very broad application prospects. Attached Figure Description
[0012] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0013] Figure 1 This is a typical converter DSP block diagram according to an embodiment of the present invention.
[0014] Figure 2 This is a block diagram of the converter modular controller according to an embodiment of the present invention.
[0015] Figure 3 This is a schematic flowchart of a method according to an embodiment of the present invention.
[0016] Figure 4 This is a flowchart of the task priority setting in an embodiment of the present invention.
[0017] Figure 5 This is a flowchart of the event priority setting in an embodiment of the present invention.
[0018] Figure 6 This is an event execution flowchart in an embodiment of the present invention.
[0019] Figure 7 This is a diagram of the SYS_BIOS configuration interface in an embodiment of the present invention. Detailed Implementation
[0020] To enable those skilled in the art to better understand the technical solutions of this invention, the technical solutions of the embodiments of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this invention, and not all embodiments. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of this invention.
[0021] This application is based on, as follows Figure 1 The diagram illustrates a typical converter controller. This typical converter comprises a power electronic device using a DSP (Digital Signal Processor) supporting a BIOS operating system as its controller. The DSP typically possesses low-level functions including data acquisition, data processing, pulse modulation, switching operations, data storage, and communication. These low-level functions, combined with hardware circuitry, work together to realize the converter's power conversion, human-machine interaction, state switching, and parallel communication functions. Human-machine interaction typically includes different interfaces such as a touchscreen interface and a host computer, while state switching typically includes device states such as power-on, power-off, and standby.
[0022] like Figure 2 As shown, this embodiment of the invention provides a task scheduling method for a converter control system based on SYS_BIOS, including: S110: Modularizes the underlying functions of the DSP and assigns functions to hardware interrupt or task modules according to the function's type or response time and operating frequency.
[0023] S120: Define the functions executed by hardware interrupts and task modules as tasks, and define the specific processing objects that the functions are directed to as events.
[0024] S130: When multiple tasks enter the execution queue, they are executed in parallel according to the preset execution relationship between tasks and the maximum parallelism of SYS_BIOS; tasks without execution relationship are executed in order of task priority.
[0025] S140: After entering a task, the events belonging to the task are executed according to the preset execution relationship first, and the events without execution relationship are executed according to the event priority order.
[0026] In this embodiment, the functional types include power control threads and power control auxiliary functions. The power control thread of the converter is carried out using hardware interrupts, and this thread includes power information acquisition and switching control of power devices. The power control auxiliary functions of the converter are carried out using task modules, and these auxiliary functions include data processing, data storage, communication, and state switching. Regardless of whether the function is executed in the hardware interrupt module or the task module, in the SYS_BIOS converter control system, one function corresponds to at least one task, and the specific execution steps of the function correspond to events. The relationships between tasks, events, and specific function implementations are preset in the SYS_BIOS converter control system. The SYS_BIOS converter control system calls tasks and events to achieve the purpose of function implementation. The relationship between events and tasks is that a task includes at least one associated event.
[0027] like Figure 3As shown, the task scheduling method of this invention defines a function facing multiple objects as a task, and defines the operation performed on the specific object facing the function as an event. Therefore, a task includes one or more events, and all system functions are realized through modular functional partitioning.
[0028] In this invention, task execution semaphores are assigned to each function that the converter needs to implement according to its priority, and events are then assigned according to the priority of the specific object to which the function is directed. Therefore, semaphores correspond to the scheduling of functions, and events correspond to the scheduling of different objects with the same function. A combination of semaphores and events is used for communication and synchronization between function implementation threads.
[0029] Furthermore, in this invention, each event is treated as an event module function, and each function is treated as a function module function. Different tasks and events run independently in real time, no longer constrained by the scheduling complexity caused by the sequential logic of traditional pipeline control.
[0030] Compared with the traditional front-end and back-end main control system of power electronic equipment, the present invention only requires simple configuration of SYS_BIOS to quickly complete the establishment of the converter multi-task system, realize flexible scheduling of multi-threads, is simple to operate, has high feasibility, reduces the difficulty of system development, and improves the stability and real-time performance of the system.
[0031] The power control thread of the converter is carried out by hardware interrupts, and the power control thread includes: power information acquisition and switching control of power devices; the auxiliary power control functions of the converter are carried out by tasks, and the auxiliary power control functions include: data processing, data storage, communication, and state switching.
[0032] Functions are assigned to hardware interrupts or task modules based on their response time and operating frequency. This can be done automatically by SYS_BIOS or manually.
[0033] The automatic analysis method is based on the defined response time priority coefficient: Define the response time priority coefficient j = task execution frequency / task response time, usually j>10; When the response time priority coefficient is less than the preset coefficient threshold k, the task is executed by the hardware interrupt module, and the smaller the response time priority coefficient, the higher the priority of the task in the hardware interrupt module; when the response time priority coefficient of the task is greater than the coefficient threshold k, the task is executed by the task module, and the higher the task running frequency, the higher the task priority.
[0034] The method for manual analysis and setting is as follows: based on the response time and operating frequency of the task, the task type is divided into interrupt tasks and regular tasks. For example, power control functions with high operating frequency or instantaneous protection functions with fast response are assigned as interrupt tasks, while auxiliary functions in the converter, such as human-machine interaction communication, data storage, and state machine processing, which have low operating frequency or long response time, are assigned as regular tasks.
[0035] This invention ensures that important events of important tasks are executed first when different task semaphores are published simultaneously, by setting different priorities for each task and its events. Typically, events within higher-priority tasks will have higher priorities than events within lower-priority tasks.
[0036] The scheduling strategy involved in this invention allows for the setting of task priorities and event priorities according to priority design principles during priority distribution. Specifically, task priorities are determined based on task response time and operating frequency; event priorities are determined based on event response time and operating frequency.
[0037] Optionally, the task priority can be set as follows: (e.g.) Figure 4 The diagram illustrates the priority design principles for converter power control-related tasks. When tasks are executed by hardware interrupt modules, one approach is to consider both task response time and execution frequency; for example, a smaller task response time coefficient results in higher priority. Alternatively, task response time should be the primary consideration, with tasks having shorter response times having higher priority. For tasks with the same response time, higher execution frequency results in higher priority. When tasks are executed by task modules, execution frequency is also considered; higher execution frequency results in higher task priority.
[0038] Optionally, after the task priority is determined, such as Figure 5 As shown, each event within a task will be prioritized based on its execution frequency and logical order. After entering a task, events belonging to the task will be executed according to the preset execution relationship. Events without execution relationship will be executed according to their priority order. Furthermore, after entering an event, it is first determined whether the event is a single-run event. Priority processing is applied only to events that do not run in a loop. The execution frequency of events is compared, and the higher the execution frequency of an event, the higher its priority.
[0039] Optionally, as an embodiment of the present invention, the preset execution relationship is defined and sorted according to the interval length and importance of tasks / events, and is implemented through the internal mechanism of SYS_BIOS and manual setting.
[0040] like Figure 6The diagram shows the execution flow of events within a task. An event's execution requires three conditions: the task reaches the flag check procedure within the task to which the event belongs; the semaphore of the task to which the event belongs is published; and the event's execution flag is set. When one or more events in a task meet these conditions, the task execution phase begins, and the published semaphore is suspended. Then, all events within the task corresponding to that semaphore are checked according to priority, and the flag determines whether to execute the event. After all events have been executed, the task completes and waits for the next semaphore publication. All tasks run independently based on SYS_BIOS.
[0041] It should be noted that the task scheduling method involved in this invention only requires necessary functional layout and configuration of the hardware interrupts (Hwi), tasks, and semaphores to meet the resource utilization requirements. For example... Figure 7 The diagram shows the SYS_BIOS configuration interface. Other modules are not necessary for this method, but they can also be used to assist in operation. For example, the issuance of semaphores can be carried out periodically by the clock function, or by the idle function, software interrupt (Swi), hardware interrupt (Hwi), etc., all of which are within the scope of this invention.
[0042] The method provided by this invention realizes a modular functional layout, as well as hierarchical task distribution and independent task operation, which greatly reduces the difficulty and operational complexity of developing multi-task complex functions such as power conversion, communication, and storage in converters.
[0043] Although the present invention has been described in detail with reference to the accompanying drawings and preferred embodiments, the invention is not limited thereto. Various equivalent modifications or substitutions can be made to the embodiments of the invention by those skilled in the art without departing from the spirit and essence of the invention, and such modifications or substitutions should all be within the scope of the invention. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the invention should also be covered within the protection scope of the invention. Therefore, the protection scope of the invention should be determined by the scope of the claims.
Claims
1. A task scheduling method for a converter control system based on SYS_BIOS, characterized in that, The SYS_BIOS converter control system includes a DSP to support the BIOS operating system; the method includes: The functions of the converter are modularized, and functions are assigned to hardware interrupts or task modules according to their function type or response time and operating frequency. The function types include power control threads and power control auxiliary functions. The power control threads of the converter are carried by hardware interrupts, and the power control threads include: power information acquisition and switching control of power devices. The power control auxiliary functions of the converter are carried by task modules, and the power control auxiliary functions include: data processing, data storage, communication, and state switching. Define hardware interrupts and the functions executed by the task module as tasks, and define the specific processing objects that the functions are directed to as events; When multiple tasks enter the execution queue, they are executed in parallel according to the preset execution relationship between tasks and the maximum parallelism of SYS_BIOS; tasks without execution relationship are executed in order of task priority. Once a task is entered, the events belonging to the task are executed according to the preset execution relationship first, and events without execution relationship are executed according to the event priority order; Task priority is determined based on task response time and execution frequency; event priority is determined based on event response time and execution frequency. The method of allocating functions to hardware interrupt or task modules based on their response time and operating frequency includes: Define the response time priority coefficient j = task execution frequency / task response time, usually j>10; When the response time priority coefficient is less than the preset coefficient threshold k, the task is executed by the hardware interrupt module, and the smaller the response time priority coefficient, the higher the priority of the task in the hardware interrupt module; when the response time priority coefficient of the task is greater than the coefficient threshold k, the task is executed by the task module, and the higher the task running frequency, the higher the task priority.
2. The task scheduling method for a converter control system based on SYS_BIOS according to claim 1, characterized in that, The task priority is determined according to the following method: When a task is executed by a hardware interrupt module, the task response time is considered first. Tasks with shorter response times have higher priority. For tasks with the same response time, the higher the running frequency, the higher the priority; or, tasks with a smaller response time priority coefficient j have higher priority. When a task is executed by a task module, the higher the task execution frequency, the higher the task priority.
3. The task scheduling method for a converter control system based on SYS_BIOS according to claim 1, characterized in that, The event priority is determined according to the following method: Determine whether an event is a single-run event, and apply priority processing only to events that do not execute in a loop; Compare the frequency of events; the higher the frequency of an event, the higher its priority.
4. The task scheduling method for a converter control system based on SYS_BIOS according to claim 1, characterized in that, The preset execution relationship is defined and ordered according to the interval and importance of tasks / events, and is implemented through the internal mechanism of SYS_BIOS and manual settings.
5. The task scheduling method for a converter control system based on SYS_BIOS according to claim 1, characterized in that, include: For any task, at least one event is processed sequentially according to the event priority. Event execution is triggered based on the following conditions: the semaphore of the task to which the event belongs is published; the program runs to the flag check program in the task to which the event belongs; the flag of the event is set. After all events have been completed, the task is finished and it awaits the next semaphore release.