Control method and device of electric actuator, electric actuator and medium

By introducing a microcontroller software architecture and script files to execute task logic into the electric actuator, the problems of poor flexibility, high communication load, and low intelligence in the existing technology are solved, achieving autonomous control and rapid adaptation to production needs.

CN121763874APending Publication Date: 2026-03-31SUZHOU JODELL ROBOTICS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-23
Publication Date
2026-03-31

AI Technical Summary

Technical Problem

Existing electric actuators suffer from poor flexibility, high communication load, low intelligence, and poor on-site adaptability. They require professional technical support to adjust the process flow, leading to production line downtime and communication delays.

Method used

The software architecture of a microcontroller is introduced into the electric actuator, including a hardware driver layer, a core service layer, and a script engine and bridging layer. By storing and executing task logic through script files, autonomous control and task orchestration are achieved, reducing the dependence on the host computer.

Benefits of technology

It improves the intelligence and autonomy of the actuator, reduces communication load, enhances system robustness and field adaptability, and reduces reliance on professional technology and deployment cycle.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121763874A_ABST
    Figure CN121763874A_ABST
Patent Text Reader

Abstract

The invention discloses a control method and device of an electric actuator, the electric actuator and a medium. The method is applied to the electric actuator comprising a microcontroller and an execution component, and a microcontroller software architecture comprises a hardware driving layer, a core service layer for realizing functions based on the hardware driving layer, and a script engine and bridging layer for providing a script interpreter and function packaging. Obtaining a to-be-executed script file from an external host and writing into the script storage area; determining task execution information corresponding to the task trigger information transmitted by the external host, and reading a target execution script file associated with the task execution information from the script storage area; calling a script interpreter to execute the target execution script file based on the task execution information, and controlling an execution component to act in combination with a peripheral operation interface; if it is determined that the target execution script file is successfully executed, exiting; and if the execution fails, continuing to read and execute the alternative execution script file according to the preset script. And the business logic is issued to the actuator in a script form, so that the control flexibility of the actuator is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of automatic control technology, and in particular to a control method, device, electric actuator, and medium for an electric actuator. Background Technology

[0002] Electric actuators are widely used in industrial automation, intelligent robots, and various intelligent control devices to perform precise physical tasks, such as the movement of robotic arms, the opening and closing of grippers, and the conveying of materials.

[0003] In existing technologies, electric actuators typically employ a "central control + end-effector execution" architecture. Specifically, complex business control logic (such as process flow arrangement, task scheduling, and exception handling) is centrally implemented in a host computer (such as a programmable logic controller (PLC) or industrial computer), while the electric actuator itself acts only as a simple execution unit, passively receiving basic instructions (such as "move to position X" or "clamping force Y") sent by the host computer and executing the corresponding actions.

[0004] When a production line needs to adjust its process flow, adapt to new tasks, or change operating parameters, the control program must be modified on the host computer. This involves the following steps: a professional engineer modifies the PLC program or host computer software, recompiles and debugs it, verifies it through on-site testing, and finally deploys it to the production environment. The entire process requires professional technical support and may result in production line downtime.

[0005] Furthermore, when performing complex processes, the host computer needs to frequently send a series of instructions to the actuator. Each action requires instruction issuance and status feedback through the communication bus, which not only increases the communication load but may also affect execution efficiency due to communication delays.

[0006] The main shortcomings of the above-mentioned technologies are as follows:

[0007] (1) Poor flexibility: The business logic is concentrated in the host computer, and the actuator cannot independently execute complex tasks. Every process adjustment requires modification of the host computer program, resulting in long deployment cycle and high cost;

[0008] (2) High communication load: Completing a complex process requires multiple instruction exchanges, which consumes communication bandwidth and may cause delays;

[0009] (3) Low level of intelligence of actuator: The actuator can only perform simple atomic operations and cannot perform task orchestration and exception handling autonomously, relying on the real-time control of the host computer;

[0010] (4) Poor on-site adaptability: When encountering new working conditions on the production site, the actuator behavior cannot be quickly adjusted, and it is necessary to wait for technicians to remotely or on-site modify the host computer program. Summary of the Invention

[0011] This invention provides a control method, device, electric actuator, and medium for an electric actuator, which can improve the flexibility of controlling the actuator.

[0012] In a first aspect, embodiments of the present invention provide a control method for an electric actuator, applied to an electric actuator including a microcontroller and an actuation component. The software architecture of the microcontroller includes a hardware driver layer, a core service layer, and a script engine and bridging layer. The hardware driver layer provides a peripheral operation interface. The core service layer implements functions based on the peripheral operation interface. The script engine and bridging layer provide a script interpreter and encapsulate the functions of the core service layer for script invocation. The method includes:

[0013] Retrieve the script file to be executed from the external host and write it to the script storage area;

[0014] Upon detecting task triggering information transmitted by the external host, determine the task execution information corresponding to the task triggering information, and read the target execution script file associated with the task execution information from the script storage area;

[0015] Based on the task execution information, the script interpreter is invoked to execute the target execution script file, and the action of the execution component is controlled in conjunction with the peripheral operation interface.

[0016] If the target execution script file is determined to be executed successfully, the process exits; if the target execution script file is determined to be executed unsuccessfully, the process continues to read and execute alternative execution script files associated with the failed task according to the preset script, until the task execution information indicates that the task execution is completed or an error is reported and the process exits.

[0017] Secondly, embodiments of the present invention provide a control device for an electric actuator, configured on the electric actuator, the electric actuator including a microcontroller and an actuation component, the software architecture of the microcontroller including a hardware driver layer, a core service layer, and a script engine and bridging layer; the hardware driver layer is used to provide a peripheral operation interface; the core service layer implements functions based on the peripheral operation interface; the script engine and bridging layer is used to provide a script interpreter and encapsulate the functions of the core service layer for script invocation; the device includes:

[0018] The script file writing module is used to obtain the script file to be executed from the external host and write it to the script storage area;

[0019] The script file reading module is used to determine the task execution information corresponding to the task trigger information when the task trigger information transmitted by the external host is detected, and to read the target execution script file associated with the task execution information from the script storage area;

[0020] The first execution module of the script file is used to call the script interpreter to execute the target execution script file based on the task execution information, and control the action of the execution component in conjunction with the peripheral operation interface;

[0021] The second execution module of the script file is used to exit if the target execution script file is determined to be executed successfully; if the target execution script file is determined to be executed unsuccessfully, it continues to read and execute the alternative execution script files associated with the failed task according to the preset script, until the task execution information indicates that the task execution is completed or an error is reported and exited.

[0022] Thirdly, embodiments of the present invention provide an electric actuator, comprising:

[0023] At least one processor; and

[0024] A memory communicatively connected to the at least one processor; wherein,

[0025] The memory stores a computer program that can be executed by the at least one processor to enable the at least one processor to perform the method as described in the first aspect.

[0026] Fourthly, embodiments of the present invention provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described in the first aspect.

[0027] The technical solution of this invention sinks the business control logic from the host computer to the executor. By storing and executing the task flow in the form of a script in the executor, the following beneficial effects are achieved:

[0028] (1) Improved the intelligence and autonomy of the actuator: The actuator can independently execute complex processes without the need for the host computer to send instructions frequently, which reduces the burden on the host computer and reduces the dependence on the host computer's real-time control capabilities.

[0029] (2) Significantly improves the flexibility of control logic: different controls of the actuator can be achieved by sending script files and task triggering information to the actuator through the external host. There is no need to modify and re-burn the underlying firmware. It can quickly adapt to different production needs and application scenarios, with short deployment cycle and low cost.

[0030] (3) Reduced communication load and improved execution efficiency: After receiving simple task trigger information, the actuator can complete the entire process autonomously, simplifying the instruction sequence that originally required multiple interactions into a single trigger, greatly reducing the load on the communication bus and reducing communication delay;

[0031] (4) Enhanced system robustness and fault tolerance: It can automatically perform subsequent processing based on the execution result of the script file without manual intervention. When the main script fails to execute, it can automatically switch to the pre-configured alternative execution script file to ensure that the task is completed as much as possible while avoiding production interruption caused by single point of failure.

[0032] (5) Improved on-site adaptability: Technicians can quickly adjust the behavior of the actuator on the production site through simple script update operations without stopping the machine to modify the host computer program, reducing the dependence on professional embedded engineers and reducing on-site maintenance costs.

[0033] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description

[0034] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0035] Figure 1 This is a flowchart of a control method for an electric actuator according to Embodiment 1 of the present invention;

[0036] Figure 2 This is a flowchart of a control method for an electric actuator according to Embodiment 2 of the present invention;

[0037] Figure 3 This is a schematic diagram of the structure of a control device for an electric actuator according to Embodiment 3 of the present invention;

[0038] Figure 4 This is a schematic diagram of the structure of the electric actuator that implements an embodiment of the present invention. Detailed Implementation

[0039] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0040] It should be noted that the terms "first," "second," etc., used in this invention 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 where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0041] Example 1

[0042] Figure 1 This is a flowchart of a control method for an electric actuator according to Embodiment 1 of the present invention. This embodiment is applicable to the control of an electric actuator. The method can be executed by a control device for the electric actuator, which can be implemented in software and / or hardware and integrated into the electric actuator.

[0043] In this embodiment of the invention, the electric actuator includes a microcontroller and an execution component. The software architecture of the microcontroller includes a hardware driver layer, a core service layer, and a script engine and bridging layer. The hardware driver layer provides a peripheral operation interface. The core service layer implements functions based on the peripheral operation interface. The script engine and bridging layer provide a script interpreter and encapsulate the functions of the core service layer for script invocation.

[0044] The hardware driver layer provides peripheral operation interfaces and is responsible for directly operating the microcontroller's underlying hardware peripherals. These underlying hardware peripherals can be peripherals related to actuator control, and are not limited here.

[0045] The core service layer implements functions based on peripheral operation interfaces. These functions may include, but are not limited to: communication protocol-related functions, which are responsible for parsing data frames received through the communication interface and processing instructions such as script downloading and register read / write; storage management-related functions, which provide interfaces for reading, writing, and erasing data on internal flash memory for saving system configuration and script files; task scheduling-related functions, which are used to implement task scheduling; and actuator control-related functions, which are used to implement precise control of actuator actions.

[0046] The script engine and bridging layer embed a lightweight script interpreter and provide programming language bridging application programming interfaces (APIs). These APIs encapsulate the core service layer's functionality into a series of programming language bridging functions, which are then registered with the script interpreter, allowing them to be directly invoked through the execution of script files.

[0047] In this embodiment of the invention, the specific business logic is defined by one or more script files. These scripts are not part of the firmware, but are stored as ordinary data in the script storage area and can be updated and replaced at any time.

[0048] In this embodiment of the invention, the electric actuator further includes a communication interface for receiving external commands and data, a non-volatile memory (such as internal flash memory) for persistently storing script files, and drive and acquisition circuits connected to sensors, etc.

[0049] Based on the above architecture, for Figure 1 The method shown is explained below, such as Figure 1 As shown, the method includes:

[0050] S110. Obtain the script file to be executed from the external host and write it to the script storage area.

[0051] An external host can be an independent device with stronger computing, storage, or human-machine interaction capabilities compared to the electric actuator (hereinafter referred to as the actuator). Its core function is to issue instructions, transmit data, or obtain feedback to the actuator's microcontroller. There are no restrictions on the external host, such as a personal computer (PC) or a programmable logic controller (PLC).

[0052] The script file to be executed can be a script file to be executed by an executor. The executor's business logic can be controlled by executing the script file. Optionally, the executor can be a mechanical gripper. Controlling the executor can be achieved by using a motor as the power source, converting the motor's motion into gripping, holding, and releasing actions of the gripper. In practical applications, the business logic required by the executor can be written into a script file on an external host using human-computer interaction capabilities combined with graphical programming, resulting in the script file to be executed.

[0053] An external host can encapsulate the script file to be executed into a data frame and transmit the encapsulated data frame to the microcontroller via an agreed-upon communication protocol, such as a serial communication protocol. The microcontroller receives the data frame transmitted by the external host via the aforementioned communication protocol, parses the data frame to obtain the script file to be executed, and writes the script file to the script storage area.

[0054] The above method allows the executable script file from the external host to be downloaded and stored. It should be noted that the executable script file downloaded from the external host to the executor can be initially stored when the executor does not yet contain the script file, or it can be added when some script files already exist in the executor. The script storage area within the executor is not limited; it can be a storage area in the internal flash memory.

[0055] S120. Upon detecting the task triggering information transmitted by the external host, determine the task execution information corresponding to the task triggering information, and read the target execution script file associated with the task execution information from the script storage area.

[0056] Task trigger information can be used to trigger task execution, and can be in the form of a command value; there are no restrictions here. The corresponding task execution information can be information indicating the task to be executed and how the task should be executed.

[0057] In practical applications, multiple predefined tasks can exist, and the execution of one or more tasks can be associated with different command values. The association method between multiple tasks and command values ​​is not limited here. For example, command value "1" triggers the execution of task 1; command value "2" triggers the execution of task 2; command value "-1" triggers the sequential execution of multiple predefined tasks; command value "-2" triggers the automatic cyclic execution of multiple predefined tasks; command value "-3" triggers the execution of task 1, exiting upon success and automatically executing the next task until success or exiting with an error after all tasks have been cycled. In the above examples, the command values ​​can be understood as task triggering information, and the content triggered by the command values ​​can be understood as task execution information.

[0058] For example, the execution logic of Task 1 could be to set the target position of the gripper to 55mm, perform the opening action, and then perform the clamping action after waiting for it to be in position; the execution logic of Task 2 could be to set the target position of the gripper to 85mm, perform the opening action, and then perform the clamping action after waiting for it to be in position.

[0059] In one embodiment, the task execution information includes target execution tasks and task execution strategies; wherein, the number of target execution tasks is one or more, and each target execution task corresponds to a target execution script file; the task execution strategy indicates the execution order of the target execution tasks, or indicates the tasks to be executed after the target execution task fails.

[0060] Here, the target execution task can be understood as a task to be executed triggered by task triggering information. For example, the command value "1" triggers task 1 to be executed; or the command value "-1" triggers multiple predefined tasks to be executed. For each target execution task, there is a corresponding target execution script file. The target execution script file can be a pre-defined script file associated with the target execution task to be executed, and the association method is not limited.

[0061] A task execution strategy can be a policy that instructs the target to execute a task. For example, the strategy corresponding to the command value "-1" is to execute multiple tasks sequentially; while the strategy corresponding to the command value "-3" is to exit when a task is successfully executed, and to automatically execute the next task until success or to loop through all tasks and then report an error and exit.

[0062] An external host can transmit task triggering information to the microcontroller via a pre-defined communication protocol. The transmission method is not limited; it can be via register read / write or direct transmission. Upon detecting the task triggering information transmitted by the external host, the microcontroller can determine the corresponding task execution information, i.e., determine the target task and task execution strategy, and then read the target execution script file associated with the target task from the script storage area.

[0063] S130. Based on the task execution information, the script interpreter is invoked to execute the target execution script file, and the operation of the execution component is controlled in conjunction with the peripheral operation interface.

[0064] A script interpreter can be understood as a computer program or tool that can be embedded in a microcontroller. Its core function is to read, parse, and execute code written in a scripting language.

[0065] In this step, the microcontroller can execute one or more target execution tasks according to the task execution strategy indicated by the task execution information. The execution process for each target execution task can be understood as follows: calling the script interpreter to parse the target execution script file corresponding to the target execution task, and calling the corresponding peripheral operation interface to control the execution components in the executor to perform corresponding actions according to the parsed business logic.

[0066] For example, the target execution task includes multiple predefined tasks such as task 1 and task 2. The task execution strategy instructs the multiple tasks to be executed in sequence. Then, the process of controlling the action of the execution component includes the following: calling the script interpreter to parse and execute the target execution script file corresponding to task 1, and controlling the execution component to execute task 1; calling the script interpreter to parse and execute the target execution script file corresponding to task 2, and controlling the execution component to execute task 2.

[0067] S140. If the target execution script file is determined to be executed successfully, exit; if the target execution script file is determined to be executed unsuccessfully, continue to read and execute the alternative execution script file associated with the failed task according to the preset script, until the task execution information indicates that the task execution is completed or an error is reported and exited.

[0068] The preset script can be pre-set and indicates how to determine the alternative script file to be executed if the currently executed script file fails. Its core purpose is to ensure the continuity and stability of the executor's tasks and avoid the interruption of the entire control flow due to the failure of a single script.

[0069] When executing one or more target execution script files corresponding to target execution tasks according to the above task execution strategy, it can be determined whether to exit execution or continue to execute the next script file based on the execution result of each target execution script file.

[0070] Scenario 1: When the task execution strategy only indicates the execution order of one or more target tasks, without specifying the execution logic after the task execution is successful or unsuccessful, such as instructing task 1 and task 2 to be executed sequentially, or instructing task 1 to execute, the processing logic is as follows:

[0071] One or more target execution tasks are executed sequentially. After the target execution script file corresponding to each target execution task is completed, the execution result must be determined. If the execution is successful, the process continues. If all target execution tasks are completed, the execution ends, or the target execution script file of the next target execution task is executed sequentially. If the execution fails, for the failed task, the alternative execution script file associated with the failed task is read and executed according to the preset script. The execution result of the alternative execution script file determines whether to end the execution or continue to the next script file. If the execution result of the alternative execution script file indicates success, the process continues; if the execution result of the alternative execution script file indicates failure, the execution ends, until all target execution tasks are completed or an error is reported and the process exits. At this time, the alternative execution script file is another script file stored in the script storage area that can execute the failed task. This other script file can be a pre-set alternative script file associated with the failed task, and there can be one or more, which is not limited here.

[0072] Scenario 2: If the task execution strategy specifies the execution logic after one or more targets have successfully completed or failed a task, such as instructing the target to exit if task 1 succeeds, and to automatically execute the next task until success or to exit after looping through all tasks, then the processing logic is as follows:

[0073] After the target execution script file corresponding to the target task has been executed, the execution result is determined. If the execution is successful, the execution ends. If the execution fails, for the failed task, the alternative execution script file associated with the failed task is read and executed according to the preset script. At this time, the alternative execution script file is the execution script file corresponding to the task that should be executed after the failed task. The execution task is one or more tasks following the failed task in the loop. The execution result of the currently executed execution script file determines whether to end the execution or continue to execute the next script file. If the execution is successful, the execution ends; if the execution fails, the execution continues to execute the next execution script file until success or the loop completes and an error is reported and the process exits.

[0074] In one embodiment, the preset script indicates alternative execution script files associated with the failed task, including other script files in the script storage area capable of executing the failed task, or the execution script file corresponding to the task to be executed after the failed task, as indicated by the task execution strategy. The execution of other script files corresponds to scenario one above, and the execution of the execution script file corresponds to scenario two above.

[0075] The technical solution of this invention can achieve different controls on the executor by sending script files and task triggering information corresponding to the business logic to the executor from an external host. There is no need to modify or re-flash the underlying firmware, which can quickly adapt to different production needs and application scenarios and is highly flexible. Moreover, it can automatically perform subsequent processing based on the execution result of the script file without manual intervention, such as exiting or continuing to execute the alternative execution script file associated with the failed task, ensuring that the task is completed as much as possible while avoiding unnecessary resource consumption.

[0076] Example 2

[0077] Figure 2 This is a flowchart of a control method for an electric actuator according to Embodiment 2 of the present invention. This embodiment is based on Embodiment 1 above, and further refines the process of obtaining the script file to be executed from an external host and writing it into the script storage area; and explains the detection of task trigger information transmitted by the external host; and further refines the process of calling the script interpreter to execute the target execution script file based on the task execution information, and controlling the action of the execution component in conjunction with the peripheral operation interface.

[0078] like Figure 2 As shown, the method includes:

[0079] S210. Upon receiving a script transmission request instruction from an external host, perform an erase operation in the flash memory.

[0080] A script transfer request command can be an instruction to request the transfer of a script file. An external host can transmit this script transfer request command to the microcontroller of the executor via a communication interface. Upon receiving the script transfer request command, the executor performs an erase operation on the flash memory, preparing to store the data transferred from the external host.

[0081] S220. Upon receiving a script transmission instruction from the external host, obtain the script file to be executed and write it into the script storage area in the flash memory.

[0082] Script transfer commands can be commands for transferring script files. The external host encapsulates the script file to be executed into a data frame, and transmits the data frame carrying the script file to be executed to the microcontroller of the executor through the communication interface using script transfer commands.

[0083] The executor receives and parses data frames based on communication protocol-related functions, and calls the interfaces provided by storage management-related functions to write the parsed script file to be executed into the script storage area in flash memory, thus completing the script storage update.

[0084] S230. If the value of the input register maintained in memory changes and the changed value matches the task trigger preset value, it is determined that task trigger information transmitted by the external host has been detected.

[0085] The actuator can maintain a set of input / output registers in memory that can be read and written by an external host.

[0086] An external host can write specific command values ​​to a designated input register via the communication bus.

[0087] The actuator can continuously monitor the value of the input register. If it detects a change in the value of the input register and the changed value matches the preset value for task triggering, it determines that task triggering information transmitted from the external host has been detected. The command value that matches successfully is the task triggering information.

[0088] For example, in Embodiment 1, there are multiple predefined command values ​​"1", "2", "-1", "-2", and "-3". These predefined command values ​​can be considered as task trigger preset values. If the external host writes "-1" into the register, then "-1" will be used as task trigger information.

[0089] S240. Upon detecting the task triggering information transmitted by the external host, determine the task execution information corresponding to the task triggering information, and read the target execution script file associated with the task execution information from the script storage area.

[0090] When the executor detects task trigger information, it reads the target execution script file associated with the task execution information from the script storage area into the random access memory based on the task execution information corresponding to the task trigger information, so that the target execution script file can be executed subsequently.

[0091] S250. According to the task execution strategy, the script interpreter is called to execute the target execution script file corresponding to the target execution task, and during the execution of the target execution script file, the programming language bridging function and the peripheral operation interface are called to control the action of the execution component.

[0092] The executor can execute one or more target execution tasks according to the task execution strategy. The execution process for each target execution task can be understood as follows: the microcontroller calls the script interpreter to parse the target execution script file corresponding to the target execution task; based on the parsing result, it calls the programming language bridge function; and the programming language bridge function calls the corresponding peripheral operation interface to control the actions of the execution component. The programming language bridge function can be a function that encapsulates the core service layer functionality and registers it with the script interpreter by bridging the application programming interface (API) with the programming language, and can be directly called during the execution of the target execution script file by the script interpreter.

[0093] S260. If the target execution script file is determined to be executed successfully, exit; if the target execution script file is determined to be executed unsuccessfully, continue to read and execute the alternative execution script file associated with the failed task according to the preset script, until the task execution information indicates that the task execution is completed or an error is reported and exited.

[0094] In one embodiment, the method further includes: writing the execution result information of the target execution script file into an output register, so that the external host can obtain the execution result information by reading the output register, wherein the execution result information includes execution status and execution data; wherein the execution status includes at least one of execution success, execution failure, and execution interruption.

[0095] The executor writes the execution result information of the target script file to the output register, and the external host can read the execution result information from the output register to obtain the content included in the execution result information. The execution result information includes the execution status, such as at least one of execution success, execution failure, and execution interruption. The external host can quickly determine whether the script execution meets expectations by using the execution status. The execution result information also includes execution data, which can be relevant data generated during the execution process; this is not limited here.

[0096] The technical solution of this invention clearly distinguishes between a stable underlying hardware layer and a dynamic application logic script layer. The underlying hardware is responsible for providing stable and reliable hardware control capabilities, while the upper-layer script is responsible for implementing specific and ever-changing business logic, thus improving overall stability and maintainability. Script files are packaged and transmitted through a communication interface, and then received, parsed, and stored in non-volatile memory by the executor, enabling non-firmware upgrades to device functions. Registers serve as the medium for exchanging data and commands between the external host and the executor, achieving asynchronous communication and control between them. The executor's actions are controlled through programming language bridging functions, abstracting complex underlying operations into simple script function calls, achieving precise script control of the hardware. Modifications to business logic can be achieved by generating and downloading scripts through host computer software, improving development and deployment efficiency. Furthermore, the scripting language is easier to learn and use, lowering the technical threshold.

[0097] Example 3

[0098] Figure 3 This is a schematic diagram of a control device for an electric actuator according to Embodiment 3 of the present invention. This embodiment is applicable to the control of an electric actuator. The device is configured on the electric actuator, which includes a microcontroller and an actuation component. The software architecture of the microcontroller includes a hardware driver layer, a core service layer, and a script engine and bridging layer. The hardware driver layer is used to provide a peripheral operation interface. The core service layer implements functions based on the peripheral operation interface. The script engine and bridging layer are used to provide a script interpreter and encapsulate the functions of the core service layer for script calls.

[0099] like Figure 3 As shown, the specific structure of the device includes:

[0100] The script file writing module 31 is used to obtain the script file to be executed from the external host and write it to the script storage area;

[0101] The script file reading module 32 is used to determine the task execution information corresponding to the task trigger information when the task trigger information transmitted by the external host is detected, and to read the target execution script file associated with the task execution information from the script storage area;

[0102] The first execution module 33 of the script file is used to call the script interpreter to execute the target execution script file based on the task execution information, and control the action of the execution component in conjunction with the peripheral operation interface;

[0103] The second execution module 34 of the script file is used to exit if the target execution script file is determined to be executed successfully; if the target execution script file is determined to be executed unsuccessfully, it continues to read and execute the alternative execution script files associated with the failed task according to the preset script until the task execution information indicates that the task execution is completed or an error is reported and exited.

[0104] The control device for the electric actuator provided in this embodiment obtains the script file to be executed from an external host and writes it to the script storage area through a script file writing module; when the script file reading module detects the task trigger information transmitted by the external host, it determines the task execution information corresponding to the task trigger information and reads the target execution script file associated with the task execution information from the script storage area; based on the task execution information, the first script file execution module calls the script interpreter to execute the target execution script file and controls the action of the execution component in conjunction with the peripheral operation interface; if the second script file execution module determines that the target execution script file is executed successfully, it exits; if the target execution script file is determined to have failed to execute, it continues to read and execute the alternative execution script files associated with the failed task according to a preset script until the task execution information indicates that the task execution is completed or an error is reported and exited. This solution enables different controls over the executor by sending script files and task triggering information corresponding to the business logic to the executor from an external host. It does not require modification or re-flashing of the underlying firmware, and can quickly adapt to different production needs and application scenarios, offering high flexibility. Furthermore, it can automatically perform subsequent processing based on the execution results of the script files without manual intervention, such as exiting or continuing to execute alternative execution script files associated with failed tasks, ensuring that tasks are completed as much as possible while avoiding unnecessary resource consumption.

[0105] Furthermore, the script file writing module 31 is specifically used for:

[0106] Upon receiving a script transfer request instruction from an external host, perform an erase operation in the flash memory;

[0107] Upon receiving a script transmission instruction from the external host, the script file to be executed is obtained and written to the script storage area in the flash memory.

[0108] Furthermore, the device also includes:

[0109] The detection module is used to determine that task triggering information transmitted by the external host has been detected when the value of the input register maintained in memory changes and the changed value matches the task triggering preset value.

[0110] Furthermore, the task execution information includes the target task to be executed and the task execution strategy;

[0111] The number of target execution tasks is one or more, and each target execution task corresponds to one target execution script file;

[0112] The task execution strategy indicates the execution order of the target task, or indicates the task to be executed if the target task fails.

[0113] Furthermore, the first execution module 33 of the script file is specifically used for:

[0114] According to the task execution strategy, the script interpreter is invoked to execute the target execution script file corresponding to the target execution task, and during the execution of the target execution script file, the programming language bridging function and the peripheral operation interface are invoked to control the actions of the execution component.

[0115] Furthermore, the preset script indicates alternative execution script files associated with the failed task, including other script files in the script storage area that can execute the failed task, or the execution script file corresponding to the task that should be executed after the failed task is executed as indicated by the task execution strategy.

[0116] Furthermore, the device also includes:

[0117] The writing module is used to write the execution result information of the target execution script file into the output register, so that the external host can obtain the execution result information by reading the output register. The execution result information includes execution status and execution data; wherein, the execution status includes at least one of execution success, execution failure, and execution interruption.

[0118] The control device for the electric actuator provided in the embodiments of the present invention can execute the control method for the electric actuator provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0119] Example 4

[0120] Figure 4 This is a schematic diagram of the structure of an electric actuator implementing an embodiment of the present invention. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the invention described and / or claimed herein.

[0121] like Figure 4As shown, the electric actuator 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 can also store various programs and data required for the operation of the electric actuator 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0122] Multiple components in the electric actuator 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, optical disk, etc.; and a communication unit 19, such as a network card, modem, wireless transceiver, etc. The communication unit 19 allows the electric actuator 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0123] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as the control methods for an electric actuator.

[0124] In some embodiments, the control method for the electric actuator may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electric actuator 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the control method for the electric actuator described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to perform the control method for the electric actuator by any other suitable means (e.g., by means of firmware).

[0125] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0126] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0127] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0128] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.

[0129] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.

[0130] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.

[0131] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A control method for an electric actuator, characterized in that, The method is applied to electric actuators, which include a microcontroller and an actuation component. The software architecture of the microcontroller includes a hardware driver layer, a core service layer, and a script engine and bridging layer. The hardware driver layer is used to provide peripheral operation interfaces; The core service layer implements its functions based on the peripheral operation interface; The script engine and bridging layer are used to provide a script interpreter and encapsulate the functions of the core service layer for script calls; The method includes: Retrieve the script file to be executed from the external host and write it to the script storage area; Upon detecting task triggering information transmitted by the external host, determine the task execution information corresponding to the task triggering information, and read the target execution script file associated with the task execution information from the script storage area; Based on the task execution information, the script interpreter is invoked to execute the target execution script file, and the action of the execution component is controlled in conjunction with the peripheral operation interface. If the target execution script file is determined to be executed successfully, the process exits; if the target execution script file is determined to be executed unsuccessfully, the process continues to read and execute alternative execution script files associated with the failed task according to the preset script, until the task execution information indicates that the task execution is completed or an error is reported and the process exits.

2. The method according to claim 1, characterized in that, Retrieve the script file to be executed from the external host and write it to the script storage area, including: Upon receiving a script transfer request instruction from an external host, perform an erase operation in the flash memory; Upon receiving a script transmission instruction from the external host, the script file to be executed is obtained and written to the script storage area in the flash memory.

3. The method according to claim 1, characterized in that, Also includes: If the value of the input register maintained in memory changes and the changed value matches a task trigger preset value, it is determined that task trigger information transmitted by the external host has been detected.

4. The method according to claim 1, characterized in that, The task execution information includes the target task to be executed and the task execution strategy; The number of target execution tasks is one or more, and each target execution task corresponds to one target execution script file; The task execution strategy indicates the execution order of the target task, or indicates the task to be executed if the target task fails.

5. The method according to claim 4, characterized in that, Based on the task execution information, the script interpreter is invoked to execute the target execution script file, and the actions of the execution component are controlled in conjunction with the peripheral operation interface, including: According to the task execution strategy, the script interpreter is invoked to execute the target execution script file corresponding to the target execution task, and during the execution of the target execution script file, the programming language bridging function and the peripheral operation interface are invoked to control the actions of the execution component.

6. The method according to claim 4, characterized in that, The preset script indicates the alternative execution script files associated with the failed task, including other script files in the script storage area that can execute the failed task, or the execution script file corresponding to the task that should be executed after the failed task is executed as indicated by the task execution strategy.

7. The method according to claim 1, characterized in that, Also includes: The execution result information of the target execution script file is written to the output register so that the external host can obtain the execution result information by reading the output register. The execution result information includes execution status and execution data; wherein, the execution status includes at least one of execution success, execution failure, and execution interruption.

8. A control device for an electric actuator, characterized in that, Configured in an electric actuator, the electric actuator includes a microcontroller and an actuation unit, the software architecture of the microcontroller includes a hardware driver layer, a core service layer, and a script engine and bridging layer; The hardware driver layer is used to provide peripheral operation interfaces; The core service layer implements its functions based on the peripheral operation interface; The script engine and bridging layer are used to provide a script interpreter and encapsulate the functions of the core service layer for script calls; The device includes: The script file writing module is used to obtain the script file to be executed from the external host and write it to the script storage area; The script file reading module is used to determine the task execution information corresponding to the task trigger information when the task trigger information transmitted by the external host is detected, and to read the target execution script file associated with the task execution information from the script storage area; The first execution module of the script file is used to call the script interpreter to execute the target execution script file based on the task execution information, and control the action of the execution component in conjunction with the peripheral operation interface; The second execution module of the script file is used to exit if the target execution script file is determined to be executed successfully; if the target execution script file is determined to be executed unsuccessfully, it continues to read and execute the alternative execution script files associated with the failed task according to the preset script, until the task execution information indicates that the task execution is completed or an error is reported and exited.

9. An electric actuator, characterized in that, include: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor to enable the at least one processor to perform the method as described in any one of claims 1-7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1-7.