Test data generation method, electronic equipment, storage medium and program

By mapping and simplifying the sample data of the business system, testing data that conforms to the distribution model is generated, which solves the problem of large differences between the test data and the real data, and achieves more accurate performance testing.

CN120492345APending Publication Date: 2025-08-15AGRICULTURAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510617281.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-14
Publication Date
2025-08-15

AI Technical Summary

Technical Problem

In the performance test of existing business systems, the test data is quite different from the real data. Ignoring the data content leads to a far distance between the test results and errors are prone to occur under boundary conditions.

Method used

By mapping the business sample data in the target sample database, a sample data mapping set is generated, and the data distribution model is simplified to generate target test data to improve authenticity and effectiveness.

Benefits of technology

The generated test data is closer to the real business system performance data, optimizes the performance testing effect of the business system, and improves the authenticity and effectiveness of the test data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120492345A_ABST
    Figure CN120492345A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a test data generation method, electronic equipment, a storage medium and a program, and the method comprises the steps: carrying out the mapping of target business sample data of a target business system stored in a target sample database, and obtaining a sample data mapping set; simplifying the sample data mapping set to obtain a simplified sample data mapping set; calculating a data distribution model of the simplified sample data mapping set; and generating target test data of the target business system according to the data distribution model of the simplified sample data mapping set. According to the technical scheme of the embodiment of the invention, the authenticity and effectiveness of the test data of the service system can be improved, so that the performance test effect of the service system is optimized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present invention relate to the field of data processing technology, and in particular to a test data generation method, device, electronic device, storage medium, and program. Background Art

[0002] Before a business system is officially launched, simulated test data is generated to test each component of the business system to ensure that the connections between the components are reasonable and smooth, and that they are operating normally. Performance testing of a business system is based on business data from the system's real environment (such as transaction operations for a banking system). This method simulates the generation of large amounts of concurrent test data over a certain period of time to test the business system. The purpose is to evaluate the performance of the business system under loads equivalent to those of real business operations and measure the robustness of the business system. The robustness of a business system is crucial to the operation of an enterprise or organization. Therefore, performance testing based on large amounts of data is at the core of an enterprise or organization's IT (Information Technology) operations.

[0003] Currently, real-world business data for business systems is readily available from historical data, providing insights into the scale of test data used in a test environment. Traditional performance testing of business systems typically involves using data generation scripts to prepare sufficient test data, inputting this data into the business system through a test interface, and observing the system's performance.

[0004] In the process of realizing the present invention, the inventors found that the prior art has the following defects: the performance test of traditional business systems usually only focuses on the scale of test data, but ignores the content of test data. For example, in the data about user information in the school management system, the student ID number may be an increasing series or a random number, and the remaining amount of the student meal card may be a random number. Ignoring the content of the data may make the results of the performance test of the business system far from the expectations. First, statistical results show that the business data of most business systems (such as banking systems, etc.) obey a certain distribution in a specific dimension. In an environment where a large number of businesses are running in parallel, this distribution may aggravate the performance problems of the business system. Secondly, software systems are usually prone to errors under boundary conditions, and randomly generated test data and the business itself are likely to lose correlation, and thus cannot cover business scenarios under boundary conditions. Summary of the Invention

[0005] Embodiments of the present invention provide a test data generation method, electronic device, storage medium, and program, which can improve the authenticity and effectiveness of test data of a business system, thereby optimizing the performance testing effect of the business system.

[0006] According to one aspect of the present invention, there is provided a test data generating method, comprising:

[0007] Mapping target business sample data of the target business system stored in the target sample database to obtain a sample data mapping set;

[0008] Simplifying the sample data mapping set to obtain a simplified sample data mapping set;

[0009] Calculating a data distribution model of the simplified sample data mapping set;

[0010] Target test data of the target business system is generated according to the data distribution model of the simplified sample data mapping set.

[0011] According to another aspect of the present invention, there is provided a test data generating apparatus, comprising:

[0012] A sample data mapping set generation module is used to map the target business sample data of the target business system stored in the target sample database to obtain a sample data mapping set;

[0013] a sample data mapping set simplification module, configured to simplify the sample data mapping set to obtain a simplified sample data mapping set;

[0014] A data distribution model calculation module, configured to calculate a data distribution model of the simplified sample data mapping set;

[0015] A target test data generating module is configured to generate target test data for the target business system according to the data distribution model of the simplified sample data mapping set.

[0016] According to another aspect of the present invention, an electronic device is provided, comprising:

[0017] at least one processor; and

[0018] a memory communicatively connected to the at least one processor; wherein,

[0019] The memory stores a computer program executable by the at least one processor. The computer program is executed by the at least one processor to enable the at least one processor to perform the test data generating method according to any embodiment of the present invention.

[0020] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the test data generating method according to any embodiment of the present invention when executed.

[0021] According to another aspect of the present invention, a computer program product is provided, comprising a computer program, wherein when the computer program is executed by a processor, the test data generating method according to any embodiment of the present invention is implemented.

[0022] The embodiment of the present invention maps the target business sample data of the target business system stored in the target sample database to obtain a sample data mapping set, and further simplifies the sample data mapping set to obtain a simplified sample data mapping set. After obtaining the simplified sample data mapping set, the data distribution model of the simplified sample data mapping set can be calculated, thereby generating target test data for the target business system based on the data distribution model of the simplified sample data mapping set. The above technical solution adopts a test data optimization method that is data-oriented rather than physical design-oriented, which can solve the problem of large differences between test data and production data in existing test data generation methods, and can improve the authenticity and effectiveness of the test data of the business system, thereby optimizing the performance testing effect of the business system.

[0023] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present invention, nor is it intended to limit the scope of the present invention. Other features of the present invention will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0025] Figure 1 is a flow chart of a test data generating method provided by an embodiment of the present invention;

[0026] Figure 2 is a flowchart of another test data generating method provided by an embodiment of the present invention;

[0027] Figure 3 is a schematic diagram of a test data generating device provided by an embodiment of the present invention;

[0028] Figure 4 A schematic structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0029] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.

[0030] It should be noted that the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or apparatus that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units that are not explicitly listed or are inherent to these processes, methods, products or apparatus.

[0031] Currently, the methods used in related technologies for generating test data often require statement correction based on the physical design of the database storing business data (such as keys, row and column storage, and partitioning, etc.), and then generate the required test data based on the corrected structure. This method of generating test data requires testers to have a database knowledge base, and different database software often requires repetitive statement correction work due to lack of compatibility issues. At the same time, existing test data generation methods often only optimize the physical distribution of data, while real data may still be concentrated in certain specific physical areas based on its content, which may increase the difference between test data and production data.

[0032] Figure 1 This is a flow chart of a test data generation method provided by an embodiment of the present invention. This embodiment is applicable to the case where test data of a business system is generated in a data-oriented design manner. The method can be executed by a test data generation device, which can be implemented by software and / or hardware and can generally be integrated into an electronic device. The electronic device can be a terminal device or a server device. As long as it can execute the test data generation method, the embodiment of the present invention does not limit the specific device type of the electronic device. Accordingly, if Figure 1 As shown, the method includes the following operations:

[0033] S110 : Map the target business sample data of the target business system stored in the target sample database to obtain a sample data mapping set.

[0034] Among them, the target sample database can be a database for storing the business data of the target business system. The embodiment of the present invention does not limit the database type of the target sample database. The target business system can be a system that needs to generate test data to perform performance testing on the system. Exemplarily, the target business system can include but is not limited to a banking system, a campus management system, an employee management system, a log system, and any other type of business system. The embodiment of the present invention does not limit the system type of the target business system. The target business sample data can be the business data stored in the target sample database for the target business system, which can be used as a sample to generate corresponding test data. The sample data mapping set can be a data combination obtained by mapping the target business sample data.

[0035] In an embodiment of the present invention, the target business system type for which test data needs to be generated can be first determined, and target business sample data of the target business system can be obtained from a target sample database. The target business sample data of the target business system can then be mapped to obtain a sample data mapping set corresponding to the target business sample data of the target business system. Mapping the target business sample data of the target business system to a sample data mapping set can achieve normalization of the target business sample data, facilitating the description of the distribution characteristics of the target business sample data. Furthermore, the original content of the target business sample data can be masked, which is beneficial for protecting the privacy of the target business sample data.

[0036] S120: Simplify the sample data mapping set to obtain a simplified sample data mapping set.

[0037] The simplified sample data mapping set may be a data set obtained by simplifying the sample data mapping set.

[0038] Since a sample data mapping set typically includes all attributes of the target sample database, large application databases often have a large number of attributes. Using all attributes for subsequent calculations would be computationally intensive. Therefore, the sample data mapping set can be further streamlined based on data relevance to create a simplified sample data mapping set. Using this simplified sample data mapping set for subsequent calculations can reduce model dimensionality and improve computational efficiency.

[0039] S130: Calculate the data distribution model of the simplified sample data mapping set.

[0040] A data distribution model is a method used to describe and analyze the distribution of data within different intervals. By dividing data into intervals and counting the amount of data or data characteristics within each interval, it reveals the overall distribution patterns and characteristics of the data. Data distribution models are crucial in data analysis, helping to understand the central tendency, degree of dispersion, and overall shape of the data.

[0041] Accordingly, after obtaining the simplified sample data mapping set, the data analysis process can be performed based on the simplified sample data mapping set to obtain a data distribution model corresponding to the simplified sample data mapping set. The data distribution model can reflect the overall distribution patterns and characteristics of the target business sample data.

[0042] S140 : Generate target test data for the target business system according to the data distribution model of the simplified sample data mapping set.

[0043] The target test data may be data used to perform performance testing on a target business system.

[0044] After obtaining the data distribution model of the simplified sample data mapping set, an arbitrary number of performance test data records that meet the requirements can be generated based on the data distribution model of the simplified sample data mapping set and the performance test data volume requirements of the target business system as the target test data of the target business system.

[0045] Since the data distribution model of the simplified sample data mapping set can reflect the overall distribution rules and characteristics of the target business sample data, the target test data of the target business system generated based on the data distribution model of the simplified sample data mapping set can reflect the actual performance of the target business system. The generated target test data of the target business system is closer to the actual performance data of the target business system, reducing the difference between the test data and the production data, improving the authenticity and effectiveness of the test data of the business system, and having a better business system performance testing effect.

[0046] The embodiment of the present invention maps the target business sample data of the target business system stored in the target sample database to obtain a sample data mapping set, and further simplifies the sample data mapping set to obtain a simplified sample data mapping set. After obtaining the simplified sample data mapping set, the data distribution model of the simplified sample data mapping set can be calculated, thereby generating target test data for the target business system based on the data distribution model of the simplified sample data mapping set. The above technical solution adopts a test data optimization method that is data-oriented rather than physical design-oriented, which can solve the problem of large differences between test data and production data in existing test data generation methods, and can improve the authenticity and effectiveness of the test data of the business system, thereby optimizing the performance testing effect of the business system.

[0047] Figure 2 This is a flowchart of another test data generation method provided by an embodiment of the present invention. This embodiment is specific based on the above embodiment. In this embodiment, multiple specific optional implementation methods are provided for mapping target business sample data stored in the target sample database, simplifying the sample data mapping set, calculating the data distribution model of the simplified sample data mapping set, and generating target test data for the target business based on the data distribution model of the simplified sample data mapping set. Figure 2 As shown, the method of this embodiment may include:

[0048] S210: Generate an initial mapping of the target business sample data according to attributes of the target business sample data.

[0049] It is understandable that the target sample database includes multiple attributes. Therefore, the initial mapping of the target business sample data can be generated by combining the attribute types of the target business sample data in the target sample database with the target business sample data.

[0050] In an optional embodiment of the present invention, generating the initial mapping of the target business sample data based on the attributes of the target business sample data may include: when it is determined that the attribute of the target business sample data is a numeric type, the initial mapping of the target business sample data is the initial value of the target business sample data; when it is determined that the attribute of the target business sample data is a character type, the initial mapping of the target business sample data is the data of the previous target setting quantity of the target business sample data; wherein, the target setting quantity is the system structure bit width of the target sample database.

[0051] Assume that the target business sample data is stored in the target sample database in rows and columns, each row is recorded as a data record, and each column is recorded as a domain of the database, representing data of the same type of attributes. Further, the target business sample data is divided into numerical data and character data according to its storage method. The difference is that the physical storage method of character data is stored in order from front to back according to the data content; while the numerical data is not necessarily. In common computer system architectures, the storage unit of character data is usually 8 binary bits, and the storage unit of numerical data is usually no more than the register size of the system architecture. For example, the mainstream x86-64 architecture is 64 binary bits. The physical storage design of the character data or numerical data in the above examples is 8 bits or 64 bits, which is only for describing specific implementation cases and does not affect the implementation of the test data generation method of the embodiment of the present invention. For example, under certain system structures, the character type is 16 bits or the numerical type is 32 bits or 128 bits.

[0052] Furthermore, we can use each property (property, referred to as p i , i represents the attribute tag, that is, the i-th column) is a numerical type (numerical) or a character type (char), and the target business sample data is initially mapped. Specifically, if the attribute of the target business sample data is a numerical type, the initial mapping of the target business sample data is itself, that is, the initial mapping of the target business sample data is the initial value of the target business sample data; if the attribute of the target business sample data is a character type, the initial mapping of the target business sample data is the target set number of data, where the target set number N can represent the system structure bit width of the target sample database, that is, the number of register bits, for example, N = 64 in the x86-64 structure.

[0053] S220 : Perform post-mapping processing on the initial mapping of the target business sample data according to the attributes of the target business sample data to obtain the sample data mapping set.

[0054] After the initial mapping of the target business sample data is completed, the target business sample data may be further subjected to post-mapping processing according to the initial mapping result to obtain a corresponding sample data mapping set.

[0055] In an optional embodiment of the present invention, the post-mapping processing of the initial mapping of the target business sample data according to the attribute of the target business sample data may include: when it is determined that the attribute of the target business sample data is a numerical type, normalizing the initial mapping of the target business sample data based on the following formula;

[0056]

[0057] in, represents the normalized mapping of the initial mapping of the target service sample data, t i (k) represents the initial mapping of the kth record of the target business sample data. By normalizing the initial mapping of the numerical target business sample data, the measurement units of different attributes can be kept consistent.

[0058] In an optional embodiment of the present invention, the post-mapping processing of the initial mapping of the target business sample data according to the attributes of the target business sample data may include: when it is determined that the attributes of the target business sample data are character type, deleting the data content of the initial mapping of the attributes of the target business sample data to obtain mapping intermediate data; re-initializing the mapping intermediate data to obtain sub-attribute mapping; deleting the data content of the initial mapping of the sub-attribute mapping to obtain mapping intermediate data, and returning to execute the operation of re-initializing the mapping intermediate data to obtain sub-attribute mapping, until it is determined that the data of the sub-attribute mapping is empty; and calculating the target mapping of the target business sample data according to the relevant metrics of the sub-attribute mapping.

[0059] The intermediate mapping data may be the data obtained by deleting the data content of the initial mapping from the target business sample data. The sub-attribute mapping may be the data obtained by re-performing the initial mapping on the intermediate mapping data. The target mapping may be the final mapping value calculated for the character-type target business sample data.

[0060] Specifically, if the attribute p of the target business sample data i If it is a character type, you can remember t i0 Represents the initial mapping of the target business sample data, t i0 The property p i Remove the initial mapped part to get the mapped intermediate data, and recalculate the initial mapping for the mapped intermediate data to get a "sub-attribute" containing N (N represents the system structure bit width) bits of data, denoted as t i1 Repeat the above process until the remaining part of the mapped intermediate data is empty, and the J+1 "sub-attributes" of the target business sample data can be obtained and recorded as:

[0061] t ij ,j=0,1,…,J

[0062] For the k-th record, that is, the sub-attribute of the k-th target business sample data Its corresponding address in the target sample database The agreement is as follows:

[0063] A) If the attribute p i A database physical index is created in the target sample database. The corresponding address is the physical address of its index.

[0064] B) Otherwise, if the attribute p i There is no physical index in the target sample database, then The corresponding address is the physical address of the kth record, which can be the location where the index or record is stored in the target sample database.

[0065] Assume that the address is m-bit binary (generally equal to the bit width of the system structure of the target sample database, that is, equal to N, m=N is not a necessary condition), assume express The nth binary digit of express The nth binary bit of , we can define:

[0066]

[0067] in, Represents two sequences and convolution, m represents an integer.

[0068] According to the above The calculation formula can be calculated Represents the correlation measure of the jth sub-attribute in the i-th attribute of the k-th record in the target sample database.

[0069] Correspondingly, for the attribute p of the target business sample data i , we can calculate:

[0070]

[0071] in, Represents the correlation measure of the jth sub-attribute in the i-th attribute of the k-th record in the target sample database.

[0072] In the above formula, argmax j (f) represents the value of j that makes the formula f in the brackets take the maximum value. Sub-attributes As the final mapping of character-type target business sample data attributes.

[0073] In summary, for the attribute p of the target business sample data i Obtained sample data mapping set is defined as follows:

[0074]

[0075] S230: Simplify the sample data mapping set to obtain a simplified sample data mapping set.

[0076] In an optional embodiment of the present invention, the simplification of the sample data mapping set to obtain a simplified sample data mapping set may include: when it is determined that the attribute of the current sample data mapping in the sample data mapping set is a database index, adding the current sample data mapping to the simplified sample data mapping set; when it is determined that the attribute of the current sample data mapping in the sample data mapping set is not a database index, calculating the covariance matrix of the current sample data mapping and all index mappings; calculating a related property index based on the covariance matrix of the current sample data mapping and all index mappings; and when it is determined that the related property index is less than a preset empirical threshold, adding the current sample data mapping to the simplified sample data mapping set.

[0077] The preset experience threshold can be configured according to actual needs, and the embodiment of the present invention does not limit the specific value of the preset experience threshold.

[0078] Further, determine the sample data mapping set The current sample data map in . If the attribute p of the current sample data map is determined i If it is an index in the target sample database, the current sample data mapping can be added to the simplified sample data mapping set; otherwise, the covariance matrix of the mapping corresponding to the attribute and all index mappings is calculated, and based on the covariance matrix of the mapping corresponding to the attribute and all index mappings, it is determined whether to add the current sample data mapping to the simplified set.

[0079] Assume that the attribute to be evaluated in the current sample data mapping is p i ', its corresponding data mapping is There is another index attribute p id and its corresponding data mapping The covariance calculation formula between two data maps can be:

[0080]

[0081] Where, express and The covariance between them, K represents the number of records in the sample target sample database, and the symbol E represents the expected value of the random variable.

[0082] Then the covariance matrix Λ of the current sample data mapping and all index mappings is a 2x2 matrix, which can be expressed as:

[0083]

[0084] in:

[0085]

[0086] The elements of the covariance matrix reflect the correlation properties between the two random variables. Furthermore, the correlation property index δ can be calculated based on the covariance matrix of the current sample data mapping and all index mappings:

[0087]

[0088] If δ<α0, then the attribute p i 'Corresponding data mapping The simplified sample data mapping set is added, otherwise it is not added if δ≥α0. α0 represents the preset empirical threshold and can be a constant.

[0089] According to the above simplification rules, the simplified sample data mapping set can be obtained as

[0090] S240: Calculate the expectation and covariance matrices of the simplified sample data mapping set.

[0091] S250: Calculate a simplified data distribution model of the simplified sample data mapping set according to the expectation and covariance matrix of the simplified sample data mapping set.

[0092] The simplified data distribution model may be a data distribution model preliminarily calculated based on a simplified sample data mapping set.

[0093] Get the simplified sample data mapping set Then, the expectation E of the simplified sample data mapping set can be calculated based on the following formula.

[0094]

[0095] in, express The expectation of K is the number of records in the sample target sample database.

[0096] At the same time, the covariance matrix Ω of the simplified sample data mapping set can also be calculated based on the following formula.

[0097]

[0098] Among them, ω uv The two elements representing the simplified sample data mapping set are and The covariance of . Correspondingly, ω uv It can be calculated based on the following formula:

[0099]

[0100] Among them, E represents expectation.

[0101] Expected to map all attributes in a collection based on simplified sample data With the covariance matrix Ω, the simplified data distribution model of the simplified sample data mapping set can be calculated. Thus, any number of performance test data records that meet the requirements can be generated based on the simplified data distribution model of the simplified sample data mapping set.

[0102] S260: Supplement the data dimension of the simplified data distribution model to obtain the data distribution model of the simplified sample data mapping set.

[0103] S270 : Generate target test data for the target business system according to the data distribution model of the simplified sample data mapping set.

[0104] Since the simplified data distribution model of the simplified sample data mapping set only includes the simplified dimensions, in order to obtain the complete data dimensions, the data dimensions of the simplified data distribution model can be supplemented. Optionally, two optional solutions can be adopted to supplement each performance test data included in the simplified data distribution model:

[0105] Solution A: Randomly fill in the missing attributes of the test data generated based on the simplified data distribution model.

[0106] Solution B: Based on the streamlined dimensions of the simplified data distribution model, search for the closest record in the target sample database and copy and fill the corresponding attribute values of that record in the target sample database. By supplementing the data dimensions of the simplified data distribution model, the final data distribution model corresponding to the simplified sample data mapping set can be obtained. Furthermore, based on the data distribution model of the simplified sample data mapping set, it is possible to generate any number of target test data that meets the requirements for the target business system, completing the optimized generation of performance test data for the target business system.

[0107] The above technical solution proposes a method for optimizing the generation of business performance test data. This method analyzes the historical data content of existing businesses and generates simulated data based on the distribution of the content as the final test data for the business system, thereby optimizing the performance testing results of the business system. Table 1 uses transaction data from a business system as an example to provide a regression comparison of performance test indicators covering different platforms and different methods (traditional methods and the method proposed in this paper). The results show that the performance test data generated by the test data method provided by the embodiment of the present invention is closer to the actual business system performance data and has better testing results.

[0108] Table 1 Performance test index regression comparison table of different business system platforms and different methods

[0109]

[0110] The embodiment of the present invention proposes a performance test optimization simulation method based on business data content, which takes the target business sample data of the target business system in the target sample database as a benchmark, and normalizes the data by mapping the target business sample data of the target business system in the target sample database, which is convenient for describing the distribution of the data and concealing the original content of the data, which is conducive to protecting data privacy. The efficiency of data calculation can be improved by simplifying the sample data mapping set. Furthermore, a distribution model is calculated based on the simplified sample data mapping set obtained by simplifying the sample data mapping set, which is used to generate simulation data according to the distribution organization of the content as the generated test data for the target business system. The performance test data generated by the above method is closer to the real business system performance data, has better test results, and achieves optimization of performance test results.

[0111] In the technical solutions disclosed herein, the collection, storage, use, processing, transmission, provision and disclosure of user personal information are in compliance with the relevant laws and regulations and do not violate public order and good morals.

[0112] It should be noted that the relevant information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for display, data for analysis, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data comply with relevant laws, regulations and standards in the relevant regions.

[0113] It should be noted that any arrangement and combination of the technical features in the above embodiments also falls within the protection scope of the present invention.

[0114] Figure 3 Schematic diagram of a test data generating device provided by an embodiment of the present invention. Figure 3 As shown, the apparatus includes: a sample data mapping set generation module 310, a sample data mapping set simplification module 320, a data distribution model calculation module 330 and a target test data generation module 340, wherein:

[0115] The sample data mapping set generating module 310 is configured to map the target business sample data of the target business system stored in the target sample database to obtain a sample data mapping set;

[0116] A sample data mapping set simplification module 320 is configured to simplify the sample data mapping set to obtain a simplified sample data mapping set;

[0117] A data distribution model calculation module 330 is used to calculate the data distribution model of the simplified sample data mapping set;

[0118] The target test data generating module 340 is configured to generate target test data for the target business system according to the data distribution model of the simplified sample data mapping set.

[0119] The embodiment of the present invention maps the target business sample data of the target business system stored in the target sample database to obtain a sample data mapping set, and further simplifies the sample data mapping set to obtain a simplified sample data mapping set. After obtaining the simplified sample data mapping set, the data distribution model of the simplified sample data mapping set can be calculated, thereby generating target test data for the target business system based on the data distribution model of the simplified sample data mapping set. The above technical solution adopts a test data optimization method that is data-oriented rather than physical design-oriented, which can solve the problem of large differences between test data and production data in existing test data generation methods, and can improve the authenticity and effectiveness of the test data of the business system, thereby optimizing the performance testing effect of the business system.

[0120] Optionally, the sample data mapping set generation module 310 is further used to: generate an initial mapping of the target business sample data according to the attributes of the target business sample data; and perform post-mapping processing on the initial mapping of the target business sample data according to the attributes of the target business sample data to obtain the sample data mapping set.

[0121] Optionally, the sample data mapping set generation module 310 is also used to: when it is determined that the attribute of the target business sample data is a numeric type, the initial mapping of the target business sample data is the initial value of the target business sample data; when it is determined that the attribute of the target business sample data is a character type, the initial mapping of the target business sample data is the previous target set quantity of data of the target business sample data; wherein, the target set quantity is the system structure bit width of the target sample database.

[0122] Optionally, the sample data mapping set generation module 310 is further configured to: when it is determined that the attribute of the target business sample data is a numerical value, perform normalization processing on the initial mapping of the target business sample data based on the following formula;

[0123]

[0124] in, represents the normalized mapping of the initial mapping of the target service sample data, t i(k) represents the initial mapping of the kth record of the target business sample data.

[0125] Optionally, the sample data mapping set generation module 310 is also used to: when it is determined that the attribute of the target business sample data is of character type, delete the data content of the initial mapping of the attribute of the target business sample data to obtain mapping intermediate data; re-initialize the mapping intermediate data to obtain sub-attribute mapping; delete the data content of the initial mapping of the attribute of the sub-attribute mapping to obtain mapping intermediate data, and return to execute the operation of re-initializing the mapping intermediate data to obtain sub-attribute mapping until it is determined that the data of the sub-attribute mapping is empty; calculate the target mapping of the target business sample data according to the relevant metrics of the sub-attribute mapping.

[0126] Optionally, the sample data mapping set simplification module 320 is further used to: when it is determined that the attribute of the current sample data mapping in the sample data mapping set is a database index, add the current sample data mapping to the simplified sample data mapping set; when it is determined that the attribute of the current sample data mapping in the sample data mapping set is not a database index, calculate the covariance matrix of the current sample data mapping and all index mappings; calculate a related property index based on the covariance matrix of the current sample data mapping and all index mappings; when it is determined that the related property index is less than a preset empirical threshold, add the current sample data mapping to the simplified sample data mapping set.

[0127] Optionally, the data distribution model calculation module 330 is also used to: calculate the expectation and covariance matrices of the simplified sample data mapping set; calculate the simplified data distribution model of the simplified sample data mapping set based on the expectation and covariance matrices of the simplified sample data mapping set; and supplement the data dimensions of the simplified data distribution model to obtain the data distribution model of the simplified sample data mapping set.

[0128] The above-mentioned test data generation device can execute the test data generation method provided by any embodiment of the present invention, and has the functional modules and beneficial effects corresponding to the execution method. For technical details not fully described in this embodiment, please refer to the test data generation method provided by any embodiment of the present invention.

[0129] Since the test data generation device described above is a device that can execute the test data generation method in the embodiment of the present invention, and based on the test data generation method described in the embodiment of the present invention, those skilled in the art will be able to understand the specific implementation and various variations of the test data generation device in this embodiment, and therefore, how the test data generation device implements the test data generation method in the embodiment of the present invention will not be described in detail here. As long as those skilled in the art can implement the device used in the test data generation method in the embodiment of the present invention, it falls within the scope of protection of this application.

[0130] Figure 4 A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or claimed herein.

[0131] like Figure 4 As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., which is communicatively connected to the at least one processor 11. The memory stores a computer program that can be executed by the at least one processor. The processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 into the random access memory (RAM) 13. Various programs and data required for the operation of the electronic device 10 can also be stored in the RAM 13. The processor 11, ROM 12, and RAM 13 are connected to each other via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0132] Multiple components in the electronic device 10 are connected to the I / O interface 15, including an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a magnetic disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.

[0133] The processor 11 may be any general-purpose and / or specialized processing component with processing and computing capabilities. Examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various specialized artificial intelligence (AI) computing chips, various processors for running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as the test data generation method.

[0134] Optionally, the test data generation method may include: mapping the target business sample data of the target business system stored in the target sample database to obtain a sample data mapping set; simplifying the sample data mapping set to obtain a simplified sample data mapping set; calculating the data distribution model of the simplified sample data mapping set; and generating the target test data of the target business system based on the data distribution model of the simplified sample data mapping set.

[0135] In some embodiments, the test data generation method can be implemented as a computer program that is tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the test data generation method described above can be performed. Alternatively, in other embodiments, processor 11 can be configured to perform the test data generation method in any other suitable manner (e.g., by means of firmware).

[0136] Various embodiments of the systems and techniques described herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system-on-chip systems (SOCs), programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0137] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when the computer program is executed by the processor, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The computer program may be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

[0138] In the context of the present invention, computer-readable storage media can be tangible media that can contain or store a computer program for use with an instruction execution system, device or equipment or used in combination with an instruction execution system, device or equipment. Computer-readable storage media can include but are not limited to electronic, magnetic, optical, electromagnetic, infrared or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, computer-readable storage media can be machine-readable signal media. More specific examples of machine-readable storage media can include electrical connections based on one or more lines, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0139] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and the input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0140] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0141] A computing system may include clients and servers. The clients and servers are typically remote from each other and typically interact via a communication network. This client-server relationship arises through computer programs running on the respective computers, creating a client-server relationship. The server may be a cloud server, also known as a cloud computing server or cloud host. This server is a hosting product within the cloud computing service ecosystem that addresses the management difficulties and limited scalability of traditional physical hosting and VPS services.

[0142] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in this disclosure can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved. This is not a limitation herein.

[0143] The above specific embodiments do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure shall be included within the scope of protection of this disclosure.

Claims

1. A test data generation method, characterized in that: include: Mapping target business sample data of the target business system stored in the target sample database to obtain a sample data mapping set; Simplifying the sample data mapping set to obtain a simplified sample data mapping set; Calculating a data distribution model of the simplified sample data mapping set; Target test data of the target business system is generated according to the data distribution model of the simplified sample data mapping set.

2. The method according to claim 1, characterized in that The target business sample data of the target business system stored in the target sample database is mapped to obtain a sample data mapping set, including: generating an initial mapping of the target business sample data according to the attributes of the target business sample data; Post-mapping processing is performed on the initial mapping of the target business sample data according to the attributes of the target business sample data to obtain the sample data mapping set.

3. The method according to claim 2, characterized in that Generating an initial mapping of the target business sample data according to the attributes of the target business sample data includes: In the case where it is determined that the attribute of the target business sample data is a numerical value, the initial mapping of the target business sample data is the initial value of the target business sample data; In the case where the attribute of the target business sample data is determined to be character type, the initial mapping of the target business sample data is a pre-target set quantity of data of the target business sample data; The target setting quantity is the system structure bit width of the target sample database.

4. The method according to claim 2, characterized in that The performing post-mapping processing on the initial mapping of the target business sample data according to the attributes of the target business sample data includes: When it is determined that the attribute of the target business sample data is a numerical type, normalizing the initial mapping of the target business sample data based on the following formula; in, represents the normalized mapping of the initial mapping of the target service sample data, t i (k) represents the initial mapping of the kth record of the target business sample data.

5. The method according to claim 2, characterized in that The performing post-mapping processing on the initial mapping of the target business sample data according to the attributes of the target business sample data includes: When it is determined that the attribute of the target business sample data is of character type, deleting the data content of the initial mapping of the attribute of the target business sample data to obtain mapping intermediate data; Re-mapping the mapping intermediate data to obtain a sub-attribute mapping; Deleting the data content of the initial mapping for the attribute of the sub-attribute mapping to obtain mapping intermediate data, and returning to perform the operation of re-initial mapping on the mapping intermediate data to obtain the sub-attribute mapping, until it is determined that the data of the sub-attribute mapping is empty; The target mapping of the target business sample data is calculated according to the relevant metrics of the sub-attribute mapping.

6. The method according to claim 1, characterized in that The simplification of the sample data mapping set to obtain a simplified sample data mapping set includes: In a case where it is determined that the attribute of the current sample data mapping in the sample data mapping set is a database index, adding the current sample data mapping to the simplified sample data mapping set; When it is determined that the attribute of the current sample data mapping in the sample data mapping set is not a database index, calculating a covariance matrix between the current sample data mapping and all index mappings; Calculating a related property index based on the covariance matrix of the current sample data mapping and all index mappings; When it is determined that the relevant property indicator is less than a preset empirical threshold, the current sample data mapping is added to the simplified sample data mapping set.

7. The method according to claim 1, characterized in that The calculating the data distribution model of the simplified sample data mapping set includes: Calculating the expectation and covariance matrices of the simplified sample data mapping set; Calculating a simplified data distribution model of the simplified sample data mapping set according to the expectation and covariance matrix of the simplified sample data mapping set; The data dimensions of the simplified data distribution model are supplemented to obtain the data distribution model of the simplified sample data mapping set.

8. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executed by the at least one processor, and the computer program is executed by the at least one processor so as to enable the at least one processor to execute the test data generating method according to any one of claims 1 to 7.

9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the test data generating method according to any one of claims 1 to 7 when executed.

10. A computer program product comprising a computer program / instructions, wherein: When the computer program / instructions are executed by a processor, the test data generating method according to any one of claims 1 to 7 is implemented.