Automatic script generation method and device, electronic equipment and storage medium

By parsing the communication data between the browser and the server, the system automatically identifies parameter dependencies and infers encryption logic, generating a well-structured automated script. This solves the problems of high maintenance costs and low writing efficiency in existing technologies, achieving highly efficient automated script generation.

CN121807700APending Publication Date: 2026-04-07SHANGHAI ANKELIAN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-16
Publication Date
2026-04-07

AI Technical Summary

Technical Problem

In existing technologies, automated testing tools based on browser operation recording have high maintenance costs when page elements change dynamically, while API-based tools have low writing efficiency and high barriers to entry, resulting in low efficiency in generating automated scripts during software development and testing.

Method used

By capturing communication data between the browser and the server, parsing the parameter dependencies of request and response data, combining intelligent algorithms to infer encryption logic, generating automated execution scripts, and outputting configurable parameter files.

Benefits of technology

It improves the efficiency of generating automated scripts, reduces development costs, and produces scripts with clear structures and complete comments, making them suitable for automated execution of browser operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121807700A_ABST
    Figure CN121807700A_ABST
Patent Text Reader

Abstract

The invention provides an automatic script generation method and device, electronic equipment and a storage medium, and relates to the technical field of computers. Comprising the following steps: capturing communication data generated by communication between a target browser and a server; according to a first type of request parameter in the request data corresponding to each request and each response parameter in the response data corresponding to each request, determining a mapping relationship between the first type of request parameter of each request and each response parameter of other requests, and generating a mapping relationship graph and a configuration file; according to a second type of request parameter in the request data corresponding to each request, determining encryption algorithm information corresponding to the second type of request parameter of each request; and according to the request data corresponding to each request, the mapping relation graph, the configuration file and the encryption algorithm information corresponding to the second type of request parameter of each request, generating an automatic execution script corresponding to the target operation of the target browser. According to the method, the automatic script generation efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and more specifically, to an automated script generation method, apparatus, electronic device, and storage medium. Background Technology

[0002] In software development and testing, repetitive operations are often required on websites to ensure software quality and development efficiency.

[0003] Existing technologies mainly rely on two types of tools: one is automated testing tools based on browser operation recording, which can generate scripts to control page elements. However, when page elements change frequently, the scripts need to be modified frequently, resulting in high script maintenance costs. The other type is interface request tools, which require manual analysis and filling in of relevant parameters to generate application programming interface (API) scripts, which is inefficient and prone to errors. Summary of the Invention

[0004] The purpose of this application is to address the shortcomings of the prior art by providing an automated script generation method, apparatus, electronic device, and storage medium to improve the efficiency of automated test script generation.

[0005] To achieve the above objectives, the technical solutions adopted in the embodiments of this application are as follows: In a first aspect, embodiments of this application provide an automated script generation method, including: During the process of a user performing a target operation on a target browser, the communication data generated between the target browser and the server is captured. The communication data includes: request data corresponding to each request and response data corresponding to each request. Based on the first type of request parameters in the request data corresponding to each request and the response parameters in the response data corresponding to each request, the mapping relationship between the first type of request parameters of each request and the response parameters of other requests is determined, and a mapping relationship graph and a configuration file are generated; the mapping relationship graph is used to record the mapping relationship between the request parameters of the current request and the response parameters of the previous request; the configuration file is used to record the request parameters to be configured in the request, and each request parameter to be configured is marked with the identifier of the request to which it belongs and the parameter format information; Based on the second type of request parameters in the request data corresponding to each request, determine the encryption algorithm information corresponding to the second type of request parameters of each request; Based on the request data corresponding to each request, the mapping relationship graph, the configuration file, and the encryption algorithm information corresponding to the second type of request parameters of each request, an automated execution script corresponding to the target operation of the target browser is generated.

[0006] Optionally, capturing communication data generated between the target browser and the server includes: Query and obtain the response status identifier corresponding to each original request. The response status identifier is used to indicate the processing status of the server for the original request. Based on the response status identifier corresponding to each original request, at least one request is selected from each original request, and the request data and response data corresponding to each request are used as the communication data.

[0007] Optionally, the step of determining the mapping relationship between the first type of request parameters of each request and the response parameters of other requests based on the first type of request parameters in the request data corresponding to each request and the response parameters in the response data corresponding to each request, and generating a mapping relationship map and configuration file, includes: Extract each first-type request parameter and the corresponding request parameter value from the request data corresponding to each request. Extract each response parameter and its corresponding value from the response data corresponding to each request; Based on the comparison results of the request parameter values ​​corresponding to each first type of request parameter of each request and the response parameter values ​​corresponding to each response parameter of other requests, the mapping relationship between each first type of request parameter of each request and the response parameters of other requests is determined, and the request parameters to be configured for each request are determined. The mapping relationship map is generated based on the mapping relationship between each first type of request parameter of each request and each response parameter of other requests; The configuration file is generated based on the configuration request parameters for each request.

[0008] Optionally, determining the mapping relationship between each first-type request parameter of each request and each response parameter of other requests, and determining the request parameters to be configured for each request, based on the comparison results of the request parameter values ​​corresponding to each first-type request parameter of each request and the response parameter values ​​corresponding to each response parameter of other requests, includes: For the current request, iterate through all comparison requests with timestamps earlier than the current request; Based on the current comparison request encountered, the request parameter values ​​corresponding to each first type of request parameter in the current request are compared with the response parameter values ​​of the current comparison request to determine whether there are any response parameter values ​​that are the same as the request parameter values ​​corresponding to each first type of request parameter in the current request. If they exist, record the mapping relationship between each first type of request parameter in the current request and the corresponding response parameter in the current comparison request; If it does not exist, then update the previous request of the current comparison request to the new current comparison request; The process is repeated until the mapping relationship between each first-type request parameter in all requests and the response parameters in all requests that came before the request is determined. Each first-type request parameter in each request whose mapping relationship has not been determined is then used as the request parameter to be configured for that request.

[0009] Optionally, generating the configuration file based on the configuration request parameters for each request includes: Based on the correspondence between each request parameter to be configured and the request, as well as the request parameter value of each request parameter to be configured, generate annotation information for each request parameter to be configured. The configuration file is generated based on each parameter to be configured and its annotation information.

[0010] Optionally, the step of generating annotation information for each request parameter to be configured based on the correspondence between each request parameter to be configured and the request parameter value of each request parameter to be configured includes: Based on the correspondence between each request parameter to be configured and the request, generate an identifier for the request to which each request parameter belongs; Based on the request parameter values ​​of each request parameter to be configured, determine the parameter format template of each request parameter to be configured, and use the parameter format template of each request parameter to be configured as the parameter format information of each request parameter to be configured. Based on the identifier of the request to which each request parameter to be configured belongs and the parameter format information of each request parameter to be configured, the annotation information of each request parameter to be configured is obtained.

[0011] Optionally, determining the encryption algorithm information corresponding to the second type of request parameters for each request based on the second type of request parameters in the request data corresponding to each request includes: Retrieve the target ciphertext information corresponding to the second type of request parameter in the request data of each request; Based on the target ciphertext information corresponding to the second type of request parameters of each request, the encryption feature information of the target ciphertext information is extracted; the encryption feature information includes: the string length of the target ciphertext information, the character base type of the target ciphertext information, the encoding type of the target ciphertext information, and the entropy value of the target ciphertext information; Based on the encryption feature information of the target ciphertext, a pre-trained encryption algorithm calculation model is used to determine the matching degree between the target ciphertext and each candidate encryption algorithm. Based on the request parameter value corresponding to the second type of request parameter, the target ciphertext information corresponding to the second type of request parameter, and the matching degree between the target ciphertext information and each candidate encryption algorithm, verify and determine the encryption algorithm corresponding to the second type of request parameter of each request. Based on the encryption algorithm corresponding to the second type of request parameter of each request, generate encryption algorithm information corresponding to the second type of request parameter of each request.

[0012] Optionally, the step of verifying and determining the encryption algorithm corresponding to the second type of request parameter for each request based on the request parameter value corresponding to the second type of request parameter, the target ciphertext information corresponding to the second type of request parameter, and the matching degree between the target ciphertext information and each candidate encryption algorithm includes: Traverse each candidate encryption algorithm and determine the current candidate encryption algorithm to be verified based on the matching degree between the target ciphertext information and each candidate encryption algorithm. Based on the request parameter value corresponding to the second type of request parameter of the target request, the plaintext information is obtained; The plaintext information is encrypted using the candidate encryption algorithm to be verified to obtain encrypted ciphertext information; If the encrypted ciphertext information is the same as the target ciphertext information, then the candidate encryption algorithm to be verified is determined to be the encryption algorithm corresponding to the second type of request parameter; If the encrypted ciphertext information is different from the target ciphertext information, then a new candidate encryption algorithm to be verified is determined. The process is repeated until the encryption algorithm corresponding to the second type of request parameter of the target request is determined from among the candidate encryption algorithms.

[0013] Optionally, the communication data further includes: a JavaScript file corresponding to the request; the JavaScript file records encryption-related information; and the step of encrypting the plaintext information using the currently verified candidate encryption algorithm to obtain encrypted ciphertext information includes: If the candidate encryption algorithm to be verified is an algorithm that encrypts using a key, then the key information is obtained from the JavaScript file corresponding to the target request; The plaintext information is encrypted using the key information to obtain the encrypted ciphertext information.

[0014] Optionally, generating the automated execution script corresponding to the target operation of the target browser based on the request data corresponding to each request, the mapping relationship graph, the configuration file, and the encryption algorithm information corresponding to the second type of request parameters of each request includes: Based on the request data corresponding to each request and the mapping relationship graph, the application interface request code corresponding to each request is generated. The application interface request code includes: request header, request body, request resource locator, query parameters and query method. Based on the encryption algorithm information corresponding to the second type of request parameters of each request, generate the encryption module code corresponding to each request; Based on the configuration file, dynamic parameter placeholders for each request are generated; The automated execution script is generated based on the application interface request code corresponding to each request, the encryption module code corresponding to each request, and the dynamic parameter placeholders for each request.

[0015] Secondly, embodiments of this application also provide an automated script generation device, including: an acquisition module, a determination module, and a generation module; The acquisition module is used to capture communication data generated between the target browser and the server during the process of the user performing a target operation on the target browser. The communication data includes: request data corresponding to each request and response data corresponding to each request. The determining module is used to determine the mapping relationship between the first type of request parameters of each request and the response parameters of other requests based on the first type of request parameters in the request data corresponding to each request and the response parameters in the response data corresponding to each request, and to generate a mapping relationship graph and a configuration file; the mapping relationship graph is used to record the mapping relationship between the request parameters of the current request and the response parameters of the previous request; the configuration file is used to record the request parameters to be configured in the request, and each request parameter to be configured is marked with the identifier of the request to which it belongs and the parameter format information; The determining module is used to determine the encryption algorithm information corresponding to the second type of request parameter of each request based on the second type of request parameter in the request data corresponding to each request. The generation module is used to generate an automated execution script corresponding to the target operation of the target browser based on the request data corresponding to each request, the mapping relationship graph, the configuration file, and the encryption algorithm information corresponding to the second type of request parameters of each request.

[0016] Optionally, the acquisition module is specifically used to query and acquire the response status identifier corresponding to each original request, and the response status identifier is used to indicate the processing status of the server for the original request; Based on the response status identifier corresponding to each original request, at least one request is selected from each original request, and the request data and response data corresponding to each request are used as the communication data.

[0017] Optionally, the determining module is specifically used to extract each first type of request parameter and the request parameter value corresponding to each first type of request parameter from the request data corresponding to each request; Extract each response parameter and its corresponding value from the response data corresponding to each request; Based on the comparison results of the request parameter values ​​corresponding to each first type of request parameter of each request and the response parameter values ​​corresponding to each response parameter of other requests, the mapping relationship between each first type of request parameter of each request and the response parameters of other requests is determined, and the request parameters to be configured for each request are determined. The mapping relationship map is generated based on the mapping relationship between each first type of request parameter of each request and each response parameter of other requests; The configuration file is generated based on the configuration request parameters for each request.

[0018] Optionally, the determining module is specifically used to iterate through each comparison request whose timestamp is earlier than the current request for the current request; Based on the current comparison request encountered, the request parameter values ​​corresponding to each first type of request parameter in the current request are compared with the response parameter values ​​of the current comparison request to determine whether there are any response parameter values ​​that are the same as the request parameter values ​​corresponding to each first type of request parameter in the current request. If they exist, record the mapping relationship between each first type of request parameter in the current request and the corresponding response parameter in the current comparison request; If it does not exist, then update the previous request of the current comparison request to the new current comparison request; The process is repeated until the mapping relationship between each first-type request parameter in all requests and the response parameters in all requests that came before the request is determined. Each first-type request parameter in each request whose mapping relationship has not been determined is then used as the request parameter to be configured for that request.

[0019] Optionally, the determining module is specifically used to generate annotation information for each request parameter to be configured based on the correspondence between each request parameter to be configured and the request and the request parameter value of each request parameter to be configured. The configuration file is generated based on each parameter to be configured and its annotation information.

[0020] Optionally, the determining module is specifically used to generate an identifier of the request to which each request parameter to be configured belongs, based on the correspondence between each request parameter to be configured and the request. Based on the request parameter values ​​of each request parameter to be configured, determine the parameter format template of each request parameter to be configured, and use the parameter format template of each request parameter to be configured as the parameter format information of each request parameter to be configured. Based on the identifier of the request to which each request parameter to be configured belongs and the parameter format information of each request parameter to be configured, the annotation information of each request parameter to be configured is obtained.

[0021] Optionally, the determining module is specifically used to obtain the target ciphertext information corresponding to the second type of request parameter in the request data corresponding to each request; Based on the target ciphertext information corresponding to the second type of request parameters of each request, the encryption feature information of the target ciphertext information is extracted; the encryption feature information includes: the string length of the target ciphertext information, the character base type of the target ciphertext information, the encoding type of the target ciphertext information, and the entropy value of the target ciphertext information; Based on the encryption feature information of the target ciphertext, a pre-trained encryption algorithm calculation model is used to determine the matching degree between the target ciphertext and each candidate encryption algorithm. Based on the request parameter value corresponding to the second type of request parameter, the target ciphertext information corresponding to the second type of request parameter, and the matching degree between the target ciphertext information and each candidate encryption algorithm, verify and determine the encryption algorithm corresponding to the second type of request parameter of each request. Based on the encryption algorithm corresponding to the second type of request parameter of each request, generate encryption algorithm information corresponding to the second type of request parameter of each request.

[0022] Optionally, the determining module is specifically used to traverse each candidate encryption algorithm and determine the current candidate encryption algorithm to be verified based on the matching degree between the target ciphertext information and each candidate encryption algorithm. Based on the request parameter value corresponding to the second type of request parameter of the target request, the plaintext information is obtained; The plaintext information is encrypted using the candidate encryption algorithm to be verified to obtain encrypted ciphertext information; If the encrypted ciphertext information is the same as the target ciphertext information, then the candidate encryption algorithm to be verified is determined to be the encryption algorithm corresponding to the second type of request parameter; If the encrypted ciphertext information is different from the target ciphertext information, then a new candidate encryption algorithm to be verified is determined. The process is repeated until the encryption algorithm corresponding to the second type of request parameter of the target request is determined from among the candidate encryption algorithms.

[0023] Optionally, the communication data further includes: a JavaScript file corresponding to the request; the JavaScript file records encryption-related information; the determining module is specifically used to obtain key information from the JavaScript file corresponding to the target request if the candidate encryption algorithm to be verified is an algorithm that encrypts using a key. The plaintext information is encrypted using the key information to obtain the encrypted ciphertext information.

[0024] Optionally, the generation module is specifically used to generate application interface request code corresponding to each request based on the request data corresponding to each request and the mapping relationship graph. The application interface request code includes: request header, request body, request resource locator, query parameters and query method. Based on the encryption algorithm information corresponding to the second type of request parameters of each request, generate the encryption module code corresponding to each request; Based on the configuration file, dynamic parameter placeholders for each request are generated; The automated execution script is generated based on the application interface request code corresponding to each request, the encryption module code corresponding to each request, and the dynamic parameter placeholders for each request.

[0025] Thirdly, embodiments of this application provide an electronic device, including: a processor, a storage medium, and a bus. The storage medium stores machine-readable instructions executable by the processor. When the electronic device is running, the processor communicates with the storage medium via the bus, and the processor executes the machine-readable instructions to implement the automated script generation method provided in the first aspect.

[0026] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program that is executed by a processor using the automated script generation method provided in the first aspect.

[0027] The beneficial effects of this application are: This application provides an automated script generation method, apparatus, electronic device, and storage medium, comprising: capturing communication data generated between the target browser and a server during the process of a user performing a target operation on a target browser; determining the mapping relationship between the first type of request parameters of each request and the response parameters of other requests based on the first type of request parameters in the request data corresponding to each request and the response parameters in the response data corresponding to each request, and generating a mapping relationship graph and a configuration file; determining the encryption algorithm information corresponding to the second type of request parameters of each request based on the second type of request parameters in the request data corresponding to each request; and generating an automated execution script corresponding to the target operation of the target browser based on the request data, mapping relationship graph, configuration file, and encryption algorithm information corresponding to the second type of request parameters of each request. This method captures network communication data generated by the user's actual operations in the browser, performs deep analysis of the request and response data of network requests, automatically identifies the parameter dependencies between the request and response data, and infers the front-end encryption logic using intelligent algorithms, ultimately generating an automated script that can be directly executed for browser operations, while also outputting a clearly structured and well-commented configurable parameter file. This improves the efficiency of automated script generation and reduces development costs. Attached Figure Description

[0028] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0029] Figure 1 This application provides an architecture diagram of an automated script generation system. Figure 2 A flowchart illustrating an automated script generation method provided in an embodiment of this application; Figure 3 A flowchart illustrating another automated script generation method provided in an embodiment of this application; Figure 4 A flowchart illustrating another automated script generation method provided in this application embodiment; Figure 5 A flowchart illustrating another automated script generation method provided in an embodiment of this application; Figure 6 A flowchart illustrating another automated script generation method provided in this application embodiment; Figure 7 A flowchart illustrating another automated script generation method provided in an embodiment of this application; Figure 8 A flowchart illustrating another automated script generation method provided in an embodiment of this application; Figure 9 A flowchart illustrating another automated script generation method provided in this application embodiment; Figure 10 A flowchart illustrating another automated script generation method provided in this application embodiment; Figure 11 A flowchart illustrating another automated script generation method provided in an embodiment of this application; Figure 12 This is a schematic diagram of the core process of an automated script generation method provided in an embodiment of this application; Figure 13 This is a schematic diagram of an encryption algorithm calculation process provided in an embodiment of this application; Figure 14 A schematic diagram of an automated script generation device provided in an embodiment of this application; Figure 15 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0030] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. It should be understood that the accompanying drawings in this application are for illustrative and descriptive purposes only and are not intended to limit the scope of protection of this application. Furthermore, it should be understood that the schematic drawings are not drawn to scale. The flowcharts used in this application illustrate operations implemented according to some embodiments of this application. It should be understood that the operations in the flowcharts may not be implemented in sequence, and steps without logical contextual relationships may be reversed or implemented simultaneously. In addition, those skilled in the art, guided by the content of this application, may add one or more other operations to the flowcharts, or remove one or more operations from the flowcharts.

[0031] Furthermore, the described embodiments are merely some, not all, of the embodiments of this application. The components of the embodiments of this application described and illustrated herein can typically be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of the application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.

[0032] It should be noted that the term "comprising" will be used in the embodiments of this application to indicate the presence of the features declared thereafter, but does not exclude the addition of other features.

[0033] In the current field of software development and testing, there are two main methods of automated testing: The first method involves recording browser actions using a recording tool and generating test scripts that simulate these actions by controlling page elements.

[0034] This method records user actions in the browser (such as clicks and input) and generates scripts to control page elements to simulate these actions. However, modern web applications widely use front-end frameworks such as React and Vue JavaScript (Vue for short), resulting in highly dynamic page elements whose attributes, such as identifiers and class names, are prone to change. This makes user interface (UI) automation scripts that rely on specific element selectors very fragile. Once the page structure is updated, the scripts are prone to failure, requiring frequent manual maintenance and incurring high maintenance costs.

[0035] The second approach involves automation tools based on Application Programming Interfaces (APIs). Tools like Postman (the API Platform) and Apifox can directly send HTTP / HTTPS requests to the server to retrieve data or trigger business logic. This method is more stable and efficient. However, to use these tools, developers must know the detailed information for each API beforehand, including the Uniform Resource Locator (URL), request method, request headers, request body parameters, and complex encryption logic (such as how passwords are encrypted). This information is typically obtained manually through analyzing network packet captures, a tedious and error-prone process. Especially in scenarios involving sensitive information, such as login, the password encryption algorithm and key are often hidden in the front-end JavaScript code, requiring reverse engineering to deduce, significantly increasing the development difficulty and time cost of the API script.

[0036] In summary, existing technologies face technical challenges in transforming user-intuitive browser operations into reusable and efficient API automation scripts. These challenges include high maintenance costs for UI scripts and low efficiency and high barriers to entry in writing API scripts.

[0037] Based on this, this solution provides an automated script generation method. By capturing network communication data generated from actual user actions in the browser, it performs deep analysis of request and response data, automatically identifies parameter dependencies between request and response data, and uses intelligent algorithms to infer front-end encryption logic. Ultimately, it generates an automated script that can be directly executed for browser operations, along with a clearly structured, well-commented, configurable parameter file. This improves the efficiency of automated script generation and reduces development costs.

[0038] Figure 1 This is a schematic diagram of the architecture of an automated script generation system provided in an embodiment of this application, such as... Figure 1As shown, this system includes a user interaction layer, a network capture layer, a data storage layer, a core function layer, and a script output layer. The user interaction layer includes the system operation interface (i.e., the browser interface) and the browser calling module. The network capture layer includes a network monitoring module and a request filtering module. The data storage layer mainly stores communication data between the browser and the server, including but not limited to request packets, response packets, and JS file databases. The data storage layer also stores a decision tree training sample database and an encryption code library. The core function layer includes a parameter mapping module and an encryption algorithm calculation module. The script output layer is mainly used to generate automated script code and generate configuration files.

[0039] The user interaction layer acts as a bridge between the system and the user, receiving user input and displaying results. The network capture layer is used to launch the browser environment and monitor all network communications. Users input operation commands through the system interface, and the browser's calling module invokes the network monitoring module to capture communication data based on these commands. The captured communication data is temporarily written to the data storage layer for later use. The request filtering module can filter out valid communication data from the captured data. The core functionality layer primarily establishes a mapping relationship between request and response parameters through the parameter mapping module. It also trains an encryption algorithm deduction model based on the training sample database and encryption code library stored in the data storage layer using the encryption algorithm deduction model. This model is used to deduce encryption algorithms for ciphertext-type request parameters. Simultaneously, request parameters for which a mapping relationship cannot be established are marked as configurable request parameters, and configuration files are generated for them, along with corresponding annotation information. Finally, the script output layer generates and outputs automated script code based on the aforementioned mapping relationship, the encryption algorithm information corresponding to the request parameters, and the configuration files.

[0040] Figure 2 This is a flowchart illustrating an automated script generation method provided in an embodiment of this application; the method can be applied to computer devices, where the aforementioned automated script generation system is deployed, such as... Figure 2 As shown, the method may include: S101. During the process of a user performing a target operation on the target browser, capture the communication data generated between the target browser and the server.

[0041] The communication data includes: request data corresponding to each request and response data corresponding to each request.

[0042] A real browser can be launched by calling a browser driver or a third-party library, allowing users to operate it. Users can then input commands through the browser page to perform browser operations.

[0043] This embodiment takes the operation of the target browser as an example. The target operation performed by the user on the target browser may be, for example, clicking the login button, entering the verification code, or browsing the page.

[0044] Typically, after responding to a user's action, the browser sends action data to the server, which then generates response data and sends it back to the user through the browser. Therefore, the process of a user interacting with the browser is essentially a continuous communication between the browser and the server to complete the final action.

[0045] By monitoring the communication process between the browser and the server, all communication data during the operation can be captured.

[0046] In this embodiment, the main captured communication data includes request data corresponding to a request and response data corresponding to a request. Request data corresponding to a request is the request data generated by the user's operation, such as requesting to open a page or requesting to turn pages; response data corresponding to a request is the server's response to the user's request data.

[0047] For example, when a user clicks the login button, the browser doesn't actually log in; instead, it sends a message to the server. This message is a request, and the series of parameters it contains are called request data. After receiving the request, the server verifies it and returns a response, which serves as the response data. It's worth noting that the server will return response data regardless of whether the verification is successful or not; only the content of the returned response data will differ.

[0048] S102. Based on the first type of request parameters in the request data corresponding to each request and the response parameters in the response data corresponding to each request, determine the mapping relationship between the first type of request parameters of each request and the response parameters of other requests, and generate a mapping relationship map and configuration file.

[0049] The mapping graph is used to record the mapping relationship between the request parameters of the current request and the response parameters of earlier requests; the configuration file is used to record the request parameters to be configured in the request, and each request parameter to be configured is marked with the identifier of the request to which it belongs and the parameter format information.

[0050] Request data typically includes request headers and a request body; the request header consists of multiple request header parameters, and the request body also includes multiple request body parameters; response data includes response headers and response content. In short, request data consists of multiple request parameters, and response data consists of multiple response parameters.

[0051] In some embodiments, for a first type of request parameter in the request data of a certain request, it is necessary to compare it with each response parameter of each request earlier than the time of the request, so as to find the mapping relationship for the first type of request parameter in each request, and finally form a parameter mapping relationship map.

[0052] For request parameters in the first type of request parameters for which no mapping relationship was found, they can be added to the configuration file as request parameters to be configured, and annotation information corresponding to the request parameters to be configured will be automatically generated, which can also be understood as comment information. The annotation information corresponding to the request parameters to be configured can include the identifier of the request to which the request parameter belongs, which can determine the page to which the request parameter belongs and its position on the page; the annotation information can also include parameter format information, which is used to indicate the input data format when the user configures the request parameter.

[0053] It's worth noting that the first type of request parameters can be authentication parameters in the request header, query parameters in the URL, or parameters in the request body. These request parameters typically require configuration of parameter mapping relationships.

[0054] For example, the request header may contain authentication parameters whose parameter names contain strings such as "authorization", "cookie", or "X-Auth-Token"; or the URL may contain various query parameters such as "startDate", "endDate", "pageNum", or "pageSized".

[0055] The request body is shown below: { "iccid": 67756748788709, "timestamp": 1679295400000, "type": 'OTA', "vinCode": '' } The parameters "iccid, timestamp, type, vinCode" in the request body can also be used as first-type request parameters.

[0056] S103. Based on the second type of request parameters in the request data corresponding to each request, determine the encryption algorithm information corresponding to the second type of request parameters of each request.

[0057] The second type of request parameters can refer to login or account-related request parameters. For this type of request parameter, since the browser encrypts the request data before sending it to the server to ensure secure transmission, it is necessary to deduce the encryption algorithm used for this type of request parameter in order to perform automatic encryption processing subsequently.

[0058] The encryption algorithm information corresponding to the second type of request parameters can include encryption algorithm function information.

[0059] For example, the second type of request parameter can be a string of type "password, psw, username, usr" that exists in the request body parameters.

[0060] S104. Based on the request data, mapping relationship graph, configuration file, and encryption algorithm information corresponding to the second type of request parameters of each request, generate an automated execution script corresponding to the target operation of the target browser.

[0061] In some embodiments, based on the encryption algorithm information corresponding to the second type of request parameters of each request, the corresponding encryption function code can be extracted from the encryption algorithm library of the system, and the plaintext account password can be used as a variable parameter to generate encryption module code. Based on the mapping graph obtained above, generate an automated execution script corresponding to the target operation for the target browser. The automated execution script can be, for example, a Python / JavaScript / Ruby script.

[0062] The generated automated execution scripts can be used to automate the execution and testing of target operations in the target browser.

[0063] In summary, the automated script generation method provided in this embodiment includes: capturing communication data generated between the target browser and the server during the user's execution of a target operation on the target browser; determining the mapping relationship between the first type of request parameters of each request and the response parameters of other requests based on the first type of request parameters in the request data corresponding to each request and the response parameters in the response data corresponding to each request, and generating a mapping relationship graph and a configuration file; determining the encryption algorithm information corresponding to the second type of request parameters of each request based on the second type of request parameters in the request data corresponding to each request; and generating an automated execution script corresponding to the target operation of the target browser based on the request data, mapping relationship graph, configuration file, and encryption algorithm information corresponding to the second type of request parameters of each request. This method captures network communication data generated by the user's actual operations in the browser, performs deep analysis of the request data and response data of network requests, automatically identifies the parameter dependencies between the request data and response data, and infers the front-end encryption logic by combining intelligent algorithms, ultimately generating an automated script that can be directly executed for browser operations, while also outputting a clearly structured and well-commented configurable parameter file. This improves the efficiency of automated script generation and reduces development costs.

[0064] Figure 3 This is a flowchart illustrating another automated script generation method provided in an embodiment of this application; optionally, in step S101, capturing communication data generated between the target browser and the server includes: S201. Query and obtain the response status identifier corresponding to each original request. The response status identifier is used to indicate the server's processing status of the original request.

[0065] In some embodiments, the captured communication data may contain data indicating failed requests, which is of no use to us. Therefore, the captured communication data can be filtered first to ensure data availability.

[0066] Optionally, the response status code corresponding to each request can be retrieved by querying. The response status code can serve as an identifier to characterize the server's processing result status for the request.

[0067] Response status codes are typically divided into five categories: 1xx (informational status codes), indicating that the request has been received and the server is processing it, providing only a temporary response; 2xx (success status codes), indicating that the request has been successfully received, understood, and processed by the server; 3xx (redirection status codes), indicating that further action is required from the client to complete the request, requiring a redirect to another address, such as 301 for permanent redirection and 302 for temporary redirection. When a program captures these status codes, it can re-request based on the new address in the response header and eventually obtain a valid resource; 4xx (client error status codes), indicating that there is an error in the request and the server cannot process it, meaning the program cannot obtain valid data using the current request method; and 5xx (server error status codes), indicating that an internal error occurred on the server while processing the request, unrelated to the client, and the client may still fail to obtain the resource even if it retryes.

[0068] S202. Based on the response status identifier corresponding to each original request, at least one request is selected from each original request, and the request data and response data corresponding to each request are used as communication data.

[0069] In this embodiment, data from requests with response status codes of 2xx or 3xx can be retained from all captured request data. This yields a filtered list of valid requests, and the request data and response data corresponding to these valid requests are used as described above. Figure 1 The communication data used in the steps.

[0070] Figure 4 This is a flowchart illustrating another automated script generation method provided in an embodiment of this application; optionally, in step S102, based on the first type of request parameters in the request data corresponding to each request and the response parameters in the response data corresponding to each request, the mapping relationship between the first type of request parameters of each request and the response parameters of other requests is determined, and a mapping relationship map and configuration file are generated, including: S301. Extract each first type of request parameter and the corresponding request parameter value from the request data corresponding to each request.

[0071] First, we can extract the primary request parameters from the request data of each request, and also extract the corresponding request parameter values. This will facilitate subsequent parameter mapping.

[0072] S302. Extract each response parameter and the corresponding response parameter value from the response data corresponding to each request.

[0073] Similarly, from the response data corresponding to each request, we can first extract each response parameter and its corresponding value. Request parameter values ​​are the data actually entered by the user during the operation or the operation data generated based on the user's actions, such as the username and password entered when the user logs in, and business identifier parameters automatically generated by the browser or front-end program based on the user's operation context to drive the back-end business logic. Response parameter values, on the other hand, are the actual data values ​​generated based on the server's response.

[0074] S303. Based on the comparison results of the request parameter values ​​corresponding to each first type request parameter of each request and the response parameter values ​​corresponding to each response parameter of other requests, determine the mapping relationship between each first type request parameter of each request and the response parameters of other requests, and determine the request parameters to be configured for each request.

[0075] For each request, a mapping relationship can be found by comparing the request parameter value corresponding to the first type of request parameter of the request with the response parameter values ​​of each response parameter of other requests that were requested earlier than the request.

[0076] The process of finding the mapping relationship is essentially about finding and analyzing whether a certain parameter value in the current request appears in the result of a previous response.

[0077] S304. Generate a mapping relationship map based on the mapping relationship between each first type request parameter of each request and each response parameter of other requests.

[0078] Based on the determined mapping relationship between the first type of request parameters for each request and the response parameters of other requests, the aforementioned mapping relationship graph can be generated. The mapping relationship graph contains the first type of request parameters for each request with which a mapping relationship can be found, along with their corresponding response parameters. The mapping relationship graph indicates the data correlation between successive requests.

[0079] For example, the mapping relationship graph can be: {the first type of request parameter 1 of request a has a mapping relationship with the response parameter 1 of request b; the first type of request parameter 2 of request a has a mapping relationship with the response parameter 2 of request c...}. In practical applications, the mapping relationship graph will show the mapping relationships determined in all requests.

[0080] Dynamic parameter tracking is achieved through mapping graphs, allowing subsequently generated automated scripts to automatically inherit the results of previous operations during execution, instead of requiring hard-coding each time. Therefore, mapping graphs are key to enabling the reuse of automated scripts.

[0081] S305. Generate configuration files based on the configuration request parameters for each request.

[0082] During the process of finding the mapping relationship, there are some request parameters for which no corresponding response parameter can be found. These request parameters are added to the configuration file as unconfigurable or configurable request parameters. These unconfigurable request parameters in the configuration file need to be flexibly entered by the user according to the specific situation of the page; they do not come from the response data of the previous requests, nor are they fixed values.

[0083] Figure 5 This is a flowchart illustrating another automated script generation method provided in an embodiment of this application; optionally, in step S303, based on the comparison results of the request parameter values ​​corresponding to each first type of request parameter of each request and the response parameter values ​​corresponding to each response parameter of other requests, the mapping relationship between each first type of request parameter of each request and the response parameters of other requests, and the determination of the request parameters to be configured for each request, include: S401. For the current request, iterate through all comparison requests whose timestamps are earlier than the current request.

[0084] When finding the parameter mapping relationship, for each request, the first type of request parameters of this request are compared with the response parameters of other requests that came before this request. Earlier requests can be found by using the timestamps of each request.

[0085] The request that is currently being processed is taken as the current request. For the current request, we can first find the comparison requests whose timestamps are earlier than the current request based on the timestamps of the current request and other requests.

[0086] S402. Based on the current comparison request that has been traversed, compare the request parameter values ​​corresponding to each first type of request parameter of the current request with the response parameter values ​​of the current comparison request to determine whether there is a response parameter value that is the same as the request parameter values ​​corresponding to each first type of request parameter of the current request.

[0087] Based on the timestamp difference between each comparison request and the current request, the comparison requests can be iterated sequentially. In other words, when comparing the current request with each comparison request, the current request is first compared with the comparison request that is closest to the current request in time. If no mapping relationship is found, the current request is then compared with the request before the closest comparison request, until the response parameters corresponding to each first type of request parameter in the current request are found, and then the comparison stops.

[0088] Taking the current comparison request as an example, it can be that the request parameter values ​​corresponding to each first type of request parameter in the previous request are compared one by one with the response parameter values ​​of the current comparison request to determine whether the request parameter value corresponding to each first type of request parameter is the same as a certain response parameter value.

[0089] S403. If it exists, record the mapping relationship between each first type of request parameter in the current request and the corresponding response parameter in the current comparison request.

[0090] If any of the response parameter values ​​in the current comparison request has the same value as the first type of request parameter in the current request, then a mapping relationship can be established between the first type of request parameter in the current request and that response parameter in the current comparison request.

[0091] S404. If it does not exist, update the previous request of the current comparison request to the new current comparison request.

[0092] If no response parameter value matching the first type of request parameter value of the current request is found among the response parameter values ​​of the current comparison request, then the previous request with the closest timestamp to the current comparison request will be updated to the latest current comparison request.

[0093] Following the method described above, find the mapped response parameters of the first type of request parameters of the current request from the latest current comparison request.

[0094] S405. Execute repeatedly until the mapping relationship between each first type request parameter in all requests and the response parameters in each request earlier than the request is determined. Then, take each first type request parameter in each request whose mapping relationship has not been determined as the request parameter to be configured for each request.

[0095] The above steps S401-S404 are executed repeatedly until the mapping relationship for each first type of request parameter in each request is found, or until all requests are compared.

[0096] In some embodiments, if some first-type request parameters for which no mapping relationship was found still exist after all requests have been compared, the first-type request parameters are added to the configuration file as request parameters to be configured.

[0097] In other words, for any request, it can first be compared with the request whose timestamp is closest to its own. If no matching parameter value is found, it can be compared with an even earlier request, and so on, one by one, until a matching parameter value is found. If no matching parameter value is found, the request parameter for which no mapping relationship can be found is added to the configuration file as a request parameter to be configured.

[0098] For example, suppose the request body of request F contains {iccid: 84524567812, key_id: hg45, section_timeout:3600, url:””}. This means that the request has three parameters that need to be mapped: iccid, key_id, and section_timeout. By searching for other requests earlier than request F, we find that the response body of request E contains iccid: 84524567812, but does not contain key_id: hg45. Therefore, the request parameter iccid of request F and the response parameter iccid of request E form a mapping relationship. That is, the value of the response parameter of request E can be used as the value of the request parameter of request F. Then, continuing to search for an even earlier request, we find that the response body of request B contains key_id: hg45. Therefore, the request parameter key_id of request F and the response parameter key_id of request B form a mapping relationship, and so on.

[0099] Figure 6 A flowchart illustrating another automated script generation method provided in this application embodiment; optionally, in step S305, a configuration file is generated based on the configuration request parameters of each request, including: S501. Generate annotation information for each request parameter to be configured based on the correspondence between each request parameter to be configured and the request parameter value of each request parameter to be configured.

[0100] In some embodiments, for each request parameter to be configured, annotation information can be generated based on its relationship to the request and its request parameter value. This annotation information is added to the configuration file as a comment and is affixed to the request parameter to be configured. This allows the user to be redirected to the corresponding location on the corresponding page based on the annotation information, and enables the user to input the parameter value of the request parameter to be configured in a specified format.

[0101] S502. Generate a configuration file based on each parameter to be configured and its annotation information.

[0102] The generated configuration file can include all request parameters to be configured, and each request parameter to be configured also carries annotation information.

[0103] Figure 7 A flowchart illustrating another automated script generation method provided in this application embodiment; optionally, in step S501, annotation information for each request parameter to be configured is generated based on the correspondence between each request parameter to be configured and the request parameter value of each request parameter to be configured, including: S601. Based on the correspondence between each request parameter to be configured and the request, generate the identifier of the request to which each request parameter to be configured belongs.

[0104] Each request parameter to be configured is a request parameter in a certain request, and its relationship with the request can be directly obtained. Therefore, based on the correspondence between each request parameter to be configured and the request, the identifier of the request to which the request parameter belongs can be generated. The identifier of the request to which the parameter belongs can include the URL of the request to which the parameter belongs, thereby directly locating the page to which the request parameter belongs and its position on the page based on the URL of the request.

[0105] S602. Based on the request parameter values ​​of each request parameter to be configured, determine the parameter format template of each request parameter to be configured, and use the parameter format template of each request parameter to be configured as the parameter format information of each request parameter to be configured.

[0106] The request parameter values ​​to be configured are the information that the user actually enters during the operation of the browser.

[0107] Suppose the request parameter to be configured is an input parameter in an input box on a certain page. When the user operates the browser, they enter "How is the weather today?" in the input box. Therefore, the parameter value "How is the weather today?" can be used as the parameter format template for the request parameter to be configured, that is, the parameter format example. In this way, when the user configures the request parameter later, they will know that the input parameter value should be in text format.

[0108] Of course, in some cases, the parameter format template for each request parameter to be configured can also be a string or path information, such as when a user uploads text in an input box.

[0109] S603. Based on the identifier of the request to which each request parameter to be configured belongs and the parameter format information of each request parameter to be configured, obtain the annotation information of each request parameter to be configured.

[0110] In some embodiments, the annotation information of the request parameter to be configured includes the identifier of the request to which the request parameter belongs and the parameter format information of the request parameter to be configured. That is, the annotation information of the request parameter to be configured consists of the identifier of the request to which the request parameter belongs and the parameter format information of the request parameter to be configured.

[0111] Figure 8 A flowchart illustrating another automated script generation method provided in this application embodiment; optionally, in step S103, determining the encryption algorithm information corresponding to the second type of request parameter of each request based on the second type of request parameter in the request data corresponding to each request includes: S701. Obtain the target ciphertext information corresponding to the second type of request parameter in the request data corresponding to each request.

[0112] The target encrypted information for the second type of request parameters can be generated by the browser. When a user needs to log in to a browser or account, the browser encrypts the plaintext password entered by the user, and sometimes also encrypts the username. The encrypted username and password are then used as request parameters to send a login request to the server. Therefore, login parameters in a login request typically have three combinations: plaintext username and plaintext password, plaintext username and encrypted password, and encrypted username and encrypted password.

[0113] The ciphertext password and ciphertext account generated by the browser encrypting the user's plaintext account and password are the target ciphertext information here.

[0114] S702. Extract the encryption feature information of the target ciphertext information based on the target ciphertext information corresponding to the second type of request parameters of each request.

[0115] The encryption features include: the string length of the target ciphertext, the character base type of the target ciphertext, the encoding type of the target ciphertext, and the entropy value of the target ciphertext.

[0116] First, it can be determined whether sensitive parameters such as login account and password in the request are in plaintext. The plaintext information entered by the user is compared with the target ciphertext information actually sent by the browser. If they match, it is considered to be plaintext transmission. However, this situation is basically non-existent because plaintext transmission would lead to the leakage of account information.

[0117] If they are inconsistent, it is assumed that the browser has encrypted the plaintext information entered by the user, and it is necessary to deduce the encryption algorithm used.

[0118] In some embodiments, encryption feature information can be extracted from the target ciphertext information. This encryption feature information may include, but is not limited to: the total length of the target ciphertext string; whether the target ciphertext is a hexadecimal string (containing only 0-9 and af characters); whether the target ciphertext is a Base64 encoded string (containing AZ, az, 0-9, +, = characters); whether the target ciphertext's early_list is not empty (i.e., the list contains key-value pairs with special characters); and the entropy value of the target ciphertext, which reflects the randomness of the string.

[0119] S703. Based on the encryption feature information of the target ciphertext, a pre-trained encryption algorithm calculation model is used to determine the matching degree between the target ciphertext and each candidate encryption algorithm.

[0120] The extracted encryption features are input into a pre-trained encryption algorithm prediction model. The model can then determine the matching degree between the target ciphertext and each candidate encryption algorithm based on the encryption features and the algorithmic features of each candidate encryption algorithm.

[0121] The candidate encryption algorithms include, but are not limited to: Message-Digest Algorithm 5 (MD5), Base64 encoding, Rivest-Shamir-Adleman (RSA) asymmetric encryption algorithm, Advanced Encryption Standard (AES) and other commonly used encryption algorithms.

[0122] Different encryption algorithms have different characteristics. For example, MD5 generates ciphertext that is usually 32-bit hexadecimal; Base64 generates ciphertext that usually ends with "="; and RSA generates ciphertext that is usually more complex and is used in conjunction with a public key.

[0123] Therefore, by extracting the encryption features of the target ciphertext and the algorithmic features of each candidate encryption algorithm, the matching degree between the target ciphertext and each candidate encryption algorithm can be predicted. For example, the matching degree of MD5 is 90%, that of RSA is 95%, and that of AES is 60%.

[0124] In some embodiments, the encryption algorithm estimation model can be trained based on training sample data, which may include: sample ciphertext information, and the label information of each sample ciphertext information as the actual encryption algorithm corresponding to the sample ciphertext information. In this scheme, the encryption algorithm estimation model can be a decision tree model.

[0125] S704. Based on the request parameter value corresponding to the second type of request parameter, the target ciphertext information corresponding to the second type of request parameter, and the matching degree between the target ciphertext information and each candidate encryption algorithm, verify and determine the encryption algorithm corresponding to the second type of request parameter of each request.

[0126] In some embodiments, since the model predictions may not be accurate, each candidate encryption algorithm can be verified sequentially based on the matching degree between the target ciphertext information and each candidate encryption algorithm to determine the final encryption algorithm.

[0127] During verification, the candidate encryption algorithm can be used to perform encryption calculation based on the request parameter value corresponding to the second type of request parameter, that is, based on the plaintext information input by the user and the corresponding target ciphertext information. Based on the calculation result, the encryption algorithm corresponding to the second type of request parameter can be verified.

[0128] S705. Generate encryption algorithm information corresponding to the second type of request parameters for each request based on the encryption algorithm corresponding to the second type of request parameters for each request.

[0129] Based on the encryption algorithm corresponding to the second type of request parameters of each request, the encryption function code corresponding to the encryption algorithm can be extracted from the encryption algorithm library. The plaintext information is used as a variable parameter and generated together with the encryption function code to generate the encryption module code. The encryption algorithm information contains the encryption module code.

[0130] Figure 9 This is a flowchart illustrating another automated script generation method provided in an embodiment of this application; optionally, in step S704, the encryption algorithm corresponding to the second type of request parameter for each request is verified and determined based on the request parameter value corresponding to the second type of request parameter, the target ciphertext information corresponding to the second type of request parameter, and the matching degree between the target ciphertext information and each candidate encryption algorithm, including: S801. Traverse each candidate encryption algorithm and determine the candidate encryption algorithm to be verified based on the matching degree between the target ciphertext information and each candidate encryption algorithm.

[0131] In some embodiments, each candidate encryption algorithm can be verified sequentially based on its matching degree with the target ciphertext information. If a candidate encryption algorithm is confirmed as the final encryption algorithm during the verification process, the subsequent candidate encryption algorithms will no longer be verified.

[0132] The algorithm can be prioritized for verification of the candidate encryption algorithm with the highest matching degree. If the verification fails, the candidate encryption algorithm with the second highest matching degree will be verified, and so on, until a candidate encryption algorithm that passes the verification is found.

[0133] S802. Obtain plaintext information based on the request parameter value corresponding to the second type of request parameter of the target request.

[0134] The request parameter values ​​corresponding to the second type of request parameters of the target request can be used as plaintext information, that is, the plaintext account and plaintext password entered by the user can be used as plaintext information here.

[0135] S803. The plaintext information is encrypted using the candidate encryption algorithm to be verified to obtain encrypted ciphertext information.

[0136] Taking the currently selected candidate encryption algorithm as an example, the plaintext information can be encrypted using the currently selected candidate encryption algorithm to generate encrypted ciphertext information.

[0137] S804. If the encrypted ciphertext information is the same as the target ciphertext information, then the candidate encryption algorithm to be verified is determined to be the encryption algorithm corresponding to the second type of request parameter.

[0138] The generated encrypted ciphertext information is compared with the target ciphertext information sent by the browser to the server. If they are the same, the verification is successful, and the candidate encryption algorithm to be verified can be the encryption algorithm corresponding to the second type of request parameter.

[0139] S805. If the encrypted ciphertext information is different from the target ciphertext information, then determine the current new candidate encryption algorithm to be verified.

[0140] If the generated encrypted ciphertext is different from the target ciphertext sent by the browser to the server, the next candidate encryption algorithm with a high matching degree will be used as the new candidate encryption algorithm to be verified.

[0141] That is, the candidate encryption algorithms are first sorted from high to low according to their matching degree. Then, the candidate encryption algorithms are selected from the sorting results for verification in turn. If the candidate encryption algorithm ranked first fails the verification, the candidate encryption algorithm ranked second will be used as the new candidate encryption algorithm to be verified, until a candidate encryption algorithm that passes the verification is found.

[0142] S806. Execute repeatedly until the encryption algorithm corresponding to the second type of request parameter of the target request is determined from among the candidate encryption algorithms.

[0143] Repeat steps S801-S805 until the encryption algorithm corresponding to all second-type request parameters is determined.

[0144] In some embodiments, the communication data further includes: a JavaScript file corresponding to the request; the JavaScript file contains encryption-related information. Figure 10 This is a flowchart illustrating another automated script generation method provided in an embodiment of this application; in step S803, the plaintext information is encrypted using the currently selected candidate encryption algorithm to obtain encrypted ciphertext information, which may include: S901. If the candidate encryption algorithm to be verified is an algorithm that uses a key for encryption, then obtain the key information from the JavaScript file corresponding to the target request.

[0145] Typically, the JavaScript file corresponding to the request may contain encryption-related information, such as key information.

[0146] Some encryption algorithms use keys for encryption, such as RSA, while others do not, such as MD5. For algorithms that require keys for encryption, the key used for encryption must be found in the JavaScript file corresponding to the request.

[0147] S902. Use the key information to encrypt the plaintext information to obtain the encrypted ciphertext information.

[0148] Therefore, based on the obtained key information, plaintext information can be encrypted to obtain encrypted ciphertext information.

[0149] It is worth noting that, in addition to the processing of the first type of request parameters and the second type of request parameters mentioned above, if there is a ten-digit or thirteen-digit integer similar to a timestamp in the request header parameters, timestamp verification is performed. If it is exactly the same as the request time, it is considered to be the timestamp of the request. For timestamp parameters, there is no need to find a mapping relationship.

[0150] If the request header parameters contain the characters "page" or "index", they are considered to be fixed parameters related to page control, and their values ​​are directly retained.

[0151] Figure 11 This is a flowchart illustrating another automated script generation method provided in an embodiment of this application; optionally, in step S104, an automated execution script corresponding to the target operation of the target browser is generated based on the request data, mapping relationship graph, configuration file, and encryption algorithm information corresponding to the second type of request parameters of each request, including: S1001. Generate the application programming interface request code corresponding to each request based on the request data and mapping relationship graph corresponding to each request.

[0152] Application programming interface (API) request code includes: request headers, request body, request resource locator, query parameters, and query method.

[0153] In some embodiments, application programming interface (API) request code can be generated for each request based on the request data and the mapping graph. The API request code indicates the contextual relationship and query method of each request parameter, enabling automatic inheritance of request parameters.

[0154] S1002. Generate the encryption module code corresponding to each request based on the encryption algorithm information corresponding to the second type of request parameters of each request.

[0155] Based on the encryption algorithm corresponding to the determined second type of request parameters, the corresponding encryption function code can be extracted. The plaintext account and plaintext password can be used as variable parameters, and combined with the encryption function code, the encryption module code corresponding to the request can be generated.

[0156] S1003. Generate dynamic parameter placeholders for each request based on the configuration file.

[0157] Based on the configuration file, dynamic parameter placeholders for each request can be generated to instruct users to flexibly configure the dynamic parameters.

[0158] S1004. Generate an automated execution script based on the application interface request code corresponding to each request, the encryption module code corresponding to each request, and the dynamic parameter placeholders for each request.

[0159] By combining the application programming interface request code, the encryption module code, and the dynamic parameter placeholders for each request obtained above, an automated execution script can be generated, that is, a Python / JavaScript / Ruby script can be generated.

[0160] Figure 12 This is a schematic diagram of the core process of an automated script generation method provided in an embodiment of this application, as shown below. Figure 12 As shown, the core process mainly includes the following steps: providing a user interface for entering website URLs, user accounts, and passwords; calling a browser for user operation; capturing request data, response data, and JavaScript files; filtering based on the response status code, retaining request data and response data for requests with status codes of 2xx or 3xx; extracting the first type of request parameters and determining the corresponding response parameters, constructing a mapping graph; extracting the second type of request parameters and determining whether the account and password in the second type of request parameters have been encrypted; if so, extracting encryption feature information based on the target plaintext information corresponding to the second type of request parameters, predicting the matching degree between the target plaintext information and each candidate encryption algorithm; verifying and confirming the final encryption method, generating an encryption code module based on the encryption method; if not, directly using the user's plaintext information as the request parameters; for request parameters for which no mapping relationship is found, treating them as request parameters to be configured and outputting them to the configuration file. Combining the mapping graph, encryption code module, and configuration file, an executable automated script is generated.

[0161] Figure 13 This is a schematic diagram of an encryption algorithm calculation process provided in an embodiment of this application, such as... Figure 13 As shown, the encryption algorithm derivation process mainly consists of data preprocessing, feature analysis, model training, and encryption code generation.

[0162] The data preprocessing section includes: obtaining the encrypted information of the user's account or password and converting it into a String type; assembling an early_list of response parameter key-value pairs with special characters. The feature analysis section includes: inputting as many different types of sample sets as possible into the system; extracting features from each encrypted information in the sample sets. The model training section includes: using decision tree-related libraries, inputting the encrypted information and its corresponding feature information, obtaining candidate encryption algorithms and matching degrees corresponding to the encrypted information; using the encryption algorithm with the highest matching degree as the first verification, verifying the encryption method, and determining whether the encryption method is compatible; if compatible, it is determined as the final encryption method; if not compatible, the result with the lower matching degree is used as the encryption method for continued verification until the final encryption method is determined. The encryption code generation section includes: obtaining the encryption code corresponding to the final encryption method from the system's encryption algorithm library, using the plaintext account and plaintext password as variable parameters, and generating encryption module code.

[0163] The above Figure 12 and Figure 13 The specific implementation process of each step has been described in detail in the foregoing embodiments, and will not be repeated here.

[0164] In summary, the automated script generation method provided in this embodiment includes: capturing communication data generated between the target browser and the server during the user's execution of a target operation on the target browser; determining the mapping relationship between the first type of request parameters of each request and the response parameters of other requests based on the first type of request parameters in the request data corresponding to each request and the response parameters in the response data corresponding to each request, and generating a mapping relationship graph and a configuration file; determining the encryption algorithm information corresponding to the second type of request parameters of each request based on the second type of request parameters in the request data corresponding to each request; and generating an automated execution script corresponding to the target operation of the target browser based on the request data, mapping relationship graph, configuration file, and encryption algorithm information corresponding to the second type of request parameters of each request. This method captures network communication data generated by the user's actual operations in the browser, performs deep analysis of the request data and response data of network requests, automatically identifies the parameter dependencies between the request data and response data, and infers the front-end encryption logic by combining intelligent algorithms, ultimately generating an automated script that can be directly executed for browser operations, while also outputting a clearly structured and well-commented configurable parameter file. This improves the efficiency of automated script generation and reduces development costs.

[0165] The following describes the apparatus, device, and storage medium used to execute the automated script generation method provided in this application. The specific implementation process and technical effects are described above and will not be repeated below.

[0166] Figure 14 This diagram illustrates an automated script generation device provided in an embodiment of this application. The functions implemented by this automated script generation device correspond to the steps executed by the method described above. This device can be understood as the aforementioned computer equipment or server, or the processor of a server, or it can be understood as a component independent of the aforementioned server or processor that implements the functions of this application under the control of the server, such as... Figure 14 As shown, the device may include: an acquisition module 100, a determination module 200, and a generation module 300; The acquisition module 100 is used to capture communication data generated between the target browser and the server during the process of the user performing a target operation on the target browser. The communication data includes: request data corresponding to each request and response data corresponding to each request. The determination module 200 is used to determine the mapping relationship between the first type of request parameters of each request and the response parameters of other requests based on the first type of request parameters in the request data corresponding to each request and the response parameters in the response data corresponding to each request, and to generate a mapping relationship graph and a configuration file; the mapping relationship graph is used to record the mapping relationship between the request parameters of the current request and the response parameters of the earlier requests; the configuration file is used to record the request parameters to be configured in the request, and each request parameter to be configured is marked with the identifier of the request to which it belongs and the parameter format information; The determining module 200 is used to determine the encryption algorithm information corresponding to the second type of request parameter of each request based on the second type of request parameter in the request data corresponding to each request; The generation module 300 is used to generate an automated execution script corresponding to the target operation of the target browser based on the request data, mapping relationship graph, configuration file and encryption algorithm information corresponding to the second type of request parameters of each request.

[0167] Optionally, the acquisition module 100 is specifically used to query and acquire the response status identifier corresponding to each original request. The response status identifier is used to indicate the processing status of the server for the original request. Based on the response status identifier corresponding to each original request, at least one request is selected from each original request, and the request data and response data corresponding to each request are used as communication data.

[0168] Optionally, the determining module 200 is specifically used to extract each first type of request parameter and the request parameter value corresponding to each first type of request parameter from the request data corresponding to each request; Extract each response parameter and its corresponding value from the response data corresponding to each request; Based on the comparison results of the request parameter values ​​corresponding to each first type of request parameter of each request and the response parameter values ​​corresponding to each response parameter of other requests, the mapping relationship between each first type of request parameter of each request and the response parameters of other requests is determined, and the request parameters to be configured for each request are determined. A mapping graph is generated based on the mapping relationship between each type of first request parameter of each request and each response parameter of other requests; Generate configuration files based on the request parameters to be configured for each request.

[0169] Optionally, module 200 is specifically used to iterate through all comparison requests with timestamps earlier than the current request for the current request; Based on the current comparison request encountered, the request parameter values ​​corresponding to each first type of request parameter in the current request are compared with the response parameter values ​​of the current comparison request to determine whether there are any response parameter values ​​that are the same as the request parameter values ​​corresponding to each first type of request parameter in the current request. If it exists, record the mapping relationship between each first type of request parameter in the current request and the corresponding response parameter in the current comparison request; If it does not exist, then update the previous request of the current comparison request to the new current comparison request; The process is repeated until the mapping relationship between each first-type request parameter in all requests and the response parameters in all requests that came before the request is determined. Each first-type request parameter in each request whose mapping relationship has not been determined is then used as the request parameter to be configured for that request.

[0170] Optionally, the determining module 200 is specifically used to generate annotation information for each request parameter to be configured based on the correspondence between each request parameter to be configured and the request and the request parameter value of each request parameter to be configured. A configuration file is generated based on each request parameter to be configured and the annotation information of each request parameter to be configured.

[0171] Optionally, the determining module 200 is specifically used to generate an identifier of the request to which each request parameter to be configured belongs, based on the correspondence between each request parameter to be configured and the request. Based on the request parameter values ​​of each request parameter to be configured, determine the parameter format template of each request parameter to be configured, and use the parameter format template of each request parameter to be configured as the parameter format information of each request parameter to be configured. Based on the identifier of the request to which each request parameter to be configured belongs and the parameter format information of each request parameter to be configured, the annotation information of each request parameter to be configured is obtained.

[0172] Optionally, the determining module 200 is specifically used to obtain the target ciphertext information corresponding to the second type of request parameter in the request data corresponding to each request; Based on the target ciphertext information corresponding to the second type of request parameters of each request, extract the encryption feature information of the target ciphertext information; the encryption feature information includes: the string length of the target ciphertext information, the character base type of the target ciphertext information, the encoding type of the target ciphertext information, and the entropy value of the target ciphertext information; Based on the encryption characteristics of the target ciphertext, a pre-trained encryption algorithm estimation model is used to determine the matching degree between the target ciphertext and each candidate encryption algorithm. Based on the request parameter value corresponding to the second type of request parameter, the target ciphertext information corresponding to the second type of request parameter, and the matching degree between the target ciphertext information and each candidate encryption algorithm, verify and determine the encryption algorithm corresponding to the second type of request parameter of each request. Based on the encryption algorithm corresponding to the second type of request parameter of each request, generate encryption algorithm information corresponding to the second type of request parameter of each request.

[0173] Optionally, the determining module 200 is specifically used to traverse each candidate encryption algorithm and determine the candidate encryption algorithm to be verified based on the matching degree between the target ciphertext information and each candidate encryption algorithm. Based on the request parameter value corresponding to the second type of request parameter of the target request, the plaintext information is obtained; The plaintext information is encrypted using the candidate encryption algorithm to be verified to obtain encrypted ciphertext information; If the encrypted ciphertext information is the same as the target ciphertext information, then the candidate encryption algorithm to be verified is determined to be the encryption algorithm corresponding to the second type of request parameter; If the encrypted ciphertext is different from the target ciphertext, then a new candidate encryption algorithm to be verified is determined. The process is repeated until the encryption algorithm corresponding to the second type of request parameter of the target request is determined from among the candidate encryption algorithms.

[0174] Optionally, the communication data also includes: the JavaScript file corresponding to the request; the JavaScript file contains encryption-related information; and a determination module, specifically used to obtain key information from the JavaScript file corresponding to the target request if the candidate encryption algorithm to be verified is an algorithm that encrypts using a key. The plaintext information is encrypted using the key information to obtain the encrypted ciphertext information.

[0175] Optionally, the generation module 300 is specifically used to generate application interface request code corresponding to each request based on the request data and mapping relationship graph corresponding to each request. The application interface request code includes: request header, request body, request resource locator, query parameters and query method. Based on the encryption algorithm information corresponding to the second type of request parameters of each request, generate the encryption module code corresponding to each request; Based on the configuration file, dynamic parameter placeholders are generated for each request; An automated execution script is generated based on the application interface request code corresponding to each request, the encryption module code corresponding to each request, and the dynamic parameter placeholders for each request.

[0176] The above-described device is used to execute the method provided in the foregoing embodiments, and its implementation principle and technical effect are similar, so they will not be described again here.

[0177] These modules can be one or more integrated circuits configured to implement the above methods, such as one or more Application Specific Integrated Circuits (ASICs), one or more digital signal processors (DSPs), or one or more Field Programmable Gate Arrays (FPGAs). Alternatively, when a module is implemented using processing element scheduler code, the processing element can be a general-purpose processor, such as a Central Processing Unit (CPU) or other processor capable of calling program code. Furthermore, these modules can be integrated together as a system-on-a-chip (SOC).

[0178] The modules described above can be connected or communicate with each other via wired or wireless connections. Wired connections can include metal cables, optical fibers, hybrid cables, or any combination thereof. Wireless connections can include connections via LAN, WAN, Bluetooth, ZigBee, or NFC, or any combination thereof. Two or more modules can be combined into a single module, and any module can be divided into two or more units. Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems and devices described above can be referred to the corresponding processes in the method embodiments, and will not be repeated here.

[0179] Figure 15 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. The device can be deployed with the aforementioned automated script generation system, such as... Figure 15 As shown, the device includes: a processor 801 and a storage medium 802.

[0180] Storage medium 802 is used to store programs, and processor 801 calls the programs stored in storage medium 802 to execute the above method embodiments. The specific implementation and technical effects are similar, and will not be described in detail here.

[0181] The storage medium 802 stores program code, which, when executed by the processor 801, causes the processor 801 to perform various steps in the automated script generation method according to various exemplary embodiments of this application as described in the "Exemplary Methods" section above.

[0182] The processor 801 can be a general-purpose processor, such as a central processing unit (CPU), digital signal processor (DSP), application-specific integrated circuit (ASIC), field-programmable gate array (FPGA), or other programmable logic device, discrete gate or transistor logic device, or discrete hardware component, capable of implementing or executing the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly manifested as being executed by a hardware processor, or executed by a combination of hardware and software modules within the processor.

[0183] Storage medium 802, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules. The storage medium can include at least one type of storage medium, such as flash memory, hard disk, multimedia card, card-type storage medium, random access memory (RAM), static random access memory (SRAM), programmable read-only memory (PROM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), magnetic storage medium, magnetic disk, optical disk, etc. The storage medium is any other medium capable of carrying or storing desired program code in the form of instructions or data structures that can be accessed by a computer, but is not limited thereto. In the embodiments of this application, storage medium 802 can also be a circuit or any other device capable of implementing storage functions for storing program instructions and / or data.

[0184] Optionally, this application also provides a program product, such as a computer-readable storage medium, including a program that, when executed by a processor, performs the above-described method embodiments.

[0185] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0186] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0187] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or in the form of hardware plus software functional units.

[0188] The integrated units implemented as software functional units described above can be stored in a computer-readable storage medium. These software functional units, stored in a storage medium, include several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute some steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

Claims

1. An automated script generation method, characterized in that, include: During the process of a user performing a target operation on a target browser, the communication data generated between the target browser and the server is captured. The communication data includes: request data corresponding to each request and response data corresponding to each request. Based on the first type of request parameters in the request data corresponding to each request and the response parameters in the response data corresponding to each request, the mapping relationship between the first type of request parameters of each request and the response parameters of other requests is determined, and a mapping relationship graph and a configuration file are generated; the mapping relationship graph is used to record the mapping relationship between the request parameters of the current request and the response parameters of the previous request; the configuration file is used to record the request parameters to be configured in the request, and each request parameter to be configured is marked with the identifier of the request to which it belongs and the parameter format information; Based on the second type of request parameters in the request data corresponding to each request, determine the encryption algorithm information corresponding to the second type of request parameters of each request; Based on the request data corresponding to each request, the mapping relationship graph, the configuration file, and the encryption algorithm information corresponding to the second type of request parameters of each request, an automated execution script corresponding to the target operation of the target browser is generated.

2. The method according to claim 1, characterized in that, Capture communication data generated between the target browser and the server, including: Query and obtain the response status identifier corresponding to each original request. The response status identifier is used to indicate the processing status of the server for the original request. Based on the response status identifier corresponding to each original request, at least one request is selected from each original request, and the request data and response data corresponding to each request are used as the communication data.

3. The method according to claim 1, characterized in that, The step of determining the mapping relationship between the first type of request parameters of each request and the response parameters of other requests based on the first type of request parameters in the request data corresponding to each request and the response parameters in the response data corresponding to each request, and generating a mapping relationship map and configuration file, includes: Extract each first-type request parameter and the corresponding request parameter value from the request data corresponding to each request. Extract each response parameter and its corresponding value from the response data corresponding to each request; Based on the comparison results of the request parameter values ​​corresponding to each first type of request parameter of each request and the response parameter values ​​corresponding to each response parameter of other requests, the mapping relationship between each first type of request parameter of each request and the response parameters of other requests is determined, and the request parameters to be configured for each request are determined. The mapping relationship map is generated based on the mapping relationship between each first type of request parameter of each request and each response parameter of other requests; The configuration file is generated based on the configuration request parameters for each request.

4. The method according to claim 3, characterized in that, The step of determining the mapping relationship between each first-type request parameter of each request and each response parameter of other requests, and determining the request parameters to be configured for each request, based on the comparison results of the request parameter values ​​corresponding to each first-type request parameter of each request and the response parameter values ​​corresponding to each response parameter of other requests, includes: For the current request, iterate through all comparison requests with timestamps earlier than the current request; Based on the current comparison request encountered, the request parameter values ​​corresponding to each first type of request parameter in the current request are compared with the response parameter values ​​of the current comparison request to determine whether there are any response parameter values ​​that are the same as the request parameter values ​​corresponding to each first type of request parameter in the current request. If they exist, record the mapping relationship between each first type of request parameter in the current request and the corresponding response parameter in the current comparison request; If it does not exist, then update the previous request of the current comparison request to the new current comparison request; The process is repeated until the mapping relationship between each first-type request parameter in all requests and the response parameters in all requests that came before the request is determined. Each first-type request parameter in each request whose mapping relationship has not been determined is then used as the request parameter to be configured for that request.

5. The method according to claim 3, characterized in that, The step of generating the configuration file based on the configuration request parameters of each request includes: Based on the correspondence between each request parameter to be configured and the request, as well as the request parameter value of each request parameter to be configured, generate annotation information for each request parameter to be configured. The configuration file is generated based on each parameter to be configured and its annotation information.

6. The method according to claim 5, characterized in that, The step of generating annotation information for each request parameter to be configured based on the correspondence between each request parameter to be configured and the request parameter value of each request parameter to be configured includes: Based on the correspondence between each request parameter to be configured and the request, generate an identifier for the request to which each request parameter belongs; Based on the request parameter values ​​of each request parameter to be configured, determine the parameter format template of each request parameter to be configured, and use the parameter format template of each request parameter to be configured as the parameter format information of each request parameter to be configured. Based on the identifier of the request to which each request parameter to be configured belongs and the parameter format information of each request parameter to be configured, the annotation information of each request parameter to be configured is obtained.

7. The method according to claim 1, characterized in that, The step of determining the encryption algorithm information corresponding to the second type of request parameter for each request based on the second type of request parameter in the request data corresponding to each request includes: Retrieve the target ciphertext information corresponding to the second type of request parameter in the request data of each request; Based on the target ciphertext information corresponding to the second type of request parameters of each request, the encryption feature information of the target ciphertext information is extracted; the encryption feature information includes: the string length of the target ciphertext information, the character base type of the target ciphertext information, the encoding type of the target ciphertext information, and the entropy value of the target ciphertext information; Based on the encryption feature information of the target ciphertext, a pre-trained encryption algorithm calculation model is used to determine the matching degree between the target ciphertext and each candidate encryption algorithm. Based on the request parameter value corresponding to the second type of request parameter, the target ciphertext information corresponding to the second type of request parameter, and the matching degree between the target ciphertext information and each candidate encryption algorithm, verify and determine the encryption algorithm corresponding to the second type of request parameter of each request. Based on the encryption algorithm corresponding to the second type of request parameter of each request, generate encryption algorithm information corresponding to the second type of request parameter of each request.

8. The method according to claim 7, characterized in that, The step of verifying and determining the encryption algorithm corresponding to the second type of request parameter for each request based on the request parameter value corresponding to the second type of request parameter, the target ciphertext information corresponding to the second type of request parameter, and the matching degree between the target ciphertext information and each candidate encryption algorithm includes: Traverse each candidate encryption algorithm and determine the current candidate encryption algorithm to be verified based on the matching degree between the target ciphertext information and each candidate encryption algorithm; Based on the request parameter value corresponding to the second type of request parameter of the target request, the plaintext information is obtained; The plaintext information is encrypted using the candidate encryption algorithm to be verified to obtain encrypted ciphertext information; If the encrypted ciphertext information is the same as the target ciphertext information, then the candidate encryption algorithm to be verified is determined to be the encryption algorithm corresponding to the second type of request parameter; If the encrypted ciphertext information is different from the target ciphertext information, then a new candidate encryption algorithm to be verified is determined. The process is repeated until the encryption algorithm corresponding to the second type of request parameter of the target request is determined from among the candidate encryption algorithms.

9. The method according to claim 8, characterized in that, The communication data further includes: a JavaScript file corresponding to the request; the JavaScript file records encryption-related information; the encryption of the plaintext information using the currently verified candidate encryption algorithm to obtain encrypted ciphertext information includes: If the candidate encryption algorithm to be verified is an algorithm that encrypts using a key, then the key information is obtained from the JavaScript file corresponding to the target request; The plaintext information is encrypted using the key information to obtain the encrypted ciphertext information.

10. The method according to claim 1, characterized in that, The step of generating an automated execution script corresponding to the target operation of the target browser based on the request data corresponding to each request, the mapping relationship graph, the configuration file, and the encryption algorithm information corresponding to the second type of request parameters of each request includes: Based on the request data corresponding to each request and the mapping relationship graph, the application interface request code corresponding to each request is generated. The application interface request code includes: request header, request body, request resource locator, query parameters and query method. Based on the encryption algorithm information corresponding to the second type of request parameters of each request, generate the encryption module code corresponding to each request; Based on the configuration file, dynamic parameter placeholders for each request are generated; The automated execution script is generated based on the application interface request code corresponding to each request, the encryption module code corresponding to each request, and the dynamic parameter placeholders for each request.

11. An automated script generation device, characterized in that, include: Acquire module, determine module, and generate module; The acquisition module is used to capture communication data generated between the target browser and the server during the process of the user performing a target operation on the target browser. The communication data includes: request data corresponding to each request and response data corresponding to each request. The determining module is used to determine the mapping relationship between the first type of request parameters of each request and the response parameters of other requests based on the first type of request parameters in the request data corresponding to each request and the response parameters in the response data corresponding to each request, and to generate a mapping relationship graph and a configuration file; the mapping relationship graph is used to record the mapping relationship between the request parameters of the current request and the response parameters of the previous request; the configuration file is used to record the request parameters to be configured in the request, and each request parameter to be configured is marked with the identifier of the request to which it belongs and the parameter format information; The determining module is used to determine the encryption algorithm information corresponding to the second type of request parameter of each request based on the second type of request parameter in the request data corresponding to each request. The generation module is used to generate an automated execution script corresponding to the target operation of the target browser based on the request data corresponding to each request, the mapping relationship graph, the configuration file, and the encryption algorithm information corresponding to the second type of request parameters of each request.

12. An electronic device, characterized in that, include: The device includes a processor, a storage medium, and a bus, wherein the storage medium stores program instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium via the bus, and the processor executes the program instructions to implement the automated script generation method as described in any one of claims 1 to 10.

13. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, which is executed by a processor to implement the automated script generation method as described in any one of claims 1 to 10.