Visual process and DSL code bidirectional conversion editing method and related device
Patent Information
- Application Number
- CN202610476447.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-04-13
- Publication Date
- 2026-08-04
AI Technical Summary
[0006]本发明实施例提出一种RPA可视化流程与DSL代码双向转换编辑方法、装置、设备及介质,用以解决相关技术中RPA设计仅支持单一编辑模式存在的开发效率低、用户使用体验差的技术问题
本发明实施例中一种RPA可视化流程与DSL代码双向转换编辑方法,通过定义预设DSL语法规范,在接收到正向转换指令后,基于预设DSL语法规范将第一目标RPA可视化流程转换为第一目标DSL代码,进而实现正向转换;在接收到逆向转换指令后,基于预设DSL语法规范将第二目标DSL代码转换为第二目标可视化流程,进而实现RPA可视化流程与DSL代码的双向转换,解决相关技术中RPA平台仅支持单一编辑模式,无法为用户提供可视化流程与DSL代码双向转换存在的编辑效率低、用户使用体验差的技术问题;提供了一种可根据用户需求进行可视化流程与代码的双向转换,进而提供用户开发编辑效率、提升用户使用体验的RPA可视化流程与DSL代码双向转换编辑方法。
Smart Images

Figure CN122507359A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of robotic process automation technology, and in particular to a method and related equipment for bidirectional conversion and editing of visual processes and DSL codes. Background Technology
[0002] RPA: Robotic Process Automation.
[0003] DSL: Domain-Specific Language.
[0004] In traditional design, developers orchestrate automated processes in two ways: 1. Visual image editing, where users drag and drop graphics to build automated processes; 2. Pure code editing, where some users write code to describe the process logic. However, traditional RPA platforms generally do not support code editing, or only support one-way export without bidirectional conversion. Because RPA platforms only support a single editing mode, in some editing scenarios (such as when dealing with a large number of repetitive node configurations, the efficiency of graphical drag-and-drop is far lower than that of batch code editing), editing efficiency is low. Furthermore, the inability to provide users with bidirectional conversion between processes and code leads to technical problems such as low RPA process development efficiency and poor user experience.
[0005] Therefore, how to solve the problems of low development efficiency and poor user experience caused by the inability to achieve bidirectional conversion between processes and code in related technologies, and the fact that RPA design only supports a single editing mode, has become a technical challenge that needs to be overcome by those skilled in the art. Summary of the Invention
[0006] This invention proposes a method, apparatus, device, and medium for bidirectional conversion and editing of RPA visual workflow and DSL code, in order to solve the technical problems of low development efficiency and poor user experience in related technologies where RPA design only supports a single editing mode.
[0007] In a first aspect, one embodiment of the present invention provides a method for bidirectional conversion and editing of RPA visualization workflow and DSL code, comprising: Receive forward conversion command; Based on the preset DSL syntax specification, the first target RPA visualization process is converted into the first target DSL code; Receive reverse conversion instructions; Based on the preset DSL syntax specification, the second target DSL code is converted into a second target RPA visualization process.
[0008] The attack detection and blocking method for large language model agents according to the embodiments of the present invention has at least the following beneficial effects: This invention provides a bidirectional conversion and editing method for RPA visual workflows and DSL code. By defining a preset DSL syntax specification, upon receiving a forward conversion instruction, the method converts a first target RPA visual workflow into a first target DSL code based on the preset DSL syntax specification, thus achieving forward conversion. Upon receiving a reverse conversion instruction, the method converts a second target DSL code into a second target visual workflow based on the preset DSL syntax specification, thereby achieving bidirectional conversion between RPA visual workflows and DSL code. This solves the technical problem in related technologies where RPA platforms only support a single editing mode, failing to provide users with bidirectional conversion between visual workflows and DSL code, resulting in low editing efficiency and poor user experience. This invention provides a method for bidirectional conversion and editing between RPA visual workflows and DSL code that can be performed according to user needs, thereby improving user development and editing efficiency and enhancing user experience.
[0009] According to other embodiments of the RPA visualization process and DSL code bidirectional conversion and editing method of the present invention, the preset DSL syntax specification includes: Syntax specifications are set for process information declaration, process parameter declaration, variable declaration, activity node metadata annotation, ordinary activity nodes, container nodes, and multiple assignment nodes.
[0010] According to other embodiments of the RPA visualization process and DSL code bidirectional conversion and editing method of the present invention, the step of converting the first target RPA visualization process into the first target DSL code based on the preset DSL syntax specification includes: Obtain the first FlowTree data object corresponding to the first target RPA visualization process; Based on the first FlowTree data object, generate process information code segments and process parameter declaration code segments according to the preset DSL syntax specification; Recursively traverse the first FlowTree data object to obtain multiple active nodes; Based on the preset DSL syntax specification, the multiple active nodes are respectively converted into multiple corresponding active node DSL code segments.
[0011] According to other embodiments of the RPA visualization process and DSL code bidirectional conversion and editing method of the present invention, the plurality of active nodes include ordinary node type, container node type, multi-assignment node type and data node filtering type.
[0012] According to other embodiments of the RPA visualization process and DSL code bidirectional conversion and editing method of the present invention, the step of converting the first target RPA visualization process into the first target DSL code based on the preset DSL syntax specification further includes: A preset function is used to generate indentation space strings for the corresponding level to achieve indentation level management; as well as, For data objects of the preset type in the first FlowTree data object, no conversion is performed and an error message is returned.
[0013] According to other embodiments of the RPA visualization process and DSL code bidirectional conversion and editing method of the present invention, the step of converting the second target DSL code into the second target RPA visualization process based on the preset DSL syntax specification includes: Create an empty FlowTree JSON data structure; The second target DSL code is parsed line by line based on the preset DSL syntax specification to obtain the second FlowTree data object; The second target RPA visualization process is obtained by processing the data based on the second FlowTree data.
[0014] According to other embodiments of the RPA visualization process and DSL code bidirectional conversion and editing method of the present invention, before the step of parsing the second target DSL code line by line based on the preset DSL syntax specification to obtain the second FlowTree data object, the method further includes: The second target DSL code is preprocessed.
[0015] Secondly, one embodiment of the present invention provides an RPA visualization workflow and DSL code bidirectional conversion and editing device, comprising: The first instruction receiving module is used to receive forward conversion instructions; The forward conversion engine is used to convert the first target RPA visual process into the first target DSL code based on the preset DSL syntax specification; The second instruction receiving module is used to receive reverse conversion instructions; A reverse engineering engine is used to convert the second target DSL code into a second target RPA visualization process based on the preset DSL syntax specification.
[0016] Thirdly, an embodiment of the present invention provides an RPA visualization process and DSL code bidirectional conversion and editing device, including a memory and at least one processor, wherein the memory stores instructions, and the memory and the at least one processor are interconnected via a line; The at least one processor invokes the instructions in the memory to cause the RPA visualization process and DSL code bidirectional conversion and editing device to execute the RPA visualization process and DSL code bidirectional conversion and editing method as described above.
[0017] Fourthly, one embodiment of the present invention provides a computer-readable storage medium storing an executable program, which is executed by a processor to implement the RPA visualization process and DSL code bidirectional conversion and editing method as described above. Attached Figure Description
[0018] Figure 1 This is a schematic diagram illustrating the steps of a specific embodiment of a method for bidirectional conversion and editing of RPA visualization process and DSL code according to an embodiment of the present invention; Figure 2 This is a schematic diagram of a specific embodiment of step S200, which includes sub-steps, in a bidirectional conversion and editing method for RPA visualization workflow and DSL code according to an embodiment of the present invention. Figure 3 This is a schematic diagram of a specific embodiment of a method for bidirectional conversion and editing of RPA visualization process and DSL code according to an embodiment of the present invention, which includes step S200 and other sub-steps. Figure 4 This is a schematic diagram of a specific embodiment of step S400, which includes sub-steps, in a bidirectional conversion and editing method for RPA visualization workflow and DSL code according to an embodiment of the present invention. Figure 5 This is a schematic diagram of the module composition of a specific embodiment of an RPA visualization process and DSL code bidirectional conversion and editing device according to an embodiment of the present invention; Figure 6 This is a schematic diagram of the module composition structure of a specific embodiment of an RPA visualization process and DSL code bidirectional conversion and editing device according to an embodiment of the present invention. Detailed Implementation
[0019] The following will describe the inventive concept and its resulting technical effects clearly and completely with reference to embodiments, so as to fully understand the purpose, features and effects of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, not all of them. Other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are all within the scope of protection of the present invention.
[0020] In the description of the embodiments of the present invention, the term "several" means one or more, and the term "multiple" means two or more. The terms "greater than," "less than," and "exceeding" should be understood as excluding the stated number, while the terms "above," "below," and "within" should be understood as including the stated number. The terms "first" and "second" should be understood as distinguishing technical features, and not as indicating or implying relative importance, the number of indicated technical features, or the order of the indicated technical features.
[0021] Reference Figure 1 This invention provides a method for bidirectional conversion and editing between RPA visual workflow and DSL code. Applied to RPA workflow design tools / platforms, it aims to provide users with bidirectional conversion between visual workflow editing and code editing, allowing users to make adaptive choices based on current needs and improve development efficiency. Specifically, it includes the following steps: S100, Receive forward conversion command; In this embodiment, the forward conversion instruction is an instruction to convert the RPA visual process into DSL code. In practical applications, when a user clicks the "Source Code" tab provided in the RPA designer interface, the RPA designer responds to the user's request and initiates the function of converting the RPA visual process into DSL code.
[0022] S200: Based on the preset DSL syntax specification, the first target RPA visualization process is converted into the first target DSL code; The default DSL syntax specification defines a proprietary syntax specification for RPA visualization processes. The first target RPA visualization process is the RPA visualization process included in the current process editing interface (canvas). In practice, when a user initiates the function to convert the RPA visualization process into DSL code, the RPA designer interface is rendered as a code mode editor component. At this point, after converting the first target RPA visualization process into first target DSL code, the user can edit the code in the code mode editor interface, thereby editing the process logic. The second target DSL code is obtained after the user edits the code based on the first target DSL code.
[0023] S300, receives reverse conversion instructions; In this embodiment, the reverse conversion instruction is an instruction to convert DSL code into an RPA visual process. In specific applications, the RPA designer responds to user requests and initiates the function of converting DSL code into an RPA visual process by clicking a button provided in the code editing mode editor interface, clicking the "Canvas" tab in the RPA designer interface, or when the user initiates a process execution operation in code mode.
[0024] S400: Based on the preset DSL syntax specification, the second target DSL code is converted into a second target RPA visualization process.
[0025] The second target DSL code is the code content obtained by the user after editing the first target DSL code obtained in step S200. The second target code can correspond to one or more RPA visualization processes. In this embodiment, after the user enables the conversion of the second target DSL code into a second target RPA visualization process, the RPA designer converts the second target DSL code into a second target RPA visualization process based on the preset DSL syntax specification, and triggers the re-rendering of the visualization canvas. The converted second target RPA visualization process is then displayed graphically on the canvas, allowing the user to edit it graphically by dragging and dropping.
[0026] This invention provides a method for bidirectional conversion and editing of RPA visualization workflows and DSL code. By defining a preset DSL syntax specification, a first target RPA visualization workflow is converted into a first target DSL code to achieve forward conversion. Users can then edit the code based on the obtained first DSL code to obtain a second target DSL code. Based on the preset DSL syntax specification, the second target DSL code is converted into a second target visualization workflow, thus realizing both the RPA visualization workflow and the DSL code. This allows users to graphically drag and drop and edit the second target RPA visualization workflow on a visualization canvas. This solves the technical problem in related technologies where RPA platforms only support a single editing mode and cannot provide users with bidirectional conversion between visualization workflows and DSL code, resulting in low editing efficiency and poor user experience.
[0027] In some embodiments, in order to accurately and efficiently achieve bidirectional conversion between RPA visual processes and DSL code, the core components of the preset DSL syntax specification include: setting syntax specifications for process information declaration, process parameter declaration, variable declaration, activity node metadata annotation, ordinary activity nodes, container nodes, and multiple assignment nodes respectively.
[0028] Specifically, in practical applications, process information declarations use the prefix "#@" to declare the process's metadata, including the project name and process name. When converting DSL code to an RPA visual process, lines starting with "#" are comment lines and are ignored during the conversion. Examples include: "#@Project Name: My RPA Project" and "#@Process Name: Data Processing Process". Process parameter declarations use the keyword "@params" to declare the process's input / output parameters. The syntax is "@params<direction><type name><parameter name>=<default value>; @<description>", where direction supports In (input parameter), Out (output parameter), and InOut (bidirectional parameter); type name is the parameter's data type, such as System.String, System.Int32, System.Boolean, etc.; default value and description are optional. Variable declarations use the keyword "def" to define local variables within the current scope. The syntax is: "def<type name><variable name>=<initial value>; @<description>". Variables follow scoping rules: a variable defined in a sequence or branch structure is only visible within that scope. Activity node metadata annotation: Each activity node is identified in the code using metadata annotations such as "@id", "@name", and "@disabled". @id is required to maintain the unique identifier of the activity node during bidirectional conversion; @name is the display name of the activity; and @disabled indicates whether the activity is disabled. The syntax for a regular activity node is "[output variable = ]<fully qualified activity name>(attribute name1 = attribute value1, attribute name2 = attribute value2);". When an activity defines output parameters (OutArgument), the output variable name is written before the activity call, using assignment syntax. Attribute values use different serialization formats depending on the data type (string, number, boolean, object, etc.). The syntax for container nodes (including Sequence / If / Switch / Trigger / Parallel types) is as follows: container type activities end with a colon ";" to indicate that they contain child activities, and "end;" indicates the end of the container. For multi-branch containers (such as Then / Else in If, Cases / Default in Switch, and Try / Catches / Finally in TryCatch), they are marked with branch name tags. The syntax for multiple assignment nodes is to use the special AssignOperations property syntax, enclosing multiple assignment expressions of "variable name = value" in curly braces.
[0029] Reference Figure 2 In some embodiments, step S200 in the above embodiments specifically includes sub-steps: S210. Obtain the first FlowTree data object corresponding to the first target RPA visualization process; When a user enters the TabsBar component through the RPA designer interface and clicks the "Source Code" tab, the code editor component calls the forward transformation engine entry function parseFlowToCode() in the created hook of the Vue component lifecycle. This reads the FlowTree data object of the current process from the flow module of the Vuex state repository, which is the first FlowTree data object.
[0030] S220. Based on the first FlowTree data object, generate a process information declaration code segment and a process parameter declaration code segment according to the preset DSL syntax specification; In step S210, after obtaining the first FlowTree data object, the sub-function generateFlowInfoCodeStr() is called to read the project name and process name from the Vuex project module and generate the process information declaration code segment based on the preset DSL syntax specification; the sub-function generateFlowParamsCodeStr() is called to traverse the members array of the FlowTree data object and generate the process parameter declaration code segment based on the preset DSL syntax specification.
[0031] S230. Recursively traverse the first FlowTree data object to obtain multiple active nodes; Specifically, multiple activity nodes are obtained by recursively traversing the entire activity tree corresponding to the first FlowTree data object, starting from the root activity node, by calling the sub-function generateActivityCodeStr().
[0032] S240. Based on the preset DSL syntax specification, convert multiple active nodes into corresponding node DSL code segments.
[0033] The `generateActivityCodeStr()` sub-function recursively traverses the activity, determining its type based on the `type` field of each activity node. For ordinary node types, the conversion process includes: first, outputting the activity metadata (`@id` and `@name`), then checking for output parameters. If present, it generates assignment syntax, concatenates the full activity name and parentheses, and outputs all attributes line by line in the format "attribute name = attribute value", separated by commas, ending with a semicolon. For container node types (Sequence / If / Switch / Trigger / Parallel, etc.), the conversion process includes: first, outputting the activity metadata and attribute parameters, marking it as a container with a colon ":", and generating all variable declarations within that scope if the container has scope (`isScope` is true). For multi-branch containers, it outputs the branch label and sub-activity code within each branch by branch name. Finally, it ends with "end;". For multiple assignment node types, the conversion process includes: using a special `AssignOperations` attribute format, converting the JSON-parsed assignment operation list into a list of assignment expressions enclosed in curly braces. For data filtering node types, the conversion process includes: in addition to regular attributes, the list of filtering conditions in the FilterOperations attribute needs to be converted into a nested operator expression format.
[0034] Reference Figure 3 In some embodiments, to ensure the readability and standardization of the output first target DSL code; in this embodiment, step S200 of the above embodiment further includes a sub-step: S250. Use a preset function to generate indentation space strings for the corresponding level to achieve indentation level management; Specifically, the preset functions include the autoCompleteNull function, which manages indentation levels by setting the root activity indentation level to 0, its direct child activity indentation level to 1, and so on.
[0035] S260. Do not perform conversion on the preset type data object in the first FlowTree data object and return an error message.
[0036] Specifically, the bidirectional conversion and editing method between RPA visual flowcharts and DSL code in this embodiment of the invention does not support the conversion of seven associative data types, including state machine and flowchart types, into DSL code. The preset data types include: Transition, State, StateMachine, Flowchart, FlowStep, FlowSwitch, and FlowDecision. To achieve graceful degradation, when encountering the conversion of these seven associative data types (state machine and flowchart types) into DSL code, the RPA designer interface switches back to graphical editing mode and displays an error message to the user.
[0037] In some embodiments, during the process of converting the first FlowTree data object (first target RPA visualization process) into the first target DSL code in the above embodiments, when serializing the active attributes, different serialization strategies are executed according to the JavaScript data type of the attribute value: undefined / null types are serialized as empty values; string types first try JSON.parse to determine whether the value is enclosed in quotes, and then decide whether to add quotes; number / bigint types are directly output as numeric literals; boolean types are output as true or false; and object types are serialized as JSON strings.
[0038] Reference Figure 4 In some embodiments, after the first target RPA visualization process is converted into the first target DSL code, the user can edit it in code editing mode. The edited code is the second target DSL code. At this time, it is necessary to reverse convert the second target DSL code into the second target RPA visualization process. In the above embodiments, step S400 specifically includes the following sub-steps: S410. Create an empty FlowTree JSON data structure; In this embodiment, after the user completes code editing in the code editing mode interface, they obtain the second target DSL code. At this time, by clicking the button provided in the code editing mode editor interface as described above, or by clicking the "Canvas" tab in the RPA designer interface, or by the user initiating the flow execution operation in code mode, the saveCodeAsGraph() function is called to perform a reverse transformation to create a new instance of the CodeToFlow parser. The initEmptyFlowTree() function is called to create an empty FlowTree data structure, which contains a placeholder root Sequence node with a randomId of "null". The current cursor (currentActivity) is pointed to the root node. The cursor stack (queue) is initialized to an empty array.
[0039] S420. Based on the preset DSL syntax specification, the second target DSL code is parsed line by line to obtain the second FlowTree data object; Specifically, corresponding to the preset DSL syntax specification, during the line-by-line parsing process, for example, code lines starting with "#" are comment lines and are skipped during parsing. For flow parameter lines, i.e., code lines starting with "@params", regular expressions are used to extract the parameter direction, type name, parameter name, default value, and description, and an Argument object is created and added to the FlowTree's members array. For variable definition lines, i.e., code lines starting with "def", regular expressions are used to extract the type name, variable name, initial value, and description, and a Variable object is created and added to the variables array of the container where the current cursor resides. For activity metadata lines, i.e., code lines starting with "@id", "@name", or "@disabled", the corresponding values are extracted and temporarily stored in temporary variables, awaiting use by subsequent activity parsing. For end marker lines, i.e., lines containing "end;", the current cursor's activeBranchIndex is reset to 0, the previous cursor is popped from the cursor stack to restore the current cursor, achieving hierarchical backtracking. If none of the above types match, the current code line is determined to be the activity call line. At this point, the activity parsing sub-process is entered, which specifically includes extracting the activity name and parameter string using a regular expression: `const breakPre = / \s*([\w.]+(?:<[\w.]+>)?)\s*(|\((.*?)\))\s*[:|;] / ;`. The pattern of this regular expression is: fully qualified activity name(parameter):(container class) or fully qualified activity name(parameter);(normal node). Then, it is determined whether the activity name is a branch name (Then, Else, Try, etc.). If so, the activity branch index of the current container is switched. Otherwise, the corresponding activity template (ActivityInfo) is found based on the activity name to obtain the activity type: for container activity types, a new activity node is created based on the template, `randomId` and `displayName` are set, the attribute string is parsed and the attribute value is set, and the new activity is added to the activity list of the current cursor. Then, the current cursor is pushed onto the stack, and the current cursor is updated to the newly created container activity. For ordinary node activity types, a special regular expression is used to extract the output variable name, full activity name, and attribute string: constpre = / (|(\w+)\s*=\s*)([\w.]+(?:<\w+>)?)\((.*?)\); / ;, and an ordinary activity node is created according to the template, the output parameters and attribute values are set, and it is directly added to the activity list of the current cursor. For unknown activity types, the corresponding original activity node is found from the original process tree (i.e., the process tree corresponding to the first target RPA visualization process) according to randomId and deep copied, keeping the original structure unchanged.
[0040] Furthermore, some embodiments include attribute parsing and merging. Attribute strings are extracted one by one using a regular expression pattern of "attribute name = attribute value". The parsed attribute values are then merged with the corresponding activity attributes in the original process tree (using the `Object.assign` method) to ensure that attributes not modified in the code retain their original values. Additionally, an attribute validation phase is included. For each parsed activity (including container activity types and ordinary node activity types), its attributes are traversed, and a backend attribute validation service is called (via the WebSocket CodeCompilation channel). Validation includes type matching verification of attribute values and checks for required fields. If validation fails, an exception message is marked on the corresponding activity node.
[0041] S430. Perform data processing based on the second FlowTree data object to obtain the second target RPA visualization process.
[0042] In step S420, after obtaining the second FlowTree data object, the constructed second FlowTree data object is retrieved by calling `codeToFlow.getFlowData()`. The `saveCodeAsGraph()` function is then called to commit the second FlowTree data object to the `setFlowTree mutation` of the `flow` module using Vuex's `commit` method. Upon detecting the change in the FlowTree data object, Vue's reactive mechanism automatically triggers a re-rendering of the visualization canvas in the main container component, displaying the parsed flow tree graphically on the canvas. Finally, `setContainerTab("graph")` switches the `containerTab` state of the `ui` module in Vuex to "graph," hiding the code editor component and displaying the visualization canvas, thus completing the mode switch. In other embodiments, after the second FlowTree data object is committed to Vuex, the `saveFlow()` function is called to serialize the second FlowTree data object into a JSON string, which is then sent to the backend file storage service via a WebSocket communication channel (designerMarshaller) for persistent storage, ensuring that modifications made by the user in code mode are persistently saved to the flow file on the server.
[0043] In some embodiments, in order to ensure successful parsing of the second target DSL code and prevent interruptions or errors in the parsing process, this embodiment further includes the following step before step S410: S401, Preprocess the second target DSL code.
[0044] The preprocessing process specifically includes: 1. Merge function arguments that span multiple lines into a single line; handle newlines before the first argument and after the last argument, for example: Original DSL code: BitWorker.UI.Click( Selector = "button#submit", ClickType = "Single" ); After preprocessing, it becomes: BitWorker.UI.Click(Selector = "button#submit", ClickType = "Single"); (\n Selector→(Selector (remove newline and space after the left parenthesis and before the first parameter)) "Single"\n);→"Single"); (Remove the newline and space before the right parenthesis after the last parameter).
[0045] 2. Process multi-line strings in the second target DSL code, for example: replace newlines within triple quotes with escaped newline characters.
[0046] 3. Handling line breaks in the AssignOperations property with multiple assignments, for example: Original DSL code: BitWorker.Core.MultipleAssign( AssignOperations = { varA = "hello" varB = 123 } ); After preprocessing, the newline characters inside the AssignOperations value are removed: BitWorker.Core.MultipleAssign(AssignOperations = {varA = "hello"varB= 123}); This way, during subsequent line-by-line parsing, the entire assignment block of AssignOperations will be on the same line, making it easier for the parsePropValue method to extract all key-value pairs of "variable name = value" at once using the regular expression / (\w+)\s*=\s*({[^}]*}|[^,\s}]+) / g (codeToFlow.ts:356).
[0047] In this embodiment, the efficient execution of subsequent code reverse conversion is ensured by preprocessing the second target DSL code.
[0048] Reference Figure 5 This invention also provides a bidirectional conversion and editing device for RPA visualization processes and DSL code, comprising a first instruction receiving module, a forward conversion engine, a second instruction receiving module, and a reverse parsing engine. The first instruction receiving module receives forward conversion instructions, and the forward conversion engine converts a first target RPA visualization process into first target DSL code based on a preset DSL syntax specification. The second instruction receiving module receives reverse conversion instructions, and the reverse parsing engine converts a second target DSL code into a second target RPA visualization process based on a preset DSL syntax specification. In this embodiment, the working process and implementation principle of each module in the forward conversion (RPA visualization process to DSL code) and reverse parsing (DSL code to RPA visualization process) processes correspond to the bidirectional conversion and editing methods for RPA visualization processes and DSL code described in the above embodiments, and will not be repeated here.
[0049] The RPA visualization process and DSL code bidirectional conversion device provided in this embodiment of the invention defines a preset DSL syntax specification. Upon receiving a forward conversion instruction, it converts a first target RPA visualization process into a first target DSL code based on the preset DSL syntax specification, thereby achieving forward conversion. Upon receiving a reverse conversion instruction, it converts a second target DSL code into a second target visualization process based on the preset DSL syntax specification, thereby achieving bidirectional conversion between RPA visualization processes and DSL codes. This solves the technical problem in related technologies where RPA platforms only support a single editing mode and cannot provide users with bidirectional conversion between visualization processes and DSL codes, resulting in low editing efficiency and poor user experience.
[0050] Figure 6This is a schematic diagram of the structure of a bidirectional conversion and editing device for RPA visualization workflows and DSL code, provided in an embodiment of the present invention. The bidirectional conversion and editing device 500 can vary significantly due to different configurations or performance characteristics. It may include one or more central processing units (CPUs) 510 (e.g., one or more processors) and a memory 520, and one or more storage media 530 (e.g., one or more mass storage devices) for storing application programs 533 or data 532. The memory 520 and storage media 530 can be temporary or persistent storage. The program stored in the storage media 530 may include one or more modules (not shown in the diagram), each module including a series of instruction operations on the RPA visualization workflow and DSL code bidirectional conversion and editing device 500. Furthermore, the processor 510 may be configured to communicate with the storage media 530 and execute the series of instruction operations in the storage media 530 on the RPA visualization workflow and DSL code bidirectional conversion and editing device 500.
[0051] The RPA visualization workflow and DSL code bidirectional conversion and editing device 500 may also include one or more power supplies 540, one or more wired or wireless network interfaces 550, one or more input / output interfaces 560, and / or one or more operating systems 531, such as Windows Server, Mac OS X, Unix, Linux, FreeBSD, etc. Those skilled in the art will understand that... Figure 6 The illustrated structure of the RPA visualization workflow and DSL code bidirectional conversion and editing device does not constitute a limitation on the RPA visualization workflow and DSL code bidirectional conversion and editing device. It may include more or fewer components than illustrated, or combine certain components, or have different component arrangements.
[0052] This invention also provides a computer storage medium, wherein the computer-readable storage medium stores a computer-executable program, which, when executed by a processor, implements the RPA visualization process and DSL code bidirectional conversion and editing method described in any of the above embodiments.
[0053] The embodiments of the present invention have been described in detail above with reference to the accompanying drawings. However, the present invention is not limited to the above embodiments, and various changes can be made within the scope of knowledge possessed by those skilled in the art without departing from the spirit of the present invention. Furthermore, the embodiments of the present invention and the features thereof can be combined with each other unless otherwise specified.
Claims
1. A method for bidirectional conversion and editing of RPA visual workflow and DSL code, characterized in that, include: Receive forward conversion command; Based on the preset DSL syntax specification, the first target RPA visualization process is converted into the first target DSL code; Receive reverse conversion instructions; Based on the preset DSL syntax specification, the second target DSL code is converted into a second target RPA visualization process.
2. The RPA visualization workflow and DSL code bidirectional conversion and editing method according to claim 1, characterized in that, The preset DSL syntax specifications include: Syntax specifications are set for process information declaration, process parameter declaration, variable declaration, activity node metadata annotation, ordinary activity nodes, container nodes, and multiple assignment nodes.
3. The RPA visualization workflow and DSL code bidirectional conversion and editing method according to claim 1 or 2, characterized in that, The process of converting the first target RPA visualization process into first target DSL code based on the preset DSL syntax specification includes: Obtain the first FlowTree data object corresponding to the first target RPA visualization process; Based on the first FlowTree data object, generate process information code segments and process parameter declaration code segments according to the preset DSL syntax specification; Recursively traverse the first FlowTree data object to obtain multiple active nodes; Based on the preset DSL syntax specification, the multiple active nodes are respectively converted into multiple corresponding active node DSL code segments.
4. The RPA visualization workflow and DSL code bidirectional conversion and editing method according to claim 3, characterized in that, The multiple active nodes include ordinary node types, container node types, multi-assignment node types, and data node filtering types.
5. The RPA visualization workflow and DSL code bidirectional conversion and editing method according to claim 3, characterized in that, The process of converting the first target RPA visualization process into first target DSL code based on the preset DSL syntax specification also includes: A preset function is used to generate indentation space strings for the corresponding level to achieve indentation level management; as well as, For data objects of the preset type in the first FlowTree data object, no conversion is performed and an error message is returned.
6. The method for bidirectional conversion and editing of RPA visualization workflow and DSL code according to claim 1, 2, 4 or 5, characterized in that, The process of converting the second target DSL code into a second target RPA visualization based on the preset DSL syntax specification includes: Create an empty FlowTree JSON data structure; The second target DSL code is parsed line by line based on the preset DSL syntax specification to obtain the second FlowTree data object; The second target RPA visualization process is obtained by processing the data based on the second FlowTree data.
7. The RPA visualization workflow and DSL code bidirectional conversion and editing method according to claim 6, characterized in that, Before obtaining the second FlowTree data object by parsing the second target DSL code line by line based on the preset DSL syntax specification, the following steps are also included: The second target DSL code is preprocessed.
8. A bidirectional conversion and editing device for RPA visualization workflow and DSL code, characterized in that, include: The first instruction receiving module is used to receive forward conversion instructions; The forward conversion engine is used to convert the first target RPA visual process into the first target DSL code based on the preset DSL syntax specification; The second instruction receiving module is used to receive reverse conversion instructions; A reverse engineering engine is used to convert the second target DSL code into a second target RPA visualization process based on the preset DSL syntax specification.
9. A device for bidirectional conversion and editing of RPA visual workflow and DSL code, characterized in that, It includes a memory and at least one processor, wherein the memory stores instructions and the memory and the at least one processor are interconnected via lines; The at least one processor invokes the instructions in the memory to cause the RPA visualization process and DSL code bidirectional conversion and editing device to execute the RPA visualization process and DSL code bidirectional conversion and editing method as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores an executable program, which is executed by a processor to implement the RPA visualization process and DSL code bidirectional conversion and editing method as described in any one of claims 1-7.