A flow-driven digital power graphical programming method
By using a flow-driven graphical programming method for digital power supplies, and leveraging the Flow component library and graphical programming modules, low-code/no-code development was achieved, solving the problem of high development difficulty in digital power supply control and improving development efficiency and the intuitiveness of logic design.
Patent Information
- Application Number
- CN202511846028.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-09
- Publication Date
- 2026-03-17
- Estimated Expiration
- 2045-12-09
AI Technical Summary
Existing digital power control systems are difficult to develop, involve complex logic modifications, struggle to flexibly express complex logical relationships, have high development barriers, and are not intuitive to debug.
It adopts a flow-driven graphical programming method for digital power supplies. By building a power control Flow component library and a graphical programming module, it provides a visual interface and predefined Flow nodes. Users do not need to write low-level code; the code is automatically converted into script files to generate control code.
Enables low-code/no-code development, reduces development difficulty, makes the logic design intuitive and easy to understand, reduces coding, compilation and debugging steps, and improves development efficiency.
Smart Images

Figure CN121277331B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of power control technology, and more specifically, relates to a graphical programming method for digital power supplies based on flow-driven operation. Background Technology
[0002] Digital power control refers to the use of embedded computer chips (DSP, MCU, or FPGA) to replace traditional analog circuit control with software algorithm control logic programming, thereby achieving precise regulation, flexible management, and intelligent control of the power supply. With the development of intelligent power supplies, digital power supplies are increasingly widely used in server / data center power supplies, energy power supplies (such as photovoltaic inverters and energy storage converters), and industrial power supplies. Currently, digital power control logic is typically implemented using text code, such as C or Python. This approach requires developers to have professional programming skills, resulting in high development barriers, complex logic modifications requiring recompilation and deployment, and unintuitive signal flow during debugging.
[0003] To reduce development complexity, some power management software offers drag-and-drop module functionality, allowing users to build control flows graphically. However, these methods are often based on fixed processes, such as sequential execution, and struggle to flexibly express complex logical relationships common in power control, such as dynamic data dependencies (e.g., voltage and current feedback loops) and parallel tasks (e.g., independent adjustment of multiple outputs). This limits their effectiveness in complex digital power control scenarios.
[0004] Therefore, how to reduce the development difficulty of digital power control is an urgent problem to be solved. Summary of the Invention
[0005] To address the shortcomings of existing technologies, the purpose of this application is to provide a stream-driven graphical programming method for digital power supplies, which enables low-code / no-code development and effectively reduces development difficulty.
[0006] To achieve the above objectives, in a first aspect, this application provides a stream-driven graphical programming method for digital power supplies, comprising the following steps:
[0007] S10, Construct a power control Flow component library. The power control Flow component library includes multiple predefined Flow nodes. The Flow nodes are stored in the Flow component library in the form of script files. The script files contain basic code snippets required to implement the node functions and describe the reserved input / output data terminals, logic terminals and node attribute parameters of the nodes.
[0008] S20, Construct a graphical programming module. This module is used to provide a graphical programming interface to receive user operations for selecting Flow nodes, connecting logical terminals, connecting data terminals, and setting node attribute parameters, so as to form a graphical program logic description file containing the selected Flow nodes, logical terminal connection relationships, data terminal connection relationships, and node attribute parameters.
[0009] S30, Generate a graphical program script file based on the graphical program logic description file and the script files of each Flow node in the Flow component library;
[0010] S40 generates power control code based on graphical program script files and chip peripheral driver script files;
[0011] S50, the power control code is compiled and burned into the embedded controller of the digital power supply.
[0012] The flow-driven graphical programming method for digital power supplies provided in this application has the following effects: It offers reusable functional nodes through a predefined Flow component library, allowing users to quickly build control logic without writing underlying code. Combined with the visual operation of the graphical programming module, the logic design process becomes intuitive and easy to understand, reducing the need for specialized programming skills. The graphical program logic description file is automatically converted into a script file and integrated with peripheral drivers to generate control code, effectively eliminating the frequent coding, compilation, and debugging steps in traditional development. This enables low-code / no-code development, effectively reducing development difficulty.
[0013] As a further preferred embodiment, in step S10, a node description protocol is defined to generate the node script file according to the node function. The node description protocol defines the framework content of the node script file in a standardized manner, including the method for defining the input and output terminals of the node, the method for defining the node attribute parameters, and the reservation method for the node input and output terminals and attribute parameters in the basic code blocks required for the implementation of the node function.
[0014] As a further preferred embodiment, in step S10, each Flow node corresponds to a specific function of power control and has at least one input terminal and one output terminal. The node terminals are divided into logic terminals and data terminals. The logic terminals are connected in a single-input single-output mode, and the data terminals are connected in a single-input multiple-output mode.
[0015] As a further preferred embodiment, in step S10, the Flow nodes in the power control Flow component library are grouped according to function, including basic data nodes, basic operation nodes, signal processing nodes, control execution nodes, and logic decision nodes.
[0016] As a further preferred embodiment, in step S20, a canvas logic protocol is defined to generate the graphical program logic description file based on user operations. The canvas logic protocol defines the graphical program logic description file as a specification for describing the logical terminal connections, data terminal connections, and node attribute parameter setting operations between nodes in the graphical program built by the user.
[0017] As a further preferred embodiment, before step S30, the method further includes: performing a legality check on the graphical program, wherein the legality check includes checking the node terminal connections and node attribute definitions;
[0018] The check node terminal connection includes checking node terminals not connected, connection error, or data type mismatch; the check node attribute definition includes checking node attributes not defined, definition error, or definition conflict.
[0019] As a further preferred embodiment, in step S30, the graphical program script file is generated based on the component script file generated according to the node description protocol and the graphical program logic description file generated according to the canvas logic protocol.
[0020] As a further preferred embodiment, in step S40, an embedded system framework is defined to generate the power control code, including a graphical logic generation area for storing the graphical script file, and a peripheral driver storage area for storing commonly used PWM, ADC, GPIO, and USART drivers for the power supply.
[0021] Secondly, this application provides a system for implementing the stream-driven graphical programming method for digital power supplies as described above, comprising:
[0022] The power control Flow component library stores multiple predefined Flow nodes. Flow nodes are stored in the Flow component library in the form of script files. The script files contain the basic code snippets required to implement the node functions and describe the reserved input and output data terminals, logic terminals and node attribute parameters of the node.
[0023] The graphical programming module provides a graphical programming interface to receive user operations for selecting Flow nodes, connecting logical terminals, connecting data terminals, and setting node attribute parameters, so as to form a graphical program logic description file containing the selected Flow nodes, logical terminal connection relationships, data terminal connection relationships, and node attribute parameters.
[0024] The code generation module is used to generate a graphical program script file based on the graphical program logic description file and the script files of each Flow node in the Flow component library, and to generate power control code based on the graphical program script file and the chip peripheral driver script file.
[0025] The compilation and programming module is used to compile and program the power control code into the embedded controller of the digital power supply.
[0026] As a further preferred embodiment, the graphical programming interface includes a component library area and a logic working area. The component library area displays power control flow nodes in groups, and the logic working area is used for adding, deleting, connecting, and editing parameters of nodes.
[0027] It is understandable that the beneficial effects of the second aspect mentioned above can be found in the relevant descriptions in the first aspect mentioned above, and will not be repeated here. Attached Figure Description
[0028] Figure 1 This is a flowchart of the stream-driven graphical programming method for digital power supplies provided in this application;
[0029] Figure 2 This is a flowchart of the digital power supply graphical programming method based on the flow-based digital power supply graphical programming method provided in the embodiments of this application;
[0030] Figure 3 This is a schematic diagram of the power control Flow component library provided in an embodiment of this application;
[0031] Figure 4 This is a node connection diagram in the graphical programming example of power output overvoltage fault protection provided in the embodiments of this application. Detailed Implementation
[0032] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0033] It should be understood that, in the description of this application, the term "multiple" means two or more, unless otherwise expressly and specifically defined.
[0034] like Figure 1 As shown, this application provides a graphical programming method for digital power supplies based on stream-driven operation, including steps S10 to S50, which are detailed below:
[0035] Step S10: Construct a power control Flow component library. The power control Flow component library includes multiple predefined Flow nodes. The Flow nodes are stored in the Flow component library in the form of script files. The script files contain the basic code snippets required to implement the node functions and describe the reserved input / output data terminals, logic terminals, and node attribute parameters of the nodes.
[0036] In step S10, the power control Flow component library simplifies the construction process of power control logic through predefined nodes. Users can directly call functional nodes without writing code from scratch, thereby reducing development workload.
[0037] Specifically, in step S10, a node script file can be generated based on the node function by defining a node description protocol. This node description protocol defines the framework of the node script file in a standardized manner, including the definition methods of node input / output terminals, the definition methods of node attribute parameters, and the reservation methods of node input / output terminals and attribute parameters in the basic code blocks required for node function implementation. Each Flow node corresponds to a specific function of power control and has at least one input terminal and one output terminal. Node terminals are divided into logic terminals and data terminals. The connection of logic terminals is in single-input single-output mode, and the connection of data terminals is in single-input multiple-output mode. The Flow nodes in the power control Flow component library are grouped according to function and may include basic data type nodes, basic operation type nodes, signal processing type nodes, control execution type nodes, and logic decision type nodes.
[0038] Step S20: Construct a graphical programming module. This module provides a graphical programming interface to receive user operations for selecting Flow nodes, connecting logical terminals, connecting data terminals, and setting node attribute parameters, so as to form a graphical program logic description file containing the selected Flow nodes, logical terminal connection relationships, data terminal connection relationships, and node attribute parameters.
[0039] In step S20, the graphical programming module makes the design of control logic more intuitive through a visual interface. Users can express complex logic by dragging and connecting lines, reducing the cognitive burden of traditional text programming.
[0040] Specifically, a canvas logic protocol can be defined to generate the graphical program logic description file based on user operations. The canvas logic protocol defines the description specifications of the logical terminal connections, data terminal connections, and node attribute parameter setting operations between nodes in the graphical program built by the user.
[0041] Step S30: Generate a graphical program script file based on the graphical program logic description file and the script files of each Flow node in the Flow component library.
[0042] In step S30, the graphical program script file is generated, which automatically converts the user-built graphical logic into an executable script form, avoiding errors and inefficiencies from manual coding.
[0043] Specifically, the graphical program script file is generated based on the component script file generated according to the node description protocol and the graphical program logic description file generated according to the canvas logic protocol.
[0044] Furthermore, prior to step S30, the method may include: performing a validity check on the graphical program, which includes checking node terminal connections and node attribute definitions. Specifically, checking node terminal connections may include checking if node terminals are not connected, have incorrect connections, or have mismatched data types, and checking node attribute definitions may include checking if node attributes are undefined, have incorrect definitions, or have definition conflicts.
[0045] Step S40: Generate power control code based on the graphical program script file and the chip peripheral driver script file.
[0046] In step S40, the generation of power control code can integrate graphical logic and hardware drivers to form a complete control scheme, ensuring the usability and integrability of the code.
[0047] Specifically, power control code can be generated by defining an embedded system framework, including a graphical logic generation area that stores the graphical script file, and a peripheral driver storage area that stores commonly used PWM, ADC, GPIO, and USART drivers for the power supply.
[0048] Step S50: Compile and burn the power control code into the embedded controller of the digital power supply.
[0049] The flow-driven graphical programming method for digital power supplies provided in this application has the following effects: It offers reusable functional nodes through a predefined Flow component library, allowing users to quickly build control logic without writing underlying code. Combined with the visual operation of the graphical programming module, the logic design process becomes intuitive and easy to understand, reducing the need for specialized programming skills. The graphical program logic description file is automatically converted into a script file and integrated with peripheral drivers to generate control code, effectively eliminating the frequent coding, compilation, and debugging steps in traditional development. This enables low-code / no-code development, effectively reducing development difficulty.
[0050] In one embodiment, the technical solution to achieve the above objective can be as follows: This embodiment addresses the limitations of traditional embedded programming in digital power control development (such as high barriers to entry, inefficient iteration, and complex logic coupling), proposing a flow-based graphical programming method for digital power supplies. This method adopts a data flow + logic flow driven approach, and through innovative architecture modeling with visual flow graphs, it enables intuitive design, flexible adjustment, and efficient deployment of power control logic. This method combines a flow-based programming model with power control requirements and achieves low-code / no-code development through graphical interaction, reducing development difficulty.
[0051] This embodiment provides a flow-based graphical programming method for digital power supplies, such as... Figure 2 As shown, the specific implementation process is as follows:
[0052] Step 1: Build the power control Flow component library.
[0053] Define power control-related Flow nodes to build a digital power supply Flow component library. Each Flow node in the component library corresponds to a specific power control function, and the nodes exist in the Flow component library in the form of script files.
[0054] The node script file defines the input and output terminals of the node. Each node has at least one input terminal and one output terminal, and a node can have multiple input and output terminals. Node terminals are divided into logic terminals and data terminals.
[0055] The node script file defines the node description protocol, which defines the basic code snippets required for function implementation and predefines node attribute parameters (such as the kp / ki / kd parameters for PID calculation).
[0056] The component library groups nodes according to their functions, such as Figure 3 As shown, it includes basic data (for data reading and writing), basic operations (for data operations), signal processing (communication / sampling signal processing), control execution (such as PID operation, GPIO control, etc.), and logical decision-making (such as loops and branches).
[0057] Step 2: Build a graphical programming module for power control.
[0058] The module includes a component library area and a logic working area. The component library area displays power control flow nodes in groups. The working area allows users to add, delete, connect, and edit parameters of nodes.
[0059] The modules are connected via logic terminals to represent logic flow drives, and the program runs according to the order of the logic terminal connections. The logic terminal connections are single-input, single-output to ensure an orderly execution sequence.
[0060] The modules are connected via data terminals to represent data flow, with data flowing from the start end of the connection to the end. The data terminal connection is in a single-input, multiple-output mode, expressing the data dependency between modules in a consumer and producer manner.
[0061] The module provides an interface for setting node attribute parameters based on the predefined attribute parameters in the script files of each Flow node. The node attribute parameters are used to form a complete node script (including attribute parameters).
[0062] The module defines the canvas logic protocol, which is based on data and logic flow (terminal connections) and node parameter settings, and builds a graphical program framework driven by flow-based (data flow + logic flow).
[0063] Step 3: Define the rules for validating the graphical program.
[0064] To ensure that the built power graphical control logic conforms to the programming rules, it is necessary to define graphical program validity check rules, which check the node terminal connections and node attribute definitions.
[0065] The former requires checking for issues such as unconnected node terminals, incorrect connections, and mismatched connection data types. The latter requires checking for issues such as undefined node attributes, incorrect definitions, and definition conflicts.
[0066] Step 4: Generate C code based on the constructed graphical program protocol.
[0067] The graphical program protocol is used to generate C code script files, and the C code is stored in the reserved graphical logic generation area in the embedded architecture. The graphical program protocol includes a node description protocol (defined in step 1) and a canvas logic protocol (defined in step 2).
[0068] Step 5: Build the embedded system framework and generate embedded code.
[0069] The embedded framework includes a reserved area for generating graphical logic and a storage area for peripheral drivers. The graphical logic generation area stores the generated C code scripts. The peripheral driver storage area contains drivers for commonly used peripherals such as PWM, ADC, and GPIO.
[0070] Step 6: Compile and burn the embedded code.
[0071] The embedded code script file is compiled to generate an executable file, which is then burned into the digital power control MCU.
[0072] In this embodiment, the Flow component library categorizes nodes according to their functional type, including:
[0073] The basic data class is used for data acquisition and assignment, such as acquiring input voltage sampling values. It includes groups for reading variables, writing variables, and constant nodes.
[0074] Basic arithmetic operations: Used for power data calculations, such as comparing power fault protection thresholds. Groups include nodes for arithmetic operations (addition, subtraction, multiplication, and division), logical operations (AND, OR, NOT), and bitwise operations (bitwise AND, OR, NOT, bit shift, set).
[0075] Signal processing class: Used to implement communication / sampling signal processing, including communication (USART, CAN, Modbus) signal read / write nodes, and sampling signal filtering and correction nodes;
[0076] Control execution class: Used for power control, including PID calculation, PID parameter setting, PWM signal control (signal start / stop, signal parameter setting), and GPIO signal control (IO input, IO output, IO high-speed capture, IO toggle) nodes;
[0077] Logical decision class: Used for conditional branching or loop control, including if-else branches, switch branches, for loops, and while loop nodes.
[0078] The following is a specific implementation example of this application:
[0079] Graphical programming design and development of power output overvoltage fault protection function:
[0080] (1) Design objective: When the power supply output voltage is detected to be greater than the overvoltage threshold of 100V, the fault protection is triggered to stop the PWM output. If the output voltage is detected to be less than the recovery threshold of 95V, the power supply PWM signal output is restored.
[0081] (2) Component library node call: Drag the nodes that need to be used to the working area of the power control graphical programming module to realize the node script file call. The nodes and functions required by the logic in this embodiment can be referred to Table 1.
[0082] Table 1 Node Function and Attribute Parameter Settings
[0083]
[0084] (3) Graphical program construction: Connect the node terminals according to the control logic, and set the node parameters in the node attribute parameter setting module. The node parameter settings in this embodiment can be referred to Table 1, and the node connection can be referred to Table 1. Figure 4 .
[0085] (4) Legality check: The output protection graphical program of this embodiment is built and the program legality is checked according to the predetermined rules. Errors in the graphical program are prompted and the graphical program is modified according to the prompts.
[0086] (5) Code generation: The output protection graphical program that has been built and is legal in this example is converted into C code according to the graphical program protocol, and stored in the reserved area of the embedded architecture, and finally the embedded code of the power control logic is generated.
[0087] (6) Compile and burn: Compile the embedded code to generate an executable file and burn it to the MCU chip to execute the power output overvoltage protection control logic of this embodiment.
[0088] The beneficial effects of this embodiment are as follows: This embodiment adopts a stream-driven programming model to build a digital power supply visualization design system, which specifically solves the core pain points in traditional digital power supply development, realizing a simple, efficient, and convenient development of the power supply control process. This method can significantly reduce the development threshold, shorten the development cycle, improve the iteration efficiency of control logic, and enhance the maintainability and reliability of the system.
[0089] Those skilled in the art will readily understand that the above description is merely a preferred embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A flow-driven based digital power graphical programming method, characterized in that, The method comprises the following steps: S10, constructing a power control Flow component library, the power control Flow component library comprising a plurality of predefined Flow nodes, the Flow nodes being stored in the Flow component library in the form of script files, the script files containing basic code segments required for implementation of node functions and describing input and output data terminals, logic terminals and node attribute parameters reserved for the nodes; S20, constructing a graphical programming module, the module being configured to provide a graphical programming interface to receive user selection of the Flow nodes, connection operations of the logic terminals, connection operations of the data terminals and setting operations of the node attribute parameters, so as to form a graphical program logic description file comprising the selected Flow nodes, connection relationships of the logic terminals, connection relationships of the data terminals and node attribute parameters; wherein the connection of the logic terminals is in a single-in single-out mode, and the connection of the data terminals is in a single-in multi-out mode; S30, generating a graphical program script file according to the graphical program logic description file and the script files of the Flow nodes in the Flow component library; S40, generating power control code based on the graphical program script file and an off-chip device driver script file; S50, compiling and burning the power control code into an embedded controller of a digital power supply; In step S10, a node description protocol is defined to generate the node script files according to node functions, the node description protocol defining the contents of the node script files in a normative manner, including a definition method of input and output terminals of the nodes, a definition method of node attribute parameters and a reservation mode of the input and output terminals and the attribute parameters in basic code blocks required for implementation of the node functions; In step S20, a canvas logic protocol is defined to generate the graphical program logic description file according to user operations, the canvas logic protocol defining a description specification of the graphical program logic description file for user operations of building a graphical program, including connection of logic terminals between nodes, connection of data terminals between nodes and setting of node attribute parameters; In step S30, the graphical program script file is generated based on the component script files generated according to the node description protocol and the graphical program logic description file generated according to the canvas logic protocol.
2. The flow-driven based digital power graphical programming method of claim 1, wherein, In step S10, each Flow node corresponds to a specific function of power control and has at least one input terminal and one output terminal, the node terminals being divided into logic terminals and data terminals, the connection of the logic terminals being in a single-in single-out mode and the connection of the data terminals being in a single-in multi-out mode.
3. The flow-driven based digital power graphical programming method of claim 1, wherein, In step S10, the Flow nodes in the power control Flow component library are grouped according to functions, including basic data class nodes, basic operation class nodes, signal processing class nodes, control execution class nodes and logic decision class nodes.
4. The flow-driven based digital power graphical programming method of claim 1, wherein, Before step S30, the method further comprises legality checking of the graphical program, the legality checking including checking of node terminal connection and node attribute definition. The check node terminal connection includes a check node terminal unconnected, connection error or data type mismatch, and the check node attribute definition includes a check node attribute undefined, definition error or definition conflict.
5. The flow-driven based digital power graphical programming method of claim 1, wherein, In step S40, the embedded system framework is defined to generate the power control code, including a graphical logic generation area for storing the graphical program script file, and a peripheral drive storage area for storing common PWM, ADC, GPIO and USART drivers of the end power supply.
6. A system for implementing the flow-driven based graphical programming method of any one of claims 1-5, characterized in that, Comprise: A power control Flow component library, which stores a plurality of predefined Flow nodes, the Flow nodes being stored in the Flow component library in the form of script files, the script files containing basic code segments required for implementing node functions and describing input and output data terminals, logic terminals and node attribute parameters reserved for the nodes; A graphical programming module, configured to provide a graphical programming interface to receive user selection of the Flow nodes, connection operation of the logic terminals, connection operation of the data terminals and setting operation of the node attribute parameters, so as to form a graphical program logic description file containing the selected Flow nodes, the connection relationship of the logic terminals, the connection relationship of the data terminals and the node attribute parameters; A code generation module, configured to generate a graphical program script file according to the graphical program logic description file and the script files of the Flow nodes in the Flow component library, and generate power control code based on the graphical program script file and the chip peripheral drive script file; A compiling and burning module, configured to compile and burn the power control code into an embedded controller of a digital power supply.
7. The system of claim 6, wherein, The graphical programming interface includes a component library area and a logic work area, the component library area displays the power control Flow nodes according to groups, and the logic work area is used for adding, deleting, connecting and parameter editing operations of the nodes.