Automatic process generation method and automatic process management system
The code generation model processes Chinese prompt words and automated process execution page images to generate automated process script codes, which solves the problem of failure of automated processes due to software updates or web page changes in the existing technology, and improves work efficiency and robustness.
Patent Information
- Application Number
- CN202311295916.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-08
- Publication Date
- 2024-10-22
AI Technical Summary
Existing automated processes are prone to failure when software versions are updated or web page element names or structures change, causing automated scripts to fail, increasing development costs and reducing work efficiency.
Using a code generation model, the text encoder, image encoder and aggregation decoder process Chinese prompt words and automated process execution page images to generate executable automated process script codes, reducing the need for manual coding.
It realizes automatic updating of script code when software is updated or web page elements change, which reduces development costs, improves work efficiency, and improves the robustness of the automated process.
Smart Images

Figure CN118819488A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to an automated process generation method and an automated process management system. Background Art
[0002] Robotic Process Automation (RPA) simulates manual operations through scripts and programs, thereby freeing workers from repetitive work, improving work efficiency, and reducing labor costs. Its automation process can be divided into system operation automation, network automation, browser automation, interface automation, office automation, email automation, database capability automation, artificial intelligence (AI) capability automation, message automation and other types according to different operating software. Different RPA can provide different levels of support for different types.
[0003] However, the existing automation process is relatively mechanical for operating elements. For example, software version updates may lead to changes in button positions, changes in web page element names or structures, changes in interface specifications used, or geological changes. These situations will cause the automation script to become invalid and require the script content to be updated, thereby increasing development costs and reducing work efficiency. Summary of the invention
[0004] In view of the problems existing in the prior art, the present invention provides an automated process generation method, comprising:
[0005] Get Chinese prompt words and automated process execution page images;
[0006] The Chinese prompt words and the automated process execution page image are input into a code generation model for processing; the code generation model includes a text encoder, a picture encoder and an aggregate decoder; the Chinese prompt words are processed by the text encoder to obtain a text code; the automated process execution page image is processed by the picture encoder to obtain a picture code; the text code and the picture code are processed by the aggregate decoder to obtain an automated process script code.
[0007] According to an automated process generation method provided by the present invention, the code generation model is trained in the following manner:
[0008] Acquire original data; the original data includes original Chinese prompt words, original operation video and original script code;
[0009] Processing the original Chinese prompt words according to the prompt word paradigm to obtain sample Chinese prompt words;
[0010] Capturing an automated step execution screenshot in the original operation video, and annotating elements of the automated step execution screenshot;
[0011] Decomposing the original script code to obtain script code slices corresponding to the automated step execution screenshot;
[0012] Determine the fine-tuning dataset based on Chinese prompt words and script codes in robot automation tasks;
[0013] Based on the sample Chinese prompt words, the automated step execution screenshots, the script code slices and the fine-tuning data set, the code generation model to be trained is trained to obtain the code generation model.
[0014] According to an automated process generation method provided by the present invention, before training a code generation model to be trained based on the sample Chinese prompt words, the automated step execution screenshots, the script code slices and the fine-tuning data set to obtain the code generation model, the method further includes:
[0015] Use the pre-trained model of the Chinese code generation model as the text encoder;
[0016] Use a pre-trained image-to-text model as the image encoder;
[0017] Use a generative pre-trained decoder model as the aggregate decoder;
[0018] Based on the text encoder, the picture encoder and the aggregate decoder, a code generation model to be trained is constructed.
[0019] According to an automated process generation method provided by the present invention, before the pre-trained model of the Chinese code generation model is used as a text encoder, the method further includes:
[0020] Get English prompt words;
[0021] Input the English prompt word into a translation model to obtain a Chinese translation result output by the translation model;
[0022] Inputting the Chinese translation result into a Chinese code generation model to obtain a code output by the Chinese code generation model;
[0023] Inputting the English prompt word into a pre-trained model of an English code generation model to obtain a code output by the pre-trained model of the English code generation model;
[0024] The code output by the Chinese code generation model is compared with the code output by the English code generation model, and the Chinese code generation model is trained by an optimizer based on the comparison result to obtain a pre-trained model of the Chinese code generation model.
[0025] According to an automated process generation method provided by the present invention, the code generation model to be trained is trained based on the sample Chinese prompt words, the automated step execution screenshots, the script code slices and the fine-tuning data set to obtain the code generation model, including:
[0026] Freeze the parameters of the text encoder and image encoder, and open the aggregate encoder for iterative training;
[0027] Generate prompt words for the current iteration training round based on sample Chinese prompt words of the historical iteration training round and the corresponding script code slices;
[0028] Inputting the prompt word and the execution page screenshot of the current iterative training round into the code generation model to be trained, and obtaining the current script code output by the code generation model to be trained;
[0029] After the current script code is executed on the robot automation process platform, a screenshot of the automation execution result is taken to obtain a screenshot of the current automation step execution;
[0030] The similarity between the current automated step execution screenshot and the automated step execution screenshot is determined as a loss function for back propagation to iteratively train the code generation model to be trained.
[0031] According to an automated process generation method provided by the present invention, after iteratively training the code generation model to be trained, the method further includes:
[0032] When the iterative training rounds reach a preset round, the code generation model to be trained is fine-tuned based on the fine-tuning data set, and the parameters of the text encoder, the image encoder and the aggregation encoder are opened for multiple rounds of training to obtain the code generation model.
[0033] The present invention also provides an automated process generation device, comprising:
[0034] An acquisition module is used to obtain Chinese prompt words and automated process execution page images;
[0035] A processing module is used to input the Chinese prompt words and the automated process execution page image into a code generation model for processing; the code generation model includes a text encoder, a picture encoder and an aggregate decoder; the Chinese prompt words are processed by the text encoder to obtain a text code; the automated process execution page image is processed by the picture encoder to obtain a picture code; the text code and the picture code are processed by the aggregate decoder to obtain an automated process script code.
[0036] The present invention also provides an automated process management system, comprising:
[0037] The service terminal is used to display a prompt word editing interface; receive the prompt word input in the prompt word editing interface, and send the prompt word to the server;
[0038] The server is used to input the prompt word into a code generation model, obtain the automation script code output by the code generation model, and execute the automation script code on a virtual machine;
[0039] The business terminal is further used to display the automation script code and the corresponding automation script code execution result; in response to the deployment operation, the automation script code is deployed to the robot automation process platform;
[0040] The robotic automation process platform is used to run the automation script code and execute the automation process.
[0041] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of the automated process generation method as described in any one of the above items are implemented.
[0042] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the steps of the automated process generation method as described in any one of the above items are implemented.
[0043] After obtaining the Chinese prompt words and the automated process execution page image, the embodiment of the present invention can process the Chinese prompt words through the text encoder in the code generation model to obtain the text code, and process the automated process execution page image through the image encoder in the code generation model to obtain the image code, and process the text code and the image code through the aggregation decoder in the code generation model to obtain an executable automated process script code file, thereby automatically generating the script code without manually writing code, and completing the robot automated process script writing with zero code, reducing development costs and improving work efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0045] Figure 1 It is a flowchart of an automated process generation method provided by an embodiment of the present invention;
[0046] Figure 2 is a schematic diagram of the architecture of a code generation model provided by an embodiment of the present invention;
[0047] Figure 3 It is a schematic diagram of the training process of the code generation model provided by an embodiment of the present invention;
[0048] Figure 4 is a pre-training flow chart of the Chinese code generation model provided by an embodiment of the present invention;
[0049] Figure 5 It is a schematic diagram of the flow of prompt word connection and determination provided by an embodiment of the present invention;
[0050] Figure 6 It is a structural schematic diagram of an automated process generation device provided by an embodiment of the present invention;
[0051] Figure 7 It is a schematic diagram of the structure of the automated process management system provided by an embodiment of the present invention;
[0052] Figure 8 It is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0053] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0054] In the field of artificial intelligence, with the rise of prompt tuning technology, the large model capabilities of natural language processing can significantly improve its understanding of human intentions in multiple deep learning fields. In the field of natural language processing itself, models fine-tuned based on the Generative Pre-trained Transformer (GPT) series and the Bidirectional Encoder Representation from Transformers (BERT) series of pre-trained models can achieve better results in downstream tasks such as question answering, filling in the blanks, continuation writing, summarization and classification.
[0055] Prompt words can make the GPT-3 model directly adapt to some simple tasks without fine-tuning, and after setting and fine-tuning the prompt word paradigm, it can be competent for more specialized tasks. For example, OpenAI's Dalle series models can form images of various styles close to the description according to the prompt words; Google's Imagen series models can form pictures and even videos through prompt words; Github's Copilot plug-in can realize code continuation and generate corresponding code according to comments; Photoshop, short video platforms, etc. can also generate stylized images and videos by combining pictures / videos with prompts. The classification of products based on prompt words can be seen in Table 1:
[0056] Prompt word enter Output product text Random Values image Dalle, Imagen text Random Values video Imagen text Code Code Copilot, Codex text image image Photoshop, short video platform text text text NovelAI
[0057] Table 1
[0058] Automated processes can be sensed using the following means:
[0059] 1) Image recognition identifies screen elements, which can be done through OCR recognition and target detection capabilities.
[0060] 2) Element review extracts elements from browser pages and documents, and can directly obtain corresponding information such as names, URLs, table data, etc.
[0061] The automated process can be operated using the following means:
[0062] 1) Click: You can simulate the mouse operation to move to the specified position to implement the click operation.
[0063] 2) Type: You can simulate keyboard input.
[0064] 3) Acquisition and insertion: It can realize the acquisition and insertion of the operation elements into the specified position.
[0065] 4) Interface call: You can use the corresponding interfaces that have been integrated into the RPA software, such as OCR interface, mail server interface, command line interface, database interface, and interfaces of various built-in services.
[0066] The automated process implements cross-software operation logic through perception and operation, and can simulate manual operations. It is currently widely used in various industries to improve work efficiency.
[0067] However, the existing automation process is relatively mechanical for operating elements. For example, software version updates may lead to changes in button positions, changes in web page element names or structures, changes in interface specifications used, or geological changes. These situations will cause the automation script to become invalid and require the script content to be updated, thereby increasing development costs and reducing work efficiency.
[0068] Figure 1 Schematic diagram of the process flow of the automated process generation method provided by the embodiment of the present invention. Figure 1 The embodiment of the present invention provides an automated process generation method, which may specifically include the following steps:
[0069] Step 101, obtaining Chinese prompt words and an automated process execution page image.
[0070] The automated process generation method provided in the embodiment of the present invention can be applied to a server to obtain Chinese prompt words and automated process execution page images for processing, thereby generating automated process script codes, so that a robot automation platform runs the automated process script codes and executes the automated process.
[0071] The Chinese prompt words may refer to the Chinese prompt words content input by the business personnel that conforms to the language habits of the business personnel. The automated process execution page image may refer to the screen page image containing the execution result obtained after the robot automation platform executes the previous automated process script code.
[0072] Step 102, input the Chinese prompt words and the automated process execution page image into a code generation model for processing; the code generation model includes a text encoder, a picture encoder and an aggregate decoder; the Chinese prompt words are processed by the text encoder to obtain a text code; the automated process execution page image is processed by the picture encoder to obtain a picture code; the text code and the picture code are processed by the aggregate decoder to obtain an automated process script code.
[0073] In the embodiment of the present invention, the Chinese prompt words and the automated process execution page image can be input into the code generation model for processing to obtain the automated process script code output by the code generation model.
[0074] Figure 2 Schematic diagram of the code generation model provided by the embodiment of the present invention. Figure 2 The code generation model may include a text encoder for processing Chinese prompt words, an image encoder for processing the image of the automated process execution page, and an aggregate decoder for aggregate encoding of the text encoding and the image encoding into the automated process script code. The code generation model may also include a text decoder for converting text into script code.
[0075] The text encoder may be a pre-trained text encoder, the text decoder may be a pre-trained text decoder, the image encoder may be a classification pre-trained image encoder, and the pre-trained aggregation decoder. After the model is trained, a usable script code generation model may be obtained through fine-tuning.
[0076] In an embodiment of the present invention, the automation process is described by using Chinese prompt words that conform to the language habits of business personnel, and the corresponding script can be automatically generated without code, so that the process automation robot script writing can be completed with zero code, reducing development costs and improving work efficiency.
[0077] In an embodiment of the present invention, an automated process execution page image can be displayed on the screen, and the position of the screen elements can be described by prompt words. The name changes are robust. If the script fails or an execution error occurs, the updated automated process script code can be obtained by re-entering the prompt words into the code generation model for reasoning, thereby reducing development costs and improving robustness.
[0078] In an embodiment of the present invention, in a scenario where there is a significant change in the automation process and corresponding process steps need to be added or reduced, the corresponding script code adjustment can be completed by directly modifying the prompt words, which is easy to adjust and convenient to operate.
[0079] In an embodiment of the present invention, the automation process is not directly linked to the code generation model, but the code generation model outputs the corresponding automation process script code for operation. The code generation model only generates code and does not occupy other computing resources, thereby reducing resource costs.
[0080] After obtaining the Chinese prompt words and the automated process execution page image, the embodiment of the present invention can process the Chinese prompt words through the text encoder in the code generation model to obtain the text code, and process the automated process execution page image through the image encoder in the code generation model to obtain the image code, and process the text code and the image code through the aggregation decoder in the code generation model to obtain an executable automated process script code file, thereby automatically generating the script code without manually writing code, and completing the robot automated process script writing with zero code, reducing development costs and improving work efficiency.
[0081] Figure 3 Schematic diagram of the training process of the code generation model provided by the embodiment of the present invention. Figure 3 First, we can prepare the original data, for example, process the original Chinese prompt words according to the prompt word paradigm to make a data set; at the same time, we can prepare a pre-trained large model, determine the loss function, and build a model structure. Then we can cluster train the model based on the data set, fine-tune the trained model, and test the model to obtain a code generation model.
[0082] In an optional embodiment, the code generation model may be trained by the following steps:
[0083] Step S11, obtaining original data; the original data includes original Chinese prompt words, original operation video and original script code.
[0084] Specifically, the code base of the RPA robot that is already in operation can be used as the data source, and the robot operation scripts with the top 20% average monthly usage can be selected as the original script code. The original script code can be recorded and manually annotated to obtain the corresponding original operation video and original Chinese prompt words.
[0085] Step S12, processing the original Chinese prompt words according to the prompt word paradigm to obtain sample Chinese prompt words.
[0086] Prompt words are an important part of the prompt word fine-tuning process. Prompt words with the same meaning may cause the code generation model to output completely different results. In an embodiment of the present invention, after obtaining the original Chinese prompt words, the original Chinese prompt words can be processed. Specifically, the original Chinese prompt words can be standardized according to the prompt word paradigm, so that the sample Chinese prompt words obtained after the standardized processing have accurate meaning, no ambiguity, and are easy to understand. The prompt word paradigm style can be shown in Table 2:
[0087]
[0088] Table 2
[0089] The embodiment of the present invention summarizes the steps of the automation process and annotates according to the prompt word paradigm, so that the code generation model can be more sensitive to paradigm language, recognize more accurately, and generate code more accurately. At the same time, it also has the ability to process non-paradigm language, ensuring that the generalization ability of the model is not lost.
[0090] Step S13, capturing a screenshot of the execution of the automation step in the original operation video, and annotating elements of the screenshot of the execution of the automation step.
[0091] In an embodiment of the present invention, the operation steps of the automation process can be decomposed, and screenshots can be taken according to the decomposed operation steps. Specifically, for each execution state, two screenshots of the automation step execution can be taken in the original operation video, one screenshot before the step is executed, and one screenshot of the result interface after the step is executed.
[0092] You can annotate common elements in screenshots of automated step execution. Specifically, you can annotate buttons, input boxes, multiple-select boxes, data boxes, and active window sizes as target detection types, and you can randomly sample all videos. The sampling results can include the starting coordinates and length and width of the element at the pixel level, which is used for pre-training of the image encoder.
[0093] Step S14, decomposing the original script code to obtain script code slices corresponding to the automated step execution screenshot.
[0094] In an embodiment of the present invention, when decomposing the operating steps of the automated process, the operating steps of the automated process can also be decomposed by comparing with the original operation video and the original script code to obtain multiple labeled operating steps, thereby obtaining script code slices corresponding to the automated step execution screenshots.
[0095] Specifically, when the original operation video screen interface jumps or switches, it can be decomposed into at least two operation steps; when making a call or processing the result, it can be independent of at least one operation step; when the original operation video screen interface undergoes various changes, the operation steps can be decomposed in a diversified manner to obtain script code slices corresponding to the operation steps of each automated process.
[0096] Step S15, determining a fine-tuning data set based on the Chinese prompt words and script codes in the robot automation task.
[0097] Specifically, among the thousands of robot automation tasks that are labeled, Chinese prompt words with clear meanings can be screened out, and the script codes corresponding to the Chinese prompt words can be reviewed and optimized to obtain the optimized script codes. The Chinese prompt words with clear meanings and the corresponding optimized script codes (high-quality texts) are used to form a fine-tuning data set consisting of multiple robot automation tasks.
[0098] Step S16, training the code generation model to be trained based on the sample Chinese prompt words, the automated step execution screenshots, the script code slices and the fine-tuning data set to obtain the code generation model.
[0099] In an embodiment of the present invention, the code generation model to be trained can be trained based on sample Chinese prompt words, corresponding automated step execution screenshots, corresponding script code slices and fine-tuning data sets, thereby obtaining a code generation model.
[0100] In an optional embodiment, before the code generation model to be trained is trained based on the sample Chinese prompt words, the automated step execution screenshots, the script code slices and the fine-tuning dataset to obtain the code generation model, it also includes: using a pre-trained model of the Chinese code generation model as a text encoder; using an image-to-text pre-trained model as a picture encoder; using a generative pre-trained decoder model as an aggregate decoder; and constructing the code generation model to be trained based on the text encoder, the picture encoder and the aggregate decoder.
[0101] The pre-trained model of the Chinese code generation model can adopt a text-to-text pre-trained model. Specifically, a pre-trained model based on the open source CODEGEN project can be used. The model is based on the GPT pre-trained model and uses the THEPILE dataset, BIGQUERY dataset, and BIGPYTHON dataset for training, and uses 350M, 2.7B, 6.1B, and 16.1B parameters of the GPT model for training. In an embodiment of the present invention, in order to ensure the model effect, a GPT model with 16.1B parameters can be used as a text encoder. The model has a certain understanding of Chinese, thereby improving the accuracy of the model.
[0102] The image encoder can use a pre-trained model for image to text. Specifically, the swintransformer pre-trained model can be used for fine-tuning. The fine-tuning data can be the data content of the screenshot element annotations. The original model classification head is used for fine-tuning training to make it more sensitive to the content of screenshot images.
[0103] The aggregate decoder can adopt the GPT decoder model, and its structure can be the same as the pre-trained model of the Chinese code generation model. In addition to the text encoder, the first layer also adds the image encoder result and connects it in a concatenate manner. The number of units in the first layer can be twice that of the original model, and the remaining structure can be consistent.
[0104] In an embodiment of the present invention, a code generation model to be trained can be constructed based on a text encoder, a picture encoder and an aggregate decoder.
[0105] In an optional embodiment, before the pre-trained model of the Chinese code generation model is used as a text encoder, it also includes: obtaining English prompt words; inputting the English prompt words into a translation model to obtain a Chinese translation result output by the translation model; inputting the Chinese translation result into a Chinese code generation model to obtain a code output by the Chinese code generation model; inputting the English prompt words into a pre-trained model of an English code generation model to obtain a code output by the pre-trained model of the English code generation model; comparing the code output by the Chinese code generation model with the code output by the English code generation model, and using an optimizer to train the Chinese code generation model based on the comparison result to obtain the pre-trained model of the Chinese code generation model.
[0106] In an embodiment of the present invention, in order to improve the understanding ability of the pre-trained model of the Chinese code generation model, a translation model and an English code generation model can be used for transfer learning so that it has good support capabilities for Chinese.
[0107] Figure 4 is a pre-training flow chart of the Chinese code generation model provided by an embodiment of the present invention. Figure 4 During the training process, the English code generation model can be used as a data source for transfer learning to generate a Chinese code generation model. English prompt words can be obtained from the database, and the English prompt words can be input into the translation model to obtain the Chinese translation result output by the translation model. The Chinese translation result can be input into the Chinese code generation model to obtain the code output by the Chinese code model. The English prompt words can be input into the pre-trained model of the English code generation model to obtain the code output by the pre-trained model of the English code generation model. The code output by the English code generation model is compared with the code output by the text decoder in the Chinese code generation model, and the weighted adaptive moment estimation Adam optimizer (Weight Decay WithAdaptive Moment Estimation Adam Optimization, ADAMW optimizer) is used to realize the ability transfer of Chinese code generation, and finally obtain the pre-trained model of the Chinese code generation model.
[0108] In an optional embodiment, the code generation model to be trained is trained based on the sample Chinese prompt words, the automated step execution screenshot, the script code slices and the fine-tuning data set to obtain the code generation model, including: freezing parameters of the text encoder and the image encoder, and opening the aggregation encoder for iterative training; generating prompt words for the current iterative training round based on the sample Chinese prompt words and the corresponding script code slices of the historical iterative training rounds; inputting the prompt words and the execution page screenshot of the current iterative training round into the code generation model to be trained to obtain the current script code output by the code generation model to be trained; after executing the current script code on the robot automation process platform, taking a screenshot of the automated execution result to obtain the current automated step execution screenshot; determining the similarity between the current automated step execution screenshot and the automated step execution screenshot as a loss function for back propagation to iteratively train the code generation model to be trained.
[0109] In an embodiment of the present invention, after completing data preparation and pre-training model preparation, the code generation model to be trained can be trained.
[0110] The code generation model to be trained can take a text encoder and a picture encoder, freeze the parameters of the text encoder and the picture encoder, and open the aggregation encoder for iterative training. For example, the number of iterative training can be preset to 50 rounds, and the learning rate is 0.001.
[0111] Among them, the text code and the image code can be connected in a concatenate manner to form an aggregate code.
[0112] Figure 5 1 is a flow chart of the connection and determination of prompt words provided by an embodiment of the present invention. Figure 5 For the same robotic automation process task, the prompt words of each round can be directly formed by the prompt words and generated codes of all previous rounds, and the pictures can be obtained by taking screenshots of the results obtained by the robotic automation process executing the current code. Specifically, the prompt words of the current iteration training round can be generated based on the sample Chinese prompt words of the historical iteration training rounds and the corresponding script code slices; the prompt words and execution page screenshots of the current iteration training round can be input into the code generation model to be trained to obtain the current script code output by the code generation model to be trained; after the current script code is executed on the robotic automation process platform, the automation execution results can be screenshotted to obtain the current automation step execution screenshot.
[0113] The comparison can be in the form of taking a screenshot of the current automated step execution screenshot obtained by taking a screenshot of the automated execution result, and using a variety of image preprocessing methods to obtain the color features, plane features, pixel features, gradient features and other features of the image with the execution results of each step in the training set (i.e., the automated step execution screenshots in the training set), and then performing hash extraction and comparison, and using their similarity as the loss function for back propagation, thereby achieving the gradient update of the code generation model to be trained.
[0114] In an optional embodiment, after the iterative training of the code generation model to be trained, it also includes: when the iterative training rounds reach a preset round, fine-tuning the code generation model to be trained based on the fine-tuning data set, opening the parameters of the text encoder, the image encoder and the aggregation encoder for multiple rounds of training to obtain the code generation model.
[0115] The parameters of the text encoder and the image encoder are frozen, and only the aggregation encoder is opened for iterative training. After the iterative training rounds reach the preset rounds (for example, 50 times), the model can be fine-tuned based on the fine-tuning dataset of high-quality code, and all parameters can be opened for multiple rounds of training (for example, 20 rounds of training with a learning rate of 0.00001) to obtain a code generation model, thereby significantly improving the accuracy of the automated script code generated by the code generation model.
[0116] The model architecture of the code generation model proposed in the embodiment of the present invention can support the generation of automated process script codes from prompt words and automated process execution page images, which is different from the current existing products and belongs to different fields; the code generation model architecture and corresponding training method for generating text through text and images can be replaced accordingly according to the own field without affecting the overall training architecture of this model; text is generated through text and images and applied in the field of automated processes, and automated process codes are generated through prompt words and screenshots of the execution process, thereby realizing code-free automated process generation.
[0117] Compared with the existing low-code RPA platform, the embodiment of the present invention has the advantage of requiring no development intervention or less development intervention. The corresponding code can be directly generated without module development for unique functional points. At the same time, the code generation model provided by the embodiment of the invention also has interface calling capabilities, which can realize all the functions that the original low-code platform can realize.
[0118] The automated process generation device provided by the present invention is described below. The automated process generation device described below and the automated process generation method described above can be referenced to each other.
[0119] Figure 6Schematic diagram of the structure of the automatic process generation device provided by the embodiment of the present invention. Figure 6 The embodiment of the present invention provides an automatic process generation device, which may specifically include the following modules:
[0120] An acquisition module 601 is used to acquire Chinese prompt words and an automated process execution page image;
[0121] The processing module 602 is used to input the Chinese prompt words and the automated process execution page image into a code generation model for processing; the code generation model includes a text encoder, a picture encoder and an aggregate decoder; the Chinese prompt words are processed by the text encoder to obtain a text code; the automated process execution page image is processed by the picture encoder to obtain a picture code; the text code and the picture code are processed by the aggregate decoder to obtain an automated process script code.
[0122] After obtaining the Chinese prompt words and the automated process execution page image, the embodiment of the present invention can process the Chinese prompt words through the text encoder in the code generation model to obtain the text code, and process the automated process execution page image through the image encoder in the code generation model to obtain the image code, and process the text code and the image code through the aggregation decoder in the code generation model to obtain an executable automated process script code file, thereby automatically generating the script code without manually writing code, and completing the robot automated process script writing with zero code, reducing development costs and improving work efficiency.
[0123] Figure 7 It is a structural diagram of an automated process management system provided by an embodiment of the present invention.
[0124] Reference Figure 7 , an embodiment of the present invention provides an automated process management system, including:
[0125] The service terminal 701 is used to display a prompt word editing interface; receive a prompt word input in the prompt word editing interface, and send the prompt word to a server;
[0126] Server 702, used for inputting the prompt word into a code generation model, obtaining the automation script code output by the code generation model and executing the automation script code on a virtual machine;
[0127] The business terminal 701 is also used to display the automation script code and the corresponding automation script code execution result; in response to the deployment operation, the automation script code is deployed to the robot automation process platform;
[0128] The robotic automation process platform 703 is used to run the automation script code and execute the automation process.
[0129] Since the sensitivity of the code generation model to the prompt words is optimized through the prompt word paradigm, there will still be the problem of inaccurate code generation results based on the prompt words, and the prompt words need to be adjusted. In an embodiment of the present invention, a business personnel management interface that can preview the execution results of the automated script code can be provided on the business terminal, so that the business personnel can adjust the prompt words based on the previewed automated script code execution results.
[0130] In the actual business process, there may be changes in page elements due to web page and software updates, making the original generated code no longer applicable, which needs to be repaired by the code generation model or business personnel. The automated process management system provided by the embodiment of the present invention can manage it, specifically:
[0131] Business personnel can log in to the prompt word writing interface through the business terminal. Specifically, in the prompt word writing interface, the system can automatically log in to the robot automation process platform to achieve real-time display of the virtual machine interface, and display the prompt word writing interface at the same time. Business personnel can write prompt words, and the prompt words can generate corresponding automation script codes through the code generation model. Business personnel can click the execution button to complete the execution on the virtual machine and confirm the execution results. At the same time, the execution site can be restored to the corresponding step through backtracking, and the prompt words can be modified for the steps that were not executed correctly.
[0132] The automated process script code that has completed all the steps and generated the correct execution results can be submitted for review for security scanning and formal review. Once passed, it can be deployed to the automated process platform.
[0133] If an error occurs during the execution of the process on the Robotic Automation Process Platform, when the number of errors exceeds a certain number (which can be set to 10 times), the prompt words can be re-reasoned in the code generation model for a certain number of times (which can be set to 10 times). If the process execution is successfully completed and the fault is repaired, it can be automatically redeployed to the Robotic Automation Process Platform.
[0134] If the code generation model fails to succeed after a certain number of inferences (which can be set to 10 times), it can be determined that the process problem cannot be repaired. A repair work order can be sent to the business personnel management interface to repeat the prompt word repair.
[0135] The embodiment of the present invention, combined with the robot automation process platform, can realize the visualization and real-time transmission of the robot process. At the same time, it can support breakpoint recovery and selection at the operation site and realize the backtracking of erroneous operation steps. It can be applied to the following situations:
[0136] 1) The automated process management system previews the code execution results corresponding to the automated script code generated based on the prompt words during the process of the business personnel writing the prompt words, which helps to ensure that the execution results are consistent with the business personnel's expectations.
[0137] 2) During the model training process, the code generation results can be verified, and the automated process of executing the same steps in large quantities for the same scenario can be realized without having to repeat the entire process, thus saving computing resources and time.
[0138] 3) In the code deployment process, the prior art manually reviews and tests whether the results of the entire process are accurate. In the embodiments of the present invention, business personnel directly confirm the accuracy, which is conducive to saving development resources.
[0139] The automated process management system provided by the embodiment of the present invention can enable business personnel to complete automated process generation through a business personnel management interface that previews the results of code execution steps. At the same time, for changes in step processes, two processing methods can be provided: model regeneration and prompt word recoding.
[0140] Figure 8 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 8 As shown, the electronic device may include: a processor 810, a communication interface 820, a memory 830 and a communication bus 840, wherein the processor 810, the communication interface 820 and the memory 830 communicate with each other through the communication bus 840. The processor 810 may call the logic instructions in the memory 830 to execute the automated process generation method, and the method includes:
[0141] Get Chinese prompt words and automated process execution page images;
[0142] The Chinese prompt words and the automated process execution page image are input into a code generation model for processing; the code generation model includes a text encoder, a picture encoder and an aggregate decoder; the Chinese prompt words are processed by the text encoder to obtain a text code; the automated process execution page image is processed by the picture encoder to obtain a picture code; the text code and the picture code are processed by the aggregate decoder to obtain an automated process script code.
[0143] In addition, the logic instructions in the above-mentioned memory 830 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0144] In another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which is implemented when the computer program is executed by a processor to perform the automated process generation method provided by the above methods, the method comprising:
[0145] Get Chinese prompt words and automated process execution page images;
[0146] The Chinese prompt words and the automated process execution page image are input into a code generation model for processing; the code generation model includes a text encoder, a picture encoder and an aggregate decoder; the Chinese prompt words are processed by the text encoder to obtain a text code; the automated process execution page image is processed by the picture encoder to obtain a picture code; the text code and the picture code are processed by the aggregate decoder to obtain an automated process script code.
[0147] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0148] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0149] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. An automated process generation method, characterized in that: include: Get Chinese prompt words and automated process execution page images; Input the Chinese prompt words and the automated process execution page image into a code generation model for processing; The code generation model includes a text encoder, a picture encoder and an aggregate decoder; the Chinese prompt word is processed by the text encoder to obtain a text code; the image of the automated process execution page is processed by the picture encoder to obtain a picture code; The text code and the picture code are processed by the aggregate decoder to obtain an automated process script code.
2. The method according to claim 1, characterized in that The code generation model is trained as follows: Acquire original data; the original data includes original Chinese prompt words, original operation video and original script code; Processing the original Chinese prompt words according to the prompt word paradigm to obtain sample Chinese prompt words; Capturing an automated step execution screenshot in the original operation video, and annotating elements of the automated step execution screenshot; Decomposing the original script code to obtain script code slices corresponding to the automated step execution screenshot; Determine the fine-tuning dataset based on Chinese prompt words and script codes in robot automation tasks; Based on the sample Chinese prompt words, the automated step execution screenshots, the script code slices and the fine-tuning data set, the code generation model to be trained is trained to obtain the code generation model.
3. The method according to claim 2, characterized in that Before the code generation model to be trained is trained based on the sample Chinese prompt words, the automated step execution screenshots, the script code slices and the fine-tuning data set to obtain the code generation model, the following step is further included: Use the pre-trained model of the Chinese code generation model as the text encoder; Use a pre-trained image-to-text model as the image encoder; Use a generative pre-trained decoder model as the aggregate decoder; Based on the text encoder, the picture encoder and the aggregate decoder, a code generation model to be trained is constructed.
4. The method according to claim 3, characterized in that Before the pre-trained model of the Chinese code generation model is used as a text encoder, it also includes: Get English prompt words; Input the English prompt word into a translation model to obtain a Chinese translation result output by the translation model; Inputting the Chinese translation result into a Chinese code generation model to obtain a code output by the Chinese code generation model; Inputting the English prompt word into a pre-trained model of an English code generation model to obtain a code output by the pre-trained model of the English code generation model; The code output by the Chinese code generation model is compared with the code output by the English code generation model, and the Chinese code generation model is trained by an optimizer based on the comparison result to obtain a pre-trained model of the Chinese code generation model.
5. The method according to claim 3, characterized in that: The method of training the code generation model to be trained based on the sample Chinese prompt words, the automated step execution screenshots, the script code slices and the fine-tuning data set to obtain the code generation model includes: Freeze the parameters of the text encoder and image encoder, and open the aggregate encoder for iterative training; Generate prompt words for the current iteration training round based on sample Chinese prompt words of the historical iteration training round and the corresponding script code slices; Inputting the prompt word and the execution page screenshot of the current iterative training round into the code generation model to be trained, and obtaining the current script code output by the code generation model to be trained; After the current script code is executed on the robot automation process platform, a screenshot of the automation execution result is taken to obtain a screenshot of the current automation step execution; The similarity between the current automated step execution screenshot and the automated step execution screenshot is determined as a loss function for back propagation to iteratively train the code generation model to be trained.
6. The method according to claim 5, characterized in that After the iterative training of the code generation model to be trained, the method further includes: When the iterative training rounds reach a preset round, the code generation model to be trained is fine-tuned based on the fine-tuning data set, and the parameters of the text encoder, the image encoder and the aggregation encoder are opened for multiple rounds of training to obtain the code generation model.
7. An automated process generation device, characterized in that: include: An acquisition module is used to obtain Chinese prompt words and automated process execution page images; A processing module, used for inputting the Chinese prompt words and the automated process execution page image into a code generation model for processing; The code generation model includes a text encoder, a picture encoder and an aggregate decoder; the Chinese prompt word is processed by the text encoder to obtain a text code; the image of the automated process execution page is processed by the picture encoder to obtain a picture code; The text code and the picture code are processed by the aggregate decoder to obtain an automated process script code.
8. An automated process management system, characterized in that: include: A business terminal, used for displaying a prompt word editing interface; receiving a prompt word inputted in the prompt word editing interface, and sending the prompt word to a server; The server is used to input the prompt word into a code generation model, obtain the automation script code output by the code generation model, and execute the automation script code on a virtual machine; The business terminal is also used to display the automation script code and the corresponding automation script code execution result; In response to the deployment operation, the automation script code is deployed to the robotic automation process platform; The robotic automation process platform is used to run the automation script code and execute the automation process.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the automated process generation method according to any one of claims 1 to 6 is implemented.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the automated process generation method according to any one of claims 1 to 6 is implemented.
Citation Information
Cited By
Intelligent agent-based office automation method and related device
CN119180620A
