Robot language conversion method and device, storage medium and system
By constructing an abstract syntax tree and an intermediate language instruction mapping table, the problem of incompatibility between programming languages of different robot manufacturers was solved, realizing the unified conversion of robot instructions, improving work efficiency and cross-platform applicability, and reducing maintenance costs.
Patent Information
- Application Number
- CN202511459881.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-13
- Publication Date
- 2026-01-23
AI Technical Summary
Different industrial robot manufacturers use different programming languages, which means that engineers need to write programs repeatedly for each type of robot. This increases the learning cost and repetitive development work, reduces the efficiency of cross-platform program reuse, and increases the complexity of system integration and maintenance difficulty.
By constructing an abstract syntax tree for robot control programs and utilizing an intermediate language instruction mapping table, instructions from different manufacturers are converted into unified intermediate language instructions, enabling one-time writing for multiple platforms. A rule engine and neural network model are used to process non-standard instructions, ensuring the accuracy and completeness of the conversion.
It has achieved unified conversion of instructions for robots from different brands, which has improved work efficiency, reduced maintenance costs, ensured cross-platform compatibility and conversion reliability, and avoided redundant development and trajectory deviation.
Smart Images

Figure CN121387288A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of industrial robot control technology, and more specifically, to a robot language conversion method, a robot language conversion device, a computer-readable storage medium, and a robot language conversion system. Background Technology
[0002] With the development of industrial automation, industrial robots are widely used in manufacturing, assembly, logistics, and other fields. Currently, there are several mainstream robot manufacturers on the market, such as ABB, KUKA, FANUC, and Yaskawa. Due to the lack of a unified standard, each manufacturer uses its own robot programming language, which differs significantly in syntax, instruction format, and motion control logic.
[0003] In practical applications, if engineers need to implement the same functionality on robots from different brands, they must write and debug programs separately for each language. This not only increases the learning curve but also leads to a large amount of repetitive development work, severely impacting the efficiency of cross-platform program reuse. Furthermore, when robots from different brands need to run collaboratively, additional adaptation and conversion are required, further increasing the complexity of integration and the difficulty of maintenance.
[0004] Therefore, how to solve the language incompatibility problem between different robot manufacturers and reduce the cost of repeated development and system integration has become a technical problem that urgently needs to be solved in the field of industrial automation. Summary of the Invention
[0005] The main objective of this application is to provide a method, device, computer-readable storage medium, and system for converting robot language, so as to at least solve the problem in the prior art that different industrial robot manufacturers use different programming languages, and the same function requires rewriting programs for different brands of robots, resulting in low work efficiency.
[0006] To achieve the above objectives, according to one aspect of this application, a method for converting robot language is provided, comprising: acquiring a robot control program, and constructing an abstract syntax tree of the control program based on the control program and a syntax rule file of the robot language; generating intermediate language instructions corresponding to the robot's instructions in the control program based on the abstract syntax tree and a preset intermediate language instruction mapping table, wherein the robot's instructions correspond one-to-one with the intermediate language instructions, and the intermediate language instruction mapping table is a mapping relationship table between the robot language and the intermediate language.
[0007] Optionally, constructing an abstract syntax tree for the control program based on the control program and the syntax rule file of the robot language includes: processing the control program using a rule engine to obtain a keyword sequence of the control program, the keyword sequence representing a set of keywords of the control program; determining the semantic category of each keyword in the keyword sequence based on the syntax rule file, and constructing the abstract syntax tree of the control program based on the semantic category.
[0008] Optionally, after processing the control program with a rule engine to obtain the keyword sequence of the control program, the method further includes: determining non-standard instructions that the rule engine failed to process; processing the non-standard instructions with a pre-trained first neural network model to obtain the semantic category of each keyword in the non-standard instructions, and constructing the abstract syntax tree of the control program based on the semantic category.
[0009] Optionally, generating intermediate language instructions corresponding to the robot's instructions in the control program based on the abstract syntax tree and a preset intermediate language instruction mapping table includes: traversing the abstract syntax tree to obtain multiple nodes of the abstract syntax tree corresponding to each instruction; determining target intermediate language instructions corresponding to the multiple nodes according to the intermediate language instruction mapping table; and filling the target intermediate language instructions into a preset first instruction template to obtain the intermediate language instructions corresponding to the instructions.
[0010] Optionally, determining the target intermediate language instruction corresponding to the multiple nodes according to the intermediate language instruction mapping table includes: if determining the target intermediate language instruction corresponding to the multiple nodes according to the intermediate language instruction mapping table fails, marking the node as a semantic difference node; processing the semantic difference node using a pre-trained second neural network model to obtain multiple candidate intermediate language instructions and a confidence value corresponding to each candidate intermediate language instruction; generating prompt information containing each candidate intermediate language instruction and the confidence value corresponding to each candidate intermediate language instruction to prompt the determination of the target candidate intermediate language instruction among the multiple candidate intermediate language instructions.
[0011] Optionally, after generating the intermediate language instructions corresponding to the robot's instructions in the control program based on the abstract syntax tree and the preset intermediate language instruction mapping table, the method further includes: generating control instructions for the target robot based on the intermediate language instructions and the second instruction template of the target robot; adding verification instructions to the control instructions to obtain the final control instructions for the target robot, wherein the verification instructions are used to verify the motion trajectory of the target robot executing the control instructions.
[0012] Optionally, after obtaining the robot's control program, the method further includes: replacing the macro definitions in the control program with the programs corresponding to the macro definitions.
[0013] According to another aspect of this application, a robot language conversion device is provided, comprising: an acquisition unit, configured to acquire a robot control program and construct an abstract syntax tree of the control program based on the control program and a syntax rule file of the robot language; and a generation unit, configured to generate intermediate language instructions corresponding to the robot instructions in the control program based on the abstract syntax tree and a preset intermediate language instruction mapping table, wherein the robot instructions and the intermediate language instructions correspond one-to-one, and the intermediate language instruction mapping table is a mapping relationship table between the robot language and the intermediate language.
[0014] According to another aspect of this application, a computer-readable storage medium is provided, the computer-readable storage medium including a stored program, wherein, when the program is executed, it controls the device on which the computer-readable storage medium is located to perform any of the methods described.
[0015] According to another aspect of this application, a robot language conversion system is provided, comprising: one or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs including methods for performing any one of the methods described.
[0016] The technical solution of this application first obtains the robot's control program, and then constructs an abstract syntax tree for the control program based on the control program and the robot language's syntax rule file. Next, based on the abstract syntax tree and a pre-defined intermediate language instruction mapping table, intermediate language instructions corresponding to the robot's instructions in the control program are generated. This solution, by constructing an abstract syntax tree and combining it with an intermediate language instruction mapping table, allows instructions from different manufacturers to be converted into a unified set of intermediate language instructions. This achieves "write once, use across multiple platforms," meaning developers only need to master the rules of the intermediate language without learning the proprietary syntax of each manufacturer. This enables "write once, use across multiple brands," significantly improving work efficiency and reducing maintenance costs. It solves the problem of low work efficiency caused by different industrial robot manufacturers using different programming languages, requiring repeated programming for the same function across different robot brands. Attached Figure Description
[0017] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments and descriptions of this application are used to explain this application and do not constitute an undue limitation of this application. In the drawings:
[0018] Figure 1 A flowchart illustrating a robot language conversion method according to an embodiment of this application is shown.
[0019] Figure 2 A flowchart illustrating another robot language conversion method provided according to an embodiment of this application is shown;
[0020] Figure 3 A structural block diagram of a robot language conversion device provided according to an embodiment of this application is shown. Detailed Implementation
[0021] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.
[0022] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0023] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application 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 for the embodiments of this application 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.
[0024] As described in the background section, different industrial robot manufacturers use different programming languages. The same function requires rewriting programs for different brands of robots, resulting in low work efficiency. To solve the above technical problems, the embodiments of this application provide a robot language conversion method, a robot language conversion device, a computer-readable storage medium, and a robot language conversion system.
[0025] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention.
[0026] Figure 1This is a flowchart of a robot language conversion method according to an embodiment of this application. Figure 1 As shown, the method includes the following steps:
[0027] Step S101: Obtain the robot's control program, and construct the abstract syntax tree of the control program based on the control program and the syntax rule file of the robot language.
[0028] Specifically, the aforementioned control program is the entire code for the robot to perform actions, such as motion, I / O control, and logical judgments. The aforementioned syntax rule file is used to define the syntax specifications of the robot language. The syntax specifications include instruction keywords, parameter formats, statement structures, and logical control structures, so that the control program can be parsed into an abstract syntax tree according to the syntax rule file.
[0029] Step S102: Based on the above abstract syntax tree and the preset intermediate language instruction mapping table, generate the intermediate language instructions corresponding to the robot's instructions in the control program. The robot's instructions and the intermediate language instructions correspond one-to-one. The intermediate language instruction mapping table is a mapping relationship table between the robot language and the intermediate language.
[0030] Specifically, the intermediate language instruction mapping table defines a one-to-one correspondence between the manufacturer's language and the intermediate language. For each robot instruction in the abstract syntax tree, the intermediate language instruction mapping table is consulted to convert it into the corresponding intermediate language instruction.
[0031] The above embodiments first obtain the robot's control program and then construct an abstract syntax tree (AST) based on the control program and the robot language's syntax rules file. Next, based on the AST and a pre-defined intermediate language instruction mapping table, intermediate language instructions corresponding to the robot's instructions in the control program are generated. This solution, by constructing an AST and combining it with an intermediate language instruction mapping table, allows instructions from different manufacturers to be converted into a unified set of intermediate language instructions. This achieves "write once, use across multiple platforms," meaning developers only need to master the intermediate language rules without learning the proprietary syntax of each manufacturer. This significantly improves work efficiency and reduces maintenance costs, solving the problem of low work efficiency caused by different industrial robot manufacturers using different programming languages and the need to repeatedly write programs for different brands of robots for the same function.
[0032] In one alternative approach, constructing an abstract syntax tree for the control program based on the control program and the syntax rule file of the robot language includes: processing the control program using a rule engine to obtain a keyword sequence of the control program, wherein the keyword sequence represents a set of keywords of the control program; determining the semantic category of each keyword in the keyword sequence based on the syntax rule file, and constructing the abstract syntax tree of the control program based on the semantic category.
[0033] In the above embodiments, the rule engine performs lexical segmentation of the control program according to the grammar rule file and generates a keyword sequence. Then, based on the same grammar rule file, semantic categories are assigned to the keywords, and finally, an abstract syntax tree is constructed. This transforms the originally ambiguous multi-vendor robot program, presented in text form, into a structured, computable, and reproducible program representation. This reduces the error rate of parsing and the cost of manual intervention, providing stable input for subsequent intermediate language mapping, parameter normalization, trajectory optimization, and validation insertion. Furthermore, since specific language differences are described in the grammar rule file, if a new robot language needs to be supported, only the grammar file needs to be updated, without modifying the underlying parsing program. This improves cross-vendor scalability and maintenance efficiency, further enhancing work efficiency.
[0034] Specifically, the aforementioned rule engine is an automated parsing tool based on preset syntax rules. It scans the source code of the control program character by character and identifies consecutive character combinations as the smallest units with independent meaning, namely keywords. The set of these keywords is constructed into the aforementioned keyword sequence.
[0035] In another alternative approach, after processing the control program with a rule engine to obtain the keyword sequence of the control program, the method further includes: identifying non-standard instructions that the rule engine failed to process; processing the non-standard instructions with a pre-trained first neural network model to obtain the semantic category of each keyword in the non-standard instructions, and constructing the abstract syntax tree of the control program based on the semantic category.
[0036] In the above embodiments, when the rule engine fails to parse a portion of the control program and produces non-standard instructions that fail to process, a pre-trained first neural network model is introduced for supplementary processing. This first neural network model can semantically classify keywords in non-standard instructions, thereby determining whether the instruction belongs to categories such as motion control, parameter setting, logical judgment, or I / O operation. Based on this, it continues to construct an abstract syntax tree, thus expanding the system's applicability and enabling correct parsing of code with vendor-specific syntax, abbreviations, or comment interference. Furthermore, it avoids the problem of entire program parsing being interrupted due to individual statements not conforming to syntax rules. Through this method, the abstract syntax tree remains complete and continuous, and subsequent intermediate language mapping and conversion can proceed smoothly, thereby improving the overall parsing success rate and further enhancing work efficiency.
[0037] Specifically, the aforementioned first neural network model includes a convolutional neural network model. The training process includes: firstly, collecting standard instructions and non-standard instructions with abbreviations, annotations, or grammatical variations from robot language programs from different manufacturers, and semantically labeling keywords to form training corpora; then, using a model structure such as a convolutional neural network or a combination thereof, segmenting control program fragments into word input models, the model learns the semantic relationship between keywords and context in multi-layer nonlinear mapping, and outputs the semantic category corresponding to each word; after training, the first neural network model can intervene when the rule engine fails to parse, automatically performing semantic determination on keywords of non-standard instructions, and outputting labels such as motion type, parameter category, or logic control, thereby ensuring the complete construction of the abstract syntax tree and providing a reliable semantic foundation for subsequent intermediate language instruction mapping.
[0038] In some exemplary embodiments of this application, generating intermediate language instructions corresponding to the robot's instructions in the control program based on the abstract syntax tree and a preset intermediate language instruction mapping table includes: traversing the abstract syntax tree to obtain multiple nodes of the abstract syntax tree corresponding to each instruction; determining target intermediate language instructions corresponding to multiple nodes according to the intermediate language instruction mapping table; and filling the target intermediate language instructions into a preset first instruction template to obtain the intermediate language instructions corresponding to the instructions.
[0039] In the above embodiments, the constructed abstract syntax tree is first traversed to identify the corresponding node for each instruction in the control program. Then, using a pre-defined intermediate language instruction mapping table, each node is matched and converted to determine its target instruction type in the intermediate language, and the parameter information in the source program is standardized according to the mapping relationship. Finally, for the identified target intermediate language instruction and the corresponding first instruction template, the parameter information is filled into the placeholders in the template item by item to generate a uniformly formatted and semantically clear intermediate language instruction. Through this process, robot instructions originally belonging to different manufacturers and with different syntaxes are all transformed into a structurally consistent intermediate language representation.
[0040] In some further exemplary embodiments of this application, determining the target intermediate language instruction corresponding to multiple nodes according to the intermediate language instruction mapping table includes: if it fails to determine the target intermediate language instruction corresponding to multiple nodes according to the intermediate language instruction mapping table, marking the nodes as semantic difference nodes; processing the semantic difference nodes using a pre-trained second neural network model to obtain multiple candidate intermediate language instructions and a confidence value corresponding to each candidate intermediate language instruction; and generating prompt information containing each candidate intermediate language instruction and the confidence value corresponding to each candidate intermediate language instruction to prompt the determination of the target candidate intermediate language instruction among the multiple candidate intermediate language instructions.
[0041] In the above embodiments, when a corresponding relationship cannot be found in the conventional mapping table, the node is automatically marked as a semantically different node and then processed by a pre-trained second neural network model. The second neural network model can combine context and historical samples to infer several possible intermediate language instructions corresponding to the node, provide a confidence value for each candidate result, and further generate prompts containing candidate instructions and their confidence levels for user confirmation or selection. This mechanism ensures that instructions that do not conform to standard syntax can be processed, preventing overall program parsing failure. Furthermore, users can make selections or corrections from the candidate results, ensuring the conversion result meets expectations, improving cross-platform conversion coverage, and enhancing applicability in real-world engineering environments.
[0042] Specifically, the second neural network model can be a Transformer model (a type of neural network model).
[0043] In one alternative approach, after generating the intermediate language instructions corresponding to the robot's instructions in the control program based on the abstract syntax tree and the preset intermediate language instruction mapping table, the method further includes: generating control instructions for the target robot based on the intermediate language instructions and the second instruction template of the target robot; adding verification instructions to the control instructions to obtain the final control instructions for the target robot, wherein the verification instructions are used to verify the motion trajectory of the target robot executing the control instructions.
[0044] In the above embodiments, after the intermediate language instructions are generated through abstract syntax tree mapping, a second instruction template for the target robot manufacturer is determined based on these intermediate language instructions. This generates control instructions that the robot can directly recognize and execute. Thus, robots from different brands can be converted into their respective manufacturer languages using the same intermediate language, thereby solving cross-platform compatibility issues. Additional verification instructions, such as trajectory simulation checks or position verifications, are added to these control instructions to ensure that the robot's motion trajectory is consistent with expectations when running according to the instructions. This guarantees that the generated control instructions conform to the syntactic and logical requirements of the target robot language, allowing for direct execution. Furthermore, the verification process avoids safety risks caused by trajectory deviations or parameter errors, thereby improving the reliability of program conversion and the safety of the execution process.
[0045] For example, the user writes the following motion command in the intermediate language: MOVE J1 TO P1 SPEED=50%MODE=FINE; the system generates the corresponding target robot language based on the intermediate language command and the target robot's syntax template, for example: PTP P1 C_DIS Vel=50%; a trajectory simulation command SIM_CHECK is automatically inserted into the generated control command, resulting in PTP P1 C_DIS Vel=50%, SIM_CHECK P1; when the target robot executes this program, the SIM_CHECK command triggers the internal simulation module to check whether the simulated trajectory is consistent with the original trajectory in the intermediate language. If there is a deviation, the system will issue an alarm or prompt the user to make adjustments; if no deviation is verified, the target robot is allowed to continue executing the control command.
[0046] In another alternative, after obtaining the robot's control program, the method further includes replacing the macro definitions in the control program with the corresponding programs.
[0047] In the above embodiments, all macros existing in the control program in the form of symbols or aliases are replaced with their actual instructions or parameter contents, transforming the source program into a complete, independently parsable code. This eliminates the ambiguity and uncertainty caused by macros, facilitating subsequent lexical segmentation and syntax analysis, ensuring the complete and continuous construction of the abstract syntax tree. Furthermore, it avoids differences in macro expansion due to different field environments or controller versions, ensuring consistent semantics for the same program during conversion, thereby improving the accuracy and stability of intermediate language mapping. Simultaneously, after macro expansion, all motion parameters, I / O settings, etc., appear as explicit values, facilitating unit and value range checks and safety threshold verification, reducing trajectory deviation and execution risks, improving maintenance efficiency, and providing an input basis for subsequent trajectory simulation.
[0048] To enable those skilled in the art to better understand the technical solution of this application, the implementation process of the robot language conversion method of this application will be described in detail below with reference to specific embodiments.
[0049] This embodiment relates to a specific method for converting robot language, such as... Figure 2 As shown, it includes the following steps:
[0050] Step S1: The user programs using the intermediate language to obtain intermediate language instructions;
[0051] Step S2: Select and convert the target robot's language to obtain the control commands for the target robot;
[0052] Step S3: Import the control instructions into the controller of the target robot, so as to control the target robot according to the control instructions to execute the user-preset motion trajectory, I / O operation and process flow.
[0053] This application provides an application scenario for cross-vendor robot language conversion. For example, on a production line, a program running on a first-model robot needs to be migrated to a second-model robot. First, the control program of the first-model robot is obtained, for example: “MoveJ p1,v100,fine,tool1\WObj:=wobj0;WaitDIdi1,1;”. Then, a rule engine is used to perform lexical and syntactic analysis on the program. In the lexical analysis stage, the program is broken down into keyword sequences: “MoveJ”, “p1”, “v100”, “fine”, “tool1”, “WObj”, “:=", “wobj0”, “;”, etc. Based on the syntax rule file of the first-model robot, the semantic category of each keyword is identified, such as “motion command”, “speed parameter”, “area mode”, “tool coordinate system”, etc., and a complete abstract syntax tree is constructed accordingly. If the rule engine encounters parts that do not conform to the syntax rules during the analysis process, such as non-standard logic embedded in comments, it is marked as a non-standard instruction and processed using a pre-trained first neural network model. The first neural network model can identify the semantic category of keywords through context, thereby filling the non-standard instruction into the abstract syntax tree and ensuring the integrity of the syntax tree. Traverse each node of the abstract syntax tree, call the intermediate language instruction mapping table, and map them one by one into intermediate language instructions. For example, "MoveJ p1,v100,fine" is mapped to "MOVE J1 TO P1 SPEED=100%MODE=FINE TOOL=TOOL1 WOBJ=WOBJ0", and "WaitDI di1,1" is mapped to "WAIT IO[1]=ON". If a node cannot find a corresponding relationship in the mapping table, it is marked as a semantic difference node, and the pre-trained second neural network model is called to generate multiple candidate intermediate language instructions and their confidence scores, which are then confirmed and selected by the user. After obtaining a unified intermediate language program, the target robot is selected as the second model robot. The system converts the intermediate language instructions into control instructions for the second model robot according to the syntax template of the second model robot. For example, the intermediate language instruction "MOVE J1 TO P1 SPEED=100%MODE=FINE" is converted to "PTPP1 Vel=100%C_PTP", and a verification instruction SIM_CHECK is automatically inserted after the key motion instruction to simulate and verify whether the trajectory is consistent with the original intermediate language instruction trajectory. If the verification result is without deviation, the instruction can be safely executed on the target robot; if there is a deviation, the system will prompt the user to adjust or confirm. After generating the final control instructions for the second model robot, these control instructions are imported into the controller of the second model robot.Through the above embodiments, cross-platform instruction conversion from the first model robot to the second model robot was realized, unifying the semantics of instructions from different manufacturers and avoiding redundant development. In addition, non-standard statements and semantic differences were processed by neural networks, improving compatibility. Trajectory simulation was performed by using verification instructions, effectively ensuring the safety and consistency of the converted instructions and improving work efficiency.
[0054] This application also provides a specific implementation scenario for processing non-standard robot instructions. When writing a target robot program, the user uses the following instruction: LIN P1 Vel=0.3m / sC_DIS. Since the C_DIS parameter in this syntax does not have a direct equivalent in other vendor languages, the system cannot find the corresponding intermediate language instruction when searching the intermediate language mapping table, thus marking this instruction node as a semantically different node. At this point, a pre-trained second neural network model is used to process this semantically different node, outputting multiple candidate intermediate language instructions and their confidence values, such as: MOVELIN TO P1 SPEED=0.3MODE=CONTINUOUS (confidence 0.72), MOVE LIN TO P1 SPEED=0.3MODE=BLEND (confidence 0.18), MOVE LIN TO P1 SPEED=0.3 (confidence 0.10). These candidate instructions and confidence level prompts are presented to the user to confirm the results, ultimately generating intermediate language instructions that conform to the intermediate language standard. Through the above implementation methods, candidate solutions can be generated even when encountering non-standard writing that cannot be directly mapped, thereby avoiding program parsing interruption, ensuring the integrity of cross-platform conversion, and the user's selection results can be fed back to the training set to further improve the model's recognition ability.
[0055] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.
[0056] This application also provides a robot language conversion device. It should be noted that the robot language conversion device of this application can be used to execute the robot language conversion method provided in this application. This device is used to implement the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0057] The following describes the robot language conversion device provided in the embodiments of this application.
[0058] Figure 3 This is a schematic diagram of a robot language conversion device according to an embodiment of this application. Figure 3 As shown, the device includes:
[0059] The acquisition unit 10 is used to acquire the robot's control program and construct an abstract syntax tree of the control program based on the control program and the syntax rule file of the robot language.
[0060] Specifically, the aforementioned control program is the entire code for the robot to perform actions, such as motion, I / O control, and logical judgments. The aforementioned syntax rule file is used to define the syntax specifications of the robot language. The syntax specifications include instruction keywords, parameter formats, statement structures, and logical control structures, so that the control program can be parsed into an abstract syntax tree according to the syntax rule file.
[0061] The first generation unit 20 is used to generate intermediate language instructions corresponding to the robot's instructions in the control program based on the abstract syntax tree and the preset intermediate language instruction mapping table. The robot's instructions and the intermediate language instructions correspond one-to-one. The intermediate language instruction mapping table is a mapping relationship table between the robot language and the intermediate language.
[0062] Specifically, the intermediate language instruction mapping table defines a one-to-one correspondence between the manufacturer's language and the intermediate language. For each robot instruction in the abstract syntax tree, the intermediate language instruction mapping table is consulted to convert it into the corresponding intermediate language instruction.
[0063] In the above embodiments, the robot's control program is first acquired by the acquisition unit, and an abstract syntax tree is constructed based on the control program and the robot language syntax rule file. Then, the first generation unit generates intermediate language instructions corresponding to the robot's instructions in the control program based on the abstract syntax tree and a preset intermediate language instruction mapping table. This solution, by constructing an abstract syntax tree and combining it with an intermediate language instruction mapping table, allows instructions from different manufacturers to be converted into a unified set of intermediate language instructions. This achieves "write once, use across multiple platforms," meaning developers only need to master the rules of the intermediate language without learning the proprietary syntax of each manufacturer. This significantly improves work efficiency and reduces maintenance costs, solving the problem of low work efficiency caused by different industrial robot manufacturers using different programming languages and the need to repeatedly write programs for different brands of robots for the same function.
[0064] In one alternative embodiment, the acquisition unit includes: a first processing module, configured to process the control program using a rule engine to obtain a keyword sequence of the control program, wherein the keyword sequence represents a set of keywords of the control program; and a first determining module, configured to determine the semantic category of each keyword in the keyword sequence according to the syntax rule file, and construct the abstract syntax tree of the control program according to the semantic category.
[0065] In the above embodiments, the rule engine performs lexical segmentation of the control program according to the grammar rule file and generates a keyword sequence. Then, based on the same grammar rule file, semantic categories are assigned to the keywords, and finally, an abstract syntax tree is constructed. This transforms the originally ambiguous multi-vendor robot program, presented in text form, into a structured, computable, and reproducible program representation. This reduces the error rate of parsing and the cost of manual intervention, providing stable input for subsequent intermediate language mapping, parameter normalization, trajectory optimization, and validation insertion. Furthermore, since specific language differences are described in the grammar rule file, if a new robot language needs to be supported, only the grammar file needs to be updated, without modifying the underlying parsing program. This improves cross-vendor scalability and maintenance efficiency, further enhancing work efficiency.
[0066] Specifically, the aforementioned rule engine is an automated parsing tool based on preset syntax rules. It scans the source code of the control program character by character and identifies consecutive character combinations as the smallest units with independent meaning, namely keywords. The set of these keywords is constructed into the aforementioned keyword sequence.
[0067] In another alternative, the acquisition unit further includes: a second determining module, used to determine the non-standard instructions that the rule engine failed to process; and a second processing module, used to process the non-standard instructions using a pre-trained first neural network model to obtain the semantic category of each keyword in the non-standard instructions, and to construct the abstract syntax tree of the control program based on the semantic category.
[0068] In the above embodiments, when the rule engine fails to parse a portion of the control program and produces non-standard instructions that fail to process, a pre-trained first neural network model is introduced for supplementary processing. This first neural network model can semantically classify keywords in non-standard instructions, thereby determining whether the instruction belongs to categories such as motion control, parameter setting, logical judgment, or I / O operation. Based on this, it continues to construct an abstract syntax tree, thus expanding the system's applicability and enabling correct parsing of code with vendor-specific syntax, abbreviations, or comment interference. Furthermore, it avoids the problem of entire program parsing being interrupted due to individual statements not conforming to syntax rules. Through this method, the abstract syntax tree remains complete and continuous, and subsequent intermediate language mapping and conversion can proceed smoothly, thereby improving the overall parsing success rate and further enhancing work efficiency.
[0069] Specifically, the aforementioned first neural network model includes a convolutional neural network model. The training process includes: firstly, collecting standard instructions and non-standard instructions with abbreviations, annotations, or grammatical variations from robot language programs from different manufacturers, and semantically labeling keywords to form training corpora; then, using a model structure such as a convolutional neural network or a combination thereof, segmenting control program fragments into word input models, the model learns the semantic relationship between keywords and context in multi-layer nonlinear mapping, and outputs the semantic category corresponding to each word; after training, the first neural network model can intervene when the rule engine fails to parse, automatically performing semantic determination on keywords of non-standard instructions, and outputting labels such as motion type, parameter category, or logic control, thereby ensuring the complete construction of the abstract syntax tree and providing a reliable semantic foundation for subsequent intermediate language instruction mapping.
[0070] In some exemplary embodiments of this application, the first generation unit includes: a traversal module, configured to traverse the abstract syntax tree to obtain multiple nodes of the abstract syntax tree corresponding to each instruction; a third determination module, configured to determine the target intermediate language instruction corresponding to the multiple nodes according to the intermediate language instruction mapping table; and a filling module, configured to fill the target intermediate language instruction into a preset first instruction template to obtain the intermediate language instruction corresponding to the instruction.
[0071] In the above embodiments, the constructed abstract syntax tree is first traversed to identify the corresponding node for each instruction in the control program. Then, using a pre-defined intermediate language instruction mapping table, each node is matched and converted to determine its target instruction type in the intermediate language, and the parameter information in the source program is standardized according to the mapping relationship. Finally, for the identified target intermediate language instruction and the corresponding first instruction template, the parameter information is filled into the placeholders in the template item by item to generate a uniformly formatted and semantically clear intermediate language instruction. Through this process, robot instructions originally belonging to different manufacturers and with different syntaxes are all transformed into a structurally consistent intermediate language representation.
[0072] In some further exemplary embodiments of this application, the third determining module includes: a determining submodule, configured to mark the nodes as semantically different nodes when it fails to determine the target intermediate language instructions corresponding to the multiple nodes according to the intermediate language instruction mapping table;
[0073] The processing submodule is used to process the above semantic difference nodes using a pre-trained second neural network model to obtain multiple candidate intermediate language instructions and the confidence values corresponding to each of the above candidate intermediate language instructions.
[0074] The generation submodule is used to generate prompt information containing each of the above-mentioned candidate intermediate language instructions and the confidence value corresponding to each of the above-mentioned candidate intermediate language instructions, so as to prompt the determination of the target candidate intermediate language instruction among the multiple above-mentioned candidate intermediate language instructions.
[0075] In the above embodiments, when a corresponding relationship cannot be found in the conventional mapping table, the node is automatically marked as a semantically different node and then processed by a pre-trained second neural network model. The second neural network model can combine context and historical samples to infer several possible intermediate language instructions corresponding to the node, provide a confidence value for each candidate result, and further generate prompts containing candidate instructions and their confidence levels for user confirmation or selection. This mechanism ensures that instructions that do not conform to standard syntax can be processed, preventing overall program parsing failure. Furthermore, users can make selections or corrections from the candidate results, ensuring the conversion result meets expectations, improving cross-platform conversion coverage, and enhancing applicability in real-world engineering environments.
[0076] Specifically, the second neural network model can be a Transformer model (a type of neural network model).
[0077] In one alternative embodiment, the apparatus further includes: a second generation unit, configured to generate control instructions for the target controlled robot based on the intermediate language instructions and the second instruction template of the target controlled robot; and an addition module, configured to add verification instructions to the control instructions to obtain the final control instructions for the target controlled robot, wherein the verification instructions are used to verify the motion trajectory of the target controlled robot executing the control instructions.
[0078] In the above embodiments, after the intermediate language instructions are generated through abstract syntax tree mapping, a second instruction template for the target robot manufacturer is determined based on these intermediate language instructions. This generates control instructions that the robot can directly recognize and execute. Thus, robots from different brands can be converted into their respective manufacturer languages using the same intermediate language, thereby solving cross-platform compatibility issues. Additional verification instructions, such as trajectory simulation checks or position verifications, are added to these control instructions to ensure that the robot's motion trajectory is consistent with expectations when running according to the instructions. This guarantees that the generated control instructions conform to the syntactic and logical requirements of the target robot language, allowing for direct execution. Furthermore, the verification process avoids safety risks caused by trajectory deviations or parameter errors, thereby improving the reliability of program conversion and the safety of the execution process.
[0079] In another alternative embodiment, the above-mentioned device further includes a replacement unit, used to replace the macro definition in the control program with the program corresponding to the macro definition.
[0080] In the above embodiments, all macros existing in the control program in the form of symbols or aliases are replaced with their actual instructions or parameter contents, transforming the source program into a complete, independently parsable code. This eliminates the ambiguity and uncertainty caused by macros, facilitating subsequent lexical segmentation and syntax analysis, ensuring the complete and continuous construction of the abstract syntax tree. Furthermore, it avoids differences in macro expansion due to different field environments or controller versions, ensuring consistent semantics for the same program during conversion, thereby improving the accuracy and stability of intermediate language mapping. Simultaneously, after macro expansion, all motion parameters, I / O settings, etc., appear as explicit values, facilitating unit and value range checks and safety threshold verification, reducing trajectory deviation and execution risks, improving maintenance efficiency, and providing an input basis for subsequent trajectory simulation.
[0081] The aforementioned robot language conversion device includes a processor and a memory. The aforementioned acquisition unit and the aforementioned first generation unit, etc., are all stored as program units in the memory. The processor executes the aforementioned program units stored in the memory to achieve the corresponding functions. All of the aforementioned modules are located in the same processor; alternatively, the aforementioned modules may be located in different processors in any combination.
[0082] The processor contains a kernel, which retrieves the corresponding program unit from memory. One or more kernels can be configured, and their parameters can be adjusted. Currently, different industrial robot manufacturers use different programming languages, requiring the same function to be programmed repeatedly for different brands of robots, leading to low work efficiency.
[0083] The memory may include non-permanent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0084] This invention provides a computer-readable storage medium including a stored program, wherein, when the program is executed, it controls the device containing the computer-readable storage medium to perform the robot language conversion method.
[0085] Specifically, methods for converting robot language include:
[0086] Step S101: Obtain the robot's control program, and construct the abstract syntax tree of the control program based on the control program and the syntax rule file of the robot language.
[0087] Specifically, the aforementioned control program is the entire code for the robot to perform actions, such as motion, I / O control, and logical judgments. The aforementioned syntax rule file is used to define the syntax specifications of the robot language. The syntax specifications include instruction keywords, parameter formats, statement structures, and logical control structures, so that the control program can be parsed into an abstract syntax tree according to the syntax rule file.
[0088] Step S102: Based on the above abstract syntax tree and the preset intermediate language instruction mapping table, generate the intermediate language instructions corresponding to the robot's instructions in the control program. The robot's instructions and the intermediate language instructions correspond one-to-one. The intermediate language instruction mapping table is a mapping relationship table between the robot language and the intermediate language.
[0089] Specifically, the intermediate language instruction mapping table defines a one-to-one correspondence between the manufacturer's language and the intermediate language. For each robot instruction in the abstract syntax tree, the intermediate language instruction mapping table is consulted to convert it into the corresponding intermediate language instruction.
[0090] In one embodiment of this application, constructing an abstract syntax tree of the control program based on the control program and the syntax rule file of the robot language includes: processing the control program using a rule engine to obtain a keyword sequence of the control program, wherein the keyword sequence represents a set of keywords of the control program; determining the semantic category of each keyword in the keyword sequence based on the syntax rule file, and constructing the abstract syntax tree of the control program based on the semantic category.
[0091] In one embodiment of this application, after processing the control program with a rule engine to obtain the keyword sequence of the control program, the method further includes: determining non-standard instructions that the rule engine failed to process; processing the non-standard instructions with a pre-trained first neural network model to obtain the semantic category of each keyword in the non-standard instructions, and constructing the abstract syntax tree of the control program based on the semantic category.
[0092] In one embodiment of this application, generating intermediate language instructions corresponding to the robot's instructions in the control program based on the abstract syntax tree and a preset intermediate language instruction mapping table includes: traversing the abstract syntax tree to obtain multiple nodes of the abstract syntax tree corresponding to each instruction; determining target intermediate language instructions corresponding to multiple nodes according to the intermediate language instruction mapping table; and filling the target intermediate language instructions into a preset first instruction template to obtain the intermediate language instructions corresponding to the instructions.
[0093] In one embodiment of this application, determining the target intermediate language instruction corresponding to multiple nodes according to the intermediate language instruction mapping table includes: if determining the target intermediate language instruction corresponding to multiple nodes according to the intermediate language instruction mapping table fails, marking the nodes as semantic difference nodes; processing the semantic difference nodes using a pre-trained second neural network model to obtain multiple candidate intermediate language instructions and a confidence value corresponding to each candidate intermediate language instruction; and generating prompt information containing each candidate intermediate language instruction and the confidence value corresponding to each candidate intermediate language instruction to prompt the determination of the target candidate intermediate language instruction among the multiple candidate intermediate language instructions.
[0094] In one embodiment of this application, after generating the intermediate language instructions corresponding to the robot's instructions in the control program based on the abstract syntax tree and the preset intermediate language instruction mapping table, the method further includes: generating control instructions for the target robot based on the intermediate language instructions and the second instruction template of the target robot; adding verification instructions to the control instructions to obtain the final control instructions for the target robot, wherein the verification instructions are used to verify the motion trajectory of the target robot executing the control instructions.
[0095] In one embodiment of this application, after obtaining the robot's control program, the method further includes: replacing the macro definitions in the control program with the programs corresponding to the macro definitions.
[0096] This invention provides a robot language conversion system. The system includes a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, it performs at least the following steps:
[0097] Specifically, methods for converting robot language include:
[0098] Step S101: Obtain the robot's control program, and construct the abstract syntax tree of the control program based on the control program and the syntax rule file of the robot language.
[0099] Specifically, the aforementioned control program is the entire code for the robot to perform actions, such as motion, I / O control, and logical judgments. The aforementioned syntax rule file is used to define the syntax specifications of the robot language. The syntax specifications include instruction keywords, parameter formats, statement structures, and logical control structures, so that the control program can be parsed into an abstract syntax tree according to the syntax rule file.
[0100] Step S102: Based on the above abstract syntax tree and the preset intermediate language instruction mapping table, generate the intermediate language instructions corresponding to the robot's instructions in the control program. The robot's instructions and the intermediate language instructions correspond one-to-one. The intermediate language instruction mapping table is a mapping relationship table between the robot language and the intermediate language.
[0101] Specifically, the intermediate language instruction mapping table defines a one-to-one correspondence between the manufacturer's language and the intermediate language. For each robot instruction in the abstract syntax tree, the intermediate language instruction mapping table is consulted to convert it into the corresponding intermediate language instruction.
[0102] The devices mentioned in this article can be servers, PCs, tablets, mobile phones, etc.
[0103] In one embodiment of this application, constructing an abstract syntax tree of the control program based on the control program and the syntax rule file of the robot language includes: processing the control program using a rule engine to obtain a keyword sequence of the control program, wherein the keyword sequence represents a set of keywords of the control program; determining the semantic category of each keyword in the keyword sequence based on the syntax rule file, and constructing the abstract syntax tree of the control program based on the semantic category.
[0104] In one embodiment of this application, after processing the control program with a rule engine to obtain the keyword sequence of the control program, the method further includes: determining non-standard instructions that the rule engine failed to process; processing the non-standard instructions with a pre-trained first neural network model to obtain the semantic category of each keyword in the non-standard instructions, and constructing the abstract syntax tree of the control program based on the semantic category.
[0105] In one embodiment of this application, generating intermediate language instructions corresponding to the robot's instructions in the control program based on the abstract syntax tree and a preset intermediate language instruction mapping table includes: traversing the abstract syntax tree to obtain multiple nodes of the abstract syntax tree corresponding to each instruction; determining target intermediate language instructions corresponding to multiple nodes according to the intermediate language instruction mapping table; and filling the target intermediate language instructions into a preset first instruction template to obtain the intermediate language instructions corresponding to the instructions.
[0106] In one embodiment of this application, determining the target intermediate language instruction corresponding to multiple nodes according to the intermediate language instruction mapping table includes: if determining the target intermediate language instruction corresponding to multiple nodes according to the intermediate language instruction mapping table fails, marking the nodes as semantic difference nodes; processing the semantic difference nodes using a pre-trained second neural network model to obtain multiple candidate intermediate language instructions and a confidence value corresponding to each candidate intermediate language instruction; and generating prompt information containing each candidate intermediate language instruction and the confidence value corresponding to each candidate intermediate language instruction to prompt the determination of the target candidate intermediate language instruction among the multiple candidate intermediate language instructions.
[0107] In one embodiment of this application, after generating the intermediate language instructions corresponding to the robot's instructions in the control program based on the abstract syntax tree and the preset intermediate language instruction mapping table, the method further includes: generating control instructions for the target robot based on the intermediate language instructions and the second instruction template of the target robot; adding verification instructions to the control instructions to obtain the final control instructions for the target robot, wherein the verification instructions are used to verify the motion trajectory of the target robot executing the control instructions.
[0108] In one embodiment of this application, after obtaining the robot's control program, the method further includes: replacing the macro definitions in the control program with the programs corresponding to the macro definitions.
[0109] It is obvious to those skilled in the art that the modules or steps of the present invention described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. They can be implemented using computer-executable program code, and thus can be stored in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those described herein, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, the present invention is not limited to any particular combination of hardware and software.
[0110] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0111] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0112] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0113] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0114] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0115] Memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0116] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0117] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0118] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0119] As can be seen from the above description, the embodiments of this application achieve the following technical effects:
[0120] 1) The robot language method of this application first obtains the robot's control program and constructs an abstract syntax tree for the control program based on the control program and the robot language syntax rule file; then, based on the abstract syntax tree and a preset intermediate language instruction mapping table, it generates intermediate language instructions corresponding to the robot's instructions in the control program. This solution, by constructing an abstract syntax tree and combining it with an intermediate language instruction mapping table, allows instructions from different manufacturers to be converted into a unified set of intermediate language instructions, thus achieving "write once, use across multiple platforms." Developers only need to master the rules of the intermediate language, without needing to learn the proprietary syntax of each manufacturer. This achieves "write once, use across multiple brands," significantly improving work efficiency and reducing maintenance costs. It solves the problem of low work efficiency caused by different industrial robot manufacturers using different programming languages and the need to repeatedly write programs for different brands of robots for the same function.
[0121] 2) The robot language conversion device of this application first acquires the robot's control program through an acquisition unit, and constructs an abstract syntax tree of the control program based on the control program and the robot language syntax rule file; then, the first generation unit generates intermediate language instructions corresponding to the robot's instructions in the control program based on the abstract syntax tree and a preset intermediate language instruction mapping table. This solution, by constructing an abstract syntax tree and combining it with an intermediate language instruction mapping table, allows instructions from different manufacturers to be converted into a unified set of intermediate language instructions, thus achieving "write once, use on multiple platforms." Developers only need to master the rules of the intermediate language, without needing to learn the proprietary syntax of each manufacturer, achieving "write once, use on multiple brands," significantly improving work efficiency and reducing maintenance costs. This solves the problem of low work efficiency caused by different industrial robot manufacturers using different programming languages and the need to repeatedly write programs for different brands of robots for the same function.
[0122] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A method of converting a robot language, characterized by, The method comprises: obtaining a control program of a robot, and constructing an abstract syntax tree of the control program according to the control program and a syntax rule file of a robot language; generating intermediate language instructions corresponding to instructions of the robot in the control program based on the abstract syntax tree and a preset intermediate language instruction mapping table, the instructions of the robot corresponding to the intermediate language instructions one by one, and the intermediate language instruction mapping table being a mapping relationship table of the robot language and the intermediate language.
2. The method of claim 1, wherein, The method of constructing an abstract syntax tree of a control program according to the control program and a syntax rule file of a robot language comprises: processing the control program by using a rule engine to obtain a keyword sequence of the control program, the keyword sequence representing a set of keywords of the control program; determining semantic categories of the keywords in the keyword sequence according to the syntax rule file, and constructing the abstract syntax tree of the control program according to the semantic categories.
3. The method of claim 2, wherein, After processing the control program by using the rule engine to obtain the keyword sequence of the control program, the method further comprises: determining non-standard instructions in which the rule engine fails to process; processing the non-standard instructions by using a pre-trained first neural network model to obtain the semantic categories of the keywords in the non-standard instructions, and constructing the abstract syntax tree of the control program according to the semantic categories.
4. The method of claim 1, wherein, The method of generating intermediate language instructions corresponding to instructions of the robot in the control program based on the abstract syntax tree and a preset intermediate language instruction mapping table comprises: traversing the abstract syntax tree to obtain a plurality of nodes of the abstract syntax tree corresponding to the instructions; determining target intermediate language instructions corresponding to a plurality of the nodes according to the intermediate language instruction mapping table; filling the target intermediate language instructions into a preset first instruction template to obtain the intermediate language instructions corresponding to the instructions.
5. The method of claim 4, wherein, The method of determining target intermediate language instructions corresponding to a plurality of the nodes according to the intermediate language instruction mapping table comprises: in a case where the determination of the target intermediate language instructions corresponding to a plurality of the nodes according to the intermediate language instruction mapping table fails, marking the nodes as semantic difference nodes; processing the semantic difference nodes by using a pre-trained second neural network model to obtain a plurality of candidate intermediate language instructions and a confidence value corresponding to each of the candidate intermediate language instructions; generating prompt information containing each of the candidate intermediate language instructions and the confidence value corresponding to each of the candidate intermediate language instructions to prompt determination of a target candidate intermediate language instruction from the plurality of the candidate intermediate language instructions.
6. The method of claim 1, wherein, After generating intermediate language instructions corresponding to instructions of the robot in the control program based on the abstract syntax tree and a preset intermediate language instruction mapping table, the method further comprises: generating control instructions of a target control robot according to the intermediate language instructions and a second instruction template of the target control robot. The control instruction is added with a check instruction to obtain final control instructions of the target control robot, and the check instruction is used to verify a motion track of the target control robot executing the control instruction.
7. The method of claim 1, wherein, After the control program of the robot is acquired, the method further includes: The macro definition in the control program is replaced with a corresponding program of the macro definition.
8. A robot language conversion apparatus characterized by comprising: The method comprises the following steps: An acquisition unit is configured to acquire a control program of a robot and construct an abstract syntax tree of the control program according to the control program and a syntax rule file of a robot language; A generation unit is configured to generate intermediate language instructions corresponding to instructions of the robot in the control program based on the abstract syntax tree and a preset intermediate language instruction mapping table, the instructions of the robot and the intermediate language instructions one-to-one corresponding, and the intermediate language instruction mapping table being a mapping relationship table of the robot language and the intermediate language.
9. A computer-readable storage medium, characterized in that, The computer readable storage medium comprises a stored program, wherein the program controls a device where the computer readable storage medium is located to execute the method in any one of claims 1 to 7 when the program is running.
10. A system for converting between robot languages, characterized by The method comprises the following steps: One or more processors, memories, and one or more programs, wherein the one or more programs are stored in the memories and configured to be executed by the one or more processors, and the one or more programs comprise a program for executing the method in any one of claims 1 to 7.