Test data generation method and device, storage medium and electronic device

By preprocessing and clustering the collected data, accurate data generation rules are generated, which solves the problem of insufficient effectiveness of test data generated by templated scripts and improves the quality and adaptability of test data.

CN122152707APending Publication Date: 2026-06-05DUXIAOMAN TECH (BEIJING) CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
DUXIAOMAN TECH (BEIJING) CO LTD
Filing Date
2026-03-20
Publication Date
2026-06-05

AI Technical Summary

Technical Problem

Existing technologies that generate test data using templated scripts struggle to handle rapidly iterating business rules, resulting in poor test data validity.

Method used

By acquiring target data, performing data preprocessing and clustering, generating data generation rules based on interface instruction data and clustering results, and using the target rule generation model to generate test data.

Benefits of technology

It achieves precise alignment of test data with test scenarios and business rules, improves the effectiveness and overall quality of test data, and adapts to the business needs of rapid rule iteration.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122152707A_ABST
    Figure CN122152707A_ABST
Patent Text Reader

Abstract

The application provides a test data generation method and device, a storage medium and an electronic device. The method comprises: performing data preprocessing on a plurality of initial data information of each data object to obtain a plurality of target data information of each data object; performing clustering processing on the plurality of target data information of each data object to obtain a clustering result of each data object; determining rule generation indication data corresponding to each data object under each to-be-tested interface based on interface indication data of each to-be-tested interface and the clustering result of each data object; calling a target rule generation model to generate data generation rules corresponding to each to-be-tested interface based on the rule generation indication data corresponding to each data object under each to-be-tested interface, and the data generation rule corresponding to one to-be-tested interface is used to generate test data under the corresponding to-be-tested interface. The embodiment of the application can conveniently generate data generation rules to improve the effectiveness of test data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and in particular to a test data generation method, apparatus, storage medium, and electronic device. Background Technology

[0002] Currently, the authenticity and compatibility of software system test data directly affect test coverage and defect detection rates. For example, especially in the internet finance sector, test effectiveness is crucial for financial transaction security, business compliance, and user fund security. Related technologies typically generate test data through templated scripts, meaning test data is usually generated in batches based on preset templates. However, these templates are fixed, have high maintenance costs, and struggle to handle rapidly iterating business rules (such as in financial transactions), leading to poor validity of the generated test data. Therefore, there is currently no satisfactory solution for conveniently generating data generation rules to improve the validity of test data. Summary of the Invention

[0003] In view of this, embodiments of the present invention provide a test data generation method, apparatus, storage medium, and electronic device to solve the problem of poor test data validity caused by related technologies. That is, embodiments of the present invention can conveniently generate data generation rules corresponding to each interface to be tested by using the interface instruction data of each interface to be tested and the clustering results of each data object. This allows the data generation rules to accurately align with the test scenario and business rules, ensuring that the generated test data can directly serve the test requirements. This can effectively improve the validity and overall quality of the test data, and thus effectively adapt to the business of rapid rule iteration.

[0004] According to one aspect of the present invention, a test data generation method is provided, the method comprising: Acquire target collection data and acquire interface indication data of each interface to be tested in at least one interface to be tested. The target collection data includes collection data of each data object in at least one data object. The collection data of a data object includes multiple initial data information of the corresponding data object. Data preprocessing is performed on multiple initial data information of each data object to obtain multiple target data information of each data object; and clustering processing is performed on multiple target data information of each data object to obtain clustering results of each data object. Based on the interface indication data of each interface to be tested and the clustering results of each data object, rule generation indication data corresponding to each data object under each interface to be tested is determined. A data object under an interface to be tested includes the interface parameters of the corresponding interface to be tested. The target rule generation model is invoked respectively, and instruction data is generated based on the rule corresponding to each data object under each interface to be tested. The data generation rule corresponding to each interface to be tested is used to generate test data under the corresponding interface to be tested.

[0005] According to another aspect of the present invention, a test data generation apparatus is provided, the apparatus comprising: The acquisition unit is used to acquire target acquisition data and acquire interface indication data of each interface to be tested in at least one interface to be tested. The target acquisition data includes acquisition data of each data object in at least one data object. The acquisition data of a data object includes multiple initial data information of the corresponding data object. The processing unit is configured to perform data preprocessing on multiple initial data information of each data object to obtain multiple target data information of each data object; and to perform clustering processing on the multiple target data information of each data object to obtain the clustering result of each data object. The processing unit is further configured to determine the rule-generated indicator data corresponding to each data object under each interface to be tested based on the interface indicator data of each interface to be tested and the clustering results of each data object. The data object under an interface to be tested includes the interface parameters of the corresponding interface to be tested. The processing unit is also used to call the target rule generation model respectively, generate instruction data based on the rule corresponding to each data object under each interface to be tested, generate data generation rules corresponding to each interface to be tested, and use the data generation rule corresponding to an interface to be tested to generate test data under the corresponding interface to be tested.

[0006] According to another aspect of the present invention, an electronic device is provided, the electronic device including a processor and a memory storing a program, wherein the program includes instructions that, when executed by the processor, cause the processor to perform the methods mentioned above.

[0007] According to another aspect of the present invention, a non-transitory computer-readable storage medium storing computer instructions for causing a computer to perform the methods mentioned above is provided.

[0008] This invention can acquire target acquisition data and interface indication data for each interface under test in at least one interface under test. The target acquisition data includes acquisition data for each data object in at least one data object, and the acquisition data for a data object includes multiple initial data information for the corresponding data object. Then, data preprocessing can be performed on the multiple initial data information of each data object to obtain multiple target data information for each data object. Clustering processing can be performed on the multiple target data information of each data object to obtain the clustering results for each data object. Further, based on the interface indication data of each interface under test and the clustering results of each data object, rule generation indication data corresponding to each data object under each interface under test can be determined. A data object under a test interface includes the interface parameters of the corresponding interface under test. Further, a target rule generation model can be called to generate indication data based on the rules corresponding to each data object under each interface under test, generating data generation rules corresponding to each interface under test. A data generation rule corresponding to a test interface is used to generate test data under the corresponding interface under test. As can be seen, the embodiments of the present invention can conveniently generate data generation rules corresponding to each interface to be tested by using the interface instruction data of each interface to be tested and the clustering results of each data object. This enables the data generation rules to accurately align with the test scenario and business rules, ensuring that the generated test data can directly serve the test requirements. This can effectively improve the validity and overall quality of the test data, and thus effectively adapt to the business of rapid rule iteration. Attached Figure Description

[0009] Further details, features, and advantages of the invention are disclosed in the following description of exemplary embodiments in conjunction with the accompanying drawings, in which: Figure 1 A flowchart illustrating a test data generation method according to an exemplary embodiment of the present invention is shown; Figure 2 A flowchart illustrating another test data generation method according to an exemplary embodiment of the present invention is shown; Figure 3 A schematic block diagram of a test data generation apparatus according to an exemplary embodiment of the present invention is shown; Figure 4 A structural block diagram of an exemplary electronic device that can be used to implement embodiments of the present invention is shown. Detailed Implementation

[0010] Embodiments of the present invention will now be described in more detail with reference to the accompanying drawings. While some embodiments of the invention are shown in the drawings, it should be understood that the invention can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the invention. It should be understood that the accompanying drawings and embodiments are for illustrative purposes only and are not intended to limit the scope of protection of the invention.

[0011] It should be understood that the various steps described in the method embodiments of the present invention may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present invention is not limited in this respect.

[0012] The term "comprising" and its variations as used herein are open-ended, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Definitions of other terms will be given in the following description. It should be noted that the concepts of "first", "second", etc., mentioned in this invention are used only to distinguish different devices, modules, or units, and are not intended to limit the order of functions performed by these devices, modules, or units or their interdependencies.

[0013] It should be noted that the terms "a" and "a plurality of" used in this invention are illustrative rather than restrictive. Those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".

[0014] The names of the messages or information exchanged between the multiple devices in the embodiments of the present invention are for illustrative purposes only and are not intended to limit the scope of these messages or information.

[0015] It should be noted that the execution subject of the test data generation method provided in the embodiments of the present invention can be one or more electronic devices, and the embodiments of the present invention do not limit this; wherein, the electronic device can be a terminal (i.e., a client) or a server. When the execution subject includes multiple electronic devices, and the multiple electronic devices include at least one terminal and at least one server, the test data generation method provided in the embodiments of the present invention can be jointly executed by the terminal and the server.

[0016] Accordingly, the terminals mentioned here may include, but are not limited to, smartphones, tablets, laptops, desktop computers, intelligent voice interaction devices, and so on. The servers mentioned here may be independent physical servers, server clusters or distributed systems composed of multiple physical servers, or cloud servers providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms, and so on.

[0017] Optionally, embodiments of the present invention may also provide a test data generation system, which may include, but is not limited to, a data acquisition and classification module, a data generation and scheduling module, etc., and embodiments of the present invention do not limit this; based on this, one or more electronic devices equipped with the test data generation system can be used to execute the test data generation method provided by embodiments of the present invention, that is, electronic devices can execute the test data generation method provided by embodiments of the present invention through the test data generation system, etc.

[0018] Based on the above description, embodiments of the present invention propose a test data generation method. This test data generation method can be executed by the aforementioned electronic device (terminal or server); or, it can be executed jointly by the terminal and the server; or, it can be executed by a test data generation system, and so on. For ease of explanation, the following description will use the execution of this test data generation method by an electronic device as an example; such as... Figure 1 As shown, the test data generation method may include the following steps S101-S104: S101, acquire target acquisition data and acquire interface indication data of each interface to be tested in at least one interface to be tested. The target acquisition data includes acquisition data of each data object in at least one data object. The acquisition data of a data object includes multiple initial data information of the corresponding data object.

[0019] Optionally, the aforementioned at least one data object may include, but is not limited to, at least one of the following: at least one structured parameter (i.e., data item, such as credit amount, account balance, etc., also referred to as structured data), at least one semi-structured parameter (such as alarm logs, etc., also referred to as semi-structured data), and at least one unstructured parameter (such as customer post-loan overdue explanation, investigation record, customer feedback text, etc., also referred to as unstructured data), etc., and this embodiment of the invention does not limit this. Optionally, at least one data object may include all data objects called by each interface to be tested, that is, it may include all interface parameters of each interface to be tested. Optionally, at least one interface to be tested may include any interface, and this embodiment of the invention does not limit this; for example, at least one interface to be tested may include all interfaces in any financial software system, etc. Wherein, a data information (such as initial data information, etc.) of a data object may be a value (i.e., Value) of the corresponding data object; optionally, an initial data information may be a collected value. Optionally, the electronic device may read table structure information in the database (including but not limited to at least one of the following: name, type, length, whether it is required, whether it has a default value, etc. of each data item), and at least one data object may also include each data item in the table structure information.

[0020] Optionally, the target data to be collected may include real-time data and historical data collected in the online production environment. For example, taking the financial sector as an example, the real-time data may include, but is not limited to, high-frequency fluctuating financial data (such as real-time transaction records, user account balance changes, risk control alarm information, etc.); correspondingly, the historical data may include large-scale historical financial data (such as user historical credit records, etc.). In this embodiment of the invention, the methods for obtaining the target data may include, but are not limited to, the following: The first acquisition method: The electronic device can receive the target acquisition data sent by the data acquisition system to acquire the target acquisition data; in this case, the target acquisition data can be acquired through the data acquisition system.

[0021] The second method of acquisition: Electronic devices can obtain data acquisition and download links, and download the target data based on the data acquisition and download links to achieve the acquisition of the target data.

[0022] The third method of acquisition: electronic devices can perform real-time data acquisition and offline historical data acquisition to obtain the target data, etc.

[0023] In this embodiment of the invention, the target data can be collected based on a target data collection mechanism, which may include real-time data collection and offline historical data collection. Optionally, during real-time data collection, message queues (such as Kafka, a distributed, high-throughput, persistent message queue / stream processing platform) can be used to collect data in real time to avoid data loss; and stream processing frameworks (such as Flink, a distributed, high-performance, highly available real-time stream processing framework) can be used to parse and clean the real-time data (such as identifying and cleaning abnormal data) to ensure the real-time performance and validity of the data, such as supporting the dynamic data needs in financial scenarios. Optionally, during offline historical data collection, batch processing frameworks (such as Spark, a distributed, general-purpose big data processing engine) can be used to periodically collect all historical data, and distributed file systems (such as HDFS, a distributed file system) can be used for storage. Furthermore, sensitive data (such as ID card numbers, bank card numbers, etc.) can be anonymized using differential privacy technology, which can support the diversity of test data while meeting compliance requirements. Based on this, in the field of internet finance, the embodiments of the present invention can connect to multiple data sources in the online financial production environment, covering core financial business data, and can realize real-time and offline mixed mode data collection through a distributed collection framework, thereby ensuring data integrity and timeliness.

[0024] Optionally, the electronic device can also read interface indication data (also known as interface parameter definition or usage scenario) to obtain the interface indication data of each interface to be tested. Optionally, the interface indication data of an interface to be tested may include, but is not limited to, at least one of the following: parameter name, data business meaning, data constraints, data type, whether it is required, and default value of the interface parameters of the corresponding interface to be tested, etc., which are not limited in this embodiment. Optionally, the interface indication data of an interface to be tested may be obtained from the API (Application Programming Interface) document of the corresponding interface to be tested, or it may be downloaded based on the interface indication data download link, etc., which are not limited in this embodiment. Optionally, the number of interface parameters (i.e., the parameters required to call the corresponding interface to be tested) of an interface to be tested may be one or more, which are not limited in this embodiment.

[0025] S102, perform data preprocessing on multiple initial data information of each data object to obtain multiple target data information of each data object; and perform clustering processing on multiple target data information of each data object to obtain clustering results of each data object.

[0026] In one implementation, for any data object among at least one data object, when any data object is a structured parameter, the electronic device can normalize multiple initial data information of any data object to obtain multiple target data information (i.e., normalization results) of any data object, thereby achieving data preprocessing of multiple initial data information of any data object. For example, Min-Max normalization (a linear normalization method) can be used to normalize multiple initial data information of any data object, thereby mapping the interval of any data object to [0, 1], which can eliminate dimensional differences between different structured parameters.

[0027] In another implementation, when any data object is a semi-structured parameter (i.e., when the initial data information of any data object is semi-structured data), the electronic device can extract the target data information (i.e., key data) of each initial data information from multiple initial data information of any data object through the target extraction syntax, thereby obtaining multiple target data information of any data object. Based on this, the multiple initial data information of any data object can be converted into a structured table, which may include multiple target data information of any data object; optionally, a target data information may include the parameter values ​​of each extraction parameter in at least one extraction parameter. Optionally, the target extraction syntax may be JsonPath syntax (a path syntax for querying JSON (JavaScript Object Notation, a lightweight data interchange format) semi-structured data), or native JSON extraction syntax, etc., and this embodiment of the invention does not limit this.

[0028] In another implementation, when any data object is an unstructured parameter (i.e., the initial data information of any data object is unstructured data), the electronic device can use a target pre-trained language model to perform feature vector transformation on each initial data information of any data object, thereby generating semantic features of each initial data information of any data object. These semantic features can then be used as multiple target data information of any data object. In other words, multiple target data information of any target data object can include the semantic features of each initial data information of any data object, ensuring that text information participates in clustering calculations. Optionally, the target pre-trained language model can be a BERT model (Bidirectional Encoder Representations from Transformers, a large-scale bidirectional pre-trained model), or a Wenxin Yiyan model (a generative language model based on Wenxin large model technology), etc. This embodiment of the invention does not limit this; for example, in the financial field, the target pre-trained language model can be a BERT-Base financial pre-trained model (a BERT-based model). The Base architecture (a basic version of the BERT model), a model that performs domain-adaptive pre-training on large-scale financial corpora, etc.

[0029] Optionally, if any data object is a feature to be dimensionality reduced, dimensionality reduction processing can be performed on each of the multiple target data information of any data object to obtain the dimensionality reduction result of each target data information of any data object. The dimensionality reduction result of each target data information of any data object can then be used to update the dimensions of each target data information of any data object. In this case, the dimension of any target data information among the multiple target data information of any data object can be the dimension after dimensionality reduction, thereby compressing the original high-dimensional data object and reducing the complexity of subsequent clustering processing (i.e., clustering calculation). In this case, the data preprocessing process for any data object may also include dimensionality reduction processing. Optionally, the number of features to be dimensionality reduced can be one or more, and this embodiment of the invention does not limit this. Optionally, the features to be dimensionality reduced can be preset or determined based on a preset dimension threshold and a non-core feature set (e.g., the features to be dimensionality reduced can refer to features with dimensions higher than the preset dimension threshold and belonging to the non-core feature set), and this embodiment of the invention does not limit this. Optionally, both the preset dimension threshold and the non-core feature set can be set according to experience or actual needs, and this embodiment of the invention does not limit this. For example, the non-core feature set may include any device feature, etc. Optionally, the electronic device may be subjected to dimensionality reduction using PCA (Principal Component Analysis) algorithm or MDS (Multidimensional Scaling) algorithm, etc., and the embodiments of the present invention do not limit this.

[0030] Optionally, when performing clustering processing on multiple target data information of each data object to obtain the clustering results of each data object, the electronic device can traverse each data object in at least one data object and take the currently traversed data object as the current data object; if the current data object is a structured parameter, then the multiple target data information of the current data object can be clustered according to numerical distribution clustering (i.e., numerical distribution clustering of multiple target data information of the current data object) to obtain the clustering result of the current data object; if the current data object is a semi-structured parameter, then the multiple target data information of the current data object can be clustered according to field combination clustering (i.e., field combination clustering of multiple target data information of the current data object) to obtain the clustering result of the current data object; if the current data object is an unstructured parameter, then the multiple target data information of the current data object can be clustered according to semantic clustering (i.e., semantic clustering of multiple target data information of the current data object) to obtain the clustering result of the current data object; after traversing each data object in at least one data object, the clustering results of each data object can be obtained. Optionally, electronic devices can be clustered using any unsupervised clustering algorithm, and this embodiment of the invention does not limit this; for example, the DBSCAN (Density-Based Spatial Clustering of Applications with Noise) algorithm can be used for clustering, and so on.

[0031] Based on this, the embodiments of the present invention can ensure that each data object is accurately extracted and participates in clustering, that is, ensure that the features of each data are accurately extracted and clustered by parameters. It is evident that the embodiments of the present invention can achieve data classification through clustering processing, thus achieving refined data classification, providing information support for subsequent processes, and ensuring the compliance and business adaptability of the classification results (i.e., clustering results, where a data cluster in the clustering results can represent a data category).

[0032] S103, based on the interface instruction data of each interface to be tested and the clustering results of each data object, determine the rule-generated instruction data corresponding to each data object under each interface to be tested. The data object under an interface to be tested includes the interface parameters of the corresponding interface to be tested.

[0033] Optionally, when determining the rules for generating instruction data for each data object under each test interface based on the interface instruction data of each test interface and the clustering results of each data object, the electronic device can determine the object instruction data of any data object from the interface instruction data of any test interface for any test interface and any data object under any test interface (i.e., any data object that any test interface needs to call). The object instruction data of any data object may include, but is not limited to, at least one of the following: the data business meaning, data type, and data constraints of any data object. Optionally, an interface parameter may be any data object among at least one data object. The data object that a test interface needs to call may refer to the data object that needs to be input when the corresponding test interface is called. Correspondingly, the data business meaning of an object (such as a data object or interface parameter) refers to the actual meaning represented by the corresponding object in a specific business scenario. The data business meaning connects the technical parameter definition and business logic, that is, it can refer to the actual business value, entity attributes, or business events represented by the data in a specific business scenario, and is the core basis for developers to correctly call the interface and understand the returned results. Based on this, electronic devices can establish a mapping relationship between data clusters and data objects (e.g., determining the data cluster of any data object) and / or establish a mapping relationship between data objects and data business meanings (e.g., determining the data business meaning of any data object) by combining the data usage scenarios and business descriptions (e.g., interface instruction data of any test interface). Optionally, a data constraint may include, but is not limited to, at least one of the following: format constraint, length constraint, integrity constraint, enumeration value constraint, association constraint, etc., and the embodiments of the present invention do not limit this.

[0034] Furthermore, the electronic device can use the object indicator data and clustering results of any data object as rule generation indicator data corresponding to any data object under any interface to be tested; that is, the object indicator data and clustering results of any data object can be added to the rule generation indicator data corresponding to any data object under any interface to be tested, so as to determine the rule generation indicator data corresponding to any data object under any interface to be tested. Specifically, the clustering results of any data object can be used to indicate the data category corresponding to any data object (i.e., the data categories involved in any data object), and a data cluster in the clustering results of any data object is used to indicate a data category corresponding to any data object.

[0035] S104, respectively call the target rule generation model, generate instruction data based on the rule corresponding to each data object under each interface to be tested, generate data generation rules corresponding to each interface to be tested, and use the data generation rule corresponding to an interface to be tested to generate test data under the corresponding interface to be tested.

[0036] Optionally, the clustering result of any data object (which may include at least one data cluster) can be used to guide the data generation rule corresponding to any data object to support the generation of data categories. One data cluster in the clustering result of any data object can be used to guide the data generation rule corresponding to any data object to support the generation of one data category. Accordingly, the data categories supported by the data generation rule corresponding to any data object may include the data categories indicated by the clustering result of any data object, and one data cluster can indicate one data category. Based on this, the data generation rule corresponding to any data object can support the generation of multiple data categories indicated by the clustering result of any data object. For example, the data generation rule corresponding to one data object can generate multiple types of data, meaning that by configuring the path of the data generation rule, different conditions can lead to different data clusters.

[0037] Optionally, the data generation rule corresponding to a test interface may include the data generation rule corresponding to each data object under the corresponding test interface, and the test data under a test interface may include the test data of each data object under the corresponding test interface; correspondingly, the data generation rule corresponding to a data object under a test interface can be used to generate the test data of the corresponding data object under the corresponding test interface. Based on this, test data of any data object under any test interface can be generated based on the data generation rule corresponding to any data object under any test interface; correspondingly, test data under any test interface can be generated based on the data generation rule corresponding to any test interface, so as to generate test data of each data object under any test interface, and so on. Optionally, a data generation rule may include, but is not limited to, at least one of the following: the distribution form of data values, the conditional logic of values, and the enumeration set of values, etc., which are not limited in this embodiment of the present invention.

[0038] In one implementation, for any one of at least one interfaces to be tested, and any data object under any one of those interfaces, the electronic device can invoke a target rule generation model to generate a data generation rule corresponding to any data object under any one of the interfaces to be tested, based on rule generation instruction data. In other words, the rule generation instruction data corresponding to any data object under any one of the interfaces to be tested can be input into the target rule generation model, thereby allowing the target rule generation model to output the data generation rule corresponding to any data object under any one of the interfaces to be tested. Based on this, after generating the data generation rule corresponding to each data object under any one interface to be tested, the generation of the data generation rule corresponding to any one interface to be tested can be achieved.

[0039] In another implementation, for any one of the at least one interfaces to be tested, the electronic device can call the target rule generation model to generate data generation rules for each data object under any one interface to be tested, based on the rule generation instruction data corresponding to each data object under any one interface to be tested. In other words, the rule generation instruction data corresponding to each data object under any one interface to be tested can be input into the target rule generation model, and the target rule generation model can output the data generation rules for each data object under any one interface to be tested, so as to generate data generation rules for any one interface to be tested.

[0040] Optionally, the target rule generation model can be any Large Language Model (LLM), and this embodiment of the invention does not limit this, meaning that this embodiment of the invention does not limit the specific model architecture of the target rule generation model. Optionally, the target rule generation model can be trained using rule generation training data, which may include rule generation instruction data corresponding to each data object under each training interface and label data generation rules corresponding to each training interface.

[0041] Optionally, the electronic device can also use test data from any interface under test to perform interface testing on any interface under test. Optionally, the electronic device can also perform functional testing based on test data from each interface under test, and so on.

[0042] Based on this, embodiments of the present invention can intelligently adjust data generation rules according to contextual information such as test case descriptions and test scenario parameters, achieving intelligent generation and real-time adaptation of test data, which can meet the needs of various complex testing scenarios such as financial systems. Optionally, the test data generation method proposed in embodiments of the present invention can be applied to the financial field, i.e., to the financial testing field, etc.; in this case, the test data generation method proposed in embodiments of the present invention can also be called a financial test data generation method, etc.

[0043] This invention can acquire target acquisition data and interface indication data for each interface under test in at least one interface under test. The target acquisition data includes acquisition data for each data object in at least one data object, and the acquisition data for a data object includes multiple initial data information for the corresponding data object. Then, data preprocessing can be performed on the multiple initial data information of each data object to obtain multiple target data information for each data object. Clustering processing can be performed on the multiple target data information of each data object to obtain the clustering results for each data object. Further, based on the interface indication data of each interface under test and the clustering results of each data object, rule generation indication data corresponding to each data object under each interface under test can be determined. A data object under a test interface includes the interface parameters of the corresponding interface under test. Further, a target rule generation model can be called to generate indication data based on the rules corresponding to each data object under each interface under test, generating data generation rules corresponding to each interface under test. A data generation rule corresponding to a test interface is used to generate test data under the corresponding interface under test. As can be seen, the embodiments of the present invention can conveniently generate data generation rules corresponding to each interface to be tested by using the interface instruction data of each interface to be tested and the clustering results of each data object. This enables the data generation rules to accurately align with the test scenario and business rules, ensuring that the generated test data can directly serve the test requirements. This can effectively improve the validity and overall quality of the test data, and thus effectively adapt to the business of rapid rule iteration.

[0044] Based on the above description, this embodiment of the invention also proposes a more specific test data generation method. Accordingly, this test data generation method can be executed by the aforementioned electronic device (terminal or server); or, the test data generation method can be executed jointly by the terminal and the server; or, the test data generation method can be executed by a test data generation system, and so on. For ease of explanation, the following description will use the execution of this test data generation method by an electronic device as an example; please refer to [link to previous text]. Figure 2 The test data generation method may include the following steps S201-S207: S201, Obtain data call path indication data. The data call path indication data is used to indicate the call path of the data object.

[0045] Optionally, when the electronic device stores data call path indication data in its own storage space, the electronic device can obtain the data call path indication data from its own storage space; or, the interface document and call log can be parsed to extract the data call path indication data, etc.; the embodiments of the present invention do not limit this.

[0046] S202, Identify the interface parameters of each interface to be tested and the data source path of each interface parameter to be tested from the data call path indication data.

[0047] Optionally, each interface to be tested can be an interface in the target system (also known as the target software system, such as a financial software system). The target system can be any system, and this embodiment of the invention does not limit this. Optionally, when the target system also includes at least one interface that does not need to be tested in addition to at least one interface to be tested, the interface parameters and corresponding data source paths of each interface that does not need to be tested can also be identified, etc. Optionally, the interface parameters of an interface (i.e., the interface parameters that an interface depends on) can also be referred to as the input parameters required by the corresponding interface when it is called, that is, the input parameter data required by an interface when it is called can be identified.

[0048] Optionally, the data source path of an interface parameter can be used to indicate that the data originates from other interface calls, database tables, configuration files, or user input, etc., and this embodiment of the invention does not limit this. Based on this, this embodiment of the invention can form a complete data source path map through data source paths, etc. Based on this, this embodiment of the invention can determine the data source path of each data object.

[0049] S203. Based on each interface to be tested, the data source path of each interface parameter of each interface to be tested, and each data object, construct an interface data dependency graph. The nodes in the interface data dependency graph include the interface node corresponding to each interface to be tested, the data object node corresponding to each data object, and at least one data source node. The interface data dependency graph can be used to identify the data object that a call to an interface to be tested depends on.

[0050] Optionally, the electronic device can model the graph structure of data source paths, etc., based on a Graph Neural Network (GNN) to construct an interface data dependency graph. For example, the electronic device can invoke a target GNN to construct an interface data dependency graph based on each interface to be tested, the data source paths of the interface parameters of each interface to be tested, and each data object. It should be noted that the specific model architecture of the target GNN is not limited in this embodiment of the invention. Based on this, this embodiment of the invention can abstract each interface to be tested, the data sources of the interface parameters of each interface to be tested, and each data object into nodes in the interface data dependency graph (hereinafter referred to as the interface data dependency graph), and connections can be established through the calling dependencies between them.

[0051] The interface data dependency graph supports identifying the data objects that a call to an interface under test depends on; it can also be described as supporting the identification of the pre-existing data that a call to an interface under test depends on. Optionally, the interface data dependency graph may also support identifying pre-existing dependencies between data objects, the data source paths of interface parameters for each interface under test, etc. Optionally, the interface data dependency graph may also include, but is not limited to, at least one of the following: node information for each node, such as the node information for an interface node may include, but is not limited to, the interface definition of the interface indicated by the corresponding interface node; the node information for a data object node may include, but is not limited to, at least one of the following: the name, type, length, whether it is required, whether it has a default value, etc., of the data object indicated by the corresponding data object node; the node information for a data source node may include the data source information of the data source indicated by the corresponding data source node (which may include descriptive information of any data source), etc. Optionally, when the target system also includes at least one interface that does not need to be tested, the interface data dependency graph may also include the interface nodes corresponding to each interface that does not need to be tested, etc.

[0052] Optionally, at least one data source node may include the node corresponding to the data source of the interface parameters of each interface to be tested, and a data source node may be used to indicate a data source.

[0053] Optionally, the electronic device can also acquire business instruction text, which may include, but is not limited to, at least one of the following: interface description text for each interface to be tested and data description text for each data object; and can call the target semantic understanding model to perform semantic understanding on the business instruction text, obtaining semantic understanding extraction results (such as, but not limited to, the data business meaning and usage logic of data objects, etc.), thereby adding the semantic understanding extraction results and / or interface data dependency graph to the dependency export file; and outputting the dependency export file. Based on this, the embodiments of the present invention can make up for the semantic missingness in structured data through semantic understanding extraction results, and can enhance the semantic accuracy and interpretability of data dependencies. Optionally, the target semantic understanding model can be any large language model, that is, the embodiments of the present invention do not limit the specific model structure of the target semantic understanding model.

[0054] Optionally, the electronic device can display an interface data dependency graph, thus visually representing the interface data dependency graph; and / or, it can display a dependency relationship export file, allowing the loading of the dependency relationship export file. In this case, users can intuitively view the data dependency path, data source node, and its semantic description for any interface.

[0055] Optionally, the dependency export file can be a structured file (such as JSON, YAML (YAML Ain't Markup Language) or a test rule file (such as test case templates or data dependency rule files); in this case, it is convenient for the test platform to integrate the dependency export file or the automated test-driven dependency export file, etc.

[0056] S204, acquire target acquisition data and acquire interface indication data of each interface to be tested in at least one interface to be tested. The target acquisition data includes acquisition data of each data object in at least one data object. The acquisition data of a data object includes multiple initial data information of the corresponding data object.

[0057] Optionally, the interface indication data of an interface to be tested can also be determined from the interface data dependency graph; or it can be determined from the interface document of the corresponding interface to be tested. This embodiment of the invention does not limit this.

[0058] S205, perform data preprocessing on multiple initial data information of each data object to obtain multiple target data information of each data object; and perform clustering processing on multiple target data information of each data object to obtain clustering results of each data object.

[0059] S206. Based on the interface instruction data of each interface to be tested and the clustering results of each data object, determine the rule-generated instruction data corresponding to each data object under each interface to be tested. The data object under an interface to be tested includes the interface parameters of the corresponding interface to be tested.

[0060] S207, respectively call the target rule generation model, generate instruction data based on the rule corresponding to each data object under each interface to be tested, generate data generation rules corresponding to each interface to be tested, and use the data generation rule corresponding to an interface to be tested to generate test data under the corresponding interface to be tested.

[0061] It should be noted that the execution order of each step is not limited in the embodiments of the present invention. For example, steps S204-S207 can be executed first, followed by steps S201-S203, and so on.

[0062] Optionally, the electronic device can also acquire target monitoring data, which may include, but is not limited to, interface parameter monitoring data (including current interface indication data, etc.) and / or monitoring and acquisition data of each interface to be tested. The monitoring and acquisition data may include the current acquisition data of each data object. Correspondingly, based on the target monitoring data, M data objects to be updated can be determined from at least one data object, where M is a non-negative integer. When the value of M is greater than 0, based on the interface data dependency graph, the interface to be updated corresponding to each of the M data objects to be updated can be determined. The interface to be updated corresponding to a data object to be updated can refer to the interface of the dependent data object (i.e., the data object called) that includes the corresponding data object to be updated, that is, the interface parameter of the interface includes the corresponding data object to be updated. Then, the data generation rules corresponding to each of the at least one interface to be updated can be updated. Among them, at least one interface to be updated may include the interface to be updated corresponding to each data object to be updated. Based on this, an interface to be updated can refer to the interface of the dependent data object that includes at least one data object to be updated, and the data generation rules corresponding to an interface to be updated can be updated, that is, the data generation rules corresponding to each data object to be updated under an interface to be updated can be updated. As can be seen, the interface data dependency graph can also be used to identify interfaces to be updated, that is, based on the dependency relationships between each interface to be tested and each data object, at least one interface to be updated can be identified. Optionally, electronic devices can acquire target monitoring data in real time to monitor changes in interface parameters, etc.

[0063] Optionally, a data object to be updated can be a data object whose data type has changed, a data object whose data category indicated by the clustering result has changed, or a data object whose data business meaning has changed, etc.; this embodiment of the invention does not limit this. For example, the electronic device can determine whether the data type of each data object has changed (i.e., determine whether the current data type is the same as the previously determined data type; if they are different, it is determined that a change has occurred), and treat all data objects whose data type has changed as data objects to be updated; and / or, it can also determine the current clustering result of each data object based on the currently collected data of each data object, and can determine whether the data category indicated by the clustering result has changed based on the data category indicated by the current clustering result of each data object (i.e., determine whether the data category indicated by the current clustering result is the same as the data category indicated by the previously determined clustering result), thereby treating all data objects whose data category has changed as data objects to be updated, etc.; this embodiment of the invention does not limit this. It should be noted that the specific execution method for determining the current clustering result of each data object based on the current collected data of each data object can be the same as the specific execution method for determining the clustering result of each data object based on the collected data of each data object (i.e., including data preprocessing and clustering processing). The embodiments of the present invention will not be described again here.

[0064] Optionally, after obtaining the current clustering results of each data object (i.e., after determining the current clustering results of each data object based on the current collected data of each data object), the data generation rules corresponding to each interface to be updated in at least one interface to be updated can be updated based on the current clustering results of each data object. Optionally, for any one of the at least one interfaces to be updated, the electronic device can determine the current rule generation indication data corresponding to each data object under any one interface to be updated based on the current clustering result of each data object under any one interface to be updated and the interface indication information of any one interface to be updated. This allows the device to call a target rule generation model, generate the indication data based on the current rule generation indication data corresponding to each data object under any one interface to be updated, and generate the data generation rule corresponding to any one interface to be updated, thereby updating the data generation rule corresponding to any one interface to be updated. In this case, the data generation rule corresponding to each data object under any one interface to be updated can be updated. Alternatively, the electronic device can determine the current rule generation indication data corresponding to each data object under any one interface to be updated based on the current clustering result of each data object under any one interface to be updated and the interface indication information of any one interface to be updated. This allows the device to call a target rule generation model, generate the indication data based on the current rule generation indication data corresponding to each data object under any one interface to be updated, and generate the data generation rule corresponding to each data object under any one interface to be updated, thereby updating the data generation rule corresponding to any one interface to be updated. In this case, only the data generation rule corresponding to each data object under any one interface to be updated can be updated, and so on. This embodiment of the invention does not limit this approach.

[0065] Based on this, embodiments of the present invention can construct an interface data dependency graph to clarify the pre-dependencies between data (such as data objects) and support the backpropagation of dependency paths when data changes occur. This automatically updates relevant data, ensuring the integrity and logical consistency of the test data construction. Specifically, in the event of changes in the test scenario or updates to data semantics, the corresponding data generation rules can be automatically adjusted to regenerate test data adapted to the current test requirements. This ensures that the generated test data remains consistent with the business logic and effectively improves flexibility and maintainability. Specifically, when a data object changes (such as a change in data type), the impact can be identified by backpropagating upwards along the interface data dependency graph from that data object. The data generation rules and / or pre-dependency data sources corresponding to all interfaces that depend on that data object can be automatically updated, enabling a mechanism for linked updates of pre-dependency data in response to data changes.

[0066] Optionally, for any one of the at least one interfaces to be tested, after generating test data to be verified based on the data generation rules corresponding to any one interface to be tested, the electronic device can further determine the target business logic constraints under any one interface to be tested; and based on the target business logic constraints, perform data verification on the test data to be verified to obtain the data verification result; if the data verification result is used to indicate that the test data to be verified meets the target business logic constraints, then the test data to be verified can be used as the target test data under any one interface to be tested, and the target test data under any one interface to be tested can be used to test any one interface to be tested, thereby ensuring that the generated data combination meets the target business logic constraints. Optionally, the target business logic constraints under any one interface to be tested can be obtained from the interface document of any one interface to be tested, or they can be obtained from the local cache, and this embodiment of the invention does not limit this. Optionally, a target business logic constraint may include, but is not limited to, at least one of the following: range constraints, enumeration constraints, association constraints, and format constraints, etc., and this embodiment of the invention does not limit this. Based on this, the embodiments of the present invention can implement a built-in data consistency verification function to ensure the quality of data generation and avoid logical conflicts or errors between generated test data. The embodiments of the present invention can introduce a data consistency check mechanism (i.e., the above-mentioned data verification process) to automatically check whether the logical relationship between data is reasonable after the test data is generated, ensuring that the generated test data is credible and effective at the business level.

[0067] In summary, the embodiments of the present invention can automatically identify the business relationships between data based on the attribute information of the data and the clustering results of each data object, intelligently arrange the pre-test data required for testing, and dynamically update the data as needed during the testing process to ensure the integrity, consistency and matching degree of the test data with the business scenario. Based on this, in the financial field, embodiments of the present invention can provide a dynamic test data generation system and method for financial testing scenarios. Furthermore, embodiments of the present invention significantly improve the authenticity of generated data, the logical consistency between data, and the matching degree to business scenarios. They also demonstrate good performance in data security and system maintenance, effectively solving practical problems in financial system testing such as the difficulty in constructing test data, complex data dependencies, and delayed change response. This effectively improves the authenticity and business relevance of financial test data. In other words, embodiments of the present invention can collect and classify real business data (i.e., achieve data classification through clustering) by connecting to multi-source data sources such as financial production environments, generating data construction rules (i.e., data generation rules). This makes the generated test data closer to real business situations, improving the accuracy and effectiveness of testing. It can achieve high-quality data support for interface testing and functional testing scenarios in financial businesses, improve test coverage and defect detection rate, and ensure the effectiveness and stability of financial system testing.

[0068] This invention, after obtaining data call path indication data, can identify the interface parameters and data source paths of each interface to be tested from the data call path indication data. Based on each interface to be tested, the data source paths of the interface parameters, and each data object, an interface data dependency graph is constructed. The nodes in the interface data dependency graph include interface nodes corresponding to each interface to be tested, data object nodes corresponding to each data object, and at least one data source node. The interface data dependency graph supports the identification of data objects that a test interface depends on. Correspondingly, after obtaining the target collection data and the interface indication data of each interface to be tested (at least one test interface), multiple initial data information of each data object is preprocessed to obtain multiple target data information of each data object. Then, the multiple target data information of each data object is clustered to obtain the clustering results of each data object. Finally, based on the interface indication data of each interface to be tested and the clustering results of each data object, rules are determined to generate indication data for each data object under each test interface. A data object under a test interface includes the interface parameters of the corresponding test interface. Furthermore, the target rule generation model can be invoked separately to generate instruction data based on the rules corresponding to each data object under each interface to be tested, and to generate data generation rules corresponding to each interface to be tested. A data generation rule corresponding to one interface to be tested is used to generate test data for that interface. It is evident that this embodiment of the invention can achieve data dependency modeling through interface data dependency graphs, and implement key technologies such as backpropagation and linked updates for data changes, enabling intelligent generation and dynamic updating of test data. Based on this, this embodiment of the invention can automatically adjust the data generation rules according to different test objectives, ensuring that the generated data not only conforms to real business logic but also responds and adjusts promptly when the data structure changes.

[0069] Based on the description of the relevant embodiments of the test data generation method above, this invention also proposes a test data generation device, which can be a computer program (including program code) running in an electronic device; such as Figure 3 As shown, the test data generation apparatus may include an acquisition unit 301 and a processing unit 302. The test data generation apparatus can perform... Figure 1 or Figure 2 The test data generation method shown, i.e., the test data generation device can operate the above-mentioned unit: The acquisition unit 301 is used to acquire target acquisition data and acquire interface indication data of each interface to be tested in at least one interface to be tested. The target acquisition data includes acquisition data of each data object in at least one data object. The acquisition data of a data object includes multiple initial data information of the corresponding data object. Processing unit 302 is configured to perform data preprocessing on multiple initial data information of each data object to obtain multiple target data information of each data object; and to perform clustering processing on multiple target data information of each data object to obtain clustering results of each data object. The processing unit 302 is further configured to determine the rule-generated indicator data corresponding to each data object under each interface to be tested based on the interface indicator data of each interface to be tested and the clustering results of each data object. The data object under an interface to be tested includes the interface parameters of the corresponding interface to be tested. The processing unit 302 is further configured to call the target rule generation model respectively, generate instruction data based on the rule corresponding to each data object under each interface to be tested, generate data generation rules corresponding to each interface to be tested, and use the data generation rule corresponding to an interface to be tested to generate test data under the corresponding interface to be tested.

[0070] In one embodiment, when the processing unit 302 performs clustering processing on multiple target data information of each data object to obtain the clustering results of each data object, it may specifically be used to: Iterate through each data object in the at least one data object, and take the currently traversed data object as the current data object; If the current data object is a structured parameter, then the multiple target data information of the current data object are clustered according to the numerical distribution clustering to obtain the clustering result of the current data object; If the current data object is a semi-structured parameter, then the multiple target data information of the current data object are clustered according to the field combination clustering to obtain the clustering result of the current data object; If the current data object is an unstructured parameter, then the multiple target data information of the current data object are clustered according to semantic clustering to obtain the clustering result of the current data object; After traversing all data objects in the at least one data object, the clustering results of each data object are obtained.

[0071] In another implementation, when the processing unit 302 determines the rule-generated indicator data corresponding to each data object under each interface to be tested based on the interface indicator data of each interface to be tested and the clustering results of each data object, it may specifically be used to: For any one of the at least one interfaces to be tested, and any data object under any one interface to be tested, determine the object indication data of any data object from the interface indication data of any one interface to be tested. The object indication data of any data object includes at least one of the following: the data business meaning, data type, and data constraints of any data object. The object indicator data and clustering results of any data object are used as the rule to generate indicator data for any data object under any interface to be tested; wherein, the clustering result of any data object is used to indicate the data category corresponding to any data object, and a data cluster in the clustering result of any data object is used to indicate a data category corresponding to any data object.

[0072] In another embodiment, the acquisition unit 301 can also be used for: Obtain data call path indication data, which is used to indicate the call path of the data object; Processing unit 302 can also be used for: From the data call path indication data, identify the interface parameters of each interface to be tested and the data source path of the interface parameters of each interface to be tested; Based on each interface to be tested, the data source path of the interface parameters of each interface to be tested, and each data object, an interface data dependency graph is constructed; wherein, the nodes in the interface data dependency graph include the interface nodes corresponding to each interface to be tested, the data object nodes corresponding to each data object, and at least one data source node, and the interface data dependency graph supports the identification of the data objects that a call to an interface to be tested depends on.

[0073] In another embodiment, the acquisition unit 301 can also be used for: Acquire target monitoring data, which includes interface parameter monitoring data and / or monitoring collection data for each interface to be tested, and the monitoring collection data includes the current collection data for each data object; Processing unit 302 can also be used for: Based on the target monitoring data, M data objects to be updated are determined from the at least one data object, where M is a non-negative integer; when the value of M is greater than 0, based on the interface data dependency graph, the interface to be updated corresponding to each of the M data objects to be updated is determined, where the interface to be updated corresponding to a data object to be updated refers to the interface of the data object to which it depends. Update the data generation rules corresponding to each of the at least one interfaces to be updated; wherein, the at least one interface to be updated includes the interface to be updated corresponding to each of the data objects to be updated.

[0074] In another embodiment, the acquisition unit 301 can also be used for: Obtain business instruction text, which includes at least one of the following: interface description text for each interface to be tested and data description text for each data object; Processing unit 302 can also be used for: The target semantic understanding model is invoked to perform semantic understanding on the business instruction text, and the semantic understanding extraction result is obtained; Add the semantic understanding extraction results and / or the interface data dependency graph to the dependency export file; and output the dependency export file.

[0075] In another embodiment, the processing unit 302 may also be used for: For any of the at least one interfaces to be tested, after generating test data to be verified based on the data generation rules corresponding to the interface to be tested, the target business logic constraints under the interface to be tested are determined. Based on the target business logic constraints, the test data to be verified is validated to obtain the data validation result. If the data verification result is used to indicate that the test data to be verified meets the target business logic constraints, then the test data to be verified is used as the target test data under any of the interfaces to be tested.

[0076] According to one embodiment of the present invention, Figure 3Each unit in the test data generation device shown can be individually or entirely merged into one or more other units, or one or more of the units can be further divided into multiple functionally smaller units. This achieves the same operation without affecting the technical effect of the embodiments of the present invention. The above units are based on logical function division. In practical applications, the function of one unit can be implemented by multiple units, or the function of multiple units can be implemented by one unit. In other embodiments of the present invention, any test data generation device may also include other units. In practical applications, these functions can also be implemented with the assistance of other units, and can be implemented collaboratively by multiple units.

[0077] According to another embodiment of the present invention, it is possible to perform operations such as those described above by running on a general-purpose electronic device, such as a computer, which includes processing elements and storage elements such as a central processing unit (CPU), random access memory (RAM), and read-only memory (ROM). Figure 1 or Figure 2 The computer program (including program code) involved in each step of the corresponding method shown, to construct such... Figure 3 The test data generation apparatus shown herein, and the test data generation method for implementing embodiments of the present invention, are described. The computer program may be stored on, for example, a computer storage medium, loaded onto the aforementioned electronic device via the computer storage medium, and run therein.

[0078] Based on the description of the method and apparatus embodiments above, an exemplary embodiment of the present invention also provides an electronic device, including: at least one processor; and a memory communicatively connected to the at least one processor. The memory stores a computer program executable by the at least one processor, which, when executed by the at least one processor, causes the electronic device to perform the method according to an embodiment of the present invention.

[0079] An exemplary embodiment of the present invention also provides a non-transitory computer-readable storage medium storing a computer program, wherein the computer program, when executed by a computer's processor, is used to cause the computer to perform a method according to an embodiment of the present invention.

[0080] An exemplary embodiment of the present invention also provides a computer program product, including a computer program, wherein, when executed by a computer's processor, the computer program is used to cause the computer to perform a method according to an embodiment of the present invention.

[0081] refer to Figure 4The present invention will now be described in the form of a structural block diagram of an electronic device 400 that can serve as a server or client of the present invention, which is an example of a hardware device that can be applied to various aspects of the present invention. The electronic device is intended to represent various forms of digital electronic computer devices, 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 processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.

[0082] like Figure 4 As shown, the electronic device 400 includes a computing unit 401, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 402 or a computer program loaded from a storage unit 408 into a random access memory (RAM) 403. The RAM 403 may also store various programs and data required for the operation of the electronic device 400. The computing unit 401, ROM 402, and RAM 403 are interconnected via a bus 404. An input / output (I / O) interface 405 is also connected to the bus 404.

[0083] Multiple components in electronic device 400 are connected to I / O interface 405, including: input unit 406, output unit 407, storage unit 408, and communication unit 409. Input unit 406 can be any type of device capable of inputting information to electronic device 400. Input unit 406 can receive input digital or character information and generate key signal inputs related to user settings and / or function control of electronic device. Output unit 407 can be any type of device capable of presenting information and may include, but is not limited to, a display, speaker, video / audio output terminal, vibrator, and / or printer. Storage unit 408 may include, but is not limited to, disks and optical discs. Communication unit 409 allows electronic device 400 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks, and may include, but is not limited to, modems, network cards, infrared communication devices, wireless communication transceivers, and / or chipsets, such as Bluetooth™ devices, WiFi devices, WiMax devices, cellular communication devices, and / or the like.

[0084] The computing unit 401 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 401 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 401 performs the various methods and processes described above. For example, in some embodiments, the test data generation method can be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 408. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 400 via ROM 402 and / or communication unit 409. In some embodiments, the computing unit 401 can be configured to perform the test data generation method by any other suitable means (e.g., by means of firmware).

[0085] The program code used to implement the methods of the present invention can be written in any combination of one or more programming languages. This program code can be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing device, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code can be executed entirely on the machine, partially on the machine, as a standalone software package partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

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

[0087] As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, device, and / or apparatus (e.g., disk, optical disk, memory, programmable logic device (PLD)) for providing machine instructions and / or data to a programmable processor, including machine-readable media that receive machine instructions as machine-readable signals. The term "machine-readable signal" refers to any signal for providing machine instructions and / or data to a programmable processor.

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

[0089] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend 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 technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.

[0090] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other.

[0091] Furthermore, it should be understood that the above-disclosed embodiments are merely preferred embodiments of the present invention and should not be construed as limiting the scope of the present invention. Therefore, any equivalent variations made in accordance with the claims of the present invention are still within the scope of the present invention.

Claims

1. A method for generating test data, characterized in that, include: Acquire target collection data and acquire interface indication data of each interface to be tested in at least one interface to be tested. The target collection data includes collection data of each data object in at least one data object. The collection data of a data object includes multiple initial data information of the corresponding data object. Data preprocessing is performed on multiple initial data information of each data object to obtain multiple target data information of each data object; Then, clustering is performed on multiple target data information of each data object to obtain the clustering results of each data object; Based on the interface indication data of each interface to be tested and the clustering results of each data object, rule generation indication data corresponding to each data object under each interface to be tested is determined. A data object under an interface to be tested includes the interface parameters of the corresponding interface to be tested. The target rule generation model is invoked respectively, and instruction data is generated based on the rule corresponding to each data object under each interface to be tested. The data generation rule corresponding to each interface to be tested is used to generate test data under the corresponding interface to be tested.

2. The method according to claim 1, characterized in that, The step of performing clustering processing on multiple target data information of each data object to obtain the clustering results of each data object includes: Iterate through each data object in the at least one data object, and take the currently traversed data object as the current data object; If the current data object is a structured parameter, then the multiple target data information of the current data object are clustered according to the numerical distribution clustering to obtain the clustering result of the current data object; If the current data object is a semi-structured parameter, then the multiple target data information of the current data object are clustered according to the field combination clustering to obtain the clustering result of the current data object; If the current data object is an unstructured parameter, then the multiple target data information of the current data object are clustered according to semantic clustering to obtain the clustering result of the current data object; After traversing all data objects in the at least one data object, the clustering results of each data object are obtained.

3. The method according to claim 1 or 2, characterized in that, The step of determining rule-based indicator data for each data object under each interface to be tested, based on the interface indicator data of each interface to be tested and the clustering results of each data object, includes: For any one of the at least one interfaces to be tested, and any data object under any one interface to be tested, determine the object indication data of any data object from the interface indication data of any one interface to be tested. The object indication data of any data object includes at least one of the following: the data business meaning, data type, and data constraints of any data object. The object indicator data and clustering results of any data object are used as the rule to generate indicator data for any data object under any interface to be tested; wherein, the clustering result of any data object is used to indicate the data category corresponding to any data object, and a data cluster in the clustering result of any data object is used to indicate a data category corresponding to any data object.

4. The method according to claim 1 or 2, characterized in that, The method further includes: Obtain data call path indication data, which is used to indicate the call path of the data object; From the data call path indication data, identify the interface parameters of each interface to be tested and the data source path of the interface parameters of each interface to be tested; Based on each interface to be tested, the data source path of the interface parameters of each interface to be tested, and each data object, an interface data dependency graph is constructed; wherein, the nodes in the interface data dependency graph include the interface nodes corresponding to each interface to be tested, the data object nodes corresponding to each data object, and at least one data source node, and the interface data dependency graph supports the identification of the data objects that a call to an interface to be tested depends on.

5. The method according to claim 4, characterized in that, The method further includes: Acquire target monitoring data, which includes interface parameter monitoring data and / or monitoring collection data for each interface to be tested, and the monitoring collection data includes the current collection data for each data object; Based on the target monitoring data, M data objects to be updated are determined from the at least one data object, where M is a non-negative integer; when the value of M is greater than 0, based on the interface data dependency graph, the interface to be updated corresponding to each of the M data objects to be updated is determined, where the interface to be updated corresponding to a data object to be updated refers to the interface of the data object to which it depends. Update the data generation rules corresponding to each of the at least one interfaces to be updated; wherein, the at least one interface to be updated includes the interface to be updated corresponding to each of the data objects to be updated.

6. The method according to claim 4, characterized in that, The method further includes: Obtain business instruction text, which includes at least one of the following: interface description text for each interface to be tested and data description text for each data object; The target semantic understanding model is invoked to perform semantic understanding on the business instruction text, and the semantic understanding extraction result is obtained; Add the semantic understanding extraction results and / or the interface data dependency graph to the dependency export file; and output the dependency export file.

7. The method according to claim 1 or 2, characterized in that, The method further includes: For any of the at least one interfaces to be tested, after generating test data to be verified based on the data generation rules corresponding to the interface to be tested, the target business logic constraints under the interface to be tested are determined. Based on the target business logic constraints, the test data to be verified is validated to obtain the data validation result. If the data verification result is used to indicate that the test data to be verified meets the target business logic constraints, then the test data to be verified is used as the target test data under any of the interfaces to be tested.

8. A test data generation device, characterized in that, The device includes: The acquisition unit is used to acquire target acquisition data and acquire interface indication data of each interface to be tested in at least one interface to be tested. The target acquisition data includes acquisition data of each data object in at least one data object. The acquisition data of a data object includes multiple initial data information of the corresponding data object. The processing unit is configured to perform data preprocessing on multiple initial data information of each data object to obtain multiple target data information of each data object; and to perform clustering processing on the multiple target data information of each data object to obtain the clustering result of each data object. The processing unit is further configured to determine the rule-generated indicator data corresponding to each data object under each interface to be tested based on the interface indicator data of each interface to be tested and the clustering results of each data object. The data object under an interface to be tested includes the interface parameters of the corresponding interface to be tested. The processing unit is also used to call the target rule generation model respectively, generate instruction data based on the rule corresponding to each data object under each interface to be tested, generate data generation rules corresponding to each interface to be tested, and use the data generation rule corresponding to an interface to be tested to generate test data under the corresponding interface to be tested.

9. An electronic device, characterized in that, include: processor; as well as Stored program memory, The program includes instructions that, when executed by the processor, cause the processor to perform the method according to any one of claims 1-7.

10. A non-transitory computer-readable storage medium storing computer instructions, wherein, The computer instructions are used to cause the computer to perform the method according to any one of claims 1-7.