Test method, device, electronic device and storage medium
Through the automated data processing process, high-precision extended data is generated and tested, which solves the low efficiency and accuracy problems of traditional manual testing methods and achieves efficient and low-cost business processing logic verification.
Patent Information
- Application Number
- CN202210139696.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-15
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2042-02-15
AI Technical Summary
The traditional testing method relies on manual operations, which results in tight time and a large amount of repetitive verification work. The verification results may be biased due to human factors, and the cost is high.
By classifying, extracting, keyword extraction, masking and data completion processing of data tables based on preset business tags, high-precision extended data is automatically generated and input into the business processing model for testing, reducing manual intervention.
It improves testing efficiency and accuracy, reduces labor costs, and achieves high-precision business processing logic testing.
Smart Images

Figure CN114490620B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a testing method, device, electronic equipment and storage medium. Background Art
[0002] At present, in a business scenario, business personnel often adjust pricing rules to meet the needs of loan-related businesses for groups with different qualifications. However, due to the large number of pricing code value factors, as much coverage verification as possible is required after the adjustment to ensure that there will be no problems after the product is launched. Therefore, the adjusted pricing rules need to be tested before going online.
[0003] The traditional testing method is to perform manual testing manually, which faces the following problems: 1. Time is tight but the workload is large; 2. There are a large number of repetitive verification tasks with similar operations, which may cause deviations in the verification results due to human factors. Summary of the invention
[0004] In order to solve the above-mentioned problems existing in the prior art, the embodiments of the present application provide a testing method, device, electronic device and storage medium, which can automatically generate high-precision extended data based on actual data to test the adjusted business processing logic, thereby reducing labor costs and improving testing efficiency and testing accuracy.
[0005] In a first aspect, an embodiment of the present application provides a testing method, comprising:
[0006] Classify each factor in the data table according to at least one preset business tag to obtain at least one classification result, wherein at least one classification result corresponds to at least one business tag one by one;
[0007] Extracting data from the data table according to each classification result of at least one classification result to obtain at least one first data;
[0008] Acquire at least one data template according to the service tag corresponding to each first data in the at least one first data, wherein the at least one data template corresponds to the at least one first data in a one-to-one manner;
[0009] Extract keywords from each first data according to the data template corresponding to each first data, and fill the extracted keywords into the data template corresponding to each first data to obtain at least one second data, wherein the at least one second data has a one-to-one correspondence with the at least one first data;
[0010] Masking a keyword of each second data in the at least one second data to obtain at least one third data, wherein the at least one third data corresponds to the at least one second data in a one-to-one manner;
[0011] Performing data completion processing on each third data in the at least one third data to obtain at least one target data;
[0012] At least one target data is input into the business process model for testing to obtain a test result.
[0013] In a second aspect, an embodiment of the present application provides a testing device, comprising:
[0014] A classification module, used to classify each factor in the data table according to at least one preset business tag to obtain at least one classification result, wherein at least one classification result corresponds to at least one business tag in a one-to-one manner;
[0015] An extraction module, configured to extract data from the data table according to each classification result of at least one classification result to obtain at least one first data;
[0016] a processing module, configured to obtain at least one data template according to a service tag corresponding to each first data in at least one first data, wherein the at least one data template corresponds to the at least one first data one-to-one, extract keywords from each first data according to the data template corresponding to each first data, and fill the extracted keywords into the data template corresponding to each first data, to obtain at least one second data, wherein the at least one second data corresponds to the at least one first data one-to-one;
[0017] an expansion module, configured to mask a keyword of each second data in the at least one second data to obtain at least one third data, wherein the at least one third data corresponds to the at least one second data in a one-to-one manner, and perform data completion processing on each third data in the at least one third data to obtain at least one target data;
[0018] The test module is used to input at least one target data into the business processing model for testing to obtain a test result.
[0019] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a processor, the processor is connected to a memory, the memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory, so that the electronic device performs the method of the first aspect.
[0020] In a fourth aspect, 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 enables a computer to execute the method of the first aspect.
[0021] In a fifth aspect, an embodiment of the present application provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and is computer-operable to cause the computer to execute the method of the first aspect.
[0022] The implementation of the present application has the following beneficial effects:
[0023] In the implementation mode of the present application, each factor in the data table is classified according to at least one preset business tag to obtain at least one classification result, and then data is extracted from the data table according to each classification result in the at least one classification result to obtain at least one first data. Then, according to the business tag corresponding to each first data in the at least one first data, at least one data template is obtained, and then keywords are extracted for each first data according to the data template corresponding to each first data, and the extracted keywords are filled into the data template corresponding to each first data to obtain at least one second data. Finally, the keywords of each second data in the at least one second data are masked to obtain at least one third data, and then data completion processing is performed on each third data in the at least one third data to obtain at least one target data, so that at least one target data is input into the business processing model for testing to obtain a test result. Thus, high-precision extended data can be automatically generated based on actual data, and the adjusted business processing logic can be tested, which gets rid of the dependence on manual labor in the traditional way, while reducing labor costs, improving test efficiency and test accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] In order to more clearly illustrate the technical solutions in the implementation modes of the present application, the drawings required for use in the description of the implementation modes will be briefly introduced below. Obviously, the drawings described below are some implementation modes of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0025] Figure 1 A schematic diagram of the hardware structure of a test device provided in an embodiment of the present application;
[0026] Figure 2 A flow chart of a testing method provided for an embodiment of the present application;
[0027] Figure 3 A flowchart of a method for performing data completion processing on each of at least one third data to obtain at least one target data provided by an embodiment of the present application;
[0028] Figure 4 A functional module composition block diagram of a test device provided in an embodiment of the present application;
[0029] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0030] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0031] The terms "first", "second", "third" and "fourth" etc. in the specification and claims of the present application and the drawings are used to distinguish different objects, rather than to describe a specific order. 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 limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices.
[0032] Reference to "embodiment" herein means that a particular feature, result, or characteristic described in conjunction with the embodiment may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0033] First, see Figure 1 , Figure 1 The hardware structure diagram of a test device provided in the embodiment of the present application is as follows: The test device 100 includes at least one processor 101 , a communication line 102 , a memory 103 and at least one communication interface 104 .
[0034] In this embodiment, the processor 101 can be a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits for controlling the execution of the program of the present application.
[0035] The communication link 102 may include a path to transmit information between the above components.
[0036] The communication interface 104 may be any transceiver-like device (eg, antenna, etc.) for communicating with other devices or communication networks, such as Ethernet, RAN, wireless local area networks (WLAN), etc.
[0037] The memory 103 may be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited to these.
[0038] In this embodiment, the memory 103 can exist independently and be connected to the processor 101 via the communication line 102. The memory 103 can also be integrated with the processor 101. The memory 103 provided in the embodiment of the present application can generally be non-volatile. Among them, the memory 103 is used to store computer-executable instructions for executing the scheme of the present application, and the execution is controlled by the processor 101. The processor 101 is used to execute the computer-executable instructions stored in the memory 103, so as to implement the method provided in the following embodiment of the present application.
[0039] In an optional implementation, the computer-executable instructions may also be referred to as application code, which is not specifically limited in this application.
[0040] In an optional embodiment, the processor 101 may include one or more CPUs, such as Figure 1 CPU0 and CPU1 in.
[0041] In an optional embodiment, the testing device 100 may include multiple processors, such as Figure 11 and 107. Each of these processors may be a single-CPU processor or a multi-CPU processor. A processor herein may refer to one or more devices, circuits, and / or processing cores for processing data (e.g., computer program instructions).
[0042] In an optional embodiment, if the test device 100 is a server, for example, it can be an independent server, or it can be 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, content delivery networks (Content Delivery Network, CDN), and big data and artificial intelligence platforms. Then the test device 100 can also include an output device 105 and an input device 106. The output device 105 communicates with the processor 101 and can display information in a variety of ways. For example, the output device 105 can be a liquid crystal display (liquid crystal display, LCD), a light emitting diode (light emitting diode, LED) display device, a cathode ray tube (cathode ray tube, CRT) display device, or a projector (projector). The input device 106 communicates with the processor 101 and can receive user input in a variety of ways. For example, the input device 106 can be a mouse, a keyboard, a touch screen device or a sensor device.
[0043] The above-mentioned test device 100 can be a general device or a special device. The embodiment of the present application does not limit the type of the test device 100.
[0044] Secondly, it should be noted that the embodiments disclosed in this application can acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0045] AI basic technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0046] The test method disclosed in this application is described below:
[0047] See also Figure 2 , Figure 2 A flow chart of a test method provided in the embodiment of the present application. The test method comprises the following steps:
[0048] 201: Classify each factor in the data table according to at least one preset business tag, and obtain at least one classification result corresponding to the at least one business tag.
[0049] In this embodiment, at least one preset business tag is obtained according to the business logic in a specific business scenario. For example, in a loan business scenario, the business tag may be a sub-scenario under the loan business scenario: risk control, underwriting, etc. Based on this, feature extraction may be performed on each factor, and the correlation between the extracted feature and the business tag may be calculated, and then the factor whose correlation satisfies a preset condition, for example, a factor whose correlation is greater than a preset threshold value, may be attributed to the business tag.
[0050] Exemplarily, when the factors included in the data table are: [factor 1, factor 2, factor 3, factor 4, factor 5, factor 6], after the correlation calculation, the factors belonging to the risk control business tag include: [factor 1, factor 3, factor 5]; the factors belonging to the underwriting business tag include: [factor 2, factor 4, factor 6]. In an optional implementation, the business tag can also be encoded, for example, the risk control business tag is encoded as 1, and the underwriting business tag is encoded as 2, so that the code of the business tag can be directly assigned to the factors included therein as the label value, which not only facilitates indicating the belonging of each factor, but also compresses the amount of data to reduce the pressure of local storage.
[0051] 202: Extract data from the data table according to each classification result of at least one classification result to obtain at least one first data.
[0052] In this embodiment, since the amount of actual data is large and the proportion of repetition is also high, before extracting data from the data table, data sampling can also be performed on the data table to reduce the amount of data in subsequent analysis and improve test efficiency. Exemplarily, the sampling conditions can be determined according to the application field corresponding to the data table. Specifically, first, the fixed parameters and random parameters in the application field are determined according to the application field corresponding to the data table, and then the weights of the fixed parameters and random parameters are determined according to the number of fixed parameters. Then, the average number of tests in the application field is determined based on historical test data. Finally, the number of data corresponding to the fixed parameters and random parameters is determined based on the weights to generate sampling conditions.
[0053] Specifically, the data table can be screened according to the number of generated data, percentage mode or fixed + random parameter mode to obtain a candidate data table. For example, in a loan business scenario, there are 10 types of qualifications in the data table, and the first limiting mode in the data table is any 3 types of qualifications. In this limiting mode, there are 120 ways of data combination in the data table, and then 20 of them, or 20% or 24 ways, are sampled to obtain a candidate data table.
[0054] Therefore, in this embodiment, data extraction can be performed on the candidate data table to obtain at least one first data. Specifically, according to each classification result, data whose values corresponding to the factors in each row of data in the candidate data table are not empty can be screened to obtain at least one first data. Exemplarily, Table 1 shows a candidate data table:
[0055] Table 1:
[0056]
[0057]
[0058] Based on this, according to the classification result in step 201, that is, the factors belonging to the risk control business mark include: [factor 1, factor 3, factor 5]; the factors belonging to the underwriting business mark include: [factor 2, factor 4, factor 6], the screening process of Table 1 is as follows:
[0059] In this embodiment, according to the factor grouping [factor 1, factor 3, factor 5] marked by the risk control business, the data corresponding to factor 1, factor 3 and factor 5 in each row of data in Table 1 are screened. For example, when the first row of data in Table 1 is screened, since the value of factor 1 in the first row is empty, the value of factor 3 is A, and the value of factor 5 is also empty, the first data can be obtained: [ ], [factor 3##A] and [ ]; when the second row of data in Table 1 is screened, since the value of factor 1 in the second row is empty, the value of factor 3 is A, and the value of factor 5 is 1, the first data can be obtained: [ ], [factor 3##A] and [factor 5##1].
[0060] Among them, "##" is a separator, which is used to separate the factor name, i.e., "factor 3", from the factor value, i.e., "A". In this embodiment, other symbols may also be selected as separators, such as: "%%", "&&", "@@", etc., which are not limited in this embodiment.
[0061] 203: Acquire at least one data template corresponding to the at least one first data in one-to-one correspondence with the at least one first data according to the service tag corresponding to each first data in the at least one first data.
[0062] In the implementation mode of the present application, the data template can be obtained by performing keyword extraction and relationship extraction on the historical data under the corresponding business tag. Specifically, the keywords can be paired according to the relationship between the keywords, and the features of the successfully paired keyword groups can be extracted to obtain the part-of-speech information and semantic information of the corresponding keywords in each keyword group, and then the common name corresponding to the keyword is determined according to the semantic information. Thus, a data template is established based on the common name, for example: [Key: noun; value: number], where "Key" and "value" are the common names of the examples, and "noun" and "number" are the corresponding parts of speech.
[0063] After obtaining the data template corresponding to each business tag, the two can be associated and stored so that they can be directly searched and called according to the business tag during subsequent processing.
[0064] 204: Extract keywords from each first data according to the data template corresponding to each first data, and fill the extracted keywords into the data template corresponding to each first data to obtain at least one second data corresponding to the at least one first data.
[0065] In an embodiment of the present application, the third part-of-speech information of the missing position can be determined based on the part-of-speech tag of the missing position in the data template. At the same time, each first data is segmented according to the separator in each first data to obtain at least one second candidate word, and the fourth part-of-speech information of each second candidate word in at least one second candidate word is determined. Then, the second candidate words whose fourth part-of-speech information is the same as the third part-of-speech information are screened out to obtain at least one third candidate word. Then, the word frequency, inverse document frequency and word length of each third candidate word in at least one third candidate word are obtained, and then the score of each third candidate word is determined based on the word frequency, inverse document frequency and word length of each third candidate word. Finally, the third candidate word with the highest score is used as the keyword of each first data.
[0066] Exemplarily, the word frequency of each third candidate word, the inverse document frequency of each third candidate word, the word length of each third candidate word, and the score of each third candidate word can be expressed by formula ①:
[0067]
[0068] Where N represents the score of each third candidate word, IDF represents the inverse document frequency of each third candidate word, TF represents the word frequency of each third candidate word, and l 1 Indicates the length of each third candidate word, l 2 represents the length of the first data corresponding to each third candidate word, d represents the weight, and e, f, and g are custom parameters.
[0069] Specifically, using the above example, for the data template [Key: noun; value: number], it can be concluded that the parts of speech at the missing position are noun and number. Therefore, after the first data [factor 5##1] is segmented, noun: factor 5 and number: 1 can be obtained. Then, the segmentation results are filled into the data template according to the parts of speech to obtain the second data [Key: factor 5; value: 1].
[0070] 205: Mask a keyword of each second data in the at least one second data to obtain at least one third data corresponding to the at least one second data in a one-to-one manner.
[0071] In the implementation manner of the present application, the keywords in each second data can be understood as any one or more of the words filled in the data template in step 204. Exemplarily, after masking the second data [Key: factor 5; value: 1], the third data [Key: ***; value: 1] or [Key: factor 5; value: ***] or [Key: ***; value: ***] can be obtained.
[0072] 206: Perform data completion processing on each third data in the at least one third data to obtain at least one target data.
[0073] In this embodiment, a method for performing data completion processing on each third data in at least one third data to obtain at least one target data is provided, such as Figure 3 As shown, the method includes:
[0074] 301: Get the key value of the mask in each third data.
[0075] In this embodiment, the key value of the mask is the name of the mask in the third data. Exemplarily, for the third data [Key: ***; Value: 1], the key value corresponding to the mask "***" is "Key". At the same time, according to step 203, "Key" and "Value" are generic names for examples, which can be replaced by specific names in specific scenarios. For example, in the field of sales, "Key" can be transformed into a specific name, such as: "sale_channel", which is the sales type, and "Value" can also be transformed into a specific name, such as: "license_reg_date", which is the license registration time. Therefore, the actual third data can be: ["sale_channel": ***, "license_reg_date": 2015-03-20]. Then, the key value of its mask is the "sale_channel" which has practical meaning.
[0076] 302: Extract features from the key value to obtain a first feature vector.
[0077] In this embodiment, feature extraction can be performed by word embedding.
[0078] 303: Determine the application field corresponding to the mask in each third data according to the first feature vector, and obtain a vocabulary corresponding to the application field.
[0079] In this embodiment, the correlation between the first feature vector and the vectors of each application field name may be calculated to determine the application field corresponding to the mask. Exemplarily, the Euclidean distance or Mahalanobis distance between two feature vectors may be calculated as the correlation between the two.
[0080] 304: Perform word embedding processing on the keyword corresponding to the mask in each third data to obtain a second feature vector.
[0081] In this embodiment, the keyword corresponding to the mask is the masked word. For example, for the third data [Key: ***; Value: 1], the masked word is "factor 5", then "factor 5" is the keyword corresponding to the mask.
[0082] 305: Matching is performed in a vocabulary corresponding to the application field according to the second feature vector to obtain at least one candidate word.
[0083] In this embodiment, by calculating the similarity between the second feature vector and the feature vector of the words in the vocabulary, the words that meet the similarity condition can be used as candidate words. Exemplarily, the length of the first common sequence between the second feature vector and the feature vector of each word in the vocabulary corresponding to the application field can be obtained, wherein the first common sequence can be understood as the common sequence with the longest length that exists in the feature vector of the second feature vector and each word in the vocabulary corresponding to the application field. Then, the similarity between the second feature vector and the feature vector of each word in the vocabulary corresponding to the application field is determined according to the length of the first common sequence.
[0084] Specifically, the similarity can be expressed by formula ②:
[0085]
[0086] Wherein, a represents the length of the first common sequence, b represents the length of the second feature vector, and c represents the length of the feature vector of each word in the vocabulary corresponding to the application field.
[0087] Finally, the words in the vocabulary whose similarity is greater than the first threshold are taken as at least one candidate word.
[0088] In addition, in this implementation, the length of the first common sequence can be obtained in the following manner:
[0089] First, the number of first elements of the second feature vector is obtained, and the number of second elements of the feature vector of each word in the vocabulary corresponding to the application field is obtained.
[0090] If the number of first elements and / or the number of second elements is 0, the length of the first common sequence is set to 0.
[0091] If the number of first elements and the number of second elements are both greater than 0, the last element of the second feature vector is obtained as the first element, and the last element of the feature vector of each word in the vocabulary corresponding to the application field is obtained as the second element.
[0092] If the first element and the second element are the same, the length of the first common sequence is set to be the length of the first common sequence of the second feature vector excluding the first element and the feature vector of each word excluding the second element plus one.
[0093] If the first element and the second element are different, the length of the first common sequence of the second feature vector excluding the first element and the feature vector of each word is taken as the first length, the length of the first common sequence of the second feature vector and the feature vector of each word excluding the second element is taken as the second length, and the maximum value of the first length and the second length is taken as the length of the first common sequence.
[0094] 306: Replace the mask in each third data with each candidate word in at least one candidate word, and obtain at least one candidate target data corresponding to each third data.
[0095] In this embodiment, at least one candidate target data corresponds to at least one candidate word one-to-one. Exemplarily, part-of-speech analysis can be performed on the position corresponding to the mask in each third data according to each third data to obtain at least one first part-of-speech information of the position corresponding to the mask. Part-of-speech recognition is then performed on each candidate word to obtain at least one second part-of-speech information corresponding to at least one candidate word. Then, at least one first candidate word is determined in at least one candidate word according to the at least one first part-of-speech information, wherein the second part-of-speech information of each first candidate word in the at least one first candidate word belongs to the at least one first part-of-speech information. Finally, each first candidate word in the at least one first candidate word is replaced with the mask in each third data respectively to obtain at least one candidate target data corresponding to each third data.
[0096] Therefore, the part of speech of the first candidate word is consistent with the part of speech of the keyword corresponding to the mask, and they belong to words with similar meanings in the same application field. Therefore, the expanded data not only has high accuracy, but also conforms to the business logic in the corresponding application field, which further improves the subsequent prediction accuracy.
[0097] 307: Combine at least one candidate target data corresponding to each third data to obtain at least one target data.
[0098] 207: Input at least one target data into the business process model for testing to obtain a test result.
[0099] In the implementation mode of the present application, the business processing model is established according to the business processing logic of the business to be tested. Specifically, by combing the business processing logic, the business processing logic is divided into multiple sub-processing logics. Then, each sub-processing logic is matched in the script library to obtain the corresponding running script. Finally, according to the position order of each sub-processing logic in the business processing logic, the running scripts corresponding to each sub-processing logic are spliced to obtain the business processing model.
[0100] Therefore, after the target data is passed into the business processing model, the business processing logic of the business to be tested can be triggered to generate test results related to the input data. Based on this, if the test result value is consistent with the expected value, it means that the business processing logic can perfectly complete the expected task and the test result is successful.
[0101] In summary, in the test method provided by the present invention, each factor in the data table is classified according to at least one preset business tag to obtain at least one classification result, and then data is extracted from the data table according to each classification result in the at least one classification result to obtain at least one first data. Then, according to the business tag corresponding to each first data in the at least one first data, at least one data template is obtained, and then keywords are extracted for each first data according to the data template corresponding to each first data, and the extracted keywords are filled into the data template corresponding to each first data to obtain at least one second data. Finally, the keywords of each second data in the at least one second data are masked to obtain at least one third data, and then data completion processing is performed on each third data in the at least one third data to obtain at least one target data, so that at least one target data is input into the business processing model for testing to obtain a test result. Thus, high-precision extended data can be automatically generated based on actual data, and the adjusted business processing logic can be tested, which gets rid of the dependence on manual labor in the traditional method, while reducing labor costs, improving test efficiency and test accuracy.
[0102] See also Figure 4 , Figure 4 This is a functional module block diagram of a test device provided in an embodiment of the present application. Figure 4 As shown, the testing device 400 includes:
[0103] A classification module 401, configured to classify each factor in the data table according to at least one preset business tag to obtain at least one classification result, wherein at least one classification result corresponds to at least one business tag in a one-to-one manner;
[0104] An extraction module 402, configured to extract data from the data table according to each classification result of at least one classification result to obtain at least one first data;
[0105] The processing module 403 is used to obtain at least one data template according to the business tag corresponding to each first data in the at least one first data, wherein the at least one data template corresponds to the at least one first data one-to-one, extract keywords from each first data according to the data template corresponding to each first data, and fill the extracted keywords into the data template corresponding to each first data to obtain at least one second data, wherein the at least one second data corresponds to the at least one first data one-to-one;
[0106] The expansion module 404 is configured to mask a keyword of each second data in the at least one second data to obtain at least one third data, wherein the at least one third data corresponds to the at least one second data in a one-to-one manner, and perform data completion processing on each third data in the at least one third data to obtain at least one target data;
[0107] The testing module 405 is used to input at least one target data into the business processing model for testing to obtain a test result.
[0108] In an embodiment of the present invention, in terms of performing data completion processing on each third data in at least one third data to obtain at least one target data, the expansion module 404 is specifically configured to:
[0109] Get the key value of the mask in each third data;
[0110] Extract features from the key value to obtain the first feature vector;
[0111] Determine the application field corresponding to the mask in each third data according to the first feature vector, and obtain the vocabulary corresponding to the application field;
[0112] Performing word embedding processing on the keywords corresponding to the masks in each third data to obtain a second feature vector;
[0113] Matching the second feature vector in a vocabulary corresponding to the application field to obtain at least one candidate word;
[0114] Replacing the mask in each third data with each candidate word in the at least one candidate word, respectively, to obtain at least one candidate target data corresponding to each third data, wherein the at least one candidate target data corresponds to the at least one candidate word one-to-one;
[0115] At least one candidate target data corresponding to each third data is combined to obtain at least one target data.
[0116] In the embodiment of the present invention, in terms of matching the second feature vector in the vocabulary corresponding to the application field to obtain at least one candidate word, the expansion module 404 is specifically used to:
[0117] Obtaining the length of a first common sequence between the second feature vector and the feature vector of each word in the vocabulary corresponding to the application field, wherein the first common sequence is a common sequence that exists in both the second feature vector and the feature vector of each word in the vocabulary corresponding to the application field and has the longest length;
[0118] The similarity between the second feature vector and the feature vector of each word in the vocabulary corresponding to the application field is determined by formula ③:
[0119]
[0120] Wherein, a represents the length of the first common sequence, b represents the length of the second feature vector, and c represents the length of the feature vector of each word in the vocabulary corresponding to the application field;
[0121] At least one candidate word is determined in a vocabulary corresponding to the application field according to the similarity, wherein the similarity corresponding to each candidate word in the at least one candidate word is greater than a first threshold.
[0122] In the embodiment of the present invention, in terms of obtaining the length of the first common sequence between the second feature vector and the feature vector of each word in the vocabulary corresponding to the application field, the expansion module 404 is specifically used to:
[0123] Obtain the number of first elements of the second feature vector, and obtain the number of second elements of the feature vector of each word in the vocabulary corresponding to the application field;
[0124] If the number of first elements and / or the number of second elements is 0, the length of the first common sequence is set to 0;
[0125] If the number of first elements and the number of second elements are both greater than 0, the last element of the second feature vector is obtained as the first element, and the last element of the feature vector of each word in the vocabulary corresponding to the application field is obtained as the second element;
[0126] If the first element and the second element are the same, the length of the first common sequence is set to be the length of the first common sequence of the second feature vector excluding the first element and the feature vector of each word excluding the second element plus one;
[0127] If the first element and the second element are different, the length of the first common sequence of the second feature vector excluding the first element and the feature vector of each word is taken as the first length, the length of the first common sequence of the second feature vector and the feature vector of each word excluding the second element is taken as the second length, and the maximum value of the first length and the second length is taken as the length of the first common sequence.
[0128] In an embodiment of the present invention, in terms of replacing the mask in each third data with each candidate word in at least one candidate word to obtain at least one candidate target data corresponding to each third data, the expansion module 404 is specifically used to:
[0129] Performing part-of-speech analysis on the position corresponding to the mask in each third data according to each third data to obtain at least one first part-of-speech information of the position corresponding to the mask;
[0130] Performing part-of-speech recognition on each candidate word to obtain at least one second part-of-speech information, wherein the at least one second part-of-speech information corresponds one-to-one to the at least one candidate word;
[0131] Determine at least one first candidate word in at least one candidate word according to at least one first part-of-speech information, wherein the second part-of-speech information of each first candidate word in the at least one first candidate word belongs to the at least one first part-of-speech information;
[0132] Each first candidate word in at least one first candidate word replaces the mask in each third data to obtain at least one candidate target data corresponding to each third data.
[0133] In the embodiment of the present invention, in terms of extracting keywords from each first data according to the data template corresponding to each first data, the processing module 403 is specifically used to:
[0134] Determine the third part-of-speech information of the missing position according to the part-of-speech tag of the missing position in the data template;
[0135] Perform word segmentation processing on each first data to obtain at least one second candidate word;
[0136] Determining fourth part-of-speech information of each second candidate word in at least one second candidate word;
[0137] Screen out the second candidate words whose fourth part-of-speech information is the same as the third part-of-speech information to obtain at least one third candidate word;
[0138] Obtaining a word frequency, an inverse document frequency, and a word length of each third candidate word in at least one third candidate word;
[0139] Determine a score for each third candidate word according to the word frequency, inverse document frequency, and word length of each third candidate word;
[0140] The third candidate word with the highest score is used as the keyword of each first data.
[0141] In an embodiment of the present invention, the word frequency of each third candidate word, the inverse document frequency of each third candidate word, the word length of each third candidate word, and the score of each third candidate word can be expressed by formula ④:
[0142]
[0143] Where N represents the score of each third candidate word, IDF represents the inverse document frequency of each third candidate word, TF represents the word frequency of each third candidate word, and l 1 Indicates the length of each third candidate word, l 2 represents the length of the first data corresponding to each third candidate word, d represents the weight, and e, f, and g are custom parameters.
[0144] See also Figure 5 , Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 5 As shown, the electronic device 500 includes a transceiver 501, a processor 502 and a memory 503. They are connected via a bus 504. The memory 503 is used to store computer programs and data, and can transmit the data stored in the memory 503 to the processor 502.
[0145] The processor 502 is used to read the computer program in the memory 503 and perform the following operations:
[0146] Classify each factor in the data table according to at least one preset business tag to obtain at least one classification result, wherein at least one classification result corresponds to at least one business tag one by one;
[0147] Extracting data from the data table according to each classification result of at least one classification result to obtain at least one first data;
[0148] Acquire at least one data template according to the service tag corresponding to each first data in the at least one first data, wherein the at least one data template corresponds to the at least one first data in a one-to-one manner;
[0149] Extract keywords from each first data according to the data template corresponding to each first data, and fill the extracted keywords into the data template corresponding to each first data to obtain at least one second data, wherein the at least one second data has a one-to-one correspondence with the at least one first data;
[0150] Masking a keyword of each second data in the at least one second data to obtain at least one third data, wherein the at least one third data corresponds to the at least one second data in a one-to-one manner;
[0151] Performing data completion processing on each third data in the at least one third data to obtain at least one target data;
[0152] At least one target data is input into the business process model for testing to obtain a test result.
[0153] In an embodiment of the present invention, in performing data completion processing on each third data in at least one third data to obtain at least one target data, the processor 502 is specifically configured to perform the following operations:
[0154] Get the key value of the mask in each third data;
[0155] Extract features from the key value to obtain the first feature vector;
[0156] Determine the application field corresponding to the mask in each third data according to the first feature vector, and obtain the vocabulary corresponding to the application field;
[0157] Performing word embedding processing on the keywords corresponding to the masks in each third data to obtain a second feature vector;
[0158] Matching the second feature vector in a vocabulary corresponding to the application field to obtain at least one candidate word;
[0159] Replacing the mask in each third data with each candidate word in the at least one candidate word, respectively, to obtain at least one candidate target data corresponding to each third data, wherein the at least one candidate target data corresponds to the at least one candidate word one-to-one;
[0160] At least one candidate target data corresponding to each third data is combined to obtain at least one target data.
[0161] In an embodiment of the present invention, in terms of matching the second feature vector in the vocabulary corresponding to the application field to obtain at least one candidate word, the processor 502 is specifically configured to perform the following operations:
[0162] Obtaining the length of a first common sequence between the second feature vector and the feature vector of each word in the vocabulary corresponding to the application field, wherein the first common sequence is a common sequence that exists in both the second feature vector and the feature vector of each word in the vocabulary corresponding to the application field and has the longest length;
[0163] The similarity between the second feature vector and the feature vector of each word in the vocabulary corresponding to the application field is determined by formula ⑤:
[0164]
[0165] Wherein, a represents the length of the first common sequence, b represents the length of the second feature vector, and c represents the length of the feature vector of each word in the vocabulary corresponding to the application field;
[0166] At least one candidate word is determined in a vocabulary corresponding to the application field according to the similarity, wherein the similarity corresponding to each candidate word in the at least one candidate word is greater than a first threshold.
[0167] In the embodiment of the present invention, in terms of obtaining the length of the first common sequence between the second feature vector and the feature vector of each word in the vocabulary corresponding to the application field, the processor 502 is specifically configured to perform the following operations:
[0168] Obtain the number of first elements of the second feature vector, and obtain the number of second elements of the feature vector of each word in the vocabulary corresponding to the application field;
[0169] If the number of first elements and / or the number of second elements is 0, the length of the first common sequence is set to 0;
[0170] If the number of first elements and the number of second elements are both greater than 0, the last element of the second feature vector is obtained as the first element, and the last element of the feature vector of each word in the vocabulary corresponding to the application field is obtained as the second element;
[0171] If the first element and the second element are the same, the length of the first common sequence is set to be the length of the first common sequence of the second feature vector excluding the first element and the feature vector of each word excluding the second element plus one;
[0172] If the first element and the second element are different, the length of the first common sequence of the second feature vector excluding the first element and the feature vector of each word is taken as the first length, the length of the first common sequence of the second feature vector and the feature vector of each word excluding the second element is taken as the second length, and the maximum value of the first length and the second length is taken as the length of the first common sequence.
[0173] In an embodiment of the present invention, in terms of replacing the mask in each third data with each candidate word in at least one candidate word to obtain at least one candidate target data corresponding to each third data, the processor 502 is specifically configured to perform the following operations:
[0174] Performing part-of-speech analysis on the position corresponding to the mask in each third data according to each third data to obtain at least one first part-of-speech information of the position corresponding to the mask;
[0175] Performing part-of-speech recognition on each candidate word to obtain at least one second part-of-speech information, wherein the at least one second part-of-speech information corresponds one-to-one to the at least one candidate word;
[0176] Determine at least one first candidate word in at least one candidate word according to at least one first part-of-speech information, wherein the second part-of-speech information of each first candidate word in the at least one first candidate word belongs to the at least one first part-of-speech information;
[0177] Each first candidate word in at least one first candidate word replaces the mask in each third data to obtain at least one candidate target data corresponding to each third data.
[0178] In an embodiment of the present invention, in terms of extracting keywords from each first data according to a data template corresponding to each first data, the processor 502 is specifically configured to perform the following operations:
[0179] Determine the third part-of-speech information of the missing position according to the part-of-speech tag of the missing position in the data template;
[0180] Perform word segmentation processing on each first data to obtain at least one second candidate word;
[0181] Determining fourth part-of-speech information of each second candidate word in at least one second candidate word;
[0182] Screen out the second candidate words whose fourth part-of-speech information is the same as the third part-of-speech information to obtain at least one third candidate word;
[0183] Obtaining a word frequency, an inverse document frequency, and a word length of each third candidate word in at least one third candidate word;
[0184] Determine a score for each third candidate word according to the word frequency, inverse document frequency, and word length of each third candidate word;
[0185] The third candidate word with the highest score is used as the keyword of each first data.
[0186] In an embodiment of the present invention, the word frequency of each third candidate word, the inverse document frequency of each third candidate word, the word length of each third candidate word, and the score of each third candidate word can be expressed by formula ⑥:
[0187]
[0188] Where N represents the score of each third candidate word, IDF represents the inverse document frequency of each third candidate word, TF represents the word frequency of each third candidate word, and l 1 Indicates the length of each third candidate word, l 2 represents the length of the first data corresponding to each third candidate word, d represents the weight, and e, f, and g are custom parameters.
[0189] It should be understood that the test device in this application may include a smart phone (such as an Android phone, an iOS phone, a Windows Phone phone, etc.), a tablet computer, a PDA, a laptop computer, a mobile Internet device MID (Mobile Internet Devices, referred to as: MID), a robot or a wearable device, etc. The above test devices are only examples, not exhaustive, and include but are not limited to the above test devices. In practical applications, the above test devices may also include: smart vehicle terminals, computer equipment, etc.
[0190] Through the description of the above implementation modes, those skilled in the art can clearly understand that the present invention can be implemented by combining software with a hardware platform. Based on such an understanding, all or part of the contribution of the technical solution of the present invention to the background technology can be embodied in the form of a software product, which can be stored in a storage medium such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in various implementation modes of the present invention or some parts of the implementation modes.
[0191] Therefore, the present application also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program is executed by a processor to implement some or all of the steps of any test method described in the above method implementation. For example, the storage medium may include a hard disk, a floppy disk, an optical disk, a tape, a disk, a USB flash drive, a flash memory, etc.
[0192] The present application also provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to execute part or all of the steps of any one of the test methods described in the above method implementation.
[0193] It should be noted that, for the sake of simplicity, the aforementioned method implementations are all described as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the implementations described in the specification are all optional implementations, and the actions and modules involved are not necessarily required by the present application.
[0194] In the above-mentioned embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0195] In the several embodiments provided in this application, it should be understood that the disclosed device can be implemented in other ways. For example, the device implementation described above is only schematic, such as the division of the units, which is only a logical function division. There may be other division methods in actual implementation, 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, and the indirect coupling or communication connection of the device or unit can be electrical or other forms.
[0196] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0197] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above integrated unit may be implemented in the form of hardware or in the form of a software program module.
[0198] If the integrated unit is implemented in the form of a software program module and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application, in essence, 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 memory and includes several instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned memory includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk and other media that can store program codes.
[0199] A person skilled in the art may understand that all or part of the steps in the various methods of the above-mentioned embodiments may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable memory, and the memory may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0200] The above is a detailed introduction to the implementation methods of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above implementation methods is only used to help understand the method and core idea of the present application. At the same time, for general technical personnel in this field, according to the idea of the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A testing method, It is characterized in that The method comprises: Classify each factor in the data table according to at least one preset business tag to obtain at least one classification result, wherein the at least one classification result corresponds to the at least one business tag one by one; Extracting data from the data table according to each of the at least one classification result to obtain at least one first data; Acquire at least one data template according to the service tag corresponding to each first data in the at least one first data, wherein the at least one data template corresponds to the at least one first data in a one-to-one manner; Extract keywords from each first data according to the data template corresponding to each first data, and fill the extracted keywords into the data template corresponding to each first data to obtain at least one second data, wherein the at least one second data corresponds to the at least one first data one by one; extract keywords from each first data according to the data template corresponding to each first data, including: determining the third part-of-speech information of the missing position according to the part-of-speech tag of the missing position in the data template; performing word segmentation processing on each first data to obtain at least one second candidate word; determining the fourth part-of-speech information of each second candidate word in the at least one second candidate word; filtering out the second candidate words whose fourth part-of-speech information is the same as the third part-of-speech information to obtain at least one third candidate word; obtaining the word frequency, inverse document frequency and word length of each third candidate word in the at least one third candidate word; determining the score of each third candidate word according to the word frequency, inverse document frequency and word length of each third candidate word; using the third candidate word with the highest score as the keyword of each first data; Masking a keyword of each second data in the at least one second data to obtain at least one third data, wherein the at least one third data corresponds to the at least one second data in a one-to-one manner; Performing data completion processing on each of the at least one third data to obtain at least one target data; comprising: Obtain the key value of the mask in each of the third data; perform feature extraction on the key value to obtain a first feature vector; determine the application field corresponding to the mask in each of the third data according to the first feature vector, and obtain the vocabulary corresponding to the application field; perform word embedding processing on the keywords corresponding to the mask in each of the third data to obtain a second feature vector; perform matching in the vocabulary corresponding to the application field according to the second feature vector to obtain at least one candidate word; replace the mask in each of the third data with each candidate word in the at least one candidate word to obtain at least one candidate target data corresponding to each of the third data, wherein the at least one candidate target data corresponds to the at least one candidate word one-to-one; combine the at least one candidate target data corresponding to each of the third data to obtain the at least one target data; The at least one target data is input into the business process model for testing to obtain a test result.
2. The method according to claim 1, It is characterized in that The matching in the vocabulary corresponding to the application field according to the second feature vector to obtain at least one candidate word includes: Obtaining the length of a first common sequence between the second feature vector and the feature vector of each word in the vocabulary corresponding to the application field, wherein the first common sequence is a common sequence that exists in both the second feature vector and the feature vector of each word in the vocabulary corresponding to the application field and has the longest length; The similarity between the second feature vector and the feature vector of each word in the vocabulary corresponding to the application field is determined by the following formula: Wherein, a represents the length of the first common sequence, b represents the length of the second feature vector, and c represents the length of the feature vector of each word in the vocabulary corresponding to the application field; The at least one candidate word is determined in the vocabulary corresponding to the application field according to the similarity, wherein the similarity corresponding to each candidate word in the at least one candidate word is greater than a first threshold.
3. The method according to claim 2, It is characterized in that The obtaining of the length of a first common sequence between the second feature vector and the feature vector of each word in the vocabulary corresponding to the application field comprises: Obtain the number of first elements of the second feature vector, and obtain the number of second elements of the feature vector of each word in the vocabulary corresponding to the application field; If the number of the first elements and / or the number of the second elements is 0, setting the length of the first common sequence to 0; If the number of the first elements and the number of the second elements are both greater than 0, obtaining the last element of the second feature vector as the first element, and obtaining the last element of the feature vector of each word in the vocabulary corresponding to the application field as the second element; If the first element and the second element are the same, setting the length of the first common sequence to be the length of the first common sequence of the second feature vector excluding the first element and the feature vector of each word excluding the second element plus one; If the first element and the second element are different, the length of the first common sequence of the second feature vector excluding the first element and the feature vector of each word is taken as the first length, the length of the first common sequence of the second feature vector and the feature vector of each word excluding the second element is taken as the second length, and the maximum value of the first length and the second length is taken as the length of the first common sequence.
4. The method according to claim 1, It is characterized in that The step of replacing the mask in each of the third data with each of the candidate words in the at least one candidate word to obtain at least one candidate target data corresponding to each of the third data includes: performing part-of-speech analysis on the position corresponding to the mask in each of the third data according to each of the third data, to obtain at least one first part-of-speech information of the position corresponding to the mask; Performing part-of-speech recognition on each candidate word to obtain at least one second part-of-speech information, wherein the at least one second part-of-speech information corresponds one-to-one to the at least one candidate word; Determine at least one first candidate word in the at least one candidate word according to the at least one first part-of-speech information, wherein the second part-of-speech information of each first candidate word in the at least one first candidate word belongs to the at least one first part-of-speech information; Each first candidate word in the at least one first candidate word replaces the mask in each third data to obtain at least one candidate target data corresponding to each third data.
5. The method according to claim 4, It is characterized in that The word frequency of each third candidate word, the inverse document frequency of each third candidate word, the word length of each third candidate word, and the score of each third candidate word satisfy the following formula: Wherein, N represents the score of each third candidate word, IDF represents the inverse document frequency of each third candidate word, TF represents the word frequency of each third candidate word, and l 1 represents the word length of each third candidate word, l 2 represents the length of the first data corresponding to each third candidate word, d represents the weight, and e, f, and g are custom parameters.
6. A test device, It is characterized in that The device is used to implement the method according to any one of claims 1 to 5, and the device comprises: A classification module, used to classify each factor in the data table according to at least one preset business tag to obtain at least one classification result, wherein the at least one classification result corresponds to the at least one business tag one by one; an extraction module, configured to extract data from the data table according to each of the at least one classification result to obtain at least one first data; a processing module, configured to obtain at least one data template according to the service tag corresponding to each first data in the at least one first data, wherein the at least one data template corresponds to the at least one first data one-to-one, extract keywords from each first data according to the data template corresponding to each first data, and fill the extracted keywords into the data template corresponding to each first data to obtain at least one second data, wherein the at least one second data corresponds to the at least one first data one-to-one; an expansion module, configured to mask a keyword of each second data in the at least one second data to obtain at least one third data, wherein the at least one third data corresponds to the at least one second data in a one-to-one manner, and perform data completion processing on each third data in the at least one third data to obtain at least one target data; The test module is used to input the at least one target data into the business processing model for testing to obtain a test result.
7. An electronic device, It is characterized in that The method comprises a processor and a memory, wherein the memory stores a computer program, and the computer program is configured to be executed by the processor to perform the steps in any one of the methods of claims 1 to 5.
8. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, and the computer program is executed by a processor to implement the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Method and device for screening data before operation of intelligent test script and electronic device
CN110096428A
Model training method and device, electronic equipment and storage medium
CN112580339A
Word replacement method and device, electronic equipment and storage medium
CN113177402A
