Task processing method and system and motor controller
By using a multi-channel sequencer parallel computing system in the co-processing module of the motor controller, decomposing and allocating tasks to multiple co-channel sequencers for parallel processing, the problem of low processing efficiency of a single channel sequencer is solved, and more efficient Task processing.
Patent Information
- Application Number
- CN202411522237.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-29
- Publication Date
- 2025-02-11
AI Technical Summary
In the prior art, the computing power of a single channel sequencer is limited and the data storage space is limited, resulting in a reduced efficiency of motor task processing.
A multi-channel sequencer parallel computing system is adopted to obtain the pending tasks through the main channel sequencer, decompose them into multiple subtasks, and allocate them to multiple co-channel sequencers for parallel processing, and finally summarize the processing results and feed them back to the main processing module.
It improves task processing efficiency, reduces the load rate of the main processing module, and achieves faster and more complex task processing.
Smart Images

Figure CN119415257A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of motor controllers, and in particular to a task processing method, system and motor controller. Background Art
[0002] Considering that when the Infineon AURIX series automotive multi-core microcontroller is currently used, there is a general data processing module - co-processing module in the timer (Generic Timer Module, GTM) in its peripheral module. The co-processing module can be regarded as an independent central processing unit (Central Processing Unit, CPU). There is a channel sequencer in the co-processing, and the channel sequencer can be used to assist the main processing module in task processing. In the related art, a single channel sequencer is usually used to generate the three-phase input current of the motor or the three-phase drive signal of the switch tube. Due to the limited computing power and data storage space of a single channel sequencer, the processing efficiency of the task is reduced. Summary of the invention
[0003] The main purpose of this application is to provide a task processing method, system and motor controller, aiming to improve the processing efficiency of tasks.
[0004] To achieve the above object, the present application proposes a task processing method, which is applied to a main channel sequencer in a co-processing module of a motor controller, wherein the co-processing module further includes a plurality of co-channel sequencers, and the main channel sequencer is used to connect each of the co-channel sequencers with the main processing module of the motor controller, and the method includes:
[0005] Obtaining the pending tasks sent by the main processing module;
[0006] Decomposing the task to be processed into multiple subtasks, and assigning each of the subtasks to a corresponding co-channel sequencer for parallel processing;
[0007] The processing results of each of the cooperative channel sequencers for each subtask are received, and the processing results of each of the subtasks are summarized and fed back to the main processing module.
[0008] In one embodiment, the step of obtaining the to-be-processed task sent by the main processing module includes:
[0009] After receiving the interrupt signal sent by the main processing module, reading the to-be-processed task from the shared memory of the main processing module and the main channel sequencer;
[0010] The step of aggregating the processing results of each of the subtasks and feeding them back to the main processing module comprises:
[0011] The summarized processing results are written into the shared memory to feed back the summarized processing results to the main processing module.
[0012] In one embodiment, the step of decomposing the task to be processed into a plurality of subtasks and assigning each of the subtasks to a corresponding co-channel sequencer for parallel processing includes:
[0013] Decomposing the task to be processed into multiple subtasks;
[0014] Obtaining the current running status of each of the co-channel sequencers;
[0015] Determine the target cooperative channel sequencer corresponding to each of the subtasks according to the current running state of each of the cooperative channel sequencers and the task processing type of the task to be processed;
[0016] Each of the subtasks is respectively assigned to a corresponding co-channel sequencer for parallel processing.
[0017] In one embodiment, the step of determining the target co-channel sequencer corresponding to each of the subtasks according to the current running state of each of the co-channel sequencers and the task processing type of the task to be processed includes:
[0018] Determine an idle associate channel sequencer according to the current operating status of each of the associate channel sequencers;
[0019] Obtaining the type of each of the subtasks;
[0020] Determine an idle co-channel sequencer matching the type of each of the subtasks;
[0021] The matching idle co-channel sequencer is used as the target co-channel sequencer of the corresponding subtask.
[0022] In one embodiment, when the task to be processed is an overcurrent detection task, the step of decomposing the task to be processed into a plurality of subtasks and assigning each of the subtasks to a corresponding co-channel sequencer for parallel processing includes:
[0023] Decomposing the overcurrent detection task according to the task processing type of each of the cooperative channel sequencers to obtain the overcurrent detection subtasks of each of the cooperative channel sequencers;
[0024] Each of the overcurrent detection subtasks is respectively assigned to a corresponding auxiliary channel sequencer, wherein each of the auxiliary channel sequencers executes the overcurrent detection subtask after receiving the corresponding overcurrent detection subtask, and feeds back the overcurrent detection result of each of the overcurrent detection subtasks to the main channel sequencer.
[0025] In one embodiment, when the task to be processed is a task of generating a driving signal for a switch tube, the step of decomposing the task to be processed into a plurality of subtasks and assigning each of the subtasks to a corresponding co-channel sequencer for parallel processing includes:
[0026] Decomposing the drive signal generation task of the switch tube according to the task processing type of each of the cooperative channel sequencers to obtain the drive signal generation subtasks of the switch tubes of each of the cooperative channel sequencers;
[0027] The drive signal generation subtask of each of the switch tubes is respectively assigned to the corresponding auxiliary channel sequencer, wherein, after receiving the drive signal generation subtask of the corresponding switch tube, each of the auxiliary channel sequencers executes the drive signal generation subtask of the switch tube and feeds back the drive signal generation result of the drive signal generation subtask of the switch tube to the main channel sequencer.
[0028] To achieve the above object, the present application proposes a task processing method, which is applied to a co-channel sequencer in a co-processing module of a motor controller, wherein the co-channel sequencer includes a plurality of co-channel sequencers, and each of the co-channel sequencers is connected to a main channel sequencer of the co-processing module, and the main channel sequencer is connected to a main processing module of the motor controller, and the method includes:
[0029] Receiving the subtask sent by the main channel sequencer, wherein the main channel sequencer obtains the to-be-processed task sent by the main processing module, decomposes the to-be-processed task into a plurality of subtasks, and assigns each of the subtasks to a corresponding assistant channel sequencer;
[0030] Execute the subtask and obtain the processing result of the subtask;
[0031] The processing results of the subtasks are fed back to the main channel sequencer, wherein the main channel sequencer receives the processing results of each of the auxiliary channel sequencers for each subtask, and summarizes the processing results of each of the subtasks and feeds them back to the main processing module.
[0032] In addition, to achieve the above objectives, the present application also proposes a task processing system, the task processing system comprising:
[0033] The task acquisition module is used to acquire the pending tasks sent by the main processing module;
[0034] A task allocation module, used for decomposing the task to be processed into multiple subtasks, and respectively allocating each of the subtasks to a corresponding co-channel sequencer for parallel processing;
[0035] The summary feedback module is used to receive the processing results of each of the cooperative channel sequencers for each subtask, and summarize the processing results of each of the subtasks and feed them back to the main processing module.
[0036] In addition, to achieve the above objectives, the present application also proposes a task processing system, the task processing system comprising:
[0037] A subtask sending module, used for receiving subtasks sent by the main channel sequencer, wherein the main channel sequencer obtains the to-be-processed task sent by the main processing module, decomposes the to-be-processed task into a plurality of subtasks, and respectively assigns each of the subtasks to a corresponding assistant channel sequencer;
[0038] A subtask execution module, used to execute the subtask and obtain the processing result of the subtask;
[0039] A processing result feedback module is used to feed back the processing results of the subtasks to the main channel sequencer, wherein the main channel sequencer receives the processing results of each of the auxiliary channel sequencers for each subtask, and summarizes the processing results of each of the subtasks and feeds them back to the main processing module.
[0040] In addition, to achieve the above-mentioned purpose, the present application also proposes a motor controller, the motor controller includes a main processing module, a co-processing module and a shared memory, wherein the co-processing module includes a main channel sequencer and a plurality of co-channel sequencers, and each of the channel sequencers is connected to the main processing module through a corresponding shared memory;
[0041] The motor controller further comprises: a computer program stored in the shared memory and executable on the master channel sequencer, the computer program being configured to implement the steps of the task processing method described above;
[0042] Alternatively, the motor controller further comprises: a computer program stored in the shared memory and executable on the cooperative channel sequencer, wherein the computer program is configured to implement the steps of the above-mentioned task processing method.
[0043] Since the application adopts a multi-channel sequencer parallel computing system, the number of co-channel sequencers and the execution tasks of each co-channel sequencer can be flexibly allocated to complete complex task processing with the fastest computing efficiency. The load rate of the main processing module is effectively reduced, and multiple channel sequencers are used for task parallel processing to improve task processing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0045] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0046] Figure 1 A flowchart of the first embodiment of the task processing method of the present application is provided;
[0047] Figure 2 A brief flowchart of the first embodiment of the task processing method of this application;
[0048] Figure 3 Another simplified flowchart of the first embodiment of the task processing method of the present application;
[0049] Figure 4 This is another simplified flowchart of the first embodiment of the task processing method of this application;
[0050] Figure 5 A flowchart of the second embodiment of the task processing method of the present application is provided;
[0051] Figure 6 A schematic diagram of a module of the task processing system of this application;
[0052] Figure 7 This is another module schematic diagram of the task processing system of this application;
[0053] Figure 8 This is an interactive diagram of the task processing method of this application.
[0054] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0055] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0056] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0057] In the related art, a single channel sequencer is usually used to generate a three-phase input current for a motor or a three-phase drive signal for a switch tube. Due to the limited computing power and data storage space of a single channel sequencer, the processing efficiency of the task is reduced.
[0058] In response to the above problems, the present application proposes a task processing method, and the main technical solutions include: obtaining the pending task sent by the main processing module; decomposing the pending task into multiple sub-tasks, and assigning each of the sub-tasks to the corresponding cooperative channel sequencer for parallel processing; receiving the processing results of each sub-task from each cooperative channel sequencer, and summarizing the processing results of each sub-task and feeding them back to the main processing module.
[0059] Since the application adopts a multi-channel sequencer parallel computing system, the number of co-channel sequencers and the execution tasks of each co-channel sequencer can be flexibly allocated to complete complex task processing with the fastest computing efficiency. The load rate of the main processing module is effectively reduced, and multiple channel sequencers are used for task parallel processing to improve task processing efficiency.
[0060] It should be noted that the main processing module of the present application can be a microcontroller unit (MCU) of a motor controller. Considering that when the Infineon AURIX series automotive multi-core microcontroller is currently used, there is a generic data processing module-coprocessing module in the timer (Generic Timer Module, GTM) in its peripheral module, and there are multiple channel sequencers (hereinafter referred to as MCS) in the coprocessing module. The coprocessing module can be regarded as an independent central processing unit (Central Processing Unit, CPU), the clock frequency can be 200MHz, it has an independent instruction set, compiler and independent random access memory (Random Access Memory, RAM), and it has been vacant and unused. Therefore, in order to both improve the processing speed and save costs, the coprocessing module is used as an additional chip.
[0061] Among them, the co-processing module includes a main channel sequencer and multiple co-channel sequencers, wherein the main channel sequencer is communicatively connected with each co-channel sequencer, and the main processing module is communicatively connected with the main channel sequencer, thereby realizing the effect of controlling the main channel sequencer through the main processing module and controlling each co-channel sequencer through the main channel sequencer.
[0062] In addition, a register is also provided in the timer, and the register here can be set to one or more, for example, a corresponding register can be set for each channel sequencer. After calculating the corresponding register value, each cooperative channel sequencer writes the register value into the register, so that the subsequent timer can obtain the corresponding data from the register to output the driving signal of the switch tube.
[0063] For ease of understanding, the following combination Figure 1-Figure 4 ,as well as Figure 8The task processing method provided in the embodiment of the present application is specifically introduced.
[0064] Reference Figure 1 , Figure 1 This is a flow chart of the first embodiment of the task processing method of the present application. In this embodiment, the task processing method is applied to the main channel sequencer in the co-processing module of the motor controller, and the co-processing module also includes multiple co-channel sequencers, and the main channel sequencer is used to connect each of the co-channel sequencers with the main processing module of the motor controller.
[0065] In this embodiment, the task processing method includes steps S10 to S30:
[0066] Step S10, obtaining the to-be-processed tasks sent by the main processing module;
[0067] After receiving the interrupt signal sent by the main processing module, the task to be processed can be read from the shared memory of the main processing module and the main channel sequencer.
[0068] On the main processing module side, the main processing module initializes the MCS process, initializes the registers in the timer, loads the MCS program from FLASH into the shared memory of the MCS and starts the main channel sequencer. At this time, the MCS enters the running state and waits for the control interrupt to trigger the operation.
[0069] The interrupt signal is a mechanism used by the main processing module to notify the main channel sequencer that an event has occurred or needs to be processed. When the main processing module requires the main channel sequencer to perform certain operations, it sends an interrupt signal to the main channel sequencer through the interrupt request line. After receiving the interrupt signal, the main channel sequencer will pause the currently executing program and execute the interrupt service program corresponding to the interrupt signal.
[0070] When the main channel sequencer receives the interrupt signal sent by the main processing module, it performs the following operations:
[0071] (1) The master channel sequencer first identifies the source and type of the interrupt signal, which is usually done by checking the status of the interrupt request line or reading the interrupt vector table.
[0072] (2) Before processing an interrupt, the main channel sequencer saves the address of the currently executed instruction and the contents of the registers so that it can be restored to the execution state before the interrupt after the interrupt processing is completed.
[0073] (3) The master channel sequencer jumps to the interrupt service routine corresponding to the interrupt signal. In this process, it may read data or status information related to interrupt processing, which can be considered as part of the public data.
[0074] (4) The interrupt service routine performs necessary operations to handle the interrupt event, which may include reading data in the shared memory between the main processing module and the main channel sequencer, updating the system status, sending response signals, etc. During the processing, the main channel sequencer may interact with the auxiliary channel sequencer.
[0075] (5) When the interrupt service routine is executed, the main channel sequencer will restore the previously saved register contents and program counter value to continue executing the program before the interrupt.
[0076] (6) Finally, the main channel sequencer will execute the interrupt return instruction and return to the next instruction of the interrupted program to continue execution.
[0077] Step S20, decomposing the task to be processed into multiple subtasks, and assigning each of the subtasks to a corresponding co-channel sequencer for parallel processing;
[0078] After obtaining the pending tasks, the main channel sequencer can decompose the pending tasks according to the task processing types of each auxiliary channel sequencer to obtain multiple subtasks, and assign each subtask to the corresponding auxiliary channel sequencer for execution. Alternatively, the pending tasks can be decomposed according to the currently idle auxiliary channel sequencer to obtain multiple subtasks, and each subtask can be assigned to the corresponding auxiliary channel sequencer for execution.
[0079] Step S30, receiving the processing results of each of the cooperative channel sequencers for each of the subtasks, and summarizing the processing results of each of the subtasks and feeding them back to the main processing module.
[0080] After processing each subtask, each auxiliary channel sequencer sends the processing results of the corresponding subtask to the main channel sequencer. After receiving the processing results of each subtask, the main channel sequencer summarizes the processing results of each subtask and feeds them back to the main processing module.
[0081] The main channel sequencer communicates with each co-channel sequencer through the ARU module. Among them, the ARU module is the core component of the timer. It can receive the processing results of each co-channel sequencer for each subtask. The main processing module and the main channel sequencer share data through shared memory to realize the feedback of the summarized processing results to the main processing module.
[0082] This embodiment provides a task processing method. Due to the use of a multi-channel sequencer parallel computing system, the number of co-channel sequencers and the execution tasks of each co-channel sequencer can be flexibly allocated to complete complex task processing with the fastest computing efficiency. The load rate of the main processing module is effectively reduced, and multiple channel sequencers are used for task parallel processing to improve task processing efficiency.
[0083] Furthermore, in order to enable the main channel sequencer to smoothly acquire the task to be processed, step S10 includes: after receiving the interrupt signal sent by the main processing module, reading the task to be processed from the shared memory of the main processing module and the main channel sequencer.
[0084] It should be noted that shared memory refers to a memory area that can be accessed and modified by multiple processors, processes or modules. The data in the shared memory can be accessed by the main processing module and the main channel sequencer at the same time. The main processing module and the main channel sequencer share data through shared memory, which can exchange data efficiently and quickly. It allows different modules to directly access and modify the same memory area, thereby improving the overall performance and response speed of the system.
[0085] In this embodiment, after receiving the interrupt signal sent by the main processing module, the main channel sequencer reads the pending tasks from the shared memory of the main processing module and the main channel sequencer, so that the main channel sequencer can smoothly obtain the pending tasks.
[0086] Furthermore, in order to enable the main channel sequencer to achieve smooth feedback of the tasks to be processed, the processing results of each subtask are summarized and fed back to the main processing module in step S30, including: writing the summarized processing results into the shared memory to feed back the summarized processing results to the main processing module.
[0087] In this embodiment, by aggregating the processing results of each subtask and writing them into a shared memory as a summarized processing result, the summarized processing result can be fed back to the main processing module, thereby realizing data feedback.
[0088] Further, see Figure 2 In order to reasonably allocate each subtask and implement orderly execution and effective processing of each subtask, step S20 includes:
[0089] Step S21, decomposing the task to be processed into multiple subtasks;
[0090] It should be noted that the task to be processed may be an overcurrent detection task, a switch tube drive signal generation task, or other types of tasks.
[0091] It should be noted that different pending tasks have different numbers of subtasks, which can be determined according to the task type of the pending task. The subtasks decomposed from the same pending task can be the same or different, which is specifically determined according to the task type of the pending task.
[0092] Step S22, obtaining the current operating status of each of the cooperative channel sequencers;
[0093] It should be noted that the current running state may be an idle state, the type of task being processed, the processing speed, resource occupancy, etc. Different running states are represented by different identifiers.
[0094] Step S23, determining the target cooperative channel sequencer corresponding to each of the subtasks according to the current running state of each of the cooperative channel sequencers and the task processing type of the task to be processed;
[0095] In a feasible implementation, the main channel sequencer needs to monitor the running status of each co-channel sequencer in real time, including whether it is idle, the type of task being processed, the processing speed, resource occupancy, etc. When the status of the co-channel sequencer changes, the main channel sequencer needs to update its status information in time to ensure that the most accurate status data can be obtained when the subsequent task is assigned. According to the characteristics and requirements of the tasks to be processed, they are classified into different task processing types. For each task to be processed, the key information such as the processing resources, processing speed and task priority required are determined. According to the task processing type and required resources of the task to be processed, it is matched with the current running status of each co-channel sequencer. Co-channel sequencers that meet the task requirements and are currently idle or low-loaded are given priority. In the matching process, the priority of the task also needs to be considered. For high-priority tasks, resources can be allocated preferentially to ensure that the task can be completed in time. During the task execution process, the main channel sequencer needs to continuously monitor the running status and task execution of each co-channel sequencer. If it is found that a co-channel sequencer is overloaded or the task execution is slow, the main channel sequencer can dynamically adjust the task allocation and transfer some tasks to other idle or low-load co-channel sequencers for execution. According to the above matching results, each subtask is assigned to the corresponding target cooperative channel sequencer. After receiving the corresponding subtask, the target cooperative channel sequencer starts to execute the subtask and returns its processing results to the main channel sequencer. After receiving the processing results of each cooperative channel sequencer, the main channel sequencer processes and analyzes the results to ensure the successful completion of the task.
[0096] In another feasible implementation, the idle co-channel sequencer can be determined according to the current operating status of each co-channel sequencer; the type of each subtask is obtained; the idle co-channel sequencer matching the type of each subtask is determined; and the matching idle co-channel sequencer is used as the target co-channel sequencer of the corresponding subtask.
[0097] Step S24, allocating each of the subtasks to a corresponding co-channel sequencer for parallel processing.
[0098] In this embodiment, through the above steps, the main channel sequencer can accurately assign each subtask to the corresponding target cooperative channel sequencer according to the current operating status of each cooperative channel sequencer and the task processing type of the task to be processed, thereby achieving efficient execution of tasks and optimal utilization of resources.
[0099] Further, see Figure 3 In order to improve the over-current detection efficiency, when the task to be processed is an over-current detection task, step S20 includes:
[0100] Step S21, decomposing the overcurrent detection task according to the task processing type of each of the cooperative channel sequencers to obtain the overcurrent detection subtasks of each of the cooperative channel sequencers;
[0101] After receiving the task to be processed, the main channel sequencer analyzes the task to be processed and determines the auxiliary channel sequencer that can process the task to be processed. After determining the auxiliary channel sequencer that can process the task to be processed, the main channel sequencer further determines the task processing type corresponding to each auxiliary channel sequencer, and decomposes the overcurrent detection task according to the task processing type of each auxiliary channel sequencer to obtain the overcurrent detection subtask of each auxiliary channel sequencer.
[0102] The task processing type of each cooperative channel sequencer can be defined in advance through the program.
[0103] Exemplarily, the overcurrent detection task can be decomposed into multiple overcurrent detection subtasks, namely overcurrent detection on U-phase input current, overcurrent detection on V-phase input current and overcurrent detection on W-phase input current.
[0104] Step S22, respectively assigning each of the overcurrent detection subtasks to the corresponding auxiliary channel sequencers, wherein each of the auxiliary channel sequencers executes the overcurrent detection subtask after receiving the corresponding overcurrent detection subtask, and feeds back the overcurrent detection results of each of the overcurrent detection subtasks to the main channel sequencer.
[0105] Assume that there are three cooperative channel sequencers, namely MCS0, MCS1 and MCS2. The task processing type of MCS0 is to be able to perform overcurrent detection on the U-phase input current, then the U-phase input current is assigned to MCS0, so that MCS0 performs overcurrent detection on the U-phase input current, and feeds back the overcurrent detection result of whether the U-phase input current is overcurrent. The task processing type of MCS1 is to be able to perform overcurrent detection on the V-phase input current, then the V-phase input current is assigned to MCS1, so that MCS1 performs overcurrent detection on the V-phase input current, and feeds back the overcurrent detection result of whether the V-phase input current is overcurrent. The task processing type of MCS2 is to be able to perform overcurrent detection on the W-phase input current, then the W-phase input current is assigned to MCS2, so that MCS2 performs overcurrent detection on the W-phase input current, and feeds back the overcurrent detection result of whether the W-phase input current is overcurrent.
[0106] In this embodiment, the overcurrent detection task is decomposed according to the task processing type of each cooperative channel sequencer to obtain the overcurrent detection subtask of each cooperative channel sequencer, and each overcurrent detection subtask is respectively assigned to the corresponding cooperative channel sequencer. In this way, the main channel sequencer can realize task decomposition and task allocation of the overcurrent detection task without the participation of the main processing module, thereby reducing the data processing pressure of the main processing module.
[0107] Further, see Figure 4 In order to improve the efficiency of generating the driving signal of the switch tube, when the task to be processed is a task of generating the driving signal of the switch tube, step S20 includes:
[0108] Step S23, decomposing the driving signal generation task of the switch tube according to the task processing type of each of the cooperative channel sequencers to obtain the driving signal generation subtasks of the switch tubes of each of the cooperative channel sequencers;
[0109] After receiving the task to be processed, the main channel sequencer analyzes the task to be processed and determines the auxiliary channel sequencer that can process the task to be processed. After determining the auxiliary channel sequencer that can process the task to be processed, the main channel sequencer further determines the task processing type corresponding to each auxiliary channel sequencer, and decomposes the drive signal generation task of the switch tube according to the task processing type of each auxiliary channel sequencer to obtain the drive signal generation subtask of the switch tube of each auxiliary channel sequencer.
[0110] The task processing type of each cooperative channel sequencer can be defined in advance through the program.
[0111] Exemplarily, the task of generating the driving signal of the switch tube can be decomposed into a plurality of subtasks of generating the driving signal of the switch tube, which are respectively generating an A-phase driving signal, a B-phase driving signal and a C-phase driving signal.
[0112] Step S24, respectively assigning the drive signal generation subtask of each of the switch tubes to the corresponding auxiliary channel sequencer, wherein each of the auxiliary channel sequencers executes the drive signal generation subtask of the switch tube after receiving the drive signal generation subtask of the corresponding switch tube, and feeds back the drive signal generation result of the drive signal generation subtask of the switch tube to the main channel sequencer.
[0113] Assume that there are three co-channel sequencers, namely MCS0, MCS1 and MCS2. If the task processing type of MCS0 is capable of generating an A-phase drive signal, the generation task of the A-phase drive signal is assigned to MCS0, so that MCS0 generates an A-phase drive signal and feeds back the generation result of the A-phase drive signal to the main channel sequencer. If the task processing type of MCS1 is capable of generating a B-phase drive signal, the generation task of the B-phase drive signal is assigned to MCS1, so that MCS1 generates a B-phase drive signal, and feeds back the generation result of the B-phase drive signal to the main channel sequencer. If the task processing type of MCS2 is capable of generating a C-phase drive signal, the generation task of the C-phase drive signal is assigned to MCS2, so that MCS2 generates a C-phase drive signal, and feeds back the generation result of the C-phase drive signal to the main channel sequencer.
[0114] In this embodiment, the drive signal generation task of the switch tube is decomposed according to the task processing type of each of the cooperative channel sequencers to obtain the drive signal generation subtasks of the switch tubes of each of the cooperative channel sequencers, and the drive signal generation subtasks of each of the switch tubes are respectively assigned to the corresponding cooperative channel sequencers. In this way, the main channel sequencer can realize task decomposition and task allocation of the drive signal generation task of the switch tube without the participation of the main processing module, thereby reducing the data processing pressure of the main processing module.
[0115] In addition, to achieve the above purpose, refer to Figure 5 , Figure 5 This is a flow chart of the second embodiment of the task processing method of the present application. In this embodiment, the task processing method is applied to the co-channel sequencer in the co-processing module of the motor controller, and the co-channel sequencer includes multiple co-channel sequencers, and each of the co-channel sequencers is connected to the main channel sequencer of the co-processing module, and the main channel sequencer is connected to the main processing module of the motor controller.
[0116] In this embodiment, the task processing method includes steps S110 to S130:
[0117] Step S110, receiving the subtask sent by the main channel sequencer, wherein the main channel sequencer obtains the to-be-processed task sent by the main processing module, decomposes the to-be-processed task into multiple subtasks, and assigns each of the subtasks to a corresponding assistant channel sequencer;
[0118] The main channel sequencer communicates with each auxiliary channel sequencer through the ARU module. Among them, the ARU module is the core component of the timer. It can route the tasks decomposed by the main channel sequencer to each auxiliary channel sequencer, so that each auxiliary channel sequencer can receive the subtasks sent by the main channel sequencer.
[0119] The task to be processed may be an overcurrent detection task, and the corresponding decomposed subtask is an overcurrent detection subtask, so that the cooperative channel sequencer can obtain the overcurrent detection subtask to perform overcurrent detection on the single-phase input current; the task to be processed may also be a task for generating a driving signal for the switching tube, so that the cooperative channel sequencer can generate a single-phase driving signal for the switching tube.
[0120] Step S120, executing the subtask and obtaining the processing result of the subtask;
[0121] After receiving the subtask, the cooperative channel sequencer processes the subtask and obtains the processing result of the subtask.
[0122] Exemplarily, if the subtask of the cooperative channel sequencer is to perform overcurrent detection on the U-phase input current, then the cooperative channel sequencer can read the U-phase input current from its corresponding shared memory and perform overcurrent detection on the U-phase input current. The processing result of the subtask here can be overcurrent or no overcurrent. If the subtask of the cooperative channel sequencer is to generate an A-phase drive signal, the pulse signal parameters sent by the main channel sequencer are read from the shared memory, and the pulse signal parameters and the public data sent by the main channel sequencer are processed to obtain the register value, thereby obtaining the A-phase drive signal. The subtask processing result here can be a register value, such as a level flip point.
[0123] Step S130, feeding back the processing results of the subtasks to the main channel sequencer, wherein the main channel sequencer receives the processing results of each of the auxiliary channel sequencers for each subtask, and summarizes the processing results of each of the subtasks and feeds them back to the main processing module.
[0124] The main channel sequencer communicates with each auxiliary channel sequencer through the ARU module. Among them, the ARU module is the core component of the timer. It can route the subtask processing results of the auxiliary channel sequencer to the main channel sequencer through the ARU module, thereby achieving the effect of feeding back the processing results of the subtask to the main channel sequencer.
[0125] In this embodiment, the processing efficiency of tasks can be improved by performing parallel processing of corresponding subtasks through various cooperative channel sequencers.
[0126] In other embodiments, in addition to task decomposition, the main channel sequencer can also perform the same functions as the auxiliary channel sequencer, so that the resources in the main channel sequencer can be used reasonably to avoid resource waste.
[0127] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the task processing method of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.
[0128] This application also provides a task processing system, please refer to Figure 6 , the task processing system comprises:
[0129] The task acquisition module 10 is used to acquire the tasks to be processed sent by the main processing module;
[0130] The task allocation module 20 is used to decompose the task to be processed into multiple subtasks, and allocate each of the subtasks to a corresponding co-channel sequencer for parallel processing;
[0131] A summary feedback module 30 is used to receive the processing results of each of the co-channel sequencers for each subtask, and summarize the processing results of each of the subtasks and feed them back to the main processing module;
[0132] Optionally, the task acquisition module 10 is further configured to read the to-be-processed task from a shared memory of the main processing module and the main channel sequencer after receiving an interrupt signal sent by the main processing module.
[0133] Optionally, the task assignment module 20 is also used to decompose the overcurrent detection task according to the task processing type of each of the cooperative channel sequencers to obtain the overcurrent detection subtasks of each of the cooperative channel sequencers; and assign each of the overcurrent detection subtasks to the corresponding cooperative channel sequencers, wherein each of the cooperative channel sequencers executes the overcurrent detection subtask after receiving the corresponding overcurrent detection subtask, and feeds back the overcurrent detection results of each of the overcurrent detection subtasks to the main channel sequencer.
[0134] Optionally, the task assignment module 20 is also used to decompose the drive signal generation task of the switch tube according to the task processing type of each of the cooperative channel sequencers to obtain the drive signal generation subtasks of the switch tubes of each of the cooperative channel sequencers; and assign the drive signal generation subtasks of each of the switch tubes to the corresponding cooperative channel sequencers, respectively, wherein each of the cooperative channel sequencers executes the drive signal generation subtask of the switch tube after receiving the drive signal generation subtask of the corresponding switch tube, and feeds back the drive signal generation result of the drive signal generation subtask of the switch tube to the main channel sequencer.
[0135] Optionally, the summary feedback module 30 is further configured to write the summarized processing result into the shared memory, so as to feed back the summarized processing result to the main processing module.
[0136] This application also provides a task processing system, please refer to Figure 7 , the task processing system comprises:
[0137] The subtask sending module 40 is used to receive the subtask sent by the main channel sequencer, wherein the main channel sequencer obtains the to-be-processed task sent by the main processing module, decomposes the to-be-processed task into multiple subtasks, and assigns each of the subtasks to the corresponding assistant channel sequencer;
[0138] The subtask execution module 50 is used to execute the subtask and obtain the processing result of the subtask;
[0139] The processing result feedback module 60 is used to feed back the processing result of the subtask to the main channel sequencer, wherein the main channel sequencer receives the processing result of each subtask from each of the auxiliary channel sequencers, and summarizes the processing result of each subtask and feeds it back to the main processing module.
[0140] The task processing system provided by the present application adopts the task processing method in the above embodiment to improve the processing efficiency of tasks. Compared with the prior art, the beneficial effects of the task processing system provided by the present application are the same as the beneficial effects of the task processing method provided by the above embodiment, and other technical features in the task processing system are the same as the features disclosed in the above embodiment method, which will not be repeated here.
[0141] In addition, to achieve the above purpose, the present embodiment further proposes a motor controller, the motor controller comprising a main processing module, a co-processing module and a shared memory, wherein the co-processing module comprises a main channel sequencer and a plurality of co-channel sequencers, each of the channel sequencers is connected to the main processing module through a corresponding shared memory;
[0142] The motor controller also includes a computer program stored in the shared memory and executable on the main channel sequencer, wherein the computer program is configured to implement the steps of the above-mentioned task processing method; or, the motor controller also includes: a computer program stored in the shared memory and executable on the assistant channel sequencer, wherein the computer program is configured to implement the steps of the above-mentioned task processing method.
[0143] The specific implementation methods of the motor controller can correspond to the above-mentioned method embodiments, so all the beneficial effects brought about by the technical solutions of the above-mentioned method embodiments can be consistent with the beneficial effects brought about by the technical solutions of the above-mentioned system embodiments, and will not be repeated here one by one.
[0144] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.
Claims
1. A task processing method, characterized in that: A main channel sequencer in a co-processing module of a motor controller, wherein the co-processing module further comprises a plurality of co-channel sequencers, and the main channel sequencer is used to connect each of the co-channel sequencers with the main processing module of the motor controller, and the method comprises: Obtaining the pending tasks sent by the main processing module; Decomposing the task to be processed into multiple subtasks, and assigning each of the subtasks to a corresponding co-channel sequencer for parallel processing; The processing results of each of the cooperative channel sequencers for each subtask are received, and the processing results of each of the subtasks are summarized and fed back to the main processing module.
2. The method according to claim 1, characterized in that The step of obtaining the to-be-processed tasks sent by the main processing module comprises: After receiving the interrupt signal sent by the main processing module, reading the to-be-processed task from the shared memory of the main processing module and the main channel sequencer; The step of aggregating the processing results of each of the subtasks and feeding them back to the main processing module comprises: The summarized processing results are written into the shared memory to feed back the summarized processing results to the main processing module.
3. The method according to claim 1, characterized in that The step of decomposing the task to be processed into a plurality of subtasks and assigning each of the subtasks to a corresponding co-channel sequencer for parallel processing comprises: Decomposing the task to be processed into multiple subtasks; Obtaining the current running status of each of the co-channel sequencers; Determine the target cooperative channel sequencer corresponding to each of the subtasks according to the current running state of each of the cooperative channel sequencers and the task processing type of the task to be processed; Each of the subtasks is respectively assigned to a corresponding co-channel sequencer for parallel processing.
4. The method according to claim 3, characterized in that The step of determining the target cooperative channel sequencer corresponding to each of the subtasks according to the current running state of each of the cooperative channel sequencers and the task processing type of the task to be processed comprises: Determine an idle associate channel sequencer according to the current operating status of each of the associate channel sequencers; Obtaining the type of each of the subtasks; Determine an idle co-channel sequencer matching the type of each of the subtasks; The matching idle co-channel sequencer is used as the target co-channel sequencer of the corresponding subtask.
5. The method according to claim 1 or 2, characterized in that: When the task to be processed is an overcurrent detection task, the step of decomposing the task to be processed into a plurality of subtasks and assigning each of the subtasks to a corresponding co-channel sequencer for parallel processing includes: Decomposing the overcurrent detection task according to the task processing type of each of the cooperative channel sequencers to obtain the overcurrent detection subtasks of each of the cooperative channel sequencers; Each of the overcurrent detection subtasks is respectively assigned to a corresponding auxiliary channel sequencer, wherein each of the auxiliary channel sequencers executes the overcurrent detection subtask after receiving the corresponding overcurrent detection subtask, and feeds back the overcurrent detection result of each of the overcurrent detection subtasks to the main channel sequencer.
6. The method according to claim 1 or 2, characterized in that: When the task to be processed is a task of generating a driving signal for a switch tube, the step of decomposing the task to be processed into a plurality of subtasks and assigning each of the subtasks to a corresponding co-channel sequencer for parallel processing includes: Decomposing the drive signal generation task of the switch tube according to the task processing type of each of the cooperative channel sequencers to obtain the drive signal generation subtasks of the switch tubes of each of the cooperative channel sequencers; The drive signal generation subtask of each of the switch tubes is respectively assigned to the corresponding auxiliary channel sequencer, wherein, after receiving the drive signal generation subtask of the corresponding switch tube, each of the auxiliary channel sequencers executes the drive signal generation subtask of the switch tube and feeds back the drive signal generation result of the drive signal generation subtask of the switch tube to the main channel sequencer.
7. A task processing method, characterized in that: A co-channel sequencer in a co-processing module of a motor controller, wherein the co-channel sequencer includes a plurality of co-channel sequencers, and each of the co-channel sequencers is connected to a main channel sequencer of the co-processing module, and the main channel sequencer is connected to a main processing module of the motor controller, and the method includes: Receiving the subtask sent by the main channel sequencer, wherein the main channel sequencer obtains the to-be-processed task sent by the main processing module, decomposes the to-be-processed task into a plurality of subtasks, and assigns each of the subtasks to a corresponding assistant channel sequencer; Execute the subtask and obtain the processing result of the subtask; The processing results of the subtasks are fed back to the main channel sequencer, wherein the main channel sequencer receives the processing results of each of the auxiliary channel sequencers for each subtask, and summarizes the processing results of each of the subtasks and feeds them back to the main processing module.
8. A task processing system, characterized in that: The task processing system comprises: The task acquisition module is used to acquire the pending tasks sent by the main processing module; A task allocation module, used for decomposing the task to be processed into multiple subtasks, and respectively allocating each of the subtasks to a corresponding co-channel sequencer for parallel processing; The summary feedback module is used to receive the processing results of each of the cooperative channel sequencers for each subtask, and summarize the processing results of each of the subtasks and feed them back to the main processing module.
9. A task processing system, characterized in that: The task processing system comprises: A subtask sending module, used for receiving subtasks sent by the main channel sequencer, wherein the main channel sequencer obtains the pending task sent by the main processing module, decomposes the pending task into multiple subtasks, and assigns each of the subtasks to the corresponding assistant channel sequencer; A subtask execution module, used to execute the subtask and obtain the processing result of the subtask; A processing result feedback module is used to feed back the processing results of the subtasks to the main channel sequencer, wherein the main channel sequencer receives the processing results of each of the auxiliary channel sequencers for each subtask, and summarizes the processing results of each of the subtasks and feeds them back to the main processing module.
10. A motor controller, characterized in that: The motor controller includes a main processing module, a co-processing module and a shared memory, wherein the co-processing module includes a main channel sequencer and a plurality of co-channel sequencers, and each of the channel sequencers is connected to the main processing module through a corresponding shared memory; The motor controller further comprises: a computer program stored in the shared memory and executable on the master channel sequencer, the computer program being configured to implement the steps of the task processing method as claimed in any one of claims 1 to 6; Alternatively, the motor controller further comprises: a computer program stored in the shared memory and executable on the co-channel sequencer, wherein the computer program is configured to implement the steps of the task processing method as claimed in claim 7.