Simulation test service generation method and device, medium, equipment and product

By using cross-browser automation tools and large-model intelligent agents to generate simulation test services, the tedious problem of manual code writing in existing technologies is solved, and fast and efficient simulation test service generation is achieved, improving development efficiency and code reusability.

CN120687360APending Publication Date: 2025-09-23JIANGSU HAIRUO INFORMATION TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510744075.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-05
Publication Date
2025-09-23

AI Technical Summary

Technical Problem

In the existing technology, building simulation test services is cumbersome and requires manual writing of a large amount of code. It also has poor reusability and cannot efficiently generate simulation test services.

Method used

Configure the target address through the configuration page, use cross-browser automation tools to record business operations, combine large model analysis agents and coding agents to generate logical code data for simulation test services, and realize automated operations and intelligent code generation.

Benefits of technology

Significantly shorten the simulation test service generation time, increase development efficiency several times, simplify the development process, enhance code reusability, reduce development costs, and improve resource utilization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120687360A_ABST
    Figure CN120687360A_ABST
Patent Text Reader

Abstract

The invention provides a simulation test service generation method and device, a medium, equipment and a product. The method comprises the following steps: providing a configuration page so that a person configures a target address on the configuration page; starting a cross-browser automatic tool to enable the cross-browser automatic tool to open a browser, and accessing the target address through the browser; recording a service operation of a user on a webpage corresponding to the target address through the cross-browser automatic tool to obtain a recorded script; submitting the recorded script to a large model, so that the large model generates logic code data corresponding to a simulation test service according to the recorded script; and running the logic code data to start and run the corresponding simulation test service. The problem that joint debugging is inconvenient due to the fact that external resources cannot be connected or data is temporarily modified in the development process can be solved, the development efficiency is improved compared with a manual coding mode, and reusability is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of service development technology, and in particular to a simulation test service generation method, device, medium, equipment and product. Background Art

[0002] Mock testing services, also known as simulation testing services, play a crucial role in the software development process. Mock testing services use virtual objects to create tests for objects that are difficult to construct or obtain. In real-world development, it's common to rely on external interfaces or services. However, these external resources can be disconnected, unstable, or slow to respond, making joint debugging impossible.

[0003] Currently, building simulation test services is a complex process, often requiring developers to manually write a large amount of code to simulate interface requests and responses. This is not only time-consuming and labor-intensive, but also results in poor code reusability. Summary of the Invention

[0004] In response to at least one of the above technical problems, embodiments of the present invention provide a simulation test service generation method, apparatus, medium, equipment, and product.

[0005] According to a first aspect, an embodiment of the present invention provides a simulation test service generation method comprising:

[0006] Providing a configuration page so that a person can configure a target address on the configuration page;

[0007] Starting a cross-browser automation tool, so that the cross-browser automation tool opens a browser and accesses the target address through the browser;

[0008] Recording the user's business operations on the web page corresponding to the target address by the cross-browser automation tool to obtain a recording script;

[0009] Submitting the recorded script to the big model so that the big model generates logic code data corresponding to the simulation test service according to the recorded script;

[0010] The logic code data is run to start and run the corresponding simulation test service.

[0011] In one embodiment, the large model includes a large model analysis agent and a large model encoding agent;

[0012] Submitting the recorded script to the big model so that the big model generates logic code data corresponding to the simulation test service according to the recorded script includes:

[0013] Submitting the recorded script to the large model analysis agent so that the large model analysis agent analyzes the request in the recorded script to obtain a request analysis result;

[0014] The request analysis result is sent to the large model coding agent, so that the large model coding agent generates logic code data corresponding to the simulation test service according to the request analysis result.

[0015] In one embodiment, submitting the recorded script to a large model analysis agent so that the large model analysis agent analyzes the request in the recorded script to obtain a request analysis result includes:

[0016] Submitting the recorded script to the large model analysis agent, so that the large model analysis agent analyzes at least one of the interface address, request method, request parameters, and request return value requested in the recorded script to obtain an initial analysis result;

[0017] Information that meets the generation requirements of the simulation test service is screened out from the initial analysis results, and the screened information is standardized and organized to obtain the request analysis result.

[0018] In one embodiment, the sending of the request analysis result to the large model coding agent so that the large model coding agent generates logic code data corresponding to the simulation test service according to the request analysis result includes:

[0019] The request analysis result is sent to the large model coding agent so that the large model coding agent generates corresponding Python code according to the request analysis result, converts the request return value in the request analysis result into simulation test data, and the Python code and the simulation test data constitute the logical code data corresponding to the simulation test service.

[0020] In one embodiment, the configuration page further has a browser type specification item for the personnel to specify the browser type;

[0021] The starting of the cross-browser automation tool so that the cross-browser automation tool opens a browser and accesses the target address through the browser includes:

[0022] The cross-browser automation tool is started to open a browser corresponding to a browser type specified by a user, and access the target address through the browser.

[0023] In one embodiment, the cross-browser automation tool is the Playwright automation tool.

[0024] According to a second aspect, an embodiment of the present invention provides a simulation test service generating device comprising:

[0025] A page providing module, configured to provide a configuration page, so that a person can configure a target address on the configuration page;

[0026] A tool startup module, configured to start a cross-browser automation tool, so that the cross-browser automation tool opens a browser and accesses the target address through the browser;

[0027] A script recording module is used to record the user's business operations on the web page corresponding to the target address through the cross-browser automation tool to obtain a recorded script;

[0028] A big model calling module, used for submitting the recorded script to the big model, so that the big model generates logic code data corresponding to the simulation test service according to the recorded script;

[0029] The code running module is used to run the logic code data to start and run the corresponding simulation test service.

[0030] According to a third aspect, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to execute the method provided in the first aspect.

[0031] According to a fourth aspect, an embodiment of the present invention provides a computing device, comprising a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the method provided in the first aspect is implemented.

[0032] According to a fifth aspect, an embodiment of the present invention provides a computer program product comprising a computer program, which implements the method provided in the first aspect when executed by a processor.

[0033] The simulation test service generation method, device, medium, equipment and product provided by the embodiment of the present invention realize the rapid generation of simulation test services through a large model combined with a cross-browser automation tool, and start the simulation test service for local debugging, thereby solving the problem of inconvenience in joint debugging due to the inability to connect to external resources or temporary modification of data during the development process. Moreover, through automated operation recording and large-scale intelligent analysis and coding, the generation time of the simulation test service is greatly shortened. Compared with the traditional manual writing method, the development efficiency is improved several times, allowing developers to quickly enter the joint debugging test stage and speed up the project development progress. In addition, the generated simulation test service can be reused in different projects or similar business scenarios to improve reusability. Developers only need to adjust some parameters according to actual needs, reduce repetitive work, reduce development costs, and improve the utilization of development resources. It can be seen that the rapid and intelligent generation of simulation test services can simplify the development process, improve development efficiency, enhance the reusability of code, and provide a more convenient and efficient solution for software development and testing. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] Figure 1 A flowchart of a method for generating a simulation test service according to an embodiment of the present invention;

[0035] Figure 2 This is a structural block diagram of a simulation test service generating device in one embodiment of the present invention. DETAILED DESCRIPTION

[0036] In the first aspect, an embodiment of the present invention provides a method for generating a simulation test service, see Figure 1 The method includes the following steps S110 to S140:

[0037] S110, providing a configuration page, so that a person can configure a target address on the configuration page;

[0038] The target address is the external interface address that needs to be simulated.

[0039] In one embodiment, the configuration page may further include a browser type specification item for a person to specify a browser type.

[0040] The browser type can be Chrome, Firefox, etc., which provides a basic environment for subsequent automated operations.

[0041] S120: Start a cross-browser automation tool to enable the cross-browser automation tool to open a browser and access the target address through the browser;

[0042] The cross-browser automation tool may be the Playwright automation tool. The Playwright automation tool is a modern browser automation tool that supports cross-browser and cross-language automated testing and operations.

[0043] In one embodiment, based on the browser type specified by the person, starting the cross-browser automation tool in S120 so that the cross-browser automation tool opens a browser and accesses the target address through the browser may include:

[0044] The cross-browser automation tool is started to open a browser corresponding to a browser type specified by a user, and access the target address through the browser.

[0045] It can be seen that after the cross-browser automation tool is started, the cross-browser automation tool opens a browser corresponding to the browser type specified by the user, and then accesses the target address on the browser.

[0046] S130, recording the user's business operations on the web page corresponding to the target address by the cross-browser automation tool to obtain a recording script;

[0047] For example, the Playwright automation tool is launched, which opens a browser and visits a target URL. Developers perform various business operations on the target URL's webpage, such as clicking buttons, entering data, and submitting forms. The Playwright automation tool records these operations in real time and generates a detailed Playwright script, which records the details of each operation step.

[0048] S140: Submitting the recorded script to the big model so that the big model generates logic code data corresponding to the simulation test service according to the recorded script;

[0049] In one embodiment, the large model includes a large model analysis agent and a large model encoding agent; S140 may specifically include:

[0050] S141, submitting the recorded script to the large model analysis agent, so that the large model analysis agent analyzes the request in the recorded script and obtains the request analysis result;

[0051] Among them, S141 may include:

[0052] A1. Submitting the recorded script to the large model analysis agent, so that the large model analysis agent analyzes at least one of the requested interface address, request method, request parameters, and request return value in the recorded script to obtain an initial analysis result;

[0053] A2. Filter out information that meets the generation requirements of the simulation test service from the initial analysis results, and standardize and organize the filtered information to obtain the request analysis results.

[0054] For example, the large-model analysis agent performs a comprehensive analysis of Fetch / XHR requests in the script, including parsing the request URL to determine the interface address, identifying the request method, extracting request parameters to understand the data transmission content, and analyzing the request return value to obtain the interface response data. It then selects information that meets the generation requirements of the simulation test service, namely the mock test service, and organizes this information according to unified standards to obtain standardized request analysis results.

[0055] S142. Send the request analysis result to the large model coding agent, so that the large model coding agent generates logic code data corresponding to the simulation test service according to the request analysis result.

[0056] Among them, S142 may include: sending the request analysis result to the large model coding agent, so that the large model coding agent generates corresponding Python code according to the request analysis result, converts the request return value in the request analysis result into simulation test data, and constitutes the logical code data corresponding to the simulation test service with the Python code and the simulation test data.

[0057] It can be seen that the requests in the recorded script are analyzed by the big model analysis agent, the logical code data is generated by the big model encoding agent, and different processing is performed by different agents. The division of labor is clear and easy to implement.

[0058] S150: Run the logic code data to start and run the corresponding simulation test service.

[0059] Among them, after the Mock test service is started, it provides the corresponding interface to the local service for debugging. The local service can call the interface of the Mock test service just like calling the real interface to obtain Mock data and implement local joint debugging testing.

[0060] The method provided by the present invention has the following beneficial effects:

[0061] (1) Fast and efficient: Through automated operation recording, large model intelligent analysis, and code generation, the generation time of mock test services is greatly shortened. Compared with the traditional manual writing method, the development efficiency is improved several times, allowing developers to quickly enter the joint debugging and testing phase, accelerating the project development progress.

[0062] (2) Easy to use: Developers only need to perform simple configuration and business operation recording without having to deeply understand the complex Mock code writing logic, which lowers the usage threshold. Even developers with less experience can easily get started and quickly generate the required Mock services.

[0063] (3) High accuracy: The large model's precise analysis of requests and intelligently generated Python code can accurately simulate the request and response logic of the real interface. The generated Mock data is highly consistent with the actual interface return data, which improves the accuracy and reliability of the test and effectively discovers potential problems in the code.

[0064] (4) Versatile and scalable: The generated Mock test service can be reused in different projects or similar business scenarios. Developers only need to adjust some parameters according to actual needs to quickly build an adaptive Mock test environment, reducing repetitive work, lowering development costs, and improving the utilization of development resources.

[0065] In summary, the present invention uses a large model combined with a cross-browser automation tool to quickly generate a Mock test service, and finally starts the Mock test service for local debugging. This method can ensure development when the target website cannot be connected, thus solving the problem of inconvenience in joint debugging due to the inability to connect to external resources or temporary modification of data during the development process. At the same time, the rapid and intelligent generation of Mock test services can simplify the development process, improve development efficiency, enhance the reusability of code, and provide a more convenient and efficient solution for software development and testing.

[0066] In a second aspect, an embodiment of the present invention provides a simulation test service generating device, see Figure 2 , the apparatus 100 comprises:

[0067] A page providing module 110 is used to provide a configuration page so that a person can configure a target address on the configuration page;

[0068] A tool starting module 120 is configured to start a cross-browser automation tool, so that the cross-browser automation tool opens a browser and accesses the target address through the browser;

[0069] A script recording module 130 is configured to record the user's business operations on the web page corresponding to the target address through the cross-browser automation tool to obtain a recorded script;

[0070] The big model calling module 140 is used to submit the recorded script to the big model so that the big model generates logic code data corresponding to the simulation test service according to the recorded script;

[0071] The code execution module 150 is configured to execute the logic code data to start and execute the corresponding simulation test service.

[0072] In one embodiment, the large model includes a large model analysis agent and a large model encoding agent; the large model calling module includes:

[0073] An analysis unit, configured to submit the recorded script to a large model analysis agent, so that the large model analysis agent analyzes the request in the recorded script to obtain a request analysis result;

[0074] The encoding unit is used to send the request analysis result to the large model encoding agent, so that the large model encoding agent generates logical code data corresponding to the simulation test service according to the request analysis result.

[0075] In one embodiment, the analysis unit is specifically used to: submit the recorded script to the large model analysis agent, so that the large model analysis agent analyzes at least one of the interface address, request method, request parameters and request return value requested in the recorded script to obtain an initial analysis result; filter out information that meets the generation requirements of the simulation test service from the initial analysis result, and standardize and organize the filtered information to obtain the request analysis result.

[0076] In one embodiment, the encoding unit is specifically used to: send the request analysis result to the large model encoding agent, so that the large model encoding agent generates corresponding Python code according to the request analysis result, converts the request return value in the request analysis result into simulation test data, and constitutes the logical code data corresponding to the simulation test service with the Python code and the simulation test data.

[0077] In one embodiment, the configuration page also has a browser type specification item for personnel to specify the browser type; the tool startup module is specifically used to: start the cross-browser automation tool so that the cross-browser automation tool opens the browser corresponding to the browser type specified by the user, and accesses the target address through the browser.

[0078] In one embodiment, the cross-browser automation tool is the Playwright automation tool.

[0079] It is understandable that the explanation, specific implementation, beneficial effects, examples, etc. of the relevant contents in the device provided by the embodiment of the present invention can be found in the corresponding parts of the method provided in the first aspect, and will not be repeated here.

[0080] In a third aspect, an embodiment of the present invention provides a computer-readable medium having computer instructions stored thereon. When the computer instructions are executed by a processor, the processor executes the method provided in the first aspect.

[0081] Specifically, a system or device equipped with a storage medium can be provided, on which software program codes that implement the functions of any of the above-mentioned embodiments are stored, and a computer (or CPU or MPU) of the system or device can be enabled to read and execute the program codes stored in the storage medium.

[0082] In this case, the program code itself read from the storage medium can realize the function of any one of the above-mentioned embodiments, and thus the program code and the storage medium storing the program code constitute part of the present invention.

[0083] Examples of storage media for providing program code include floppy disks, hard disks, magneto-optical disks, optical disks (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD+RW), magnetic tapes, non-volatile memory cards, and ROMs. Alternatively, the program code can be downloaded from a server computer via a communication network.

[0084] In addition, it should be clear that the functions of any of the above embodiments can be achieved not only by executing the program code read by the computer, but also by enabling the operating system operating on the computer to complete part or all of the actual operations based on the instructions of the program code.

[0085] In addition, it can be understood that the program code read from the storage medium is written into a memory provided in an expansion board inserted into the computer or into a memory provided in an expansion module connected to the computer, and then based on the instructions of the program code, a CPU installed on the expansion board or expansion module is enabled to perform part or all of the actual operations, thereby realizing the functions of any of the above embodiments.

[0086] It is understandable that the explanation, specific implementation methods, beneficial effects, examples, etc. of the relevant contents in the computer-readable medium provided in the embodiment of the present invention can be found in the corresponding parts of the method provided in the first aspect, and will not be repeated here.

[0087] In a fourth aspect, an embodiment of this specification provides a computing device, comprising a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, it implements the method in any one of the embodiments in the specification.

[0088] It is understandable that the explanation, specific implementation, beneficial effects, examples, etc. of the relevant contents in the computing device provided by the embodiment of the present invention can be found in the corresponding parts of the method provided in the first aspect, and will not be repeated here.

[0089] In a fifth aspect, an embodiment of this specification provides a computer program product, including a computer program, which implements the method provided in the first aspect when executed by a processor.

[0090] It is understandable that the explanation, specific implementation methods, beneficial effects, examples, etc. of the relevant contents in the computer program product provided by the embodiment of the present invention can be found in the corresponding parts of the method provided in the first aspect, and will not be repeated here.

[0091] 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.

[0092] Those skilled in the art will appreciate that in one or more of the above examples, the functions described in the present invention may be implemented using hardware, software, widgets, or any combination thereof. When implemented using software, these functions may be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium.

[0093] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent replacements, improvements, etc. made on the basis of the technical solution of the present invention should be included in the scope of protection of the present invention.

Claims

1. A method for generating a simulation test service, characterized in that: include: Providing a configuration page so that a person can configure a target address on the configuration page; Starting a cross-browser automation tool, so that the cross-browser automation tool opens a browser and accesses the target address through the browser; Recording the user's business operations on the web page corresponding to the target address by the cross-browser automation tool to obtain a recording script; Submitting the recorded script to the big model so that the big model generates logic code data corresponding to the simulation test service according to the recorded script; The logic code data is run to start and run the corresponding simulation test service.

2. The method according to claim 1, characterized in that The large model includes a large model analysis agent and a large model encoding agent; Submitting the recorded script to the big model so that the big model generates logic code data corresponding to the simulation test service according to the recorded script includes: Submitting the recorded script to the large model analysis agent so that the large model analysis agent analyzes the request in the recorded script to obtain a request analysis result; The request analysis result is sent to the large model coding agent, so that the large model coding agent generates logic code data corresponding to the simulation test service according to the request analysis result.

3. The method according to claim 2, characterized in that Submitting the recorded script to the large model analysis agent so that the large model analysis agent analyzes the request in the recorded script to obtain a request analysis result includes: Submitting the recorded script to the large model analysis agent, so that the large model analysis agent analyzes at least one of the interface address, request method, request parameters, and request return value requested in the recorded script to obtain an initial analysis result; Information that meets the generation requirements of the simulation test service is screened out from the initial analysis results, and the screened information is standardized and organized to obtain the request analysis result.

4. The method according to claim 2, characterized in that The step of sending the request analysis result to the large model coding agent so that the large model coding agent generates logic code data corresponding to the simulation test service according to the request analysis result includes: The request analysis result is sent to the large model coding agent so that the large model coding agent generates corresponding Python code according to the request analysis result, converts the request return value in the request analysis result into simulation test data, and the Python code and the simulation test data constitute the logical code data corresponding to the simulation test service.

5. The method according to claim 1, wherein The configuration page also has a browser type specification item for personnel to specify the browser type; The starting of the cross-browser automation tool so that the cross-browser automation tool opens a browser and accesses the target address through the browser includes: The cross-browser automation tool is started to open a browser corresponding to a browser type specified by a user, and access the target address through the browser.

6. The method according to claim 1, characterized in that The cross-browser automation tool is the Playwright automation tool.

7. A simulation test service generating device, characterized in that: include: A page providing module, configured to provide a configuration page, so that a person can configure a target address on the configuration page; A tool startup module, configured to start a cross-browser automation tool, so that the cross-browser automation tool opens a browser and accesses the target address through the browser; A script recording module is used to record the user's business operations on the web page corresponding to the target address through the cross-browser automation tool to obtain a recorded script; A big model calling module, used for submitting the recorded script to the big model, so that the big model generates logic code data corresponding to the simulation test service according to the recorded script; The code running module is used to run the logic code data to start and run the corresponding simulation test service.

8. A computer-readable storage medium, characterized in that A computer program is stored thereon, and when the computer program is executed in a computer, the computer is caused to execute the method according to any one of claims 1 to 6.

9. A computing device, characterized in that The method comprises a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the method according to any one of claims 1 to 6 is implemented.

10. A computer program product, characterized in that The invention comprises a computer program, which implements the method according to any one of claims 1 to 6 when the computer program is executed by a processor.