Control system and method for automatic distribution of computing power based on software and hardware collaboration
Through the configuration of the computing power automatic allocation module in the software, the control logic complexity is adaptively judged, and high-complexity tasks are allocated to the computing software and low-complexity tasks are allocated to the hardware controller, which solves the problems of insufficient computing power and insufficient real-time performance in traditional control systems, and achieves the optimal utilization of resources and efficient and reliable operation of the system.
Patent Information
- Application Number
- CN202510396246.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-31
- Publication Date
- 2025-07-04
AI Technical Summary
In traditional control systems, hardware controllers have limited computing power, which is difficult to meet the needs of high-complex algorithms, and the computing efficiency is low. The communication delay between software and hardware leads to insufficient real-time performance, which may cause system crashes or data loss.
By configuring the computing power automatic allocation module in the software, the complexity of the control logic is adaptively judged, and the control logic of high complexity is allocated to the computing software, and the control logic of low complexity is allocated to the hardware controller. Combining the advantages of the computing software and the hardware controller, the optimal utilization of resources is achieved.
It improves the overall operating efficiency of the system, avoids resource waste and performance bottlenecks, ensures the continuous operation and fault tolerance of the system, reduces downtime, and meets the algorithm needs of different users.
Smart Images

Figure CN120255312A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of distributed control systems, and particularly relates to a control system and method for automatic computing power allocation based on software and hardware collaboration. Background Art
[0002] Today, with the rapid development of digitalization and intelligence, the algorithm complexity implemented by control systems is getting higher and higher. However, traditional computing and control methods often highly rely on hardware controllers, and the computing power of hardware controllers is often limited, prone to performance bottlenecks, difficult to meet the requirements of high-complexity algorithms, resulting in low computing efficiency or even inability to complete computing tasks. On the other hand, in some current control scenarios, a host computer is used for high-level language programming to control devices. Although the computing power has been improved, due to the stability and reliability issues of software operation, as well as the communication delay between software and hardware, it may lead to insufficient real-time performance of the system, and even cause serious consequences such as system crashes or data loss.
[0003] Facing these challenges, how to effectively combine the advantages of computing software and controller hardware to achieve reasonable allocation and efficient utilization of computing power has become an urgent problem to be solved. For this reason, the present invention proposes a control system and method for automatic computing power allocation based on software and hardware collaboration. Summary of the Invention
[0004] The purpose of the present invention is to provide a control system and method for automatic computing power allocation based on software and hardware collaboration. The computing power automatic allocation module in the configuration software adaptively judges the complexity of the control logic, and automatically allocates the computing tasks to be completed by the computing software or the hardware controller according to different complexities of the control logic, so as to overcome the deficiencies of the prior art that it is difficult to meet the requirements of high-complexity algorithms, has low computing efficiency, and insufficient real-time performance.
[0005] In order to achieve the above purpose, the present invention provides the following technical solutions: On the one hand, the present invention provides a control system for automatic computing power allocation based on software and hardware collaboration, including: Configuration software: The configuration software includes a computing power automatic allocation module, and the computing power automatic allocation module is used to judge the complexity of the control logic and allocate for different complexities of the control logic; the complexity includes high complexity and low complexity; Computing software: Used to calculate high-complexity control logic; Hardware controller: Used to calculate low-complexity control logic.
[0006] Further, the computing power automatic allocation module includes an algorithm input module, an analyzer, and an output module; The algorithm input module is used to receive the algorithm code and algorithm description, and perform a preliminary analysis on the input algorithm code, and describe the algorithm based on natural language for the input algorithm description; The analyzer is used to analyze the algorithm code and algorithm description and output the time complexity and space complexity of the algorithm, and judge the complexity based on the time complexity and space complexity of the algorithm; The output module is used to analyze high complexity and low complexity, allocate the control logic of high complexity to the computing software, and allocate the control logic of low complexity to the hardware controller.
[0007] In a second aspect, the present invention provides a method for a control system of automatic computing power allocation based on software and hardware cooperation, including the following steps: Start the computing power automatic allocation module for the object that has completed the control logic configuration; After parsing the control logic, the computing power automatic allocation module enters the algorithm input module through the algorithm code or algorithm description; After a preliminary analysis of the algorithm code or algorithm description by the algorithm input module, it is output to the analyzer; The analyzer judges the algorithm complexity according to the time complexity and space complexity; the complexity includes high complexity and low complexity; Allocate the control logic of high complexity to the computing software, and allocate the control logic of low complexity to the hardware controller.
[0008] Further, the specific process of the algorithm code entering the algorithm input module for preliminary analysis includes: The algorithm code enters the algorithm input module for preliminary analysis; the preliminary analysis includes lexical analysis and syntax parsing; Lexical analysis decomposes the source code into a series of lexemes through regular expressions to generate a lexeme sequence; Syntax parsing is the process of combining lexemes into an abstract syntax tree representation.
[0009] Further, the input method of the algorithm code is a text file containing the algorithm code and directly pasting the algorithm code into the input box of the user interface.
[0010] Further, the source code includes keywords, identifiers, operators, and numbers.
[0011] Further, the algorithm description entering the algorithm input module is a process of describing the algorithm based on natural language, and this description process includes: the goal and input of the algorithm, keywords, and the main steps of the algorithm.
[0012] Further, the specific process of judging the algorithm complexity by the time complexity and space complexity is: Time complexity analysis: By analyzing the number of executions in the algorithm, estimate the growth trend of the algorithm's execution time with the increase of the input scale.
[0013] The process of judging the algorithm complexity by the space complexity is specifically as follows: Space complexity analysis: For variables, data structures, and recursive call stacks, evaluate the additional storage space required by the algorithm during execution.
[0014] In a third aspect, a computer device includes a processor and a memory for storing processor-executable instructions. When the processor executes the instructions, the steps of the method of the above-mentioned control system for automatically allocating computing power based on software and hardware cooperation are implemented.
[0015] In a fourth aspect, a computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method of the above-mentioned control system for automatically allocating computing power based on software and hardware cooperation is implemented.
[0016] Compared with the prior art, the present invention has the following beneficial technical effects: The present invention provides a control system for automatically allocating computing power based on software and hardware cooperation. By allocating high-complexity control logic to computing software and low-complexity control logic to a hardware controller, the system can make full use of software and hardware resources. The computing software can handle complex algorithms and optimization tasks, while the hardware controller focuses on real-time and low-latency tasks, thereby achieving the optimal utilization of resources. It avoids the situation that allocating high-complexity tasks to the hardware controller may lead to insufficient performance or allocating low-complexity tasks to the computing software may lead to over-occupation of resources, and improves the overall operation efficiency of the system.
[0017] Through the heartbeat mechanism and data synchronization mechanism, the system of the present invention realizes redundancy between the primary and standby computing software. Even if the primary controller fails, the standby controller can seamlessly take over, ensuring the continuous operation of the system and reducing the downtime caused by hardware or software failures.
[0018] The present invention provides a method for a control system for automatically allocating computing power based on software and hardware cooperation. Through the accurate judgment of the algorithm complexity, i.e., time complexity and space complexity, by an analyzer, high-complexity tasks are allocated to computing software, and low-complexity tasks are allocated to the hardware controller. This allocation method ensures that tasks run in the most suitable execution environment, avoiding resource waste and performance bottlenecks.
[0019] Through the heartbeat mechanism and incremental data synchronization mechanism, the primary and standby computing software can detect faults in real time and switch quickly. This design significantly improves the fault tolerance of the system and reduces the downtime caused by single-point failures.
[0020] The algorithm input module of the present invention supports algorithm code and natural language descriptions, and can meet the needs of different users; through lexical analysis, syntax parsing, and natural language processing technologies, the analyzer can automatically judge the complexity of the algorithm and allocate tasks according to the complexity. This automation reduces manual intervention. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 It is a schematic diagram of a control system for automatic computing power allocation based on software and hardware cooperation in an embodiment of the present invention.
[0022] Figure 2 It is a schematic diagram of the architecture of the automatic computing power allocation module of a control system for automatic computing power allocation based on software and hardware cooperation in an embodiment of the present invention.
[0023] Figure 3 It is a flowchart of a method of a control system for automatic computing power allocation based on software and hardware cooperation in an embodiment of the present invention.
[0024] Figure 4 It is a schematic diagram of the computing software architecture of a method of a control system for automatic computing power allocation based on software and hardware cooperation in an embodiment of the present invention.
[0025] Figure 5 It is a logic diagram of the implementation of a method of a control system for automatic computing power allocation based on software and hardware cooperation in an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0026] In order to enable those skilled in the art to better understand the solution of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0027] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments of the present invention described here can be implemented in an order different from those illustrated or described here. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products, or devices.
[0028] To effectively combine the advantages of computing software and controller hardware and achieve reasonable allocation and efficient utilization of computing power, refer to Figures 1 to 2 , the present invention proposes a control system for automatic allocation of computing power based on software and hardware collaboration, including: Configuration software: The configuration software includes a computing power automatic allocation module, which is used to judge the complexity of control logic and allocate tasks for different complexities of control logic; the complexity includes high complexity and low complexity; Computing software: Used to calculate high-complexity control logic and has powerful computing capabilities; Hardware controller: Used to calculate low-complexity control logic and utilize its real-time and stability advantages.
[0029] The computing power automatic allocation module includes an algorithm input module, an analyzer, and an output module; The algorithm input module is used to receive algorithm code and algorithm description, and perform preliminary parsing on the input algorithm code and describe the algorithm process based on natural language for the input algorithm description; The input of algorithm code supports two methods. The input of algorithm code supports being in a text file and supports multiple common programming language file formats, such as: Python file, C++ file, Java file; users can import the text file containing algorithm code into the system through the file upload function. After the system reads the file content, it passes it to the algorithm input module for subsequent processing. At the same time, text can also be directly pasted in the UI input interface. After the algorithm code is input, it will be preliminarily parsed in the algorithm input module. The preliminary parsing mainly includes two key steps: lexical analysis and syntax parsing.
[0030] The analyzer is used to analyze the algorithm code and algorithm description and output the time complexity and space complexity of the algorithm, and judge the complexity based on the time complexity and space complexity of the algorithm; The output module is used to analyze high complexity and low complexity, allocate high-complexity control logic to the computing software, and allocate low-complexity control logic to the hardware controller.
[0031] Refer to Figure 3 , the present invention provides a method for a control system of automatic allocation of computing power based on software and hardware collaboration, including the following steps: Start the computing power automatic allocation module for the object that has completed control logic configuration; The computing power automatic allocation module is responsible for judging the complexity of the control logic and allocating tasks to the computing software or the hardware controller according to the complexity.
[0032] After parsing the control logic, the computing power automatic allocation module enters the algorithm input module through algorithm code or algorithm description; After the algorithm input module conducts a preliminary analysis on the algorithm code or algorithm description, it outputs to the analyzer; the algorithm code enters the algorithm input module for preliminary analysis; the preliminary analysis includes lexical analysis and syntax parsing; Lexical analysis decomposes the source code into a series of lexemes through regular expressions; (such as keywords, identifiers, operators, numbers, etc.); Syntax parsing is the process of combining lexemes into an abstract syntax tree (AST) or other structured representations. The AST is a tree structure that represents the syntax structure in the source code.
[0033] The algorithm description enters the algorithm input module based on natural language for the description process of the algorithm. This description process includes: the goal and input of the algorithm, keywords, and the main steps of the algorithm.
[0034] The analyzer judges the algorithm complexity according to the time complexity and space complexity; the complexity includes high complexity and low complexity; The main task of the analyzer module is to evaluate the algorithm complexity and provide a basis for subsequent task allocation. It can process two types of inputs: algorithm code and algorithm description; For inputs such as algorithm code, first the analyzer traverses the AST tree structure and analyzes the nodes therein to identify the key parts of the algorithm. This usually involves identifying structures such as loops, conditional statements, function calls, etc., and calculating their nesting depth and execution times. The method of traversing the AST adopts a recursive way. During the traversal process, the analyzer needs to maintain some state information to track the current context and calculate the complexity. For the algorithm description part, it is necessary to train in advance for keywords, implementation goals, etc. of various algorithms based on an artificial neural network. When an algorithm description is input, the trained artificial neural network can be called, and the algorithm goal, keywords, etc. of the algorithm description are used as inputs, and the complexity is used as the output to judge the algorithm complexity.
[0035] The judgment of complexity is mainly divided into two types: time complexity and space complexity; Time complexity refers to the changing trend of the time required for the algorithm during execution as the input scale increases. Identify the basic operations with the most execution times in the algorithm, such as loops, recursive calls, etc.; by analyzing the number of iterations of the loop, the depth of recursion, etc., estimate the growth trend of the execution time of the algorithm as the input scale increases.
[0036] Space complexity refers to the additional storage space required for the algorithm during execution, excluding the input data itself. It reflects the consumption of memory resources by the algorithm.
[0037] Analyze the variables, arrays, linked lists and other data structures used in the algorithm, evaluate the storage space they occupy. For recursive algorithms, analyze the depth of the recursive call stack and evaluate its memory occupancy; the additional storage space required during the execution of the algorithm, excluding the input data itself. For example, an algorithm may need to temporarily store some intermediate results, and the space occupied by these results also needs to be calculated.
[0038] Allocate high-complexity control logic to the computing software and low-complexity control logic to the hardware controller; The high-complexity algorithm is calculated in the computing software to save the computing power expenditure of the hardware controller. The low-complexity algorithm is calculated in the hardware controller, which can improve the control response speed while ensuring the reliability of the algorithm. In addition, the output module also interprets and explains the evaluation results for the user, including the meaning of the complexity metrics, the performance characteristics of the algorithm, and possible optimization suggestions.
[0039] Refer to Figure 4 , the computing software mainly includes the parsing function of the configuration software, as well as the logical operation function, redundancy function, and configuration management function of various types of on-site devices; The main process of parsing the configuration file includes file format recognition, file reading, syntax analysis, structure analysis, etc.
[0040] The logical operation function includes simple logical operations (AND, OR, NOT), comparison operations, and complex logical operations such as PID, and also supports advanced intelligent optimization algorithms; The implementation of the redundancy function mainly includes two aspects: the heartbeat mechanism and the data synchronization mechanism. The heartbeat mechanism is used to detect the connection status between the primary and standby computing software in real time and determine whether the primary controller is running normally. If the primary controller fails, the standby controller can take over in time to ensure the continuity of the system.
[0041] First, establish a heartbeat mechanism. The primary and standby computing software will judge whether the connection is normal through the heartbeat mechanism, so as to judge whether a switch between the primary and standby computing software is needed. The heartbeat mechanism is mainly realized by generating a heartbeat signal and sending it to the other party to judge whether there is a reply.
[0042] The data synchronization mechanism is used to ensure data consistency between the primary and standby controllers. When the primary controller fails and switches, the standby controller can immediately take over and continue to run without data loss or inconsistency.
[0043] A data synchronization mechanism also needs to be established between the primary and standby computing software. Each time the primary controller updates data, it generates an incremental data packet containing the updated data. This data packet only contains the changed data since the last synchronization, rather than the entire data set. After receiving the incremental data packet, the standby controller applies it to the local data copy, thus achieving data synchronization with the primary controller.
[0044] The configuration management function allows users to flexibly configure the computing software according to actual needs. Users can select the devices to be controlled, set control parameters, adjust control logic, etc. through this module. The configuration management module also provides a friendly user interface to facilitate user operation and monitoring.
[0045] The implementation process of the present invention is as Figure 5 shown. First, after the configuration personnel complete the control logic configuration of the controlled object, they manually start the computing power automatic allocation module. The control logic on the configuration page is further parsed in the computing power automatic allocation module, and then enters the algorithm input module, which can be input in two ways. For the externally connected advanced optimization algorithms implemented by high-level language programming, lexical analysis and syntax parsing are performed. For the control logic implemented on the software configuration page, the algorithm will be described using natural language. The main contents include: the goal and input of the algorithm, keywords, the main steps of the algorithm, etc. For the algorithm code or algorithm description, the analyzer judges its complexity. If it is a program such as source code, it identifies structures such as loops, conditional statements, and function calls by judgment, and calculates their nesting depth and execution times, etc. to identify the complexity. If it is the algorithm description part, it is necessary to use an artificial neural network to judge the algorithm complexity with the algorithm goal, keywords, etc. described in the algorithm as the input and the complexity as the output.
[0046] After the algorithm complexity judgment is completed, if it is a high-complexity algorithm, the configuration logic is automatically downloaded to the computing software. After the computing software loads the configuration logic, it outputs the analysis result of the algorithm complexity to the engineering personnel. The computing software loads the configuration file, and at the same time completes the parsing and execution of the logic operation function. At the same time, the computing software starts the redundancy function. First, it judges the running status of the primary and standby computing programs through the heartbeat mechanism. Then, each time the primary controller updates data, it generates an incremental data packet containing the updated data, which only contains the changed data since the last synchronization. After receiving the incremental data packet, the standby controller applies it to the local data copy, thus achieving data synchronization with the primary controller.
[0047] If the analysis result of the algorithm complexity is low complexity, the hardware controller automatically downloads the configuration logic, completes the logic operation and the control process of the field devices, and at the same time outputs the analysis result of the algorithm complexity to the engineering personnel.
[0048] The present invention also provides a computer device, including a processor and a memory for storing processor-executable instructions. When the processor executes the instructions, the steps of the method of the above-mentioned control system for automatically allocating computing power based on software and hardware cooperation are implemented.
[0049] The present invention also provides a computer-readable storage medium. A computer program is stored on the storage medium. When the computer program is executed by a processor, the method of the above-mentioned control system for automatically allocating computing power based on software and hardware cooperation is implemented.
[0050] The above embodiments are only preferred embodiments given to fully illustrate the present invention, and the protection scope of the present invention is not limited thereto. Equivalent substitutions or transformations made by those skilled in the art on the basis of the present invention are all within the protection scope of the present invention. The protection scope of the present invention is subject to the claims.
Claims
1. A control system for automatic computing power allocation based on software and hardware collaboration, characterized in that It includes: Configuration software: The configuration software includes a computing power automatic allocation module, which is used to judge the complexity of the control logic and allocate tasks for different complexities of control logic; the complexity includes high complexity and low complexity; Computing software: It is used to calculate the control logic with high complexity; Hardware controller: It is used to calculate the control logic with low complexity.
2. The control system for automatic computing power allocation based on software and hardware cooperation according to claim 1, wherein The computing power automatic allocation module includes an algorithm input module, an analyzer and an output module; The algorithm input module is used to receive algorithm codes and algorithm descriptions, and perform a preliminary analysis on the input algorithm codes, and describe the algorithm based on the input algorithm description in natural language; The analyzer is used to analyze the algorithm codes and algorithm descriptions and output the time complexity and space complexity of the algorithm, and judge the complexity based on the time complexity and space complexity of the algorithm; The output module is used to analyze high complexity and low complexity, allocate the control logic with high complexity to the computing software, and allocate the control logic with low complexity to the hardware controller.
3. A method for a control system of automatic computing power allocation based on software and hardware collaboration, characterized in that, It includes the following steps: Start the computing power automatic allocation module for the object that has completed the control logic configuration; The computing power automatic allocation module parses the control logic and represents it in a structured manner, and then enters the algorithm input module through the algorithm code or algorithm description; After a preliminary analysis of the algorithm code or algorithm description by the algorithm input module, it is output to the analyzer; The analyzer judges the algorithm complexity according to the time complexity and space complexity; the complexity includes high complexity and low complexity; Allocate the control logic with high complexity to the computing software, and allocate the control logic with low complexity to the hardware controller.
4. The method of a control system for automatic computing power allocation based on software and hardware collaboration according to claim 3, characterized in that The specific process of the preliminary analysis of the algorithm code entering the algorithm input module includes: The algorithm code enters the algorithm input module for preliminary analysis; the preliminary analysis includes lexical analysis and syntax parsing; Lexical analysis is to decompose the source code into a series of lexemes through regular expressions; Syntax parsing is the process of combining lexemes into an abstract syntax tree representation.
5. The method of a control system for automatic computing power allocation based on software and hardware collaboration according to claim 4, characterized in that, The input method of the algorithm code is a text file containing the algorithm code and directly pasting the algorithm code into the input box of the user interface.
6. The control method for automatic computing power allocation based on software and hardware collaboration according to claim 3, wherein The entry of the algorithm description into the algorithm input module is a description process of the algorithm based on natural language, and this description process includes: the goal and input of the algorithm, keywords, and the main steps of the algorithm.
7. The method of a control system for automatic computing power allocation based on software and hardware collaboration according to claim 3, characterized in that, The computing software includes the parsing function, logical operation function, redundancy function and configuration management function of the configuration software; the redundancy function includes establishing a heartbeat mechanism and establishing a data synchronization mechanism between the computing software.
8. The method of a control system for automatic computing power allocation based on software and hardware collaboration according to claim 3, wherein, The specific process of judging the algorithm complexity by the time complexity and space complexity is as follows: Time complexity analysis: By analyzing the number of executions in the algorithm, estimate the growth trend of the execution time of the algorithm with the increase of the input scale; The specific process of judging the algorithm complexity by the space complexity is as follows: Space complexity analysis: For variables, data structures and recursive call stacks, evaluate the additional storage space required by the algorithm during execution.
9. A computer device, characterized in that, It includes a processor and a memory for storing processor-executable instructions. When the processor executes the instructions, it implements the steps of the method of a control system for automatically allocating computing power based on software and hardware cooperation described in any one of claims 3-8.
10. A computer-readable storage medium, characterized in that, A computer program is stored on the storage medium. When the computer program is executed by a processor, it implements the method of a control system for automatically allocating computing power based on software and hardware cooperation described in any one of claims 3-8.
Citation Information
Cited By
Robot control method and system thereof, medium, equipment and program product
CN121515155A