Test data construction method, device and electronic equipment

By obtaining the attribute feature information of business data in the production environment, and using machine learning to cluster and scene recognition models to construct test data, the problem of incomplete test data is solved, and the accuracy and efficiency of test results are improved.

CN115373974BActive Publication Date: 2025-08-08NETSUNION CLEARING CORP
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110558872.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-05-21
Publication Date
2025-08-08
Estimated Expiration
2041-05-21

AI Technical Summary

Technical Problem

During the existing testing process, the test data is not comprehensive enough, resulting in insufficient accuracy and reliability of the test results, and it is prone to dirty data problems that affect the stability and efficiency of the test environment.

Method used

By obtaining the attribute feature information of business data in the production environment, using machine learning for clustering training, identifying the business scenarios to which the business data belongs, and constructing test data based on the scene recognition model to realize the automated construction of test data.

Benefits of technology

It improves the comprehensiveness and organization of the test data, meets the testing needs of real business scenarios, avoids dirty data problems, improves the stability of the test environment and the accuracy of the test results, and improves the testing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115373974B_ABST
    Figure CN115373974B_ABST
Patent Text Reader

Abstract

The embodiments of this specification disclose a test data construction method, device and electronic device. The test data construction method includes: obtaining attribute feature information of business data in a production environment, wherein the attribute feature information includes feature values corresponding to multiple attribute features of the business data; performing clustering training based on the feature values corresponding to a single attribute feature of the business data to obtain categories corresponding to the business data under multiple attribute features; inputting the attribute feature information of the business data into a pre-established scene recognition model to obtain the business scene to which the business data belongs, wherein the scene recognition model is trained based on the attribute feature information of the sample business data and the corresponding scene label, and the scene label is used to indicate the business scene to which the sample business data belongs; constructing test data corresponding to the business scene to which the business data belongs based on the business data and the categories corresponding to the business data under the multiple attribute features.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This document relates to the field of testing technology, and in particular to a test data construction method, device and electronic equipment. Background Art

[0002] During the software product development and launch process, it is usually necessary to test the product using test data to ensure that there are no quality problems after the product is launched.

[0003] Currently, testing is typically divided and tested separately by business module. Specifically, for each business module, testers construct the test data required for the current module based on the fields of interest, while randomly filling in other fields of less interest. However, the test data constructed in this way is not comprehensive enough to meet the testing requirements of the test scenario, affecting the accuracy and reliability of test results. It can also lead to disorganized test data, causing various problems in the test environment due to dirty data. These problems are time-consuming and labor-intensive to troubleshoot, ultimately affecting the stability of the test environment and testing efficiency.

[0004] Therefore, there is an urgent need for a testing solution that can improve testing efficiency and the accuracy and reliability of test results. Summary of the Invention

[0005] The embodiments of this specification aim to provide a test data construction method, apparatus, and electronic device that can improve test efficiency and the accuracy and reliability of test results.

[0006] In order to achieve the above objectives, the embodiments of this specification adopt the following technical solutions:

[0007] In a first aspect, a test data construction method is provided, comprising:

[0008] Acquire attribute feature information of business data in a production environment, the attribute feature information including feature values corresponding to multiple attribute features of the business data;

[0009] Performing clustering training based on the feature values corresponding to the single attribute features of the business data to obtain the categories corresponding to the business data under the multiple attribute features;

[0010] Inputting the attribute feature information of the business data into a pre-established scene recognition model to obtain the business scene to which the business data belongs, wherein the scene recognition model is trained based on the attribute feature information of the sample business data and a scene label corresponding to the sample business data, and the scene label is used to indicate the business scene to which the sample business data belongs;

[0011] Based on the business data and the categories to which the business data respectively corresponds under the multiple attribute features, test data corresponding to the business scenario to which the business data belongs is constructed.

[0012] In a second aspect, a test data construction device is provided, comprising:

[0013] A first acquisition unit is configured to acquire attribute feature information of business data in a production environment, wherein the attribute feature information includes feature values corresponding to multiple attribute features of the business data;

[0014] A single feature training unit performs clustering training based on the feature values corresponding to the single attribute features of the business data, so as to obtain the categories corresponding to the business data under the multiple attribute features;

[0015] a scene recognition unit that inputs the attribute feature information of the business data into a pre-established scene recognition model to obtain a business scene to which the business data belongs, wherein the scene recognition model is trained based on the attribute feature information of sample business data and a scene label corresponding to the sample business data, wherein the scene label is used to indicate the business scene to which the sample business data belongs;

[0016] A construction unit constructs test data corresponding to the business scenario to which the business data belongs based on the business data and the categories to which the business data corresponds under the multiple attribute features.

[0017] According to a third aspect, an electronic device is provided, including:

[0018] processor; and

[0019] a memory arranged to store computer-executable instructions which, when executed, cause the processor to:

[0020] Acquire attribute feature information of business data in a production environment, the attribute feature information including feature values corresponding to multiple attribute features of the business data;

[0021] Performing clustering training based on the feature values corresponding to the single attribute features of the business data to obtain the categories corresponding to the business data under the multiple attribute features;

[0022] Inputting the attribute feature information of the business data into a pre-established scene recognition model to obtain the business scene to which the business data belongs, wherein the scene recognition model is trained based on the attribute feature information of the sample business data and a scene label corresponding to the sample business data, and the scene label is used to indicate the business scene to which the sample business data belongs;

[0023] Based on the business data and the categories to which the business data respectively corresponds under the multiple attribute features, test data corresponding to the business scenario to which the business data belongs is constructed.

[0024] According to a fourth aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores one or more programs. When the one or more programs are executed by an electronic device including a plurality of application programs, the electronic device performs the following operations:

[0025] Acquire attribute feature information of business data in a production environment, the attribute feature information including feature values corresponding to multiple attribute features of the business data;

[0026] Performing clustering training based on the feature values corresponding to the single attribute features of the business data to obtain the categories corresponding to the business data under the multiple attribute features;

[0027] Inputting the attribute feature information of the business data into a pre-established scene recognition model to obtain the business scene to which the business data belongs, wherein the scene recognition model is trained based on the attribute feature information of the sample business data and a scene label corresponding to the sample business data, and the scene label is used to indicate the business scene to which the sample business data belongs;

[0028] Based on the business data and the categories to which the business data respectively corresponds under the multiple attribute features, test data corresponding to the business scenario to which the business data belongs is constructed.

[0029] The solution of the embodiments of this specification, through artificial intelligence, machine learning and other methods, sorts and aggregates the business data in the real production environment based on attribute feature information, and obtains the business scenarios to which the business data belongs and the categories corresponding to multiple attribute features respectively. Further, based on the business scenarios and the categories corresponding to the single attribute features, the test data corresponding to the business scenarios to which the business data belongs is automatically constructed. Thus, the constructed test data is comprehensive and organized, which can not only meet the testing requirements of real business scenarios, but also avoid various problems in the test environment due to dirty data, thereby improving the stability of the test environment and the accuracy and reliability of the test results. In addition, the entire construction process does not require human intervention, which can improve testing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] The drawings described herein are used to provide a further understanding of this specification and constitute a part of this specification. The exemplary embodiments and descriptions of this specification are used to explain this specification and do not constitute an improper limitation of this specification. In the drawings:

[0031] Figure 1A flowchart of a test data construction method provided in one embodiment of this specification;

[0032] Figure 2 A flowchart of a test data construction method provided in another embodiment of this specification;

[0033] Figure 3 A flowchart of a service testing method provided in one embodiment of this specification;

[0034] Figure 4 A schematic diagram of the structure of a test data construction device provided in one embodiment of this specification;

[0035] Figure 5 A schematic diagram of the structure of a service testing device provided in one embodiment of this specification;

[0036] Figure 6 The present invention provides a schematic structural diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0037] To make the purpose, technical solutions, and advantages of this specification more clear, the technical solutions of this specification will be clearly and completely described below in conjunction with the specific embodiments of this specification and the corresponding drawings. Obviously, the embodiments described are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of this document.

[0038] As mentioned above, the current testing process typically divides and tests each business module separately. Specifically, for each business module, testers construct the test data required for that module based on the fields of interest, while randomly filling in other fields of less interest. For example, a payment system primarily comprises business modules such as transaction, settlement, and reconciliation. During testing, test data for the transaction module is constructed based on transaction-related fields, test data for the settlement module is constructed based on settlement-related fields, and test data for the reconciliation module is constructed based on reconciliation-related fields. However, the test data constructed in this way is incomplete and can easily miss data truly required for the test scenario, affecting the accuracy and reliability of test results. It can also lead to disorganized test data, causing various issues in the test environment due to dirty data. These issues are time-consuming and labor-intensive to troubleshoot, ultimately impacting the stability and efficiency of the test environment.

[0039] To this end, the embodiments of this specification aim to provide a business data construction solution, which, based on the attribute feature information of business data in a real production environment, identifies the business scenario to which the business data belongs and classifies the business data under a single attribute feature, and further implements the automated construction of test data corresponding to the business scenario to which the business data belongs based on the business scenario to which the business data belongs and the corresponding category under a single attribute feature. This construction method can improve testing efficiency, ensure the comprehensiveness of the constructed test data, reduce data deviation, meet the testing requirements of real business scenarios, and thus improve the stability of the test environment and the accuracy and reliability of the test results.

[0040] It should be understood that the test data construction method provided in the embodiments of this specification can be executed by an electronic device or software installed in an electronic device, specifically, can be executed by a terminal device or a server device.

[0041] The technical solutions provided by the embodiments of this specification are described in detail below with reference to the accompanying drawings.

[0042] Please refer to Figure 1 , is a flow chart of a test data construction method provided in one embodiment of this specification, the method may include:

[0043] S102 , acquiring attribute feature information of business data in a production environment, wherein the attribute feature information includes feature values corresponding to a plurality of attribute features of the business data.

[0044] Among them, the multiple attribute characteristics can be multiple different characteristics that characterize the attributes of business data, which can be set specifically according to business needs. Optionally, the multiple attribute characteristics may include the type of business participants and the supported business types. For example, taking transaction-type business as an example, the business participants are the transaction participants, which may specifically include but are not limited to the transaction initiator, payer and payee. The types of business participants may include third-party institutions, banks, etc., and the business types may include quick payment, gateway payment, etc. Table 1 shows an example of attribute characteristic information of business data.

[0045] Table 1

[0046] Business data Business initiator Payer Payee Supported transaction types Business Data 1 third-party organizations third-party organizations third-party organizations Quick transactions Business Data 2 bank third-party organizations bank Gateway Transactions

[0047] Business data may include business-related data, which varies depending on the business. For example, in the case of transaction-related businesses, business data may include the number of goods traded and the transaction price, inventory quantity, warehouse location of goods, and transaction volume and amount between transaction participants.

[0048] In specific implementations, business data can be obtained from a database in an online production environment (hereinafter referred to as the "production database"), which stores business data generated in real time during business processing. In an optional implementation, given that business data generated during business processing changes in real time, business data from the production environment within a predetermined historical time period before the current moment can be obtained. The business data thus obtained has better real-time performance, which enables the subsequently constructed test data to better meet the testing requirements of current real-world business scenarios.

[0049] S104: performing clustering training based on the feature values corresponding to the single attribute features of the business data, so as to obtain the categories corresponding to the business data under the multiple attribute features.

[0050] By using machine learning methods to cluster business data with the same characteristic values corresponding to a single attribute feature, it is possible to determine the categories corresponding to these business data under that single attribute feature. In other words, by clustering the characteristic values corresponding to the acquired business data for a single attribute feature, the business data is finely classified according to the single attribute feature, thereby determining the specific category corresponding to the business data under the single attribute feature, completing the process of moving from coarse classification to fine classification of business data. Specifically, in an optional embodiment, the above S104 may include:

[0051] Step 1: Aggregate the business data based on the characteristic values corresponding to the single attribute features of the business data to obtain the business data corresponding to different characteristic values of the single attribute features.

[0052] For example, taking the attribute feature of the transaction initiator shown in Table 1 above as an example, by aggregating the business data of the transaction initiator being a third-party institution, the business data of the transaction initiator being a third-party institution can be obtained; by aggregating the business data of the transaction initiator being a bank, the business data of the transaction initiator being a bank can be obtained.

[0053] Step 2: Based on a preset clustering algorithm, cluster the business data corresponding to different feature values of a single attribute feature to obtain the category corresponding to the business data under the single attribute feature.

[0054] For each characteristic value of a single attribute feature, a preset clustering algorithm is used to cluster the business data corresponding to that characteristic value, resulting in multiple characteristic value clusters, each of which represents a category. For example, taking the attribute feature "transaction initiator" shown in Table 1 above as an example, clustering the business data corresponding to the characteristic value "third-party institution" yields multiple categories, including clusters with transaction volumes in the tens of millions and those in the millions. Based on the cluster to which each piece of business data belongs, the category corresponding to each piece of business data under the attribute feature "transaction initiator" is determined.

[0055] Among them, the preset clustering algorithm can, for example, include a combination of one or more of the following algorithms: K-means algorithm, K-MEDOIDS algorithm, Principal Component Analysis (PCA) algorithm, etc., which can be set according to business needs, and the embodiments of this specification do not make specific limitations on this.

[0056] The following uses the K-means algorithm as an example to explain the clustering training process for the transaction initiator attribute. First, the business data for the same transaction initiator is aggregated to determine the amount of business data contained in each transaction party. Assume that the following table shows the organizations and the amount of business data they contain.

[0057] Table 2

[0058] third-party organizations Amount of business data included Institution A 5 Institution B 20 Institution C 11 Institution D 5 Institution E 9 Institution F 19 Institution G 30 Institution H 3 Institution I 15

[0059] Next, randomly divide the above institutions A to I into K groups and calculate the mean of the number of business data in each group. K can be set according to actual needs. Assuming K = 3, the initial grouping is as follows:

[0060] Group 1: Institution A, Institution B, and Institution C. The average number of business data in this group is 12.

[0061] Group 2: Institution D, Institution E, and Institution F. The average number of business data in this group is 11.

[0062] Group 3: Institution G, Institution H, and Institution I, where the average number of business data in this group is 16.

[0063] Furthermore, for each organization, reassign it to the group with the closest average number of business data items to the number of business data items it contains, and recalculate the average number of business data items for each group. Taking the above initial grouping as an example, organization A (containing 5 business data items) can be reassigned to group 2 (with an average number of business data items of 11), and so on, to obtain the following new groupings:

[0064] Group 1: Institution C and Institution E. The average number of business data in this group is 10.

[0065] Group 2: Institution A, Institution D, and Institution H. The average number of business data in this group is 4.33;

[0066] Group 3: Institution B, Institution F, Institution G, and Institution I. The average number of business data in this group is 21.

[0067] Repeat the above regrouping steps until the change in the mean number of business data in each group falls within the preset range, thereby obtaining the final grouping result. Finally, based on the number of business data contained in each group and the preset correspondence between the number of business data and the category, the category to which each group belongs is determined. The category to which each group belongs is the category to which the business data in each group belongs based on the attribute characteristic of the transaction initiator.

[0068] It should be noted that the above example only uses the K-means algorithm to perform clustering training on the characteristic value of the third-party institution under the transaction initiator. Similar methods can be used for clustering training for other attribute features and characteristic values to obtain the corresponding categories of business data under other attribute features.

[0069] It can be understood that through the above-mentioned clustering training method, the business data is first aggregated according to the characteristic value corresponding to a single attribute feature of the business data, and then the business data corresponding to different characteristic values of the single attribute feature are clustered. In this way, machine learning can be used to realize the automatic sorting of the attribute feature information of the business data. The category corresponding to the obtained business data under a single attribute feature can more intuitively and accurately reflect the business characteristics of the real production environment.

[0070] Of course, in the test data construction method provided in the embodiment of this specification, any other appropriate method can also be used to perform cluster training on the feature values corresponding to a single attribute feature of the business data, and the embodiment of this specification does not make specific limitations on this.

[0071] S106: Input the attribute feature information of the business data into a pre-established scene recognition model to obtain the business scene to which the business data belongs.

[0072] The scene recognition model is trained based on the attribute feature information of the sample business data and the scene labels corresponding to the sample business data. The scene labels corresponding to the sample business data are used to indicate the business scene to which the sample business data belongs.

[0073] The business process executed by a business system includes at least one business scenario, which varies depending on the business process. For example, a payment business process may include business scenarios such as transaction creation and payment, settlement, and accounting. Table 3 shows an example of attribute feature information for business data and the business scenario to which it belongs.

[0074] Table 3

[0075]

[0076] S108 , constructing test data corresponding to the business scenario to which the business data belongs based on the business data and the categories corresponding to the business data under multiple attribute characteristics.

[0077] To ensure the orderliness of the constructed test data and avoid various problems in the test environment due to dirty data, thereby ensuring the stability of the test environment and test efficiency, business data can be aggregated according to the categories corresponding to multiple attribute characteristics of the business data to obtain typical test data in the business scenario to which the business data belongs.

[0078] Specifically, in an optional implementation, the above S108 may include:

[0079] Step 1: Based on the categories corresponding to multiple attribute features of the business data, the business data corresponding to the same category combination are aggregated to obtain business data corresponding to different category combinations.

[0080] A category combination refers to a combination of categories corresponding to multiple attribute features. By aggregating the acquired business data according to the category combination, business data corresponding to different category combinations can be obtained.

[0081] Taking the above-mentioned multiple attribute characteristics including the transaction initiator, payer, payee and supported transaction types as an example, Table 4 shows a schematic diagram of different category combinations.

[0082] Table 4

[0083]

[0084] Step 2: Based on the business data corresponding to the same category combination, construct the test data corresponding to the same category combination.

[0085] Specifically, the business data corresponding to the same category combination can be used as the test data corresponding to the same category combination.

[0086] Step 3: Determine the test data corresponding to the constructed different category combinations as the test data corresponding to the business scenario to which the business data belongs.

[0087] For each business scenario, the test data corresponding to different category combinations of the same business scenario can be determined as the test data corresponding to the business scenario. For example, taking the category combinations shown in Table 4 as an example, the business data corresponding to business scenario 1 is aggregated according to the above category combinations to obtain the test data corresponding to business scenario 1 as shown in Table 5 below.

[0088] Table 5

[0089]

[0090]

[0091] It can be understood that the above approach enables the subdivision of test data from the same business scenario into different category combinations. This not only aligns test data, avoids various issues in the test environment due to dirty data, reduces manual troubleshooting, and ensures test environment stability and testing efficiency, but also improves the comprehensiveness of test data from the same business scenario, providing accurate and reliable test results. Of course, the test data construction methods provided in the embodiments of this specification may also employ any other appropriate technical means commonly used in the art to implement test data construction, and this embodiment of this specification does not specifically limit this.

[0092] By adopting the test data construction method provided in the embodiment of this specification, the business data in the real production environment is sorted and aggregated based on attribute feature information through artificial intelligence, machine learning, etc., and the business scenarios to which the business data belongs and the corresponding categories under multiple attribute features are obtained respectively. Further, based on the business scenarios and the corresponding categories under a single attribute feature, the test data corresponding to the business scenarios to which the business data belongs is automatically constructed. Thus, the constructed test data is comprehensive and organized, which can not only meet the testing requirements of real business scenarios, but also avoid various problems in the test environment due to dirty data, thereby improving the stability of the test environment and the accuracy and reliability of the test results. In addition, the entire construction process does not require human intervention, which can improve testing efficiency.

[0093] Furthermore, in another embodiment of the present specification, in order to more conveniently obtain test data in the subsequent test process and further improve the comprehensiveness of the test data, as shown in FIG. Figure 2 As shown, after constructing the test data corresponding to the business scenario to which the business data belongs through the above S108, the test data construction method provided by any of the above embodiments also includes a step of aggregating the locally stored test data and the newly constructed test data to generate a test database, so that the required test data can be obtained from the test database during subsequent testing.

[0094] Specifically, after the above S108, the test data construction method provided in the embodiment of this specification also includes: aggregating the constructed test data and the locally stored test data according to the business scenarios to which they belong, to obtain test data sets corresponding to different business scenarios; determining the characteristic values corresponding to the business data under multiple attribute characteristics as the scenario characteristics of the business scenarios to which the business data belongs; and generating a test database based on the test data sets and scenario characteristics corresponding to different business scenarios.

[0095] It can be understood that through the test data construction method provided by this embodiment, the generated test database stores test data sets corresponding to different business scenarios, thereby realizing dynamic maintenance of test data corresponding to different business scenarios. Moreover, in the subsequent testing process, based on the scenario characteristics of the business scenario to be tested, part or all of the test data under the business scenario can be obtained from the test database, thereby further improving the test efficiency and the accuracy and reliability of the test results.

[0096] Furthermore, in another embodiment of this specification, Figure 2 As shown, after generating the test database, the test data construction method provided by any of the above embodiments further includes: obtaining target test data matching the test scenario based on the scenario characteristics of the test scenario provided by the test party. Specifically, the test data construction method provided by any of the above embodiments further includes: receiving a data acquisition request sent by the test party, wherein the data acquisition request is used to request the acquisition of test data and the data acquisition request carries the scenario characteristics of the test scenario; accordingly, in response to the data acquisition request, obtaining target test data matching the test scenario from the test database based on the scenario characteristics of the test scenario, and feeding the target test data back to the test party.

[0097] More specifically, the scenario characteristics of the test scenario can be matched with the scenario characteristics of each business scenario in the test database, and the business scenario involved in the test scenario can be determined based on the matching results, and the test data in the test data set corresponding to the business scenario involved can be determined as the target test data matching the test scenario.

[0098] For example, taking the test data shown in Table 5 above as an example, assuming that the scenario characteristics of the test scenario are "transaction initiator: third-party institution; payer: third-party institution; payee: third-party institution; transaction type: quick transaction", it can be determined that the target test data matching the test scenario include test data 1 and test data 2.

[0099] It can be understood that the test data construction method provided in this embodiment allows the test party to obtain test data matching the test scenario by only providing the scenario characteristics of the test scenario, thereby realizing the automated and targeted push of test data, ensuring that the test data meets the requirements of the test scenario, and further improving the accuracy and reliability of the test results.

[0100] Furthermore, the test data construction method provided in any of the above embodiments also includes a training method for the scene recognition model. It is worth noting that the training method for the scene recognition model is performed in advance based on the sample business data and its corresponding scene labels collected from the production environment and / or the test environment, for example, before the above S106. In the subsequent process of constructing the test data, there is no need to train the creative scene recognition model every time, or the scene recognition model can be periodically updated based on the sample business data and its corresponding scene labels collected from the production environment and / or the test environment center.

[0101] Specifically, the scene recognition model training method includes obtaining attribute feature information of sample business data and corresponding scene labels for the sample business data, and performing training using the attribute feature information of the sample business data as input and the corresponding scene labels for the sample business data as output to obtain the scene recognition model. In practical applications, the sample business data can be historical business data obtained from a production environment.

[0102] It can be understood that by training the scene recognition model in the above manner, the trained scene recognition model can quickly and accurately identify the business scenario to which the business data belongs based on the attribute feature information of the business data, thereby providing strong support for the subsequent construction of test data.

[0103] Furthermore, in order to avoid the leakage of sensitive information in business data and to achieve reliable protection of sensitive information, the sample business data and its attribute feature information used to train the scene recognition model can be desensitized. That is, the scene recognition model is trained based on the attribute feature information of the desensitized sample business data and its corresponding scene labels. Figure 2 As shown, after obtaining the attribute characteristic information of the business data through the above S102, the business data and its attribute characteristic information are further desensitized. The desensitization strategy used for desensitizing the sample business data and its attribute characteristic information can be the same as that used for desensitizing the business data and its attribute characteristic information.

[0104] It should be noted that the data construction method provided in the embodiments of this specification can be performed in advance before testing, or can be performed periodically based on newly acquired business data and its attribute feature information from the production environment to further improve the accuracy and reliability of subsequent test results.

[0105] Corresponding to the above method, the embodiment of this specification also provides a service testing method, which can be based on Figure 1 It should be understood that the service testing method provided in the embodiments of this specification can be executed by an electronic device or software installed in an electronic device, specifically, by a terminal device or a server device.

[0106] Please refer to Figure 3 , is a flowchart of a service testing method provided in one embodiment of this specification, the method may include:

[0107] S302 , acquiring attribute feature information of business data in a production environment, wherein the attribute feature information includes feature values corresponding to a plurality of attribute features of the business data.

[0108] S304: performing clustering training based on the feature values corresponding to the single attribute features of the business data, so as to obtain the categories corresponding to the business data under the multiple attribute features.

[0109] S306: Input the attribute feature information of the business data into a pre-established scene recognition model to obtain the business scene to which the business data belongs.

[0110] The scene recognition model is trained based on the attribute feature information of the sample business data and the scene labels corresponding to the sample business data. The scene labels corresponding to the sample business data are used to indicate the business scene to which the sample business data belongs.

[0111] S308 : Based on the business data and the categories corresponding to the business data under multiple attribute characteristics, construct test data corresponding to the business scenario to which the business data belongs.

[0112] S310: Perform business testing based on the constructed test data.

[0113] Specifically, tests related to the business scenario can be performed based on the test data corresponding to the business scenario to be tested.

[0114] It should be noted that the specific implementation of the above steps S302 to S308 is the same as Figure 1 Steps S102 to S108 in the embodiment shown are similar, and can be found in detail. Figure 1 The relevant description of the illustrated embodiment will not be repeated here.

[0115] Obviously, the service testing method provided in the embodiments of this specification can perform service testing based on test data corresponding to different service scenarios, thereby improving the accuracy and reliability of the test results. Subsequently, based on the service test results, relevant service processing tests can be performed, such as improving the performance of the service system.

[0116] In addition, with the above Figure 1 Corresponding to the test data construction method shown, the embodiment of this specification also provides a test data construction device. Figure 4 4 is a schematic diagram of a test data construction device 400 provided in an embodiment of this specification, including:

[0117] A first acquiring unit 410 acquires attribute feature information of business data in a production environment, wherein the attribute feature information includes feature values corresponding to multiple attribute features of the business data;

[0118] The single feature training unit 420 performs clustering training based on the feature values corresponding to the single attribute features of the business data, so as to obtain the categories corresponding to the business data under the multiple attribute features;

[0119] The scene recognition unit 430 inputs the attribute feature information of the business data into a pre-established scene recognition model to obtain the business scene to which the business data belongs, wherein the scene recognition model is trained based on the attribute feature information of the sample business data and the scene label corresponding to the sample business data, and the scene label is used to indicate the business scene to which the sample business data belongs;

[0120] The construction unit 440 constructs test data corresponding to the business scenario to which the business data belongs based on the business data and the categories to which the business data corresponds under the multiple attribute features.

[0121] The test data construction device provided in the embodiment of this specification uses artificial intelligence, machine learning, etc. to sort out and aggregate business data in a real production environment based on attribute feature information, and obtains the business scenarios to which the business data belongs and the categories corresponding to multiple attribute features. Further, based on the business scenarios and the categories corresponding to a single attribute feature, the automatic construction of test data corresponding to the business scenarios to which the business data belongs is realized. Thus, the constructed test data is comprehensive and organized, which can not only meet the testing requirements of real business scenarios, but also avoid various problems in the test environment due to dirty data, thereby improving the stability of the test environment and the accuracy and reliability of the test results. In addition, the entire construction process does not require human intervention, which can improve testing efficiency.

[0122] Optionally, the construction unit 440 is specifically configured to:

[0123] Based on the categories corresponding to the business data under the multiple attribute characteristics, the business data corresponding to the same category combination are aggregated to obtain business data corresponding to different category combinations, where the category combination refers to a combination of categories corresponding to the multiple attribute characteristics;

[0124] Based on the business data corresponding to the same category combination, construct test data corresponding to the same category combination;

[0125] The test data corresponding to the constructed different category combinations are determined as the test data corresponding to the business scenario to which the business data belongs.

[0126] Optionally, the apparatus 400 further includes:

[0127] an aggregation unit, which, after the construction unit 440 constructs the test data corresponding to the business scenario to which the business data belongs, aggregates the constructed test data and the locally stored test data according to the business scenario to obtain a test data set corresponding to different business scenarios;

[0128] A scenario feature determination unit, which determines the feature values corresponding to the business data under the multiple attribute features as the scenario features of the business scenario to which the business data belongs;

[0129] The test database generating unit generates a test database based on the test data sets and scenario features corresponding to the different business scenarios.

[0130] Optionally, the apparatus 400 further includes:

[0131] a receiving unit, configured to receive a data acquisition request sent by a test party after the test database generating unit generates a test database, wherein the data acquisition request is used to request acquisition of test data and carries scenario characteristics of a test scenario;

[0132] A second acquiring unit, based on the scenario characteristics of the test scenario, acquires target test data matching the test scenario from the test database;

[0133] The sending unit feeds back the target test data to the test party.

[0134] Optionally, the single feature training unit 420 is specifically configured to:

[0135] Aggregating the business data based on the characteristic values corresponding to the single attribute features of the business data to obtain business data corresponding to different characteristic values of the single attribute features;

[0136] Based on a preset clustering algorithm, the business data corresponding to different feature values of the single attribute feature are clustered to obtain the category corresponding to the business data under the single attribute feature.

[0137] Optionally, the apparatus 400 further includes:

[0138] a third acquisition unit, which acquires the attribute feature information of the sample business data and the scene label corresponding to the sample business data before the scene recognition unit 430 inputs the attribute feature information of the business data into the pre-established scene recognition model;

[0139] A training unit is configured to perform training using the attribute feature information as input and the scene label corresponding to the sample business data as output to obtain the scene recognition model.

[0140] Optionally, the scene recognition model is trained based on attribute feature information of the desensitized sample business data and its corresponding scene labels;

[0141] The apparatus 400 further includes:

[0142] The desensitizing processing unit performs desensitizing processing on the business data and its attribute characteristic information after the first acquiring unit 410 acquires the attribute characteristic information of the business data in the production environment.

[0143] Optionally, the multiple attribute features include types of business participants and supported business types.

[0144] Obviously, the test data construction device of the embodiment of this specification can be used as the above Figure 1 The execution subject of the test data construction method shown in FIG, thus being able to implement the test data construction method in Figure 1 Since the principle is the same, the functions realized are not described here.

[0145] In addition, with the above Figure 3 Corresponding to the service testing method shown, the embodiment of this specification also provides a service testing device. Figure 5 : is a schematic diagram of the structure of a service testing device 500 provided in an embodiment of this specification, including:

[0146] A first acquiring unit 510 acquires attribute feature information of business data in a production environment, wherein the attribute feature information includes feature values corresponding to multiple attribute features of the business data;

[0147] The single feature training unit 520 performs clustering training based on the feature values corresponding to the single attribute features of the business data, so as to obtain the categories corresponding to the business data under the multiple attribute features;

[0148] The scene recognition unit 530 inputs the attribute feature information of the business data into a pre-established scene recognition model to obtain the business scene to which the business data belongs, wherein the scene recognition model is trained based on the attribute feature information of the sample business data and the scene label corresponding to the sample business data, and the scene label is used to indicate the business scene to which the sample business data belongs;

[0149] The construction unit 540 constructs test data corresponding to the business scenario to which the business data belongs based on the business data and the categories to which the business data corresponds under the multiple attribute features.

[0150] The testing unit 550 performs service testing based on the constructed test data.

[0151] The service testing device provided in the embodiments of this specification can perform service testing based on test data corresponding to different service scenarios, thereby improving the accuracy and reliability of the test results. Subsequently, based on the service test results, relevant service processing tests can be performed, such as improving the performance of the service system.

[0152] Obviously, the service test device of the embodiment of this specification can be used as the above Figure 3 The execution subject of the business test method shown in Figure 3 Since the principle is the same, the functions realized are not described here.

[0153] Figure 6 This is a schematic diagram of the structure of an electronic device according to an embodiment of this specification. Figure 6 At the hardware level, the electronic device includes a processor and, optionally, an internal bus, a network interface, and memory. The memory may include internal memory, such as high-speed random-access memory (RAM), or non-volatile memory, such as at least one disk drive. Of course, the electronic device may also include other hardware required for its services.

[0154] The processor, network interface, and memory can be interconnected via an internal bus, which can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 6 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or one type of bus.

[0155] The memory is used to store programs. Specifically, the program may include program code, which includes computer operating instructions. The memory may include internal memory and non-volatile memory, and provides instructions and data to the processor.

[0156] The processor reads the corresponding computer program from the non-volatile memory into the internal memory and then runs it, forming a test data construction device at the logical level. The processor executes the program stored in the memory and is specifically used to perform the following operations:

[0157] Acquire attribute feature information of business data in a production environment, the attribute feature information including feature values corresponding to multiple attribute features of the business data;

[0158] Performing clustering training based on the feature values corresponding to the single attribute features of the business data to obtain the categories corresponding to the business data under the multiple attribute features;

[0159] Inputting the attribute feature information of the business data into a pre-established scene recognition model to obtain the business scene to which the business data belongs, wherein the scene recognition model is trained based on the attribute feature information of the sample business data and a scene label corresponding to the sample business data, and the scene label is used to indicate the business scene to which the sample business data belongs;

[0160] Based on the business data and the categories to which the business data respectively corresponds under the multiple attribute features, test data corresponding to the business scenario to which the business data belongs is constructed.

[0161] Alternatively, the processor reads the corresponding computer program from the non-volatile memory into the internal memory and then runs it, forming a business test device at the logical level. The processor executes the program stored in the memory and is specifically used to perform the following operations:

[0162] Acquire attribute feature information of business data in a production environment, the attribute feature information including feature values corresponding to multiple attribute features of the business data;

[0163] Performing clustering training based on the feature values corresponding to the single attribute features of the business data to obtain the categories corresponding to the business data under the multiple attribute features;

[0164] Inputting the attribute feature information of the business data into a pre-established scene recognition model to obtain the business scene to which the business data belongs, wherein the scene recognition model is trained based on the attribute feature information of the sample business data and a scene label corresponding to the sample business data, and the scene label is used to indicate the business scene to which the sample business data belongs;

[0165] Based on the business data and the categories corresponding to the business data under the multiple attribute characteristics, constructing test data corresponding to the business scenario to which the business data belongs;

[0166] Perform business testing based on constructed test data.

[0167] The above is as in this manual Figure 1 The method executed by the test data construction device disclosed in the embodiment shown or as described in this specification Figure 3The service testing methods disclosed in the illustrated embodiments can be applied to a processor or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by hardware integrated logic circuits in the processor or by software instructions. The above processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The various methods, steps, and logic block diagrams disclosed in the embodiments of this specification can be implemented or executed. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in conjunction with the embodiments of this specification can be directly implemented and executed by a hardware decoding processor, or by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium well-known in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, etc. The storage medium is located in the memory, and the processor reads the information in the memory and, in conjunction with its hardware, completes the steps of the above method.

[0168] It should be understood that the electronic device of the embodiment of this specification can realize the test data construction device in Figure 1 The functions of the embodiment shown in the figure, or the above service test device can be implemented in Figure 3 The functions of the embodiments shown in the figure are as follows. Since the principles are the same, the embodiments of this specification will not be repeated here. Since the principles are the same, the embodiments of this specification will not be repeated here.

[0169] Of course, in addition to software implementation, the electronic device in this specification does not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc. That is to say, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.

[0170] The embodiment of this specification also proposes a computer-readable storage medium, which stores one or more programs, wherein the one or more programs include instructions, which, when executed by a portable electronic device including multiple application programs, can enable the portable electronic device to execute Figure 1The method of the embodiment shown is specifically used to perform the following operations:

[0171] Acquire attribute feature information of business data in a production environment, the attribute feature information including feature values corresponding to multiple attribute features of the business data;

[0172] Performing clustering training based on the feature values corresponding to the single attribute features of the business data to obtain the categories corresponding to the business data under the multiple attribute features;

[0173] Inputting the attribute feature information of the business data into a pre-established scene recognition model to obtain the business scene to which the business data belongs, wherein the scene recognition model is trained based on the attribute feature information of the sample business data and a scene label corresponding to the sample business data, and the scene label is used to indicate the business scene to which the sample business data belongs;

[0174] Based on the business data and the categories to which the business data respectively corresponds under the multiple attribute features, test data corresponding to the business scenario to which the business data belongs is constructed.

[0175] Alternatively, when the above instructions are executed by a portable electronic device including a plurality of application programs, the portable electronic device can execute Figure 3 The method of the embodiment shown is specifically used to perform the following operations:

[0176] Acquire attribute feature information of business data in a production environment, the attribute feature information including feature values corresponding to multiple attribute features of the business data;

[0177] Performing clustering training based on the feature values corresponding to the single attribute features of the business data to obtain the categories corresponding to the business data under the multiple attribute features;

[0178] Inputting the attribute feature information of the business data into a pre-established scene recognition model to obtain the business scene to which the business data belongs, wherein the scene recognition model is trained based on the attribute feature information of the sample business data and a scene label corresponding to the sample business data, and the scene label is used to indicate the business scene to which the sample business data belongs;

[0179] Based on the business data and the categories corresponding to the business data under the multiple attribute characteristics, constructing test data corresponding to the business scenario to which the business data belongs;

[0180] Perform business testing based on constructed test data.

[0181] The foregoing description of this specification describes specific embodiments. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in an order different from that described in the embodiments and still achieve the desired results. Furthermore, the processes depicted in the accompanying drawings do not necessarily require the specific order shown or the sequential order to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0182] In short, the above description is only a preferred embodiment of this specification and is not intended to limit the scope of protection of this specification. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of this specification shall be included in the scope of protection of this specification.

[0183] The systems, devices, modules, or units described in the above embodiments may be implemented by computer chips or entities, or by products having certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.

[0184] Computer-readable media includes permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. The information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory computer-readable media (transitory media), such as modulated data signals and carrier waves.

[0185] It should also be noted that the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, commodity, or apparatus that includes a series of elements includes not only those elements but also other elements not explicitly listed, or includes elements inherent to such process, method, commodity, or apparatus. In the absence of further limitations, an element defined by the phrase "comprises a ..." does not exclude the presence of other identical elements in the process, method, commodity, or apparatus that includes the element.

[0186] The various embodiments in this specification are described in a progressive manner. Similar parts between the various embodiments can be referred to in conjunction with each other. Each embodiment focuses on the differences between the other embodiments. In particular, the system embodiments are generally similar to the method embodiments, so the description is relatively simple. For relevant parts, refer to the description of the method embodiments.

Claims

1. A test data construction method, characterized in that: include: Acquire attribute feature information of business data in a production environment, the attribute feature information including feature values corresponding to multiple attribute features of the business data; Performing clustering training based on the feature values corresponding to the single attribute features of the business data to obtain the categories corresponding to the business data under the multiple attribute features; Inputting the attribute feature information of the business data into a pre-established scene recognition model to obtain the business scene to which the business data belongs, wherein the scene recognition model is trained based on the attribute feature information of the sample business data and a scene label corresponding to the sample business data, and the scene label is used to indicate the business scene to which the sample business data belongs; Based on the business data and the categories corresponding to the business data under the multiple attribute characteristics, constructing test data corresponding to the business scenario to which the business data belongs; The step of constructing test data corresponding to the business scenario to which the business data belongs based on the business data and the categories to which the business data corresponds under the multiple attribute features includes: Based on the categories corresponding to the business data under the multiple attribute characteristics, the business data corresponding to the same category combination are aggregated to obtain business data corresponding to different category combinations, where the category combination refers to a combination of categories corresponding to the multiple attribute characteristics; Based on the business data corresponding to the same category combination, construct test data corresponding to the same category combination; The test data corresponding to the constructed different category combinations are determined as the test data corresponding to the business scenario to which the business data belongs.

2. The method according to claim 1, wherein After constructing test data corresponding to the business scenario to which the business data belongs, the method further includes: According to the business scenarios, the constructed test data and the locally stored test data are aggregated to obtain the test data sets corresponding to different business scenarios; Determining the characteristic values corresponding to the business data under the multiple attribute characteristics as the scenario characteristics of the business scenario to which the business data belongs; A test database is generated based on the test data sets and scenario characteristics corresponding to the different business scenarios.

3. The method according to claim 2, wherein After generating the test database, the method further includes: receiving a data acquisition request sent by a test party, wherein the data acquisition request is used to request acquisition of test data, and the data acquisition request carries scenario characteristics of a test scenario; Based on the scenario characteristics of the test scenario, acquiring target test data matching the test scenario from the test database; Feedback the target test data to the test party.

4. The method according to claim 1, wherein: The clustering training is performed based on the feature values corresponding to the single attribute features of the business data to obtain the categories corresponding to the business data under the multiple attribute features, including: Aggregating the business data based on the characteristic values corresponding to the single attribute features of the business data to obtain business data corresponding to different characteristic values of the single attribute features; Based on a preset clustering algorithm, the business data corresponding to different feature values of the single attribute feature are clustered to obtain the category corresponding to the business data under the single attribute feature.

5. The method according to claim 1, wherein Before inputting the attribute feature information of the business data into the pre-established scene recognition model, the method further includes: Obtaining attribute feature information of sample business data and scenario labels corresponding to the sample business data; The attribute feature information is used as input and the scene label corresponding to the sample business data is used as output for training to obtain the scene recognition model.

6. The method according to claim 1, wherein The scene recognition model is trained based on the attribute feature information of the desensitized sample business data and its corresponding scene labels; After acquiring the attribute feature information of the business data in the production environment, the method further includes: Desensitizing the business data and its attribute characteristic information.

7. The method according to any one of claims 1 to 6, characterized in that The multiple attribute characteristics include the type of business participants and the supported business types.

8. A test data construction device comprising: A first acquisition unit acquires attribute feature information of business data in a production environment, wherein the attribute feature information includes feature values corresponding to multiple attribute features of the business data; A single feature training unit performs clustering training based on the feature values corresponding to the single attribute features of the business data, so as to obtain the categories corresponding to the business data under the multiple attribute features; a scene recognition unit that inputs the attribute feature information of the business data into a pre-established scene recognition model to obtain a business scene to which the business data belongs, wherein the scene recognition model is trained based on the attribute feature information of sample business data and a scene label corresponding to the sample business data, wherein the scene label is used to indicate the business scene to which the sample business data belongs; A construction unit aggregates the business data corresponding to the same category combination based on the categories corresponding to the business data under the multiple attribute characteristics to obtain business data corresponding to different category combinations, where the category combination refers to a combination of categories corresponding to the multiple attribute characteristics; based on the business data corresponding to the same category combination, constructs test data corresponding to the same category combination; and determines the constructed test data corresponding to the different category combinations as test data corresponding to the business scenarios to which the business data belongs.

9. An electronic device comprising: processor; as well as a memory arranged to store computer-executable instructions which, when executed, cause the processor to: Acquire attribute feature information of business data in a production environment, the attribute feature information including feature values corresponding to multiple attribute features of the business data; Performing clustering training based on the feature values corresponding to the single attribute features of the business data to obtain the categories corresponding to the business data under the multiple attribute features; Inputting the attribute feature information of the business data into a pre-established scene recognition model to obtain the business scene to which the business data belongs, wherein the scene recognition model is trained based on the attribute feature information of the sample business data and a scene label corresponding to the sample business data, and the scene label is used to indicate the business scene to which the sample business data belongs; Based on the business data and the categories corresponding to the business data under the multiple attribute characteristics, constructing test data corresponding to the business scenario to which the business data belongs; The step of constructing test data corresponding to the business scenario to which the business data belongs based on the business data and the categories to which the business data corresponds under the multiple attribute features includes: Based on the categories corresponding to the business data under the multiple attribute characteristics, the business data corresponding to the same category combination are aggregated to obtain business data corresponding to different category combinations, where the category combination refers to a combination of categories corresponding to the multiple attribute characteristics; Based on the business data corresponding to the same category combination, construct test data corresponding to the same category combination; The test data corresponding to the constructed different category combinations are determined as the test data corresponding to the business scenario to which the business data belongs.

10. A computer-readable storage medium storing one or more programs that, when executed by an electronic device including a plurality of application programs, causes the electronic device to perform the following operations: Acquire attribute feature information of business data in a production environment, the attribute feature information including feature values corresponding to multiple attribute features of the business data; Performing clustering training based on the feature values corresponding to the single attribute features of the business data to obtain the categories corresponding to the business data under the multiple attribute features; Inputting the attribute feature information of the business data into a pre-established scene recognition model to obtain the business scene to which the business data belongs, wherein the scene recognition model is trained based on the attribute feature information of the sample business data and a scene label corresponding to the sample business data, and the scene label is used to indicate the business scene to which the sample business data belongs; Based on the business data and the categories corresponding to the business data under the multiple attribute characteristics, constructing test data corresponding to the business scenario to which the business data belongs; The step of constructing test data corresponding to the business scenario to which the business data belongs based on the business data and the categories to which the business data corresponds under the multiple attribute features includes: Based on the categories corresponding to the business data under the multiple attribute characteristics, the business data corresponding to the same category combination are aggregated to obtain business data corresponding to different category combinations, where the category combination refers to a combination of categories corresponding to the multiple attribute characteristics; Based on the business data corresponding to the same category combination, construct test data corresponding to the same category combination; The test data corresponding to the constructed different category combinations are determined as the test data corresponding to the business scenario to which the business data belongs.

Citation Information

Patent Citations

  • Method, device and system for constructing test data

    CN110597728A

  • Test data construction method and construction system

    CN110895506A