Macro script conversion system and method, electronic device, medium, and program product

The macro script conversion system automates the process of migrating scripts between industry software platforms by using natural language and pseudocode conversion, addressing the high manual effort and cost issues in script migration, and enhancing user efficiency and resource utilization.

WO2025231664A1PCT designated stage Publication Date: 2025-11-13SIEMENS AG +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/091790
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Filing Date
2024-05-08
Publication Date
2025-11-13

AI Technical Summary

Technical Problem

Migrating automation scripts from one industry software platform to another requires significant manual effort and expertise, leading to high costs due to the need for simulation experts to understand and manually reconstruct scripts, which is prohibitive for most users.

Method used

A macro script conversion system and method that includes a receiving module, a code translation agent, and a code generation agent to convert macro scripts from source to target software using natural language and pseudocode, with optional error detection and user feedback, enabling automated and efficient script conversion.

Benefits of technology

Enables accurate and rapid conversion of macro scripts across different software platforms, reducing manual effort and costs by providing automated script translation and error detection, thus improving user efficiency and resource utilization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024091790_13112025_PF_FP_ABST
    Figure CN2024091790_13112025_PF_FP_ABST
Patent Text Reader

Abstract

Embodiments of this application mainly relate to the field of industrial digitization, and in particular, to a macro script conversion system and method, an electronic device, a medium, and a program product. A receiving module is configured to receive a first macro script, a name of source software, and a name of target software inputted by a user, where the first macro script includes a macro script of the source software. A code translation agent module is configured to convert the first macro script into corresponding natural language and pseudocode. A code generation agent module is configured to create a macro script corresponding to the name of the target software based on the natural language and the pseudocode.
Need to check novelty before this filing date? Find Prior Art

Description

MACRO SCRIPT CONVERSION SYSTEM AND METHOD, ELECTRONIC DEVICE, MEDIUM, AND PROGRAM PRODUCTTECHNICAL FIELD

[0001] Embodiments of this application mainly relate to the field of industrial digitization, and in particular, to a macro script conversion system and method, an electronic device, a medium, and a program product.BACKGROUND

[0002] With increasing requirements for simulation modeling and analysis automation, most industry software platforms, for example, CAD, CAE, CAM, and PLC software, have script-based integrated automation functions. Such functions enable a user to automatically perform tasks such as model construction, adjustment, and simulation setting by using a script.

[0003] Although manners of model construction and model analysis are similar on different industry software platforms, different software have respective unique script rule sets. Currently, migrating an automation process from software A to software B requires a simulation expert to gain insight into automation processes of the software A and the software B and manually reconstruct an automation script in the software B. Therefore, costs of the corresponding migration are very high and are eventually prohibitive for most users.SUMMARY

[0004] Embodiments of this application provide a macro script conversion system and method, an electronic device, a medium, and a program product. Through the embodiments of this application, a macro script of source software can be accurately and quickly converted into a macro script of target software.

[0005] According to a first aspect, a macro script conversion system is provided, including: a receiving module, configured to receive a first macro script, a name of source software, and a name of target software inputted by a user, where the first macro script includes a macro script of the source software; a code translation agent module, configured to convert the first macro script into corresponding natural language and pseudocode; and a code generation agent module, configured to create a macro script corresponding to the name of the target  software based on the natural language and the pseudocode.

[0006] According to a second aspect, a macro script conversion method is provided, including: receiving a first macro script, a name of source software, and a name of target software inputted by a user, where the first macro script includes a macro script of the source software; converting the first macro script into corresponding natural language and pseudocode through a code translation agent; and creating a macro script corresponding to the name of the target software through a code generation agent based on the natural language and the pseudocode.

[0007] According to a third aspect, an electronic device is provided, including: at least one memory, configured to store computer-readable code; and at least one processor, configured to invoke the computer-readable code, to perform the steps in the method provided in the second aspect.

[0008] According to a fourth aspect, a computer-readable medium is provided, where the computer-readable medium stores computer-readable instructions, and the computer-readable instructions, when executed by a processor, cause the processor to perform the steps in the method provided in the second aspect.

[0009] According to a fifth aspect, a computer program product is provided, where the computer program product is tangibly stored on a computer-readable medium and includes computer executable instructions, and the computer executable instructions, when executed, cause at least one processor to perform the steps in the method provided in the second aspect.BRIEF DESCRIPTION OF THE DRAWINGS

[0010] The following figures are only intended to give schematic illustrations and explanations of embodiments of this application but are not intended to limit a scope of the embodiments of this application.

[0011] FIG. 1 is a schematic diagram of a macro script conversion system according to an embodiment of this application;

[0012] FIG. 2 is a flowchart of a macro script conversion method according to an embodiment of this application; and

[0013] FIG. 3 is a schematic diagram of an electronic device according to an embodiment of this application.

[0014] Descriptions of reference numerals:

[0015] 10: Macro script conversion system; 11: Receiving module; 12: Code translation agent module;

[0016] 13: Code generation agent module; 200: Macro script conversion method; 201 to 203: Method steps;

[0017] 300: Electronic device; 301: Processor; 302: Communications interface;

[0018] 303: Memory; 304: Communications bus; and 305: Program.DETAILED DESCRIPTION

[0019] A subject described in this specification is discussed now with reference to exemplary implementations. It should be understood that, discussion of the implementations is merely intended to make a person skilled in the art better understand and implement the subject described in this specification, and is not intended to limit the protection scope of the claims, the applicability, or examples. Changes may be made to the functions and arrangements of the discussed elements without departing from the protection scope of the content of the embodiments of this application. Various processes or components may be omitted, replaced, or added in each example according to requirements. For example, the described method may be performed according to a sequence different from the sequence described herein, and steps may be added, omitted, or combined. In addition, features described in some examples may also be combined in other examples.

[0020] As used in this specification, the term "include" and variants thereof represent open terms, and means "include but is not limited to" . The term "based on" represents "at least partially based on" . The terms "one embodiment" and "an embodiment" represent "at least one embodiment" . The term "another embodiment" represents "at least one another embodiment" . The terms "first" , "second" , and the like may represent different objects or the same object. Other definitions may be included explicitly or implicitly in the following. Unless otherwise clearly specified, the definition of one term is consistent in the entire specification.

[0021] The following describes the embodiments of this application with reference to the accompanying drawings.

[0022] FIG. 1 is a schematic diagram of a macro script conversion system according to an embodiment of this application. As shown in FIG. 1, the macro script conversion system 10 includes:

[0023] a receiving module 11, configured to receive a first macro script, a name of source software, and a name of target software inputted by a user, where

[0024] the first macro script is a macro script of the source software, the source software and the  target software may be different software or may be different versions of one software, and because a writing method of a macro script is updated after a version is updated, software of a new version may not be able to read a macro file of an old version;

[0025] a code translation agent module 12, configured to convert the first macro script into corresponding natural language and pseudocode; and

[0026] a code generation agent module 13, configured to create a macro script corresponding to the name of the target software based on the natural language and the pseudocode obtained.

[0027] In this embodiment of this application, the macro script of the source software, the name of the source software, and the name of the target software inputted by the user are first received; the macro script of the source software is converted into the corresponding natural language and pseudocode through the code translation agent module; and then the macro script corresponding to the target software is created based on the data obtained through the conversion. Through the embodiments of this application, the macro script of the source software can be accurately and quickly converted into the macro script of the target software. In addition, in this embodiment of this application, the software script is converted into the natural language and the pseudocode, making it convenient for the user to understand execution logic of an automation process, thereby improving user efficiency.

[0028] In an embodiment, the system 10 further includes: a code logic checking agent module, configured to: retrieve errors or omissions in the natural language and the pseudocode; and when there is any error or omission, input the corresponding error or omission into the code translation agent module 12 to update the natural language and the pseudocode obtained.

[0029] In an embodiment, the code generation agent module 13 is further configured to create a second macro script for the name of the source software. A code syntax checking agent module is configured to: check a syntax error or an API error in the second macro script; and when there is any syntax error or API error, input the corresponding error and the second macro script into the code generation agent module 13, to update the second macro script. A code function checking agent module is configured to: detect functional consistency between the second macro script and the first macro script. In a specific manner, optionally, in a test environment, the code function checking agent module may run the first macro script and the second macro script in an initial simulation software environment, and check the consistency by comparing corresponding results. Optionally, the code function checking agent module may independently evaluate the functional consistency, for example, whether orders of operation steps are the same, or whether set statuses are consistent.

[0030] When there is any error, for example, reduction of an operation step, addition of a step  with additional impact, or a parameter error, the corresponding error and the first macro script are inputted into the code translation agent module 12, to update the natural language and the pseudocode. The embodiments of this application support automated testing and comparison of script execution effects, thereby greatly reducing time and resources required in a manual testing process.

[0031] In an embodiment, the code syntax checking agent module is configured to: perform verification on whether a syntax error or an API error exists in the macro script corresponding to the name of the target software; and when there is any syntax error or API error, input the corresponding error and the macro script corresponding to the name of the software into the code generation agent module 13, to update the macro script corresponding to the name of the target software to obtain a third macro script. Optionally, the code function checking agent module is further configured to detect functional consistency between the third macro script and the first macro script. In a specific manner, optionally, in a test environment, the code function checking agent runs the first macro script and the third macro script on the source software and the target software respectively by invoking simulation software, and checks the consistency by comparing corresponding results. Optionally, the code function checking agent module may independently evaluate the functional consistency.

[0032] When there is any error, the corresponding error and the first macro script are inputted into the code generation agent module, to update the natural language and the pseudocode.

[0033] In an embodiment, the natural language and the pseudocode may be displayed to the user through the user interface. The user marks or points out a possible error or content that needs to be adjusted, and then a feedback of the user is provided to the code translation agent module 12 to update the natural language and the pseudocode.

[0034] Optionally, the code translation agent module 12 and the code generation agent module 13 are each based on a large language model, and are obtained through training by using a dataset of a universal simulation scenario, a relevant dataset of the source software, and a relevant dataset of the target software as training datasets.

[0035] Optionally, the training dataset of the code translation agent module 12 may further include a task requirement and a corresponding pseudocode dataset, and optionally, an AI augmented task requirement and a corresponding code dataset. The datasets are used in a manner in which a code is used as an input item and the task requirement is used as an output item.

[0036] Optionally, the training dataset of the code generation agent module 13 may further include a task requirement and a corresponding pseudocode dataset, and optionally, an AI  augmented task requirement and a corresponding code dataset. The datasets are used in a manner in which a code is used as an input item and the task requirement is used as an output item.

[0037] Optionally, the training dataset of the code logic checking agent module may include: a dataset of a universal simulation scenario, an operation document of corresponding software, an application programming interface (API) description document of corresponding software, and / or a code case document of relevant software.

[0038] Optionally, the training dataset of the code syntax checking agent module may include: an API description document of corresponding software, a code case document of relevant software, a task requirement and a code dataset corresponding to corresponding software, and optionally, an AI augmented task requirement and a code dataset corresponding to corresponding software.

[0039] Optionally, the training data of the code function checking agent module may include a dataset of relevant software, for example, an operation document, an API description document, a code case document, a task requirement and a code dataset corresponding to corresponding software, and optionally, an AI augmented task requirement and a code dataset corresponding to corresponding software.

[0040] According to the embodiments of this application, a script of a new software platform can be learned according to a relevant document and a script example, thereby implementing an automatic expansion capability.

[0041] In an embodiment, the system 10 further includes an output module, configured to return the macro script corresponding to the name of the target software to the user through a user interface.

[0042] FIG. 2 is a flowchart of a macro script conversion method according to an embodiment of this application. As shown in FIG. 2, the macro script conversion method 200 includes:

[0043] Step 201: Receive a first macro script, a name of source software, and a name of target software inputted by a user.

[0044] Step 202: Convert the first macro script into corresponding natural language and pseudocode through a code translation agent.

[0045] Step 203: Create a macro script corresponding to the name of the target software through a code generation agent based on the natural language and the pseudocode.

[0046] Optionally, the code translation agent and the code generation agent are each based on a large language model, and are obtained through training by using a dataset of a universal simulation scenario, a relevant dataset of the source software, and a relevant dataset of the  target software as training datasets.

[0047] Through the embodiments of this application, a macro script of source software can be accurately and quickly converted into a macro script of target software.

[0048] FIG. 3 is a schematic diagram of an electronic device according to an embodiment of this application. Specific embodiments of this application do not limit specific implementation of the electronic device. Referring to FIG. 3, the electronic device 300 provided in this embodiment of this application includes a processor 302, a communications interface 304, a memory 306, and a communications bus 308.

[0049] The processor 302, the communications interface 304, and the memory 306 communicate with each other through the communications bus 308.

[0050] The communications interface 304 is configured to communicate with another electronic device or a server.

[0051] The processor 302 is configured to execute a program 310, and specifically may perform the foregoing relevant steps in the embodiments of the macro script conversion method 200.

[0052] Specifically, the program 310 may include program code, and the program code includes computer operation instructions.

[0053] The processor 302 may be a central processing unit (CPU) , or an application specific integrated circuit (ASIC) , or one or more integrated circuits configured to implement the embodiments of this application. One or more processors included in a smart device may be processors of a same type, such as one or more CPUs; or may be processors of different types, such as one or more CPUs and one or more ASICs.

[0054] The memory 302 is configured to store the program 310. The memory 306 may include a high-speed RAM memory, or may further include a non-volatile memory, for example, at least one magnetic disk memory.

[0055] An embodiment of this application further provides a computer-readable storage medium, storing instructions configured to cause a machine to perform the macro script conversion method 200 described herein. Specifically, a system or an apparatus that is equipped with a storage medium may be provided. The storage medium stores software program code that implements functions of any embodiment in the foregoing embodiments, and a computer (aCPU or an MPU) of the system or the apparatus is enabled to read and execute the program code stored in the storage medium.

[0056] In this case, the program code read from the storage medium can implement the functions in any one of the foregoing embodiments, and therefore the program code and the storage medium for storing the program code constitute a part of this application.

[0057] Embodiments of the storage medium for providing the program code may include a floppy disk, a hard disk, a magneto-optical disk, an optical memory (such as a CD-ROM, a CD-R, a CD-RW, a DVD-ROM, a DVD-RAM, a DVD-RW, and a DVD+RW) , a magnetic tape, a non-volatile storage card, and a ROM. Optionally, the program code may be downloaded from a server computer by using a communications network.

[0058] Moreover, it should be clear that an operating system operated in the computer can be made, not only by executing program code read by a computer, but also by using an instruction based on the program code, to implement some or all actual operations, to implement functions of any one of the foregoing embodiments.

[0059] In addition, it should be noted that the program code read from the storage medium may also be written to a memory that is disposed in an extension board inserted in the computer, or may be written to a memory that is disposed in an extension module connected to the computer, and then a CPU or the like that is installed on the extension board or extension module may be enabled to execute some or all actual operations based on instructions of the program code, to implement the functions of any embodiment in the foregoing embodiments.

[0060] An embodiment of this application further provides a computer program product, where the computer program product is tangibly stored on a computer-readable medium and includes computer executable instructions, and the computer executable instructions, when executed, cause at least one processor to perform the macro script conversion method 200 according to the foregoing embodiments. It should be understood that the solutions in the embodiments have corresponding technical effects in the foregoing method embodiments, and details are not described herein again.

[0061] Not all steps and modules in the procedures and the system structure diagrams are necessary, and some steps or modules may be omitted according to an actual need. An execution order of the steps is not fixed and may be adjusted according to requirements. The system structure described in the embodiments may be a physical structure or a logical structure. That is, some modules may be implemented by the same physical entity, or some modules may be implemented by a plurality of physical entities, or may be implemented by some components in a plurality of independent devices together.

[0062] The nouns and pronouns of a person in this application are not limited to a specific gender.

[0063] Hardware modules in the foregoing embodiments may be implemented in a mechanic manner or an electronic manner. For example, a hardware module may include permanently dedicated circuitry or logic (for example, an application-specific processor such as an FPGA  or an ASIC) to complete corresponding operations. The hardware module may further include programmable logic or circuitry (for example, a universal processor or another programmable processor) , which may be temporarily set by software to complete corresponding operations. The specific implementation method (mechanical, or dedicated permanent circuitry, or temporary circuitry) may be determined based on costs and time.

[0064] This application is presented and described in detail through the accompanying drawings and the preferred embodiments. However, this application is not limited to the disclosed embodiments. Based on the foregoing plurality of embodiments, a person skilled in the art may learn that code review means in the foregoing different embodiments may be combined to obtain more embodiments of this application. Such embodiments also fall within the protection scope of this application.

[0065] The nouns and pronouns of a person in this application are not limited to a specific gender.

Claims

1.A macro script conversion system, comprising:a receiving module (11) , configured to receive a first macro script, a name of source software, and a name of target software inputted by a user, wherein the first macro script comprises a macro script of the source software;a code translation agent module (12) , configured to convert the first macro script into corresponding natural language and pseudocode; anda code generation agent module (13) , configured to create a macro script corresponding to the name of the target software based on the natural language and the pseudocode.2.The system according to claim 1, further comprising:a code logic checking agent module, configured to: retrieve errors or omissions in the natural language and the pseudocode; andwhen there is any error or omission, input the corresponding error or omission into the code translation agent module (12) to update the natural language and the pseudocode.3.The system according to claim 1 or 2, whereinthe code generation agent module (13) is further configured to create a second macro script for the name of the source software;a code syntax checking agent module is configured to: check a syntax error or an API error in the second macro script; andwhen there is any syntax error or API error, input the corresponding error and the second macro script into the code generation agent module (13) , to update the second macro script; anda code function checking agent module is configured to: detect functional consistency between the second macro script and the first macro script; andwhen there is any error, input the corresponding error and the first macro script into the code translation agent module (12) , to update the natural language and the pseudocode.4.The system according to claim 1, whereina code syntax checking agent module is configured to: perform verification on whether a syntax error or an API error exists in the macro script corresponding to the name of the target software; andwhen there is any syntax error or API error, input the corresponding error and the macro script corresponding to the name of the target software into the code generation agent module (13) , to update the macro script corresponding to the name of the target software to obtain a third macro script.5.The system according to claim 4, whereina code function checking agent module is further configured to: detect functional consistency between the third macro script and the first macro script; andwhen there is any error, input the corresponding error and the first macro script into the code generation agent module (13) , to update the natural language and the pseudocode.6.The system according to any one of claims 1 to 4, whereinthe code translation agent module and the code generation agent module are each based on a large language model, and are obtained through training by using a dataset of a universal simulation scenario, a relevant dataset of the source software, and a relevant dataset of the target software as training datasets.7.The system according to claim 1, further comprising:an output module, configured to return the macro script corresponding to the name of the target software to the user through a user interface.8.A macro script conversion method, comprising:receiving (201) a first macro script, a name of source software, and a name of target software inputted by a user, wherein the first macro script comprises a macro script of the source software;converting (202) the first macro script into corresponding natural language and pseudocode through a code translation agent; andcreating (203) a macro script corresponding to the name of the target software through a code generation agent based on the natural language and the pseudocode.9.The method according to claim 8, wherein the code translation agent and the code generation agent are each based on a large language model, and are obtained through training by using a dataset of a universal simulation scenario, a relevant dataset of the source software, and a relevant dataset of the target software as training datasets.10.An electronic device (300) , comprising: a processor (301) , a communications interface (302) , a memory (303) , and a communications bus (304) , wherein the processor (301) , the memory (303) , and the communications interface (302) communicate with each other through the communications bus (304) ; andthe memory (303) is configured to store at least one executable instruction, and the executable instruction causes the processor to perform the operations corresponding to the macro script conversion method according to any one of claim 8 or 9.11.A computer storage medium, storing a computer program, wherein the program, when executed by a processor, implements the macro script conversion method according to any one of claim 8 or 9.12.A computer program product, wherein the computer program product is tangibly stored on a computer-readable medium and comprises computer executable instructions, and the computer executable instructions, when executed, cause at least one processor to perform the macro script conversion method according to any one of claim 8 or 9.

Citation Information

Patent Citations

  • System for generating multiple-command macros

    US20200097148A1