Digital power supply control device, design method and control method

By dividing the content of multi-core DSP into modules and allocating execution time, combined with handshake mechanism technology, the load balancing problem between multi-core processors is solved and the stability and reliability of the system are improved.

CN118534810APending Publication Date: 2024-08-23JND ELECTRONIC TECH (SHANGHAI) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410591897.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-13
Publication Date
2024-08-23

AI Technical Summary

Technical Problem

The existing multi-core DSP synchronization control method cannot fully utilize the performance of multi-core processors and cannot effectively solve the load balancing problem between multi-cores, resulting in insufficient system stability and reliability.

Method used

By dividing the content of the main controller into modules, the execution time of each module is obtained, and the modules are assigned to different processors according to the execution time and logical sequence. The handshake mechanism technology is used to align the timing of parallel execution modules to ensure coordination between processors. Interact with data.

Benefits of technology

It realizes the dynamic adjustment of multi-core processor performance, solves the problem of load balancing, and improves the stability and reliability of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118534810A
    Figure CN118534810A
Patent Text Reader

Abstract

The invention relates to the technical field of digital power supply control, in particular to a digital power supply control device, a design method and a control method. Then, according to the execution logic sequence and the execution time of each module, the execution sequence of each module is arranged and allocated to different processors in the main controller for execution, so that dynamic adjustment can be carried out according to the execution time of each module, and the performance of the multi-core processor is fully utilized; secondly, a handshake mechanism is inserted into each selected parallel execution module and is used for carrying out time sequence alignment, stage data interaction operation and the like on the subsequently executed parallel execution modules, so that the work of the multi-core processor is more coordinated, the problem of load balancing among the multi-core processors is effectively solved, and the load balancing efficiency is improved. And the stability and the reliability of the system are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of digital power supply control, and in particular to a digital power supply control device, a design method and a control method. Background Art

[0002] Digital power control systems are an important part of modern power electronic equipment and are widely used in various power electronic equipment, such as photovoltaic inverters, wind power inverters, uninterruptible power supplies, etc. The control core of these devices is usually a digital signal processor (DSP), which can meet the real-time and accuracy requirements of digital power control systems due to its powerful computing power and fast response speed. However, as the complexity of power electronic equipment increases, the control algorithm becomes more and more complex, which requires a higher-performance DSP. Therefore, multi-core DSP has become the mainstream controller of digital power control systems. Multi-core DSP is a microprocessor with multiple processor cores, each of which can execute instructions independently, thereby improving the parallel processing capability of the system. However, the asynchronous operation of the various central processing units (CPUs) of the multi-core DSP will lead to inaccurate timing logic control and delayed response when processing work.

[0003] In order to ensure the stability and reliability of the all-digital power control system, the existing digital power control system usually adopts a dual CPU redundant architecture, and the common ones are DSP+Field Programmable Gate Array (FPGA), DSP+Complex Programmable Logic Device (CPLD), etc. This architecture usually uses DSP to implement complex control algorithms, and FPGA or CPLD to be responsible for hardware protection, pulse width modulation (PWM) output and other work links that require high timeliness. In this architecture, multiple cores of DSP need to work synchronously to ensure the stability and reliability of the control system. Or use software programming to achieve the synchronization of the work of each CPU core of the multi-core DSP by modifying the design of the software program.

[0004] Although the existing multi-core DSP synchronization control method can improve the performance of digital power control systems to a certain extent, there are still some problems in practical applications. On the one hand, since different tasks may require different execution times, and the existing synchronization control method cannot be dynamically adjusted according to the actual execution time of the task, the existing synchronization control method may not fully utilize the performance of the multi-core DSP. On the other hand, the existing synchronization control method cannot effectively solve the load balancing problem between multiple cores, which may cause some cores to be overloaded while other cores are idle.

[0005] In view of this, overcoming the defects of the prior art is an urgent problem to be solved in the field of this technology. Summary of the invention

[0006] The technical problem to be solved by the present invention is how to improve the performance of a multi-core processor and how to solve the load balancing problem among the multi-core processors.

[0007] The present invention adopts the following technical solution:

[0008] In a first aspect, the present invention provides a design method for improving the performance of a multi-core processor, the design method being implemented in a digital power control device including a main controller and a programmable device, the design method comprising:

[0009] Step 101: Divide the content to be executed by the main controller into modules, and obtain the execution time of each module;

[0010] Step 102: Allocating each module to different processors in the main controller according to the execution time and execution order of each module;

[0011] Step 103: Determine a parallel execution module that has a parallel execution relationship with modules in other processors, and insert a handshake mechanism at the selected parallel execution module to align the timing of subsequent modules.

[0012] Preferably, allocating each module to different processors in the main controller according to the execution time and execution order of each module comprises:

[0013] Arrange all modules according to the implementation logic order of each module to determine the execution order of each module;

[0014] Determine at least one parallel execution group according to the execution order; wherein each of the parallel execution groups includes at least two parallel execution modules, and the parallel execution modules in the same parallel execution group can be executed at the same time without interfering with each other;

[0015] Based on the maximum parallelism principle, the parallel execution modules in the same parallel execution group are respectively allocated to at least two different processors according to the execution time of the corresponding modules.

[0016] Preferably, the design method for improving the performance of a multi-core processor further includes:

[0017] The main controller is configured so that multiple processors share the rising edge of the same synchronization signal as an interrupt trigger source to enter an interrupt processing state; the synchronization signal is an external arbitrary periodic signal.

[0018] Preferably, the synchronization signal output port of the programmable device is connected to the external interrupt pin of the main controller;

[0019] The programmable device generates the synchronization signal and sends the synchronization signal to the main controller through the synchronization signal output port.

[0020] Preferably, obtaining the execution time of each module includes:

[0021] Connect the probe of the oscilloscope to the output IO (full name in English: Input / Output) port of the main controller to be measured;

[0022] Adding a level control code of the output IO port in the program code, setting the output IO port to a high level through the level control code when the required measurement module starts to be executed, and setting the output IO port to a low level through the level control code after the required measurement module is executed;

[0023] The interval time between the high level and the low level of the output IO port is measured by an oscilloscope. The interval time is the execution time of the required measurement module, so as to obtain the execution time of each module.

[0024] Preferably, obtaining the execution time of each module also includes:

[0025] According to the function module for calculating the program running time in the main controller, the execution time of the specified section of code is measured to obtain the execution time of each module.

[0026] Preferably, inserting a handshake mechanism at a selected parallel execution module to align the timing of subsequent modules includes:

[0027] For each processor, a flag updating process is inserted at the execution end node of the selected parallel execution module; the flag updating process is used to update the end flag to a preset value;

[0028] A handshake process is inserted at the execution start node of the selected parallel execution module; the handshake process is used to determine whether the end flags corresponding to the modules before the parallel execution module in the execution order are all updated to preset values ​​to determine whether to run the parallel execution module.

[0029] Preferably, the main controller comprises at least a first processor and a second processor, the first processor is allocated with a first parallel execution module, the second processor is allocated with a second parallel execution module and a third parallel execution module, the first parallel execution module can be executed in parallel with the second parallel execution module and the third parallel execution module, and the difference between the sum of the execution time of the second parallel execution module and the third parallel execution module and the execution time of the first parallel execution module is less than a preset value;

[0030] The inserting of a handshake mechanism at the selected parallel execution module comprises:

[0031] In the first processor, inserting the handshake process at the execution start node of the first parallel execution module, and inserting the flag update process at the execution end node of the first parallel execution module;

[0032] In the second processor, the handshake process is inserted at the execution start node of the second parallel execution module, and the flag update process is inserted at the execution end node of the third parallel execution module.

[0033] In a second aspect, a control method for a multi-core processor is provided. The control method for the multi-core processor is applied to a digital power supply control device designed by the design method. The control method includes:

[0034] After receiving the synchronization signal, each processor executes the assigned modules in sequence;

[0035] If a handshake process is detected before the parallel execution module starts executing, it is determined whether the end flags corresponding to the modules before the parallel execution module in the execution order are all updated to preset values; if all are updated to preset values, the parallel execution module starts executing;

[0036] If a flag update process is detected after the parallel execution module is finished executing, the corresponding end flag is updated to a preset value.

[0037] In a third aspect, a digital power supply control device is provided, comprising a main controller and a programmable device, wherein a synchronization signal output port of the programmable device is connected to an external interrupt pin of the main controller, and the main controller comprises a plurality of processors, and the processors are used to execute the control method.

[0038] In a fourth aspect, a control device for a multi-core processor is provided, the control device for the multi-core processor comprising: a processor and a memory for storing instructions executable by the processor;

[0039] Wherein, the processor is configured to execute the control method of the multi-core processor described in the second aspect.

[0040] In a fifth aspect, a non-volatile computer storage medium is provided, wherein the computer storage medium stores computer executable instructions, and the computer executable instructions are executed by one or more processors to complete the control method of the multi-core processor described in the second aspect.

[0041] In a sixth aspect, a chip is provided, comprising: a processor and an interface, for calling and running a computer program stored in the memory from a memory, and executing the control method of the multi-core processor as described in the second aspect.

[0042] In a seventh aspect, a computer program product comprising instructions is provided, which, when executed on a computer or a processor, enables the computer or the processor to execute the control method of the multi-core processor as described in the second aspect.

[0043] Compared with the prior art, the present invention has the following beneficial effects:

[0044] The present invention divides the content to be executed by the main controller into modules and obtains the execution time of each module, then arranges the execution order of each module according to the execution logic order and execution time of each module and allocates them to different processors in the main controller for execution, so that dynamic adjustment can be made according to the execution time of each module to fully utilize the performance of the multi-core processor; secondly, the present invention inserts a handshake mechanism at each selected parallel execution module to perform timing alignment and stage data interaction operations on the subsequently executed parallel execution modules, so that the work of the multi-core processor is more coordinated, effectively solves the load balancing problem between multi-core processors, and improves the stability and reliability of the system. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0046] Figure 1 It is a structural schematic diagram of a digital power supply control system provided by an embodiment of the present invention;

[0047] Figure 2It is a flowchart of a design method for improving the performance of a multi-core processor provided by an embodiment of the present invention;

[0048] Figure 3 is a schematic diagram of the execution time of each module provided by an embodiment of the present invention;

[0049] Figure 4 It is a structural diagram of allocating modules to different processors for execution provided by an embodiment of the present invention;

[0050] Figure 5 It is a handshake flow diagram of a handshake mechanism provided by an embodiment of the present invention;

[0051] Figure 6 is a schematic diagram of an insertion structure of a handshake mechanism provided by an embodiment of the present invention;

[0052] Figure 7 It is a schematic diagram of a synchronization signal generation process provided by an embodiment of the present invention;

[0053] Figure 8 1 is a waveform diagram of a PWM carrier signal and a synchronization signal provided by an embodiment of the present invention;

[0054] Fig. 9 It is a flowchart of a control method of a multi-core processor provided by an embodiment of the present invention;

[0055] Fig.10 is a structural schematic diagram of a control device for a multi-core processor provided by an embodiment of the present invention;

[0056] Fig.11 It is a structural schematic diagram of a digital power supply control device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0057] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0058] Unless the context requires otherwise, throughout the specification and claims, the term "including" is to be interpreted as open inclusion, that is, "including, but not limited to". In the description of the specification, the terms "one embodiment", "some embodiments", "exemplary embodiments", "examples", "specific examples" or "some examples" and the like are intended to indicate that specific features, structures, materials or characteristics associated with the embodiment or example are included in at least one embodiment or example of the present disclosure. The schematic representation of the above terms does not necessarily refer to the same embodiment or example. In addition, the specific features, structures, materials or characteristics may be included in any one or more embodiments or examples in any appropriate manner, that is, although they may be carried in the embodiments or examples of the above terms due to reasons such as the order and position of appearance, it is not limited to that they can be carried in combination by one embodiment or example.

[0059] In the description of the present invention, the terms "first" and "second" are used only for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the embodiments of the present disclosure, unless otherwise specified, the meaning of "multiple" is two or more. In addition, for example, the same type of nouns may be described as two independent individuals by adding "A" and "B" at the end. In this case, the corresponding features defined as "A" and "B" are only used to distinguish the same type of individuals for description purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features.

[0060] When describing some embodiments, the expressions "coupling", "coupling" and "connection" and their derivatives may be used. For example, when describing some embodiments, the term "connection" may be used to indicate that two or more components are in direct physical or electrical contact with each other. For another example, when describing some embodiments, the term "coupling" may be used to indicate that two or more components are in direct physical or electrical contact. However, the terms "connection" or "coupling" may also refer to two or more components that are not in direct contact with each other, but still cooperate or interact with each other, such as "optical path coupling", "wireless connection", etc. The embodiments disclosed herein are not necessarily limited to the contents of the present invention.

[0061] In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.

[0062] Embodiment 1:

[0063] Embodiment 1 of the present invention provides a design method for improving the performance of a multi-core processor. The design method is implemented in a digital power control device including a main controller and a programmable device. The design method includes: dividing the content that needs to be executed by the main controller into modules, and obtaining the execution time of each module; allocating each module to different processors in the main controller according to the execution time and execution order of each module; determining a parallel execution module that has a parallel execution relationship with modules in other processors, and inserting a handshake mechanism at the selected parallel execution module to align the timing of subsequent modules.

[0064] The programmable device may be a CPLD or an FPGA, and the main controller may be a DSP.

[0065] In one embodiment, the design method for improving the performance of a multi-core processor will be described below with reference to a specific example. Figure 1 As shown, the digital power control device adopts a multi-core DSP+CPLD dual redundant architecture control system, wherein the DSP is used as the main controller, the DSP includes multiple CPUs, and the CPLD is used as a programmable device. This architecture can effectively improve the reliability and stability of the system, and is also conducive to the realization of multi-core synchronous work. Figure 1 The other structures in are only to show the completeness of the whole system.

[0066] The content to be executed by the DSP is divided into modules and the execution time required for each module is measured. Then, the execution order of the modules is arranged according to the execution time and execution order of each module, and then assigned to different processors in the main controller for execution. That is, the modules are arranged according to the execution logic order of each module. For example, module 1, module 2, and module 3 are executed in sequence according to the execution logic. At this time, if module 1 and module 2 can be executed in parallel, that is, the execution logics of the two modules do not affect each other, module 1 can be assigned to one processor and module 2 can be assigned to another processor. In this way, dynamic adjustment can be made according to the actual execution time of the task to fully utilize the performance of the multi-core DSP.

[0067] Assuming that the main controller includes two processors, the two processors can execute the two modules (module 1 and module 2 in the above example) at the same time point to maintain load balancing among multiple processors in the entire main controller. In order for the two processors to execute the two modules at the same time point, it is necessary to insert a handshake mechanism at the selected parallel execution module, wherein the parallel execution modules, i.e., module 1 and module 2 in the above example, are both parallel execution modules. Insert a handshake mechanism at the selected parallel execution module. The handshake mechanism is a synchronization tool used to transmit signals between different processors to confirm that a module has completed execution. Through the handshake mechanism, each processor can know the status of other processors, thereby coordinating their execution and ensuring data consistency and sequentiality. The handshake mechanism will be described in detail below.

[0068] This embodiment divides the content to be executed by the main controller into modules and obtains the execution time of each module, then arranges the execution order of each module according to the execution logic order and execution time of each module and allocates them to different processors in the main controller for execution, so that dynamic adjustments can be made according to the execution time of each module to fully utilize the performance of the multi-core processor; secondly, this embodiment inserts a handshake mechanism at each selected parallel execution module to perform timing alignment and stage data interaction operations on the subsequently executed parallel execution modules, so that the work of the multi-core processor is more coordinated, effectively solving the load balancing problem between multi-core processors, and improving the stability and reliability of the system.

[0069] Next, the design method for improving the performance of a multi-core processor will be described in detail.

[0070] In a preferred embodiment, Figure 2 As shown, the design method for improving the performance of a multi-core processor includes:

[0071] Step 101: Divide the content to be executed by the main controller into modules, and obtain the execution time of each module.

[0072] The content that the main controller needs to execute is the program code that the DSP needs to run, which can be provided by the developer. For example, in this embodiment, the content that the main controller needs to execute is divided into an ADC analog quantity sampling module, an analog quantity and actual value conversion calculation module, and a multi-channel analog quantity actual value conversion module.

[0073] The method for obtaining the execution time of each module includes: measuring the execution time of a specified segment of code according to the function module for calculating the program running time in the main controller to obtain the execution time of each module. If the DSP officially provides a timing function module for calculating the program running time, the timing function module can be used to measure the execution time of the specified segment of code.

[0074] If the timing function module cannot be provided, the method for obtaining the execution time of each module includes: connecting the probe of the oscilloscope to the output IO port of the main controller that needs to be measured; adding the level control code of the output IO port in the program code, and when the required measurement module starts to be executed, the output IO port is set to a high level through the level control code, and after the required measurement module is executed, the output IO port is set to a low level through the level control code; measuring the interval time between the high level and the low level of the output IO port through an oscilloscope, and the interval time is the execution time of the required measurement module, so as to obtain the execution time of each module.

[0075] Of course, in other embodiments, when the required measurement module starts to be executed, the output IO port can also be set to a level through the level control code. After the required measurement module is executed, the output IO port can be set to a high level through the level control code to measure the execution time of the required measurement module.

[0076] According to the above implementation, the execution time of each module can be obtained, such as Figure 3 As shown, the execution time of module 1 is T_m1, the execution time of module 2 is T_m2, and so on.

[0077] Step 102: Allocate each module to a different processor in the main controller according to the execution time and execution order of each module.

[0078] In one embodiment, all modules are arranged according to the implementation logic order of each module to determine the execution order of each module; at least one parallel execution group is determined according to the execution order; wherein each parallel execution group includes at least two parallel execution modules, and the parallel execution modules in the same parallel execution group can be executed at the same time without interfering with each other; based on the maximum parallelism principle, the parallel execution modules in the same parallel execution group are respectively allocated to at least two different processors according to the execution time of the corresponding modules.

[0079] Among them, according to the execution order, different modules will have a successive relationship, and different modules will also have a parallel execution relationship. Modules with a successive relationship are divided into serial execution groups; modules with a parallel execution relationship are divided into parallel execution groups.

[0080] In the actual allocation process, the parallel execution modules with parallel execution relationships can be first divided into at least two processors respectively; then the serial execution modules with a sequential relationship with the parallel execution modules are determined, and the corresponding serial execution modules are allocated to the appropriate processors according to the execution order to ensure that the execution logic is not disordered. Figure 4 As shown, module 2 and module 3 are a parallel execution group, module 2 and module 3 are respectively called parallel execution modules, and module 2 and module 3 are assigned to different processors; module 4, module 5, module 6 and module 7 are a parallel execution group, module 4 is assigned to CPU1, and module 5, module 6 and module 7 are assigned to CPU2; module 8, module 9 and module 10 are a parallel execution group, module 9 and module 10 are assigned to CPU1, and module 8 is assigned to CPU2.

[0081] In one embodiment, the parallel execution modules are first assigned to different processors according to the parallel execution groups, and then other unassigned modules are assigned to appropriate processors.

[0082] The maximum parallelism principle means that modules that can be executed in parallel should be assigned to be completed within a similar length of time as much as possible, that is, parallel execution modules with similar execution time should be assigned to be processed within the same time period of multiple processors as much as possible. Figure 4 For example, modules 5, 6 and 7 form a parallel execution group with module 4. The total execution time of modules 5, 6 and 7 is almost the same as that of module 4, so the parallel execution group is scheduled to execute in the same time period. In this way, dynamic adjustment can be made according to the actual execution time of the task to fully utilize the performance of the multi-core DSP.

[0083] In one embodiment, when the parallel execution group includes at least three parallel execution modules, and the at least three parallel execution modules are in a parallel execution relationship; the allocating the parallel execution modules in the same parallel execution group to at least two different processors according to the execution time of the corresponding modules includes:

[0084] Assign the parallel execution module with the longest execution time to one of the processors; assign the parallel execution modules with shorter execution time to the same processor; or, group the parallel execution modules according to the execution time of each parallel execution module in the same parallel execution group, so that the sum of the execution time of the parallel execution modules in each group is substantially the same.

[0085] For example, in one embodiment, it is necessary to complete the ADC analog quantity sampling before performing the analog quantity and actual value conversion calculation. The ADC analog quantity sampling module and the analog quantity and actual value conversion calculation module can be assigned to the same processor; there is no order relationship between the actual value conversion of multi-channel analog quantities and the ADC analog quantity sampling and analog quantity and actual value conversion calculation. Therefore, the actual value conversion module of the multi-channel analog quantity can be respectively combined with the ADC analog quantity sampling module and the analog quantity and actual value conversion calculation module to form a parallel execution group, which can be executed in parallel. For example, referring to Figure 4 , the ADC analog quantity sampling module (such as module 9) and the analog quantity and actual value conversion calculation module (such as module 10) can be assigned to CPU1, and the multi-channel analog quantity actual value conversion module (such as module 8) can be assigned to CPU2.

[0086] Step 103: Determine a parallel execution module that has a parallel execution relationship with modules in other processors, and insert a handshake mechanism at the selected parallel execution module to align the timing of subsequent modules.

[0087] In one embodiment, the handshake mechanism includes a flag update process and a handshake process. For each processor, the flag update process is inserted at the execution end node of the selected parallel execution module; the flag update process is used to update the end flag to a preset value; the handshake process is inserted at the execution start node of the selected parallel execution module; the handshake process is used to determine whether the end flags corresponding to the modules whose execution order is before the parallel execution module are all updated to the preset values, so as to determine whether to run the parallel execution module.

[0088] In one embodiment, not all parallel execution modules need to be inserted with a handshake mechanism, but a suitable parallel execution module is selected according to the execution time and execution logic. For example, the main controller includes at least a first processor and a second processor, the first processor is assigned with a first parallel execution module, the second processor is assigned with a second parallel execution module and a third parallel execution module, the first parallel execution module can be executed in parallel with the second parallel execution module and the third parallel execution module, and the difference between the sum of the execution time of the second parallel execution module and the third parallel execution module and the execution time of the first parallel execution module is less than a preset value;

[0089] The inserting of the handshake mechanism at the selected parallel execution module includes: in the first processor, inserting the handshake process at the execution start node of the first parallel execution module, and inserting the flag update process at the execution end node of the first parallel execution module; in the second processor, inserting the handshake process at the execution start node of the second parallel execution module, and inserting the flag update process at the execution end node of the third parallel execution module.

[0090] by Figure 4 For example, module 4, module 5, module 6 and module 7 can be executed in parallel, and the total execution time of module 5, module 6 and module 7 is almost the same as the execution time of module 4, then module 4 is selected as the parallel execution module, the handshake process is inserted at the execution start node of module 4, and the flag update process is inserted at the execution end node of module 4; module 5 and module 7 are selected as parallel execution modules, the handshake process is inserted at the execution start node of module 5, and the flag update process is inserted at the execution end node of module 7.

[0091] In one embodiment, the main controller includes at least a first processor and a second processor, a memory is arranged between the first processor and the second processor, and the memory may be a dual-access random access memory (DARAM); when the parallel execution module n and the parallel execution module n+4 are executed by the first processor, and the parallel execution module n+1, the parallel execution module n+2, the parallel execution module n+3 and the parallel execution module n+5 are executed by the second processor, Figure 5 and Figure 6 As shown, the handshake process of the handshake mechanism specifically includes:

[0092] Step 201: inserting an execution end mark at the end of execution of the selected parallel execution module.

[0093] That is, in Figure 6 In the example, the selected parallel execution modules are module n and module n+3, and the execution end flag F1 of the first processor is set at the execution end node P11 of the parallel execution module n. n Set to a preset value (which may be 1), and update the mapping value in the memory; and set the second processor execution end flag F2 at the execution end node P21 of the parallel execution module n+3 n+3 Set to a preset value (which may be 1), and update the mapping value in the memory;

[0094] Step 202: inserting a check on the execution end flag of the previous parallel execution module at the beginning of the execution of the selected parallel execution module.

[0095] Among them, continue to refer to Figure 6 , the selected parallel execution modules are module n+4 and module n+5. The execution end flag of the previous parallel execution module is judged as follows: n and F2 n+3 Whether it is the preset value at the same time (can be 1).

[0096] Step 203: The execution start condition of the next parallel execution module is that the execution end flags of all previous parallel execution modules are set to preset values.

[0097] For step 201, the next parallel execution modules of module n and module n+3 are module n+4 and module n+5 respectively. In this case, F1 is read from the memory at the execution start node P1_2 of the parallel execution module n+4. n and F2 n+3 Mapping value, if F1 n and F2 n+3 At the same time, it is a preset value (which may be 1), and the first processor executes the parallel execution module n+4.

[0098] At the execution start node P22 of the parallel execution module n+5, F1 is read from the memory. n and F2 n+3 Mapping value, if F1 n and F2 n+3 At the same time, it is a preset value (which can be 1), and the second processor executes the parallel execution module n+5. For the subsequent modules to be executed, continue to refer to Figure 6 , the operations of the above steps 201 to 202 are respectively performed at the P13 node and the P23 node, which will not be further explained in this embodiment.

[0099] Realizing the working synchronization of each CPU core of a multi-core DSP through software programming may affect the operating efficiency of the digital power control system, especially when processing complex operations, there may be a problem of response lag, resulting in the inability to ensure the accuracy and real-time performance of synchronization. In order to solve the above problems, in one embodiment, the design method for improving the performance of a multi-core processor also includes: configuring the main controller so that multiple processors share the rising edge of the same synchronization signal as an interrupt trigger source to enter an interrupt processing state; the synchronization signal is an external arbitrary periodic signal. Among them, in the digital power control device, the synchronization signal is the time reference in the system, and multiple processors use this synchronization signal as an interrupt trigger source to enter the interrupt processing state at the same time, so that multiple processors work synchronously, reduce the introduction of additional errors, and improve the accuracy of the control system. This synchronization signal can be an arbitrary external periodic signal.

[0100] In a specific scenario, multiple processors in the main controller monitor the synchronization signal. When the synchronization signal arrives, multiple processors will use the synchronization signal as an interrupt trigger source, that is, they will respond to this interrupt and enter the interrupt processing state. The interrupt processing state is a state in which the processor performs a specific task. When the processor receives an interrupt request from a synchronization signal, it will suspend the current task and execute the interrupt service program related to this interrupt. In the interrupt service program, the processor performs corresponding processing according to the synchronization signal, including processing data, updating system status, and responding to external events.

[0101] In one embodiment, the synchronization signal output port of the programmable device is connected to the external interrupt pin of the main controller; the programmable device generates the synchronization signal and sends the synchronization signal to the main controller through the synchronization signal output port.

[0102] like Figure 7 As shown, the generation of the synchronization signal includes:

[0103] Step 301: The programmable device generates a PWM carrier signal through a PWM carrier counter.

[0104] Among them, Figure 8 As shown, the programmable device generates a PWM carrier signal by adding and subtracting counts, and the carrier cycle time is T s In this design, the PWM carrier counter is used to generate a periodic clock signal, the frequency and period of which are determined by the clock source of the PWM carrier counter.

[0105] Step 302: When the PWM carrier counter is reduced to 0, the level is set high, and when the PWM carrier counter is increased to the amplitude of the PWM carrier signal, the level is set low to obtain the synchronization signal.

[0106] The underflow signal of the PWM carrier counter is used as the synchronization signal source. In digital systems, especially when using a timer or counter to generate a PWM carrier signal, if the counter value decreases to the minimum value, the so-called "underflow" will occur. The counter will start counting from the minimum value again. For the PWM carrier signal, this means that the PWM carrier signal will repeat periodically.

[0107] The value of the PWM carrier counter increases or decreases under the control of the triangle wave signal, and when the value of the PWM carrier counter reaches a specific threshold, the synchronization signal is generated.

[0108] Continue to refer to Figure 8When the value of the PWM carrier counter decreases to 0, the output level is set high, usually indicating the beginning of a cycle, or the initial state of a new PWM cycle; when the value of the PWM carrier counter increases to be equal to the amplitude C_AMP of the PWM carrier signal, the output level is set low. Through the above-mentioned level setting high and low operations, the synchronization signal can be generated when the value of the PWM carrier counter reaches a specific value. The generation of the synchronization signal depends on the value of the PWM carrier counter and the PWM carrier signal. By programming the increment and decrement conditions of the counter and the thresholds for level setting high and low, precise control of the synchronization signal can be achieved.

[0109] The main controller is configured so that multiple processors share the rising edge of the synchronization signal as an interrupt trigger source. Since the underflow signal of the PWM carrier counter is used as the synchronization signal source, when the carrier underflows, the PWM carrier counter starts counting from the minimum value again, and the signal changes from a low level to a high level, that is, a rising edge. The rising edge refers to the moment when the synchronization signal suddenly changes from a low level to a high level.

[0110] In a multi-core processor, all processors listen to this synchronization signal. When the synchronization signal changes from low level to high level, the main controller generates an interrupt request and passes it to all processors. Once a processor detects an interrupt request, it immediately suspends the current operation and jumps to the preset interrupt handler to handle the interrupt. Among them, the interrupt handler can be some code that is executed when the processor responds to an interrupt. These codes define how to handle the interrupt, such as performing specific calculations, updating system status, or communicating with other processors.

[0111] In this embodiment, the synchronization signal output port of the CPLD is connected to the external interrupt pin of the DSP. The CPLD can generate a synchronization signal, and all CPUs in the DSP enter the interrupt trigger state with the synchronization signal, thereby achieving the purpose of multi-core synchronous operation. This design does not require the addition of additional synchronization signal lines, nor does it require the modification of the design of the software program, which simplifies the system design and avoids problems that may affect the efficiency of the system operation. In this way, the main controller ensures that all processors respond to the interrupt in unison at the rising edge of the synchronization signal, thereby achieving system-level coordination and synchronization. The coordination and consistency of the system when executing tasks are ensured, and the efficiency of the overall system work is also improved.

[0112] Due to the advanced nature of the scheme of this embodiment, it can be widely used in application fields such as digital power control systems, multi-core CPU operating efficiency optimization, and computer system performance optimization. This embodiment can effectively solve the synchronization error problem in the prior art and improve the accuracy of the control system. Secondly, this embodiment can be dynamically adjusted according to the actual execution time of the task, so as to make full use of the performance of the multi-core DSP and improve the operating efficiency of the system. Finally, this embodiment proposes an effective multi-core load balancing method, which can avoid overloading of certain cores and improve the stability and reliability of the system. Therefore, the present invention has broad application prospects in the fields of power electronic equipment, communication equipment, industrial automation equipment, etc.

[0113] Embodiment 2:

[0114] In Example 1, a design method for improving the performance of a multi-core processor is proposed. In this embodiment, a control method for a multi-core processor is proposed. The control method for the multi-core processor is applied to a digital power supply control device designed by the design method described in Example 1. Fig. 9 As shown, the control method includes:

[0115] Step 401: After receiving the synchronization signal, each processor executes the assigned modules in sequence.

[0116] The specific method for generating the synchronization signal is referred to in Example 1 and will not be repeated in this embodiment.

[0117] Step 402: If a handshake process is detected before the parallel execution module starts executing, determine whether the end flags corresponding to the modules before the parallel execution module in the execution order are all updated to preset values; if all are updated to preset values, start executing the parallel execution module.

[0118] Reference Figure 6 For example, before the execution of module n+5 begins, the corresponding processor detects the handshake process. At this time, it is determined whether the end flags corresponding to module n and module n+3 are all updated to preset values. If all are updated to preset values, the corresponding processor starts to run module n+5. For the handshake process and the update of the end flag, see Example 1, which will not be repeated in this embodiment.

[0119] If the end flags corresponding to the modules that are executed before the parallel execution module are not all updated to the preset values, wait until they are all updated to the preset values.

[0120] Step 403: If a flag update process is detected after the parallel execution module is finished executing, the corresponding end flag is updated to a preset value.

[0121] Continue to refer to Figure 6 For example, after the execution of module n+5 is completed, the corresponding flag update process is detected, and the end flag of the processor corresponding to module n+5 is updated to a preset value, which is used as a basis for determining whether the subsequent modules start execution.

[0122] For the specific process of the design method for improving the performance of the multi-core processor, please refer to Example 1, which will not be repeated in this example.

[0123] Embodiment 3:

[0124] A control method for a multi-core processor is provided in Example 2. In this embodiment, a control device for a multi-core processor is proposed. The control device for the multi-core processor includes: a processor and a memory for storing processor executable instructions; wherein the processor is configured to execute the control method for the multi-core processor described in Example 2.

[0125] like Fig.10 As shown, the control device of the multi-core processor includes a processor 21 and a memory 22, wherein the processor 21 and the memory 22 can be connected via a bus or other means.

[0126] The processor 21 may be a CPU. The processor 21 may also be other general-purpose processors, DSPs, application-specific integrated circuits (ASICs), FPGAs or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or a combination of the above chips.

[0127] The memory 22, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs, non-transitory computer executable programs and modules, such as program instructions / modules corresponding to the control method of the multi-core processor in Embodiment 2 of the present invention. The processor executes various functional applications and training processes of the processor by running the non-transitory software programs, instructions and modules stored in the memory.

[0128] The memory 22 may include a program storage area and a training storage area, wherein the program storage area may store an operating system, an application required for at least one function; the training storage area may store training created by the processor, etc. In addition, the memory may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 22 may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0129] The one or more modules are stored in the memory 22, and when executed by the processor 21, the following is performed: Figure 1 The control method of the multi-core processor in the embodiment 1 is shown.

[0130] The specific details of the control method of the multi-core processor can be found in Fig. 9 The corresponding related descriptions and effects in the illustrated embodiments can be understood and will not be repeated here.

[0131] This embodiment also provides a non-volatile computer storage medium, which stores computer executable instructions. The computer executable instructions are executed by one or more processors to complete the control method of the multi-core processor described in Example 2.

[0132] The computer storage medium stores computer executable instructions, which can execute the control method of the multi-core processor in any of the above method embodiments. The storage medium can be a magnetic disk, an optical disk, a read-only memory (ROM), a random access memory (RAM), a flash memory, a hard disk (HDD), or a solid-state drive (SSD); the storage medium can also include a combination of the above types of memory.

[0133] For the specific steps of the control method of the multi-core processor, please refer to Example 2 and will not be repeated in this embodiment.

[0134] Embodiment 4:

[0135] In Embodiment 2, a control method for a multi-core processor is proposed. In this embodiment, a digital power supply control device is proposed. Fig.11 As shown, it includes a main controller and a programmable device, the synchronization signal output port of the programmable device is connected to the external interrupt pin of the main controller, and the main controller includes multiple processors, which are used to execute the control method described in Example 2.

[0136] For the specific steps of the control method of the multi-core processor, please refer to Example 2 and will not be repeated in this embodiment.

[0137] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A design method for improving the performance of a multi-core processor, characterized in that: The design method is implemented in a digital power supply control device including a main controller and a programmable device, and the design method includes: Step 101: Divide the content to be executed by the main controller into modules, and obtain the execution time of each module; Step 102: Allocate each module to different processors in the main controller according to the execution time and execution order of each module; Step 103: Determine a parallel execution module that has a parallel execution relationship with modules in other processors, and insert a handshake mechanism at the selected parallel execution module to align the timing of subsequent modules.

2. The design method for improving multi-core processor performance according to claim 1, characterized in that: The allocating each module to different processors in the main controller according to the execution time and execution order of each module comprises: Arrange all modules according to the implementation logic order of each module to determine the execution order of each module; Determine at least one parallel execution group according to the execution order; wherein each of the parallel execution groups includes at least two parallel execution modules, and the parallel execution modules in the same parallel execution group can be executed at the same time without interfering with each other; Based on the maximum parallelism principle, the parallel execution modules in the same parallel execution group are respectively allocated to at least two different processors according to the execution time of the corresponding modules.

3. The design method for improving multi-core processor performance according to claim 1, characterized in that: The design method for improving the performance of the multi-core processor also includes: The main controller is configured so that multiple processors share the rising edge of the same synchronization signal as an interrupt trigger source to enter an interrupt processing state; the synchronization signal is an external arbitrary periodic signal.

4. The design method for improving the performance of a multi-core processor according to claim 3, characterized in that: Connecting the synchronization signal output port of the programmable device to the external interrupt pin of the main controller; The programmable device generates the synchronization signal and sends the synchronization signal to the main controller through the synchronization signal output port.

5. The design method for improving multi-core processor performance according to claim 1, characterized in that: The step of obtaining the execution time of each module includes: Connect the probe of the oscilloscope to the output IO port of the main controller to be measured; Adding a level control code of the output IO port in the program code, setting the output IO port to a high level through the level control code when the required measurement module starts to be executed, and setting the output IO port to a low level through the level control code after the required measurement module is executed; The interval time between the high level and the low level of the output IO port is measured by an oscilloscope. The interval time is the execution time of the required measurement module, so as to obtain the execution time of each module.

6. The design method for improving multi-core processor performance according to claim 1, characterized in that: The obtaining of the execution time of each module further comprises: measuring the execution time of a specified section of code according to a function module for calculating program running time in the main controller to obtain the execution time of each module.

7. The design method for improving the performance of a multi-core processor according to any one of claims 1 to 6, characterized in that: The inserting of a handshake mechanism at a selected parallel execution module to align the timing of subsequent modules includes: For each processor, a flag updating process is inserted at the execution end node of the selected parallel execution module; the flag updating process is used to update the end flag to a preset value; A handshake process is inserted at the execution start node of the selected parallel execution module; the handshake process is used to determine whether the end flags corresponding to the modules before the parallel execution module in the execution order are all updated to preset values ​​to determine whether to run the parallel execution module.

8. The design method for improving the performance of a multi-core processor according to claim 7, characterized in that: The main controller includes at least a first processor and a second processor, the first processor is allocated with a first parallel execution module, the second processor is allocated with a second parallel execution module and a third parallel execution module, the first parallel execution module can be executed in parallel with the second parallel execution module and the third parallel execution module, and the difference between the sum of the execution time of the second parallel execution module and the third parallel execution module and the execution time of the first parallel execution module is less than a preset value; The inserting of a handshake mechanism at the selected parallel execution module comprises: In the first processor, inserting the handshake process at the execution start node of the first parallel execution module, and inserting the flag update process at the execution end node of the first parallel execution module; In the second processor, the handshake process is inserted at the execution start node of the second parallel execution module, and the flag update process is inserted at the execution end node of the third parallel execution module.

9. A control method for a multi-core processor, characterized in that: The control method of the multi-core processor is applied to a digital power control device designed by the design method according to any one of claims 1 to 8, and the control method comprises: After receiving the synchronization signal, each processor executes the assigned modules in sequence; If a handshake process is detected before the parallel execution module starts executing, it is determined whether the end flags corresponding to the modules before the parallel execution module in the execution order are all updated to preset values; if all are updated to preset values, the parallel execution module starts executing; If a flag update process is detected after the parallel execution module is finished executing, the corresponding end flag is updated to a preset value.

10. A digital power supply control device, characterized in that: It comprises a main controller and a programmable device, wherein a synchronization signal output port of the programmable device is connected to an external interrupt pin of the main controller, and the main controller comprises a plurality of processors, and the processors are used to execute the control method as claimed in claim 9.