Visual script generation method and device, equipment and medium

By selecting and connecting logic blocks through a graphical programming interface, establishing register mapping relationships, generating and transmitting script files to the target control device, the problem of high technical barriers in existing technologies is solved, and low-barrier, efficient program logic adjustment is achieved.

CN121807274APending Publication Date: 2026-04-07SUZHOU 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-04-07

AI Technical Summary

Technical Problem

In existing technologies, adjusting the program logic of industrial automation and intelligent robot control equipment requires professional embedded software engineers to modify the source code and recompile the firmware, which has a high technical threshold and low development efficiency.

Method used

By selecting and connecting logic blocks through a graphical programming interface, establishing register mapping relationships, generating script files, and transmitting them to the target control device for execution, the program logic can be adjusted.

Benefits of technology

It lowers the technical threshold, improves development efficiency, and enables non-professionals to adjust the program logic of intelligent control devices through graphical programming.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121807274A_ABST
    Figure CN121807274A_ABST
Patent Text Reader

Abstract

The invention discloses a visual script generation method and device, equipment and a medium. The method is applied to an upper computer, and comprises a presentation layer responding to visual operation, a business logic layer responding to presentation layer operation to realize business logic processing, a data access layer and a hardware communication layer. In response to a task configuration operation in the graphical programming interface, selecting a target logic block from to-be-added logic blocks matched with the target control equipment for configuration and connection, and establishing a to-be-executed task; in response to a register mapping operation in the register mapping configuration interface, establishing a mapping relationship between a register address of target control equipment in the register mapping configuration interface and a target logic block; and generating a to-be-executed script file of the target control device based on the to-be-executed task and the mapping relationship, so as to transmit the to-be-executed script file to the target control device for execution. Script generation is achieved through graphical programming, equipment control is achieved through scripts, the technical threshold is low, and the development efficiency is high.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of automatic control technology, and in particular to a method, apparatus, device and medium for generating visual scripts. Background Technology

[0002] Control of industrial automation, intelligent robots, and various intelligent control devices is typically achieved through fixed program logic. When adjustments to the program logic are needed, specialized embedded software engineers must modify the source code, recompile the firmware, and then flash it into the intelligent control device. The drawback of this technology is its strong reliance on the expertise of embedded software engineers, high technical threshold, and low development efficiency. Summary of the Invention

[0003] This invention provides a visual script generation method, apparatus, device, and medium, which can generate scripts through graphical programming, enabling the adjustment of program logic for intelligent control devices via scripts. It has low technical barriers and high development efficiency.

[0004] In a first aspect, embodiments of the present invention provide a visualization script generation method applied to a host computer. The software architecture of the host computer includes a presentation layer, a business logic layer, a data access layer, and a hardware communication layer. The presentation layer is used to respond to visualization operations. The business logic layer is used to respond to operations in the presentation layer to implement the business logic processing required for script generation. The data access layer is used to provide a data operation interface for the business logic layer. The hardware communication layer is used to implement communication with a target control device. The method includes:

[0005] In response to the task configuration operation in the graphical programming interface, a target logic block is selected from the logic blocks to be added, configured and connected, and a task to be executed is established. The logic blocks to be added are the logic blocks displayed in the graphical programming interface that match the target control device.

[0006] In response to the register mapping operation in the register mapping configuration interface, establish the mapping relationship between the register address of the target control device and the target logic block in the register mapping configuration interface;

[0007] Based on the task to be executed and the mapping relationship, an executable script file for the target control device is generated, and the executable script file is transmitted to the target control device for execution.

[0008] Secondly, embodiments of the present invention provide a visual script generation device configured on a host computer. The software architecture of the host computer includes a presentation layer, a business logic layer, a data access layer, and a hardware communication layer. The presentation layer is used to respond to visual operations. The business logic layer is used to respond to operations in the presentation layer to implement the business logic processing required for script generation. The data access layer is used to provide a data operation interface for the business logic layer. The hardware communication layer is used to implement communication with a target control device. The device includes:

[0009] The task configuration module is used to respond to the task configuration operation in the graphical programming interface, select the target logic block from the logic blocks to be added, configure and connect it, and establish the task to be executed. The logic blocks to be added are the logic blocks displayed in the graphical programming interface that match the target control device.

[0010] The register mapping module is used to respond to the register mapping operation in the register mapping configuration interface and establish the mapping relationship between the register address of the target control device and the target logic block in the register mapping configuration interface.

[0011] The script generation module is used to generate an executable script file for the target control device based on the task to be executed and the mapping relationship, so as to transmit the executable script file to the target control device for execution.

[0012] Thirdly, embodiments of the present invention provide an electronic device, including:

[0013] At least one processor; and

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

[0015] 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.

[0016] 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.

[0017] The technical solution of this invention, in response to task configuration operations in a graphical programming interface, selects, configures, and connects logic blocks matching the target control device to establish a task to be executed; in response to register mapping operations in a register mapping configuration interface, it establishes a mapping relationship between the register addresses of the target control device and the target logic blocks; based on the task to be executed and the mapping relationship, it generates an executable script file for the target control device, which is then transmitted to the target control device for execution. This solution enables script file generation through graphical programming, and the generated script file is used to transmit to the target control device for execution. The script file allows for adjustments to the program logic of the target control device, resulting in low technical barriers and high development efficiency.

[0018] 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

[0019] 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.

[0020] Figure 1 This is a flowchart of a visual script generation method provided in Embodiment 1 of the present invention;

[0021] Figure 2 This is a schematic diagram of a host computer software architecture provided according to Embodiment 1 of the present invention;

[0022] Figure 3 This is a flowchart of a task instance of a task to be executed according to Embodiment 1 of the present invention;

[0023] Figure 4 This is a flowchart of another task instance of a task to be executed according to Embodiment 1 of the present invention;

[0024] Figure 5 This is a schematic diagram of a register mapping configuration interface provided according to Embodiment 1 of the present invention;

[0025] Figure 6 This is a flowchart of a device control method provided according to Embodiment 2 of the present invention;

[0026] Figure 7 This is a schematic diagram of the structure of a visual script generation device according to Embodiment 3 of the present invention;

[0027] Figure 8 This is a schematic diagram of the structure of an electronic device that implements an embodiment of the present invention. Detailed Implementation

[0028] 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.

[0029] 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.

[0030] Example 1

[0031] Figure 1 This is a flowchart of a visual script generation method according to Embodiment 1 of the present invention. This embodiment is applicable to situations involving visual script generation. The method can be executed by a visual script generation device, which can be implemented in software and / or hardware and integrated into a host computer. Figure 1 As shown, the method includes S110-S130.

[0032] In this embodiment of the invention, the software architecture of the host computer includes a presentation layer, a business logic layer, a data access layer, and a hardware communication layer; the presentation layer is used to respond to visual operations; the business logic layer is used to respond to the business logic processing required for script generation in response to operations in the presentation layer; the data access layer is used to provide data operation interfaces for the business logic layer; and the hardware communication layer is used to implement communication with the target control device.

[0033] Figure 2This is a schematic diagram of a host computer software architecture according to Embodiment 1 of the present invention. The presentation layer provides a graphical user interface (GUI), responds to user operations, and passes operation-related requests to the business logic layer; it also subscribes to data update notifications from the business logic layer and displays the data on the visualization interface. The presentation layer may contain all windows, dialog boxes, and controls, such as the project manager, register mapping, communication settings, and the main canvas.

[0034] The business logic layer handles the business logic processing required for script generation in the presentation layer, implementing the core functionality of the software and processing all business rules and calculations. It consists of a series of highly cohesive, loosely coupled services, such as engineering services, device configuration services, task configuration services, register mapping services, graphical programming services, compilation services, and oscilloscope services. This service-oriented approach allows each core function to be developed, tested, and maintained independently, significantly improving software quality and scalability.

[0035] The data access layer encapsulates access to the data source, providing a data operation interface for the business logic layer. It isolates the business logic layer from the physical file system. The business logic layer requests file operations from the project file reader / writer in the data access layer. The project file reader / writer receives the request and converts it into specific operation instructions. Combined with file serialization / deserialization format conversion in the data access layer, it achieves interaction with the file system. The business logic layer does not need to know how files are stored; these details are handled internally by the data access layer. This means that if the storage format needs to be changed in the future, only this layer needs to be modified.

[0036] The hardware communication layer is responsible for communicating with external hardware, such as the target control device, providing serial port drivers, protocol processors, and communication services. The hardware communication layer converts the high-level instructions from the services involved in the upper-layer business logic layer into raw data frames conforming to a specific communication protocol and sends them out through the physical port. It is also responsible for receiving data, verifying and parsing the received data, and then notifying the upper layer. This allows the services in the business logic layer to complete their tasks simply by calling these high-level interfaces, without needing to concern themselves with the specific implementation of serial communication. The target control device can be an electric actuator, such as a mechanical gripper; this is not limited here.

[0037] Based on the above-described host computer software architecture, the visualization script generation method provided in this embodiment of the invention is described as follows:

[0038] S110. In response to the task configuration operation in the graphical programming interface, select the target logic block from the logic blocks to be added, configure and connect it, and establish the task to be executed. The logic block to be added is the logic block displayed in the graphical programming interface that matches the target control device.

[0039] A graphical programming interface is an interface used to implement graphical programming. It provides a programming environment with graphical elements at its core, eliminating the need to write traditional text code. Program design can be completed by dragging, connecting, and configuring visual components.

[0040] The logic block to be added is the logic block displayed in the graphical programming interface that matches the target control device. When the graphical programming interface is displayed, the host computer can communicate with the target control device to obtain its serial number (SN), and display the logic block that matches the target control device based on the obtained serial number—that is, the logic block available for programming the target control device. The host computer can also respond to the input operation of the device identification code in the graphical programming interface, determine the device identification code of the target control device, and display the logic block that matches the target control device based on the determined device identification code. The device identification code can consist of information such as device series, specifications, and version. Among these, the logic block is the core functional component in graphical programming, referring to a visual unit that encapsulates specific logic processing rules.

[0041] The target logic block is selected from the logic blocks to be added displayed in the graphical programming interface, and is used to create the task to be executed. The task to be executed is the task to be performed by the target controlled device.

[0042] In one embodiment, the category of the logic block to be added includes at least one of the following: motion control, motor control, logic processing, mathematical calculation, and storage resource; the connection between the target logic blocks is implemented based on the flow of logic.

[0043] The motion control class may include, but is not limited to, logic blocks for acquiring / setting the status of the motion control module of the target control device, logic blocks for acquiring motion judgment thresholds, and logic blocks for setting / acquiring motion positions. The motion control module of the target control device, such as the gripping or rotating module of a mechanical gripper, is not limited here.

[0044] Motor control logic may include, but is not limited to, logic blocks for acquiring / setting operating parameters, logic blocks for setting motor control commands, and logic blocks for setting motor positions.

[0045] Logic processing classes may include, but are not limited to, logic blocks for conditional judgment, logic blocks for variable definition, and logic blocks for process jumps.

[0046] Mathematical calculation classes may include, but are not limited to, logic blocks used for taking absolute values.

[0047] Storage resource classes may include, but are not limited to, logical blocks for register operations and logical blocks for internal flash memory operations.

[0048] The connection between target logic blocks is based on the flow of logic. It can be understood that the connection between target logic blocks is not an arbitrary splicing, but follows the order of program execution logic, conditional branches or loop relationships. The essence of the connection is to define the flow path of logic, telling the program which logic to execute first, which logic to execute next, and what conditions to meet before executing the next logic, etc.

[0049] In this step, responding to the task configuration operation in the graphical programming interface, the target logic block is selected from the logic blocks to be added displayed in the graphical programming interface (i.e., selection operation). The target logic block is then dragged and dropped into the task configuration area of ​​the graphical programming interface (i.e., drag and drop operation). The execution parameters required by the target logic block are configured in this area (i.e., parameter configuration operation). Finally, the configured target logic blocks are connected according to the task execution logic (i.e., connection operation). The combination of connected target logic blocks can be understood as the task to be executed. The task configuration operation can be any operation that configures the task to be executed, and may include selection, drag and drop, parameter configuration, and connection operations of logic blocks; it is not limited here.

[0050] Figure 3 This is a flowchart of a task instance of a task to be executed according to Embodiment 1 of the present invention. The task is an enable (initialization) task, and the execution logic is as follows: The process begins; initialization operation is performed; it is determined whether the motor is enabled. If so, speed mode configuration is performed, i.e., the motor is set to speed mode, the current is 75%, and the forward speed is 20%. Otherwise, the motor is enabled before speed mode configuration is performed; forward blocking judgment is performed, i.e., it is determined whether "speed ≤ blocking speed?" and "blocking time ≥ time threshold?". If so, the maximum position is recorded and the motor is set to 20% reverse speed. Otherwise, the judgment continues; reverse blocking judgment is performed, i.e., it is determined whether "speed ≤ blocking speed?" and "blocking time ≥ time threshold?". If so, the minimum position is recorded and the motor mode is switched to position mode. Otherwise, the judgment continues; state setting is performed, i.e., the state is set to "idle, action completed"; the process ends. This is a process of "finding the stroke" or "returning to zero". The gripper first moves in one direction until it stalls (encounters a mechanical limit switch) and records this position (i.e., the maximum position); then it moves in the opposite direction until it stalls again and records another position (i.e., the minimum position). In this way, the gripper knows its complete range of motion.

[0051] Figure 4This is a flowchart of another task instance to be executed according to Embodiment 1 of the present invention. The task is a gripper opening task, and the execution logic is as follows: The process begins; position mode configuration is performed, that is, the motor is set to position mode, configured with maximum current and maximum speed, and the target position is set to a preset opening position; the status is set to "running, action in progress"; position deviation judgment is performed, that is, whether "target position - current position ≤ position threshold" is true. If yes, the action status is set to "execution completed", the module status is set to "idle", and the process ends; otherwise, the speed and blocking time judgment is entered, that is, whether "speed ≤ blocking speed?" and "blocking time ≥ time threshold?" are true. If yes, the action status is set to "action blocked" and the module status is set to "idle", and the process ends; otherwise, the process returns to the position deviation judgment and continues execution. This task can be understood as follows: after initialization, the gripper moves to a preset opening position. During the movement, it continuously detects whether it has reached the target position or whether it has blocked prematurely due to encountering an obstacle.

[0052] S120. In response to the register mapping operation in the register mapping configuration interface, establish the mapping relationship between the register address of the target control device and the target logic block in the register mapping configuration interface.

[0053] The register mapping configuration interface is used to configure register mapping, which associates the task to be executed with the registers of the target control device. Optionally, the register mapping configuration interface can be displayed in response to triggering the register mapping control in the main operation interface, which is the main interface for generating visual scripts.

[0054] The register address of the target control device may include the addresses of its input registers and output registers, and is not limited here. In one embodiment, the register address of the target control device is a virtual address, which is used to associate with the actual variable physical address of the target control device. Flexible mapping between virtual and physical addresses can be achieved. By mapping the values ​​corresponding to logical blocks of fixed virtual addresses, they can be synchronously mapped to their corresponding physical addresses located in different positions. As long as the logical points mapped by the virtual address (the rewritable values ​​in the logical block) remain unchanged, even if the mapped physical address changes, there is no need to update the target address routing table, reducing software complexity. It is also easy to operate.

[0055] It is understandable that a virtual address can serve as a fixed logical identifier, which is associated with the physical address of the target control device through a dynamic mapping mechanism. This physical address can be flexibly changed according to the device status, configuration, or requirements, thereby decoupling the control logic from the hardware physical address.

[0056] The target logic block is the logic block selected in S110 to establish the task to be executed, which may include, but is not limited to: logic blocks that can be mapped to the address of the input register, such as enable current, enable speed, turn-on current, turn-on speed, turn-on current, and turn-on speed; and logic blocks that can be mapped to the address of the output register, such as module status, action status, and error code.

[0057] In response to register mapping operations in the register mapping configuration interface, the addresses of the input registers of the target control device in the register mapping configuration interface are mapped and connected to the corresponding target logic blocks, and the addresses of the output registers of the target control device in the register mapping configuration interface are mapped and connected to the corresponding target logic blocks, thus establishing a mapping relationship between register addresses and target logic blocks. The register mapping operation is the operation that establishes the mapping relationship between register addresses and target logic blocks; specifically, it can be a join operation.

[0058] Figure 5 This is a schematic diagram of a register mapping configuration interface provided according to Embodiment 1 of the present invention. Figure 5 As shown, the interface is divided into input register mapping and output register mapping. Each mapping contains two parts: the register address on the left and the target logic block on the right (listing all mappable items in a tree structure). Users select a target logic point (a sub-item of the target logic block, such as an instruction source) from the right, and then select the register address they wish to bind to from the left, dragging and dropping to associate it. This interface allows users to clearly view all established mapping relationships and modify or delete them. It should be noted that in this interface, the enable instruction value -1 controls the enable current and enable speed, the open instruction value -2 controls the open current and open speed, and the close instruction value -3 controls the close current and close speed.

[0059] S130. Based on the task to be executed and the mapping relationship, generate the script file to be executed for the target control device, and transmit the script file to be executed to the target control device for execution.

[0060] In this step, based on the tasks to be executed and the mapping relationship, compilation and packaging are performed to obtain a binary firmware file that the microcontroller of the target control device can recognize and execute, i.e., the script file to be executed, which is then saved locally. The script file to be executed can be transmitted to the target control device, which receives it, parses it, and executes the task corresponding to the script file.

[0061] In one embodiment, the script file to be executed is generated and downloaded to the local machine via a trigger operation to download engineering controls in the main operation interface; the script file to be executed is transmitted to the target control device via a trigger operation to upload engineering controls in the main operation interface.

[0062] In response to the download of project controls triggered by the main operation interface, the system generates an executable script file and saves it in the local project directory based on the previously configured tasks and mapping relationships. In response to the upload of project controls triggered by the main operation interface, the executable script file is transmitted to the microcontroller of the target control device via the configured communication link.

[0063] It should be noted that the above content involves the following services in the business logic layer:

[0064] Task configuration service: manages the data structure of tasks, calls the graphical programming engine to process the logical flow of tasks, and calls the register mapping service to associate the interface between tasks and hardware;

[0065] Register mapping service: Maintains a global and unique mapping table, provides interface services for adding and deleting mappings, and ensures the correctness and uniqueness of the connection between software logic blocks and register addresses;

[0066] Graphical programming engine (i.e., graphical programming service): Parses the user's graphical operations on the canvas (such as dragging and connecting lines), converts them into internal executable logical data structures, and provides this structured information to the compilation service;

[0067] Compilation service: Collects all configuration information from other core services, compiles and packages it into a binary firmware file that the microcontroller can recognize and execute, and saves it locally; it also responds to upload commands and hands the file over to the communication service in the hardware communication layer for processing;

[0068] Engineering Services: Responsible for handling all logic related to the lifecycle of project files, including creation, parsing, and saving.

[0069] The technical solution of this invention, in response to task configuration operations in a graphical programming interface, selects, configures, and connects logic blocks matching the target control device to establish a task to be executed; in response to register mapping operations in a register mapping configuration interface, it establishes a mapping relationship between the register addresses of the target control device and the target logic blocks; based on the task to be executed and the mapping relationship, it generates an executable script file for the target control device, which is then transmitted to the target control device for execution. This solution enables script file generation through graphical programming, and the generated script file is used to transmit to the target control device for execution. The script file allows for adjustments to the program logic of the target control device, resulting in low technical barriers and high development efficiency.

[0070] It should be noted that the following configuration is required before displaying the graphical programming interface:

[0071] In one embodiment, the method further includes:

[0072] In response to the triggering operation of the communication settings control in the main operation interface, the serial port configuration interface is displayed;

[0073] In response to the serial port configuration operation in the serial port configuration interface, the serial port information is configured, and the target control device is connected based on the serial port information.

[0074] First, a communication connection is established between the host computer and the target control device. Responding to the triggering operation of the communication setting controls in the main operation interface, a serial port configuration interface can be displayed as a pop-up window. This interface includes drop-down selection boxes for serial port selection, drop-down configuration boxes for baud rate configuration, and a control to open the serial port. Responding to serial port configuration operations in the interface—selecting the serial port from the drop-down selection box, configuring the baud rate from the drop-down configuration box, and triggering the open serial port control—the serial port information is confirmed: the selected serial port, the configured baud rate, and the connection to the target control device is established based on this information. When the host computer is connected to the target control device, it automatically reads information such as the target control device's serial number (SN) for subsequent processing.

[0075] This section covers the initialization of communication services. Communication services encapsulate all the low-level details of communicating with hardware and are responsible for implementing specific communication protocols to handle data packaging, sending, receiving, verification, and unpacking.

[0076] In one embodiment, the method further includes:

[0077] In response to the triggering operation of the new project control in the main operation interface, the device configuration interface is displayed;

[0078] In response to the device configuration operation in the device configuration interface, configure and save the device information and register address information of the target control device, and create a new project file.

[0079] Once the communication connection is successful, a new project can be created. Responding to the triggering operation of the "Create New Project" control in the main operation interface, a device configuration interface can be displayed as a pop-up window. The serial port configuration interface includes input boxes for configuring device information and register address information. Device information includes the device name and model; register address information includes the starting address and number of input registers and the starting address and number of output registers; and a save control is also included. Responding to device configuration operations in the device configuration interface—that is, entering device information and register address information in the aforementioned input boxes, or clicking the save control—a new project file is created based on the entered information.

[0080] Among them, project files can be files that are persistently stored on disk in a specific format, used to completely record all the work done by the user in a project, including device configuration, module parameters, task logic and register mapping relationships, etc.

[0081] In one embodiment, the method further includes:

[0082] Once the project file is created, in response to the trigger operation of adding controls to the module in the device tree corresponding to the target control device, an action control module is added to the device tree, and the module configuration interface is displayed. The device tree is used to display projects, devices, modules, and tasks in a hierarchical structure.

[0083] In response to the module configuration operation in the module configuration interface, configure the basic parameters and motor parameters of the motion control module;

[0084] In response to the task addition operation under the action control module, the graphical programming interface is displayed.

[0085] Once the project files are created, add modules for the device. Responding to the trigger operation of the module addition control in the device tree corresponding to the target controlled device—that is, clicking the module addition control in the device tree—adds an action control module, such as a clamping module, and displays the module configuration interface in a pop-up window.

[0086] The module configuration interface includes input boxes for configuring basic parameters and motor parameters for the motion control module. Basic parameters include module name, resistance judgment time, resistance judgment speed, end-point judgment threshold, default stroke, overvoltage judgment threshold, undervoltage judgment threshold, and overtemperature judgment threshold. Motor parameters include number of pole pairs, phase resistance, phase inductance, maximum operating current, minimum operating current, maximum operating speed, minimum operating speed, rated voltage, and reduction ratio. A save control is also included. Response to module configuration operations in the module configuration interface—namely, entering basic parameters and motor parameters in the input boxes and clicking the save control—configures the basic parameters and motor parameters for the motion control module.

[0087] In response to the task addition operation under the action control module, such as clicking "Add Task" and double-clicking the task (e.g., the task to be executed) under the action control module, the main window canvas switches to the graphical programming interface of the task to be executed, so as to further execute the operations of S110-S130 mentioned above.

[0088] This section covers the device configuration service, which is responsible for managing the data models of devices and their subordinate modules, handling the logic of adding, deleting, and modifying devices / modules, and verifying the validity of their parameters (such as motor parameters).

[0089] It should be noted that the oscilloscope service can also handle online monitoring and debugging logic. The oscilloscope service periodically sends instructions to the communication service to request the reading of register values, processes the acquired data, and provides it to the monitoring panel and charts on the user interface for display.

[0090] In one embodiment, the method further includes:

[0091] The display shows an oscilloscope interface that displays data read from the mapped registers of the target control device in real time.

[0092] The oscilloscope interface can be a separate window that displays data read from the mapped registers of the target control device in real time. When the target control device moves, the real-time changes in values ​​can be observed through the oscilloscope interface. The mapped registers are those that have established a mapping relationship with the host computer.

[0093] In one embodiment, the method further includes:

[0094] In response to a mode switching operation in the graphical programming interface, switch to debug mode to modify the value of the output register of the target control device through the debug mode.

[0095] In response to mode switching operations in the graphical programming interface, such as clicking the mode switching control, the system switches to debug mode. In debug mode, the value of the output register can be manually modified, and then the task can be run to perform step-by-step debugging.

[0096] Example 2

[0097] Figure 6 This is a flowchart of a device control method according to Embodiment 2 of the present invention. This embodiment is applicable to situations where device control is implemented based on scripts. This method can be executed by a device control device, which can be implemented in software and / or hardware and integrated into the target control device. Figure 6 As shown, the method includes S610-S630.

[0098] In this embodiment of the invention, the target control device 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 device control-related 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.

[0099] 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 device control, and there are no restrictions here.

[0100] 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 device control-related functions, which are used to implement precise control of device actions.

[0101] 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.

[0102] Based on the above software architecture, the device control method provided in the embodiments of the present invention will be described as follows:

[0103] S610. Obtain the script file to be executed from the host computer and write it into the script storage area. The script file to be executed is generated by the visual script generation method.

[0104] In practical applications, when the host computer generates an executable script file using a visual script generation method, it can encapsulate the executable script file into a data frame and transmit the encapsulated data frame to the target control device through an agreed communication protocol, such as a serial communication protocol.

[0105] The target control device receives data frames transmitted from the host computer via the aforementioned communication protocol, parses the data frames to obtain the script file to be executed, and writes the script file to be executed into the script storage area. In this way, the script file to be executed in the host computer can be sent to the target control device and stored.

[0106] It should be noted that the script file to be executed sent from the host computer to the target control device can be initially stored when the script file does not yet exist in the target control device, or it can be a newly added script file stored when some script files already exist in the target control device. The script storage area within the target control device is not limited; it can be a storage area in the internal flash memory.

[0107] S620. When it is detected that the host computer writes a target task identifier into the input register of the target control device, the task execution information corresponding to the target task identifier is determined, and the target execution script file associated with the task execution information is read from the script storage area.

[0108] The target control device can maintain a set of input / output registers in memory that can be read and written by the host computer. The host computer can write specific command values, i.e., write the target task identifier, to a designated input register via the communication bus.

[0109] The target control device can continuously monitor the value of the input register. If a change in the input register value is detected, and the changed value matches the task trigger preset value, the detected value is identified as the target task identifier written by the host computer. The task trigger preset value can be considered as multiple predefined command values, with different command values ​​corresponding to different tasks to be triggered.

[0110] Upon detecting a target task identifier, the task execution information corresponding to the target task identifier is determined. This task execution information can be the content to be executed triggered by the command value corresponding to the target task identifier. Once the task execution information is determined, the target execution script file associated with the task execution information is read from the script storage area.

[0111] Optionally, 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.

[0112] Here, a target execution task can be understood as a task to be executed triggered by a command value corresponding to a target task identifier. For example, a command value of "1" triggers the execution of task 1; or a command value of "-1" triggers the execution of multiple predefined tasks. 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, and the association method is not limited.

[0113] 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.

[0114] S630. Based on the task execution information, the script interpreter is invoked to execute the target execution script file, and the target control device is controlled to perform actions in conjunction with the peripheral operation interface.

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

[0116] In this step, the target control device 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: the script interpreter is invoked to parse the target execution script file corresponding to the task, and the programming language bridging function is invoked according to the parsed business logic. The programming language bridging function then calls the corresponding peripheral operation interface to control the actions of the target control device's execution components. The programming language bridging 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 a programming language. This function can be directly invoked during the execution of the target execution script file by the script interpreter.

[0117] The technical solution of this invention separates the business logic from the firmware into an independent script file. Different controls on the target control device can be achieved by sending the script file and the target task identifier to the target control device through the host computer. There is no need to modify and re-burn the underlying firmware. It can quickly adapt to different production needs and application scenarios and has high flexibility.

[0118] The following is a more detailed explanation of the above content:

[0119] The target control device, from the underlying hardware to the high-level application logic, specifically includes:

[0120] Application logic layer (dynamic / configurable): Specific business processes, action sequences, and process parameters are defined through one or more script files. These scripts are not part of the firmware but are stored as independent files in the script storage area, and can be remotely updated and replaced by the host computer at any time. The advantage of this setup is that it achieves "one machine, multiple uses," allowing the same hardware to adapt to different tasks through different scripts.

[0121] Script Engine and Bridge Layer: Provides a script interpreter responsible for parsing and executing script instructions line by line; also provides a programming language bridge application programming interface, which encapsulates the complex underlying hardware operations into simple and safe function interfaces for script calls, serving as a bridge connecting the upper-layer logic and the underlying platform.

[0122] Core Service Layer: Provides a cooperative task scheduler, which acts as the system's "heartbeat," periodically calling other tasks that require polling execution, such as message processing and motor status updates, based on the system's heartbeat clock; a communication protocol stack, responsible for parsing all incoming messages and performing read / write operations on the input / output register pool, providing standard and reliable external communication capabilities; a register pool, serving as the data exchange center for communication between the host computer and the target control device; and a storage manager, responsible for the persistent storage of script files.

[0123] Hardware driver layer: Implements motor control, including the implementation of some motor control algorithms, and is responsible for the actual motion control of the motor; Hardware abstraction interface: Used to shield the differences in the underlying hardware and provide a unified peripheral operation interface for the upper layer; System clock: Used to provide a precise time base for the task scheduler and delay functions.

[0124] The physical hardware layer is the physical foundation of systems such as microcontrollers, communication transceiver chips, flash memory, and motor drivers, and is the carrier for all software to run.

[0125] The target control device receives and executes the script file transmitted from the host computer. The specific process is as follows:

[0126] I. Initialization and Preparation

[0127] 1. System power-on and peripheral initialization:

[0128] After the target control device is powered on, it first initializes basic peripherals such as the microcontroller clock, general-purpose input / output interfaces, and direct memory access. At the same time, it initializes the system timer as the system's time base.

[0129] 2. Core service initialization:

[0130] Initialize the communication protocol stack, and configure the slave address and communication baud rate;

[0131] Initialize the task scheduler, register functions that need to be executed periodically (such as motor status monitoring functions) into the task list, and set their execution cycle;

[0132] Initialize the storage manager and check the validity of the script storage area.

[0133] 3. Script engine initialization:

[0134] Create a script interpreter instance and register all programming language bridging functions into the script interpreter environment.

[0135] 4. Enter the main loop:

[0136] After the system completes initialization, it enters an infinite main loop. Within this loop, the task scheduler's task list execution function will be called periodically.

[0137] Optionally, when the target control device is powered on, an initialization operation is performed, which includes at least peripheral initialization, core service initialization, and script engine initialization. After the initialization operation is completed, the main loop is entered, in which the execution function of the task scheduler is periodically called. The task scheduler is used to manage the execution order and timing of tasks related to device control.

[0138] II. Project Document Download Process (Execute as needed)

[0139] 1. The host computer sends a custom function code command to the target control device to start downloading the script, using the agreed communication protocol.

[0140] 2. The target control device receives and parses the instruction based on the agreed communication protocol, calls the storage manager to perform an erase operation in the flash memory, and prepares to store the data transmitted from the host computer.

[0141] 3. The host computer divides the script file to be executed into packets and sends them to the target control device one packet at a time by writing instructions to multiple registers (or custom function codes).

[0142] 4. After receiving the data packet, the target control device writes its contents sequentially into the script storage area in the flash memory to complete the remote and dynamic update of the script.

[0143] III. Task Triggering and Execution

[0144] 1. Task Triggered:

[0145] According to the production cycle, the host computer writes a specific task identifier, namely the target task identifier, into the agreed input register in the target control device by writing a single register or multiple registers.

[0146] 2. Instruction processing:

[0147] When the message processing function of the target control device is called by the task scheduler, it processes the received data and writes the target task identifier indicated by the data into the register data pool in memory.

[0148] 3. Trigger recognition and script loading:

[0149] If a high-frequency monitoring task (or main loop) in the system detects a change in the value of the input register, and the changed value matches the task trigger preset value, the detected value will be determined as the target task identifier written by the host computer.

[0150] Based on the target task identifier, the system locates the corresponding target execution script file in the script storage area and reads the target execution script file from the script storage area into the random access memory buffer.

[0151] 4. Script execution and hardware control:

[0152] The system calls the script interpreter to execute the target executable script file in the random access memory buffer according to the task execution strategy. During execution, the target executable script file calls programming language bridging functions according to business logic. For example, it calls the opening / closing degree setting function to set the target opening / closing degree of the gripper, and calls the motor start function to start the motor. Within the loop, it can also call the action status judgment function to determine whether the action is completed, obstructed, or has encountered an error.

[0153] 5. Results Feedback and Process End:

[0154] After the script execution is complete, the output register value setting function can be called to write the task execution result (such as success or failure codes, actual clamping width, etc.) to the output register. The host computer can read the value of the output register using a register read command to obtain the task execution result, complete a closed-loop control process, and the system returns to the waiting-to-trigger state. Optionally, the execution result information of the target execution script file can be written to the output register so that the host computer can obtain the execution result information by reading the output register.

[0155] Example 3

[0156] Figure 7 This is a schematic diagram of a visualization script generation device according to Embodiment 3 of the present invention. This embodiment is applicable to the implementation of visualization script generation. The device is configured on a host computer. The software architecture of the host computer includes a presentation layer, a business logic layer, a data access layer, and a hardware communication layer. The presentation layer is used to respond to visualization operations. The business logic layer is used to respond to the operations in the presentation layer to implement the business logic processing required for script generation. The data access layer is used to provide a data operation interface for the business logic layer. The hardware communication layer is used to implement communication with the target control device.

[0157] like Figure 7 As shown, the specific structure of the device includes:

[0158] The task configuration module 71 is used to respond to the task configuration operation in the graphical programming interface, select the target logic block from the logic blocks to be added, configure and connect it, and establish the task to be executed. The logic block to be added is the logic block displayed in the graphical programming interface that matches the target control device.

[0159] Register mapping module 72 is used to respond to register mapping operations in the register mapping configuration interface and establish a mapping relationship between the register address of the target control device and the target logic block in the register mapping configuration interface.

[0160] The script generation module 73 is used to generate an executable script file for the target control device based on the task to be executed and the mapping relationship, so as to transmit the executable script file to the target control device for execution.

[0161] The visual script generation device provided in this embodiment responds to task configuration operations in the graphical programming interface through a task configuration module. It selects and connects target logic blocks from the logic blocks to be added, establishing a task to be executed. The logic blocks to be added are those displayed in the graphical programming interface that match the target control device. The register mapping module responds to register mapping operations in the register mapping configuration interface, establishing a mapping relationship between the register addresses of the target control device and the target logic blocks. Based on the task to be executed and the mapping relationship, the script generation module generates an executable script file for the target control device, which is then transmitted to the target control device for execution. This solution achieves script file generation through graphical programming, and the generated script file is used for transmission to the target control device for execution. The script file enables adjustments to the program logic of the target control device, resulting in low technical barriers and high development efficiency.

[0162] Furthermore, the categories of the logic blocks to be added include at least one of the following: motion control, motor control, logic processing, mathematical calculation, and storage resource; the connection between the target logic blocks is implemented based on the flow of logic.

[0163] Furthermore, the device also includes:

[0164] The first control triggering module is used to respond to the triggering operation of the communication setting control in the main operation interface and display the serial port configuration interface;

[0165] The serial port configuration module is used to respond to the serial port configuration operation in the serial port configuration interface, configure serial port information, and connect to the target control device based on the serial port information.

[0166] Furthermore, the device also includes:

[0167] The second control triggering module is used to respond to the triggering operation of the newly created project control in the main operation interface and display the device configuration interface;

[0168] The device configuration module is used to respond to the device configuration operation in the device configuration interface, configure and save the device information and register address information of the target control device, and create a new project file.

[0169] Furthermore, the device also includes:

[0170] The third control trigger module is used to add an action control module to the device tree corresponding to the target control device in response to the trigger operation of adding a control when the project file is created. The device tree is used to display the project, device, module and task in a hierarchical structure.

[0171] The module configuration module is used to configure the basic parameters and motor parameters of the motion control module in response to the module configuration operation in the module configuration interface.

[0172] The programming interface display module is used to display the graphical programming interface in response to the task addition operation under the action control module.

[0173] Furthermore, the script file to be executed is generated and downloaded to the local machine through the trigger operation of downloading the project control in the main operation interface;

[0174] The script file to be executed is transmitted to the target control device through the trigger operation of the uploaded engineering control in the main operation interface.

[0175] Furthermore, the device also includes:

[0176] An oscilloscope interface display module is used to display an oscilloscope interface, which displays data read from the mapped registers of the target control device in real time.

[0177] Furthermore, the device also includes:

[0178] The debugging module is used to switch to debug mode in response to a mode switching operation in the graphical programming interface, so as to modify the value of the output register of the target control device through the debug mode.

[0179] Furthermore, the register address of the target control device is a virtual address, which is used to associate with the real, variable physical address of the target control device.

[0180] The visual script generation device provided in this embodiment of the invention can execute the visual script generation method provided in this embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0181] Example 4

[0182] Figure 8This is a schematic diagram of the structure of an electronic device implementing embodiments of the present invention. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.

[0183] like Figure 8 As shown, the electronic device 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 performs various appropriate actions and processes based on the computer programs stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 may also store various programs and data required for the operation of the electronic device 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.

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

[0185] 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 visualization script generation methods.

[0186] In some embodiments, the visualization script generation method 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 electronic device 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 visualization script generation method described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to execute the visualization script generation method by any other suitable means (e.g., by means of firmware).

[0187] 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.

[0188] 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.

[0189] 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.

[0190] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0191] 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.

[0192] 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.

[0193] 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.

[0194] 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 method for generating visual scripts, characterized in that, Applied to a host computer, the software architecture of the host computer includes a presentation layer, a business logic layer, a data access layer, and a hardware communication layer; the presentation layer is used to respond to visual operations; the business logic layer is used to respond to the operations in the presentation layer to implement the business logic processing required for script generation; The data access layer is used to provide data operation interfaces for the business logic layer; The hardware communication layer is used to enable communication with the target control device; the method includes: In response to the task configuration operation in the graphical programming interface, a target logic block is selected from the logic blocks to be added, configured and connected, and a task to be executed is established. The logic blocks to be added are the logic blocks displayed in the graphical programming interface that match the target control device. In response to the register mapping operation in the register mapping configuration interface, establish the mapping relationship between the register address of the target control device and the target logic block in the register mapping configuration interface; Based on the task to be executed and the mapping relationship, an executable script file for the target control device is generated, and the executable script file is transmitted to the target control device for execution.

2. The method according to claim 1, characterized in that, The categories of the logic blocks to be added include at least one of the following: motion control, motor control, logic processing, mathematical calculation, and storage resource; the connection between the target logic blocks is implemented based on the flow of logic.

3. The method according to claim 1, characterized in that, Also includes: In response to the triggering operation of the communication settings control in the main operation interface, the serial port configuration interface is displayed; In response to the serial port configuration operation in the serial port configuration interface, the serial port information is configured, and the target control device is connected based on the serial port information.

4. The method according to claim 1, characterized in that, Also includes: In response to the triggering operation of the new project control in the main operation interface, the device configuration interface is displayed; In response to the device configuration operation in the device configuration interface, configure and save the device information and register address information of the target control device, and create a new project file.

5. The method according to claim 1, characterized in that, Also includes: Once the project file is created, in response to the trigger operation of adding controls to the module in the device tree corresponding to the target control device, an action control module is added to the device tree, and the module configuration interface is displayed. The device tree is used to display projects, devices, modules, and tasks in a hierarchical structure. In response to the module configuration operation in the module configuration interface, configure the basic parameters and motor parameters of the motion control module; In response to the task addition operation under the action control module, the graphical programming interface is displayed.

6. The method according to claim 1, characterized in that, The script file to be executed is generated and downloaded to the local machine through the trigger operation of downloading the project control in the main operation interface; The script file to be executed is transmitted to the target control device through the trigger operation of the uploaded project control in the main operation interface.

7. The method according to claim 1, characterized in that, Also includes: The display shows an oscilloscope interface that displays data read from the mapped registers of the target control device in real time.

8. The method according to claim 1, characterized in that, Also includes: In response to a mode switching operation in the graphical programming interface, switch to debug mode to modify the value of the output register of the target control device through the debug mode.

9. The method according to claim 1, characterized in that, The register address of the target control device is a virtual address, which is used to associate the target control device with its real, variable physical address.

10. A visual script generation device, characterized in that, Configured on a host computer, the host computer's software architecture includes a presentation layer, a business logic layer, a data access layer, and a hardware communication layer; the presentation layer is used to respond to visual operations; the business logic layer is used to respond to the operations in the presentation layer to implement the business logic processing required for script generation; The data access layer is used to provide data operation interfaces for the business logic layer; The hardware communication layer is used to enable communication with the target control device; the device includes: The task configuration module is used to respond to the task configuration operation in the graphical programming interface, select the target logic block from the logic blocks to be added, configure and connect it, and establish the task to be executed. The logic blocks to be added are the logic blocks displayed in the graphical programming interface that match the target control device. The register mapping module is used to respond to the register mapping operation in the register mapping configuration interface and establish the mapping relationship between the register address of the target control device and the target logic block in the register mapping configuration interface. The script generation module is used to generate an executable script file for the target control device based on the task to be executed and the mapping relationship, so as to transmit the executable script file to the target control device for execution.

11. An electronic device, 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-9.

12. 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-9.