Test data generation method and apparatus, program product, and electronic device

By leveraging a distributed search library and custom word segmentation query capabilities, test data is automatically generated, solving the problem of time-consuming and inaccurate manual test data generation by front-end developers. This improves the efficiency and accuracy of test data generation, thereby enhancing development efficiency.

CN122633554APending Publication Date: 2026-08-25HANGZHOU NETEASE CLOUD MUSIC TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510207325.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-24
Publication Date
2026-08-25

AI Technical Summary

Technical Problem

Front-end developers need to manually edit interface response data when building test data, which is time-consuming and may not be comprehensive enough, leading to inaccurate tests and affecting development efficiency.

Method used

By receiving test data generation requests and utilizing historical response object data stored in a distributed search library, test data that meets business requirements is automatically generated. Combined with the custom word segmentation query capabilities of the distributed search engine, test data is generated quickly.

Benefits of technology

It improves the efficiency and accuracy of test data generation, enhances development efficiency, reduces manual intervention, and ensures more comprehensive test data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122633554A_ABST
    Figure CN122633554A_ABST
Patent Text Reader

Abstract

The present disclosure provides a test data generation method, device, program product and electronic equipment, and relates to the technical field of computers. The method comprises: receiving a test data generation request, the test data generation request carrying indication information for indicating a to-be-tested item; generating test data corresponding to the to-be-tested item according to the indication information and a distributed search library; wherein the distributed search library stores data corresponding to historical response objects obtained based on each item request response process. Through the data pre-stored in the distributed search library, the present disclosure can automatically and quickly generate the test data required by the to-be-tested item, thereby improving the generation efficiency of the test data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of this disclosure relate to the field of computer technology, and more specifically, to a test data generation method, a test data generation apparatus, a computer program product, and an electronic device. Background Technology

[0002] Currently, the development of a software or application requires collaboration between front-end and back-end developers.

[0004] Specifically, backend developers first produce a technical solution based on the requirements document, which includes definitions of the calling methods, inputs, and outputs of each interface. Then, frontend developers develop the software based on the interface definitions and requirements document provided by the backend developers. After the initial development of the software or application, frontend developers can perform self-testing by manually building interface responses to verify the logic and presentation of the frontend's dependencies on the server. Finally, the software that has passed frontend verification is then subjected to full-chain integration testing by backend developers in the development environment. Summary of the Invention

[0005] However, in related technologies, front-end developers need to manually edit and construct interface response data based on the interface definitions defined by the back-end developers. Most of the time, front-end developers don't construct complete response data; they often only simulate the fields used in the current development requirements, arbitrarily creating the remaining data based on the defined response field types. This approach not only requires front-end developers to spend a significant amount of time and effort manually constructing test data, but it also may lead to inaccurate testing due to insufficiently comprehensive manually constructed test data.

[0006] In view of this, the present disclosure provides a test data generation method, a test data generation device, a computer program product, and an electronic device to improve the efficiency of test data generation to a certain extent, thereby improving development efficiency and testing efficiency.

[0007] In a first aspect, this disclosure provides a method for generating test data, the method comprising:

[0008] Receive a test data generation request, the test data generation request carrying indication information for indicating the item to be tested;

[0009] Based on the indicated information and the distributed search library, test data corresponding to the project to be tested is generated; wherein, the distributed search library stores data corresponding to historical response objects obtained based on the request-response process of each project.

[0010] In one possible implementation, test data corresponding to the project to be tested is generated based on the instruction information and the distributed search library, including:

[0011] Determine the first interface definition information that matches the indication information;

[0012] Based on the first interface definition information and the distributed search library, test data corresponding to the project to be tested is generated.

[0013] In one possible implementation, test data corresponding to the project to be tested is generated based on the first interface definition information and the distributed search library, including:

[0014] From the distributed search library, search for historical response objects that match the first interface definition information;

[0015] If the historical response object exists in the distributed search library, test data corresponding to the project to be tested is generated based on the data corresponding to the historical response object.

[0016] In one possible implementation, test data corresponding to the project to be tested is generated based on the data corresponding to the historical response objects, including:

[0017] If all fields of the first interface definition information are exactly the same as all fields of the historical response object, then the data corresponding to the historical response object will be used as the test data corresponding to the project to be tested.

[0018] In one possible implementation, test data corresponding to the project to be tested is generated based on the data corresponding to the historical response objects, including:

[0019] If all fields of the first interface definition information are the same as some fields of the historical response object, then the historical response object and the first interface definition object are traversed, and the field data with the same path is filled into the corresponding path in the preset test data to generate the test data corresponding to the project to be tested.

[0020] In one possible implementation, test data corresponding to the project to be tested is generated based on the data corresponding to the historical response objects, including:

[0021] If some fields of the first interface definition information are the same as all fields of the historical response object, then traverse the historical response object and the first interface definition object, fill the field data with the same path into the corresponding path in the preset test data, and obtain the initial test data.

[0022] The first field within the first interface definition information is determined, and the field response result matching the first field is searched in the distributed search library to obtain the first field response result; wherein, the first field is a field within the first interface definition information other than the field that is the same as all fields of the historical response object;

[0023] Based on the response result of the first field and the initial test data, test data corresponding to the item to be tested is generated.

[0024] In one possible implementation, the method further includes:

[0025] If the historical response object does not exist in the distributed search library, then traverse the first interface definition information to obtain the field requirement information of the first interface definition information;

[0026] From the distributed search library, find the field response results that match each field included in the field requirement information to obtain the second field response result;

[0027] The response result of the second field is used as the test data corresponding to the project to be tested.

[0028] In one possible implementation, the second field response result is obtained by searching the distributed search library for field response results that match each field included in the field requirement information, including:

[0029] Perform the following operations on each field included in the field requirement information:

[0030] The field names are split according to camelCase rules to obtain multiple minimal words;

[0031] For each of the minimum words, a relevance search is performed in the distributed search library to obtain multiple matching values ​​corresponding to each of the minimum words;

[0032] The field response result of the field matching is determined based on the response data corresponding to the maximum value among the multiple matching values ​​corresponding to each minimum word.

[0033] In one possible implementation, the distributed search library is constructed based on the following:

[0034] Obtain traffic data for at least one interface in a preset environment within a preset time period;

[0035] The traffic data of at least one interface is cleaned to obtain a candidate interface traffic dataset;

[0036] For each response result in the candidate interface traffic dataset, the data exchange format is traversed to obtain the data of the data exchange format object and the data of a single field corresponding to each response result;

[0037] The data exchange format object corresponding to each of the response results is stored in the distributed search library, and the data of the single field is stored in the distributed search library.

[0038] In one possible implementation, acquiring traffic data from at least one interface of a preset environment within a preset time period includes:

[0039] Obtain at least one sampling and recording processing result, wherein the at least one sampling and recording processing result is obtained by sampling and recording at least one business request processing process generated in a preset environment within a preset time period;

[0040] Based on the sampling and recording processing results, the at least one interface traffic data is obtained.

[0041] Secondly, this disclosure provides a test data generation apparatus, the apparatus comprising:

[0042] A receiving unit is configured to receive a test data generation request, wherein the test data generation request carries indication information for indicating the item to be tested;

[0043] The generation unit is used to generate test data corresponding to the project to be tested based on the instruction information and the distributed search library; wherein, the distributed search library stores data corresponding to historical response objects obtained based on the request-response process of each project.

[0044] In one possible implementation, the generating unit is specifically used for:

[0045] Determine the first interface definition information that matches the indication information;

[0046] Based on the first interface definition information and the distributed search library, test data corresponding to the project to be tested is generated.

[0047] In one possible implementation, the generating unit is specifically used for:

[0048] From the distributed search library, search for historical response objects that match the first interface definition information;

[0049] If the historical response object exists in the distributed search library, test data corresponding to the project to be tested is generated based on the data corresponding to the historical response object.

[0050] In one possible implementation, the generating unit is specifically used for:

[0051] If all fields of the first interface definition information are exactly the same as all fields of the historical response object, then the data corresponding to the historical response object will be used as the test data corresponding to the project to be tested.

[0052] In one possible implementation, the generating unit is specifically used for:

[0053] If all fields of the first interface definition information are the same as some fields of the historical response object, then the historical response object and the first interface definition object are traversed, and the field data with the same path is filled into the corresponding path in the preset test data to generate the test data corresponding to the project to be tested.

[0054] In one possible implementation, the generating unit is specifically used for:

[0055] If some fields of the first interface definition information are the same as all fields of the historical response object, then traverse the historical response object and the first interface definition object, fill the field data with the same path into the corresponding path in the preset test data, and obtain the initial test data.

[0056] The first field within the first interface definition information is determined, and the field response result matching the first field is searched in the distributed search library to obtain the first field response result; wherein, the first field is a field within the first interface definition information other than the field that is the same as all fields of the historical response object;

[0057] Based on the response result of the first field and the initial test data, test data corresponding to the item to be tested is generated.

[0058] In one possible implementation, the generating unit is specifically used for:

[0059] If the historical response object does not exist in the distributed search library, then traverse the first interface definition information to obtain the field requirement information of the first interface definition information;

[0060] From the distributed search library, find the field response results that match each field included in the field requirement information to obtain the second field response result;

[0061] The response result of the second field is used as the test data corresponding to the project to be tested.

[0062] In one possible implementation, the generating unit is specifically used for:

[0063] Perform the following operations on each field included in the field requirement information:

[0064] The field names are split according to camelCase rules to obtain multiple minimal words;

[0065] For each of the minimum words, a relevance search is performed in the distributed search library to obtain multiple matching values ​​corresponding to each of the minimum words;

[0066] The field response result of the field matching is determined based on the response data corresponding to the maximum value among the multiple matching values ​​corresponding to each minimum word.

[0067] In one possible implementation, the device further includes a building unit for:

[0068] Obtain traffic data for at least one interface in a preset environment within a preset time period;

[0069] The traffic data of at least one interface is cleaned to obtain a candidate interface traffic dataset;

[0070] For each response result in the candidate interface traffic dataset, the data exchange format is traversed to obtain the data of the data exchange format object and the data of a single field corresponding to each response result;

[0071] The data exchange format object corresponding to each of the response results is stored in the distributed search library, and the data of the single field is stored in the distributed search library.

[0072] In one possible implementation, the device further includes a building unit for:

[0073] Obtain at least one sampling and recording processing result, wherein the at least one sampling and recording processing result is obtained by sampling and recording at least one business request processing process generated in a preset environment within a preset time period;

[0074] Based on the sampling and recording processing results, the at least one interface traffic data is obtained.

[0075] According to a third aspect of this disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements the method of the first aspect described above and possible implementations thereof.

[0076] According to a fourth aspect of this disclosure, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to perform the method of the first aspect and possible implementations thereof by executing the executable instructions.

[0077] The technical solution disclosed herein has the following beneficial effects:

[0078] In this embodiment, a test data generation request can be received, carrying indication information for the project to be tested. Then, based on the indication information and a distributed search library, test data corresponding to the project to be tested is generated. The distributed search library stores multiple types of data corresponding to historical response objects obtained from the request-response process of each project. In other words, this disclosure can quickly generate test data that meets the business requirements of the project to be tested by using multiple types of data corresponding to historical response objects obtained from the request-response process of each project—that is, data determined using existing online business traffic data in stable business operations—combined with the custom word segmentation query capability of a distributed search engine. The entire process is automated, requiring no manual intervention. This improves both the efficiency and accuracy of test data generation, thereby enhancing development efficiency.

[0079] Other features and advantages of this disclosure will be set forth in the following description and will be apparent in part from the description or may be learned by practicing the disclosure. The objects and other advantages of this disclosure may be realized and obtained by means of the structures particularly pointed out in the written description, claims, and drawings. Attached Figure Description

[0080] To more clearly illustrate the technical solutions of the embodiments of this disclosure, the accompanying drawings used in the embodiments of this disclosure will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0081] Figure 1 This illustration shows a schematic diagram of an application scenario in this exemplary embodiment;

[0082] Figure 2 A schematic diagram of a test data generation service architecture is shown in this exemplary embodiment;

[0083] Figure 3 This diagram illustrates a mock data flow in this exemplary embodiment.

[0084] Figure 4 A flowchart illustrating a test data generation method in this exemplary embodiment is shown.

[0085] Figure 5 This diagram illustrates a process for handling response results in this exemplary embodiment.

[0086] Figure 6This diagram illustrates a test data generation method in this exemplary embodiment.

[0087] Figure 7 This diagram illustrates the structure of a test data generation apparatus according to this exemplary embodiment.

[0088] Figure 8 A schematic diagram of the structure of an electronic device in this exemplary embodiment is shown. Detailed Implementation

[0089] To make the objectives, technical solutions, and advantages of this disclosure clearer, the technical solutions in the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this disclosure, and not all of them. Based on the embodiments of this disclosure, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this disclosure. Unless otherwise specified, the embodiments and features in the embodiments of this disclosure can be arbitrarily combined with each other. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than that shown here.

[0090] The term "comprising" and any variations thereof in the specification and claims of this disclosure are intended to cover non-exclusive protection. For example, a process, method, system, product, or apparatus that comprises a series of steps or units is not limited to the steps or units listed, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to such process, method, product, or apparatus.

[0091] In this disclosure, there are one or more embodiments; "multiple" refers to two or more. "And / or" describes the relationship between the associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following associated objects are in an "or" relationship. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple.

[0092] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this disclosure are used to distinguish similar objects and are not necessarily used to describe a specific order, sequence, size, or priority. For example, the first interface definition information and the second interface definition information in the embodiments of this disclosure are merely used to distinguish different interface definition information. It should be understood that such data can be interchanged where appropriate so that the embodiments of this disclosure described herein can be implemented in orders other than those illustrated or described herein. The implementation methods described in the following exemplary embodiments do not represent all implementation methods consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.

[0093] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, which are schematic illustrations of this disclosure and are not necessarily drawn to scale. Some block diagrams shown in the drawings may be functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities may be implemented in software, in hardware modules or integrated circuits, or in networks, processors, or microcontrollers. Implementations can be carried out in various forms and should not be construed as limited to the examples set forth herein. The features, structures, or characteristics described in this disclosure can be combined in any suitable manner in one or more implementations. Numerous specific details are provided in the following description to give a thorough description of the embodiments of this disclosure. However, those skilled in the art will recognize that one or more specific details may be omitted when implementing the technical solutions of this disclosure, or other methods, components, devices, steps, etc., may be used to replace one or more specific details. It should be noted that in the embodiments of this disclosure, the collection, dissemination, use, and display of data all comply with relevant national laws and regulations. Invention Overview

[0095] Currently, the development of a software or application requires collaboration between front-end and back-end developers.

[0096] Specifically, backend developers first produce a technical solution based on the requirements document, which includes definitions of the calling methods, inputs, and outputs of each interface. Then, frontend developers develop the software based on the interface definitions and requirements document provided by the backend developers. After the initial development of the software or application, frontend developers can perform self-testing by manually building interface responses to verify the logic and presentation of the frontend's dependencies on the server. Finally, the software that has passed frontend verification is then subjected to full-chain integration testing by backend developers in the development environment.

[0097] Alternatively, front-end developers can manually edit and construct interface response data based on the interface definition provided by back-end developers. However, since front-end developers typically don't construct complete response data, they only manually edit and construct the fields they currently use, leaving the remaining data as arbitrary entries based on the defined response field types. This method of constructing test data not only requires front-end developers to spend a significant amount of time and effort, but it may also lead to issues such as incomplete data construction causing problems to go undetected, failing development verification, and preventing deployment.

[0098] Optionally, related technologies also provide a method for generating test data by randomly generating string content as test data. However, this method can only ensure that the field is not empty; it cannot generate corresponding content based on the possible meanings of the field. Even if it barely conforms to the field's defined type, the generated test data may still produce results that are not logical. For example, if a timestamp is required and the field is defined as Long, the randomly generated content may not be a real time point, meaning the generated test data is not logical. Software that passes the test data generated using this method may fail the deployment verification, leading to delays in deployment and reduced development efficiency.

[0099] In view of this, embodiments of this disclosure provide a test data generation method. This method receives a test data generation request, which carries indication information for the project to be tested. Then, based on the indication information and a distributed search library, test data corresponding to the project to be tested is generated. The distributed search library stores multiple types of data corresponding to historical response objects obtained from the request-response process of each project. In other words, this disclosure can quickly generate test data that meets the business requirements of the project to be tested by using multiple types of data corresponding to historical response objects obtained from the request-response process of each project—that is, data determined using existing online business traffic data in stable business operations—combined with the custom word segmentation query capabilities of a distributed search engine. The entire process is automated, requiring no manual intervention. This not only improves the efficiency of test data generation but also enhances the accuracy of the generated test data, thereby improving development efficiency.

[0100] After introducing the basic principles of this disclosure, various non-limiting embodiments of this disclosure will be described in detail below.

[0101] Application Scenarios Overview

[0102] To better understand the technical solutions provided in the embodiments of this disclosure, the following is a brief introduction to the application scenarios applicable to the technical solutions provided in the embodiments of this disclosure. It should be noted that the application scenarios described below are only for illustrating the embodiments of this disclosure and are not intended to limit the scope. In specific implementation, the technical solutions provided in the embodiments of this disclosure can be flexibly applied according to actual needs.

[0103] In this embodiment of the disclosure, the test data generation technology can be applied to business scenarios that require testing new versions of various types of software or applications, or testing new features of various types of software or applications. For example, it can be applied to business scenarios where music software or music apps are updated and new versions are tested, or shopping platforms are updated and new versions are tested, or instant messaging software to be released is tested. This embodiment of the disclosure does not limit the application to these scenarios.

[0104] Please see Figure 1 As shown, Figure 1 This is an application scenario to which the technical solution of the present disclosure embodiment can be applied. The schematic diagram of this scenario includes a terminal device 110 and an electronic device 120. The terminal device 110 can be one or more.

[0105] Front-end developers can use terminal device 110 to develop mobile applications (APP), HyperText Markup Language 5 (HTML5 or H5) applications, cross-platform mobile application development framework (React Native, RN) applications, web applications (World Wide Web), personal computer applications (Personal Computer, PC), and Mac applications (Macintosh). Terminal device 110 can communicate directly or indirectly with electronic device 120 through one or more networks.

[0106] In this embodiment of the disclosure, any object that wishes to generate test data, such as a front-end developer or a back-end developer, can send a test data generation request through a terminal device 110. Then, an electronic device 120 can receive the test data generation request, determine the instruction information carried in the test data generation request to indicate the item to be tested, and then generate test data corresponding to the item to be tested using the instruction information and a distributed search library. The distributed search library stores data corresponding to historical response objects obtained based on the request and response process of each item.

[0107] in, Figure 1The electronic device 120 in the document can also be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server or cloud server cluster that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms, but is not limited to these.

[0108] Figure 1 The terminal device 110 can be a mobile phone, tablet computer (PAD), personal computer, smart TV, smart watch, smart speaker, smart vehicle device, and wearable device, but is not limited to these.

[0109] Of course, the methods provided in this disclosure are not limited to... Figure 1 The application scenarios shown can also be used in other possible application scenarios, and this disclosure does not limit the scope of the embodiments.

[0110] Please see Figure 2 As shown, Figure 2 This is a schematic diagram of a test data generation service architecture to which the technical solutions of the embodiments of this disclosure can be applied. Figure 2 The Mock server in this context can be understood as the aforementioned Figure 1 Electronic device 110 in the test data generation platform is the server. The Mock server can provide two functions: one is response data parsing, and the other is simulation (mock) data generation.

[0111] In this embodiment of the disclosure, the Mock server can trigger a request to the interface definition service to obtain interface definition information. It can then parse the response data based on the interface definition information and store the parsing results in a distributed search library. Figure 2 In this system, the distributed search library includes a relational database (Elastic Search, ES) and an in-memory database (Remote Dictionary Server, Redis). Specifically, the distributed search library can be divided into multiple storage areas to store real interface request information, parsed data, and historical mock data, respectively. In this embodiment, mock data can be understood as test data. The real interface request information can be provided through a gateway or traffic redirection service that performs traffic management.

[0112] In this embodiment of the disclosure, the front-end service can be understood as described above. Figure 1In the terminal device 110, users can implement at least two functions through the front-end service. One function is to initiate a test data generation request. Figure 2 Another function is to initiate mock requests and modify mock data.

[0113] As can be seen, in this embodiment of the disclosure, after the user triggers a test data generation request through the front-end service, the Mockserver can link the interface definition service and the distributed repository to generate the test data requested by the test data generation request.

[0114] For example, please see Figure 3 As shown, Figure 3 This is a schematic diagram illustrating a mock data flow provided in an embodiment of this disclosure. Figure 3 In this system, the gateway and traffic redirection services can sample and store business request data in a distributed repository. The Mockserver can then retrieve this business request data from the distributed search library, parse it, and store the parsed data in the distributed search library. When a user triggers a mock data retrieval request (i.e., a test data generation request) based on the frontend service, the Mock server can retrieve mock data from the distributed search library and return it to the frontend service, thus providing the user with the mock data needed for testing.

[0115] Exemplary methods

[0116] To further illustrate the technical solutions provided by the embodiments of this disclosure, a detailed description is provided below in conjunction with the accompanying drawings and specific implementation methods. Although the embodiments of this disclosure provide method operation steps as shown in the following embodiments or drawings, the method may include more or fewer operation steps based on conventional or non-inventive methods. In steps where there is no logically necessary causal relationship, the execution order of these steps is not limited to the execution order provided by the embodiments of this disclosure. In actual processing or when the device executes the method, it may be executed sequentially or in parallel according to the method shown in the embodiments or drawings.

[0117] Please see Figure 4 , Figure 4 This is a schematic flowchart illustrating a test data generation method according to an embodiment of this disclosure. The method flow can be, for example, carried out by an electronic device, such as... Figure 1 Electronic device 102 or Figure 2 , Figure 3 The specific implementation process of this method, which executes a mock server within the system, is as follows:

[0118] Step 401: Receive a test data generation request. The test data generation request carries instruction information for indicating the items to be tested.

[0119] In this embodiment of the disclosure, developers can log in to the test data generation platform through a terminal to trigger a test data generation request. The electronic device can be understood as the server corresponding to the test data generation platform, and thus the electronic device can receive the test data generation request.

[0120] In this embodiment of the disclosure, the electronic device can determine the instruction information carried in the test data generation request, which indicates the item to be tested. The instruction information may include at least one of the following: server-side project name, code branch, and interface path.

[0121] Step 402: Generate test data corresponding to the project to be tested based on the instruction information and the distributed search library; wherein, the distributed search library stores data corresponding to historical response objects obtained based on the request and response process of each project in multiple categories.

[0122] In this embodiment of the disclosure, the electronic device can determine the first interface definition information that matches the instruction information by linking the interface definition service according to the server project name, code branch and interface path included in the instruction information. The first interface definition information includes the interface response structure, the definition of each field and the range of enumeration types, etc.

[0123] In this embodiment of the disclosure, before introducing the generation of test data corresponding to the project to be tested, the construction process of the distributed search library will be introduced first.

[0124] Step A: Obtain traffic data for at least one interface in a preset environment within a preset time period.

[0125] In this embodiment, a preset time period and preset environment can be determined based on a pre-set timed task for acquiring historical response object data. For example, assuming the timed task is to acquire interface pipeline data from the production environment every 5 minutes for processing to obtain historical response object data, the preset period (5 minutes) and the current time can be determined, and the production environment can be used as the preset environment. Optionally, the preset environment can be any one of the development environment, testing environment, and production environment; this embodiment does not limit this.

[0126] In this embodiment of the disclosure, at least one business request processing process generated in a preset environment within a preset time period can be sampled and recorded to obtain at least one sampling and recording processing result, and then at least one interface traffic data can be obtained based on the at least one sampling and recording processing result.

[0127] Specifically, gateway services and traffic redirection services that manage traffic can sample and record test and real online business requests to obtain recorded interface request information. This information can then be stored in Elasticsearch (ES) or Redis. Electronic devices can then obtain at least one sampled recording result from the distributed search library and parse it to obtain at least one interface traffic data.

[0128] Optionally, the interface request information includes at least one of requestBody, method, responseBody, responseCode, URL, and serverName.

[0129] In this context, the request body refers to the data sent to the server in a Hypertext Transfer Protocol (HTTP) request. In web development, when a client sends a POST, PUT, or PATCH request, it typically sends data as part of the request to the server. This data is usually sent in the form of JSON, XML, or form data. The server extracts this data from the request and processes it accordingly. This data constitutes the aforementioned request body.

[0130] Here, "method" can be understood as the type of action the client takes when making a request to the server. Common HTTP methods include GET, POST, PUT, and DELETE. Simply put, these correspond to the four actions of querying, adding, modifying, and deleting, respectively.

[0131] The responseBody refers to the data portion contained in the server's response. When a client sends a request to the server, the server returns data included in the response; this data constitutes the responseBody.

[0132] The responseCode refers to the status code used by the server in response to a client request. This status code can be used to inform the client of the processing result of the request, such as success, redirection, client error, or server error.

[0133] Here, URL refers to the interface path, that is, the path used to access a specific network interface.

[0134] Here, serverName refers to the name used to identify a specific project or application in the web server, such as the server-side project name.

[0135] Step B: Clean the traffic data of at least one interface to obtain a candidate interface traffic dataset.

[0136] In this embodiment of the disclosure, traffic data of all interfaces in a preset environment within a preset time period can be obtained. The obtained traffic data of all interfaces can be organized into an interface traffic data list. The interface traffic data list can be cleaned by traversing the entire traffic data list to filter out abnormal requests and data lists that do not return interface responses, thereby obtaining a candidate interface traffic data list.

[0137] Step C: Iterate through the data exchange format of each response result in the candidate interface traffic dataset, and obtain the data of the data exchange format object and the data of a single field corresponding to each response result;

[0138] Step D: Store the data exchange format object corresponding to each response result in the distributed search library, and store the data of a single field in the distributed search library.

[0139] In this embodiment, each response result within the candidate interface traffic dataset can be traversed using JSON to obtain all contained JSON objects and individual fields, and then stored separately. It should be noted that all data, regardless of fields or JSON objects, can be associated with the corresponding server-side project and interface path.

[0140] For example, see Figure 5 As shown, Figure 5 This diagram illustrates a data exchange format traversal of a response result provided in an embodiment of this disclosure. Specifically, the JSON object obtained by traversing the response result can be stored, for example, as... Figure 5 The responseBody, body, and data JSON objects are stored separately. The response results can also be iterated down to the smallest field and the result of that field is stored. For example, ... Figure 5 The code, message, targetAmount, and marketCode fields are used for storage.

[0141] As can be seen, in this embodiment, traffic data can be processed through a scheduled task to obtain historical response data stored in the distributed search library. Specifically, when the scheduled task is triggered, the Mock Server can obtain interface information, responseCode, and responseBody within a specified time range and environment from the distributed search library, and then filter out erroneous requests and unresponsive interfaces to obtain a candidate interface traffic dataset. Further, the Mock Server can obtain detailed interface request data from the distributed search library: responseBody, serverName, and method, and then iterate through the responses to obtain the values ​​of each field and the object value, thereby storing the data exchange format object corresponding to each response result in the distributed search library, and storing the data of a single field in the distributed search library.

[0142] In this embodiment of the disclosure, after introducing the construction method of the distributed search library, the specific scheme for generating test data is described below.

[0143] In this embodiment of the disclosure, the electronic device can first determine the first interface definition information that matches the indication information; then, based on the first interface definition information and the distributed search library, it can generate test data corresponding to the item to be tested.

[0144] In this embodiment of the disclosure, the electronic device can search for historical response objects that match the first interface definition information from a distributed search library.

[0145] Optionally, if historical response objects exist in the distributed search library, test data corresponding to the project to be tested can be generated based on the data corresponding to the historical response objects.

[0146] In one possible implementation, if all fields of the first interface definition information are exactly the same as all fields of the historical response object, then the data corresponding to the historical response object is used as the test data corresponding to the project to be tested.

[0147] In other words, if all fields of the first interface definition information completely match all fields of the historical response object, that is, if the interface definition determined by the instruction information indicating the project to be tested is the same as the original interface definition, that is, if the first interface requested has not been modified at the definition level compared to the original interface, then the test data generation server, i.e., the electronic device, can use the data corresponding to the historical response object as the test data corresponding to the project to be tested.

[0148] In one possible implementation, if all fields of the first interface definition information are the same as some fields of the historical response object, then the historical response object and the first interface definition object are traversed, and the field data with the same path is filled into the corresponding path in the preset test data to generate the test data corresponding to the project to be tested.

[0149] For example, an electronic device can match the fields defined in the first interface definition with the fields of historical response objects. This allows it to determine that, due to business adjustments, the marketCode field has been removed from the response structure of the first interface definition. Based on the historical response object data stored in the distributed search library, which includes targetAmount, marketCode, and {"targetAmount":xx", "marketCode":xx}, the electronic device can determine that the test data corresponding to the first interface definition, i.e., the new response data, is {"targetAmount":xx}. In other words, the electronic device can use mock data of the targetAmount field as the test data for the item under test.

[0150] In one possible implementation, if some fields of the first interface definition information are the same as all fields of the historical response object, then the historical response object and the first interface definition object are traversed, and the field data with the same path is filled into the corresponding path in the preset test data to obtain the initial test data; the first field in the first interface definition information is determined, and the field response result matching the first field is searched in the distributed search library to obtain the first field response result; wherein, the first field is the field in the first interface definition information other than the field that is the same as all fields of the historical response object; based on the first field response result and the initial test data, the test data corresponding to the project to be tested is generated.

[0151] In other words, the electronic device can compare the fields defined in the first interface definition information with the fields of the historical response object to determine whether there are changes or additions to the fields in the first interface compared to its corresponding original interface. This results in some fields in the first interface definition information being the same as all fields in the historical response object. In this way, the response data included in the historical response object, i.e., the aforementioned initial test data, can be used as part of the test data corresponding to the item to be tested. Then, the test data for the other parts corresponding to the item to be tested can be determined, thereby finally determining the test data corresponding to the item to be tested.

[0152] For example, the original interface response result corresponding to the first interface is returned as {"targetAmount":xx","marketCode":xx}, and the electronic device can determine that the first interface requires the three fields balanceAmount, targetAmount and marketCode based on the various fields defined in the first interface definition information.

[0153] Specifically, the `targetAmount` and `marketCode` fields can be directly retrieved from the distributed search library using data stored in online traffic, i.e., `{"targetAmount":xx", "marketCode":xx}`. Therefore, electronic devices can use `{"targetAmount":xx", "marketCode":xx}` as initial test data. However, the `balanceAmount` field does not exist in the historical response objects. Therefore, it requires word segmentation search to match historical fields with similar names to obtain the corresponding mock data.

[0154] Optionally, if the distributed repository can retrieve another interface under the historical project corresponding to the project to be tested, for example, if the historical response object corresponding to interface b has a field of balanceAmount, then the data of the field of the historical response object corresponding to interface b, i.e., {balanceAmount”bb}, can be obtained as the first field response result.

[0155] Optionally, if the distributed repository does not find a historical response object with the field "balanceAmount" corresponding to another interface under the historical project corresponding to the project under test, random data is generated through the type defined by the field (e.g., long, string, int, etc.), so that the response result of the first field can be obtained as {balanceAmount"bb}.

[0156] Once the initial test data and the response result of the first field are determined, the electronic device can determine the test data corresponding to the item to be tested as: {"targetAmount":xx","marketCode":xx","balanceAmount"bb}.

[0157] For example, the original interface response to the first interface might return {"targetAmount":xx","marketCode":xx}. The electronic device can compare the fields defined in the first interface definition with those in the original interface to determine if a business change has occurred, specifically a change from the targetAmount field to balanceAmount. Therefore, {"marketCode":xx} can be used as initial test data.

[0158] Since the `balanceAmount` field does not exist in the historical response object corresponding to the first interface, we can use word segmentation search to match historical fields with similar meanings to `balanceAmount`, and obtain the mock data corresponding to the historical field as the first field response result. Specifically, if the distributed repository can retrieve the historical response object of another interface X under the historical project corresponding to the project under test, which contains the `balanceAmount` field, then the data of that field, i.e., `{balanceAmount":xx}`, can be obtained as mock data as the first field response result. If the distributed repository does not retrieve the historical response object of another interface under the historical project corresponding to the project under test, which contains the `balanceAmount` field, then random data is generated based on the field's defined type (e.g., long, string, int, etc.), thus determining that the first field response result is `{"balanceAmount":xx}`.

[0159] Once the initial test data and the response result of the first field are determined, the electronic device can determine the test data corresponding to the item to be tested as: {"balanceAmount":xx", "marketCode":xx}.

[0160] Optionally, if no historical response object exists in the distributed search library, the first interface definition information is traversed to obtain the field requirement information of the first interface definition information; the field response results that match each field included in the field requirement information are searched in the distributed search library to obtain the second field response results; the second field response results are used as the test data corresponding to the project to be tested.

[0161] For example, if the distributed search library does not contain a historical response object, the electronic device can determine that the interface does not exist online. In other words, a business change has added the first interface. Thus, the electronic device can determine that the required field information for the first interface is: the test data includes the fields `targetAmount` and `marketCode`.

[0162] Since the distributed search library does not contain any historical response objects that match the first interface, it is possible to iterate through the distributed search library and search for each field in the targetAmount and marketCode fields by matching the field names to see if another interface exists for that field in the historical project corresponding to the project under the test. If it does, the mock data of that field from the other interface is used as the response result for that field. If not, it is randomly generated according to the type defined in the field definition (e.g., long, string, int, etc.), thus determining the response result of the second field as {"targetAmount":xx","marketCode":xx}.

[0163] In this embodiment of the disclosure, the following operations can be performed on each field included in the field requirement information: split the field name of the field according to the camelCase rule to obtain multiple minimum words; perform a relevance search on each minimum word in the distributed search library to obtain multiple matching values ​​corresponding to each minimum word; and determine the field response result of the field matching based on the response data corresponding to the maximum value among the multiple matching values ​​corresponding to each minimum word.

[0164] Specifically, field names are split into camelCase rules down to the smallest words. Relevance searches are then performed using these smallest words. If a field name in another historical response object in the distributed repository contains the smallest word obtained from this splitting, and the service project name and field type of that other historical response object match the indication information, then a successful match is determined. When multiple other historical response objects match successfully, the higher the word matching degree, the higher the ranking of the other historical response objects. The data of the field corresponding to the highest-ranked historical response object is then used as the field response result for field matching.

[0165] For example, assuming the field name is targetAmount, the field name can be split into "target" and "amount". Then, "target" and "amount" are matched with the field names of other historical response objects in the distributed repository. If the field name of other historical response objects in the distributed repository contains one of the above fields, and the service project name and field type of the other historical response objects are consistent with the indication information, then the match is successful. The field response result of the field matching can be determined based on the data corresponding to the fields of other historical response objects.

[0166] As can be seen, in this embodiment of the disclosure, based on existing real online data of stable business and the word segmentation and search capabilities of Elasticsearch, mock data that is more in line with actual business needs and field meanings can be automatically generated through response parsing and JSON generation, thereby improving the efficiency of development and testing.

[0167] For example, see Figure 6 As shown, Figure 6 This is a schematic diagram illustrating test data generation in one embodiment of this disclosure. In this embodiment, the Mock server can receive test data generation requests sent by the front-end service, i.e. Figure 6 The front-end service in the middle initiates a "mock request" to the Mock server. This request carries indication information, including the server-side project name (i.e., Figure 6 "serverName" in the code (i.e., code branch) Figure 6 "branch" in the text), interface path (i.e. Figure 6 (path in the code). Then, the Mock server can send a request to the interface definition service to obtain the interface definition based on the instruction information, and thus obtain the definition information of the first interface from the interface definition service.

[0168] In this embodiment, the Mock server can obtain historical interface responseBody results from a distributed search library, that is, search for historical response objects that match the first interface definition information in the distributed search library. Then, based on the matching situation between the first interface definition information and the historical response objects, the Mock server can determine whether to perform a custom matching operation to obtain the response result of the highest matching field, and / or to randomly generate the field response result by the field definition type, thereby ultimately determining the mock data as the test data of the project to be tested, and feeding the test data back to the front-end service.

[0169] Exemplary device

[0170] Exemplary embodiments of this disclosure also provide a test data generation apparatus. (See reference...) Figure 7 As shown, the test data generation device 700 includes the following program units:

[0171] The receiving unit 701 is used to receive a test data generation request, wherein the test data generation request carries indication information for indicating the item to be tested;

[0172] The generation unit 702 is used to generate test data corresponding to the project to be tested based on the instruction information and the distributed search library; wherein, the distributed search library stores data corresponding to historical response objects obtained based on the request-response process of each project.

[0173] In one possible implementation, the generation unit 702 is specifically used for:

[0174] Determine the first interface definition information that matches the indication information;

[0175] Based on the first interface definition information and the distributed search library, test data corresponding to the project to be tested is generated.

[0176] In one possible implementation, the generation unit 702 is specifically used for:

[0177] From the distributed search library, search for historical response objects that match the first interface definition information;

[0178] If the historical response object exists in the distributed search library, test data corresponding to the project to be tested is generated based on the data corresponding to the historical response object.

[0179] In one possible implementation, the generation unit 702 is specifically used for:

[0180] If all fields of the first interface definition information are exactly the same as all fields of the historical response object, then the data corresponding to the historical response object will be used as the test data corresponding to the project to be tested.

[0181] In one possible implementation, the generation unit 702 is specifically used for:

[0182] If all fields of the first interface definition information are the same as some fields of the historical response object, then the historical response object and the first interface definition object are traversed, and the field data with the same path is filled into the corresponding path in the preset test data to generate the test data corresponding to the project to be tested.

[0183] In one possible implementation, the generation unit 702 is specifically used for:

[0184] If some fields of the first interface definition information are the same as all fields of the historical response object, then traverse the historical response object and the first interface definition object, fill the field data with the same path into the corresponding path in the preset test data, and obtain the initial test data.

[0185] The first field within the first interface definition information is determined, and the field response result matching the first field is searched in the distributed search library to obtain the first field response result; wherein, the first field is a field within the first interface definition information other than the field that is the same as all fields of the historical response object;

[0186] Based on the response result of the first field and the initial test data, test data corresponding to the item to be tested is generated.

[0187] In one possible implementation, the generation unit 702 is specifically used for:

[0188] If the historical response object does not exist in the distributed search library, then traverse the first interface definition information to obtain the field requirement information of the first interface definition information;

[0189] From the distributed search library, find the field response results that match each field included in the field requirement information to obtain the second field response result;

[0190] The response result of the second field is used as the test data corresponding to the project to be tested.

[0191] In one possible implementation, the generation unit 702 is specifically used for:

[0192] Perform the following operations on each field included in the field requirement information:

[0193] The field names are split according to camelCase rules to obtain multiple minimal words;

[0194] For each of the minimum words, a relevance search is performed in the distributed search library to obtain multiple matching values ​​corresponding to each of the minimum words;

[0195] The field response result of the field matching is determined based on the response data corresponding to the maximum value among the multiple matching values ​​corresponding to each minimum word.

[0196] In one possible implementation, the device further includes a building unit for:

[0197] Obtain traffic data for at least one interface in a preset environment within a preset time period;

[0198] The traffic data of at least one interface is cleaned to obtain a candidate interface traffic dataset;

[0199] For each response result in the candidate interface traffic dataset, the data exchange format is traversed to obtain the data of the data exchange format object and the data of a single field corresponding to each response result;

[0200] The data exchange format object corresponding to each of the response results is stored in the distributed search library, and the data of the single field is stored in the distributed search library.

[0201] In one possible implementation, the device further includes a building unit for:

[0202] Obtain at least one sampling and recording processing result, wherein the at least one sampling and recording processing result is obtained by sampling and recording at least one business request processing process generated in a preset environment within a preset time period;

[0203] Based on the sampling and recording processing results, the at least one interface traffic data is obtained.

[0204] The specific details of each part of the above-mentioned device have been described in detail in the method section of the implementation plan. For any undisclosed details, please refer to the implementation plan of the method section, and therefore will not be repeated here.

[0205] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to exemplary embodiments of this disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.

[0206] Exemplary program product

[0207] Exemplary embodiments of this disclosure also provide a computer program product. The computer program product includes a computer program that, when executed by a processor, implements the above-described test data generation method.

[0208] In one embodiment, the computer program product can be a tangible product containing a computer program, such as a computer-readable storage medium storing the computer program. The readable storage medium can be a storage medium based on electrical, magnetic, optical, electromagnetic, infrared, or other signals, including but not limited to: random access memory (RAM), read-only memory (ROM), magnetic tape, floppy disk, flash memory, hard disk drive (HDD), solid-state drive (SSD), etc. For example, the computer program product can be implemented as a non-volatile storage medium storing the computer program, such as read-only memory, NAND flash memory, etc.

[0209] In one implementation, the computer program product can be an intangible product containing a computer program. For example, the computer program product can be implemented as a virtual digital product, such as an executable file, installation package, or other digital file storing the computer program.

[0210] Computer program code can be written in one or more programming languages. Examples of programming languages ​​include C, Java, and C++. Program code can execute entirely on the user's computing device, partially on the user's computing device, or as a standalone software package. It can also execute partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, such as a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via an internet connection provided by a mobile network operator).

[0211] Computer programs can be carried or transmitted via signals such as electricity, magnetism, light, electromagnetic radiation, and infrared rays. Electronic devices can convert signals carrying computer programs into digital signals, thereby running the computer programs. When a computer program runs on an electronic device, its code causes the electronic device to execute (more specifically, its processor) the method steps of various exemplary embodiments of this disclosure, such as the test data generation method described above, which includes the following steps:

[0212] Step 401: Receive a test data generation request, which carries instruction information for the project to be tested. Step 402: Generate test data corresponding to the project to be tested based on the instruction information and the distributed search library; wherein, the distributed search library stores data corresponding to historical response objects obtained based on the request-response process of each project.

[0213] By implementing the above method steps through a computer program, a test data generation request can be received. This request carries instruction information indicating the item to be tested. Then, based on the instruction information and a distributed search library, test data corresponding to the item to be tested is generated. The distributed search library stores multiple types of data corresponding to historical response objects obtained from the request-response process of each item. In other words, this disclosure can quickly generate test data that meets the business requirements of the item to be tested by using multiple types of data corresponding to historical response objects obtained from the request-response process of each item—that is, data determined using existing online business traffic data in stable business operations—combined with the custom word segmentation and query capabilities of a distributed search engine. The entire process is automated, requiring no manual intervention. This improves both the efficiency and accuracy of test data generation, thereby enhancing development efficiency.

[0214] Exemplary electronic devices

[0215] Exemplary embodiments of this disclosure also provide an electronic device. The electronic device may include a processor and a memory. The memory stores executable instructions for the processor, such as computer programs. The processor executes these executable instructions to perform the method steps of various exemplary embodiments of this disclosure.

[0216] The following is for reference. Figure 8 The electronic device is illustrated by way of a general-purpose computing device. It should be understood that... Figure 8 The electronic device 800 shown is merely an example and should not be construed as limiting the functionality and scope of use of the embodiments disclosed herein.

[0217] like Figure 8 As shown, the electronic device 800 may include: a processor 810, a memory 820, a bus 830, an I / O (input / output) interface 840, and a network adapter 850.

[0218] Memory 820 may include volatile memory, such as RAM 821 and cache unit 822, and may also include non-volatile memory, such as ROM 823. Memory 820 may also include one or more program modules 824, such program modules 828 including but not limited to: operating system, one or more application programs, other program modules, and program data, each or some combination of these examples may include an implementation of a network environment. For example, program module 824 may include the units in the above-described device.

[0219] The processor 810 may include one or more processing units, such as an AP (Application Processor), a modem processor, a GPU (Graphics Processing Unit), an ISP (Image Signal Processor), a controller, an encoder, a decoder, a DSP (Digital Signal Processor), a baseband processor, and / or an NPU (Neural-Network Processing Unit).

[0220] The processor 810 can be used to execute executable instructions stored in the memory 820, such as the test data generation method described above, which includes the following steps: Step 401: Receive a test data generation request, the test data generation request carrying instruction information for indicating the item to be tested. Step 402: Generate test data corresponding to the item to be tested based on the instruction information and a distributed search library; wherein, the distributed search library stores data corresponding to historical response objects obtained based on the request-response process of each item in multiple categories.

[0221] By executing the above method steps through processor 810, a test data generation request can be received. This request carries instruction information indicating the item to be tested. Then, based on the instruction information and a distributed search library, test data corresponding to the item to be tested is generated. The distributed search library stores multiple types of data corresponding to historical response objects obtained from the request-response process of each item. In other words, this disclosure can quickly generate test data that meets the business requirements of the item to be tested by combining multiple types of data corresponding to historical response objects obtained from the request-response process of each item—that is, data determined using existing online business traffic data in stable business operations—with the custom word segmentation query capability of a distributed search engine. The entire process is automated, requiring no manual intervention. This not only improves the efficiency of test data generation but also enhances the accuracy of the generated test data, thereby improving development efficiency.

[0222] Bus 830 is used to connect different components of electronic device 800 and may include data bus, address bus and control bus.

[0223] Electronic device 800 can communicate with one or more external devices 900 (such as keyboard, mouse, external controller, etc.) through I / O interface 840.

[0224] Electronic device 800 can communicate with one or more networks via network adapter 850. For example, network adapter 850 can provide mobile communication solutions such as 3G / 4G / 5G, or wireless communication solutions such as wireless LAN, Bluetooth, and near-field communication. Network adapter 850 can communicate with other modules of electronic device 800 via bus 830.

[0225] although Figure 8 As not shown in the diagram, other hardware and / or software modules may also be configured in the electronic device 800, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0226] As can be seen from the above, the technical solutions disclosed herein can be implemented as methods, apparatus, systems, computer program products, storage media, electronic devices, etc. Those skilled in the art will understand that various aspects of this disclosure can be specifically implemented in the following forms: a completely hardware implementation, a completely software implementation (including firmware, microcode, etc.), or a combination of hardware and software implementations, which may be referred to as "circuit," "module," or "system," respectively.

[0227] It should be understood that this disclosure is not limited to the specific methods, steps, or structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. Those skilled in the art will readily conceive of other embodiments based on the specific implementations provided in this disclosure. Therefore, the specific implementations provided in this disclosure are merely exemplary, and the scope and spirit of this disclosure are indicated by the claims, and should cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary technical means in the art not disclosed in this disclosure.

Claims

1. A method for generating test data, characterized in that, The method includes: Receive a test data generation request, the test data generation request carrying indication information for indicating the item to be tested; Based on the indicated information and the distributed search library, test data corresponding to the project to be tested is generated; wherein, the distributed search library stores data corresponding to historical response objects obtained based on the request-response process of each project.

2. The method according to claim 1, characterized in that, Based on the indicated information and the distributed search library, test data corresponding to the project to be tested is generated, including: Determine the first interface definition information that matches the indication information; Based on the first interface definition information and the distributed search library, test data corresponding to the project to be tested is generated.

3. The method according to claim 2, characterized in that, Based on the first interface definition information and the distributed search library, test data corresponding to the project to be tested is generated, including: From the distributed search library, search for historical response objects that match the first interface definition information; If the historical response object exists in the distributed search library, test data corresponding to the project to be tested is generated based on the data corresponding to the historical response object.

4. The method according to claim 3, characterized in that, Based on the data corresponding to the historical response objects, test data corresponding to the project to be tested is generated, including: If all fields of the first interface definition information are exactly the same as all fields of the historical response object, then the data corresponding to the historical response object will be used as the test data corresponding to the project to be tested.

5. The method according to claim 3, characterized in that, Based on the data corresponding to the historical response objects, test data corresponding to the project to be tested is generated, including: If all fields of the first interface definition information are the same as some fields of the historical response object, then the historical response object and the first interface definition object are traversed, and the field data with the same path is filled into the corresponding path in the preset test data to generate the test data corresponding to the project to be tested.

6. The method according to claim 3, characterized in that, Based on the data corresponding to the historical response objects, test data corresponding to the project to be tested is generated, including: If some fields of the first interface definition information are the same as all fields of the historical response object, then traverse the historical response object and the first interface definition object, fill the field data with the same path into the corresponding path in the preset test data, and obtain the initial test data; The first field within the first interface definition information is determined, and the field response result matching the first field is searched in the distributed search library to obtain the first field response result; wherein, the first field is a field within the first interface definition information other than the field that is the same as all fields of the historical response object; Based on the response result of the first field and the initial test data, test data corresponding to the item to be tested is generated.

7. The method according to claim 3, characterized in that, The method further includes: If the historical response object does not exist in the distributed search library, then traverse the first interface definition information to obtain the field requirement information of the first interface definition information; From the distributed search library, find the field response results that match each field included in the field requirement information to obtain the second field response result; The response result of the second field is used as the test data corresponding to the project to be tested.

8. A test data generation device, characterized in that, The device includes: A receiving unit is configured to receive a test data generation request, wherein the test data generation request carries indication information for indicating the item to be tested; The generation unit is used to generate test data corresponding to the project to be tested based on the instruction information and the distributed search library; wherein, the distributed search library stores data corresponding to historical response objects obtained based on the request-response process of each project.

9. An electronic device, characterized in that, include: processor; Memory for storing the executable instructions of the processor; The processor is configured to perform the method of any one of claims 1-7 by executing the executable instructions.

10. A computer program product storing a computer program thereon, characterized in that, When the computer program is executed by a processor, it implements the method described in any one of claims 1-7.