Code generation method, device, electronic device and readable storage medium

By obtaining and combining the operation content of the application software, generating rich sets of instructions and writing object code, it solves the problem that the existing automation script software is not rich enough and the development efficiency is low, and efficient and personalized code generation is achieved.

CN119781746APending Publication Date: 2025-04-08CHINA MOBILE INTERNET CO LTD +1
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411706394.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-26
Publication Date
2025-04-08

AI Technical Summary

Technical Problem

The existing automation script software is not rich enough, and developers need to write corresponding code for different business operations, resulting in low development efficiency and poor scalability.

Method used

By obtaining the set of operation contents of the application software to perform operations, combining and converting key information, determining the instruction set, and generating code snippets for each instruction, and generating target codes in combination with preset template code blocks.

Benefits of technology

Without the need for developers to write code manually, it efficiently generates target codes that implement business operations, improves the scalability of the code and can generate personalized target codes for different business operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119781746A_ABST
    Figure CN119781746A_ABST
Patent Text Reader

Abstract

The present application discloses a code generation method, device, electronic device and readable storage medium, the method comprising: obtaining an operation content set for performing operations on application software; combining and converting at least one key information corresponding to the operation content set to determine an instruction set for performing operations on the application software; for each instruction in the instruction set, generating a code snippet corresponding to each instruction; and generating a target code for performing operations on the application software based on each of the code snippets and preset template code blocks corresponding to each of the code snippets.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of cloud computing technology, and specifically relates to a code generation method, device, electronic device and readable storage medium. Background Art

[0002] The automated script software of cloud phones can realize many functions, such as game hanging, automatic ticket grabbing, automatic message reply, automatic sending and receiving emails, etc. By setting relevant parameters, the automated script software will automatically perform related operations, simplifying the user's manual operations.

[0003] Current automation script software usually implements automation functions by recording operation sequences or writing scripts, but the functions of the automation script software are not rich enough. Developers are required to write corresponding codes for different business operations of the application software, which has low development efficiency and poor scalability. Summary of the invention

[0004] The embodiments of the present application provide a code generation method, device, electronic device and readable storage medium, which can solve the problems that the current automation script software is not rich in functions, developers are required to write corresponding codes for different business operations, and the development efficiency is low and the scalability is poor.

[0005] In a first aspect, an embodiment of the present application provides a code generation method, the method comprising: obtaining a set of operation contents for performing operations on application software; combining and converting at least one key information corresponding to the set of operation contents to determine a set of instructions for performing operations on the application software; for each instruction in the set of instructions, generating a code snippet corresponding to each instruction; and generating a target code for performing operations on the application software based on each of the code snippets and preset template code blocks corresponding to each of the code snippets.

[0006] In a second aspect, an embodiment of the present application provides a code generation device, which includes: an acquisition module, used to acquire a set of operation contents for performing operations on application software; a determination module, used to combine and transform at least one key information corresponding to the operation content set to determine a set of instructions for performing operations on the application software; a code generation module, used to generate, for each instruction in the instruction set, a code snippet corresponding to each instruction; and generate a target code for performing operations on the application software based on each of the code snippets and preset template code blocks corresponding to each of the code snippets.

[0007] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the method described in the first aspect.

[0008] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.

[0009] In a fifth aspect, an embodiment of the present application provides a chip, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the steps of the method described in the first aspect.

[0010] In a sixth aspect, an embodiment of the present application provides a computer program product, comprising a computer program stored on a non-transitory computer-readable storage medium, wherein the computer program comprises a program or instructions, and when the program or instructions are executed, the steps of the method described in the first aspect are implemented.

[0011] In the embodiment of the present application, by acquiring an operation content set for performing operations on the application software, at least one key information corresponding to the operation content set is combined and converted to determine an instruction set for performing operations on the application software. The instruction set for performing operations on the application software enriches the directly acquired operation content set and expands the functions that can be implemented by the target code. For each instruction in the instruction set, a code snippet corresponding to each instruction is generated, and according to each of the code snippets and the preset template code blocks corresponding to each of the code snippets, the target code for performing operations on the application software is generated, so that the developer does not need to write corresponding codes for different business operations of the application software. According to each instruction required to implement the business operation, a code snippet corresponding to the instruction is generated, and then combined with the preset template code blocks corresponding to the code snippet, the target code for implementing the business operation is efficiently generated, and personalized target codes can be generated for different business operations, thereby improving the scalability of the code. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] Figure 1 It is a flowchart of a code generation method provided in an embodiment of the present application; Figure 2 It is a structural schematic diagram of a code generation device provided in an embodiment of the present application; Figure 3 It is a structural diagram of a code generation system provided in an embodiment of the present application; Figure 4 It is a flowchart of another code generation method provided in an embodiment of the present application; Figure 5 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0013] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0014] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0015] In the related art, the method of realizing the automation function through the automation script software includes: step 1, downloading and installing the script software; step 2, authorization, such as opening the floating window permission, auxiliary function permission, etc.; step 3, configuring the script, according to the operation guide of the script software, configuring the script or task required for the automation function, such as the automatic hang-up function, and realizing the script configuration by recording the operation sequence or writing a custom script; step 4, starting the automation function, after the configuration is completed, triggering the automation function, the automation script software will automatically execute the operation indicated by the script to realize the automation function. However, the method of realizing the automation function through the automation script software has the following problems: 1. The current automation script software is not rich enough in functions, such as one-click taxi function, one-click image generation function, automatic download of the latest music function, etc. 2. It cannot provide users with personalized recommendation functions according to the user's operation preferences. 3. The current automation script software searches for the element points of the application in the page through global recursion, and then slides, clicks, etc. on the element points, which has the problem of low code execution efficiency. 4. Developers need to write corresponding codes for different business operations, which has low development efficiency and poor scalability.

[0016] The code generation method, device, electronic device and readable storage medium provided in the embodiments of the present application are described in detail below in conjunction with the accompanying drawings through specific embodiments and their application scenarios, which can at least solve the above-mentioned problems.

[0017] Figure 1 A schematic diagram of a code generation method provided in an embodiment of the present application is shown, and the method can be executed by an electronic device. Figure 1 , the method may include the following steps.

[0018] Step 102: Obtain a set of operation contents for performing operations on the application software.

[0019] The application software may be a cloud application installed in a cloud terminal, and the cloud terminal may be a cloud phone. The operation content set includes the descriptive operation content input by the operator who performs the operation on the application software through the cloud terminal page. The operation content is used to describe the execution operation on the application software. After the cloud terminal identifies and parses the operation content, it triggers the execution operation. The operation content set also includes the substantial operation content of the execution operation directly triggered by the operator who performs the operation on the application software through the cloud terminal page. The cloud terminal can directly respond to the triggering of the execution operation.

[0020] Step 104: Combining and converting at least one key information corresponding to the operation content set to determine an instruction set for executing the operation on the application software.

[0021] Among them, each execution operation in the operation content set includes key information that characterizes the execution operation, such as modifying the binding information of application software A, wherein "modification", "application software A" and "binding information" are key information of the execution operation. Different combinations and conversions are performed on at least one key information corresponding to the operation content set to determine the expanded instruction set for executing the operation on the application software.

[0022] Step 106: for each instruction in the instruction set, generate a code snippet corresponding to each instruction.

[0023] Among them, each instruction is disassembled and analyzed to generate a code fragment corresponding to each instruction. The code fragment can realize the function of the instruction and is the core part of the complete target code. The complete target code can be obtained by combining the code fragments and other processing.

[0024] Step 108: Generate target code for executing operations on the application software according to each of the code snippets and the preset template code blocks corresponding to each of the code snippets.

[0025] Among them, the preset template code block is a predefined code structure or framework, which includes some placeholders or variables, and these placeholders or variables can be filled according to specific needs to assist the code snippet in generating a complete target code.

[0026] In the embodiment of the present application, by obtaining the set of operation contents for performing operations on the application software, at least one key information corresponding to the set of operation contents is combined and converted, and based on multiple different combinations of at least one key information, more abundant instructions can be obtained, and an instruction set including the expanded operation for performing operations on the application software is determined. For each instruction in the instruction set, a code snippet corresponding to each instruction is generated, and the code snippet can realize the function of the instruction and can be used as the core part of the complete target code. Then, according to each of the code snippets and the preset template code blocks corresponding to each of the code snippets, the target code for performing operations on the application software is generated, so that the developer does not need to write corresponding codes for different business operations of the application software. According to the code snippet corresponding to the generated instruction, combined with the preset template code block corresponding to the code snippet, the target code for realizing the business operation is efficiently generated, and personalized target code can be generated for different business operations, thereby improving the scalability of the code.

[0027] In one implementation, before the above step 102 of obtaining a set of operation contents for performing operations on the application software, the method further includes the following steps.

[0028] Step 1011: Obtain identification information and authorization information of the operating user who performs operations on the application software.

[0029] The identification information of the operating user includes personal identification information such as the account number and password entered by the operating user, and may also include personal biometric identification information such as fingerprints entered by the operating user. The authorization information of the operating user includes whether the operating user is allowed to operate the application software, whether the operating user is allowed to trigger related functions of the application software, etc.

[0030] Step 1012: verify the identification information of the operating user to determine the identity of the operating user.

[0031] The cloud terminal corresponding to the cloud terminal pre-stores identification information of historical operating users, so as to verify the identification information of the current operating user according to the pre-stored identification information and determine the identity of the operating user.

[0032] Step 1013, determining whether to enable the artificial intelligence prediction function based on the identity of the operating user and the authorization information.

[0033] Among them, the artificial intelligence prediction function can predict the next operation of the operating user and simplify the operating user's operation.

[0034] In an embodiment of the present application, by obtaining the identification information and authorization information of the operating user who performs operations on the application software, the identification information of the operating user is verified to determine the identity of the operating user, and then based on the identity of the operating user and the authorization information, it is determined whether to enable the artificial intelligence prediction function. Thus, based on the dual verification of the identity of the operating user and the authorization information of the operating user, it is determined whether to enable the artificial intelligence prediction function, and the artificial intelligence prediction function that uses user personal information for prediction is managed and controlled, thereby better protecting the privacy of the user.

[0035] In one implementation, the operation content set includes a first operation content set. The above step 102 of acquiring an operation content set for performing operations on application software includes the following steps.

[0036] Step 1021, when the identity of the operating user is inconsistent with the identity of the user to which the application software belongs, determine not to enable the artificial intelligence prediction function.

[0037] The user to whom the application software belongs is the main user of the application software, that is, the owner of the cloud terminal on which the application software is installed.

[0038] Step 1022: Receive the first operation content set input by the operating user.

[0039] The operating user may input the first operation content set by text input or voice input.

[0040] In an embodiment of the present application, when the identity of the operating user is inconsistent with the identity of the user to whom the application software belongs, it means that the operating user currently operating the application software is not the machine owner, and the artificial intelligence prediction function is not enabled by default, so as to avoid using the machine owner's historical operation content set to make predictions for the operating user, thereby leaking the machine owner's privacy, and to avoid incorrectly predicting the subsequent operations that the operating user may perform, thereby reducing the user experience of the operating user. By receiving a first operation content set input by the operating user, the first operation content set is parsed, and the subsequent operations of the operating user are not predicted through the artificial intelligence prediction function. Subsequently, based on the first operation content set obtained by the analysis, a target code for implementing the application software to execute the operation is generated, thereby ensuring both the privacy security of the machine owner and the accuracy of the first operation content set.

[0041] In one implementation, the operation content set includes a second operation content set. The above step 102 of acquiring an operation content set for performing operations on application software includes the following steps.

[0042] Step 1023, when the identity of the operating user is consistent with the identity of the user to which the application software belongs, determine to enable the artificial intelligence prediction function.

[0043] Among them, the artificial intelligence prediction function includes a target artificial intelligence prediction model.

[0044] Optionally, whether to enable the artificial intelligence prediction function can be determined by asking the operating user, and the artificial intelligence prediction model is enabled after the operating user confirms.

[0045] Step 1024: Receive the first operation content of the operating user performing the operation on the application software and the application information of the application software.

[0046] The first operation content is part of the execution operation currently triggered by the operating user on the application software. For example, the execution operation of the operating user on the application software includes three operations. The operating user currently triggers the first operation. The subsequent operations can be predicted by the artificial intelligence prediction function to simplify the operation of the operating user. The application information of the application software includes the page information of the application software currently in which the operating user is located, the identification information of the application software, and the behavior data of the operating user performing operations on the application software, such as single-click, double-click, and slide.

[0047] Step 1025: Input the first operation content and the application information of the application software into the target artificial intelligence prediction model to predict the second operation content of performing an operation on the application software.

[0048] Among them, the artificial intelligence prediction model can better analyze the operating habits, preferences, intentions, etc. of the operating user based on the first operation content and the application information of the application software, thereby predicting the second operation content of the operator's operation on the application software. The second operation content is related to the above-mentioned first operation content, for example, in terms of the connection in terms of execution order. The second operation content can be a subsequent operation of the first operation content.

[0049] Optionally, the second operation content predicted to perform an operation on the application software can be recommended to the operating user as a recommended operation, and the operating user can quickly select one or more subsequent operations therefrom, thereby improving the use efficiency of the application software.

[0050] Step 1026: determine the first operation content and the second operation content as the second operation content set.

[0051] In an embodiment of the present application, when the identity of the operating user is consistent with the identity of the user to whom the application software belongs, it means that the operating user currently operating the application software is the machine owner, and the machine owner's historical operation content set can be used to predict for the operating user, and has the authority to whether to turn on the artificial intelligence prediction function. When determining to turn on the artificial intelligence prediction function, the first operation content of the operating user performing an operation on the application software and the application information of the application software are received, and the first operation content and the application information of the application software are input into the target artificial intelligence prediction model to predict the subsequent operations that the operating user may perform on the application software, that is, to obtain the second operation content of performing operations on the application software, and determine the first operation content and the second operation content as the second operation content set, so that on the basis of simplifying the operating user's execution of operations on the application software, the second operation content set for generating the target code can also be obtained.

[0052] In one implementation, the above code generation method may further include the following steps.

[0053] Step 110: Obtain a set of historical operation contents of the user to which the application software belongs.

[0054] Among them, for the users of the application software, the cloud stores their historical operation content collection, which can be used to analyze the operation mode, preference, habits, etc. of the users of the application software, so that the operations of the users of the application software can be predicted based on the analysis results.

[0055] Step 111: divide the historical operation content set into a training set and a test set.

[0056] Step 112, input the training set into the initial artificial intelligence prediction model to obtain a set of predicted operation content of the user to which the application software belongs.

[0057] Among them, the predicted operation content set is the operation content predicted by the artificial intelligence prediction model, and the test set is the actual operation content of the users of the application software.

[0058] Step 113: Determine a prediction evaluation index based on the test set and the prediction operation content set.

[0059] Among them, the prediction evaluation indicators include prediction accuracy, prediction recall, and F1 value. Among them, the prediction accuracy is the ratio of the number of correctly predicted samples in the prediction operation content set predicted by the artificial intelligence prediction model to the total number of samples in the historical operation content set. The prediction recall is the ratio of the number of samples correctly predicted by the artificial intelligence prediction model in the test set. The F1 value is the harmonic mean of the above prediction accuracy and prediction recall, which comprehensively considers the prediction accuracy and prediction recall.

[0060] Step 114, training the initial artificial intelligence prediction model according to the prediction evaluation index until the initial artificial intelligence prediction model converges to obtain the target artificial intelligence prediction model.

[0061] In an embodiment of the present application, the historical operation content set of the user of the application software is divided into a training set and a test set, and the training set is input into the initial artificial intelligence prediction model to obtain the predicted operation content set of the user of the application software. The initial artificial intelligence prediction model is then trained based on the test set and the predicted operation content set obtained by the prediction until the initial artificial intelligence prediction model converges to obtain a target artificial intelligence prediction model, thereby using the trained target artificial intelligence prediction model to predict the operator's operations and improve the prediction accuracy.

[0062] In one implementation, after generating target code for executing operations on the application software according to each of the code snippets and the preset template code blocks corresponding to each of the code snippets in the above step 108, the method further includes the following steps.

[0063] Step 1081, obtaining execution feedback information of executing the target code.

[0064] The execution feedback information includes log data of operations performed on the application software through the target code, and also includes the opinions of the operating user on the operations performed on the application software through the target code.

[0065] Step 1082: Optimize and train the target artificial intelligence prediction model based on the execution feedback information.

[0066] In an embodiment of the present application, after executing an operation on the application software based on the generated target code, the execution status of the operation on the application software through the target code and the user experience of the operating user are obtained by analyzing the execution feedback information of the target code, so as to continue to train the target artificial intelligence prediction model, optimize the performance of the target artificial intelligence prediction model, improve the prediction accuracy and enhance the user experience.

[0067] In one implementation, the above-mentioned step 104 combines and converts at least one key information corresponding to the operation content set to determine an instruction set for executing the operation on the application software, including the following steps.

[0068] Step 1041: extract at least one key information corresponding to the operation content set.

[0069] The operation content set includes at least one operation, and each operation includes at least one key information characterizing the operation.

[0070] Step 1042: Combining the at least one key information into at least one key information combination.

[0071] Among them, the key information includes actions, objects targeted by the actions, execution environments of the objects, etc. These key information can be combined in different ways to form a variety of different key information combinations.

[0072] Step 1043: Convert the at least one key information combination into at least one instruction for executing an operation on the application software.

[0073] In an embodiment of the present application, by extracting at least one key information corresponding to the operation content set, combining the at least one key information into at least one key information combination, and converting the at least one key information combination into at least one instruction for performing an operation on the application software, the operation content set is expanded to form an instruction set for implementing richer functions.

[0074] In one implementation, the above step 106 generates a code snippet corresponding to each instruction in the instruction set, including the following steps.

[0075] Step 1061 , for the first instruction, according to the position of the application software in the cloud terminal page, determine a first coordinate point corresponding to the position.

[0076] The first instruction may be a step of performing an operation on the application software, and the step may be determining the application software, that is, determining which application software the operator uses. Multiple application software are displayed on the cloud terminal page, and different application software are located at different positions, and thus correspond to different coordinate points.

[0077] Step 1062: According to the first instruction and the first coordinate point, convert the first instruction for executing the operation on the application software into an execution instruction for the first coordinate point.

[0078] The execution instruction for the first coordinate point is used to select the application software used by the operator, and the execution instruction can trigger the selection by single-clicking, double-clicking, one-key sliding of the first coordinate point, and other actions.

[0079] Step 1063: Generate a first code segment corresponding to the execution instruction for the first coordinate point.

[0080] In an embodiment of the present application, for a first instruction, a first coordinate point corresponding to the position of the application software in a cloud terminal page is determined, and based on the first instruction and the first coordinate point, the first instruction to perform an operation on the application software is converted into an execution instruction for the first coordinate point. By triggering the first coordinate point, the application software indicated by the first coordinate point can be selected, and then a first code fragment corresponding to the execution instruction for the first coordinate point is generated, thereby implementing the execution instruction for the first coordinate point through the first code fragment.

[0081] In one implementation, the above step 106 generates a code snippet corresponding to each instruction in the instruction set, including the following steps.

[0082] Step 1064, for the second instruction, according to the position of each function in the application software in the cloud terminal page, determine the second coordinate point corresponding to the position.

[0083] The second instruction may be another step of performing an operation on the application software, which may be determining a function in the application software, that is, determining which function of the application software the operator uses. The cloud terminal page displays multiple functions of the application software, and different functions are located at different positions, which correspond to different coordinate points.

[0084] Step 1065: According to the second instruction and the second coordinate point, convert the second instruction for executing operations on each function in the application software into an execution instruction for the second coordinate point.

[0085] The execution instruction for the second coordinate point is used to select a function in the application software, and the execution instruction can trigger the selection by single-clicking, double-clicking, or sliding the second coordinate point with one key.

[0086] Step 1066: Generate a second code segment corresponding to the execution instruction for the second coordinate point.

[0087] In an embodiment of the present application, for the second instruction, according to the position of each function in the application software in the cloud terminal page, the second coordinate point corresponding to the position is determined, and according to the second instruction and the second coordinate point, the second instruction for performing operations on each function in the application software is converted into an execution instruction for the second coordinate point, and by triggering the second coordinate point, the function indicated by the second coordinate point can be selected, and then a second code fragment corresponding to the execution instruction for the second coordinate point is generated, thereby implementing the execution instruction for the first coordinate point through the second code fragment.

[0088] It should be noted that other instructions in the instruction set are similar to the processing of the first instruction or the second instruction mentioned above, converting the instructions for each function in the application software into execution instructions for the coordinate points, and then generating code snippets for the execution instructions for the coordinate points.

[0089] In one implementation, the above step 108 generates a target code for executing an operation on the application software according to each of the code snippets and a preset template code block corresponding to each of the code snippets, and includes the following steps.

[0090] Step 1081, determining the preset template code blocks corresponding to each of the code snippets from the code template library.

[0091] The code template library includes a Python script template library, which includes multiple template code blocks.

[0092] Step 1082: insert each of the code snippets into a preset template code block corresponding to each of the code snippets to obtain a target code block corresponding to each instruction.

[0093] Each code snippet has a corresponding preset template code block, which is used to assist the code snippet in generating a complete target code.

[0094] Step 1083, combining the target code blocks corresponding to the various instructions to generate target code for executing operations on the application software.

[0095] In an embodiment of the present application, by determining the preset template code blocks corresponding to each of the code fragments from a code template library, each of the code fragments is inserted into the preset template code blocks corresponding to each of the code fragments, and a target code block corresponding to each instruction is obtained. The target code block has a core part and structure for implementing the function. The target code blocks corresponding to the instructions are combined to generate a target code for executing operations on the application software. Each target code block can implement its corresponding function. The target code blocks can be combined to generate a complete target code, so that calling and executing the target code can implement the execution operation on the application software.

[0096] In one implementation, after generating target code for executing operations on the application software according to each of the code snippets and the preset template code blocks corresponding to each of the code snippets in the above step 108, the method further includes the following steps.

[0097] Step 115: Check the executableness of the target code.

[0098] The target code is checked to ensure that it can be executed.

[0099] Step 116, if the verification is passed, compile the target code to generate a shortcut application corresponding to the target code.

[0100] Different quick applications correspond to different target codes, and the target code can be quickly called by selecting the quick application.

[0101] Optionally, when the verification fails, errors are found and corrected in each code generation step in turn to improve the quality of the target code.

[0102] Step 117, storing the quick application in a cloud device corresponding to the cloud terminal.

[0103] In an embodiment of the present application, the executableness of the target code is checked to ensure that the target code can be executed. If the check passes, the target code is compiled to generate a quick application corresponding to the target code, and the quick application is stored in a cloud device corresponding to the cloud terminal, so that when needed, the target code can be called and executed by selecting the quick application from the cloud device.

[0104] In one implementation, after the quick application is stored in the cloud device corresponding to the cloud terminal in the above step 117, the method further includes the following steps.

[0105] Step 118: convert the shortcut application into a pointer application.

[0106] The conversion of the quick application into a pointer application associates the shortcut with a locally triggerable pointer application, so that the quick application can be quickly accessed by selecting the pointer application without going through complicated menus or searches. In other words, the quick application provides the user with the function of executing the target code with one click, thereby further simplifying the operation of the user and improving the user experience.

[0107] Step 119: Send the pointer application to the cloud terminal page of the cloud terminal in the form of a pop-up window.

[0108] Among them, the cloud terminal is issued through the pointer application instead of the quick application, which greatly reduces the size of the transmitted data, saves the transmission time, and saves the storage space of the cloud terminal.

[0109] In the embodiment of the present application, by converting the quick application into a pointer application, and then sending the pointer application to the cloud terminal page of the cloud terminal in the form of a pop-up window, the operating user selects the pointer application that meets the current needs from the various pointer applications displayed on the display page and triggers it, thereby realizing one-click execution of the target code. Compared with the prior art of using automated script software to globally recursively search for element points of applications in the page, and then sliding, clicking, and other operations on the element points, there is a problem of low code execution efficiency. The embodiment of the present application can execute the target code with one click, thereby efficiently realizing the execution operation of the application software.

[0110] In one implementation, after the pointer application is sent to the cloud terminal page of the cloud terminal in the form of a pop-up window in the above step 119, the method further includes: step 120, in response to triggering the pointer application, calling and executing the target code corresponding to the pointer application.

[0111] The pointer application corresponds to the shortcut application stored in the cloud device, and the shortcut application corresponds to the target code.

[0112] In an embodiment of the present application, by responding to the triggering of the pointer application, it is equivalent to triggering the shortcut application corresponding to the pointer application, so that based on the triggering call to the shortcut application and executing the target code corresponding to the shortcut application, the execution operation of the application software is realized through the target code.

[0113] It should be noted that the code generation method provided in the embodiment of the present application can be executed by a code generation device or a control module in the code generation device for executing the code generation method. In the embodiment of the present application, the code generation device provided in the embodiment of the present application is described by taking the execution of the code generation method by the code generation device as an example.

[0114] Figure 2 FIG. 1 shows a schematic diagram of the structure of a code generation device provided in an embodiment of the present application. Figure 2 As shown, the device 200 includes: an acquisition module 21, a determination module 22 and a code generation module 23.

[0115] Among them, the acquisition module 21 is used to obtain a set of operation contents for performing operations on the application software; the determination module 22 is used to combine and transform at least one key information corresponding to the operation content set to determine an instruction set for performing operations on the application software; the code generation module 23 is used to generate a code snippet corresponding to each instruction in the instruction set; and generate a target code for performing operations on the application software based on each of the code snippets and the preset template code blocks corresponding to each of the code snippets.

[0116] In one implementation, the above-mentioned device may also include a verification and authorization module, wherein the verification and authorization module is used to obtain the identification information and authorization information of the operating user who performs operations on the application software; verify the identification information of the operating user to determine the identity of the operating user; and determine whether to enable the artificial intelligence prediction function based on the identity of the operating user and the authorization information.

[0117] In one implementation, the operation content set includes a first operation content set; the above-mentioned acquisition module 21 can be used to determine not to enable the artificial intelligence prediction function when the identity of the operating user is inconsistent with the identity of the user to whom the application software belongs; and receive the first operation content set input by the operating user.

[0118] In one implementation, the operation content set includes a second operation content set; the above-mentioned acquisition module 21 can be used to determine to enable the artificial intelligence prediction function when the identity of the operating user is consistent with the identity of the user to whom the application software belongs; wherein the artificial intelligence prediction function includes a target artificial intelligence prediction model; receiving the first operation content of the operating user performing an operation on the application software and the application information of the application software; inputting the first operation content and the application information of the application software into the target artificial intelligence prediction model to predict the second operation content of performing an operation on the application software; and determining the first operation content and the second operation content as the second operation content set.

[0119] In one implementation, the above-mentioned device may also include a model training module, which is used to obtain a set of historical operation content of users to which the application software belongs; divide the set of historical operation content into a training set and a test set; input the training set into an initial artificial intelligence prediction model to obtain a set of predicted operation content of users to which the application software belongs; determine a prediction evaluation index based on the test set and the predicted operation content set; and train the initial artificial intelligence prediction model based on the prediction evaluation index until the initial artificial intelligence prediction model converges to obtain the target artificial intelligence prediction model.

[0120] In one implementation, the above-mentioned model training module can also be used to obtain execution feedback information of executing the target code; based on the execution feedback information, the target artificial intelligence prediction model is optimized and trained.

[0121] In one implementation, the above-mentioned determination module 22 can be used to extract at least one key information corresponding to the operation content set; combine the at least one key information into at least one key information combination; and convert the at least one key information combination into at least one instruction for performing an operation on the application software.

[0122] In one implementation, the above-mentioned code generation module 23 can be used to determine, for a first instruction, a first coordinate point corresponding to the position according to the position of the application software in the cloud terminal page; based on the first instruction and the first coordinate point, convert the first instruction for executing an operation on the application software into an execution instruction for the first coordinate point; and generate a first code fragment corresponding to the execution instruction for the first coordinate point.

[0123] In one implementation, the above-mentioned code generation module 23 can be used to determine, for a second instruction, a second coordinate point corresponding to the position of each function in the application software in the cloud terminal page according to the position of the position; according to the second instruction and the second coordinate point, convert the second instruction for performing operations on each function in the application software into an execution instruction for the second coordinate point; and generate a second code fragment corresponding to the execution instruction for the second coordinate point.

[0124] In one implementation, the above-mentioned code generation module 23 can be used to determine the preset template code blocks corresponding to each of the code fragments from the code template library; insert each of the code fragments into the preset template code blocks corresponding to each of the code fragments to obtain the target code blocks corresponding to each instruction; combine the target code blocks corresponding to each of the instructions to generate the target code for performing operations on the application software.

[0125] In one implementation, the above-mentioned device may also include a storage module for testing the executableness of the target code; if the test passes, the target code is compiled to generate a quick application corresponding to the target code; and the quick application is stored in a cloud device corresponding to the cloud terminal.

[0126] In one implementation, the above-mentioned device may further include a conversion module, which is used to convert the shortcut application into a pointer application; and send the pointer application to the cloud terminal page of the cloud terminal in the form of a pop-up window.

[0127] In one implementation, the above-mentioned device may further include a code execution module, which is used to call and execute the target code corresponding to the pointer application in response to the triggering of the pointer application.

[0128] The code generation device in the embodiment of the present application can be a device, or a component, integrated circuit, or chip in a terminal. The device can be a mobile electronic device, and for example, the mobile electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, an in-vehicle electronic device, a wearable device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (PDA), etc. The non-mobile electronic device can be a server, a network attached storage (NAS), a personal computer (PC), a television (TV), a teller machine, or a self-service machine, etc., and the embodiment of the present application does not specifically limit it.

[0129] The code generation device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.

[0130] The code generation device provided in the embodiment of the present application can achieve Figure 1 To avoid repetition, the various processes implemented in the method embodiment are not described here.

[0131] Figure 3 A schematic diagram of the structure of a code generation system provided in an embodiment of the present application is shown. Figure 3 The system 300 includes a client input module 31, a fingerprint security management module 32, an artificial intelligence (AI) prediction and recommendation model 33, a text intelligent parsing module 34, an AI script model 35, and a user feedback optimization module 36.

[0132] Among them, the client input module 31 is used to receive the operation instructions input by the operating user through text or voice. The fingerprint security management module 32 voice reads the fingerprint information input by the operating user and determines whether to turn on the AI ​​prediction function. The AI ​​prediction recommendation model 33 is used to predict the subsequent operation instructions of the operating user based on the current operation instructions of the operating user and the application information of the application software, and generate a personalized recommendation list including subsequent operation instructions. Among them, the AI ​​prediction recommendation model includes a convolutional neural network deep learning model, which is trained based on the historical operation instructions of the operating user. The text intelligent analysis module 34 is used to extract key information from the operation instructions of the operating user, and convert at least one key information combination into a set of instructions for executing various steps on the application software. The AI ​​script model 35 includes an intelligent script generation engine 351 and an automatic generation application platform 352, wherein the intelligent script generation engine 351 also includes a cloud terminal page grid coordinate system, an application coordinate mapping unit, an operation step parsing unit, a Python script template library, and a target code generator, wherein the page grid coordinate system is a plane rectangular coordinate system of the current cloud terminal page; the application coordinate mapping module is used to generate coordinate point mapping list data corresponding to the application position in the page; the operation step parsing module is used to convert various instructions of the application software into execution instructions such as single click, double click, and one-key sliding of the coordinate point; the target code generator module selects a suitable Python script template library for combination according to the code fragment generated by the execution instruction to generate the target code. The automatic generation application platform 352 is used to generate a quick application in the cloud terminal page based on the generated target code, so that the user can directly operate and call it. The user feedback optimization module 36 is used to optimize and iterate the AI ​​prediction recommendation model and AI script model in the system according to the execution log information of the target code and the feedback information of the operating user to improve the recommendation effect and user experience.

[0133] Figure 4 A schematic diagram of another code generation method provided in an embodiment of the present application is shown, which can be applied to Figure 3 The code generation system shown in Figure 4 , the method comprises the following steps.

[0134] Step 401: The local device installs the cloud phone application software (Application, APP), and the user logs in to the cloud phone APP to enter the cloud phone.

[0135] Step 402, receiving the fingerprint information input by the operating user, comparing the fingerprint information with the fingerprint information pre-stored in the fingerprint management platform, and determining whether the operating user is the machine owner. If not, executing steps 4031 to 4032, and if yes, executing steps 4041 to 4043.

[0136] Step 4031: When the operating user is not the owner of the device, the AI ​​prediction and recommendation function is turned off by default.

[0137] Step 4032, receiving an operation instruction input by the user through text or voice.

[0138] Step 4041, when the operating user is the owner of the device, the AI ​​prediction and recommendation function is enabled by default.

[0139] Step 4042: predict the subsequent operation instructions of the operating user based on the current operation instructions and application information of the operating user.

[0140] Among them, by receiving the current operation instructions of the operating user and the application information of the application software, the current operation instructions and application information are input into the AI ​​prediction and recommendation model to predict the subsequent operation instructions of the operating user.

[0141] Before step 4042, the method also includes training the AI ​​prediction and recommendation model based on the historical operation instructions of the operating user.

[0142] Step 405: extract key information from the operation instructions of the operating user, and convert at least one key information combination into an instruction set for executing various steps on the application software.

[0143] Among them, the operating instructions of the operating user include the operating instructions input by the operating user through text or voice, and the subsequent operating instructions of the operating user predicted by the AI ​​prediction and recommendation model.

[0144] Step 406: Generate a code snippet corresponding to each instruction in the instruction set.

[0145] For example, the first instruction of step 1 is executed on the application software, and the first coordinate point corresponding to the position of the application software in the page is generated based on the page grid coordinate system, and the first instruction of step 1 is converted to the execution behavior of single-clicking, double-clicking, one-key sliding, etc. on the first coordinate point. For another example, the second instruction of step 2 is executed on the application software, and the second coordinate point corresponding to the position of the function of the application software in the page is generated based on the page grid coordinate system, and the second instruction of step 2 is converted to the execution behavior of single-clicking, double-clicking, one-key sliding, etc. on the second coordinate point. The processing of other instructions of other steps executed by the application software is similar to the above two steps.

[0146] Step 407: Generate target code according to each code snippet and the template code block corresponding to each code snippet.

[0147] Among them, by selecting the template code blocks corresponding to each code snippet from the Python script template library, each code snippet is inserted into each template code block to obtain each target code block, and then each code block is combined to generate the target code for executing each step of the application software.

[0148] Step 408, the target code is tested, and if the test passes, the target code is compiled to generate a quick application corresponding to the target code, and the quick application is stored in the cloud.

[0149] Step 409: convert the reference of the quick application into a pointer application, and send the pointer application to the cloud terminal page.

[0150] Among them, the operating user can realize one-click execution of the target code by triggering the pointer application in the cloud terminal page.

[0151] Step 410, receiving execution log information and feedback information from the operating user after executing the target code, and optimizing and iterating the AI ​​prediction recommendation model and AI script model in the system.

[0152] In an embodiment of the present application, by extracting and combining key information of the operation instructions input by the operating user through text or voice, and the subsequent operation instructions of the operating user predicted by the AI ​​prediction and recommendation model, the operation instructions are expanded, and the functions that can be realized by the target code are enriched. The instructions for executing each step of the application software are converted into execution instructions for the coordinate points, so that the execution instructions for the coordinate points can be quickly triggered when the target code is triggered, which is more efficient than the related art of using automated script software to globally recursively search for element points applied in the page. For each instruction in the instruction set, a code snippet corresponding to each instruction is generated, and a template code block corresponding to each code snippet in the combined Python script template library is generated to generate the target code. The target code can be efficiently generated without the participation of developers.

[0153] The embodiment of the present application also provides an electronic device, which is used to execute the above-mentioned code generation method. Figure 5A schematic diagram of the structure of an electronic device for implementing various embodiments of the present application. The electronic device may have relatively large differences due to different configurations or performances, and may include a processor (processor) 501, a communication interface (CommunicationsInterface) 502, a memory (memory) 503 and a communication bus 504, wherein the processor 501, the communication interface 502, and the memory 503 communicate with each other through the communication bus 504. The processor 501 can call a computer program stored in the memory 503 and can be run on the processor 501 to execute the various steps of the above-mentioned code generation method embodiment, and can achieve the same technical effect, so it will not be repeated here to avoid repetition.

[0154] The above electronic device structure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently. For example, the input unit may include a graphics processing unit (GPU) and a microphone, and the display unit may be configured with a display panel in the form of a liquid crystal display, an organic light-emitting diode, etc. The user input unit includes a touch panel and at least one of other input devices. The touch panel is also called a touch screen. Other input devices may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which will not be repeated here.

[0155] The memory can be used to store software programs and various data. The memory may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or instructions required for at least one function (such as a sound playback function, an image playback function, etc.), etc. In addition, the memory may include a volatile memory or a non-volatile memory, or the memory may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. Volatile memory can be random access memory (RAM), static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM) and direct memory bus random access memory (DRRAM).

[0156] The processor may include one or more processing units; optionally, the processor integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to the operating system, user interface, and application programs, and the modem processor mainly processes wireless communication signals, such as a baseband processor. It is understandable that the modem processor may not be integrated into the processor.

[0157] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, each process of the above-mentioned code generation method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0158] The processor is a processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0159] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned code generation method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0160] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.

[0161] An embodiment of the present application also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes a program or instructions. When the program or instructions are executed, the various processes of the above-mentioned code generation method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, they are not repeated here.

[0162] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

[0163] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0164] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

Claims

1. A code generation method, characterized in that: include: Get the operation content set for performing operations on the application software; Combining and converting at least one key information corresponding to the operation content set to determine an instruction set for performing operations on the application software; For each instruction in the instruction set, generate a code snippet corresponding to each instruction; According to each of the code snippets and the preset template code blocks corresponding to each of the code snippets, a target code for executing an operation on the application software is generated.

2. The method according to claim 1, characterized in that Before obtaining the set of operation contents for performing operations on the application software, the method further includes: Obtaining identification information and authorization information of an operating user who performs operations on the application software; Verifying the identification information of the operating user to determine the identity of the operating user; Determine whether to enable the artificial intelligence prediction function based on the identity of the operating user and the authorization information.

3. The method according to claim 2, characterized in that The operation content set includes a first operation content set; the step of obtaining the operation content set for performing operations on the application software includes: In the case where the identity of the operating user is inconsistent with the identity of the user to which the application software belongs, determining not to enable the artificial intelligence prediction function; The first operation content set input by the operation user is received.

4. The method according to claim 2, characterized in that: The operation content set includes a second operation content set; and the step of obtaining the operation content set for performing operations on the application software includes: In the case where the identity of the operating user is consistent with the identity of the user to which the application software belongs, determining to enable the artificial intelligence prediction function; wherein the artificial intelligence prediction function includes a target artificial intelligence prediction model; Receive a first operation content of the operating user performing an operation on the application software and application information of the application software; Inputting the first operation content and the application information of the application software into the target artificial intelligence prediction model to predict the second operation content of performing an operation on the application software; The first operation content and the second operation content are determined as the second operation content set.

5. The method according to claim 4, characterized in that The method further comprises: Obtaining a collection of historical operation contents of the user of the application software; Dividing the historical operation content set into a training set and a test set; Inputting the training set into the initial artificial intelligence prediction model to obtain a set of predicted operation contents of the user to which the application software belongs; Determining a prediction evaluation index according to the test set and the prediction operation content set; According to the prediction evaluation index, the initial artificial intelligence prediction model is trained until the initial artificial intelligence prediction model converges to obtain the target artificial intelligence prediction model.

6. The method according to claim 4, characterized in that After generating the target code for performing the operation on the application software according to each of the code snippets and the preset template code blocks corresponding to each of the code snippets, the method further includes: Obtaining execution feedback information of executing the target code; The target artificial intelligence prediction model is optimized and trained according to the execution feedback information.

7. The method according to claim 1, characterized in that The combining and converting at least one key information corresponding to the operation content set to determine an instruction set for performing an operation on the application software includes: Extracting at least one key information corresponding to the operation content set; combining the at least one key information into at least one key information combination; The at least one key information combination is converted into at least one instruction for executing an operation on the application software.

8. The method according to claim 1, characterized in that The step of generating, for each instruction in the instruction set, a code snippet corresponding to each instruction, comprises: In response to the first instruction, according to the position of the application software in the cloud terminal page, determine a first coordinate point corresponding to the position; According to the first instruction and the first coordinate point, converting the first instruction for executing the operation on the application software into an execution instruction for the first coordinate point; A first code segment corresponding to an execution instruction for the first coordinate point is generated.

9. The method according to claim 1, characterized in that: The step of generating, for each instruction in the instruction set, a code snippet corresponding to each instruction, comprises: In response to the second instruction, according to the position of each function in the application software on the cloud terminal page, determine the second coordinate point corresponding to the position; According to the second instruction and the second coordinate point, converting the second instruction for executing operations on each function in the application software into an execution instruction for the second coordinate point; A second code segment corresponding to the execution instruction for the second coordinate point is generated.

10. The method according to claim 1, characterized in that The step of generating target code for executing an operation on the application software according to each of the code snippets and the preset template code blocks corresponding to each of the code snippets includes: Determine, from a code template library, preset template code blocks corresponding to each of the code snippets; Inserting each of the code snippets into a preset template code block corresponding to each of the code snippets to obtain a target code block corresponding to each instruction; The target code blocks corresponding to the various instructions are combined to generate target code that performs operations on the application software.

11. The method according to claim 1, characterized in that: After generating the target code for performing the operation on the application software according to each of the code snippets and the preset template code blocks corresponding to each of the code snippets, the method further includes: Testing the executableness of the target code; If the verification is passed, compile the target code to generate a shortcut application corresponding to the target code; The quick application is stored in a cloud device corresponding to the cloud terminal.

12. The method according to claim 11, characterized in that After storing the quick application in the cloud device corresponding to the cloud terminal, the method further includes: Converting the shortcut application into a pointer application; The pointer application is sent to the cloud terminal page of the cloud terminal in the form of a pop-up window.

13. The method according to claim 12, characterized in that After sending the pointer application to the cloud terminal page of the cloud terminal in the form of a pop-up window, the method further includes: In response to triggering the pointer application, the target code corresponding to the pointer application is called and executed.

14. A code generating device, characterized in that: include: An acquisition module, used to acquire a set of operation contents for performing operations on application software; A determination module, used to combine and convert at least one key information corresponding to the operation content set to determine an instruction set for performing an operation on the application software; A code generation module, used for generating a code snippet corresponding to each instruction in the instruction set; And according to each of the code snippets and the preset template code blocks corresponding to each of the code snippets, a target code for executing operations on the application software is generated.

15. The device according to claim 14, characterized in that The device also includes a verification and authorization module; Among them, the verification and authorization module is used to obtain the identification information and authorization information of the operating user who performs operations on the application software; verify the identification information of the operating user to determine the identity of the operating user; and determine whether to enable the artificial intelligence prediction function based on the identity of the operating user and the authorization information.

16. An electronic device, characterized in that: The electronic device includes a processor, a memory, and a program or instruction stored in the memory and executable on the processor. When the program or instruction is executed by the processor, the steps of the code generation method according to any one of claims 1 to 13 are implemented.

17. A readable storage medium, characterized in that: The readable storage medium stores a program or instruction, and when the program or instruction is executed by a processor, the steps of the code generation method according to any one of claims 1 to 13 are implemented.

18. A computer program product, characterized in that The computer program product comprises a computer program stored on a non-transitory computer-readable storage medium, wherein the computer program comprises a program or instructions, and when the program or instructions are executed, the steps of the code generation method according to any one of claims 1 to 13 are implemented.

Citation Information

Cited By

  • Method and device for generating programming language according to clinical DVP table

    CN120929062A