Data processing method, device, terminal device and storage medium

By dynamically adjusting the interface request parameter template, the problem of high workload for developers in complex scenarios in interface automation testing is solved, and the testing efficiency and applicability are improved.

CN113282512BActive Publication Date: 2024-12-24PING AN TECH (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110707172.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-06-24
Publication Date
2024-12-24
Estimated Expiration
2041-06-24

AI Technical Summary

Technical Problem

In interface automation testing, as the complexity of business systems increases, the combination of back-end interface request parameters becomes more and more complex, resulting in developers needing to conceive all possible business scenarios in advance, increasing workload and time, and reducing testing Efficiency and applicability.

Method used

By obtaining business test requests, determining the request parameter template, and adding, modifying and deleting fields of the template according to the incoming API parameters, a new request parameter template is generated to meet different business needs.

Benefits of technology

It reduces the difficulty of template development, improves the efficiency and applicability of interface automation testing, and allows flexibly adjusting the request parameter template to adapt to different test scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113282512B_ABST
    Figure CN113282512B_ABST
Patent Text Reader

Abstract

The embodiment of the present application discloses a data processing method, apparatus, terminal device and storage medium, the method comprising: obtaining a business test request, and determining a first request parameter template according to the business test request. Obtaining a first parameter passed in based on a first application program interface API, and obtaining a second parameter passed in through a second API. Adjusting the fields in the first request parameter template and / or the values ​​corresponding to the fields in the first request parameter template according to the first parameter and the second parameter, respectively, to generate a new request parameter template. The use of the embodiment of the present application can reduce the difficulty of template development, improve the efficiency of interface automation testing, and has high applicability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a data processing method, apparatus, terminal device and storage medium. Background Art

[0002] Constructing request parameters is a key step in the interface automated testing process. Generally speaking, when constructing request parameters, you can first store each interface request parameter template in a local file, and then replace the key variables in the corresponding request parameter template according to different test tasks to assemble the final request parameters for interface automated testing. In most scenarios, this method of filling the test data into the interface request parameter template and then generating the request parameters required by the user is a method for quickly combining request parameters.

[0003] However, with the increasing complexity of business systems, the combination of back-end interface request parameters is becoming more and more complex. Due to the diversity and uncertainty of actual business scenarios, developers must conceive of all possible business scenarios in advance, and then develop a corresponding interface request parameter template for each small business scenario in advance, or in the development process of some interface request parameter templates, pre-identify the fields that may need to be updated in the interface request parameter template in advance through placeholders (such as {}, ${}, etc.). However, whether it is a way to completely redevelop an interface request parameter template each time (that is, write an interface request parameter template from scratch) or to pre-add placeholders to the template so that the template can be updated by replacing the placeholders later, it will increase the workload of developers and require all possible situations to be anticipated in advance, which is obviously unrealistic and time-consuming and labor-intensive. Therefore, the efficiency of interface automation testing is low and the applicability is not high. Summary of the invention

[0004] The embodiments of the present application provide a data processing method, apparatus, terminal device, and storage medium, which can reduce the difficulty of template development and improve the efficiency of interface automation testing and have high applicability.

[0005] In a first aspect, an embodiment of the present application provides a data processing method, the method comprising:

[0006] Obtaining a service test request, and determining a first request parameter template according to the service test request;

[0007] Obtaining a first parameter passed in based on a first application programming interface (API), and obtaining a second parameter passed in through a second API, wherein the first parameter is used to add a field to the first request parameter template and / or to modify a value corresponding to a field included in the first request parameter template, and the second parameter is used to delete a field included in the first request parameter template;

[0008] The fields in the first request parameter template and / or the values ​​corresponding to the fields in the first request parameter template are adjusted according to the first parameter and the second parameter respectively to generate a new request parameter template.

[0009] In combination with the first aspect, in a possible implementation manner, the service test request includes a first template identifier;

[0010] The determining a request parameter template according to the service test request includes:

[0011] A first request parameter template corresponding to the first template identifier is obtained from a request parameter template library, wherein a template identifier is used to mark a request parameter template.

[0012] In combination with the first aspect, in a possible implementation manner, the service test request includes a service identifier of the service to be tested;

[0013] The determining a first request parameter template according to the service test request includes:

[0014] Determine the service type of the service to be tested according to the service identifier;

[0015] Acquire at least one request parameter template corresponding to the service type from a request parameter template library;

[0016] The request parameter template corresponding to the minimum timestamp in the at least one request parameter template is determined as the first request parameter template.

[0017] In combination with the first aspect, in a possible implementation manner, before adjusting the fields in the first request parameter template and / or the values ​​corresponding to the fields in the first request parameter template according to the first parameter and the second parameter respectively, the method further includes:

[0018] Determine a first Hash value according to the first parameter and the second parameter, and determine the first Hash value as a template identifier;

[0019] The adjusting, according to the first parameter and the second parameter, respectively, the field in the first request parameter template and / or the value corresponding to the field in the first request parameter template includes:

[0020] If the at least one request parameter template does not include the request parameter template corresponding to the template identifier, the fields in the first request parameter template and / or the values ​​corresponding to the fields in the first request parameter template are adjusted according to the first parameter and the second parameter to generate a new request parameter template.

[0021] In combination with the first aspect, in a possible implementation manner, the method further includes:

[0022] If it is determined that the at least one request parameter template includes the request parameter template corresponding to the template identifier, the request parameter template corresponding to the template identifier is determined as the new request parameter template.

[0023] In combination with the first aspect, in a possible implementation, adjusting the fields in the first request parameter template and / or the values ​​corresponding to the fields in the first request parameter template according to the first parameter and the second parameter to generate a new request parameter template includes:

[0024] Adding fields in the first request parameter template and / or modifying values ​​corresponding to fields in the first request parameter template according to the first parameter to obtain a second request parameter template;

[0025] The fields in the second request parameter template and the values ​​corresponding to the fields are deleted according to the second parameter to obtain the new request parameter template.

[0026] In combination with the first aspect, in a possible implementation manner, adding a field in the request parameter template and / or modifying a value corresponding to a field in the request parameter template according to the first parameter includes:

[0027] If it is determined that the first request parameter template includes the first field according to the first field included in the first parameter, modifying the value of the first field included in the first request parameter template to a value corresponding to the first field included in the first parameter; and / or

[0028] If it is determined according to the first field included in the first parameter that the first request parameter template does not include the first field, the first field and the value corresponding to the first field are added to the first request parameter template.

[0029] In combination with the first aspect, in a possible implementation manner, deleting the field in the second request parameter template and the value corresponding to the field according to the second parameter to obtain the new request parameter template includes:

[0030] Performing field segmentation on the second request parameter template to obtain a plurality of fields constituting the second request parameter template;

[0031] Based on the second field included in the second parameter, each field in the multiple fields is matched one by one. If any field in the multiple fields matches the second field, the second field included in the second request parameter template is deleted, and the value corresponding to the second field in the second request parameter template is deleted to obtain the new request parameter template.

[0032] In combination with the first aspect, in a possible implementation manner, after adjusting the fields in the first request parameter template and / or the values ​​corresponding to the fields in the first request parameter template according to the first parameter and the second parameter to generate a new request parameter template, the method further includes:

[0033] Acquire business test data, and fill in the values ​​of the various fields included in the business test data into the values ​​corresponding to the corresponding fields included in the new request parameter template in sequence to generate interface request parameters;

[0034] Execute interface automation testing according to the interface request parameters.

[0035] In a second aspect, an embodiment of the present application provides a data processing device, the device comprising:

[0036] A first request parameter template acquisition module, used to acquire a service test request and determine a first request parameter template according to the service test request;

[0037] a parameter acquisition module, used to acquire a first parameter passed in based on a first application program interface (API), and to acquire a second parameter passed in through a second API, wherein the first parameter is used to add a field to the first request parameter template and / or to modify a value corresponding to a field included in the first request parameter template, and the second parameter is used to delete a field included in the first request parameter template;

[0038] A request parameter template updating module is used to adjust the fields in the first request parameter template and / or the values ​​corresponding to the fields in the first request parameter template according to the first parameter and the second parameter, so as to generate a new request parameter template.

[0039] In combination with the second aspect, in a possible implementation manner, the service test request includes a first template identifier;

[0040] The first request parameter template acquisition module is specifically used for:

[0041] A first request parameter template corresponding to the first template identifier is obtained from a request parameter template library, wherein a template identifier is used to mark a request parameter template.

[0042] In conjunction with the second aspect, in a possible implementation manner, the service test request includes a service identifier of the service to be tested;

[0043] The first request parameter template acquisition module includes:

[0044] A service type determination unit, configured to determine the service type to which the service to be tested belongs according to the service identifier;

[0045] A request parameter template acquisition unit, used to acquire at least one request parameter template corresponding to the business type from a request parameter template library;

[0046] The first request parameter template acquiring unit is configured to determine the request parameter template corresponding to the minimum timestamp among the at least one request parameter template as the first request parameter template.

[0047] In conjunction with the second aspect, in a possible implementation manner, the device further includes:

[0048] a template identification determination module, configured to determine a first Hash value according to the first parameter and the second parameter, and determine the first Hash value as a template identification;

[0049] The request parameter template updating module is specifically used for:

[0050] If it is determined that the at least one request parameter template does not include the request parameter template corresponding to the template identifier, the fields in the first request parameter template and / or the values ​​corresponding to the fields in the first request parameter template are adjusted according to the first parameter and the second parameter respectively to generate a new request parameter template.

[0051] In conjunction with the second aspect, in a possible implementation manner, the request parameter template updating module is further configured to:

[0052] If it is determined that the at least one request parameter template includes the request parameter template corresponding to the template identifier, the request parameter template corresponding to the template identifier is determined as the new request parameter template.

[0053] In conjunction with the second aspect, in a possible implementation, the request parameter template updating module includes:

[0054] a first processing unit, configured to add fields in the first request parameter template and / or modify values ​​corresponding to the fields in the first request parameter template according to the first parameter, so as to obtain a second request parameter template;

[0055] The second processing unit is used to delete the fields in the second request parameter template and the values ​​corresponding to the fields according to the second parameter to obtain the new request parameter template.

[0056] In conjunction with the second aspect, in a possible implementation manner, the first processing unit is specifically configured to:

[0057] If it is determined that the first request parameter template includes the first field according to the first field included in the first parameter, modifying the value of the first field included in the first request parameter template to a value corresponding to the first field included in the first parameter; and / or

[0058] If it is determined according to the first field included in the first parameter that the first request parameter template does not include the first field, the first field and the value corresponding to the first field are added to the first request parameter template.

[0059] In conjunction with the second aspect, in a possible implementation manner, the second processing unit is specifically configured to:

[0060] Performing field segmentation on the second request parameter template to obtain a plurality of fields constituting the second request parameter template;

[0061] Based on the second field included in the second parameter, each field in the multiple fields is matched one by one. If any field in the multiple fields matches the second field, the second field included in the second request parameter template is deleted, and the value corresponding to the second field in the second request parameter template is deleted to obtain the new request parameter template.

[0062] In combination with the second aspect, in a possible implementation manner, the device further includes a request parameter generating module, and the request parameter generating module includes:

[0063] A request parameter generating unit, used to obtain service test data, and sequentially fill the values ​​of the fields included in the service test data into the values ​​corresponding to the corresponding fields included in the new request parameter template to generate interface request parameters;

[0064] The interface automation testing unit is used to perform interface automation testing according to the interface request parameters.

[0065] In a third aspect, an embodiment of the present application provides a terminal device, the terminal device includes a processor, a memory, and a transceiver, and the processor, the memory, and the transceiver are connected to each other. The memory is used to store a computer program that supports the terminal device to execute the method provided by the first aspect and / or any possible implementation of the first aspect, the computer program includes program instructions, and the processor and the transceiver are configured to call the above-mentioned program instructions to execute the method provided by the first aspect and / or any possible implementation of the first aspect.

[0066] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program, and the computer program includes program instructions, which, when executed by a processor, enable the processor to execute the method provided by the above-mentioned first aspect and / or any possible implementation method of the first aspect.

[0067] In an embodiment of the present application, by obtaining a business test request, a first request parameter template can be determined according to the business test request. A first parameter passed in based on a first application program interface API is obtained, and a second parameter passed in through a second API is obtained. According to the first parameter and the second parameter, the values ​​corresponding to the fields in the first request parameter template and / or the fields in the first request parameter template are adjusted to generate a new request parameter template. It can be understood that in the present application, by obtaining a standardized template associated with a business test request (i.e., a first request parameter template), and adding, updating, and deleting the fields of the first request parameter template through the dynamic parameters (i.e., the first parameter and the second parameter) passed in, various forms of interface request parameter templates can be combined to adapt to different business test requirements, thereby reducing the difficulty of template development, and since the required request parameter template can be adjusted in real time according to actual needs, it is conducive to improving the efficiency of interface automation testing under different demand scenarios, with higher flexibility and applicability. BRIEF DESCRIPTION OF THE DRAWINGS

[0068] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0069] Figure 1 It is a flow chart of a data processing method provided in an embodiment of the present application;

[0070] Figure 2 This is a schematic diagram of the correspondence between the service identifier and the service type provided in the embodiment of the present application;

[0071] Figure 3 It is a schematic diagram of the structure of the request parameter template library provided in the embodiment of the present application;

[0072] Figure 4 It is a schematic diagram of a scenario of updating a request parameter template library provided in an embodiment of the present application;

[0073] Figure 5 is another flow chart of the data processing method provided in the embodiment of the present application;

[0074] Figure 6 is a structural schematic diagram of a data processing device provided in an embodiment of the present application;

[0075] Figure 7 is another structural schematic diagram of a data processing device provided in an embodiment of the present application;

[0076] Figure 8 It is a schematic diagram of the structure of the terminal device provided in an embodiment of the present application. DETAILED DESCRIPTION

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

[0078] The data processing method provided in the embodiment of the present application can be widely applied to various terminal devices capable of performing interface automation testing. Among them, the above-mentioned terminal devices include but are not limited to servers, smart phones, tablet computers, laptops and desktop computers, etc., which are not limited here. For the convenience of description, the terminal device will be used as an example for explanation below. In the method in the embodiment of the present application, the terminal device can determine the first request parameter template according to the business test request by obtaining a business test request. Obtain a first parameter passed in based on a first application program interface API, and obtain a second parameter passed in through a second API. According to the first parameter and the second parameter, the values ​​corresponding to the fields in the first request parameter template and / or the fields in the first request parameter template are adjusted respectively to generate a new request parameter template. By adopting the embodiment of the present application, the difficulty of template development can be reduced, and the efficiency of interface automation testing can be improved, and the applicability is high.

[0079] The following will be combined Figures 1 to 8 The methods and related devices provided in the embodiments of the present application are described in detail respectively.

[0080] See also Figure 1 , Figure 1A flow chart of a data processing method provided in an embodiment of the present application. The method provided in an embodiment of the present application may include the following steps S101 to S103:

[0081] S101: Obtain a service test request, and determine a first request parameter template according to the service test request.

[0082] In some feasible implementations, the terminal device can determine the request parameter template according to the service test request by obtaining the service test request. Among them, the service test request may include an identifier of the request parameter template (hereinafter referred to as the template identifier) ​​or a service identifier of the service to be tested, etc., which is not limited here. Optionally, the service test request may also include a timestamp, etc., which is not limited here. Among them, the template identifier can be the number of the request parameter template, or the name of the request parameter template, etc., which is not limited here. The service identifier can be the service type of the service to be tested, or it can be the service name of the service to be tested, etc., which is not limited here. Among them, the first request parameter template in the embodiment of the present application is json type data.

[0083] It can be understood that if the above-mentioned business test request includes a template identifier, then the above-mentioned determination of the first request parameter template based on the business test request can be understood as: according to the parsed business test request including the first template identifier, obtaining the first request parameter template corresponding to the first template identifier from the request parameter template library, wherein a template identifier is used to mark a request parameter template.

[0084] Optionally, if the service test request includes the service identifier of the service to be tested, the above-mentioned determination of the first request parameter template based on the service test request can be understood as: determining the service type to which the service to be tested belongs according to the service identifier included in the parsed service test request. Obtain at least one request parameter template corresponding to the service type from the request parameter template library. Determine the request parameter template corresponding to the minimum timestamp in at least one request parameter template as the first request parameter template. Among them, each request parameter template included in the request parameter template library is a json type of data.

[0085] Specifically, the terminal device may store a correspondence table between service identifiers and service types in advance. Therefore, after parsing the service identifier included in the service test request, the service type corresponding to the service identifier included in the service test request may be determined by querying the correspondence table. For example, see Figure 2 , Figure 2 Schematic diagram of the correspondence between the service identifier and the service type provided in the embodiment of the present application. Figure 2As shown, the service identifiers 00qazwsxe, 00wsxedcr, 00edcrfvt, 00rfvtgby, 00tgbyhnu, etc. correspond to service type a, and the service identifiers 01yhnujmi, 01ujmqazw, etc. correspond to service type b. Optionally, the service type to which the service to be tested belongs can also be determined based on the first n characters of the m characters that make up the service identifier. Among them, m is an integer greater than n. In other words, the first n characters in the service identifier can be used to characterize the service type. For example, taking n=2 as an example, if 00 is pre-defined to represent service type a, 01 is used to represent service type b, 10 is used to represent service type c, and 11 is used to represent service type d. Among them, assuming that the service identifier of the service to be tested is 10tgflv, according to the first two characters 10 of the service identifier 10tgflb, it can be determined that the service type to which the service to be tested belongs is service type c.

[0086] In the embodiment of the present application, at least one request parameter template corresponding to each service type in the request parameter template library can be arranged in order from early to late according to the template generation timestamp. For example, see Figure 3 , Figure 3 Schematic diagram of the structure of the request parameter template library provided in the embodiment of the present application. Figure 3 As shown, it is assumed that for business type a, the business type a corresponds to 3 request parameter templates. Among them, the 3 request parameter templates are request parameter template a1, request parameter template a2 and request parameter template a3, wherein template a1 is the original / general / basic / standardized template created at timestamp 1, template a2 is a template generated after adjusting template a1 at timestamp 2 (i.e., the template generated after adjusting template a1 according to parameter 1 passed in by the first API and parameter 2 passed in by the second API), and template a3 is another template generated after adjusting template a1 at timestamp 3 (i.e., the template generated after adjusting template a1 according to parameter 1' passed in by the first API and parameter 2' passed in by the second API). It should be understood that template a1, template a2 and template a3 are different, and timestamp 1 is earlier than timestamp 2, and timestamp 2 is earlier than timestamp 3. Therefore, in the request parameter template library, the appearance order of the 3 request parameter templates corresponding to business type a is template a1, template a2, and template a3 from top to bottom. By analogy, in the request parameter template library, the order of appearance of the two request parameter templates corresponding to business type b is template b1 (i.e., the original template corresponding to business type b) and template b2 (i.e., the new template adjusted based on template b1) from top to bottom.

[0087] For example, assuming that the service test request in the embodiment of the present application includes the service identifier 00qazwsxe, it can be determined that the service identifier 00qazwsxe corresponds to the service type a, and therefore, the request parameter template a1, request parameter template a2, and request parameter template a3 corresponding to the service type a can be obtained from the request parameter template library. Since the timestamp 1 corresponding to the request parameter template a1 is less than the timestamp 2 corresponding to the request parameter template a2 and less than the timestamp 3 corresponding to the request parameter template a3, the request parameter template a1 can be used as the first request parameter template.

[0088] Among them, Figure 3 The template identifier 1 shown is used to mark the request parameter template a1, the template identifier 2 is used to mark the request parameter template a2, the template identifier 3 is used to mark the request parameter template a3, the template identifier 4 is used to mark the request parameter template b1, and the template identifier 5 is used to mark the request parameter template b2. It is understandable that the template identifier of the original template corresponding to each business type in the embodiment of the present application can be a hash value obtained by hashing the original template. For example, template identifier 1 = hash (request parameter template a1), and for another example, template identifier 4 = hash (request parameter template b1). It is understandable that the template identifiers of other templates other than the original template corresponding to each business type in the embodiment of the present application can be hash values ​​obtained by concatenating the first parameter and the second parameter of the other template and then performing a hash operation. For example, taking template a2 as an example, since template a2 is a template generated by adjusting template a1 according to parameter 1 passed in by the first API and parameter 2 passed in by the second API, the template identifier 2 corresponding to template a2 = hash (parameter 1 + parameter 2). For another example, taking template a3 as an example, since template a3 is a template generated by adjusting template a1 according to parameter 1' passed in by the first API and parameter 2' passed in by the second API, the template identifier 3 corresponding to template a3 = hash (parameter 1' + parameter 2'). It is not difficult to understand that the hash algorithm is a one-way cryptographic system, that is, it is an irreversible mapping from plaintext to ciphertext. There is only an encryption process, but no decryption process. At the same time, the hash algorithm can change the input data of any length to obtain an output of a fixed length, and if any character in the input data changes, it will inevitably lead to a different hash value of the final output. The hash algorithms used in the embodiments of the present application include MD series hash algorithms, SHA hash algorithms, and SM3 hash algorithms, etc., which are not limited here. The MD series hash algorithms include MD2, MD4 and MD5, etc., and the SHA hash algorithms include SHA-1, SHA-224, SHA-256, SHA-384, SHA-512, etc.

[0089] S102: Acquire a first parameter passed in based on a first application programming interface (API), and acquire a second parameter passed in through a second API.

[0090] In some feasible implementations, a first parameter passed in based on a first application program interface API is obtained, and a second parameter passed in through a second API is obtained. The first parameter and the second parameter are used to adjust the first request parameter template corresponding to the above-obtained business type to generate a new request parameter template that matches the actual test scenario. It is understandable that the first parameter in the present application is used to add missing items and / or modify existing items in the above-mentioned first request parameter template, and the second parameter is used to delete irrelevant items in the above-mentioned first request parameter template. In other words, the first parameter is used to add fields to the first request parameter template and / or modify the values ​​corresponding to the fields in the first request parameter template to obtain the second request parameter template. The second parameter is used to delete the fields and the values ​​corresponding to the fields in the second request parameter template generated based on the first request parameter template to obtain a new request parameter template. The first parameter is a key-value type parameter, that is, the map type commonly referred to in the Java language. The second parameter is text character data, that is, the string type in the Java language.

[0091] S103: Adjust the fields in the first request parameter template and / or the values ​​corresponding to the fields in the first request parameter template according to the first parameter and the second parameter respectively to generate a new request parameter template.

[0092] In some feasible implementations, the fields in the first request parameter template and / or the values ​​corresponding to the fields in the first request parameter template may be adjusted according to the first parameter and the second parameter, respectively, to generate a new request parameter template. It is understandable that if the first parameter is not empty and the second parameter is empty, the fields in the first request parameter template and the values ​​corresponding to the fields may be adjusted only according to the first parameter to generate a new request parameter template, or the values ​​corresponding to the fields in the first request parameter template may be adjusted to generate a new request parameter template. If the first parameter is empty and the second parameter is not empty, the fields in the first request parameter template and the values ​​corresponding to the fields may be adjusted only according to the second parameter to generate a new request parameter template.

[0093] Specifically, the above-mentioned adjusting the fields in the first request parameter template and / or the values ​​corresponding to the fields in the first request parameter template according to the first parameter and the second parameter respectively to generate a new request parameter template can be understood as: adding fields in the first request parameter template and / or modifying the values ​​corresponding to the fields in the first request parameter template according to the first parameter to obtain the second request parameter template. Deleting the fields in the second request parameter template and the values ​​corresponding to the fields according to the second parameter to obtain a new request parameter template. Specifically, the above-mentioned adding fields in the request parameter template and / or modifying the values ​​corresponding to the fields in the request parameter template according to the first parameter can be understood as: if it is determined that the first request parameter template includes the first field according to the first field included in the first parameter, then modifying the value of the first field included in the first request parameter template to the value corresponding to the first field included in the first parameter; and / or, if it is determined that the first request parameter template does not include the first field according to the first field included in the first parameter, then adding the first field and the value corresponding to the first field to the first request parameter template. The above-mentioned deleting the fields and the values ​​corresponding to the fields in the second request parameter template according to the second parameter to obtain a new request parameter template can be understood as: performing field segmentation on the second request parameter template to obtain multiple fields constituting the second request parameter template. Based on the second field included in the second parameter, each field in the multiple fields is matched one by one. If any field in the multiple fields matches the second field, the second field included in the second request parameter template is deleted, and the value corresponding to the second field in the second request parameter template is deleted to obtain a new request parameter template.

[0094] In the specific implementation, after receiving the two parameters (i.e. the first parameter and the second parameter) passed in from the outside, you can first use the first key-value data structure parameter (i.e. the map object) to traverse the entire original template through the Java language hashMap. Then use the parsed key and value values ​​as the input parameters of the set method in the jsonpath tool class in the Java language. Note that you need to use "$." as a prefix to splice the key value and combine it into a standard jsonpath syntax. The purpose is to accurately know the location of the field to be modified, so as to modify the value of this field. After finding the location of the field to be updated in the original template, replace the value of the field to be updated in the original template with the above value value, that is, to obtain the updated value. If no field that conforms to the current jsonpath syntax rules is found in the original template, you can add a field to the original template according to the current syntax rules, and also use the value value as the value of the newly added field. After parsing the first parameter, the second parameter passed in is cut into multiple characters according to "," such as "username, user.0.phone" as the input parameter of the remove method of the jsonpath tool class, and then the fields to be deleted are removed from the original template.

[0095] For example, when writing an interface automation script, there are two situations:

[0096] Case 1: Xiao Wang is a soldier, his information needs to be kept confidential, and his contact address and contact information need to be empty (that is, the address field and phoneNumbers field in the interface request parameter field need to be deleted). Here, to implement the situation described in Case 1, you can pass in the address and phoneNumbers fields in the second parameter, and then delete the address and phoneNumbers fields in the request parameter template.

[0097] Case 2: Xiao Yang's contact information needs to add a personal number in addition to the company number (that is, the phoneNumbers field in the interface request parameter field needs to add multiple number fields and type fields). Therefore, you only need to pass {"phoneNumbers.2.number": xxxxxxxxxxx "phoneNumbers.2.type": "phone"} in the first parameter to achieve the effect described in Case 2.

[0098] Case 3: Xiao Jiang is a student. In addition to his home address, his contact address also needs to include a school address (that is, the interface request parameter field address has two or more contact addresses). Therefore, you only need to pass {"address.school.city":"sz","address.school.streetAddress":"school address"} in the first parameter to achieve the effect of Case 3.

[0099] Optionally, in some feasible implementations, after a new request parameter template is generated, the new request parameter template can also be added to the request parameter template corresponding to the service type to which the service to be tested belongs in the request parameter template library. For example, see Figure 4 , Figure 4 Schematic diagram of a scenario of updating a request parameter template library provided in an embodiment of the present application. Figure 4 As shown, assuming that request parameter template a4 is a new request parameter template generated after adjusting template a1 according to the first parameter d1 and the second parameter d2 at timestamp 6, template a4 can be added after template a3, wherein the template identifier 6 corresponding to template a4 = hash(d1+d2).

[0100] In an embodiment of the present application, by obtaining a business test request, a first request parameter template can be determined according to the business test request. A first parameter passed in based on a first application program interface API is obtained, and a second parameter passed in through a second API is obtained. According to the first parameter and the second parameter, the fields in the first request parameter template and / or the values ​​corresponding to the fields in the first request parameter template are adjusted respectively to generate a new request parameter template. By adopting an embodiment of the present application, the difficulty of template development can be reduced, and the efficiency of interface automation testing can be improved, and the applicability is high.

[0101] See also Figure 5 , Figure 5 It is another flow chart of the data processing method provided in the embodiment of the present application. The data processing method provided in the embodiment of the present application can be explained by the implementation method provided by the following steps S501 to S505:

[0102] S501: Obtain a service test request, and determine a first request parameter template according to the service test request.

[0103] S502: Acquire a first parameter passed in based on a first application programming interface (API), and acquire a second parameter passed in through a second API.

[0104] The specific implementation of step S501 to step S502 can be found in Figure 1The description of step S101 to step S102 in the corresponding embodiment will not be repeated here.

[0105] S503: Determine a first Hash value according to the first parameter and the second parameter, and determine the first Hash value as a template identifier.

[0106] In some feasible implementations, a first hash value may be determined based on the first parameter and the second parameter, and the first hash value may be determined as a template identifier. Specifically, the first parameter and the second parameter may be concatenated first, and then a hash operation may be performed on the concatenated string to obtain the first hash value as the template identifier. The concatenation order may be the first parameter first and the second parameter second, or the concatenation order may be the second parameter first and the first parameter second, which is not limited here. For example, assuming that the first parameter is: {"phoneNumbers.2.number": xxxxxxxxxxx "phoneNumbers.2.type": "phone"}, and the second parameter is: address, wherein ① the concatenation order is the first parameter first and the second parameter second, then the concatenated string is: {"phoneNumbers.2.number": xxxxxxxxxxx "phoneNumbers.2.type": "phone"}address. ② The concatenation order is the second parameter first and the first parameter last, and the concatenated string is: address{"phoneNumbers.2.number": xxxxxxxxxxx"phoneNumbers.2.type":"phone"}. For ease of understanding, the following embodiments of the present application are described by taking the first parameter first and the second parameter last as an example.

[0107] S504: If it is determined that at least one request parameter template does not include the request parameter template corresponding to the template identifier, adjust the fields in the first request parameter template and / or the values ​​corresponding to the fields in the first request parameter template according to the first parameter and the second parameter respectively to generate a new request parameter template.

[0108] In some feasible implementations, if it is determined that at least one request parameter template does not include a request parameter template corresponding to the template identifier, the step of adjusting the fields in the first request parameter template and / or the values ​​corresponding to the fields in the first request parameter template according to the first parameter and the second parameter respectively can be performed to generate a new request parameter template. If it is determined that at least one request parameter template includes the request parameter template corresponding to the template identifier, the request parameter template corresponding to the template identifier in the request parameter template library can be directly determined as the new request parameter template. That is, based on the generated template identifier, at least one request parameter template corresponding to the business type corresponding to the business to be tested included in the request parameter template library can be queried / traversed. If the template identifier is found in at least one request parameter template corresponding to the business type, the request parameter template corresponding to the template identifier in the request parameter template library can be used as a template for subsequent generation of request parameters. If the template identifier cannot be found in at least one request parameter template corresponding to the business type, the step of adjusting the fields in the first request parameter template and / or the values ​​corresponding to the fields in the first request parameter template according to the first parameter and the second parameter respectively to generate a new request parameter template is performed.

[0109] S505: Obtain business test data, and fill in the values ​​of the fields included in the business test data into the values ​​corresponding to the corresponding fields included in the new request parameter template in sequence, so as to generate interface request parameters for performing interface automated testing.

[0110] In some feasible implementations, after a new request parameter template is generated, business test data can be further obtained. By parsing the various fields and values ​​corresponding to the various fields included in the business test data, the values ​​corresponding to the parsed various fields can be filled into the corresponding fields in the newly generated request parameter template to generate complete interface request parameters. Therefore, interface automation testing can be performed based on the generated interface request parameters.

[0111] In an embodiment of the present application, a business test request is obtained, and a first request parameter template is determined according to the business test request, wherein the first request parameter template is one of at least one request parameter template corresponding to the business type of the business to be tested in the request parameter template library. A first parameter passed in based on a first application program interface API is obtained, and a second parameter passed in through a second API is obtained. A first hash value is determined based on the first parameter and the second parameter, and the first hash value is determined as a template identifier. If it is determined that the request parameter template corresponding to the template identifier is not included in the at least one request parameter template, the fields in the first request parameter template and / or the values ​​corresponding to the fields in the first request parameter template are adjusted according to the first parameter and the second parameter, respectively, to generate a new request parameter template. Business test data is obtained, and the values ​​of the various fields included in the business test data are sequentially filled into the values ​​corresponding to the corresponding fields included in the new request parameter template to generate interface request parameters for performing interface automation testing. By adopting the embodiment of the present application, when the request parameter template library does not include a new request parameter template corresponding to the business type of the business to be tested, the first request parameter template can be adjusted by the first parameter and the second parameter to generate a new request parameter template. This can avoid repeated development of the same template, reduce the difficulty of template development, and improve the efficiency of interface automation testing, and has high applicability.

[0112] See also Figure 6 , Figure 6 : is a schematic diagram of the structure of a data processing device provided in an embodiment of the present application. The data processing device provided in an embodiment of the present application includes:

[0113] A first request parameter template acquisition module 61 is used to acquire a service test request and determine a first request parameter template according to the service test request;

[0114] a parameter acquisition module 62, configured to acquire a first parameter passed in based on a first application program interface API, and to acquire a second parameter passed in through a second API, wherein the first parameter is used to add a field to the first request parameter template and / or to modify a value corresponding to a field included in the first request parameter template, and the second parameter is used to delete a field included in the first request parameter template;

[0115] The request parameter template updating module 63 is used to adjust the fields in the first request parameter template and / or the values ​​corresponding to the fields in the first request parameter template according to the first parameter and the second parameter, so as to generate a new request parameter template.

[0116] Please also see Figure 7 , Figure 7 is another structural schematic diagram of a data processing device provided in an embodiment of the present application.

[0117] In a possible implementation manner, the service test request includes a first template identifier;

[0118] The first request parameter template acquisition module 61 is specifically used for:

[0119] A first request parameter template corresponding to the first template identifier is obtained from a request parameter template library, wherein a template identifier is used to mark a request parameter template.

[0120] In a possible implementation manner, the service test request includes a service identifier of the service to be tested;

[0121] The first request parameter template acquisition module 61 includes:

[0122] A service type determination unit 611, configured to determine the service type to which the service to be tested belongs according to the service identifier;

[0123] A request parameter template acquiring unit 612, configured to acquire at least one request parameter template corresponding to the service type from a request parameter template library;

[0124] The first request parameter template acquiring unit 613 is configured to determine the request parameter template corresponding to the minimum timestamp among the at least one request parameter template as the first request parameter template.

[0125] In a possible implementation, the device further includes:

[0126] A template identification determination module 64, configured to determine a first Hash value according to the first parameter and the second parameter, and determine the first Hash value as a template identification;

[0127] The request parameter template updating module 63 is specifically used for:

[0128] If it is determined that the at least one request parameter template does not include the request parameter template corresponding to the template identifier, the fields in the first request parameter template and / or the values ​​corresponding to the fields in the first request parameter template are adjusted according to the first parameter and the second parameter respectively to generate a new request parameter template.

[0129] In a possible implementation manner, the request parameter template updating module 63 is further configured to:

[0130] If it is determined that the at least one request parameter template includes the request parameter template corresponding to the template identifier, the request parameter template corresponding to the template identifier is determined as the new request parameter template.

[0131] In a possible implementation, the request parameter template updating module 63 includes:

[0132] A first processing unit 631 is configured to add a field in the first request parameter template and / or modify a value corresponding to a field in the first request parameter template according to the first parameter, so as to obtain a second request parameter template;

[0133] The second processing unit 632 is configured to delete the fields and the values ​​corresponding to the fields in the second request parameter template according to the second parameter to obtain the new request parameter template.

[0134] In a possible implementation manner, the first processing unit 631 is specifically configured to:

[0135] If it is determined that the first request parameter template includes the first field according to the first field included in the first parameter, modifying the value of the first field included in the first request parameter template to a value corresponding to the first field included in the first parameter; and / or

[0136] If it is determined according to the first field included in the first parameter that the first request parameter template does not include the first field, the first field and the value corresponding to the first field are added to the first request parameter template.

[0137] In a possible implementation manner, the second processing unit 632 is specifically configured to:

[0138] Performing field segmentation on the second request parameter template to obtain a plurality of fields constituting the second request parameter template;

[0139] Based on the second field included in the second parameter, each field in the multiple fields is matched one by one. If any field in the multiple fields matches the second field, the second field included in the second request parameter template is deleted, and the value corresponding to the second field in the second request parameter template is deleted to obtain the new request parameter template.

[0140] In a possible implementation manner, the device further includes a request parameter generating module 65, and the request parameter generating module 65 includes:

[0141] The request parameter generating unit 651 is used to obtain the service test data, and sequentially fill the values ​​of the fields included in the service test data into the values ​​corresponding to the corresponding fields included in the new request parameter template to generate the interface request parameters;

[0142] The interface automation testing unit 652 is used to perform interface automation testing according to the interface request parameters.

[0143] In an embodiment of the present application, the data processing device can obtain a business test request and determine a first request parameter template according to the business test request. Obtain a first parameter passed in based on a first application program interface API, and obtain a second parameter passed in through a second API. Adjust the fields in the first request parameter template and / or the values ​​corresponding to the fields in the first request parameter template according to the first parameter and the second parameter, respectively, to generate a new request parameter template. By adopting an embodiment of the present application, the difficulty of template development can be reduced, and the efficiency of interface automation testing can be improved, and the applicability is high.

[0144] See also Figure 8 , Figure 8 Schematic diagram of the structure of the terminal device provided in the embodiment of the present application. Figure 8 As shown, the terminal device in this embodiment may include: one or more processors 801, memory 802 and transceiver 803. The processor 801, memory 802 and transceiver 803 are connected via a bus 804. The memory 802 is used to store a computer program, which includes program instructions. The processor 801 and the transceiver 803 are used to execute the program instructions stored in the memory 802 to perform the following operations:

[0145] The transceiver 803 is used to obtain a service test request and determine a first request parameter template according to the service test request;

[0146] The transceiver 803 is further configured to obtain a first parameter passed in based on a first application program interface API, and to obtain a second parameter passed in through a second API, wherein the first parameter is used to add a field to the first request parameter template and / or to modify a value corresponding to a field included in the first request parameter template, and the second parameter is used to delete a field included in the first request parameter template;

[0147] Processor 801 is used to adjust the fields in the first request parameter template and / or the values ​​corresponding to the fields in the first request parameter template according to the first parameter and the second parameter, so as to generate a new request parameter template.

[0148] In a possible implementation manner, the service test request includes a first template identifier;

[0149] The processor 801 is used for:

[0150] A first request parameter template corresponding to the first template identifier is obtained from a request parameter template library, wherein a template identifier is used to mark a request parameter template.

[0151] In a possible implementation manner, the service test request includes a service identifier of the service to be tested;

[0152] The processor 801 is used for:

[0153] Determine the service type of the service to be tested according to the service identifier;

[0154] Acquire at least one request parameter template corresponding to the service type from a request parameter template library;

[0155] The request parameter template corresponding to the minimum timestamp in the at least one request parameter template is determined as the first request parameter template.

[0156] In a possible implementation manner, the processor 801 is configured to:

[0157] Determine a first Hash value according to the first parameter and the second parameter, and determine the first Hash value as a template identifier;

[0158] The processor 801 is further configured to:

[0159] If the at least one request parameter template does not include the request parameter template corresponding to the template identifier, the fields in the first request parameter template and / or the values ​​corresponding to the fields in the first request parameter template are adjusted according to the first parameter and the second parameter to generate a new request parameter template.

[0160] In a possible implementation manner, the processor 801 is configured to:

[0161] If it is determined that the at least one request parameter template includes the request parameter template corresponding to the template identifier, the request parameter template corresponding to the template identifier is determined as the new request parameter template.

[0162] In a possible implementation manner, the processor 801 is configured to:

[0163] Adding fields in the first request parameter template and / or modifying values ​​corresponding to fields in the first request parameter template according to the first parameter to obtain a second request parameter template;

[0164] The fields in the second request parameter template and the values ​​corresponding to the fields are deleted according to the second parameter to obtain the new request parameter template.

[0165] In a possible implementation manner, the processor 801 is configured to:

[0166] If it is determined that the first request parameter template includes the first field according to the first field included in the first parameter, modifying the value of the first field included in the first request parameter template to a value corresponding to the first field included in the first parameter; and / or

[0167] If it is determined according to the first field included in the first parameter that the first request parameter template does not include the first field, the first field and the value corresponding to the first field are added to the first request parameter template.

[0168] In a possible implementation manner, the processor 801 is configured to:

[0169] Performing field segmentation on the second request parameter template to obtain a plurality of fields constituting the second request parameter template;

[0170] Based on the second field included in the second parameter, each field in the multiple fields is matched one by one. If any field in the multiple fields matches the second field, the second field included in the second request parameter template is deleted, and the value corresponding to the second field in the second request parameter template is deleted to obtain the new request parameter template.

[0171] In one possible implementation,

[0172] The transceiver 803 is used to obtain service test data;

[0173] The processor 801 is further configured to sequentially fill the values ​​of the fields included in the service test data into the values ​​corresponding to the corresponding fields included in the new request parameter template to generate interface request parameters;

[0174] The processor 801 is further configured to execute an interface automation test according to the interface request parameters.

[0175] It should be understood that in some feasible implementations, the processor 801 may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The memory 802 may include a read-only memory and a random access memory, and provide instructions and data to the processor 801. A portion of the memory 802 may also include a non-volatile random access memory. For example, the memory 802 may also store information about the device type.

[0176] In a specific implementation, the above terminal device can execute the above-mentioned functions through its built-in functional modules. Figures 1 to 5 For the implementation methods provided in each step, please refer to the implementation methods provided in the above steps for details, which will not be repeated here.

[0177] In an embodiment of the present application, the terminal device can determine the first request parameter template according to the business test request by obtaining the business test request. Obtain the first parameter passed in based on the first application program interface API, and obtain the second parameter passed in through the second API. According to the first parameter and the second parameter, the fields in the first request parameter template and / or the values ​​corresponding to the fields in the first request parameter template are adjusted respectively to generate a new request parameter template. By adopting the embodiment of the present application, the difficulty of template development can be reduced, and the efficiency of interface automation testing can be improved, and the applicability is high.

[0178] The present application also provides a computer-readable storage medium storing a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, Figures 1 to 5 For the data processing methods provided in each step, please refer to the implementation methods provided in the above steps, which will not be repeated here.

[0179] The computer-readable storage medium may be the data processing device provided in any of the aforementioned embodiments or the internal storage unit of the terminal device, such as a hard disk or memory of an electronic device. The computer-readable storage medium may also be an external storage device of the electronic device, such as a plug-in hard disk, a smart memory card (smartmedia card, SMC), a secure digital (secure digital, SD) card, a flash card (flash card), etc. equipped on the electronic device. Further, the computer-readable storage medium may also include both an internal storage unit of the electronic device and an external storage device. The computer-readable storage medium is used to store the computer program and other programs and data required by the electronic device. The computer-readable storage medium may also be used to temporarily store data that has been output or is to be output.

[0180] The terms "first", "second", "third", "fourth", etc. in the claims, specification and drawings of this application are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices.

[0181] Mentioning "embodiment" in this article means that the specific features, structures or characteristics described in conjunction with the embodiment may be included in at least one embodiment of the present application. Displaying the phrase at various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments. The term "and / or" used in the specification of this application and the appended claims refers to any combination of one or more of the items listed in association and all possible combinations, and includes these combinations. It can be appreciated by those of ordinary skill in the art that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to the function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application.

[0182] The method and related apparatus provided by the embodiment of the present application are described with reference to the method flow chart and / or structural diagram provided by the embodiment of the present application. Specifically, each process and / or box in the method flow chart and / or structural diagram, as well as the combination of the processes and / or boxes in the flow chart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the process in the process. Figure 1 A process or multiple processes and / or structures Figure 1 These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing device to work in a specific way, so that the instructions stored in the computer-readable memory produce a product including an instruction device, which implements the functions specified in the process. Figure 1 A process or multiple processes and / or structures Figure 1 These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide for implementing the process in the process. Figure 1 A flow or multiple flows and / or structures illustrate the steps of the functions specified in one block or multiple blocks.

Claims

1. A data processing method, characterized in that: The method comprises: Obtaining a service test request, and determining a first request parameter template according to the service test request, where the first request parameter template is included in at least one request parameter template; Obtaining a first parameter passed in based on a first application programming interface (API), and obtaining a second parameter passed in through a second API, wherein the first parameter is used to add a field to the first request parameter template and / or to modify a value corresponding to a field included in the first request parameter template, and the second parameter is used to delete a field included in the first request parameter template; Determine a first Hash value according to the first parameter and the second parameter, and determine the first Hash value as a template identifier; If it is determined that the at least one request parameter template does not include the request parameter template corresponding to the template identifier, adjusting the fields in the first request parameter template and / or the values ​​corresponding to the fields in the first request parameter template according to the first parameter and the second parameter, respectively, to generate a new request parameter template; The adjusting the fields in the first request parameter template and / or the values ​​corresponding to the fields in the first request parameter template according to the first parameter and the second parameter to generate a new request parameter template includes: adding fields in the first request parameter template and / or modifying the values ​​corresponding to the fields in the first request parameter template according to the first parameter to obtain a second request parameter template; deleting the fields in the second request parameter template and the values ​​corresponding to the fields according to the second parameter to obtain the new request parameter template; The adding of fields in the request parameter template and / or modifying values ​​corresponding to fields in the request parameter template according to the first parameter includes: if it is determined that the first request parameter template includes the first field according to the first field included in the first parameter, modifying the value of the first field included in the first request parameter template to a value corresponding to the first field included in the first parameter; and / or, if it is determined that the first request parameter template does not include the first field according to the first field included in the first parameter, adding the first field and the value corresponding to the first field to the first request parameter template; The deleting the fields in the second request parameter template and the values ​​corresponding to the fields according to the second parameter to obtain the new request parameter template includes: performing field segmentation on the second request parameter template to obtain multiple fields constituting the second request parameter template; matching each of the multiple fields in sequence based on the second field included in the second parameter, and if any field in the multiple fields matches the second field, deleting the second field included in the second request parameter template and deleting the value corresponding to the second field in the second request parameter template to obtain the new request parameter template.

2. The method according to claim 1, characterized in that: The service test request includes a service identifier of the service to be tested; The determining a first request parameter template according to the service test request includes: Determine the service type of the service to be tested according to the service identifier; Acquire at least one request parameter template corresponding to the service type from a request parameter template library; The request parameter template corresponding to the minimum timestamp in the at least one request parameter template is determined as the first request parameter template.

3. The method according to claim 1 or 2, characterized in that: After adjusting the fields in the first request parameter template and / or the values ​​corresponding to the fields in the first request parameter template according to the first parameter and the second parameter to generate a new request parameter template, the method further includes: Acquire business test data, and fill in the values ​​of the various fields included in the business test data into the values ​​corresponding to the corresponding fields included in the new request parameter template in sequence to generate interface request parameters; Execute interface automation testing according to the interface request parameters.

4. A data processing device, characterized in that: The device comprises: A first request parameter template acquisition module, used to acquire a service test request and determine a first request parameter template according to the service test request, wherein the first request parameter template is included in at least one request parameter template; a parameter acquisition module, used to acquire a first parameter passed in based on a first application program interface (API), and to acquire a second parameter passed in through a second API, wherein the first parameter is used to add a field to the first request parameter template and / or to modify a value corresponding to a field included in the first request parameter template, and the second parameter is used to delete a field included in the first request parameter template; a template identification determination module, configured to determine a first Hash value according to the first parameter and the second parameter, and determine the first Hash value as a template identification; a request parameter template updating module, configured to, if it is determined that the at least one request parameter template does not include the request parameter template corresponding to the template identifier, adjust the fields in the first request parameter template and / or the values ​​corresponding to the fields in the first request parameter template according to the first parameter and the second parameter, respectively, so as to generate a new request parameter template; The request parameter template updating module includes: a first processing unit, configured to add fields in the first request parameter template and / or modify values ​​corresponding to fields in the first request parameter template according to the first parameter, so as to obtain a second request parameter template; a second processing unit, configured to delete fields in the second request parameter template and values ​​corresponding to the fields according to the second parameter, so as to obtain the new request parameter template; The first processing unit is configured to: if it is determined that the first request parameter template includes the first field according to the first field included in the first parameter, modify the value of the first field included in the first request parameter template to a value corresponding to the first field included in the first parameter; and / or, if it is determined that the first request parameter template does not include the first field according to the first field included in the first parameter, add the first field and the value corresponding to the first field to the first request parameter template; The second processing unit is used to: perform field segmentation on the second request parameter template to obtain multiple fields constituting the second request parameter template; match each of the multiple fields in sequence based on the second field included in the second parameter, and if any field in the multiple fields matches the second field, delete the second field included in the second request parameter template, and delete the value corresponding to the second field in the second request parameter template to obtain the new request parameter template.

5. A terminal device, characterized in that: It includes a processor, a memory and a transceiver, wherein the processor, the memory and the transceiver are connected to each other; The memory is used to store a computer program, the computer program includes program instructions, and the processor and the transceiver are configured to call the program instructions to execute the method according to any one of claims 1 to 3.

6. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the processor is caused to perform the method according to any one of claims 1 to 3.