Test data generation method and apparatus

By setting up a data pipeline in software testing and utilizing query data retrieval, transaction data generation, and rule-based data generation components, test data can be generated automatically, solving the problem of time-consuming and inefficient test data generation and achieving efficient test data generation.

CN115658485BActive Publication Date: 2026-07-07CHINA CONSTRUCTION BANK +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHINA CONSTRUCTION BANK
Filing Date
2022-10-17
Publication Date
2026-07-07

AI Technical Summary

Technical Problem

In the software testing process, generating test data is time-consuming and inefficient, affecting test coverage and product delivery quality.

Method used

By setting up multiple data pipelines, arranging service interfaces and execution order according to business scenarios or testing needs, and using query data retrieval, transaction data generation, and rule data generation components to generate test data, the automation and flexible connection of data pipelines can be achieved.

Benefits of technology

It reduces the time required to generate test data, improves the efficiency of test data generation, and is applicable to various business scenarios to meet different testing needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115658485B_ABST
    Figure CN115658485B_ABST
Patent Text Reader

Abstract

The application discloses a kind of test data generation method and device, it is related to software testing technical field.The specific embodiment of the method includes: receiving test data generation request;The target pipeline corresponding to the test data generation request is obtained, the target pipeline includes at least one target service interface, the target service interface is one-to-one corresponding with target processing element;The execution order of each target service interface in the target pipeline is obtained;According to the execution order, the target processing element corresponding to each target service interface is sequentially called to generate the test data corresponding to the test data generation request.The embodiment can reduce the time required to generate test data and is relatively efficient.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of software testing technology, and in particular to a method and apparatus for generating test data. Background Technology

[0002] Testers need to use test data during functional testing, automated testing, and non-functional testing. Throughout the software testing lifecycle, to improve test coverage and ensure product delivery quality, test data needs to be generated for various scenarios. This data is then used to comprehensively test the system. Testers typically spend a significant amount of time querying and generating test data. The process of generating test data is usually very time-consuming and inefficient. Summary of the Invention

[0003] In view of this, embodiments of the present invention provide a test data generation method and apparatus that can reduce the time required to generate test data and are highly efficient.

[0004] In a first aspect, embodiments of the present invention provide a test data generation method, comprising:

[0005] Receive test data generation request;

[0006] Based on the test data, a request information is generated to obtain the target pipeline corresponding to the test data generation request. The target pipeline includes at least one target service interface, and the target service interface corresponds one-to-one with a target processing element.

[0007] Obtain the execution order of each target service interface in the target pipeline;

[0008] According to the execution order, the target processing elements corresponding to each target service interface are called sequentially to generate the test data corresponding to the test data generation request.

[0009] Optionally, the test data generation request may further include: input parameters;

[0010] The step of sequentially invoking the target processing elements corresponding to each target service interface according to the execution order to generate the test data corresponding to the test data generation request includes:

[0011] From the target processing elements corresponding to each of the target service interfaces, a first element with a first execution order is determined, the input parameters are passed to the first element, and the output data of the first element is obtained;

[0012] From the remaining target processing elements, determine the second element with the second execution order, pass the output data of the first element to the second element, and obtain the output data of the second element;

[0013] This process continues until all target processing elements have been invoked.

[0014] Optionally, the target pipeline further includes: input parameter setting conditions corresponding to each of the target processing elements;

[0015] The step of sequentially invoking the target processing elements corresponding to each target service interface according to the execution order to generate the test data corresponding to the test data generation request includes:

[0016] From the target processing elements corresponding to each of the target service interfaces, determine and call the first element with the first execution order, and obtain the first output data of the first element;

[0017] From the remaining target processing elements, determine the second element with the second execution order; determine the input parameter setting conditions corresponding to the second element, and use the input parameter setting conditions to process the first output data to obtain the second input data; pass the second input data to the second element, and obtain the second output data of the second element;

[0018] This process continues until all target processing elements have been invoked.

[0019] Optionally, the target processing element includes: a query data retrieval element, a transaction data generation element, or a rule data generation element; wherein, the query data retrieval element is used to retrieve data from the database, the transaction data generation element is used to generate transaction data, and the rule data generation element is used to generate data corresponding to a preset algorithm.

[0020] Optionally, it also includes:

[0021] Receive orchestration instructions for the data pipeline;

[0022] From the component library, identify at least one candidate processing component;

[0023] Display the at least one alternative processing element and receive operation instructions for the at least one alternative processing element;

[0024] According to the operation instructions, at least one selected processing element is determined from the at least one candidate processing element, and the execution order of each selected processing element is determined;

[0025] Based on the service interface of the at least one selected processing element and the execution order of each selected processing element, a data pipeline corresponding to the orchestration instruction is generated.

[0026] Optionally, after determining at least one selected processing element from the at least one candidate processing element according to the operation instruction, the method further includes:

[0027] Receive setting instructions for the selected processing element;

[0028] Based on the setting instructions of the selected processing element, the input parameter setting conditions corresponding to the selected processing element are determined.

[0029] Optionally, it also includes:

[0030] Receive new instructions for processing elements;

[0031] Display the component creation interface and receive editing operations for the component creation interface;

[0032] Based on the editing operation, the processing code corresponding to the processing element is generated and saved.

[0033] Optionally, before receiving the test data generation request, the method further includes:

[0034] Obtain task information for the data generation task, the task information including: running conditions;

[0035] Determine whether the current system meets the aforementioned operating conditions;

[0036] If the current system meets the aforementioned operating conditions, a test data generation request corresponding to the data generation task is generated.

[0037] Secondly, embodiments of the present invention provide a test data generation apparatus, comprising:

[0038] The request receiving module is used to receive test data generation requests;

[0039] The first acquisition module is used to generate request information based on the test data and acquire the target pipeline corresponding to the test data generation request. The target pipeline includes at least one target service interface, and the target service interface corresponds one-to-one with a target processing element.

[0040] The second acquisition module is used to acquire the execution order of each target service interface in the target pipeline;

[0041] The data generation module is used to sequentially call the target processing elements corresponding to each of the target service interfaces according to the execution order, so as to generate the test data corresponding to the test data generation request.

[0042] Optionally, the test data generation request may further include: input parameters;

[0043] The data generation module is specifically used for:

[0044] From the target processing elements corresponding to each of the target service interfaces, a first element with a first execution order is determined, the input parameters are passed to the first element, and the output data of the first element is obtained;

[0045] From the remaining target processing elements, determine the second element with the second execution order, pass the output data of the first element to the second element, and obtain the output data of the second element;

[0046] This process continues until all target processing elements have been invoked.

[0047] Optionally, the target pipeline further includes: input parameter setting conditions corresponding to each of the target processing elements;

[0048] The data generation module is specifically used for:

[0049] From the target processing elements corresponding to each of the target service interfaces, determine and call the first element with the first execution order, and obtain the first output data of the first element;

[0050] From the remaining target processing elements, determine the second element with the second execution order; determine the input parameter setting conditions corresponding to the second element, and use the input parameter setting conditions to process the first output data to obtain the second input data; pass the second input data to the second element, and obtain the second output data of the second element;

[0051] This process continues until all target processing elements have been invoked.

[0052] Optionally, the target processing element includes: a query data retrieval element, a transaction data generation element, or a rule data generation element; wherein, the query data retrieval element is used to retrieve data from the database, the transaction data generation element is used to generate transaction data, and the rule data generation element is used to generate data corresponding to a preset algorithm.

[0053] Thirdly, embodiments of the present invention provide an electronic device, comprising:

[0054] One or more processors;

[0055] Storage device for storing one or more programs.

[0056] When the one or more programs are executed by the one or more processors, the one or more processors implement the method described in any of the above embodiments.

[0057] Fourthly, embodiments of the present invention provide a computer-readable medium having a computer program stored thereon, which, when executed by a processor, implements the methods described in any of the above embodiments.

[0058] Fifthly, embodiments of the present invention provide a computer program product, including a computer program that, when executed by a processor, implements the method described in any of the above embodiments.

[0059] One embodiment of the above invention has the following advantages or beneficial effects: The system sets up multiple data pipelines. Based on business scenarios or testing requirements, the service interfaces and execution order in each data pipeline are arranged. Each service interface corresponds one-to-one with a processing element. Processing elements can be query data retrieval elements, transaction data generation elements, and rule data generation elements, etc., and can realize various forms of data retrieval or generation. Through the data pipelines, the processing elements are flexibly connected to generate test data suitable for various business scenarios.

[0060] After receiving a test data generation request, the target pipeline corresponding to the request is determined. The test data corresponding to the request is then generated using the target pipeline. This embodiment of the invention automatically and flexibly generates test data by orchestrating data pipelines, reducing the time required for test data generation and achieving high efficiency.

[0061] The further effects of the aforementioned unconventional alternative methods will be explained below in conjunction with specific implementation methods. Attached Figure Description

[0062] The accompanying drawings are provided to better understand the invention and are not intended to unduly limit the scope of the invention. Wherein:

[0063] Figure 1 This is a flowchart illustrating a test data generation method provided in the first embodiment of the present invention;

[0064] Figure 2 This is a flowchart illustrating a data pipeline orchestration method provided in the second embodiment of the present invention;

[0065] Figure 3 This is a flowchart illustrating a test data generation method provided in the third embodiment of the present invention;

[0066] Figure 4 This is a schematic diagram of the structure of a test data generation device provided in an embodiment of the present invention;

[0067] Figure 5 This is a schematic diagram of the structure of a computer system suitable for implementing terminal devices or servers of the present invention. Detailed Implementation

[0068] The following description, in conjunction with the accompanying drawings, illustrates exemplary embodiments of the present invention, including various details to aid understanding. These details should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the invention. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.

[0069] The acquisition, storage, use, and processing of data in this application all comply with the relevant provisions of national laws and regulations.

[0070] Figure 1 This is a flowchart illustrating a test data generation method provided in the first embodiment of the present invention, as shown below. Figure 1 As shown, the method includes:

[0071] Step 101: Receive test data generation request.

[0072] Step 102: Generate request information based on test data, obtain the target pipeline corresponding to the test data generation request, the target pipeline includes at least one target service interface, and the target service interface corresponds one-to-one with the target processing element.

[0073] The system sets up multiple data pipelines. Each data pipeline has pipeline information, which may include: pipeline identifier, test data type, transaction identifier, project identifier, functional unit identifier, etc.

[0074] It can retrieve request information contained in the test data generation request, which may include: pipeline identifier, test data type, transaction identifier, project identifier, functional unit identifier, etc. Based on the pipeline information and request information, the target pipeline is determined from multiple data pipelines.

[0075] Step 103: Obtain the execution order of each target service interface in the target pipeline.

[0076] Step 104: According to the execution order, call the target processing element corresponding to each target service interface in sequence to generate test data corresponding to the test data generation request.

[0077] The data pipeline includes multiple service interfaces with an execution order, each corresponding to a processing element. These processing elements are capable of various forms of data retrieval or generation. Interface-based processing elements facilitate functions such as element invocation and parameter passing.

[0078] In this embodiment of the invention, multiple data pipelines are configured in the system. The service interfaces and execution order within each data pipeline are arranged according to business scenarios or testing requirements. Processing elements can include query data retrieval elements, transaction data generation elements, and rule-based data generation elements, etc. Through the data pipelines, these processing elements are flexibly connected to generate test data suitable for various business scenarios.

[0079] After receiving a test data generation request, the target pipeline corresponding to the request is determined. The test data corresponding to the request is then generated using the target pipeline. This embodiment of the invention automatically and flexibly generates test data by orchestrating data pipelines, reducing the time required for test data generation and achieving high efficiency.

[0080] The processing code for processing elements can be written according to requirements to achieve various forms of data generation or retrieval. Processing elements may include: query data retrieval elements, transaction data generation elements, or rule-based data generation elements, etc.

[0081] The query retrieval component is used to retrieve data from the database. It enables the querying of basic metadata from database tables. Query retrieval components can be generated through a graphical interface and SQL syntax.

[0082] The transaction data generation component is used to generate transaction data of the target type. The transaction data generation component enables data generation capabilities for a single transaction interface.

[0083] The rule-based data generation element is used to generate data corresponding to preset algorithms. These preset algorithms may include algorithms for generating ID card numbers, mobile phone numbers, and serial number acquisition. The rule-based data generation element is used to generate data based on these algorithms. The data generated by the rule-based data generation element includes: ID card numbers, mobile phone numbers, and serial numbers.

[0084] By connecting query and data retrieval components in a data pipeline, combined queries of database data can be achieved; by connecting single transaction data generation components in a data pipeline, combined transaction data generation scenarios can be achieved; by combining and connecting rule algorithm data generation components, query and data retrieval components, and transaction data generation components in a data pipeline, test data for various application scenarios can be generated.

[0085] In an embodiment of the present invention, the test data generation request further includes: input parameters; according to the execution order, sequentially calling the target processing elements corresponding to each target service interface to generate test data corresponding to the test data generation request, including: determining a first element with a first execution order from the target processing elements corresponding to each target service interface, passing the input parameters to the first element, and obtaining the output data of the first element; determining a second element with a second execution order from the remaining target processing elements, passing the output data of the first element to the second element, and obtaining the output data of the second element; and so on, until all target processing elements have been called.

[0086] The data pipeline calls interface-based query data retrieval, transaction data generation, and rule data generation components. Based on data requirements, input parameters are passed to the test data generation request, and the output data of the previous processing component is passed as context to the next processing component, ultimately forming a test data pipeline that automatically generates test data and can then feed the generated test data into a data pool.

[0087] In an embodiment of the present invention, the target pipeline further includes: input parameter setting conditions corresponding to each target processing element; according to the execution order, sequentially calling the target processing elements corresponding to each target service interface to generate test data corresponding to the test data generation request, including: determining and calling a first element with a first execution order from the target processing elements corresponding to each target service interface, and obtaining the first output data of the first element; determining a second element with a second execution order from the remaining target processing elements; determining the input parameter setting conditions corresponding to the second element, and using the input parameter setting conditions to process the first output data to obtain the second input data; passing the second input data to the second element, and obtaining the second output data of the second element; and so on, until all target processing elements have been called.

[0088] Input parameter settings can be configured as needed. These settings are used to convert the output data of the previous processing element into input parameters for the next processing element. Input parameter settings may include: parameter type, parameter operation rules, and parameter name.

[0089] The parameter type is used to convert the output data of the previous processing element into data corresponding to this parameter type. The parameter operation rule is used to process the output data of the previous processing element according to the processing method corresponding to this parameter operation rule. The parameter name is used to convert the name of the output data of the previous processing element into this parameter name.

[0090] By using the input parameter settings, the output data of the previous processing element is converted into the input parameters of the next processing element. Each processing element is called in sequence until all processing elements have been called, and the required test data is generated.

[0091] This invention provides a method for pipelined combination and concatenation of test data services from different scenarios. By using input parameters and setting conditions, the output parameters of the previous processing element are passed as context to the next processing element, flexibly enabling the association of various types of test data and automating the generation of test data.

[0092] Figure 2 This is a flowchart illustrating a data pipeline orchestration method provided in the second embodiment of the present invention, as shown below. Figure 2 As shown, the method includes:

[0093] Step 201: Receive orchestration instructions for the data pipeline.

[0094] Step 202: Identify at least one candidate processing component from the component library.

[0095] The orchestration instructions may include orchestration information such as test data type, transaction identifier, and project identifier; based on the orchestration information, at least one alternative processing element that matches the orchestration information is determined from multiple processing elements in the component library.

[0096] Step 203: Display at least one alternative processing element and receive operation instructions for at least one alternative processing element.

[0097] Step 204: According to the operation instructions, determine at least one selected processing element from at least one candidate processing element, and determine the execution order of each selected processing element.

[0098] Operation instructions may include selection instructions and editing instructions. Selection instructions are used to determine at least one selected processing element from at least one candidate processing element. Editing instructions are used to determine the execution order of the selected processing elements.

[0099] In one embodiment of the present invention, after determining at least one selected processing element from at least one candidate processing element according to the operation instruction, the method further includes: receiving a setting instruction for the selected processing element; and determining the input parameter setting conditions corresponding to the selected processing element according to the setting instruction for the selected processing element.

[0100] By using the configuration commands for selected processing elements, input parameter settings can be set for those elements. By setting these input parameter settings, multiple processing elements can be connected in series more easily and flexibly to generate the required data pipeline, thereby producing test data suitable for various test scenarios.

[0101] Step 205: Generate a data pipeline based on the service interface of at least one selected processing element and the execution order of each selected processing element.

[0102] It can also receive pipeline setting instructions and generate pipeline information for the data pipeline based on the pipeline setting instructions. The pipeline information may include: pipeline identifier, test data type, transaction identifier, project identifier, functional unit identifier, etc.

[0103] This invention provides a data pipeline orchestration method. This method uses an interface-based approach to associate and combine query data retrieval, transaction data generation, and rule-based data generation. By interface-izing data services, these interface-based services are further combined and chained together to form a test data pipeline.

[0104] This invention also provides a method for generating a processing element, comprising: receiving a new creation instruction for the processing element; displaying a new element creation interface and receiving an editing operation for the new element creation interface; and generating and saving the processing code corresponding to the processing element based on the editing operation.

[0105] The system receives editing commands from the user and generates corresponding processing code for the processing element. This processing code implements the data retrieval or creation functions of the processing element. The processing code can be in SQL format or written in languages ​​such as Java and Python. The element creation interface can display data object information, which may include databases, tables, and fields. The system also receives selection instructions and adds the corresponding data object to the processing code.

[0106] Figure 3 This is a flowchart illustrating a test data generation method provided in the third embodiment of the present invention. Figure 3 As shown, the method includes:

[0107] Step 301: Obtain the task information for the data generation task. The task information includes: running conditions.

[0108] The operating conditions can be set according to specific needs. Operating conditions can include: running automatically every 4 hours, running automatically at 12 noon every day, data loading in the target business system being completed, and the current CPU resources being idle, etc.

[0109] Step 302: Determine whether the current system meets the operating conditions.

[0110] Step 303: If the current system meets the operating conditions, generate the test data generation request corresponding to the data generation task.

[0111] Step 304: Obtain the target pipeline corresponding to the test data generation request. The target pipeline includes at least one target service interface, and each target service interface corresponds to a target processing element.

[0112] Step 305: Obtain the execution order of each target service interface in the target pipeline.

[0113] Step 306: According to the execution order, call the target processing element corresponding to each target service interface in sequence to generate test data corresponding to the test data generation request.

[0114] In this embodiment of the invention, by setting the running conditions corresponding to the data generation task, a test data generation request can be generated when the system meets the running conditions, thus completing the automatic generation of test data. Furthermore, the test data pipeline can also automatically generate test data by utilizing the data pool's scheduled task capabilities.

[0115] Figure 4 This is a schematic diagram of a test data generation device provided in one embodiment of the present invention, as shown below. Figure 4 As shown, the device includes:

[0116] Request receiving module 401 is used to receive test data generation requests;

[0117] The first acquisition module 402 is used to acquire request information of the test data generation request based on the test data, and to acquire the target pipeline corresponding to the test data generation request. The target pipeline includes at least one target service interface, and the target service interface corresponds one-to-one with the target processing element.

[0118] The second acquisition module 403 is used to acquire the execution order of each target service interface in the target pipeline;

[0119] The data generation module 404 is used to sequentially call the target processing elements corresponding to each of the target service interfaces according to the execution order, so as to generate the test data corresponding to the test data generation request.

[0120] Optionally, the test data generation request may further include: input parameters;

[0121] The data generation module 404 is specifically used for:

[0122] From the target processing elements corresponding to each of the target service interfaces, a first element with a first execution order is determined, the input parameters are passed to the first element, and the output data of the first element is obtained;

[0123] From the remaining target processing elements, determine the second element with the second execution order, pass the output data of the first element to the second element, and obtain the output data of the second element;

[0124] This process continues until all target processing elements have been invoked.

[0125] Optionally, the target pipeline further includes: input parameter setting conditions corresponding to each of the target processing elements;

[0126] The data generation module 404 is specifically used for:

[0127] From the target processing elements corresponding to each of the target service interfaces, determine and call the first element with the first execution order, and obtain the first output data of the first element;

[0128] From the remaining target processing elements, determine the second element with the second execution order; determine the input parameter setting conditions corresponding to the second element, and use the input parameter setting conditions to process the first output data to obtain the second input data; pass the second input data to the second element, and obtain the second output data of the second element;

[0129] This process continues until all target processing elements have been invoked.

[0130] Optionally, the target processing element includes: a query data retrieval element, a transaction data generation element, or a rule data generation element; wherein, the query data retrieval element is used to retrieve data from the database, the transaction data generation element is used to generate transaction data, and the rule data generation element is used to generate data corresponding to a preset algorithm.

[0131] Optionally, the device further includes:

[0132] Pipeline orchestration module 405 is used to receive orchestration instructions for data pipelines;

[0133] From the component library, identify at least one candidate processing component;

[0134] Display the at least one alternative processing element and receive operation instructions for the at least one alternative processing element;

[0135] According to the operation instructions, at least one selected processing element is determined from the at least one candidate processing element, and the execution order of each selected processing element is determined;

[0136] Based on the service interface of the at least one selected processing element and the execution order of each selected processing element, a data pipeline corresponding to the orchestration instruction is generated.

[0137] Optionally, the pipeline orchestration module 405, according to the operation instruction, is further configured to:

[0138] Receive setting instructions for the selected processing element;

[0139] Based on the setting instructions of the selected processing element, the input parameter setting conditions corresponding to the selected processing element are determined.

[0140] Optionally, the device further includes:

[0141] The component generation module 406 is used to receive new creation instructions for the processed component;

[0142] Display the component creation interface and receive editing operations for the component creation interface;

[0143] Based on the editing operation, the processing code corresponding to the processing element is generated and saved.

[0144] Optionally, the device further includes:

[0145] The request generation module 407 is used to obtain task information of the data generation task, the task information including: running conditions;

[0146] Determine whether the current system meets the aforementioned operating conditions;

[0147] If the current system meets the aforementioned operating conditions, a test data generation request corresponding to the data generation task is generated.

[0148] This invention provides an electronic device, comprising:

[0149] One or more processors;

[0150] Storage device for storing one or more programs.

[0151] When one or more programs are executed by one or more processors, the one or more processors implement the methods of any of the above embodiments.

[0152] This invention provides a computer program product, including a computer program that, when executed by a processor, implements the enterprise risk assessment method of this invention.

[0153] The following is for reference. Figure 5 It shows a schematic diagram of the structure of a computer system 500 suitable for implementing a terminal device of the present invention. Figure 5 The terminal device shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of the present invention.

[0154] like Figure 5 As shown, the computer system 500 includes a central processing unit (CPU) 501, which can perform various appropriate actions and processes based on programs stored in read-only memory (ROM) 502 or programs loaded from storage section 508 into random access memory (RAM) 503. The RAM 503 also stores various programs and data required for the operation of the system 500. The CPU 501, ROM 502, and RAM 503 are interconnected via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.

[0155] The following components are connected to I / O interface 505: an input section 506 including a keyboard, mouse, etc.; an output section 507 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 508 including a hard disk, etc.; and a communication section 509 including a network interface card such as a LAN card, modem, etc. The communication section 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to I / O interface 505 as needed. A removable medium 511, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on drive 510 as needed so that computer programs read from it can be installed into storage section 508 as needed.

[0156] In particular, according to the embodiments disclosed in this invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this invention include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 509, and / or installed from removable medium 511. When the computer program is executed by central processing unit (CPU) 501, it performs the functions defined above in the system of this invention.

[0157] It should be noted that the computer-readable medium shown in this invention can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this invention, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media can also be any computer-readable medium other than computer-readable storage media, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.

[0158] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0159] The modules described in the embodiments of the present invention can be implemented in software or hardware. The described modules can also be located in a processor, and for example, can be described as: a request receiving module, a first acquisition module, a second acquisition module, and a data generation module. The names of these modules do not necessarily limit the module itself; for example, the request receiving module can also be described as a "module for receiving test data generation requests".

[0160] In another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiments; or it may exist independently and not assembled into the device. The computer-readable medium carries one or more programs, which, when executed by the device, cause the device to include:

[0161] Receive test data generation request;

[0162] Based on the test data, a request information is generated to obtain the target pipeline corresponding to the test data generation request. The target pipeline includes at least one target service interface, and the target service interface corresponds one-to-one with a target processing element.

[0163] Obtain the execution order of each target service interface in the target pipeline;

[0164] According to the execution order, the target processing elements corresponding to each target service interface are called sequentially to generate the test data corresponding to the test data generation request.

[0165] According to the technical solution of this invention, the system sets up multiple data pipelines. Based on business scenarios or testing requirements, the service interfaces and execution order in each data pipeline are arranged. Each service interface corresponds one-to-one with a processing element. Processing elements can be query data retrieval elements, transaction data generation elements, and rule data generation elements, etc., and can implement various forms of data retrieval or generation. Through the data pipelines, the processing elements are flexibly connected to generate test data suitable for various business scenarios.

[0166] After receiving a test data generation request, the target pipeline corresponding to the request is determined. The test data corresponding to the request is then generated using the target pipeline. This embodiment of the invention automatically and flexibly generates test data by orchestrating data pipelines, reducing the time required for test data generation and achieving high efficiency.

[0167] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can occur depending on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A method for generating test data, characterized in that, include: Receive test data generation request; wherein, the test data pipeline is configured according to the data pool's scheduled task capability, and each data pipeline has pipeline information, including: pipeline identifier, test data type, transaction identifier, project identifier, and functional unit identifier; Based on the test data, a request information is generated to obtain the target pipeline corresponding to the test data generation request. The target pipeline includes at least one target service interface, and the target service interface corresponds one-to-one with a target processing element. Obtain the execution order of each target service interface in the target pipeline; According to the execution order, the target processing elements corresponding to each target service interface are called sequentially to generate the test data corresponding to the test data generation request; The target processing element includes: a query data retrieval element, a transaction data generation element, or a rule data generation element; wherein, the query data retrieval element is used to retrieve data from the database, the transaction data generation element is used to generate transaction data, and the rule data generation element is used to generate data corresponding to a preset algorithm; By connecting query and data retrieval components in a data pipeline, combined queries of database data can be achieved; by connecting single transaction data generation components in a data pipeline, combined transaction data generation scenarios can be achieved; by combining and connecting rule algorithm data generation components, query and data retrieval components, and transaction data generation components in a data pipeline, test data for various application scenarios can be generated. The target pipeline further includes: input parameter setting conditions corresponding to each target processing element; the step of sequentially calling the target processing elements corresponding to each target service interface according to the execution order to generate test data corresponding to the test data generation request includes: determining and calling a first element with a first execution order from the target processing elements corresponding to each target service interface, and obtaining the first output data of the first element; determining a second element with a second execution order from the remaining target processing elements; determining the input parameter setting conditions corresponding to the second element, and processing the first output data using the input parameter setting conditions to obtain second input data; passing the second input data to the second element, and obtaining the second output data of the second element; and so on, until all target processing elements have been called. Before receiving the test data generation request, the method further includes: obtaining task information of the data generation task, the task information including: running conditions; determining whether the current system meets the running conditions; and generating the test data generation request corresponding to the data generation task if the current system meets the running conditions.

2. The method according to claim 1, characterized in that, The test data generation request also includes: input parameters; The step of sequentially invoking the target processing elements corresponding to each target service interface according to the execution order to generate the test data corresponding to the test data generation request includes: From the target processing elements corresponding to each of the target service interfaces, a first element with a first execution order is determined, the input parameters are passed to the first element, and the output data of the first element is obtained; From the remaining target processing elements, determine the second element with the second execution order, pass the output data of the first element to the second element, and obtain the output data of the second element; This process continues until all target processing elements have been invoked.

3. The method according to claim 1, characterized in that, Also includes: Receive orchestration instructions for the data pipeline; From the component library, identify at least one candidate processing component; Display the at least one alternative processing element and receive operation instructions for the at least one alternative processing element; According to the operation instructions, at least one selected processing element is determined from the at least one candidate processing element, and the execution order of each selected processing element is determined; Based on the service interface of the at least one selected processing element and the execution order of each selected processing element, a data pipeline corresponding to the orchestration instruction is generated.

4. The method according to claim 3, characterized in that, After determining at least one selected processing element from the at least one candidate processing element according to the operation instruction, the method further includes: Receive setting instructions for the selected processing element; Based on the setting instructions of the selected processing element, the input parameter setting conditions corresponding to the selected processing element are determined.

5. The method according to claim 1, characterized in that, Also includes: Receive new instructions for processing elements; Display the component creation interface and receive editing operations for the component creation interface; Based on the editing operation, the processing code corresponding to the processing element is generated and saved.

6. A test data generation device, characterized in that, include: The request receiving module is used to receive test data generation requests; wherein, the test data pipeline is configured according to the data pool's scheduled task capabilities, and each data pipeline has pipeline information, including: pipeline identifier, test data type, transaction identifier, project identifier, and functional unit identifier; The first acquisition module is used to generate request information based on the test data and acquire the target pipeline corresponding to the test data generation request. The target pipeline includes at least one target service interface, and the target service interface corresponds one-to-one with a target processing element. The second acquisition module is used to acquire the execution order of each target service interface in the target pipeline; The data generation module is used to sequentially call the target processing elements corresponding to each of the target service interfaces according to the execution order, so as to generate the test data corresponding to the test data generation request. The target processing element includes: a query data retrieval element, a transaction data generation element, or a rule data generation element; wherein, the query data retrieval element is used to retrieve data from the database, the transaction data generation element is used to generate transaction data, and the rule data generation element is used to generate data corresponding to a preset algorithm; The data generation module is also used to connect query data retrieval components in series through the data pipeline to realize combined queries of database data; to connect single transaction data generation components in series through the data pipeline to realize combined transaction data generation scenarios; and to combine and connect rule algorithm data generation components, query data retrieval components, and transaction data generation components in series through the data pipeline to generate test data for various application scenarios. The target pipeline further includes: input parameter setting conditions corresponding to each target processing element; the data generation module is specifically used to: determine and call a first element with a first execution order from the target processing elements corresponding to each target service interface, and obtain the first output data of the first element; determine a second element with a second execution order from the remaining target processing elements; determine the input parameter setting conditions corresponding to the second element, and process the first output data using the input parameter setting conditions to obtain second input data; pass the second input data to the second element, and obtain the second output data of the second element; and so on, until all target processing elements have been called. It also includes: a request generation module, used to obtain task information of the data generation task, the task information including: running conditions; determining whether the current system meets the running conditions; and generating a test data generation request corresponding to the data generation task if the current system meets the running conditions.

7. The apparatus according to claim 6, characterized in that, The test data generation request also includes: input parameters; The data generation module is specifically used for: From the target processing elements corresponding to each of the target service interfaces, a first element with a first execution order is determined, the input parameters are passed to the first element, and the output data of the first element is obtained; From the remaining target processing elements, determine the second element with the second execution order, pass the output data of the first element to the second element, and obtain the output data of the second element; This process continues until all target processing elements have been invoked.

8. An electronic device, characterized in that, include: One or more processors; Storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of claims 1-5.

9. A computer-readable medium having a computer program stored thereon, characterized in that... When the program is executed by the processor, it implements the method as described in any one of claims 1-5.

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