Decision model training and mini program inspection
By training the decision model, obtaining user intentions and interactive actions, generating mini-program inspection paths, and using reinforcement learning and business logic rules optimization, the problem of high cost of mini-program inspection time is solved, and automated and efficient inspection path generation is achieved.
Patent Information
- Application Number
- PCT/CN2025/073502
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-02-08
- Filing Date
- 2025-01-21
- Publication Date
- 2025-08-14
AI Technical Summary
The existing mini-program inspection requires the writing of customized inspection scripts according to different business needs, which is costly and lacks the method of automatically generating inspection paths.
By training the decision model, obtaining user intention labels and interactive action sequences, using the generative model to generate inspection paths, and optimizing model parameters through reinforcement learning, and optimizing inspection paths in combination with business logic rules.
It realizes automatic generation of inspection paths, saves time and costs, and improves inspection efficiency and path optimization capabilities.
Smart Images

Figure CN2025073502_14082025_PF_FP_ABST
Abstract
Description
Decision model training and mini-program inspection Technical Field
[0001] The present invention relates to the field of machine learning technology, and in particular to a decision model training method, a mini-program inspection method, and a device. Background Art
[0002] Mini Program inspections refer to the process from entering a mini program to finding the target page. Mini Program inspections can identify risks within the mini program. Currently, mini program inspections require customized inspection scripts tailored to specific business needs, which is very time-consuming and expensive to implement. Summary of the Invention
[0003] One or more embodiments of this specification describe a decision model training method, a mini-program inspection method, and a device. The decision model provided by this method can make automated decisions for different mini-programs to quickly generate inspection paths.
[0004] In a first aspect, a method for training a decision model is provided, comprising: obtaining a user's intention label, and a sequence of interactive actions in which the user interacts with a web page based on the intention described by the intention label; obtaining a web page image sample that the user interacts with in the process of executing the interactive action sequence; inputting the web page image sample and the intention label into a generation model to obtain a decision result; determining a loss function based on the decision result and the decision label to update the parameters of the generation model to obtain a target decision model; the decision label is determined based on each interactive action in the interactive action sequence and the operation object of the interactive action in the web page image sample.
[0005] As an optional method of the method described in the first aspect, the training method also includes: inputting the user's intention instruction and the page image of the real mini program into the decision model; based on the decision result of the decision model for the page image, performing interactive operations with the mini program and obtaining interaction data; selecting the path that successfully reaches the target page specified by the intention instruction from the interaction data as positive feedback, and the remaining paths as negative feedback, and updating the parameters of the target decision model based on the reinforcement learning strategy.
[0006] As an optional manner of the method described in the first aspect, the generation model includes an encoder and a generator; the web page image sample and the intent label are input into the generation model to obtain a decision result, specifically including: inputting the web page image sample into the encoder to obtain an environment representation; inputting the environment representation and the intent label into the generator to obtain the decision result.
[0007] Specifically, the encoder is a large multimodal model, and the generator is a large language model; the environment representation and the intent label are input into the generator to obtain the decision result, which specifically includes: converting the environment representation into text features in natural language form; inputting the text features and the intent label into the generator to obtain a decision result in text form; the decision result in text form is used to represent the operation object in the web page image sample and the interactive action performed on the operation object.
[0008] On the second aspect, a mini-program inspection method is provided, including: inputting the page image of the target mini-program and the intention instruction set by the user into a decision model; the decision model is trained using the above-mentioned decision model training method; based on each decision result of the decision model for the page image of the target mini-program, performing interactive operations with the target mini-program until reaching the target page specified by the intention instruction.
[0009] As an optional implementation of the method described in the second aspect, based on each decision result of the decision model for the page image of the target applet, interactive operations with the target applet are performed, specifically including: for each decision result output by the decision model, the decision result is matched with a pre-set business logic rule with a higher priority, and when the decision result conflicts with the business logic rule, the operation specified by the business logic rule is executed.
[0010] As an optional implementation of the method described in the second aspect, the inspection method also includes: saving each inspection path determined by the decision result output by the decision model during the inspection process; for inspection paths with the same starting page and target page, removing redundant steps through pruning operations to obtain at least one shortest inspection path.
[0011] Specifically, the inspection method may further include: generating an inspection script according to the shortest inspection path.
[0012] In a third aspect, a training device for a decision model is provided, which includes: a first data acquisition module, configured to obtain a user's intention label, a sequence of interactive actions in which the user interacts with a web page based on the intention described by the intention label, and a web page image sample interacted with by the user in the process of executing the interactive action sequence; a processing module, configured to input the web page image sample and the intention label into a generation model to obtain a decision result; a loss function is determined based on the decision result and the decision label to update the parameters of the generation model to obtain a target decision model; the decision label is determined based on each interactive action in the interactive action sequence and the operation object of the interactive action in the web page image sample.
[0013] As an optional implementation of the device described in the third aspect, the training device may also include: a second data acquisition module, configured to obtain the user's intention instructions and the page image of the real mini program; an optimization module, configured to input the intention instructions and the page image obtained by the second data acquisition module into the decision model; based on the decision result of the decision model for the page image, perform interactive operations with the mini program and obtain interaction data; select the path that successfully reaches the target page specified by the intention instruction from the interaction data as positive feedback, and the remaining paths as negative feedback, and update the parameters of the target decision model based on the reinforcement learning strategy.
[0014] In the fourth aspect, a mini-program inspection device is provided, which includes: a third data acquisition module, configured to obtain the page image of the target mini-program and the intention instruction set by the user; a decision generation module, configured to input the page image of the target mini-program and the intention instruction into a decision model to obtain a decision result; the decision model is trained using the above-mentioned decision model training method; an interaction module, configured to perform interactive operations with the target mini-program based on each decision result of the decision model for the page image of the target mini-program, until the target page specified by the intention instruction is reached.
[0015] As an optional implementation of the device described in the fourth aspect, the interaction module is specifically used to match each decision result output by the decision model with a pre-set business logic rule with a higher priority, and when the decision result conflicts with the business logic rule, execute the operation specified by the business logic rule.
[0016] As an optional implementation of the device described in the fourth aspect, the inspection device may also include: an inspection path generation module, configured to save each inspection path determined by the decision result output by the decision model during the inspection process; for inspection paths with the same starting page and target page, redundant steps are removed through pruning operations to obtain at least one shortest inspection path.
[0017] Specifically, the inspection device may further include: an inspection script generation module configured to generate an inspection script according to the shortest inspection path.
[0018] In a fifth aspect, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the training method of the above-mentioned decision model is implemented, or the mini-program inspection method is implemented.
[0019] In a sixth aspect, an electronic device is provided, comprising: one or more processors; and a memory associated with the one or more processors, the memory being used to store program instructions, which, when read and executed by the one or more processors, execute the above-mentioned decision model training method, or the above-mentioned mini-program inspection method.
[0020] One or more embodiments of this specification provide a decision model training method. This method collects a large amount of behavioral data related to user interactions with mini-programs, labeled with intent, and trains a large model. This model is then used as the decision model during inspections, thereby achieving automated inspections. This decision model can automatically and quickly generate inspection decisions for different inspection intents and mini-programs, saving significant time and costs.
[0021] The decision model training device, mini-program inspection method and device provided in one or more embodiments of this specification also have the above-mentioned beneficial effects. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate one or more embodiments of this specification or the technical solutions in 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 only some embodiments recorded in this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0023] FIG1 exemplarily shows a flowchart of a decision model training method provided by one or more embodiments of this specification.
[0024] FIG2 exemplarily shows a schematic diagram of a network structure of a decision model provided by one or more embodiments of this specification.
[0025] FIG3 exemplarily shows a flowchart of a mini-program inspection method provided by one or more embodiments of this specification.
[0026] FIG4 exemplarily shows a schematic structural diagram of a training device for a decision model provided by one or more embodiments of this specification.
[0027] FIG5 exemplarily shows a schematic structural diagram of a decision model optimization module in a decision model training device provided in one or more embodiments of this specification.
[0028] FIG6 exemplarily shows a schematic structural diagram of a mini-program inspection device provided by one or more embodiments of this specification.
[0029] FIG7 exemplarily shows a schematic structural diagram of an electronic device provided by one or more embodiments of this specification. DETAILED DESCRIPTION
[0030] To help those skilled in the art better understand the technical solutions in this specification, the following will provide a clear and complete description of the technical solutions in the embodiments of this specification, in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of this specification, not all of them. All other embodiments obtained by those skilled in the art based on the embodiments in this specification without creative work should fall within the scope of protection of this specification.
[0031] Mini Program inspections refer to the process from entering a Mini Program to finding the target page. Mini Program inspections can identify risks within the Mini Program. Currently, Mini Program inspections require customized inspection scripts tailored to specific business needs, obtaining specific Mini Program pages to meet specific business objectives (e.g., verifying payment flow and page integrity). However, this approach of implementing targeted inspections of specific Mini Programs by writing different inspection scripts for each Mini Program is very time-consuming and expensive.
[0032] Therefore, there is an urgent need for a new inspection script construction solution that can automatically and quickly generate inspection scripts according to different business needs.
[0033] It should be noted that in other embodiments, the steps of the corresponding method are not necessarily performed in the order shown and described in this specification. In some other embodiments, the method may include more or fewer steps than those described in this specification. In addition, a single step described in this specification may be broken down into multiple steps for description in other embodiments, and multiple steps described in this specification may be combined into a single step for description in other embodiments.
[0034] The following will combine the drawings and specific embodiments of the specification to further explain in detail the training method of a decision model, the mini-program inspection method and the device described in the embodiments of this specification, but this detailed description does not constitute a limitation on the embodiments of this specification.
[0035] In some embodiments, a decision model training method is provided. Referring to FIG. 1 , the training method includes steps S100 - S104 .
[0036] S100: Acquire a user's intention tag, an interaction action sequence of the user interacting with a webpage based on the intention described by the intention tag, and webpage image samples interacted with by the user in the process of executing the above interaction action sequence.
[0037] The above-mentioned intent tag refers to the purpose of the user's interaction with the web page. For example, if a set of interactive action sequences is to complete a payment operation, then the payment operation is the intent tag of this set of interactive action sequences. For example, if a target product is selected in a store and added to the shopping cart, then adding the product to the shopping cart is the intent tag of this set of interactive action sequences.
[0038] The above-mentioned interactive actions refer to the user's actions on the operation object on the web page. For example, if the user enters the user address in the address bar, the address bar is the operation object, and the action of filling in / entering the user address is the operation action on the operation object. For another example, if a detailed introduction of a target product is opened on the product page, the icon of the target product (clicking the icon will jump to the target product's detailed information page) or the jump button on the detailed information page is the operation object, and clicking it is the operation action on the operation object.
[0039] The web page image samples mentioned above refer to all web page images from the start page to the end page during the execution of the above interactive action sequence.
[0040] In this step, the web page image samples corresponding to each group of interactive action sequences can be input into the generation model as training samples, the intention labels can be input into the generation model as prompt information, and the operation objects and operation actions corresponding to each interactive action in the group of interactive action sequences can be used as decision labels for the corresponding web page image samples.
[0041] S102: Input the web page image sample and the intent label into the generation model to obtain the decision result.
[0042] After the web page image samples and corresponding intention labels corresponding to each set of interactive action sequences are input into the generative model, the generative model will output at least one decision result for each web page image sample. The decision result is used to characterize the operation object and operation action predicted by the generative model for the web page image sample.
[0043] S104: Determine a loss function based on the decision result and the decision label to update the parameters of the generated model to obtain a target decision model.
[0044] The above-mentioned decision labels are determined based on each interaction action in the interaction action sequence and the operation object of the interaction action in the corresponding web page image sample. Specifically, for a group of interaction actions, if the group has n interaction actions, and each interaction action results in a web page jump, then including the starting page, the group of interaction actions will generate a total of n+1 web pages. For the first n web pages, each web page has a decision label, which is used to represent the operation object (such as a button, address bar, etc.) and the operation action (such as clicking, sliding, input / filling, etc.) on the web page.
[0045] Therefore, when the generative model outputs a decision result, each decision result will have a corresponding decision label. By regressing the gap between the decision label and the decision result, the parameters of the above generative model can be updated to obtain a decision model that meets the preset conditions.
[0046] A loss function can be used to describe the gap between the decision label and the decision result. The selection of the loss function can be adaptively selected according to needs, and this embodiment does not impose any restrictions on this.
[0047] In addition, the above-mentioned satisfying the preset condition may specifically refer to the number of updates to the above-mentioned generation model reaching a preset iteration threshold, or may refer to the value of the loss function being less than a preset threshold.
[0048] As can be seen from the model training method described above, the decision model training method described in the embodiments of this specification collects a large amount of behavioral data from users interacting with mini-programs with intent labels, trains a large model, and uses it as the decision model during the inspection process, thereby achieving automated inspections. This decision model can automatically and quickly generate inspection decisions for different inspection intents and different mini-programs, saving significant time and costs.
[0049] To better illustrate the training method of the above decision model, the following will be explained in combination with specific implementation scenarios.
[0050] Please refer to Figure 2, which schematically illustrates the structure of a decision model, which includes an encoder 201 and a generator 202. Encoder 201 is used to encode an input webpage image sample into an environment representation. Generator 202 is used to generate a decision result based on the environment representation and the intent label.
[0051] In some possible implementations, the encoder 201 may be implemented using a pre-trained multimodal large model (MLLM), and the generator 202 may be implemented using a large language model (LLM).
[0052] Specifically, the multimodal large model can be pre-trained using massive amounts of pre-collected web page data, such as web page screenshots, DOM structures, etc.
[0053] When pre-training the above-mentioned multimodal large model, a generative network model can be connected to the output end of the multimodal large model, and the training process can be carried out in the following manner: the original web page image is input into the multimodal large model to obtain a predicted environmental representation; the environmental representation predicted by the multimodal large model is input into the generative network model to obtain a generated image; a generation loss function is constructed based on the gap between the generated image and the original web page image, and the parameters of the multimodal large model are updated through the generation loss function, so that the feature encoding of the original web page image by the multimodal large model is closer to the actual environmental representation of the original web page image.
[0054] After completing the pre-training of the above-mentioned multimodal large model, an environment representation model is obtained. This environment representation model can analyze web page screenshot data and convert unstructured web page screenshot data into environment representation.
[0055] Since the input of the large language model (LLM) needs to be text data, the environmental representation output by the multimodal large model must be converted into text features in natural language. Similarly, the intent label must be converted into a natural language description of the intent. For example, the intent description text could be: The purpose of this operation is to purchase a random item and reach the final payment page. The natural language text converted from the environmental representation could be: The current page is the product page, which has product button 1, product button 2, product button 3, and a confirmation button; the login button on the login page and the coffee button on the product page have been clicked in the past. Therefore, this step should be __". The decision result of the large language model (LLM) is to click on a button given in the prompt.
[0056] For the decision model shown in Figure 2, the following method can be used for training: input web page image samples into the multimodal large model to obtain environmental representation; convert the environmental representation into descriptive text in natural language form; input the intention label and descriptive text in natural language form into the large language model to obtain the decision result in text form; map the decision result in text form to the feature space of the decision label to obtain the gap between the decision result in text form and the corresponding decision label, and fine-tune the parameters of the large language model based on the loss function constructed based on the gap until the target decision model is obtained.
[0057] From the above content, it can be seen that in the training process of the decision model shown in Figure 2, the image modality is accurately described in language to a large language model (such as LLaMA, chatGLM, etc.) through a pre-trained multimodal large model (MLLM), and then fine-tuned with the corresponding intent labels and training sample data. In this way, a decision-making model with decision-making capabilities can be implemented at a lower cost.
[0058] In some more specific implementations, the parameters of the decision model can be optimized and the model performance can be improved through the results of the interaction between the decision model and the real environment.
[0059] Taking the structure of the decision model shown in Figure 2 as an example, in a specific implementation, an interface or processing module can be constructed as an intelligent agent to execute the decision results output by the decision model. During the interaction process, the user's intention instructions and the page image of the real mini-program can be input into the fine-tuned decision model. The text-based decision results output by the decision model are then converted into interactive instructions that can be understood and executed by the above-mentioned processing module or interface. The interactive instructions are then transmitted to the above-mentioned processing module or interface, so that the processing module or interface executes the interactive instructions and interacts with the real mini-program.
[0060] Specifically, a text translation model can be trained to convert the textual decision results output by the decision model into interactive instructions that can be understood and executed by the above-mentioned processing module or interface. This text translation model can adopt but is not limited to a regular matching rule model, a large prediction model (LLM), etc.
[0061] During the interaction between the agent and the real mini-program, some incorrect, repeated, and redundant decisions may occur, resulting in failure to reach the target page specified by the user's intent command. Therefore, we can select the path that successfully reaches the target page specified by the intent command from the interaction data as positive feedback, and use the remaining paths as negative feedback. Based on the reinforcement learning strategy, we update the parameters of the decision model to complete the parameter optimization of the decision model.
[0062] In some embodiments, a mini-program inspection method is also provided. Please refer to Figure 3. The training method includes steps S300-S302.
[0063] S300: Inputting the page image of the target applet and the intention instruction set by the user into the decision model.
[0064] S302: Based on each decision result of the decision model for the page image of the target applet, perform an interactive operation with the target applet until the target page specified by the intent instruction is reached.
[0065] In the above-mentioned mini-program inspection method, the decision model is obtained by adopting the above-mentioned decision model training method.
[0066] In some scenarios, after the decision model completes the inspection process specified by the user's intention instructions, the following problems may still exist.
[0067] Question 1: During the inspection process, the path taken based on the decision-making model is not the optimal path, resulting in a waste of resources.
[0068] Question 2: If the inspection process is completely handed over to the decision-making model, the entire process may be uncontrollable. Once the decision-making model makes a wrong decision, it cannot be corrected.
[0069] Problem 3: The exploration results cannot be reproduced stably.
[0070] For the above problem 1, pruning operations can be used to optimize the inspection path. Specifically, the following methods can be used: save each inspection path determined by the decision results output by the decision model during the inspection process; for inspection paths with the same starting page and target page, remove redundant, erroneous, or repeated steps through pruning operations to obtain at least one shortest inspection path.
[0071] In response to the above-mentioned problem 2, a method of setting high-priority business logic rules can be adopted. For example, for each decision result output by the decision model, the decision result can be matched with a pre-set business logic rule with a higher priority. When the decision result conflicts with the business logic rule, the operation specified by the business logic rule is executed. These business logic rules can be adaptively set according to demand, and this embodiment does not limit this. For example, the business logic rules can be set to: when the interface reports an error, stop execution; when sensitive information (user name) needs to be entered, report the behavior and stop execution; if the mini program requires authorization to run, the authorization conditions need to be met first, and so on.
[0072] To address the above problem 3, the following approach can be adopted: the shortest inspection path after pruning operation is generated as an inspection script and saved for reuse.
[0073] In some embodiments, a decision model training device is also provided. Please refer to FIG4 , which exemplarily illustrates a decision model training device that can be used to implement the decision model training method. It should be noted that the decision model training method described in one or more embodiments of the present application can be implemented by relying on the decision model training device shown in FIG4 , but is not limited to the decision model training device.
[0074] As shown in Figure 4, the training device of the decision model includes: a first data acquisition module 401, configured to obtain the user's intention label, the user's interaction action sequence with the web page based on the intention described by the intention label, and the web page image sample interacted by the user in the process of executing the interaction action sequence; a processing module 402, configured to input the web page image sample and the intention label into the generation model to obtain a decision result; determine the loss function based on the decision result and the decision label to update the parameters of the generation model to obtain the target decision model.
[0075] For the first data acquisition module 401, the intent tag it acquires is used to characterize the purpose of the user's interaction with the web page. For example, if a set of interactive action sequences is to complete a payment operation, then the payment operation is the intent tag of this set of interactive action sequences. For example, if a target product is selected in a store and added to a shopping cart, then adding the product to the shopping cart is the intent tag of this set of interactive action sequences.
[0076] The interactive action sequence obtained refers to a series of interactive actions performed by the user with the mini program in order to complete a certain intention. Specifically, the above-mentioned interactive action refers to the user's operation on the operation object in the web page. For example, if the user address is filled in the address bar, the address bar is the operation object, and the operation of filling in / entering the user address is the operation action on the operation object. For another example, if a detailed introduction of a target product is opened on the product page, the icon of the target product (clicking the icon can jump to the detail information page of the target product) or the jump button of the detail information page is the operation object, and the click operation is the operation action on the operation object.
[0077] The web page image samples mentioned above refer to all web page images from the start page to the end page during the execution of the above interactive action sequence.
[0078] Processing module 402 is primarily used to train the generative model to produce a decision model. Specifically, after inputting web page image samples and corresponding intent labels corresponding to each set of interactive action sequences into the generative model, the generative model outputs at least one decision result for each web page image sample. This decision result represents the operation object and operation action predicted by the generative model for that web page image sample.
[0079] The decision labels used in the training process are determined based on each interaction in the interaction sequence and the operation object of the interaction in the corresponding web page image sample. Specifically, for a group of interactions, if the group has n interactions, and each interaction results in a web page jump, then including the starting page, the group of interactions will generate a total of n+1 web pages. For the first n web pages, each web page has a decision label, which is used to represent the operation object (such as a button, address bar, etc.) and the operation action (such as clicking, sliding, input / filling, etc.) on the web page.
[0080] After the generation model outputs the decision results, each decision result will have a corresponding decision label. By regressing the gap between the decision label and the decision result, the processing module 402 can update the parameters of the above generation model to obtain a decision model that meets the preset conditions.
[0081] In some embodiments, the training device of the above-mentioned decision model may also include a decision model optimization module, please refer to Figure 5, the decision model optimization module may include: a second data acquisition module 501, configured to obtain the user's intention instructions and the page image of the real applet; an optimization module 502, configured to input the intention instructions and page image obtained by the second data acquisition module 501 into the decision model; based on the decision result of the decision model for the page image, perform interactive operations with the real applet and obtain interactive data; select the path that successfully reaches the target page specified by the intention instruction from the interactive data as positive feedback, and use the remaining paths as negative feedback, and update the parameters of the target decision model based on the reinforcement learning strategy.
[0082] The above-mentioned optimization module 502 can be understood as an intelligent agent, which can be implemented by constructing an interface or processing module to execute the decision results output by the decision model. Taking the decision model shown in Figure 2 as an example, during the interaction between the optimization module 502 and the real mini-program, the user's intention instructions and the page image of the real mini-program can be input into the decision model. The text-based decision results output by the decision model are then converted into interactive instructions that can be understood and executed by the optimization module 502. The interactive instructions are then transmitted to the optimization module 502 so that the optimization module 502 executes the interactive instructions and interacts with the real mini-program.
[0083] More specifically, a text translation model can be trained to convert the textual decision results output by the decision model into interactive instructions that can be understood and executed by the optimization module 502. This text translation model can adopt but is not limited to a regular matching rule model, a large prediction model (LLM), etc.
[0084] During the interaction between the optimization module 502 and the actual mini-program, some incorrect, repeated, or redundant decisions may occur, resulting in failure to reach the target page specified by the user's intent instruction. Therefore, the path that successfully reaches the target page specified by the intent instruction can be selected from the interaction data as positive feedback, and the remaining paths can be used as negative feedback. Based on the strategy of reinforcement learning, the parameters of the above decision model can be updated to complete the parameter optimization of the decision model.
[0085] The following uses the aforementioned training device, including the first data acquisition module 401 and the processing module 402, as an example to illustrate how the training device can be implemented. In practice, both the first data acquisition module 401 and the processing module 402 can be implemented via software or hardware. For example, the implementation of the first data acquisition module 401 will be described below using the first data acquisition module 401 as an example. Similarly, the implementation of the processing module 402 can refer to the implementation of the first data acquisition module 401.
[0086] As an example of a software functional unit, the first data acquisition module 401 may include code running on a computing instance. The computing instance may include at least one of a physical host (computing device), a virtual machine, and a container. Furthermore, the computing instance may be one or more. For example, the first data acquisition module 401 may include code running on multiple hosts / virtual machines / containers. The multiple hosts / virtual machines / containers used to run the code may be distributed in the same region or in different regions. Furthermore, the multiple hosts / virtual machines / containers used to run the code may be distributed in the same availability zone (AZ) or in different AZs, each AZ including one data center or multiple geographically close data centers. Typically, a region may include multiple AZs.
[0087] Similarly, multiple hosts / virtual machines / containers running the code can be distributed within the same virtual private cloud (VPC) or across multiple VPCs. Typically, a VPC is set up within a region. Cross-region communication between two VPCs within the same region, or between VPCs in different regions, requires a communication gateway within each VPC to interconnect the VPCs.
[0088] As an example of a hardware functional unit, the first data acquisition module 401 may include at least one computing device, such as a server. Alternatively, the first data acquisition module 401 may be implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). The PLD may be a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.
[0089] The multiple computing devices included in the first data acquisition module 401 can be distributed in the same region or in different regions. The multiple computing devices included in the first data acquisition module 401 can be distributed in the same AZ or in different AZs. Similarly, the multiple computing devices included in the first data acquisition module 401 can be distributed in the same VPC or in multiple VPCs. The multiple computing devices can be any combination of servers, ASICs, PLDs, CPLDs, FPGAs, GALs, and other computing devices.
[0090] In other embodiments, the first data acquisition module 401 can be used to execute any step in the above-mentioned decision model training method, and the processing module 402 can be used to execute any step in the above-mentioned decision model training method.
[0091] The steps that the first data acquisition module 401 and the processing module 402 are responsible for implementing can be specified as needed. The first data acquisition module 401 and the processing module 402 respectively implement different steps in the above-mentioned decision model training method to realize all the functions of the decision model training device.
[0092] In this implementation, the training device of the decision model can also be applied to computing devices such as computers and servers, or to a computing device cluster including at least one computing device, to realize the training function of the decision model.
[0093] In some embodiments, a mini-program inspection device is also provided. Please refer to Figure 6, which exemplarily shows a structural diagram of a mini-program inspection device, which can be used to implement the above-mentioned mini-program inspection method. It should be noted that the mini-program inspection method described in one or more embodiments of the present application can be implemented by relying on the mini-program inspection device shown in Figure 6, but is not limited to the mini-program inspection device.
[0094] As shown in Figure 6, the mini-program inspection device includes: a third data acquisition module 601, configured to obtain the page image of the target mini-program and the intention instruction set by the user; a decision generation module 602, configured to input the page image and intention instruction of the target mini-program into the decision model to obtain a decision result; the decision model here is trained by the above-mentioned decision model training method; an interaction module 603, configured to perform interactive operations with the target mini-program based on each decision result of the decision model for the page image of the target mini-program, until the target page specified by the intention instruction is reached.
[0095] In some scenarios, after the decision model completes the inspection process specified by the user's intention instructions, the following problems may still exist.
[0096] Question 1: During the inspection process, the path taken based on the decision-making model is not the optimal path, resulting in a waste of resources.
[0097] Question 2: If the inspection process is completely handed over to the decision-making model, the entire process may be uncontrollable. Once the decision-making model makes a wrong decision, it cannot be corrected.
[0098] Problem 3: The exploration results cannot be reproduced stably.
[0099] In response to the above-mentioned question 1, in some embodiments, the above-mentioned mini-program inspection device may also include an inspection path generation module, configured to save each inspection path determined by the decision results output by the decision model during the inspection process; for inspection paths with the same starting page and target page, redundant steps are removed through pruning operations to obtain at least one shortest inspection path.
[0100] In response to the above-mentioned question 2, in some embodiments, the above-mentioned interaction module 603 is also specifically used to match each decision result output by the decision model with a pre-set business logic rule with a higher priority, and when the decision result conflicts with the business logic rule, the operation specified by the business logic rule is executed. These business logic rules can be adaptively set according to needs, and this embodiment does not limit this. For example, the business logic rules can be set to: when the interface reports an error, stop execution; when sensitive information (user name) needs to be entered, report the behavior and stop execution; if the mini program requires authorization to run, the authorization conditions need to be met first.
[0101] In response to the above question 3, in some embodiments, the above inspection device may further include: an inspection script generation module configured to generate an inspection script based on the shortest inspection path and save it for reuse.
[0102] As an example of a software functional unit, the third data acquisition module 601 may include code running on a computing instance. The computing instance may include at least one of a physical host (computing device), a virtual machine, and a container. Furthermore, the computing instance may be one or more. For example, the third data acquisition module 601 may include code running on multiple hosts / virtual machines / containers. The multiple hosts / virtual machines / containers used to run the code may be distributed in the same region or in different regions. Furthermore, the multiple hosts / virtual machines / containers used to run the code may be distributed in the same availability zone (AZ) or in different AZs, each AZ including one data center or multiple geographically close data centers. Typically, a region may include multiple AZs.
[0103] Similarly, multiple hosts / virtual machines / containers running the code can be distributed within the same virtual private cloud (VPC) or across multiple VPCs. Typically, a VPC is set up within a region. Cross-region communication between two VPCs within the same region, or between VPCs in different regions, requires a communication gateway within each VPC to interconnect the VPCs.
[0104] As an example of a hardware functional unit, the third data acquisition module 601 may include at least one computing device, such as a server. Alternatively, the third data acquisition module 601 may be implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). The PLD may be a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.
[0105] The multiple computing devices included in the third data acquisition module 601 can be distributed in the same region or in different regions. The multiple computing devices included in the third data acquisition module 601 can be distributed in the same AZ or in different AZs. Similarly, the multiple computing devices included in the third data acquisition module 601 can be distributed in the same VPC or in multiple VPCs. The multiple computing devices can be any combination of servers, ASICs, PLDs, CPLDs, FPGAs, GALs, and other computing devices.
[0106] In other embodiments, the third data acquisition module 601 can be used to execute any step in the above-mentioned mini-program inspection method, the decision generation module 602 can be used to execute any step in the above-mentioned mini-program inspection method, and the interaction module 603 can be used to execute any step in the above-mentioned mini-program inspection method.
[0107] The steps that the third data acquisition module 601, decision generation module 602 and interaction module 603 are responsible for implementing can be specified as needed. The third data acquisition module 601, decision generation module 602 and interaction module 603 respectively implement different steps in the above-mentioned mini-program inspection method to realize all the functions of the mini-program inspection device.
[0108] In this implementation, the mini-program inspection device can also be applied to computing devices such as computers and servers, or to a computing device cluster including at least one computing device, to realize the mini-program inspection function.
[0109] In some embodiments, an electronic device is also provided. Referring to Figure 7 , the electronic device includes a bus 701, a processor 702, a memory 703, and a communication interface 704. The processor 702, the memory 703, and the communication interface 704 communicate with each other via the bus 701. The electronic device may be a server or a terminal device. It should be understood that this application does not limit the number of processors and memories in the electronic device.
[0110] Bus 701 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. Buses may be classified as address buses, data buses, control buses, and the like. For ease of illustration, FIG7 illustrates a single bus line, but this does not imply a single bus or type of bus. Bus 701 may include a path for transmitting information between various components of an electronic device (e.g., processor 702, memory 703, and communication interface 704).
[0111] The processor 702 may include any one or more processors such as a CPU, a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).
[0112] The memory 703 may include a volatile memory, such as a random access memory (RAM). The memory 703 may also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD), or a solid state drive (SSD).
[0113] The memory 703 stores executable program code, and the processor 702 executes the executable program code to respectively implement the functions of the aforementioned first data acquisition module 401 and processing module 402, that is, to implement the functions of the aforementioned decision model training device, thereby implementing the aforementioned decision model training method. Alternatively, the memory 703 stores executable program code, and the processor 702 executes the executable program code to respectively implement the functions of the aforementioned third data acquisition module 601, decision generation module 602, and interaction module 603, that is, to implement the functions of the aforementioned mini-program inspection device, thereby implementing the aforementioned mini-program inspection method.
[0114] That is, the memory 703 stores instructions for executing the training method of the decision model or the mini-program inspection method.
[0115] The communication interface 704 uses a transceiver module such as, but not limited to, a network interface card or a transceiver to implement communication between the electronic device and other devices or a communication network.
[0116] In some embodiments, a computer-readable storage medium is also provided, which stores a computer program. When the computer program runs on an electronic device, the electronic device executes the above-mentioned decision model training method, or implements the above-mentioned mini-program inspection method.
[0117] The computer-readable storage medium can be any available medium that can be stored by the electronic device or a data storage device such as a data center that contains one or more available media. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a magnetic tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive). The computer-readable storage medium includes instructions that instruct the electronic device to execute the model training method.
[0118] It should be understood that the structures illustrated in the embodiments of this specification do not constitute specific limitations on the systems of the embodiments of this specification. In other embodiments of the specification, the above-mentioned system may include more or fewer components than shown in the figure, or some components may be combined, some components may be separated, or the components may be arranged differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0119] The various embodiments in this specification are described in a progressive manner. Similar parts between the various embodiments can be referred to in conjunction with each other. Each embodiment focuses on the differences from other embodiments. In particular, the device embodiments are generally similar to the method embodiments, so the description is relatively simple. For relevant parts, refer to the description of the method embodiments.
[0120] The foregoing description of this specification describes specific embodiments. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in an order different from that described in the embodiments and still achieve the desired results. Furthermore, the processes depicted in the accompanying drawings do not necessarily require the specific order shown or the sequential order to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0121] It should be noted that the above examples are merely specific embodiments of the present invention. Obviously, the present invention is not limited to the above examples, and many similar variations are possible. All variations directly derived from or associating with the present invention by those skilled in the art are intended to fall within the scope of protection of the present invention.
Claims
1. A decision model training method, comprising: Obtaining a user's intention tag and a sequence of interaction actions of the user to interact with the webpage based on the intention described by the intention tag; Acquiring web page image samples interacted with by the user during the execution of the interactive action sequence; Inputting the webpage image sample and the intent label into a generative model to obtain a decision result; Determining a loss function based on the decision result and the decision label to update the parameters of the generative model to obtain a target decision model; The decision label is determined according to each interactive action in the interactive action sequence and the operation object of the interactive action in the web page image sample.
2. The method of claim 1, further comprising: Inputting the user's intention instruction and the page image of the real mini program into the decision model; Based on the decision result of the decision model for the page image, performing an interactive operation with the mini-program and obtaining interactive data; The path that successfully reaches the target page specified by the intention instruction is selected from the interaction data as positive feedback, and the remaining paths are used as negative feedback. Based on the reinforcement learning strategy, the parameters of the target decision model are updated.
3. The method of claim 1, wherein the generative model comprises an encoder and a generator; Inputting the webpage image sample and the intent label into the generative model to obtain a decision result, specifically including: Inputting the web page image sample into the encoder to obtain an environment representation; The environment representation and the intention label are input into a generator to obtain the decision result.
4. The method according to claim 3, wherein the encoder is a large multimodal model and the generator is a large language model; inputting the environment representation and the intent label into the generator to obtain the decision result specifically comprises: Converting the environment representation into a description text in a natural language form; The description text and the intention label are input into the generator to obtain a decision result in text form; the decision result in text form is used to characterize the operation object in the web page image sample and the interactive action performed on the operation object.
5. A mini-program inspection method, comprising: Input the target applet's page image and the user's set intention instruction into the decision model; The decision model is trained using the method described in any one of claims 1 to 4; Based on each decision result of the decision model for the page image of the target applet, an interactive operation with the target applet is performed until the target page specified by the intention instruction is reached.
6. The method according to claim 5, performing an interactive operation with the target applet based on each decision result of the decision model for the page image of the target applet, specifically comprising: For each decision result output by the decision model, the decision result is matched with a pre-set business logic rule with a higher priority. When the decision result conflicts with the business logic rule, the operation specified by the business logic rule is executed.
7. The method of claim 5, further comprising: Saving each inspection path determined based on the decision result output by the decision model during the inspection process; For inspection paths with the same starting page and target page, redundant steps are removed through pruning operations to obtain at least one shortest inspection path.
8. The method of claim 7, further comprising: Generate an inspection script based on the shortest inspection path.
9. A training device for a decision model, comprising: A first data acquisition module is configured to acquire a user's intention tag, a sequence of interaction actions of the user interacting with the webpage based on the intention described by the intention tag, and webpage image samples interacted with by the user in the process of executing the interaction action sequence; a processing module configured to input the webpage image sample and the intent label into a generation model to obtain a decision result; Determining a loss function based on the decision result and the decision label to update the parameters of the generative model to obtain a target decision model; The decision label is determined according to each interactive action in the interactive action sequence and the operation object of the interactive action in the web page image sample.
10. The apparatus of claim 9, further comprising: A second data acquisition module is configured to acquire the user's intended instruction and the page image of the real mini program; an optimization module configured to input the intention instruction and the page image acquired by the second data acquisition module into the decision model; Based on the decision result of the decision model for the page image, performing an interactive operation with the mini-program and obtaining interactive data; The path that successfully reaches the target page specified by the intention instruction is selected from the interaction data as positive feedback, and the remaining paths are used as negative feedback. Based on the reinforcement learning strategy, the parameters of the target decision model are updated.
11. A small program inspection device, comprising: A third data acquisition module is configured to acquire a page image of a target applet and an intention instruction set by a user; A decision generation module configured to input the page image of the target applet and the intention instruction into a decision model to obtain a decision result; the decision model is trained using the method according to any one of claims 1 to 4; The interaction module is configured to perform an interaction operation with the target applet based on each decision result of the decision model for the page image of the target applet until the target page specified by the intention instruction is reached.
12. In the device as described in claim 11, the interaction module is specifically used to match each decision result output by the decision model with a pre-set business logic rule with a higher priority, and when the decision result conflicts with the business logic rule, execute the operation specified by the business logic rule.
13. The apparatus of claim 11, further comprising: An inspection path generation module is configured to save each inspection path determined based on the decision result output by the decision model during the inspection process; For inspection paths with the same starting page and target page, redundant steps are removed through pruning operations to obtain at least one shortest inspection path.
14. The apparatus of claim 13, further comprising: The inspection script generation module is configured to generate an inspection script according to the shortest inspection path.
15. A computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the computer program implements the method according to any one of claims 1 to 4, or the method according to any one of claims 5 to 8.
16. An electronic device comprising: one or more processors; as well as A memory associated with the one or more processors, the memory being used to store program instructions, wherein when the program instructions are read and executed by the one or more processors, the program instructions execute the method according to any one of claims 1 to 4, or the method according to any one of claims 5 to 8.
Citation Information
Patent Citations
Application program testing method and equipment and computer readable medium
CN110221959A
Verification method and device of applet, equipment and storage medium
CN111597114A
RPA webpage operation automation method and system based on Transform
CN115878003A
Intelligent webpage operation method and system and application thereof
CN117033156A
RPA process execution system and method based on page state understanding and large model driving
CN117196546A