Business test data generation method and system, electronic equipment and storage medium

The target business model is determined through word segmentation processing and encoding matching, and business test data is generated, which solves the problems of low data generation efficiency and reliability in the existing technology, and realizes efficient and diverse data generation to meet business test needs.

CN119227639APending Publication Date: 2024-12-31CHINA TELECOM ARTIFICIAL INTELLIGENCE TECHNOLOGY (BEIJING) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411262299.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-09
Publication Date
2024-12-31

AI Technical Summary

Technical Problem

In the prior art, it is difficult to meet the data diversity and reliability requirements of business tests when constructing data by artificially simulating business behavior, and the efficiency and reliability of generating data are low, making it difficult to meet the test needs.

Method used

By obtaining preset input demand information and business model parameter information, it is used to process word segmentation, convert it into vocabulary index information, perform encoding and matching, determine the target business model, and use the target model to generate business test data, improving the diversity and reliability of data generation.

Benefits of technology

It realizes the rapid generation of business test data that meets business needs, improves the diversity and reliability of data generation, and meets the effectiveness and timeliness of data governance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119227639A_ABST
    Figure CN119227639A_ABST
Patent Text Reader

Abstract

The invention discloses a service test data generation method and system, electronic equipment and a storage medium, and the method comprises the steps: obtaining preset input demand information, and carrying out the word segmentation processing of the preset input demand information, and obtaining a first word segmentation list; obtaining model parameter information of a preset business model, and performing word segmentation processing on the model parameter information to obtain a second word segmentation list; converting the first word segmentation list and the second word segmentation list into a preset set; converting the preset set into a preset dictionary to obtain vocabulary index information; encoding the first word segmentation list and the second word segmentation list according to the vocabulary index information, and performing model matching through obtained encoding vector information to obtain a target business model; and performing data generation through the target business model to obtain business test data. According to the embodiment of the invention, the service test data meeting the service requirements can be quickly generated, and the diversity and reliability of the generation of the service test data are effectively improved. The method can be widely applied to the technical field of data construction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data construction technology, and in particular to a method, system, electronic device and storage medium for generating business test data. Background Art

[0002] With the development of the Internet, more and more network data is generated. Many companies analyze the industry data they have and develop business systems for reference. When testing such businesses, testers must pay attention to the accuracy, timeliness, and stability of the data analysis program. Therefore, a large amount of data is required during the testing process to meet the requirements of accuracy and timeliness. Accordingly, the data constructed during testing must meet the requirements of large quantity, data diversity, and data reliability to ensure the effectiveness and timeliness of data governance. In related technologies, data construction is mainly carried out by manually simulating business behaviors. However, manually constructed data often fails to generate the desired data according to established requirements and rules. The reliability and efficiency of the generated data are low, making it difficult to meet testing requirements.

[0003] In summary, the technical problems existing in the relevant technologies need to be improved. Summary of the Invention

[0004] The main purpose of the embodiments of the present application is to propose a business test data generation method, system, electronic device and storage medium, which can quickly generate business test data that meets business needs and effectively improve the diversity and reliability of business test data generation.

[0005] To achieve the above objectives, an embodiment of the present application provides a method for generating service test data, the method comprising the following steps:

[0006] Obtaining preset input requirement information, performing word segmentation processing on the preset input requirement information, and obtaining a first word segmentation list;

[0007] Obtaining model parameter information of a preset business model to perform word segmentation processing on the model parameter information to obtain a second word segmentation list;

[0008] Converting the first word segmentation list and the second word segmentation list into a preset set;

[0009] Converting the preset set into a preset dictionary to obtain vocabulary index information;

[0010] Encoding the first word segmentation list and the second word segmentation list respectively according to the vocabulary index information, performing model matching on the encoded vector information obtained by encoding, and obtaining a target business model;

[0011] Data is generated through the target business model to obtain business test data.

[0012] In some embodiments, before performing the step of obtaining model parameter information of a preset business model to perform word segmentation processing on the model parameter information to obtain a second word segmentation list, the method further includes:

[0013] Modeling is performed based on preset basic business scenarios and personalized business scenarios to obtain several preset business models.

[0014] In some embodiments, the modeling is performed based on the preset basic business scenarios and the personalized business scenarios to obtain several preset business models, including:

[0015] Obtain basic business data and personalized scenario data through preset built-in basic functions;

[0016] A model relationship network is generated according to the basic business data and the personalized scenario data, so as to form a plurality of the preset business models through the model relationship network; wherein the preset business models include business scenario models under different scenarios.

[0017] In some embodiments, encoding the first word segmentation list and the second word segmentation list respectively according to the vocabulary index information, and performing model matching on the encoded vector information obtained by encoding to obtain a target business model includes:

[0018] Performing one-hot encoding on the first word segmentation list according to the vocabulary index information to obtain a first encoding vector;

[0019] Performing one-hot encoding on the second word segmentation list according to the vocabulary index information to obtain a second encoding vector;

[0020] Calculating preset similarity data based on the first encoding vector and the second encoding vector using a cosine similarity algorithm;

[0021] The target business model is determined from the plurality of preset business models using the preset similarity data.

[0022] In some embodiments, determining the target business model from the plurality of preset business models using the preset similarity data includes:

[0023] When it is determined that the preset similarity data is greater than or equal to a preset similarity threshold, the corresponding preset business model is determined as the target business model.

[0024] In some embodiments, generating data using the target business model to obtain business test data includes:

[0025] Generate asynchronous batch data through a preset thread pool according to the target business model to obtain the business test data;

[0026] The service test data is stored in a preset data storage unit.

[0027] In some embodiments, the asynchronous batch data generation through a preset thread pool according to the target business model to obtain the business test data includes:

[0028] Generate data through a first thread according to the target business model to obtain the business test data;

[0029] The construction state data is recorded by the second thread; wherein the construction state data includes the data construction state during the data generation process by the first thread.

[0030] To achieve the above objectives, another aspect of the present application provides a service test data generation system, the system comprising:

[0031] The first module is used to obtain preset input requirement information, perform word segmentation processing on the preset input requirement information, and obtain a first word segmentation list;

[0032] The second module is used to obtain model parameter information of a preset business model, and perform word segmentation processing on the model parameter information to obtain a second word segmentation list;

[0033] A third module is configured to convert the first word segmentation list and the second word segmentation list into a preset set;

[0034] A fourth module is configured to convert the preset set into a preset dictionary to obtain vocabulary index information;

[0035] A fifth module is configured to encode the first word segmentation list and the second word segmentation list respectively according to the vocabulary index information, and perform model matching on the encoded vector information obtained by encoding to obtain a target business model;

[0036] The sixth module is used to generate data through the target business model to obtain business test data.

[0037] To achieve the above-mentioned object, another aspect of the present application provides an electronic device, comprising:

[0038] at least one processor;

[0039] at least one memory for storing at least one program;

[0040] When the at least one program is executed by the at least one processor, the at least one processor implements the above method.

[0041] To achieve the above-mentioned purpose, another aspect of an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program implements the above-mentioned method when executed by a processor.

[0042] The embodiments of the present application include at least the following beneficial effects: The present application provides a method, system, electronic device and storage medium for generating business test data. The scheme obtains preset input requirement information to perform word segmentation processing on the preset input requirement information to obtain a first word segmentation list. At the same time, the embodiment of the present invention obtains model parameter information of a preset business model to perform word segmentation processing on the model parameter information to obtain a second word segmentation list. Then, the embodiment of the present invention converts the first word segmentation list and the second word segmentation list into a preset set, and then the embodiment of the present invention converts the preset set into a preset dictionary to obtain vocabulary index information, thereby encoding the first word segmentation list and the second word segmentation list respectively according to the vocabulary index information, and performing model matching on the encoding vector information obtained by encoding to obtain a target business model. Finally, the embodiment of the present invention generates data through the target business model to obtain business test data, thereby realizing rapid generation of business test data. It is easy to understand that the embodiment of the present invention constructs a first word segmentation list and a second word segmentation list, and then constructs vocabulary index information, encodes the first word segmentation list and the second word segmentation list through the vocabulary index information, and obtains the target business model by matching the encoded encoding vector information. In this way, the corresponding target business model can be determined more accurately, thereby effectively generating business test data that meets business needs, and data generation through the determined target business model can effectively improve the diversity and reliability of business test data generation. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 This is a schematic diagram of the steps of the method for generating business test data provided by an embodiment of the present invention;

[0044] Figure 2 This is a schematic diagram of the overall process of the service test data generation method provided by an embodiment of the present invention;

[0045] Figure 3 This is a schematic flow chart of steps for modeling a plurality of preset business models based on preset basic business scenarios and personalized business scenarios, provided by an embodiment of the present invention;

[0046] Figure 4 yes Figure 1 Flowchart of step S150 in FIG.

[0047] Figure 5 yes Figure 1 Flowchart of step S160 in FIG.

[0048] Figure 6 This is a schematic diagram of a process for asynchronously generating data provided by an embodiment of the present invention;

[0049] Figure 7 This is a schematic diagram of a specific process for generating service test data provided by an embodiment of the present invention;

[0050] Figure 8 This is a schematic diagram of a service test data generation architecture provided by an embodiment of the present invention;

[0051] Figure 9 This is a schematic diagram of the structure of the service test data generation system provided in an embodiment of the present application;

[0052] Figure 10 This is a schematic diagram of the hardware structure of the electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0053] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the embodiments of the present application. They are merely examples of devices and methods consistent with some aspects of the embodiments of the present application as detailed in the appended claims.

[0054] It will be understood that the terms "first", "second", etc. used in this application may be used herein to describe various concepts, but unless otherwise specified, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another. For example, without departing from the scope of the embodiments of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the words "if" and "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0055] The terms "at least one", "plurality", "each", "any", etc. used in this application include "at least one", "two" or more, "plurality" or "each", "any" or "any one", "each" or "any one" as used herein.

[0056] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application pertains. The terms used herein are for the purpose of describing the embodiments of this application only and are not intended to limit this application.

[0057] Before explaining the embodiments of the present application in detail, some of the nouns and terms involved in the embodiments of the present application are first explained. The nouns and terms involved in the embodiments of the present application are subject to the following explanations.

[0058] Hadoop Distributed File System (HDFS): It is a distributed storage solution for storing and managing large-scale data sets. It locates files through a directory tree and is suitable for write-once, read-many scenarios.

[0059] One-hot encoding (oneHot): is a technique that converts categorical variables into a format that is easy for machine learning algorithms to process. It solves the problem that classifiers have difficulty processing discrete data. By expanding the values ​​of discrete features to Euclidean space, the distance calculation between features is more reasonable.

[0060] Data accuracy: refers to the closeness between the observed value or estimated value and the true value or the generally accepted true value. It emphasizes whether there are anomalies or errors in the information recorded in the data.

[0061] Data timeliness: The timeliness of data involves the length of time from the generation of data to its collection, processing, analysis and release, as well as the currentness and relevance of the data in reflecting the real situation.

[0062] Data diversity: This refers to the inclusion of diverse data types, sources, and formats within a dataset, such as text, images, audio, and video. Increasing data diversity improves the accuracy and comprehensiveness of data analysis and mining, leading to a better understanding of the underlying information and trends.

[0063] Data reliability refers to the accurate, complete, and timely acquisition of data during storage, transmission, and processing. It is a key factor in ensuring the effectiveness of data analysis and decision-making. Accordingly, it involves the accuracy, completeness, consistency, and credibility of data.

[0064] With the development of the Internet, more and more network data is generated. Many companies analyze the industry data they have and develop business systems for reference. When testing such businesses, testers must pay attention to the accuracy, timeliness, and stability of the data analysis program. Therefore, a large amount of data is required during the testing process to meet the requirements of accuracy and timeliness. Accordingly, the data constructed during testing must meet the requirements of large quantity, data diversity, and data reliability to ensure the effectiveness and timeliness of data governance. In related technologies, data construction is mainly carried out by manually simulating business behaviors. However, manually constructed data often fails to generate the desired data according to established requirements and rules. The reliability and efficiency of the generated data are low, making it difficult to meet testing requirements.

[0065] In view of this, a method, system, electronic device and storage medium for generating business test data are provided in an embodiment of the present application. The scheme obtains preset input requirement information to perform word segmentation processing on the preset input requirement information to obtain a first word segmentation list. At the same time, an embodiment of the present invention obtains model parameter information of a preset business model to perform word segmentation processing on the model parameter information to obtain a second word segmentation list. Then, an embodiment of the present invention converts the first word segmentation list and the second word segmentation list into a preset set, and then an embodiment of the present invention converts the preset set into a preset dictionary to obtain vocabulary index information, thereby encoding the first word segmentation list and the second word segmentation list respectively according to the vocabulary index information, and performing model matching on the encoding vector information obtained by encoding to obtain a target business model. Finally, an embodiment of the present invention generates data through the target business model to obtain business test data, which can quickly generate business test data that meets business needs and effectively improves the diversity and reliability of business test data generation.

[0066] The business test data generation method provided in the embodiment of the present application relates to the field of data construction technology. The business test data generation method provided in the embodiment of the present application can be applied to a terminal, can also be applied to a server, and can also be software running in a terminal or a server. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, and a car terminal, etc., but is not limited to this; the server side can be configured as an independent physical server, or can be configured as a server cluster or distributed system composed of multiple physical servers, and can also be configured as a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The server can also be a node server in a blockchain network; the software can be an application that implements the business test data generation method, etc., but is not limited to the above forms.

[0067] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, and the like. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, and the like that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments in which tasks are performed by remote processing devices connected via a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media, including storage devices.

[0068] Figure 1 This is an optional flowchart of the method for generating business test data provided in an embodiment of the present application. Figure 1 The method may include but is not limited to steps S110 to S160.

[0069] Step S110: obtaining preset input requirement information, performing word segmentation processing on the preset input requirement information, and obtaining a first word segmentation list.

[0070] Step S120: Obtain model parameter information of a preset business model to perform word segmentation processing on the model parameter information to obtain a second word segmentation list.

[0071] Step S130: Convert the first word segmentation list and the second word segmentation list into a preset set.

[0072] Step S140: Convert the preset set into a preset dictionary to obtain vocabulary index information.

[0073] Step S150: Encode the first word segmentation list and the second word segmentation list respectively according to the vocabulary index information, and perform model matching on the encoding vector information obtained by encoding to obtain a target business model.

[0074] Step S160: Generate data using the target business model to obtain business test data.

[0075] During the operation of this specific embodiment, the present invention first obtains preset input requirement information and performs word segmentation processing on the preset input requirement information to obtain a first word segmentation list. Specifically, the preset input requirement information in the present invention refers to user requirement information. For example, in the present invention, a user enters the web test data requirement information required to be generated through a corresponding web interface or application, i.e., the preset input requirement information. Accordingly, the present invention segments the obtained preset input requirement information into a number of vocabulary units, thereby obtaining a first word segmentation list. Next, the present invention obtains model parameter information for a preset business model and performs word segmentation processing on the model parameter information to obtain a second word segmentation list. Specifically, in the present invention, the preset business model refers to a number of pre-constructed business models corresponding to different business scenarios and capable of generating business test data for the corresponding business scenarios. Accordingly, the model parameter information in the present invention refers to parameter data corresponding to each preset business model, such as the business model name, business model type, or business model identifier. The present invention obtains the model parameter information for each preset business model and performs word segmentation processing on the model parameter information to obtain the second word segmentation list. It is easy to understand that the embodiment of the present invention performs word segmentation processing on the preset input requirement information and the model parameter information respectively to facilitate subsequent model matching.

[0076] Next, the embodiment of the present invention converts the first and second word segmentation lists into a preset set, and converts the preset set into a preset dictionary to obtain vocabulary index information. The first and second word segmentation lists are then encoded based on the vocabulary index information, and the resulting encoding vector information is used for model matching to obtain the target business model. Specifically, the embodiment of the present invention first converts the two lists, namely the first and second word segmentation lists, into a set (i.e., the preset set), and merges the two lists into a single set to remove duplicate elements. The embodiment of the present invention then converts the resulting preset set into a dictionary (i.e., the preset dictionary). For example, in the preset dictionary of the embodiment of the present invention, the key is still a word, and the value is the position of the word in the set, thereby determining the corresponding vocabulary index information. Next, the embodiment of the present invention encodes the first and second word segmentation lists based on the determined position of the word in the set (i.e., the vocabulary index information) to obtain corresponding encoding vector information, thereby forming word frequency data for the preset input demand information and model parameter information. Based on this word frequency data, the preset input demand information can be matched with each preset business model to determine the target business model from each preset model. Finally, the embodiment of the present invention generates data using the target business model to obtain business test data. Specifically, after matching the corresponding preset business model, the embodiment of the present invention quickly constructs business test data using the determined target business model, thereby generating business test data that meets the preset input requirement information.

[0077] In some embodiments of the present invention, before obtaining model parameter information of a preset business model to perform word segmentation processing on the model parameter information to obtain a second word segmentation list, the business test data generation method provided by the embodiment of the present invention further includes but is not limited to the following steps:

[0078] Modeling is performed based on preset basic business scenarios and personalized business scenarios to obtain several preset business models.

[0079] In this specific embodiment, before the model parameter learning is segmented, the embodiment of the present invention first models the model based on the preset basic business scenarios and personalized business scenarios to obtain several preset business models. Specifically, the preset basic business scenarios in the embodiment of the present invention refer to the basic businesses of different business application scenarios, such as online shopping scenarios in shopping application scenarios. Correspondingly, personalized business scenarios refer to personalized businesses provided in different business application scenarios, such as group buying businesses in online shopping. Accordingly, the embodiment of the present invention can more accurately model the corresponding business scenarios by modeling the preset basic business scenarios and personalized business scenarios, thereby constructing models corresponding to each business scenario, that is, several preset business models. For example, Figure 2As shown, a data simulator is provided in the intelligent business test data construction tool of an embodiment of the present invention, which embeds a large number of pre-built preset business models for different industries or scenarios. These preset business models are generated based on relevant data of the industry or business scenario and can meet the requirements of data diversity and data reliability.

[0080] Reference Figure 3 In some embodiments of the present invention, modeling is performed based on preset basic business scenarios and personalized business scenarios to obtain several preset business models, including but not limited to the following steps:

[0081] Step S210: Obtain basic business data and personalized scenario data through preset built-in basic functions.

[0082] Step S220: Generate a model relationship network based on the basic business data and the personalized scenario data, so as to form a plurality of preset business models through the model relationship network, wherein the preset business models include business scenario models under different scenarios.

[0083] In this specific embodiment, the present invention first obtains basic business data and personalized scenario data through a preset built-in basic function. Specifically, in this embodiment, the preset built-in basic function refers to a downstream built-in basic function. For example, in an online shopping scenario, both basic business data and personalized scenario data are generated by a downstream built-in basic function. In this embodiment, basic business data refers to the business data corresponding to the preset basic business scenario, including both structured and unstructured data. This business data can be organized into basic data based on the actual business scenario. For example, in an e-commerce activity business scenario, basic business data includes purchase order data for the e-commerce activity and order data for sports products for the past month. The e-commerce activity purchase order data includes A1: order ID, A2: product category, A3: total sales, A4: product price, A5: transaction status, A6: payment status, A7: product ID, A8: product link, A9: application name, A10: user ID, A11: event information, A12: review information, A13: logistics information, and A14: application name. Correspondingly, the order data of sports products in the past month may include B1: order id, B2: product category, B3: total sales, B4: product price, B5: transaction status, B6: payment status, B7: product id, B8: product link, B9: application name, B10: user id, B11: order time, B12: comment information, B13: logistics information, B14: payment time. In addition, the personalized scenario data in the embodiment of the present invention refers to the business data corresponding to the personalized business scenario. It is easy to understand that in addition to the basic business data, the embodiment of the present invention also obtains personalized scenario data for different application scenarios. For example, the group buying function in the online shopping embodiment of the present invention, the specific fields include F1: number of group buying, F2: user id, F3: product id, F4: number of group buying people, F5: group buying time. Correspondingly, for the above-mentioned scenario data, the embodiment of the present invention obtains it through the preset built-in basic function, that is, the downstream built-in basic function.

[0084] Furthermore, the embodiment of the present invention generates a model relationship network based on the basic business data and personalized scenario data to form several preset business models through the model relationship network. Specifically, the preset business models in the embodiment of the present invention include business scenario models under different scenarios, that is, the embodiment of the present invention constructs business models corresponding to several different business scenarios respectively to meet the requirements of data diversity and data reliability. Accordingly, the embodiment of the present invention forms a business model relationship network by acquiring key information in the basic business data and personalized scenario data, such as user id, product id, comment id, logistics id, order id, etc., so as to construct preset business models corresponding to different business scenarios, such as business scenario models of online shopping behaviors under different scenarios. In addition, the embodiment of the present invention stores the constructed preset business models in json format. For example, the overall structure of the online shopping behavior model in json format under the e-commerce activities of sports products on a certain shopping platform is as follows:

[0085]

[0086]

[0087] For example, after constructing each preset business model, the embodiment of the present invention stores these preset business models in the data simulator. An example of a stored business model of the data simulator is shown in Table 1 below:

[0088] Table 1

[0089]

[0090] Reference Figure 4 In some embodiments of the present invention, encoding the first word segmentation list and the second word segmentation list respectively according to the vocabulary index information, and performing model matching on the encoded vector information obtained by encoding to obtain the target business model includes but is not limited to the following steps:

[0091] Step S310: One-hot encode the first word list according to the vocabulary index information to obtain a first encoding vector.

[0092] Step S320: One-hot encode the second word list according to the vocabulary index information to obtain a second encoding vector.

[0093] Step S330: Calculate preset similarity data based on the first encoding vector and the second encoding vector using a cosine similarity algorithm.

[0094] Step S340: determining a target business model from a number of preset business models using preset similarity data.

[0095] In this specific embodiment, the embodiment of the present invention first performs one-hot encoding on the first word segmentation list according to the vocabulary index learning to obtain a first encoding vector, and performs one-hot encoding on the second word segmentation list according to the vocabulary index learning to obtain a second encoding vector, and then calculates the preset similarity data based on the first encoding vector and the second encoding vector through the cosine similarity algorithm to determine the target business model from a number of preset business models through the preset similarity data. Specifically, the one-hot encoding (oneHot) in the embodiment of the present invention is a data encoding method that converts categorical variables into a form that is easy for the machine to process. Accordingly, the embodiment of the present invention performs one-hot encoding on the first word segmentation list and the second word segmentation list according to the position of the word in the preset set, that is, vocabulary index learning, so as to calculate the word frequency vector (that is, the first encoding vector) of each word in the first word segmentation list and the word frequency vector (that is, the second encoding vector) of each word in the second word segmentation list. Then, the embodiment of the present invention calculates the preset similarity through the cosine similarity formula, as shown in the following formula (1):

[0096]

[0097] Among them, x i Represents the first encoding vector, that is, the word frequency vector of the first word segmentation list, y i Represents the second encoding vector, that is, the word frequency vector of the second word segmentation list.

[0098] Next, the embodiment of the present invention determines whether the calculated cosθ satisfies the preset matching rules, thereby determining a target business model from among several preset business models. For example, if the calculated cosθ is greater than a preset similarity threshold, it indicates a successful match, and the corresponding preset business model is selected as the target business model. Alternatively, the preset business model with the largest calculated cosθ is selected as the target business model.

[0099] In some embodiments of the present invention, determining a target business model from a plurality of preset business models using preset similarity data includes but is not limited to the following steps:

[0100] When it is determined that the preset similarity data is greater than or equal to the preset similarity threshold, the corresponding preset business model is determined as the target business model.

[0101] In this specific embodiment, the embodiment of the present invention determines the target business model by setting a preset similarity threshold to determine whether the preset similarity data satisfies the preset matching rules. Specifically, the preset similarity threshold in the embodiment of the present invention refers to the cosine similarity threshold of the preset input requirement information and the model parameter information. Accordingly, when the calculated preset similarity data is greater than or equal to the preset similarity threshold, such as when the preset similarity data is greater than or equal to 0.8, the preset matching condition is met and the corresponding preset business model is matched, such as determining the corresponding business model name, thereby determining the preset business model as the target business model.

[0102] Reference Figure 5 In some embodiments of the present invention, data generation is performed using a target business model to obtain business test data, including but not limited to the following steps:

[0103] Step S410: Asynchronous batch data generation is performed through a preset thread pool according to the target business model to obtain business test data.

[0104] Step S420: storing the service test data in a preset data storage unit.

[0105] In this specific embodiment, the embodiment of the present invention first performs asynchronous batch data generation through a preset thread pool according to the target business model to obtain business test data. Specifically, after matching the relevant information of the target business model from the preset business model, such as the business model name, the embodiment of the present invention sends the relevant learning of the target business model to the data simulator to select the target business model from the preset business models of different business scenarios embedded in the data simulator. Accordingly, after determining the target business model, the embodiment of the present invention customizes the thread pool through ThreadPoolExecutor to perform asynchronous batch data generation to obtain business test data. Then, the embodiment of the present invention stores the batch-generated business test data in a preset data storage unit. Among them, the preset data storage unit in the embodiment of the present invention includes a distributed file system (HDFS) for storing files, and locates files through a directory tree. By storing the business test data in a preset data storage unit, such as a distributed file system, the embodiment of the present invention can improve the reliability of the business test data and meet the data processing requirements.

[0106] In some embodiments of the present invention, asynchronous batch data generation is performed through a preset thread pool according to a target business model to obtain business test data, including:

[0107] Data is generated through the first thread according to the target business model to obtain business test data.

[0108] The second thread records the construction state data, wherein the construction state data includes the data construction state during the data generation process by the first thread.

[0109] In this specific embodiment, the embodiment of the present invention first generates data through the first thread according to the target business model to obtain business test data, and records the construction state data through the second thread. Specifically, the construction state data in the embodiment of the present invention includes the data construction state during the data generation process of the first thread. Figure 6 , after the data simulator selects the target business model, it uses the asynchronous capability provided by ThreadPoolExecutor to adopt two threads, namely the first thread and the second thread, to perform asynchronous batch generation. Among them, in the embodiment of the present invention, thread 1 (the first thread) calculates the data volume, generates data, and calls the underlying high-performance construction engine to construct large batches of data to obtain business test data. Accordingly, the basic data of the business model generated in the embodiment of the present invention is saved in json format, and the business model data generated each time is compressed, such as compressed into zip format, and stored in the distributed file system (HDFS) to obtain business test data. Correspondingly, in the embodiment of the present invention, thread 2 (the second thread) assists thread 1 (the first thread) in constructing data, records the construction status data, and returns the download link to the user, so as to realize the business model data construction requirements of human-computer interaction.

[0110] The following describes the solution of the embodiment of the present invention in detail with reference to a specific business test data generation scenario:

[0111] For example, referring to Figure 7 and Figure 8 , Figure 7 A schematic diagram of a specific process for generating business test data provided by an embodiment of the present invention, Figure 8A schematic diagram of the business test data generation architecture provided by an embodiment of the present invention. Specifically, when data analysis is required around online shopping behavior, the data analysis system's analytical capabilities must be accurate and reliable. In this business scenario, the embodiment of the present invention requires business data on online shopping behavior for testing. Accordingly, the embodiment of the present invention models the business model of online shopping behavior using basic business data and personalized scenario data provided by different online shopping applications. This model is constructed and stored in a data simulator. The business test data generation in the embodiment of the present invention utilizes a front-end and back-end interactive approach, provided externally as a service. The system obtains user requirements, generates the required business model dataset, and returns the storage path of the business model dataset to the user. Accordingly, the embodiment of the present invention constructs several preset business models in the front-end. To implement human-computer interaction and intelligent data construction, the back-end service first analyzes the user's requirements and obtains the user's input query, i.e., the preset input requirement information. After obtaining the query, the back-end performs word segmentation processing on it to obtain a first word segmentation list. Simultaneously, the embodiment of the present invention obtains the business model names of all preset business models and performs word segmentation processing to obtain a second word segmentation list, thereby forming two lists. For example, in an embodiment of the present invention, the user input query is "I need some order data for XY sports products", and the first segmentation list after word segmentation is "I need some order data for XY sports products". In addition, in an embodiment of the present invention, the business model name is "ABB sports products online shopping behavior model under XY activity", and the second segmentation list after word segmentation is "ABB sports products online shopping behavior model under XY activity". Then, the embodiment of the present invention converts the two lists into a preset set, and then converts the preset set into a preset dictionary dict to determine the position of the word in the preset set and obtain the vocabulary index information. Furthermore, the embodiment of the present invention performs oneHot encoding on the two lists respectively to form the word frequency of the query and the business model name, that is, the word frequency vector. For example, the embodiment of the present invention first counts the frequency of each word, including the following: I, need, some, X, Y, sports, categories, commodities, orders, data, A, BB, network, shopping, behavior, model, under, activities. Correspondingly, the frequency of the first word segmentation list is: I 1, need 1, some 1, X1, Y1, 2, sports 1, categories 1, commodities 1, orders 1, data 1, A0, BB0, network 0, shopping 0, behavior 0, model 0, under 0, activities 1, under 0. Meanwhile, the frequency of the second word segmentation list is: I 0, need 0, some 0, X1, Y1, 1, sports 1, categories 1, commodities 1, orders 0, data 0, A1, BB1, network 1, shopping 1, behavior 1, model 1, under 0, activities 1, under 1.It can be obtained that the word frequency vector of the first word segmentation list in the embodiment of the present invention is (1,1,1,1,1,2,1,1,1,1,1,1,0,0,0,0,0,0,0,1,0), and the word frequency vector of the second word segmentation list is (0,0,0,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,0,1,1). Accordingly, the embodiment of the present invention calculates the preset similarity data through the cosine similarity formula using the word frequency vector of the first word segmentation list (first encoding vector) and the word frequency vector of the second word segmentation list (second encoding vector) to determine the target business model through the cosine similarity data. Correspondingly, when it is determined that the calculated preset similarity data is greater than or equal to 0.8, it means that the matching condition is met and the target business model is matched. For example, the preset similarity data calculated based on the word frequency vectors of the first word segmentation list and the second word segmentation list is. When the preset similarity threshold is set to 0.8, the preset similarity data is less than the preset similarity threshold, indicating a match failure. Finally, asynchronous batch data generation is performed based on the target business model to obtain business test data, which is then stored in the distributed file system (HDFS) and the storage path is returned to the client.

[0112] It is easy to understand that, in the process of constructing the preset business model, the embodiment of the present invention starts from the diversity and reliability of data, analyzes the characteristics of the business scenarios, connects the data of each scenario of the business, constructs a number of preset business models, and can quickly generate business test data according to the target business model. At the same time, in the process of user demand analysis, the embodiment of the present invention matches the user demand and the constructed business model library through the cosine similarity algorithm, can fully understand the user demand, quickly construct the business test data required by the user, and form a business test data set. Accordingly, the business test data generation method provided by the embodiment of the present invention, by constructing a rich variety of preset business models, can enable business testers to generate large quantities of business test data through an interface with one click, store them in a distributed file system (HDFS), and form a large number of business test data sets. When in use, the corresponding business model data can be obtained according to the business data set storage path for business testing, thereby improving test efficiency.

[0113] See also Figure 9 The present application also provides a service test data generation system that can implement the above service test data generation method. The system includes:

[0114] The first module 510 is configured to obtain preset input requirement information, perform word segmentation processing on the preset input requirement information, and obtain a first word segmentation list.

[0115] The second module 520 is configured to obtain model parameter information of a preset business model, and perform word segmentation processing on the model parameter information to obtain a second word segmentation list.

[0116] The third module 530 is configured to convert the first word segmentation list and the second word segmentation list into a preset set.

[0117] The fourth module 540 is configured to convert the preset set into a preset dictionary to obtain vocabulary index information.

[0118] The fifth module 550 is used to encode the first word segmentation list and the second word segmentation list respectively according to the vocabulary index information, and perform model matching on the encoding vector information obtained by encoding to obtain a target business model.

[0119] The sixth module 560 is used to generate data through the target business model to obtain business test data.

[0120] It can be understood that the contents of the above method embodiments are applicable to the present system embodiments, the functions specifically implemented by the present system embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0121] The present application also provides an electronic device comprising a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the above-mentioned method for generating service test data. The electronic device can be any smart terminal, including a tablet computer and an in-vehicle computer.

[0122] It can be understood that the contents of the above method embodiments are applicable to the present device embodiments, the functions specifically implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0123] See also Figure 10 , Figure 10 The hardware structure of an electronic device according to another embodiment is shown. The electronic device includes:

[0124] The processor 610 may be implemented as a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is configured to execute relevant programs to implement the technical solutions provided in the embodiments of the present application.

[0125] The memory 620 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 620 can store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 620 and is called by the processor 610 to execute the service test data generation method of the embodiments of this application.

[0126] Input / output interface 630, used to implement information input and output;

[0127] Communication interface 640, used to implement communication interaction between this device and other devices, which can be achieved through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WiFi, Bluetooth, etc.);

[0128] bus 650 , which transmits information between the various components of the device (e.g., processor 610 , memory 620 , input / output interface 630 , and communication interface 640 );

[0129] The processor 610 , the memory 620 , the input / output interface 630 and the communication interface 640 are connected to each other in communication within the device via the bus 650 .

[0130] An embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the above-mentioned business test data generation method is implemented.

[0131] It can be understood that the contents of the above method embodiments are all applicable to the present storage medium embodiment, the functions specifically implemented by the present storage medium embodiment are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0132] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely arranged relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0133] The embodiments described in the embodiments of this application are intended to more clearly illustrate the technical solutions of the embodiments of this application and do not constitute a limitation on the technical solutions provided by the embodiments of this application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.

[0134] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.

[0135] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, i.e., they may be located in one place or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of this embodiment.

[0136] Those skilled in the art will appreciate that all or some of the steps in the methods, systems, and functional modules / units in the devices disclosed above may be implemented as software, firmware, hardware, or appropriate combinations thereof.

[0137] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0138] It should be understood that in this application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following items" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.

[0139] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the above-mentioned units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0140] The units described above as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0141] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0142] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes multiple instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: various media that can store programs, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0143] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but are not intended to limit the scope of the present invention. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and essence of the present invention should be within the scope of the present invention.

Claims

1. A method for generating business test data, characterized in that: The method comprises the following steps: Acquire preset input requirement information to perform word segmentation processing on the preset input requirement information to obtain a first word segmentation list; Obtaining model parameter information of a preset business model to perform word segmentation processing on the model parameter information to obtain a second word segmentation list; Converting the first word segmentation list and the second word segmentation list into a preset set; Converting the preset set into a preset dictionary to obtain vocabulary index information; Encoding the first word segmentation list and the second word segmentation list respectively according to the vocabulary index information, and performing model matching through the encoding vector information obtained by encoding to obtain a target business model; Data is generated through the target business model to obtain business test data.

2. The method according to claim 1, characterized in that Before executing the step of acquiring model parameter information of a preset business model to perform word segmentation processing on the model parameter information to obtain a second word segmentation list, the method further includes: Modeling is performed according to preset basic business scenarios and personalized business scenarios to obtain several preset business models.

3. The method according to claim 2, characterized in that The modeling is performed according to the preset basic business scenarios and the personalized business scenarios to obtain several preset business models, including: Obtain basic business data and personalized scenario data through preset built-in basic functions; A model relationship network is generated according to the basic business data and the personalized scenario data, so as to form a plurality of the preset business models through the model relationship network; wherein the preset business models include business scenario models under different scenarios.

4. The method according to claim 1, characterized in that The encoding of the first word segmentation list and the second word segmentation list according to the vocabulary index information is performed respectively, and the model matching is performed through the encoding vector information obtained by encoding to obtain the target business model, including: Performing one-hot encoding on the first word segmentation list according to the vocabulary index information to obtain a first encoding vector; Performing one-hot encoding on the second word segmentation list according to the vocabulary index information to obtain a second encoding vector; Calculating preset similarity data according to the first encoding vector and the second encoding vector by using a cosine similarity algorithm; The target business model is determined from the plurality of preset business models using the preset similarity data.

5. The method according to claim 4, characterized in that The determining the target business model from the plurality of preset business models by using the preset similarity data includes: When it is determined that the preset similarity data is greater than or equal to a preset similarity threshold, the corresponding preset business model is determined as the target business model.

6. The method according to claim 1, characterized in that The step of generating data through the target business model to obtain business test data includes: Asynchronous batch data generation is performed through a preset thread pool according to the target business model to obtain the business test data; The service test data is stored in a preset data storage unit.

7. The method according to claim 6, characterized in that The asynchronous batch data generation is performed through a preset thread pool according to the target business model to obtain the business test data, including: Generate data through a first thread according to the target business model to obtain the business test data; The construction state data is recorded by the second thread; wherein the construction state data includes the data construction state during the data generation process performed by the first thread.

8. A business test data generation system, characterized in that: The system comprises: The first module is used to obtain preset input requirement information to perform word segmentation processing on the preset input requirement information to obtain a first word segmentation list; The second module is used to obtain model parameter information of a preset business model to perform word segmentation processing on the model parameter information to obtain a second word segmentation list; A third module is used to convert the first word segmentation list and the second word segmentation list into a preset set; A fourth module is used to convert the preset set into a preset dictionary to obtain vocabulary index information; A fifth module is used to encode the first word segmentation list and the second word segmentation list respectively according to the vocabulary index information, so as to perform model matching through the encoding vector information obtained by encoding to obtain a target business model; The sixth module is used to generate data through the target business model to obtain business test data.

9. An electronic device, characterized in that: include: at least one processor; at least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements the method according to any one of claims 1 to 7.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.