Data generation method and device, computer equipment, storage medium and program product

By acquiring and replacing template test data from the business system to generate target test data, the problem of low test data generation efficiency in traditional technologies is solved, and efficient batch generation of test data is achieved.

CN121901068APending Publication Date: 2026-04-21湖南长银五八消费金融股份有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
湖南长银五八消费金融股份有限公司
Filing Date
2025-12-09
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

In traditional technologies, generating test data requires writing a set of automated scripts for each test scenario, resulting in low efficiency in test data generation.

Method used

By acquiring template test data from the business system, a preset number of duplicate data are generated, and the initial information is replaced with new user information and new business identification information to generate target test data in batches.

Benefits of technology

There is no need to write a dedicated automation script for each test scenario. Test data is generated in batches by copying templates and replacing information, which reduces the cost of script writing and the difficulty of scenario adaptation, and improves the efficiency of test data generation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121901068A_ABST
    Figure CN121901068A_ABST
Patent Text Reader

Abstract

The invention relates to a data generation method and device, computer equipment, a storage medium and a program product, and the method comprises the steps: obtaining template test data corresponding to each target business scene related to a business system under the condition that the business system needs to be subjected to a performance test; for each target service scene, generating copy data of template test data corresponding to a preset number of target service scenes, and a preset number of different new user information and different new service identification information; for each piece of copy data, replacing the initial user information and the initial service identification information in the copy data with any new user information and new service identification information of a target service scene corresponding to the copy data to obtain target test data; wherein the target test data is used for carrying out performance test on the business system. The test data is generated in batches in a template copying and information replacing mode, and the test data generation efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of system performance testing technology, and in particular to a data generation method, apparatus, computer equipment, storage medium, and program product. Background Technology

[0002] Currently, with the development of technology, the functions of various business systems are becoming more abundant, and the data in these systems is becoming increasingly complex. In order to ensure the performance of these business systems, performance testing is necessary.

[0003] In traditional technologies, test scenario interface data is typically constructed and the interface is called using automated scripts to achieve the construction of test data for a specified scenario.

[0004] However, this method of generating test data requires writing a set of automated scripts for each test scenario to build interface data, resulting in low efficiency in test data generation. Summary of the Invention

[0005] Therefore, it is necessary to provide a data generation method, apparatus, computer equipment, storage medium, and program product to address the aforementioned technical problems and improve the efficiency of test data generation.

[0006] Firstly, this application provides a data generation method, including:

[0007] When performance testing of a business system is required, template test data corresponding to each target business scenario involved in the business system is obtained; wherein, the template test data includes at least initial user information, initial business identification information, and business association information;

[0008] For each target business scenario, generate a preset number of copies of template test data corresponding to the target business scenario, as well as a preset number of different new user information and different new business identification information;

[0009] For each copy of data, the initial user information and initial business identifier information in the copy of data are replaced with any new user information and new business identifier information of the target business scenario corresponding to the copy of data to obtain target test data; wherein, the target test data is used to perform performance testing on the business system.

[0010] In one embodiment, obtaining template test data corresponding to each target business scenario involved in the business system includes:

[0011] For each target business scenario, obtain the system user identifier under the target business scenario;

[0012] Based on the correspondence between different system user identifiers and different user information, the initial user information corresponding to the system user identifier is determined;

[0013] Based on the initial user information and the scene identifier corresponding to the target business scenario, determine the initial business identifier information and business association information corresponding to the initial user information and the scene identifier.

[0014] In one embodiment, generating the preset number of different new user information and different new service identification information includes:

[0015] Based on the device identifier, timestamp, and data numbering rules, a preset number of different new user information and different new service identifier information are generated; wherein, the device identifier is the identifier of the device used to generate the information.

[0016] In one embodiment, obtaining template test data corresponding to each target business scenario involved in the business system includes:

[0017] For each target business scenario, retrieve the template test data corresponding to the target business scenario from the first database.

[0018] In one embodiment, before generating a preset number of copies of the template test data corresponding to the target business scenario, the method further includes:

[0019] The template test data corresponding to the target business scenario is encapsulated into a data table and an entity class object corresponding to the data table;

[0020] The data table and the entity class objects corresponding to the data table are stored in a second database; wherein, the second database is located in a preset memory space;

[0021] The process of generating a preset number of copies of template test data corresponding to the target business scenario includes:

[0022] Using the data table as an index, query the entity class object corresponding to the data table in the second database;

[0023] The found entity class objects and their corresponding relationships are copied to generate a preset number of copies of the template test data corresponding to the target business scenario.

[0024] In one embodiment, each target business scenario involved in the business system is determined in the following way:

[0025] Obtain the candidate business scenarios involved in the business system, and the amount of log data corresponding to each candidate business scenario;

[0026] Candidate business scenarios corresponding to log data volumes exceeding a preset threshold are identified as target business scenarios.

[0027] Secondly, this application also provides a data generation apparatus, comprising:

[0028] The acquisition module is used to acquire template test data corresponding to each target business scenario involved in the business system when performance testing of the business system is required; wherein, the template test data includes at least initial user information, initial business identification information, and business association information;

[0029] The generation module is used to generate a preset number of copies of template test data corresponding to each target business scenario, as well as a preset number of different new user information and different new business identification information for each target business scenario.

[0030] The replacement module is used to replace the initial user information and initial business identifier information in each copy of the data with any new user information and new business identifier information corresponding to the target business scenario, thereby obtaining target test data; wherein, the target test data is used to perform performance testing on the business system.

[0031] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:

[0032] When performance testing of a business system is required, template test data corresponding to each target business scenario involved in the business system is obtained; wherein, the template test data includes at least initial user information, initial business identification information, and business association information;

[0033] For each target business scenario, generate a preset number of copies of template test data corresponding to the target business scenario, as well as a preset number of different new user information and different new business identification information;

[0034] For each copy of data, the initial user information and initial business identifier information in the copy of data are replaced with any new user information and new business identifier information of the target business scenario corresponding to the copy of data to obtain target test data; wherein, the target test data is used to perform performance testing on the business system.

[0035] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the following steps:

[0036] When performance testing of a business system is required, template test data corresponding to each target business scenario involved in the business system is obtained; wherein, the template test data includes at least initial user information, initial business identification information, and business association information;

[0037] For each target business scenario, generate a preset number of copies of template test data corresponding to the target business scenario, as well as a preset number of different new user information and different new business identification information;

[0038] For each copy of data, the initial user information and initial business identifier information in the copy of data are replaced with any new user information and new business identifier information of the target business scenario corresponding to the copy of data to obtain target test data; wherein, the target test data is used to perform performance testing on the business system.

[0039] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, performs the following steps:

[0040] When performance testing of a business system is required, template test data corresponding to each target business scenario involved in the business system is obtained; wherein, the template test data includes at least initial user information, initial business identification information, and business association information;

[0041] For each target business scenario, generate a preset number of copies of template test data corresponding to the target business scenario, as well as a preset number of different new user information and different new business identification information;

[0042] For each copy of data, the initial user information and initial business identifier information in the copy of data are replaced with any new user information and new business identifier information of the target business scenario corresponding to the copy of data to obtain target test data; wherein, the target test data is used to perform performance testing on the business system.

[0043] The aforementioned data generation method, apparatus, computer equipment, storage medium, and program product, when performance testing of a business system is required, acquire template test data corresponding to each target business scenario involved in the business system. The template test data includes at least initial user information, initial business identification information, and business association information. For each target business scenario, a preset number of copies of the template test data corresponding to the target business scenario are generated, along with a preset number of different new user information and different new business identification information. For each copy, the initial user information and initial business identification information in the copy data are replaced with any new user information and new business identification information of the target business scenario corresponding to the copy data to obtain the target test data. The target test data is used for performance testing of the business system. This solution eliminates the need to write dedicated automated scripts for each test scenario, generating test data in batches through template copying and information replacement, reducing script writing costs and scenario adaptation difficulty, and improving test data generation efficiency. Attached Figure Description

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

[0045] Figure 1 This is a flowchart illustrating a data generation method in one embodiment;

[0046] Figure 2 This is a schematic diagram of the process for obtaining template test data in one embodiment;

[0047] Figure 3 This is a flowchart illustrating the generation method in another embodiment;

[0048] Figure 4 This is a structural block diagram of a method apparatus in one embodiment;

[0049] Figure 5 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0050] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0051] The data generation method provided in this application embodiment can be applied to application scenarios for testing the performance of business systems.

[0052] This method can be executed by a server or a terminal. The server can be a standalone physical server, a server cluster or distributed system consisting of multiple physical servers, or a cloud server providing cloud computing services. The terminal can be, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, smart in-vehicle systems, and projection devices. Portable wearable devices can include smartwatches, smart bracelets, and head-mounted displays. Head-mounted displays can be virtual reality (VR) devices, augmented reality (AR) devices, and smart glasses.

[0053] In one exemplary embodiment, such as Figure 1 As shown, a data generation method is provided. Taking the application of this method to a server as an example, the method includes the following steps:

[0054] S101: When performance testing of a business system is required, obtain template test data corresponding to each target business scenario involved in the business system.

[0055] Among them, business systems refer to various business processing systems that require performance testing, such as loan systems and e-commerce transaction systems.

[0056] Target business scenarios refer to the scenarios in the business system that require key performance testing, such as normal repayment scenarios, overdue repayment scenarios, and early repayment scenarios in a loan system.

[0057] Template test data refers to the basic test data corresponding to the target business scenario, which contains core information to ensure the integrity of the scenario, including at least initial user information (such as customer name, ID number, contact number, etc.), initial business identification information (such as IOU number, contract number, overpayment account number, etc.) and business-related information (such as repayment plan, annual interest rate, account status, etc.).

[0058] For example, a dedicated data reading module can be used to read basic data corresponding to the target business scenario from a database (such as MySQL) that stores scenario data. Taking a loan system as an example, the data reading module can connect to the scenario database through Spring Data JPA, receive a specified customer identifier (ID) (this customer data conforms to the target test scenario, such as customer data in a normal repayment scenario), query all related data tables corresponding to that customer (customer table, loan agreement table, repayment plan table, etc.), and obtain complete template test data.

[0059] S102, for each target business scenario, generate a preset number of template test data copies corresponding to the target business scenario, as well as a preset number of different new user information and different new business identification information.

[0060] Among them, the copy data refers to the data copy obtained by copying the template test data, which has the same structure as the original template and whose core relationships remain unchanged.

[0061] New user information refers to user identifiers and related information that are generated separately for the copy data and are different from and unique to the initial user information, such as the ID number and customer ID of a newly added customer.

[0062] New business identification information refers to a unique business identifier generated separately for the copy data, which is different from the initial business identification information, such as a new loan receipt number or a new contract number.

[0063] For example, the read template test data can be encapsulated into entity class objects (DTOs) and then copied in batches in the Java Virtual Machine (JVM) memory using deep copy technology to generate a preset number (such as 1,000 or 10,000) of copies. During the copying process, the business relationships of the original template data are preserved, such as the association between the repayment plan and the IOU number.

[0064] For example, new user information and new business identification information can be randomly generated for each copy of the data, and the new user information and new business identification information generated for each copy of the data are not duplicated.

[0065] S103. For each copy of data, replace the initial user information and initial business identifier information in the copy data with any new user information and new business identifier information corresponding to the target business scenario of the copy data to obtain the target test data.

[0066] Among them, target test data refers to the final data that can be directly used for performance testing of business systems after copy generation and information replacement.

[0067] For example, in JVM memory, each copy of data can be traversed, and the initial user information and initial business identification information contained therein can be replaced with the corresponding newly generated user information and new business identification information. After the replacement, the business association information remains unchanged, and the target test data is finally formed.

[0068] The above data generation method, when performance testing of the business system is required, obtains template test data corresponding to each target business scenario involved in the business system. This template test data includes at least initial user information, initial business identification information, and business association information. For each target business scenario, a preset number of copies of the template test data corresponding to the target business scenario are generated, along with a preset number of different new user information and different new business identification information. For each copy, the initial user information and initial business identification information in the copy data are replaced with any new user information and new business identification information from the target business scenario corresponding to the copy data to obtain the target test data. This target test data is used for performance testing of the business system. This solution eliminates the need to write dedicated automated scripts for each test scenario, generating test data in batches through template copying and information replacement, reducing script writing costs and scenario adaptation difficulty, and improving test data generation efficiency.

[0069] In some alternative implementations, see [link to relevant documentation]. Figure 2 , Figure 2 A flowchart for obtaining template test data is provided, which includes the following steps:

[0070] S201, for each target business scenario, obtain the system user identifier under the target business scenario.

[0071] Among them, the system user identifier refers to the number used to uniquely identify users in the business system, such as the customer ID in the loan system or the user account in the e-commerce system.

[0072] For example, the system user identifier that matches the target business scenario can be received by the user through the interface. For example, in a loan system, the user can input a customer ID=1001 that matches the normal repayment scenario; or the default system user identifier corresponding to the target business scenario can be automatically read from the scenario configuration table.

[0073] S202, Based on the correspondence between different system user identifiers and different user information, determine the initial user information corresponding to the system user identifier.

[0074] Among them, the correspondence between different system user identifiers and different user information refers to the mapping table or association rules pre-stored in the system, such as the one-to-one correspondence table between customer ID and user information such as customer name, ID number, and contact number.

[0075] For example, based on the obtained system user identifier, a preset system user identifier and user information mapping table can be queried to extract all user basic information associated with the system user identifier as initial user information.

[0076] S203, based on the initial user information and the scenario identifier corresponding to the target business scenario, determine the initial business identifier information and business association information corresponding to the initial user information and the scenario identifier.

[0077] Among them, the scenario identifier refers to the unique identifier used to distinguish different target business scenarios, such as the scenario name or code for normal repayment, overdue repayment, and early repayment, such as SCENE_001, SCENE_002, etc.

[0078] For example, the initial user information and scenario identifier can be used as joint query conditions to connect to the business database through Spring DataJPA, query all business data of the user in the scenario, extract core business identifiers (such as IOU number and contract number) as initial business identifier information, and extract business rules, status and other information as business association information.

[0079] For example, let's take the overdue repayment scenario of a loan system, with the scenario identifier SCENE_002, as an example for illustration.

[0080] First, obtain the system user identifier. You can input the customer ID (system user identifier) ​​that matches the overdue scenario through the interface, such as customer ID=1002.

[0081] This allows you to determine the initial user information. For example, you can query the "Customer ID and User Information Mapping Table" to find that the initial user information corresponding to Customer ID=1002 is "Name: XXX, ID Number: XXXX, Contact Number: XXX".

[0082] Furthermore, determine the initial business identification information and business association information. The loan business database can be queried using the condition "Customer ID=1002+Scenario Identifier=SCENE_002" to obtain the initial business identification information (loan receipt number: XXX, contract number: XXX) and business association information (repayment method: equal principal repayment, annual interest rate: 4.8%, overdue days: 15 days, overdue penalty interest rate: 0.05% / day, account status: overdue).

[0083] In the above embodiments, the core data of the target business scenario can be accurately located through the joint query logic of system user identifier and scenario identifier, ensuring that the obtained template test data is highly matched with the scenario requirements and avoiding data redundancy or missing data; and based on the preset mapping relationship and joint query rules, the initial information is automatically extracted without manual intervention, improving the efficiency and accuracy of template test data acquisition.

[0084] In some optional implementations, a preset number of different new user information and different new business identification information can be generated based on device identifier, timestamp, and data numbering rules; where the device identifier is the identifier of the device used to generate the information.

[0085] Among them, device identifier refers to the device used to perform information generation operations, such as the unique identifier of the server that deploys the customer information change module, such as server number SV001, SV002, device media access control (MAC) address, etc.

[0086] A timestamp refers to the system time when the information was generated, usually recorded with millisecond precision, such as 1718000000000, which corresponds to 10:00:00 on June 10, 2024, and is used to ensure the time uniqueness of the information.

[0087] Data numbering rules refer to preset auto-incrementing sequence rules, such as starting from 0001 and incrementing sequentially, used to distinguish multiple pieces of information generated by the same device and under the same timestamp.

[0088] For example, the system can automatically read the preset identifier of the deployed device, such as server number SV001, or the device hardware identifier, such as MAC address, as the device identifier. When generating new information, the system time interface can be called to obtain the current millisecond-level timestamp, such as 1718000000000. Following a preset auto-incrementing sequence rule, a unique number can be assigned to each new piece of information, starting from an initial value such as 0001, with the number automatically incrementing by 1 after each piece of information is generated. Then, the device identifier, timestamp, and data number are combined in a preset format, such as a combination of device identifier_timestamp_data number, to generate core identifiers (such as customer ID) and new business identifiers (such as IOU number, contract number) in the new user information, ensuring that all new information is unique.

[0089] In the above embodiments, a triple unique mechanism of device identifier, timestamp, and data number is used to ensure that the generated new user information and new business identifier information are not duplicated, thus avoiding primary key conflicts when writing data later.

[0090] In some optional implementations, obtaining the template test data corresponding to each target business scenario involved in the business system can be achieved by retrieving the template test data corresponding to each target business scenario from the first database.

[0091] The first database refers to the database that stores the template test data corresponding to each target business scenario of the business system. It is usually a persistent database (such as MySQL or Oracle) and can contain multiple database instances for classifying and storing different scenarios or different types of scenario data.

[0092] For example, the first database instance where the template test data for a given scenario resides can be determined based on the configuration information of the target business scenario, such as the mapping relationship between scenario identifiers and database instances. For instance, in a loan system, normal repayment scenario data is stored in the MySQL instance DB_SCENE_NORMAL, and overdue scenario data is stored in the MySQL instance DB_SCENE_OVERDUE.

[0093] Furthermore, the Spring Data JPA framework can be used to establish a stable connection with a specific first database instance based on preset database connection parameters, such as URL, username, and password.

[0094] Furthermore, the system user identifier and scenario identifier corresponding to the target business scenario can be used as query conditions to query complete scenario data from relevant data tables (such as customer table, loan table, repayment plan table) in the first database through SQL statements or JPA query methods, and then integrated and returned as template test data.

[0095] In the above embodiments, the first database uses persistent storage to ensure the security and reusability of the template test data. The same template data can be used multiple times for performance testing in different batches.

[0096] In some optional implementations, before generating a preset number of copies of the template test data corresponding to the target business scenarios, the template test data corresponding to the target business scenarios can be encapsulated into data tables and entity class objects corresponding to the data tables; and the data tables and entity class objects corresponding to the data tables are stored in a second database; wherein, the second database is located in a preset memory space.

[0097] The data tables refer to structured data tables formed by splitting the template test data according to business types, such as customer data tables, loan data tables, and repayment plan data tables. Each table contains fields corresponding to the business type; for example, the customer table contains fields such as customer ID, name, and ID number. Entity objects refer to Java entity classes (DTOs, Data Transfer Objects) that correspond one-to-one with the data table structure. They are used to encapsulate the data in the data tables, facilitating data transfer and processing in memory. The secondary database refers to a cache database (such as Redis) located in a pre-defined memory space, used to temporarily store the encapsulated data tables and entity objects, supporting high-speed read and write operations.

[0098] For example, after obtaining template test data from the first database, it can be split into multiple data tables according to business type (such as customer table, loan table), and the data in each data table can be converted into corresponding entity class objects (such as CustomerDTO, LoanDTO) to ensure that the fields of the entity class objects are fully mapped to the fields of the data tables.

[0099] Furthermore, the RedisTemplate tool can be used to construct a HashMap data structure by using the table name as the key and serializing the entity class object into a JSON string as the value. This data can then be written in batches to a specified database (DB) in the second database (such as DB5 in Redis) to complete the data caching.

[0100] Based on this, a preset number of template test data copies corresponding to target business scenarios are generated. The data table can be used as an index to query the entity class objects corresponding to the data table in the second database; and the found entity class objects and the correspondence between them are copied to generate a preset number of template test data copies corresponding to target business scenarios.

[0101] For example, when generating replica data, the table name can be used as the index (key) to query the corresponding JSON string in the second database using RedisTemplate, and then deserialize it into an entity class object, such as CustomerDTO.

[0102] Furthermore, deep copy tools, such as Apache Commons Lang's SerializationUtils, can be used to batch copy the deserialized entity class objects and their relationships (such as the relationship between CustomerDTO and LoanDTO), generating a preset number of copies of data while maintaining the structure and relationships of the entity class objects unchanged during the copying process.

[0103] In the above embodiments, the second database is an in-memory database, which has a much faster read and write speed than a persistent database. This improves the efficiency of querying and copying entity objects, shortens the generation time of replica data, and thus improves the efficiency of the overall data generation process.

[0104] In some alternative implementations, each target business scenario involved in the business system is determined in the following ways:

[0105] Obtain all candidate business scenarios involved in the business system, as well as the log data volume corresponding to each candidate business scenario; identify the candidate business scenarios with log data volumes exceeding a preset threshold as the target business scenarios.

[0106] Among them, candidate business scenarios refer to all business scenarios in the business system that may require performance testing, such as normal repayment, overdue repayment, early repayment, extension, and settlement in the loan system.

[0107] Log data volume refers to the number of business operation log entries generated for each candidate business scenario within a preset time period (such as the past 3 months). The logs record the actual usage frequency and data processing volume of the scenario, such as the number of daily repayment operation log entries in the normal repayment scenario.

[0108] The preset threshold refers to the pre-set standard for judging the amount of log data, which is used to distinguish between core and non-core scenarios. The threshold can be adjusted according to business needs, such as 10,000 log entries / month.

[0109] For example, the scenario configuration table of the business system can be traversed to extract all defined business scenarios as candidate business scenarios. For instance, the loan system can extract five candidate scenarios: normal repayment, overdue repayment, early repayment, extension, and settlement.

[0110] Then, query the log database of the business system (such as the ELK log system), group the candidate business scenarios, and count the total number of log entries for each scenario within a preset time period (such as the last 3 months), which is taken as the log data volume for that scenario.

[0111] Then, the log data volume of each candidate business scenario is compared with a preset threshold (such as 10,000 logs / month). Candidate business scenarios with log data volume exceeding the threshold are identified as target business scenarios, and performance testing is carried out in a focused manner.

[0112] In the above embodiments, by filtering target business scenarios based on the amount of log data, it is possible to accurately locate core scenarios in the business system that are frequently used and have a large amount of data processing, making performance testing more targeted, avoiding ineffective testing of low-frequency scenarios, and saving testing resources.

[0113] In some alternative implementations, see [link to relevant documentation]. Figure 3 , Figure 3 A flowchart illustrating another data generation method is provided, which includes the following steps:

[0114] S301: For each target business scenario, retrieve the template test data corresponding to the target business scenario from the first database.

[0115] S302 encapsulates the template test data corresponding to the target business scenario into a data table and entity class objects corresponding to the data table.

[0116] S303, store the data table and the corresponding entity class object in the second database.

[0117] S304: Using the data table as an index, query the entity class object corresponding to the data table in the second database.

[0118] S305, copy the found entity class objects and the corresponding relationships between them to generate a preset number of template test data copies corresponding to the target business scenarios.

[0119] S306 generates a preset number of different new user information and different new service identification information based on device identification, timestamp and data numbering rules.

[0120] S307. For each copy of data, replace the initial user information and initial business identifier information in the copy data with any new user information and new business identifier information of the target business scenario corresponding to the copy data to obtain the target test data.

[0121] The specific processes of S301 to S307 described above can be found in the description of the above method embodiments. Their implementation principles and technical effects are similar, and will not be repeated here.

[0122] Furthermore, the execution order of the above steps is merely illustrative and is not intended to limit the execution steps. The execution order of other steps is within the protection scope of the embodiments of this application.

[0123] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0124] Based on the same inventive concept, this application also provides a data generation apparatus for implementing the data generation method described above. The solution provided by this apparatus is similar to the implementation scheme described in the above method; therefore, the specific limitations in one or more data generation apparatus embodiments provided below can be found in the limitations of the data generation method described above, and will not be repeated here.

[0125] In one exemplary embodiment, such as Figure 4 As shown, a data generation apparatus is provided, comprising:

[0126] The acquisition module 10 is used to acquire template test data corresponding to each target business scenario involved in the business system when performance testing of the business system is required; wherein, the template test data includes at least initial user information, initial business identification information and business association information;

[0127] The generation module 20 is used to generate a preset number of template test data copies for each target business scenario, as well as a preset number of different new user information and different new business identification information.

[0128] The replacement module 30 is used to replace the initial user information and initial business identifier information in each copy data with any new user information and new business identifier information corresponding to the target business scenario of the copy data, so as to obtain the target test data; wherein, the target test data is used to perform performance testing on the business system.

[0129] The aforementioned data generation device, when performance testing of a business system is required, acquires template test data corresponding to each target business scenario involved in the business system. This template test data includes at least initial user information, initial business identification information, and business association information. For each target business scenario, it generates a preset number of copies of the template test data corresponding to that target business scenario, as well as a preset number of different new user information and different new business identification information. For each copy of the data, it replaces the initial user information and initial business identification information in the copy with any new user information and new business identification information from the target business scenario corresponding to the copy, thus obtaining the target test data. This target test data is used for performance testing of the business system. This solution eliminates the need to write dedicated automated scripts for each test scenario, generating test data in batches through template copying and information replacement, reducing script writing costs and scenario adaptation difficulties, and improving test data generation efficiency.

[0130] In one embodiment, the acquisition module 10 is specifically used for:

[0131] For each target business scenario, obtain the system user identifier under the target business scenario; based on the correspondence between different system user identifiers and different user information, determine the initial user information corresponding to the system user identifier; based on the initial user information and the scenario identifier corresponding to the target business scenario, determine the initial business identifier information and business association information corresponding to the initial user information and the scenario identifier.

[0132] In one embodiment, the generation module 20 is specifically used for:

[0133] Based on the device identifier, timestamp, and data numbering rules, a preset number of different new user information and different new business identifier information are generated; among them, the device identifier is the identifier of the device used to generate the information.

[0134] In one embodiment, the acquisition module 10 is specifically used for:

[0135] For each target business scenario, retrieve the corresponding template test data from the first database.

[0136] In one embodiment, the device further includes a storage module for encapsulating template test data corresponding to the target business scenario into a data table and entity class objects corresponding to the data table; storing the data table and entity class objects corresponding to the data table into a second database; wherein the second database is located in a preset memory space;

[0137] The generation module is used to query the entity class objects corresponding to the data table in the second database using the data table as an index; and to copy the found entity class objects and the correspondence between them to generate a preset number of template test data copies corresponding to the target business scenarios.

[0138] In one embodiment, the device further includes a determining module for:

[0139] Obtain all candidate business scenarios involved in the business system, as well as the log data volume corresponding to each candidate business scenario; identify the candidate business scenarios with log data volumes exceeding a preset threshold as the target business scenarios.

[0140] Each module in the aforementioned data generation device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.

[0141] In one exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 5As shown, this computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores test data. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. When executed by the processor, the computer program implements a data generation method.

[0142] Those skilled in the art will understand that Figure 5 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0143] In one exemplary embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the data generation method described in any of the above embodiments.

[0144] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps of the data generation method described in any of the above embodiments.

[0145] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps of the data generation method described in any of the above embodiments.

[0146] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.

[0147] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.

[0148] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0149] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A data generation method, characterized in that, The method includes: When performance testing of a business system is required, template test data corresponding to each target business scenario involved in the business system is obtained; wherein, the template test data includes at least initial user information, initial business identification information, and business association information; For each target business scenario, generate a preset number of copies of template test data corresponding to the target business scenario, as well as a preset number of different new user information and different new business identification information; For each copy of data, the initial user information and initial business identifier information in the copy of data are replaced with any new user information and new business identifier information of the target business scenario corresponding to the copy of data to obtain target test data; wherein, the target test data is used to perform performance testing on the business system.

2. The method according to claim 1, characterized in that, The step of obtaining template test data corresponding to each target business scenario involved in the business system includes: For each target business scenario, obtain the system user identifier under the target business scenario; Based on the correspondence between different system user identifiers and different user information, the initial user information corresponding to the system user identifier is determined; Based on the initial user information and the scene identifier corresponding to the target business scenario, determine the initial business identifier information and business association information corresponding to the initial user information and the scene identifier.

3. The method according to claim 1, characterized in that, Generating the preset number of different new user information and different new service identification information includes: Based on the device identifier, timestamp, and data numbering rules, a preset number of different new user information and different new business identifier information are generated; wherein, the device identifier is the identifier of the device used to generate the information.

4. The method according to claim 1, characterized in that, Obtain template test data corresponding to each target business scenario involved in the business system, including: For each target business scenario, retrieve the template test data corresponding to the target business scenario from the first database.

5. The method according to claim 4, characterized in that, Before generating a preset number of copies of the template test data corresponding to the target business scenario, the method further includes: The template test data corresponding to the target business scenario is encapsulated into a data table and an entity class object corresponding to the data table; The data table and the entity class objects corresponding to the data table are stored in a second database; wherein, the second database is located in a preset memory space; The process of generating a preset number of copies of template test data corresponding to the target business scenario includes: Using the data table as an index, query the entity class object corresponding to the data table in the second database; The found entity class objects and their corresponding relationships are copied to generate a preset number of copies of the template test data corresponding to the target business scenario.

6. The method according to claim 1, characterized in that, Each target business scenario involved in the business system is determined in the following way: Obtain the candidate business scenarios involved in the business system, and the amount of log data corresponding to each candidate business scenario; Candidate business scenarios corresponding to log data volumes exceeding a preset threshold are identified as target business scenarios.

7. A data generation apparatus, characterized in that, The device includes: The acquisition module is used to acquire template test data corresponding to each target business scenario involved in the business system when performance testing of the business system is required; wherein, the template test data includes at least initial user information, initial business identification information, and business association information; The generation module is used to generate a preset number of copies of template test data corresponding to each target business scenario, as well as a preset number of different new user information and different new business identification information for each target business scenario. The replacement module is used to replace the initial user information and initial business identifier information in each copy of the data with any new user information and new business identifier information corresponding to the target business scenario, thereby obtaining target test data; wherein, the target test data is used to perform performance testing on the business system.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.