CN117573543A - Test data generation method and device, electronic equipment and storage medium - Google Patents
Test data generation method and device, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN117573543A CN117573543A CN202311595541.9A CN202311595541A CN117573543A CN 117573543 A CN117573543 A CN 117573543A CN 202311595541 A CN202311595541 A CN 202311595541A CN 117573543 A CN117573543 A CN 117573543A
- Authority
- CN
- China
- Prior art keywords
- test data
- keyword
- subscript
- target
- list
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Prevention of errors by analysis, debugging or testing of software
- G06F11/3668—Testing of software
- G06F11/3672—Test management
- G06F11/3684—Test management for test design, e.g. generating new test cases
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Prevention of errors by analysis, debugging or testing of software
- G06F11/3668—Testing of software
- G06F11/3672—Test management
- G06F11/3688—Test management for test execution, e.g. scheduling of test suites
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Biomedical Technology (AREA)
- Evolutionary Computation (AREA)
- Artificial Intelligence (AREA)
- Health & Medical Sciences (AREA)
- Biophysics (AREA)
- Computational Linguistics (AREA)
- Data Mining & Analysis (AREA)
- Life Sciences & Earth Sciences (AREA)
- General Health & Medical Sciences (AREA)
- Molecular Biology (AREA)
- Computing Systems (AREA)
- Mathematical Physics (AREA)
- Software Systems (AREA)
- Debugging And Monitoring (AREA)
Abstract
Description
技术领域Technical field
本公开涉及数据处理技术领域,尤其涉及一种测试数据的生成方法及装置、电子设备和存储介质。The present disclosure relates to the field of data processing technology, and in particular, to a test data generation method and device, electronic equipment and storage media.
背景技术Background technique
在软件测试中,测试数据是测试的基础,对测试结果的准确性和全面性有着至关重要的影响。测试人员需要根据需求场景来进行测试数据的设计和生成,可以利用测试数据生成工具来快速生成大量的测试数据。In software testing, test data is the basis of testing and has a vital impact on the accuracy and comprehensiveness of test results. Testers need to design and generate test data based on demand scenarios, and can use test data generation tools to quickly generate large amounts of test data.
在测试过程中,往往会需要构造大量的测试数据,且这些测试数据需要满足各种不同的类型,各种不同的参数以及各种场景。相关的测试数据生成技术,通过测试参数来表征生成测试数据的条件,预设数据库中已经存储了一部分所需要的测试数据,根据设置的参数到数据库中取出对应条件下的测试数据。During the testing process, it is often necessary to construct a large amount of test data, and these test data need to meet various types, parameters, and scenarios. Relevant test data generation technology uses test parameters to characterize the conditions for generating test data. A part of the required test data has been stored in the preset database, and the test data under corresponding conditions is retrieved from the database according to the set parameters.
但是,根据设置的参数进行测试数据的构造生成的方法,不能支持多个参数多种类型的数据的随机分布,不能模拟生产环境的数据情况。However, the method of constructing and generating test data based on set parameters cannot support the random distribution of multiple parameters and multiple types of data, and cannot simulate the data situation of the production environment.
发明内容Contents of the invention
本公开提供了一种测试数据的生成方法、装置、电子设备和存储介质。其主要目的在于解决根据设置的参数进行测试数据的构造生成的方法,不能支持多个参数多种类型的数据的随机分布,不能模拟生产环境的数据情况的问题。The present disclosure provides a test data generation method, device, electronic device, and storage medium. Its main purpose is to solve the problem that the method of constructing and generating test data based on set parameters cannot support the random distribution of multiple parameters and multiple types of data, and cannot simulate the data situation of the production environment.
根据本公开的第一方面,提供了一种测试数据的生成方法,其中,包括:According to a first aspect of the present disclosure, a method for generating test data is provided, which includes:
响应于测试数据的生成指令,基于所述生成指令中的规则配置文件获取测试数据生成规则,所述测试数据生成规则包括测试数据的目标数量及参数权重列表,所述参数权重列表包括不同数据类别的关键词参数列表及对应的权重列表;In response to the test data generation instruction, test data generation rules are obtained based on the rule configuration file in the generation instruction. The test data generation rules include a target number of test data and a parameter weight list, and the parameter weight list includes different data categories. Keyword parameter list and corresponding weight list;
基于所述测试数据生成规则,分别根据不同数据类别的关键词参数列表及对应的权重列表生成对应的关键词组;Based on the test data generation rules, generate corresponding keyword groups according to keyword parameter lists and corresponding weight lists of different data categories;
将所述关键词组输入训练好的预设语言模型,得到所述关键词组对应的目标测试数据。Input the keyword group into the trained preset language model to obtain target test data corresponding to the keyword group.
可选地,在所述响应于测试数据的生成指令,基于所述生成指令中的规则配置文件获取测试数据生成规则之前,所述方法包括:Optionally, before responding to the test data generation instruction and obtaining the test data generation rules based on the rule configuration file in the generation instruction, the method includes:
响应于对所述规则配置文件的配置指令,获取所述配置指令所携带的规则配置文件;In response to the configuration instruction for the rule configuration file, obtain the rule configuration file carried by the configuration instruction;
基于所述规则配置文件,按照预设测试数据生成规则的配置模板编写测试数据生成规则;Based on the rule configuration file, write test data generation rules according to the configuration template of the preset test data generation rules;
对所述测试数据生成规则进行校验;Verify the test data generation rules;
在确定所述测试数据生成规则通过校验后,将所述测试数据生成规则写入预设数据库。After it is determined that the test data generation rule passes the verification, the test data generation rule is written into a preset database.
可选地,在所述基于所述测试数据生成规则,分别根据不同数据类别的关键词参数列表及对应的权重列表生成对应的关键词组之前,所述方法还包括:Optionally, before generating corresponding keyword groups according to keyword parameter lists and corresponding weight lists of different data categories based on the test data generation rules, the method further includes:
获取所述参数权重列表,其中,一个关键词参数对应一个权重值及一个第一下标,所述第一下标与所述关键词参数存在映射关系;所述第一下标为所述参数权重列表中存储所述关键词参数的存储地址对应的下标;Obtain the parameter weight list, where a keyword parameter corresponds to a weight value and a first subscript, and there is a mapping relationship between the first subscript and the keyword parameter; the first subscript is the parameter The subscript corresponding to the storage address where the keyword parameter is stored in the weight list;
对所述权重列表中的权重值进行初始化,得到对应的前缀和列表,所述前缀和列表为根据所述权重值加和的大小有序递增列表,用于表示权重值的边界,其中,所述第一下标与所述第二下标对应;所述前缀和列表中的每个边界值分别对应一个第三下标,所述第三下标与所述第二下标对应;Initialize the weight values in the weight list to obtain the corresponding prefix sum list. The prefix sum list is an ordered increasing list according to the sum of the weight values and is used to represent the boundary of the weight value, where, The first subscript corresponds to the second subscript; each boundary value in the prefix sum list corresponds to a third subscript, and the third subscript corresponds to the second subscript;
基于所述第二下标建立所述第一下标与所述第三下标之间的映射关系。A mapping relationship between the first subscript and the third subscript is established based on the second subscript.
可选地,所述基于所述测试数据生成规则,分别根据不同数据类别的关键词参数列表及对应的权重列表生成对应的关键词组包括:Optionally, based on the test data generation rules, generating corresponding keyword groups according to keyword parameter lists and corresponding weight lists of different data categories includes:
调用权重随机选择算法,根据所述权重值生成随机数字,其中,所述随机数字为1至所述前缀和列表中边界值的最大值范围内的任一个数字;Call the weight random selection algorithm to generate a random number according to the weight value, where the random number is any number within the range from 1 to the maximum value of the boundary value in the prefix sum list;
调用二分查找算法,分别查找所述随机数字对应于所述前缀和列表的目标边界值;Call the binary search algorithm to respectively search for the target boundary value of the random number corresponding to the prefix sum list;
分别获取所述目标边界值对应的第三下标;Obtain the third subscript corresponding to the target boundary value respectively;
根据所述第一下标与所述第三下标之间的映射关系,分别查找所述第三下标对应的第一下标;According to the mapping relationship between the first subscript and the third subscript, respectively search for the first subscript corresponding to the third subscript;
根据所述第一下标,从所述关键词参数列表中查找对应的关键词参数;According to the first subscript, search for the corresponding keyword parameter from the keyword parameter list;
根据所述查找到的关键词参数组合成所述关键词组。The keyword group is combined according to the found keyword parameters.
可选地,所述根据所述第一下标,从所述关键词参数列表中查找对应的关键词参数包括:Optionally, searching for the corresponding keyword parameter from the keyword parameter list according to the first subscript includes:
当检测到所述关键词参数的数量达到目标数量时,停止调用随机选择算法生成所述随机数字。When it is detected that the number of keyword parameters reaches the target number, stop calling the random selection algorithm to generate the random numbers.
可选地,所述预设语言模型的训练方法包括:Optionally, the training method of the preset language model includes:
从预设数据库获取不同数据类别的训练用文本数据;Obtain training text data of different data categories from a preset database;
根据预设过滤规则对所述训练用文本数据进行过滤,得到目标数据类别的训练用关键词组,所述预设过滤规则包括基于正则表达式规则去除预设数据类别的文本数据;Filter the text data for training according to preset filtering rules to obtain training keywords of the target data category, where the preset filtering rules include removing text data of the preset data category based on regular expression rules;
将所述目标数据类别的训练用关键词组输入预设语言模型进行训练,得到训练好的预设语言模型。Keyword phrases for training of the target data category are input into the preset language model for training, and a trained preset language model is obtained.
可选地,在将所述关键词组输入预设语言模型,得到所述关键词组对应的目标测试数据之后,所述方法包括:Optionally, after inputting the keyword group into the preset language model and obtaining target test data corresponding to the keyword group, the method includes:
读取所述测试数据生成规则中的定时发送信息,判断是否定时发送所述目标测试数据;Read the timing sending information in the test data generation rules and determine whether to send the target test data in a timely manner;
在确定定时发送所述目标测试数据的情况下,当满足定时发送条件时,根据所述关键词参数的数据类别将所述目标测试数据分别发送至对应数据类别的目标数据库;In the case where it is determined to send the target test data regularly, when the timing sending conditions are met, the target test data are respectively sent to the target database of the corresponding data category according to the data category of the keyword parameter;
若监测到所述目标测试数据的发送数量与所述目标数据库的接收数量一致,则完成所述目标测试数据的传输;If it is monitored that the number of sent target test data is consistent with the received number of the target database, then the transmission of the target test data is completed;
若监测到所述目标数据库接收到的目标测试数据的数量与目标数量不一致,则确定所述目标数据传输异常。If it is monitored that the number of target test data received by the target database is inconsistent with the target number, it is determined that the target data transmission is abnormal.
根据本公开的第二方面,提供了一种测试数据的生成装置,包括:According to a second aspect of the present disclosure, a device for generating test data is provided, including:
获取单元,用于响应于测试数据的生成指令,基于所述生成指令中的规则配置文件获取测试数据生成规则,所述测试数据生成规则包括测试数据的目标数量及参数权重列表,所述参数权重列表包括不同数据类别的关键词参数列表及对应的权重列表;An acquisition unit configured to respond to a test data generation instruction and acquire test data generation rules based on the rule configuration file in the generation instruction. The test data generation rules include a target quantity of test data and a parameter weight list. The parameter weights The list includes a list of keyword parameters of different data categories and a corresponding weight list;
生成单元,用于基于所述测试数据生成规则,分别根据不同数据类别的关键词参数列表及对应的权重列表生成对应的关键词组;A generation unit, configured to generate corresponding keyword groups based on the test data generation rules according to the keyword parameter lists of different data categories and the corresponding weight lists;
输入单元,用于将所述关键词组输入训练好的预设语言模型,得到所述关键词组对应的目标测试数据。An input unit is used to input the keyword group into a trained preset language model to obtain target test data corresponding to the keyword group.
可选地,所述装置还包括编写单元,所述编写单元包括:Optionally, the device further includes a writing unit, which includes:
第一获取模块,用于在所述响应于测试数据的生成指令,基于所述生成指令中的规则配置文件获取测试数据生成规则之前,响应于对所述规则配置文件的配置指令,获取所述配置指令所携带的规则配置文件;The first acquisition module is configured to obtain the test data generation rules based on the rule configuration file in the generation instruction in response to the generation instruction of the test data, and in response to the configuration instruction of the rule configuration file, obtain the The rule configuration file carried by the configuration instruction;
编写模块,用于基于所述规则配置文件,按照预设测试数据生成规则的配置模板编写测试数据生成规则;A writing module, configured to write test data generation rules according to the configuration template of the preset test data generation rules based on the rule configuration file;
校验模块,用于对所述测试数据生成规则进行校验;A verification module, used to verify the test data generation rules;
写入模块,用于在确定所述测试数据生成规则通过校验后,将所述测试数据生成规则写入预设数据库。A writing module, configured to write the test data generation rules into a preset database after determining that the test data generation rules pass the verification.
可选地,所述装置还包括建立单元,所述建立单元包括:Optionally, the device further includes an establishment unit, which includes:
第二获取模块,用于在所述基于所述测试数据生成规则,分别根据不同数据类别的关键词参数列表及对应的权重列表生成对应的关键词组之前,获取所述参数权重列表,其中,一个关键词参数对应一个权重值及一个第一下标,所述第一下标与所述关键词参数存在映射关系;所述第一下标为所述参数权重列表中存储所述关键词参数的存储地址对应的下标;The second acquisition module is used to obtain the parameter weight list before generating corresponding keyword groups based on the keyword parameter lists and corresponding weight lists of different data categories based on the test data generation rules, wherein a The keyword parameter corresponds to a weight value and a first subscript, and there is a mapping relationship between the first subscript and the keyword parameter; the first subscript is the value in the parameter weight list where the keyword parameter is stored. The subscript corresponding to the storage address;
初始化模块,用于对所述权重列表中的权重值进行初始化,得到对应的前缀和列表,所述前缀和列表为根据所述权重值加和的大小有序递增列表,用于表示权重值的边界,其中,所述第一下标与所述第二下标对应;所述前缀和列表中的每个边界值分别对应一个第三下标,所述第三下标与所述第二下标对应;An initialization module, used to initialize the weight values in the weight list to obtain the corresponding prefix sum list. The prefix sum list is an ordered increasing list according to the size of the sum of the weight values, and is used to represent the weight value. Boundary, wherein the first subscript corresponds to the second subscript; each boundary value in the prefix sum list corresponds to a third subscript, and the third subscript corresponds to the second subscript. mark correspondence;
建立模块,用于基于所述第二下标建立所述第一下标与所述第三下标之间的映射关系。An establishing module, configured to establish a mapping relationship between the first subscript and the third subscript based on the second subscript.
可选地,所述生成单元包括:Optionally, the generating unit includes:
生成模块,用于调用权重随机选择算法,根据所述权重值生成随机数字,其中,所述随机数字为1至所述前缀和列表中边界值的最大值范围内的任一个数字;A generation module, configured to call a weight random selection algorithm and generate a random number according to the weight value, where the random number is any number within the range of 1 to the maximum value of the boundary value in the prefix sum list;
第一查找模块,用于调用二分查找算法,分别查找所述随机数字对应于所述前缀和列表的目标边界值;The first search module is used to call the binary search algorithm to respectively search for the target boundary value of the random number corresponding to the prefix sum list;
第三获取模块,用于分别获取所述目标边界值对应的第三下标;The third acquisition module is used to respectively acquire the third subscript corresponding to the target boundary value;
第二查找模块,用于根据所述第一下标与所述第三下标之间的映射关系,分别查找所述第三下标对应的第一下标;A second search module, configured to respectively search for the first subscript corresponding to the third subscript according to the mapping relationship between the first subscript and the third subscript;
第三查找模块,用于根据所述第一下标,从所述关键词参数列表中查找对应的关键词参数;A third search module, configured to search for the corresponding keyword parameter from the keyword parameter list according to the first subscript;
组合模块,用于根据所述查找到的关键词参数组合成所述关键词组。A combination module, configured to combine the found keyword parameters into the keyword group.
可选地,所述组合模块还用于:Optionally, the combination module is also used to:
当检测到所述关键词参数的数量达到目标数量时,停止调用随机选择算法生成所述随机数字。When it is detected that the number of keyword parameters reaches the target number, stop calling the random selection algorithm to generate the random number.
可选地,所述装置还包括训练单元,所述训练单元包括:Optionally, the device also includes a training unit, the training unit includes:
第四获取模块,用于从预设数据库获取不同数据类别的训练用文本数据;The fourth acquisition module is used to acquire training text data of different data categories from the preset database;
过滤模块,用于根据预设过滤规则对所述训练用文本数据进行过滤,得到目标数据类别的训练用关键词组,所述预设过滤规则包括基于正则表达式规则去除预设数据类别的文本数据;A filtering module configured to filter the text data for training according to preset filtering rules to obtain training keywords of the target data category. The preset filtering rules include removing text data of the preset data category based on regular expression rules. ;
训练模块,用于将所述目标数据类别的训练用关键词组输入预设语言模型进行训练,得到训练好的预设语言模型。The training module is used to input the training keywords of the target data category into the preset language model for training, and obtain the trained preset language model.
可选地,所述装置还包括监测单元,所述监测单元包括:Optionally, the device further includes a monitoring unit, which includes:
判断模块,用于在将所述关键词组输入预设语言模型,得到所述关键词组对应的目标测试数据之后,读取所述测试数据生成规则中的定时发送信息,判断是否定时发送所述目标测试数据;A judgment module, used to input the keyword group into the preset language model and obtain the target test data corresponding to the keyword group, read the scheduled transmission information in the test data generation rule, and determine whether to send the target in time. Test Data;
发送模块,用于在确定定时发送所述目标测试数据的情况下,当满足定时发送条件时,根据所述关键词参数的数据类别将所述目标测试数据分别发送至对应数据类别的目标数据库;A sending module, configured to send the target test data to the target database of the corresponding data category according to the data category of the keyword parameter when the timing sending condition is met when it is determined to send the target test data regularly;
第一监测模块,用于若监测到所述目标测试数据的发送数量与所述目标数据库的接收数量一致,则完成所述目标测试数据的传输;The first monitoring module is configured to complete the transmission of the target test data if it monitors that the number of sent target test data is consistent with the received number of the target database;
第二监测模块,用于若监测到所述目标数据库接收到的目标测试数据的数量与目标数量不一致,则确定所述目标数据传输异常。The second monitoring module is configured to determine that the target data transmission is abnormal if it detects that the number of target test data received by the target database is inconsistent with the target number.
根据本公开的第三方面,提供了一种电子设备,包括:According to a third aspect of the present disclosure, an electronic device is provided, including:
至少一个处理器;以及at least one processor; and
与所述至少一个处理器通信连接的存储器;其中,a memory communicatively connected to the at least one processor; wherein,
所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行前述第一方面所述的方法。The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor, so that the at least one processor can perform the method described in the first aspect.
根据本公开的第四方面,提供了一种存储有计算机指令的非瞬时计算机可读存储介质,其中,所述计算机指令用于使所述计算机执行前述第一方面所述的方法。According to a fourth aspect of the present disclosure, there is provided a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause the computer to execute the method described in the first aspect.
根据本公开的第五方面,提供了一种计算机程序产品,包括计算机程序,所述计算机程序在被处理器执行时实现如前述第一方面所述的方法。According to a fifth aspect of the present disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements the method described in the foregoing first aspect.
本公开提供的测试数据的生成方法及装置、电子设备和存储介质,响应于测试数据的生成指令,基于所述生成指令中的规则配置文件获取测试数据生成规则,所述测试数据生成规则包括测试数据的目标数量及参数权重列表,所述参数权重列表包括不同数据类别的关键词参数列表及对应的权重列表;基于所述测试数据生成规则,分别根据不同数据类别的关键词参数列表及对应的权重列表生成对应的关键词组;将所述关键词组输入训练好的预设语言模型,得到所述关键词组对应的目标测试数据。本公开提供的测试数据的生成方法,通过编写测试数据生成规则对不同数据类别的关键词参数加权,并根据测试数据生成规则实现对测试数据的构造,使得生成的测试数据更加符合生产数据的分布特性,在满足了测试数据多样性的同时也保证了测试数据的随机性;并基于训练好的预设语言模型根据关键词组生成目标测试数据,满足测试过程中需要大量测试数据的需求。The test data generation method and device, electronic equipment and storage medium provided by the present disclosure respond to the test data generation instruction and obtain the test data generation rules based on the rule configuration file in the generation instruction. The test data generation rules include test The target number of data and the parameter weight list, the parameter weight list includes the keyword parameter list of different data categories and the corresponding weight list; based on the test data generation rules, respectively according to the keyword parameter list of different data categories and the corresponding weight list The weight list generates a corresponding keyword group; the keyword group is input into the trained preset language model to obtain target test data corresponding to the keyword group. The test data generation method provided by this disclosure weights keyword parameters of different data categories by writing test data generation rules, and implements the construction of test data according to the test data generation rules, so that the generated test data is more consistent with the distribution of production data. It not only meets the diversity of test data but also ensures the randomness of test data; and generates target test data based on keyword groups based on the trained preset language model to meet the need for a large amount of test data during the test process.
应当理解,本部分所描述的内容并非旨在标识本申请的实施例的关键或重要特征,也不用于限制本申请的范围。本申请的其它特征将通过以下的说明书而变得容易理解。It should be understood that the content described in this section is not intended to identify key or important features of the embodiments of the application, nor is it intended to limit the scope of the application. Other features of the present application will become readily understood from the following description.
附图说明Description of the drawings
附图用于更好地理解本方案,不构成对本公开的限定。其中:The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure. in:
图1为本公开实施例所提供的一种测试数据的生成方法的流程示意图;Figure 1 is a schematic flowchart of a method for generating test data provided by an embodiment of the present disclosure;
图2为本公开实施例提供的一种编写测试数据生成规则的流程示意图;Figure 2 is a schematic flowchart of writing test data generation rules provided by an embodiment of the present disclosure;
图3为本公开实施例提供的一种规则配置指令页面的示意图;Figure 3 is a schematic diagram of a rule configuration instruction page provided by an embodiment of the present disclosure;
图4为本公开实施例提供的一种生成关键词组的流程示意图;Figure 4 is a schematic flowchart of generating keyword groups according to an embodiment of the present disclosure;
图5为本公开实施例提供的一种测试数据的生成装置的结构示意图;Figure 5 is a schematic structural diagram of a test data generation device provided by an embodiment of the present disclosure;
图6为本公开实施例提供的另一种测试数据的生成装置的结构示意图;Figure 6 is a schematic structural diagram of another test data generation device provided by an embodiment of the present disclosure;
图7为本公开实施例提供的示例电子设备500的示意性框图。FIG. 7 is a schematic block diagram of an example electronic device 500 provided by an embodiment of the present disclosure.
具体实施方式Detailed ways
以下结合附图对本公开的示范性实施例做出说明,其中包括本公开实施例的各种细节以助于理解,应当将它们认为仅仅是示范性的。因此,本领域普通技术人员应当认识到,可以对这里描述的实施例做出各种改变和修改,而不会背离本公开的范围和精神。同样,为了清楚和简明,以下的描述中省略了对公知功能和结构的描述。Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, in which various details of the embodiments of the present disclosure are included to facilitate understanding and should be considered to be exemplary only. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the disclosure. Also, descriptions of well-known functions and constructions are omitted from the following description for clarity and conciseness.
下面参考附图描述本公开实施例的测试数据的生成方法、装置、电子设备和存储介质。The method, device, electronic device, and storage medium for generating test data according to embodiments of the present disclosure are described below with reference to the accompanying drawings.
图1为本公开实施例所提供的一种测试数据的生成方法的流程示意图。FIG. 1 is a schematic flowchart of a method for generating test data provided by an embodiment of the present disclosure.
如图1所示,该方法包含以下步骤:As shown in Figure 1, the method consists of the following steps:
步骤101,响应于测试数据的生成指令,基于所述生成指令中的规则配置文件获取测试数据生成规则,所述测试数据生成规则包括测试数据的目标数量及参数权重列表,所述参数权重列表包括不同数据类别的关键词参数列表及对应的权重列表。Step 101: In response to the test data generation instruction, obtain the test data generation rules based on the rule configuration file in the generation instruction. The test data generation rules include the target number of test data and a parameter weight list. The parameter weight list includes A list of keyword parameters for different data categories and a corresponding list of weights.
在本申请实施例中,为了构造不同数据类别的测试数据,更加灵活的生成测试数据,需要根据测试需求编写不同的测试数据生成规则。所述测试数据生成规则由测试人员根据测试需求进行编写,在编写后存储于所述规则配置文件,在接收到测试数据的生成指令后,基于所述生成指令中的规则配置文件获取测试数据生成规则。所述测试数据生成规则包括测试数据的目标数量及参数权重列表,所述目标数量为生成关键词组的数量,所述参数权重列表包括不同数据类别的关键词参数列表及对应的权重列表。In the embodiment of this application, in order to construct test data of different data categories and generate test data more flexibly, different test data generation rules need to be written according to test requirements. The test data generation rules are written by testers according to test requirements, and are stored in the rule configuration file after writing. After receiving the test data generation instruction, the test data generation is obtained based on the rule configuration file in the generation instruction. rule. The test data generation rules include a target number of test data and a parameter weight list. The target number is the number of generated keyword groups. The parameter weight list includes a keyword parameter list of different data categories and a corresponding weight list.
为了对所述测试数据生成规则进行更好的理解,本申请实施例提供了一种测试数据生成规则如下所示:In order to better understand the test data generation rules, embodiments of this application provide a test data generation rule as follows:
{"num":"5","crontab":"是否定时","attribute":{"情感":["正面","中性","负面"],"权重":[2,1,2]},"region":{"地区":["上海","北京","南京"],"权重":[3,1,1]},"industry":{"行业":["销售","金融","计算机"],"权重":[1,2,2]}}。{"num":"5","crontab":"whether it is timed","attribute":{"emotion":["positive","neutral","negative"],"weight":[2,1 ,2]},"region":{"region":["Shanghai","Beijing","Nanjing"],"weight":[3,1,1]},"industry":{"industry": ["Sales","Finance","Computer"],"Weight":[1,2,2]}}.
其中,所述测试数据生成规则以键值对(key-value)的格式输入,“"num":"5"”表示目标数量为5,即需要生成的关键词组的数量为5个;“"crontab":"”是否定时"”用于设置定时信息,“"attribute":{"情感":["正面","中性","负面"],"权重":[2,1,2]},"region":{"地区":["上海","北京","南京"],"权重":[3,1,1]},"industry":{"行业":["销售","金融","计算机"],"权重":[1,2,2]}”即为参数权重列表,分别为表示情感、地区、行业的不同数据类别的关键词参数列表及对应的权重列表,每一个关键词参数列表对应一个权重列表,每个数据类别的关键词参数列表中包含有不同的关键词参数,一个关键词参数对应一个权重。Among them, the test data generation rules are input in the format of key-value pairs, ""num":"5"" means that the target number is 5, that is, the number of key phrases that need to be generated is 5; "" crontab":""Is timing"" used to set timing information,""attribute":{"emotion":["positive","neutral","negative"],"weight":[2,1,2 ]},"region":{"region":["Shanghai","Beijing","Nanjing"],"weight":[3,1,1]},"industry":{"industry":[" Sales","Finance","Computer"],"Weight":[1,2,2]}" is a list of parameter weights, which are keyword parameter lists and correspondences for different data categories representing emotions, regions, and industries. The weight list, each keyword parameter list corresponds to a weight list, the keyword parameter list of each data category contains different keyword parameters, and one keyword parameter corresponds to one weight.
步骤102,基于所述测试数据生成规则,分别根据不同数据类别的关键词参数列表及对应的权重列表生成对应的关键词组。Step 102: Based on the test data generation rules, generate corresponding keyword groups according to keyword parameter lists and corresponding weight lists of different data categories.
在获取所述测试数据生成规则之后,为了获取目标测试数据,还需要根据不同数据类别的关键词参数列表及对应的权重列表生成对应的关键词组。为了对所述关键词组进行更好的理解,请继续参考上述步骤101的测试数据生成规则,由于目标数量为5,因此根据测试数据生成规则,基于不同数据类别的关键词参数列表和对应的权重列表生成5个关键词组,如["中性+北京+销售","正面+上海+金融","负面+北京+计算机","正面+北京+金融","负面+南京+计算机"]。After obtaining the test data generation rules, in order to obtain target test data, it is also necessary to generate corresponding keyword groups based on keyword parameter lists of different data categories and corresponding weight lists. In order to better understand the keyword group, please continue to refer to the test data generation rules in step 101 above. Since the target number is 5, according to the test data generation rules, the keyword parameter list and corresponding weights based on different data categories are The list generates 5 keyword groups, such as ["Neutral+Beijing+Sales", "Positive+Shanghai+Finance", "Negative+Beijing+Computer", "Positive+Beijing+Finance", "Negative+Nanjing+Computer"] .
步骤103,将所述关键词组输入训练好的预设语言模型,得到所述关键词组对应的目标测试数据。Step 103: Input the keyword group into the trained preset language model to obtain target test data corresponding to the keyword group.
为了使测试数据种类更加丰富且满足大量测试数据用来测试的需求,在获得所述关键词组后,将所述关键词组输入训练好的预设语言模型,通过训练好的预设语言模型,得到所述关键词组对应的目标测试数据。为了更好的理解所述目标测试数据,本申请实施例提供了所述目标测试数据的样例如下表所示:In order to enrich the types of test data and meet the needs of a large amount of test data for testing, after obtaining the keyword group, the keyword group is input into the trained preset language model, and through the trained preset language model, we get The target test data corresponding to the keyword group. In order to better understand the target test data, the embodiment of this application provides samples of the target test data as shown in the following table:
表1Table 1
本公开提供的测试数据的生成方法,响应于测试数据的生成指令,基于所述生成指令中的规则配置文件获取测试数据生成规则,所述测试数据生成规则包括测试数据的目标数量及参数权重列表,所述参数权重列表包括不同数据类别的关键词参数列表及对应的权重列表;基于所述测试数据生成规则,分别根据不同数据类别的关键词参数列表及对应的权重列表生成对应的关键词组;将所述关键词组输入训练好的预设语言模型,得到所述关键词组对应的目标测试数据。本公开提供的测试数据的生成方法,通过编写测试数据生成规则对不同数据类别的关键词参数加权,并根据测试数据生成规则实现对测试数据的构造,使得生成的测试数据更加符合生产数据的分布特性,在满足了测试数据多样性的同时也保证了测试数据的随机性;并基于训练好的预设语言模型根据关键词组生成目标测试数据,满足测试过程中需要大量测试数据的需求。The test data generation method provided by the present disclosure responds to a test data generation instruction and obtains test data generation rules based on the rule configuration file in the generation instruction. The test data generation rules include a target number of test data and a parameter weight list. , the parameter weight list includes keyword parameter lists of different data categories and corresponding weight lists; based on the test data generation rules, corresponding keyword groups are generated according to keyword parameter lists of different data categories and corresponding weight lists; Input the keyword group into the trained preset language model to obtain target test data corresponding to the keyword group. The test data generation method provided by this disclosure weights keyword parameters of different data categories by writing test data generation rules, and implements the construction of test data according to the test data generation rules, so that the generated test data is more consistent with the distribution of production data. It not only meets the diversity of test data but also ensures the randomness of test data; and generates target test data based on keyword groups based on the trained preset language model to meet the need for a large amount of test data during the test process.
在本申请实施例中,为了满足生成的测试数据的多样性,以及不同数据类型的测试数据的生成,在基于所述生成指令中的规则配置文件获取测试数据生成规则之前,还需根据测试需求编写所述测试数据生成规则。In the embodiment of the present application, in order to meet the diversity of generated test data and the generation of test data of different data types, before obtaining the test data generation rules based on the rule configuration file in the generation instruction, it is also necessary to according to the test requirements Write the test data generation rules as described.
为了对所述根据需求编写所述测试数据生成规则进行更好的理解,请参考图2,图2为本申请实施例提供的一种编写测试数据生成规则的流程示意图。In order to have a better understanding of writing the test data generation rules according to requirements, please refer to Figure 2, which is a schematic flow chart of writing test data generation rules provided by an embodiment of the present application.
如图2所示,该方法包含以下步骤:As shown in Figure 2, the method consists of the following steps:
步骤201,响应于对所述规则配置文件的配置指令,获取所述配置指令所携带的规则配置文件。Step 201: In response to the configuration instruction for the rule configuration file, obtain the rule configuration file carried by the configuration instruction.
为了对所述响应于对所述规则配置文件的配置指令,获取所述配置指令所携带的规则配置文件进行更好的理解,请参考图3,图3为本申请实施例提供的一种规则配置指令页面的示意图。如图3所示,所述规则配置指令页面包括“数量”、“定时”、“规则配置文件”以及“预设模板”四个选项。所述“数量”用于输入目标数量,所述“定时”用于设置是否定时发送目标测试数据,所述“规则配置文件”用于编写所述测试数据生成规则,在一些实施例中,所述规则配置文件采用JSON格式写入;所述“预设模板”用于下载所述预设测试数据生成规则配置模板以及在完成对所述测试数据生成规则的编写之后,将基于模板编写的规则配置文件进行上传。In order to better understand the method of obtaining the rule configuration file carried by the configuration instruction in response to the configuration instruction of the rule configuration file, please refer to Figure 3. Figure 3 is a rule provided by an embodiment of the present application. Schematic diagram of the configuration command page. As shown in Figure 3, the rule configuration instruction page includes four options: "Quantity", "Timing", "Rule Configuration File" and "Preset Template". The "quantity" is used to input the target quantity, the "timing" is used to set whether to send target test data in a timely manner, and the "rule configuration file" is used to write the test data generation rules. In some embodiments, The above rule configuration file is written in JSON format; the "preset template" is used to download the preset test data generation rule configuration template and after completing the writing of the test data generation rule, the rules written based on the template Configuration file is uploaded.
步骤202,基于所述规则配置文件,按照预设测试数据生成规则配置模板编写测试数据生成规则。Step 202: Based on the rule configuration file, write test data generation rules according to the preset test data generation rule configuration template.
在本申请实施例中,所述预设测试数据生成规则的配置模板用于便于对所述测试数据生成规则进行编写,为了对所述预设测试数据生成规则的配置模板进行更好的理解,所述预设测试数据生成规则的配置模板如下所示:In the embodiment of this application, the configuration template of the preset test data generation rules is used to facilitate the writing of the test data generation rules. In order to better understand the configuration template of the preset test data generation rules, The configuration template of the preset test data generation rules is as follows:
{"num":"数量","crontab":"是否定时","region":{"地区":["地区1","地区2"],"权重":[权重1,权重2]},"industry":{"行业":["行业1","行业2"],"权重":[权重1,权重2]},"attribute":{"情感":["情感1","情感2"],"权重":[权重1,权重2]},"type":{"类型":["类型1","类型2"],"权重":[权重1,权重2]}。{"num":"quantity","crontab":"whether to time","region":{"region":["region 1","region 2"],"weight":[weight 1, weight 2] },"industry":{"industry":["industry1","industry2"],"weight":[weight1,weight2]},"attribute":{"emotion":["emotion1" ,"emotion 2"],"weight":[weight 1,weight 2]},"type":{"type":["type 1","type 2"],"weight":[weight 1,weight 2]}.
在基于所述规则配置指令页面下载所述配置模板之后,可通过所述配置模板对所述测试数据生成规则进行编写。除上述配置模板中的内容之外,测试人员也可根据自己的测试需求,在规则模板中对应的增加key-value格式的不同数据类型的关键词参数,以生成自己所需要的特定数据类型的测试数据。After downloading the configuration template based on the rule configuration instruction page, the test data generation rules can be written through the configuration template. In addition to the content in the above configuration template, testers can also add keyword parameters of different data types in key-value format to the rule template according to their own testing needs to generate the specific data types they need. Test Data.
步骤203,对所述测试数据生成规则进行校验。Step 203: Verify the test data generation rules.
在所述规则配置指令页面上传规则配置文件之后,系统会对传过来的测试数据生成规则进行校验,例如,校验关键词参数合法性,即该关键词参数在对应产品类别中是否存在;校验关键词参数准确性,即该关键词参数对应内容是否符合后台的输入要求。After uploading the rule configuration file on the rule configuration instruction page, the system will verify the passed test data generation rules, for example, verify the legality of the keyword parameters, that is, whether the keyword parameters exist in the corresponding product category; Verify the accuracy of keyword parameters, that is, whether the content corresponding to the keyword parameters meets the input requirements of the background.
步骤204,在确定所述测试数据生成规则通过校验后,将所述测试数据生成规则写入预设数据库。Step 204: After determining that the test data generation rule passes the verification, write the test data generation rule into a preset database.
若确定所述测试数据生成规则通过校验,则将所述测试数据生成规则写入预设数据库,并在所述规则配置指令页面显示“关键词参数写入成功”的提示信息。在一些实施例中,所述预设数据库可采用MySQL数据库。If it is determined that the test data generation rule passes the verification, the test data generation rule is written into the preset database, and a prompt message of "keyword parameters written successfully" is displayed on the rule configuration instruction page. In some embodiments, the preset database may be a MySQL database.
通过上述的测试数据生成规则的编写方法,可实现根据测试人员的需求设置不同类别的关键词参数;可实现对多种不同类别的测试数据进行加权;可更加灵活的生成所述关键词组。Through the above method of writing test data generation rules, different categories of keyword parameters can be set according to the needs of testers; multiple different categories of test data can be weighted; and the keyword groups can be generated more flexibly.
作为对上述步骤102的一种可实现方式,为了实现根据不同数据类别的关键词参数列表及对应的权重列表生成对应的关键词组,还需要构建所述关键词参数与前缀和列表中的边界值的对应关系,具体的实现方法包括:在分别根据不同数据类别的关键词参数列表及对应的权重列表生成对应的关键词组之前,获取所述参数权重列表,在所述参数权重列表中,一个关键词参数对应一个权重值及一个第一下标,所述第一下标与所述关键词参数存在映射关系;所述第一下标为所述参数权重列表中存储所述关键词参数的存储地址对应的下标;对所述权重列表中的权重值进行初始化,得到对应的前缀和列表,所述前缀和列表为根据所述权重值的大小有序递增列表,用于表示权重值的边界,其中,所述第一下标与所述第二下标对应;所述前缀和列表中的每个边界值分别对应一个第三下标,所述第三下标与所述第二下标对应;基于所述第二下标建立所述第一下标与所述第三下标之间的映射关系。As an implementation method of the above step 102, in order to generate the corresponding keyword groups according to the keyword parameter lists of different data categories and the corresponding weight lists, it is also necessary to construct the boundary values in the keyword parameters and prefix sum lists. The corresponding relationship, the specific implementation method includes: before generating the corresponding keyword group according to the keyword parameter list and the corresponding weight list of different data categories, obtaining the parameter weight list, in the parameter weight list, a key The word parameter corresponds to a weight value and a first subscript, and there is a mapping relationship between the first subscript and the keyword parameter; the first subscript is the storage of the keyword parameter in the parameter weight list. The subscript corresponding to the address; initialize the weight value in the weight list to obtain the corresponding prefix sum list. The prefix sum list is an orderly increasing list according to the size of the weight value and is used to represent the boundary of the weight value. , wherein the first subscript corresponds to the second subscript; each boundary value in the prefix sum list corresponds to a third subscript, and the third subscript corresponds to the second subscript Correspondence: establishing a mapping relationship between the first subscript and the third subscript based on the second subscript.
为了对上述的前缀和列表以及前缀和列表的边界值进行更好的理解,本申请实施例提供了以下示例:将所述参数权重列表设置为"region":{"地区":["北京","上海","天津","深圳"],"权重":[1,2,3,4]},所述关键词列表["北京","上海","天津","深圳"]对应的第一下标分别为[0,1,2,3],即关键词参数"北京"对应的权重为1,第一下标为0;所述权重列表[1,2,3,4]对应的第二下标与第一下表对应,随后对所述权重列表[1,2,3,4]中的权重值进行初始化,即按照前后顺序对所述权重列表进行累加计算,得到对应的前缀和列表[1,3,6,10],因此,所述前缀和列表为根据所述权重值加和的大小有序递增列表;并且,所述前缀和列表中的每个值为所述权重值加和的右边界值,每个右边界值对应一个第三下标,所述第三下标与所述第二下标对应,因此,基于所述第二下标,可建立所述第一下标与所述第三下标之间的映射关系。In order to better understand the above-mentioned prefix sum list and the boundary value of the prefix sum list, the embodiment of this application provides the following example: setting the parameter weight list to "region":{"region":["Beijing" ,"Shanghai", "Tianjin", "Shenzhen"], "weight": [1,2,3,4]}, the keyword list ["Beijing", "Shanghai", "Tianjin", "Shenzhen" ] The corresponding first subscripts are [0, 1, 2, 3] respectively, that is, the weight corresponding to the keyword parameter "Beijing" is 1, and the first subscript is 0; the weight list [1, 2, 3, 4] The corresponding second subscript corresponds to the first table below, and then the weight values in the weight list [1, 2, 3, 4] are initialized, that is, the weight list is cumulatively calculated in order, The corresponding prefix sum list [1, 3, 6, 10] is obtained. Therefore, the prefix sum list is an ordered increasing list according to the size of the sum of the weight values; and, each value in the prefix sum list is the right boundary value of the sum of the weight values, each right boundary value corresponds to a third subscript, and the third subscript corresponds to the second subscript. Therefore, based on the second subscript, A mapping relationship between the first subscript and the third subscript is established.
通过建立所述第一下标与所述第三下标之间的映射关系,同时建立了所述前缀和列表与所述关键词参数列表之间的映射关系,可调用所述调用权重随机选择算法生成随机数并调用二分查找法查找所述随机数在所述前缀和列表中对应的右边界值,返回右边界值对应的第三下标,并基于所述前缀和列表与所述关键词参数列表之间的映射关系,查找到对应的关键词参数。By establishing a mapping relationship between the first subscript and the third subscript, and simultaneously establishing a mapping relationship between the prefix sum list and the keyword parameter list, the call weight random selection can be called The algorithm generates random numbers and calls the binary search method to find the right boundary value corresponding to the random number in the prefix sum list, returns the third subscript corresponding to the right boundary value, and based on the prefix sum list and the keyword The mapping relationship between parameter lists finds the corresponding keyword parameters.
为了对所述基于所述前缀和列表与所述关键词参数列表之间的映射关系,查找到对应的关键词参数进行更好的理解,请参考图4,图4为本申请实施例提供的一种生成关键词组的流程示意图。In order to have a better understanding of finding the corresponding keyword parameters based on the mapping relationship between the prefix sum list and the keyword parameter list, please refer to Figure 4, which is provided by the embodiment of the present application. A schematic diagram of a process for generating keyword phrases.
如图4所示,该方法包含以下步骤:As shown in Figure 4, the method consists of the following steps:
步骤301,调用权重随机选择算法,根据所述权重值生成随机数字,其中,所述随机数字为1至所述前缀和列表中边界值的最大值范围内的任一个数字。Step 301: Call the weight random selection algorithm to generate a random number according to the weight value, where the random number is any number within the range of 1 to the maximum value of the boundary value in the prefix sum list.
为了对所述生成关键词组的流程进行更好的理解,请继续参考上述步骤102提供的测试数据生成规则,所述测试数据生成规则如下:In order to better understand the process of generating keyword phrases, please continue to refer to the test data generation rules provided in step 102 above. The test data generation rules are as follows:
{"num":"5","crontab":"是否定时","attribute":{"情感":["正面","中性","负面"],"权重":[2,1,2]},"region":{"地区":["上海","北京","南京"],"权重":[3,1,1]},"industry":{"行业":["销售","金融","计算机"],"权重":[1,2,2]}}{"num":"5","crontab":"whether it is timed","attribute":{"emotion":["positive","neutral","negative"],"weight":[2,1 ,2]},"region":{"region":["Shanghai","Beijing","Nanjing"],"weight":[3,1,1]},"industry":{"industry": ["Sales","Finance","Computer"],"Weight":[1,2,2]}}
以上述测试数据生成规则中数据类别为地区的参数权重列表"region":{"地区":["上海","北京","南京"],"权重":[3,1,1]}为例,其关键词参数列表为["上海","北京","南京"],对应的第一下标为[0,1,2],对应的权重列表为[3,1,1],则对所述权重列表进行初始化后得到的前缀和列表为[3,4,5],所述前缀和列表中边界值的最大值为5,因此,调用权重随机选择算法,根据所述权重值生成一个随机数字,所述随机数字为1至5范围内的任一个数字,每次随机选择的时间复杂度是O(logn),n是对应权重列表的权重值的加和。The parameter weight list "region":{"region":["Shanghai","Beijing","Nanjing"],"weight":[3,1,1]} is based on the data category in the above test data generation rules. For example, the keyword parameter list is ["Shanghai", "Beijing", "Nanjing"], the corresponding first subscript is [0,1,2], and the corresponding weight list is [3,1,1] , then the prefix sum list obtained after initializing the weight list is [3,4,5], and the maximum value of the boundary value in the prefix sum list is 5. Therefore, the weight random selection algorithm is called, and according to the weight Value generates a random number, which is any number in the range of 1 to 5. The time complexity of each random selection is O(logn), and n is the sum of the weight values of the corresponding weight list.
步骤302,调用二分查找算法,分别查找所述随机数字对应于所述前缀和列表的目标边界值。Step 302: Call the binary search algorithm to respectively search for the target boundary value of the random number corresponding to the prefix sum list.
根据上述步骤301所述的方法生成1至5范围内的随机数字,以生成的随机数字是2为例,调用二分查找算法,查找所述随机数字2在前缀和列表中的右边界值,所述右边界值为3。Generate random numbers in the range of 1 to 5 according to the method described in step 301 above. Taking the generated random number as 2 as an example, call the binary search algorithm to find the right boundary value of the random number 2 in the prefix sum list, so The right boundary value is 3.
步骤303,分别获取所述目标边界值对应的第三下标。Step 303: Obtain the third subscript corresponding to the target boundary value.
根据上述步骤302,可确定随机数字2在前缀和列表中的右边界值3对应的第三下标。According to the above step 302, the third subscript corresponding to the right boundary value 3 of the random number 2 in the prefix sum list can be determined.
步骤304,根据所述第一下标与所述第三下标之间的映射关系,分别查找所述第三下标对应的第一下标。Step 304: According to the mapping relationship between the first subscript and the third subscript, respectively search for the first subscript corresponding to the third subscript.
根据上述步骤303可确定所述第三下标对应的第一下标为0。According to the above step 303, it can be determined that the first subscript corresponding to the third subscript is 0.
步骤305,根据所述第一下标,从所述关键词参数列表中查找对应的关键词参数。Step 305: Search the corresponding keyword parameter from the keyword parameter list according to the first subscript.
根据关键词参数与第一下标的映射关系,可查找到所述关键词参数列表中对应的第一下标为0的关键词参数为"上海"。According to the mapping relationship between keyword parameters and the first subscript, it can be found that the corresponding keyword parameter with a first subscript of 0 in the keyword parameter list is "Shanghai".
步骤306,根据所述查找到的关键词参数组成所述关键词组。Step 306: Compose the keyword group according to the found keyword parameters.
重复执行上述步骤301至步骤305,使每个数据类别的参数权重列表生成的对应关键词参数达到目标数量,例如,当目标数量为5时,则每个数据类别的参数权重列表分别生成5个对应的第一下标,如{"attribute":{"情感":[1,0,2,0,2]},"region":{"地区":[1,0,1,1,2]},"industry":{"行业":[0,1,2,1,2]}},则对应的关键词参数为{"attribute":{"情感":[中性,正面,负面,正面,负面]},"region":{"地区":[北京,上海,北京,北京,南京]},"industry":{"行业":[销售,金融,计算机,金融,计算机]}};根据查找到的关键词参数组成所述关键词组,如["中性+北京+销售","正面+上海+金融","负面+北京+计算机","正面+北京+金融","负面+南京+计算机"],得到目标数量,即5个关键词组。Repeat the above steps 301 to 305 until the corresponding keyword parameters generated by the parameter weight list of each data category reach the target number. For example, when the target number is 5, then 5 parameter weight lists of each data category are generated. The corresponding first subscript, such as {"attribute":{"emotion":[1,0,2,0,2]},"region":{"region":[1,0,1,1,2 ]},"industry":{"industry":[0,1,2,1,2]}}, then the corresponding keyword parameters are {"attribute":{"emotion":[neutral, positive, negative ,positive,negative]},"region":{"region":[Beijing, Shanghai, Beijing, Beijing, Nanjing]},"industry":{"industry":[sales, finance, computer, finance, computer]} }; Compose the keyword group according to the found keyword parameters, such as ["Neutral+Beijing+Sales", "Positive+Shanghai+Finance", "Negative+Beijing+Computer", "Positive+Beijing+Finance", "Negative+Nanjing+Computer"], the target number is obtained, that is, 5 keyword groups.
在上述步骤305中,当检测到所述关键词参数的数量达到目标数量时,则停止调用随机选择算法生成所述随机数字。In the above step 305, when it is detected that the number of keyword parameters reaches the target number, the random selection algorithm is stopped to be called to generate the random numbers.
通过上述调用权重随机选择算法,按照关键词参数对应的权重值,随机生成关键词参数并组合得到关键词组的方法,可实现多个参数多种类型的测试数据的随机分布,模拟了生产环境的数据情况。By calling the weighted random selection algorithm above and randomly generating keyword parameters according to the weight values corresponding to the keyword parameters and combining them to obtain keyword groups, the random distribution of multiple parameters and types of test data can be achieved, simulating the production environment. data situation.
为了得到训练好的预设语言模型,如训练好的GPT-2模型等语言模型,还需要对所述预设语言模型进行训练,所述训练方法包括以下步骤:In order to obtain a trained preset language model, such as a trained GPT-2 model and other language models, the preset language model also needs to be trained. The training method includes the following steps:
步骤1.从预设数据库获取不同数据类别的训练用文本数据,所述训练用文本数据已经标记好对应的情感类型attribute、地区region、行业industry。Step 1. Obtain training text data of different data categories from the preset database. The training text data has been marked with the corresponding emotion type attribute, region, and industry.
步骤2.根据预设过滤规则对所述训练用文本数据进行过滤,得到目标数据类别的训练用关键词组,所述预设过滤规则包括基于正则表达式规则去除预设数据类别的文本数据。所述预设过滤规则包括基于正则表达式规则去除噪音数据,如(1)去除文本中的网址数据、html格式等,(2)去除文本中的图片、emoji表情数据,(3)去除文字中的空格、换行符等无意义数据,(4)去除太长或太短的文本内容。Step 2. Filter the text data for training according to preset filtering rules to obtain the training keywords of the target data category. The preset filtering rules include removing text data of the preset data category based on regular expression rules. The preset filtering rules include removing noise data based on regular expression rules, such as (1) removing URL data, html format, etc. in the text, (2) removing pictures and emoji expression data in the text, (3) removing text in the text. spaces, newlines and other meaningless data, (4) remove text content that is too long or too short.
另外,通过黑名单的方式针对一些敏感数据进行过滤,如(1)去除脏话、敏感词。(2)去除含有个人身份信息的数据。In addition, some sensitive data are filtered through blacklists, such as (1) removing swear words and sensitive words. (2) Remove data containing personally identifiable information.
步骤3.将所述目标数据类别的训练用关键词组输入预设语言模型进行训练,得到训练好的预设语言模型。Step 3. Input the training keywords of the target data category into the preset language model for training, and obtain the trained preset language model.
通过对预设语言模型进行训练,例如对GPT-2模型进行训练,之后将得到的所述关键词组输入所述训练好的预设语言模型,得到对应的文本数据作为目标测试数据,使目标测试数据内容更丰富,满足大量测试数据用来测试的需求。By training the preset language model, for example, training the GPT-2 model, and then inputting the obtained keyword phrase into the trained preset language model, the corresponding text data is obtained as the target test data, so that the target test The data content is richer and meets the needs of a large amount of test data for testing.
为了更好的保存所述目标测试数据,在得到所述关键词组对应的目标测试数据之后,还需要读取所述测试数据生成规则中的定时发送信息,判断是否定时发送所述目标测试数据;在确定定时发送所述目标测试数据的情况下,当满足定时发送条件时,根据所述关键词参数的数据类别将所述目标测试数据分别发送至对应数据类别的目标数据库;若监测到所述目标测试数据的发送数量与所述目标数据库的接收数量一致,则完成所述目标测试数据的传输,并返回传输成功标识;若监测到所述目标数据库接收到的目标测试数据的数量与目标数量不一致,则确定所述目标数据传输异常,返回传输失败标识以提示测试人员。In order to better save the target test data, after obtaining the target test data corresponding to the keyword group, it is also necessary to read the scheduled transmission information in the test data generation rules to determine whether to send the target test data in a timely manner; In the case where it is determined to send the target test data regularly, when the timing sending conditions are met, the target test data will be sent to the target database of the corresponding data category according to the data category of the keyword parameter; if the If the number of target test data sent is consistent with the number of target test data received by the target database, the transmission of the target test data will be completed and the transmission success indicator will be returned; if it is monitored that the number of target test data received by the target database is consistent with the target number If they are inconsistent, it is determined that the target data transmission is abnormal, and a transmission failure identification is returned to prompt the tester.
综上所述,本公开实施例能达到以下效果:To sum up, the embodiments of the present disclosure can achieve the following effects:
1.基于规则配置文件编写测试数据生成规则,可实现根据测试人员的需求设置不同类别的关键词参数;可实现对多种不同类别的测试数据进行加权;可更加灵活的生成所述关键词组。1. Write test data generation rules based on the rule configuration file, which can set different categories of keyword parameters according to the needs of testers; can achieve weighting of multiple different categories of test data; and can generate the keyword groups more flexibly.
2.通过调用权重随机选择算法,按照关键词参数对应的权重值,随机生成关键词参数并组合得到关键词组的方法,可实现多个参数多种类型的测试数据的随机分布,模拟了生产环境的数据情况。2. By calling the weight random selection algorithm and randomly generating keyword parameters according to the weight values corresponding to the keyword parameters and combining them to obtain the keyword group, random distribution of multiple parameters and multiple types of test data can be achieved, simulating the production environment. data situation.
3.通过对预设语言模型进行训练得到训练好的预设语言模型,将得到的所述关键词组输入所述训练好的预设语言模型,得到对应的文本数据作为目标测试数据,使目标测试数据内容更丰富,满足大量测试数据用来测试的需求。3. Obtain a trained preset language model by training the preset language model, input the obtained keyword phrase into the trained preset language model, and obtain the corresponding text data as the target test data, so that the target test The data content is richer and meets the needs of a large amount of test data for testing.
与上述的汽车热管理系统的参数标定方法相对应,本发明还提出一种汽车热管理系统的参数标定装置。由于本发明的装置实施例与上述的方法实施例相对应,对于装置实施例中未披露的细节可参照上述的方法实施例,本发明中不再进行赘述。Corresponding to the above parameter calibration method of the automobile thermal management system, the present invention also proposes a parameter calibration device of the automobile thermal management system. Since the device embodiment of the present invention corresponds to the above-mentioned method embodiment, details not disclosed in the device embodiment can be referred to the above-mentioned method embodiment, and will not be described again in the present invention.
与上述的测试数据的生成方法相对应,本发明还提出一种测试数据的生成装置。由于本发明的装置实施例与上述的方法实施例相对应,对于装置实施例中未披露的细节可参照上述的方法实施例,本发明中不再进行赘述。Corresponding to the above-mentioned test data generation method, the present invention also proposes a test data generation device. Since the device embodiment of the present invention corresponds to the above-mentioned method embodiment, details not disclosed in the device embodiment can be referred to the above-mentioned method embodiment, and will not be described again in the present invention.
图5为本公开实施例提供的一种测试数据的生成装置的结构示意图,如图5所示,包括:获取单元41、生成单元42、输入单元43。Figure 5 is a schematic structural diagram of a test data generation device provided by an embodiment of the present disclosure. As shown in Figure 5, it includes: an acquisition unit 41, a generation unit 42, and an input unit 43.
获取单元41,用于响应于测试数据的生成指令,基于所述生成指令中的规则配置文件获取测试数据生成规则,所述测试数据生成规则包括测试数据的目标数量及参数权重列表,所述参数权重列表包括不同数据类别的关键词参数列表及对应的权重列表;The acquisition unit 41 is configured to respond to a test data generation instruction and acquire test data generation rules based on the rule configuration file in the generation instruction. The test data generation rules include a target quantity of test data and a parameter weight list. The parameters The weight list includes a keyword parameter list of different data categories and a corresponding weight list;
生成单元42,用于基于所述测试数据生成规则,分别根据不同数据类别的关键词参数列表及对应的权重列表生成对应的关键词组;The generation unit 42 is configured to generate corresponding keyword groups based on the test data generation rules according to the keyword parameter lists of different data categories and the corresponding weight lists;
输入单元43,用于将所述关键词组输入训练好的预设语言模型,得到所述关键词组对应的目标测试数据。The input unit 43 is used to input the keyword group into a trained preset language model to obtain target test data corresponding to the keyword group.
进一步地,在本实施例一种可能的实现方式中,如图6所示,在所述获取单元41之前,所述装置还包括编写单元44,所述编写单元44包括:Further, in a possible implementation of this embodiment, as shown in Figure 6, before the acquisition unit 41, the device further includes a writing unit 44, and the writing unit 44 includes:
第一获取模块441,用于在所述响应于测试数据的生成指令,基于所述生成指令中的规则配置文件获取测试数据生成规则之前,响应于对所述规则配置文件的配置指令,获取所述配置指令所携带的规则配置文件;The first acquisition module 441 is configured to obtain the test data generation rules based on the rule configuration file in the generation instruction in response to the generation instruction of the test data, and obtain the test data generation rules in response to the configuration instruction of the rule configuration file. The rule configuration file carried by the above configuration instructions;
编写模块442,用于基于所述规则配置文件,按照预设测试数据生成规则的配置模板编写测试数据生成规则;Writing module 442, configured to write test data generation rules according to the configuration template of the preset test data generation rules based on the rule configuration file;
校验模块443,用于对所述测试数据生成规则进行校验;Verification module 443, used to verify the test data generation rules;
写入模块444,用于在确定所述测试数据生成规则通过校验后,将所述测试数据生成规则写入预设数据库。The writing module 444 is configured to write the test data generation rules into a preset database after determining that the test data generation rules pass the verification.
进一步地,在本实施例一种可能的实现方式中,如图6所示,在所述生成单元42前,所述装置还包括建立单元45,所述建立单元45包括:Further, in a possible implementation of this embodiment, as shown in Figure 6, before the generating unit 42, the device further includes an establishing unit 45, and the establishing unit 45 includes:
第二获取模块451,用于在所述基于所述测试数据生成规则,分别根据不同数据类别的关键词参数列表及对应的权重列表生成对应的关键词组之前,获取所述参数权重列表,其中,一个关键词参数对应一个权重值及一个第一下标,所述第一下标与所述关键词参数存在映射关系;所述第一下标为所述参数权重列表中存储所述关键词参数的存储地址对应的下标;The second acquisition module 451 is configured to obtain the parameter weight list before generating corresponding keyword groups based on the keyword parameter lists and corresponding weight lists of different data categories based on the test data generation rules, where, A keyword parameter corresponds to a weight value and a first subscript, and there is a mapping relationship between the first subscript and the keyword parameter; the first subscript is the keyword parameter stored in the parameter weight list. The subscript corresponding to the storage address;
初始化模块452,用于对所述权重列表中的权重值进行初始化,得到对应的前缀和列表,所述前缀和列表为根据所述权重值加和的大小有序递增列表,用于表示权重值的边界,其中,所述第一下标与所述第二下标对应;所述前缀和列表中的每个边界值分别对应一个第三下标,所述第三下标与所述第二下标对应;Initialization module 452 is used to initialize the weight values in the weight list to obtain the corresponding prefix sum list. The prefix sum list is an ordered increasing list according to the size of the sum of the weight values and is used to represent the weight value. boundary, wherein the first subscript corresponds to the second subscript; each boundary value in the prefix sum list corresponds to a third subscript, and the third subscript corresponds to the second subscript. Subscript correspondence;
建立模块453,用于基于所述第二下标建立所述第一下标与所述第三下标之间的映射关系。The establishment module 453 is configured to establish a mapping relationship between the first subscript and the third subscript based on the second subscript.
进一步地,在本实施例一种可能的实现方式中,如图6所示,所述生成单元42包括:Further, in a possible implementation of this embodiment, as shown in Figure 6, the generating unit 42 includes:
生成模块421,用于调用权重随机选择算法,根据所述权重值生成随机数字,其中,所述随机数字为1至所述前缀和列表中边界值的最大值范围内的任一个数字;The generation module 421 is used to call the weight random selection algorithm and generate a random number according to the weight value, where the random number is any number within the range of 1 to the maximum value of the boundary value in the prefix sum list;
第一查找模块422,用于调用二分查找算法,分别查找所述随机数字对应于所述前缀和列表的目标边界值;The first search module 422 is used to call a binary search algorithm to respectively search for the target boundary value of the random number corresponding to the prefix sum list;
第三获取模块423,用于分别获取所述目标边界值对应的第三下标;The third obtaining module 423 is used to obtain the third subscript corresponding to the target boundary value respectively;
第二查找模块424,用于根据所述第一下标与所述第三下标之间的映射关系,分别查找所述第三下标对应的第一下标;The second search module 424 is configured to respectively search for the first subscript corresponding to the third subscript according to the mapping relationship between the first subscript and the third subscript;
第三查找模块425,用于根据所述第一下标,从所述关键词参数列表中查找对应的关键词参数;The third search module 425 is configured to search for the corresponding keyword parameter from the keyword parameter list according to the first subscript;
组合模块426,用于根据所述查找到的关键词参数组合成所述关键词组。The combination module 426 is used to combine the keyword groups according to the found keyword parameters.
进一步地,在本实施例一种可能的实现方式中,所述组合模块426还用于:Further, in a possible implementation of this embodiment, the combination module 426 is also used to:
当检测到所述关键词参数的数量达到目标数量时,停止调用随机选择算法生成所述随机数字。When it is detected that the number of keyword parameters reaches the target number, stop calling the random selection algorithm to generate the random number.
进一步地,在本实施例一种可能的实现方式中,所述装置还包括训练单元46,如图6所示,所述训练单元46包括:Further, in a possible implementation of this embodiment, the device further includes a training unit 46. As shown in Figure 6, the training unit 46 includes:
第四获取模块461,用于从预设数据库获取不同数据类别的训练用文本数据;The fourth acquisition module 461 is used to acquire training text data of different data categories from the preset database;
过滤模块462,用于根据预设过滤规则对所述训练用文本数据进行过滤,得到目标数据类别的训练用关键词组,所述预设过滤规则包括基于正则表达式规则去除预设数据类别的文本数据;The filtering module 462 is configured to filter the text data for training according to preset filtering rules to obtain the training keywords of the target data category. The preset filtering rules include removing text of the preset data category based on regular expression rules. data;
训练模块463,用于将所述目标数据类别的训练用关键词组输入预设语言模型进行训练,得到训练好的预设语言模型。The training module 463 is used to input the training keywords of the target data category into the preset language model for training, and obtain the trained preset language model.
进一步地,在本实施例一种可能的实现方式中,所述装置还包括监测单元47,所述监测单元47包括:Further, in a possible implementation of this embodiment, the device further includes a monitoring unit 47, and the monitoring unit 47 includes:
判断模块471,用于在将所述关键词组输入预设语言模型,得到所述关键词组对应的目标测试数据之后,读取所述测试数据生成规则中的定时发送信息,判断是否定时发送所述目标测试数据;The judgment module 471 is used to input the keyword group into the preset language model and obtain the target test data corresponding to the keyword group, read the timed sending information in the test data generation rule, and judge whether to send the timed message. target test data;
发送模块472,用于在确定定时发送所述目标测试数据的情况下,当满足定时发送条件时,根据所述关键词参数的数据类别将所述目标测试数据分别发送至对应数据类别的目标数据库;Sending module 472, configured to send the target test data to the target database of the corresponding data category according to the data category of the keyword parameter when the timing sending conditions are met when it is determined to send the target test data at a scheduled time. ;
第一监测模块473,用于若监测到所述目标测试数据的发送数量与所述目标数据库的接收数量一致,则完成所述目标测试数据的传输;The first monitoring module 473 is configured to complete the transmission of the target test data if it is monitored that the number of sent target test data is consistent with the received number of the target database;
第二监测模块474,用于若监测到所述目标数据库接收到的目标测试数据的数量与目标数量不一致,则确定所述目标数据传输异常。The second monitoring module 474 is configured to determine that the target data transmission is abnormal if it is detected that the number of target test data received by the target database is inconsistent with the target number.
本公开提供的测试数据的生成装置,响应于测试数据的生成指令,基于所述生成指令中的规则配置文件获取测试数据生成规则,所述测试数据生成规则包括测试数据的目标数量及参数权重列表,所述参数权重列表包括不同数据类别的关键词参数列表及对应的权重列表;基于所述测试数据生成规则,分别根据不同数据类别的关键词参数列表及对应的权重列表生成对应的关键词组;将所述关键词组输入训练好的预设语言模型,得到所述关键词组对应的目标测试数据。本公开提供的测试数据的生成方法,通过编写测试数据生成规则对不同数据类别的关键词参数加权,并根据测试数据生成规则实现对测试数据的构造,使得生成的测试数据更加符合生产数据的分布特性,在满足了测试数据多样性的同时也保证了测试数据的随机性;并基于训练好的预设语言模型根据关键词组生成目标测试数据,满足测试过程中需要大量测试数据的需求。The test data generation device provided by the present disclosure responds to the test data generation instruction and obtains the test data generation rules based on the rule configuration file in the generation instruction. The test data generation rules include the target number of test data and the parameter weight list. , the parameter weight list includes keyword parameter lists of different data categories and corresponding weight lists; based on the test data generation rules, corresponding keyword groups are generated according to keyword parameter lists of different data categories and corresponding weight lists; Input the keyword group into the trained preset language model to obtain target test data corresponding to the keyword group. The test data generation method provided by this disclosure weights keyword parameters of different data categories by writing test data generation rules, and implements the construction of test data according to the test data generation rules, so that the generated test data is more consistent with the distribution of production data. It not only meets the diversity of test data but also ensures the randomness of test data; and generates target test data based on keyword groups based on the trained preset language model to meet the need for a large amount of test data during the test process.
需要说明的是,前述对方法实施例的解释说明,也适用于本实施例的装置,原理相同,本实施例中不再限定。It should be noted that the foregoing explanation of the method embodiment also applies to the device of this embodiment. The principles are the same and are no longer limited in this embodiment.
根据本公开的实施例,本公开还提供了一种电子设备、一种可读存储介质和一种计算机程序产品。According to embodiments of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium, and a computer program product.
图7示出了可以用来实施本公开的实施例的示例电子设备500的示意性框图。电子设备旨在表示各种形式的数字计算机,诸如,膝上型计算机、台式计算机、工作台、个人数字助理、服务器、刀片式服务器、大型计算机、和其它适合的计算机。电子设备还可以表示各种形式的移动装置,诸如,个人数字处理、蜂窝电话、智能电话、可穿戴设备和其它类似的计算装置。本文所示的部件、它们的连接和关系、以及它们的功能仅仅作为示例,并且不意在限制本文中描述的和/或者要求的本公开的实现。7 illustrates a schematic block diagram of an example electronic device 500 that may be used to implement embodiments of the present disclosure. Electronic devices are intended to refer to various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. Electronic devices may also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are examples only and are not intended to limit implementations of the disclosure described and/or claimed herein.
如图7所示,设备500包括计算单元501,其可以根据存储在ROM(Read-OnlyMemory,只读存储器)502中的计算机程序或者从存储单元508加载到RAM(Random AccessMemory,随机访问/存取存储器)503中的计算机程序,来执行各种适当的动作和处理。在RAM503中,还可存储设备500操作所需的各种程序和数据。计算单元501、ROM 502以及RAM 503通过总线504彼此相连。I/O(Input/Output,输入/输出)接口505也连接至总线504。As shown in Figure 7, the device 500 includes a computing unit 501, which can be loaded into a RAM (Random Access Memory) according to a computer program stored in a ROM (Read-Only Memory) 502 or from a storage unit 508. The computer program in the memory) 503 to perform various appropriate actions and processes. In the RAM 503, various programs and data required for the operation of the device 500 can also be stored. Computing unit 501, ROM 502 and RAM 503 are connected to each other via bus 504. An I/O (Input/Output, input/output) interface 505 is also connected to the bus 504.
设备500中的多个部件连接至I/O接口505,包括:输入单元506,例如键盘、鼠标等;输出单元507,例如各种类型的显示器、扬声器等;存储单元508,例如磁盘、光盘等;以及通信单元509,例如网卡、调制解调器、无线通信收发机等。通信单元509允许设备500通过诸如因特网的计算机网络和/或各种电信网络与其他设备交换信息/数据。Multiple components in the device 500 are connected to the I/O interface 505, including: input unit 506, such as a keyboard, mouse, etc.; output unit 507, such as various types of displays, speakers, etc.; storage unit 508, such as a magnetic disk, optical disk, etc. ; and communication unit 509, such as a network card, modem, wireless communication transceiver, etc. The communication unit 509 allows the device 500 to exchange information/data with other devices through computer networks such as the Internet and/or various telecommunications networks.
计算单元501可以是各种具有处理和计算能力的通用和/或专用处理组件。计算单元501的一些示例包括但不限于CPU(Central Processing Unit,中央处理单元)、GPU(Graphic Processing Units,图形处理单元)、各种专用的AI(Artificial Intelligence,人工智能)计算芯片、各种运行机器学习模型算法的计算单元、DSP(DigitalSignal Processor,数字信号处理器)、以及任何适当的处理器、控制器、微控制器等。计算单元501执行上文所描述的各个方法和处理,例如测试数据的生成方法。例如,在一些实施例中,测试数据的生成方法可被实现为计算机软件程序,其被有形地包含于机器可读介质,例如存储单元508。在一些实施例中,计算机程序的部分或者全部可以经由ROM 502和/或通信单元509而被载入和/或安装到设备500上。当计算机程序加载到RAM 503并由计算单元501执行时,可以执行上文描述的方法的一个或多个步骤。备选地,在其他实施例中,计算单元501可以通过其他任何适当的方式(例如,借助于固件)而被配置为执行前述测试数据的生成方法。Computing unit 501 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of the computing unit 501 include but are not limited to CPU (Central Processing Unit, Central Processing Unit), GPU (Graphic Processing Units, Graphics Processing Units), various dedicated AI (Artificial Intelligence, artificial intelligence) computing chips, various running The computing unit of the machine learning model algorithm, DSP (Digital Signal Processor, digital signal processor), and any appropriate processor, controller, microcontroller, etc. The computing unit 501 performs various methods and processes described above, such as the test data generation method. For example, in some embodiments, the test data generating method may be implemented as a computer software program that is tangibly embodied in a machine-readable medium, such as the storage unit 508 . In some embodiments, part or all of the computer program may be loaded and/or installed onto device 500 via ROM 502 and/or communication unit 509 . When the computer program is loaded into RAM 503 and executed by computing unit 501, one or more steps of the method described above may be performed. Alternatively, in other embodiments, the computing unit 501 may be configured to perform the aforementioned test data generation method in any other suitable manner (eg, by means of firmware).
本文中以上描述的系统和技术的各种实施方式可以在数字电子电路系统、集成电路系统、FPGA(Field Programmable Gate Array,现场可编程门阵列)、ASIC(Application-Specific Integrated Circuit,专用集成电路)、ASSP(Appl ication SpecificStandard Product,专用标准产品)、SOC(System On Chip,芯片上系统的系统)、CPLD(Complex Programmable Logic Device,复杂可编程逻辑设备)、计算机硬件、固件、软件、和/或它们的组合中实现。这些各种实施方式可以包括:实施在一个或者多个计算机程序中,该一个或者多个计算机程序可在包括至少一个可编程处理器的可编程系统上执行和/或解释,该可编程处理器可以是专用或者通用可编程处理器,可以从存储系统、至少一个输入装置、和至少一个输出装置接收数据和指令,并且将数据和指令传输至该存储系统、该至少一个输入装置、和该至少一个输出装置。Various implementations of the systems and technologies described above in this article can be implemented in digital electronic circuit systems, integrated circuit systems, FPGA (Field Programmable Gate Array, field programmable gate array), ASIC (Application-Specific Integrated Circuit, application-specific integrated circuit) , ASSP (Application Specific Standard Product, dedicated standard product), SOC (System On Chip, system on chip), CPLD (Complex Programmable Logic Device, complex programmable logic device), computer hardware, firmware, software, and/or implemented in their combination. These various embodiments may include implementation in one or more computer programs executable and/or interpreted on a programmable system including at least one programmable processor, the programmable processor The processor, which may be a special purpose or general purpose programmable processor, may receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device. An output device.
用于实施本公开的方法的程序代码可以采用一个或多个编程语言的任何组合来编写。这些程序代码可以提供给通用计算机、专用计算机或其他可编程数据处理装置的处理器或控制器,使得程序代码当由处理器或控制器执行时使流程图和/或框图中所规定的功能/操作被实施。程序代码可以完全在机器上执行、部分地在机器上执行,作为独立软件包部分地在机器上执行且部分地在远程机器上执行或完全在远程机器或服务器上执行。Program code for implementing the methods of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing device, such that the program codes, when executed by the processor or controller, cause the functions specified in the flowcharts and/or block diagrams/ The operation is implemented. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
在本公开的上下文中,机器可读介质可以是有形的介质,其可以包含或存储以供指令执行系统、装置或设备使用或与指令执行系统、装置或设备结合地使用的程序。机器可读介质可以是机器可读信号介质或机器可读储存介质。机器可读介质可以包括但不限于电子的、磁性的、光学的、电磁的、红外的、或半导体系统、装置或设备,或者上述内容的任何合适组合。机器可读存储介质的更具体示例会包括基于一个或多个线的电气连接、便携式计算机盘、硬盘、RAM、ROM、EPROM(Electrically Programmable Read-Only-Memory,可擦除可编程只读存储器)或快闪存储器、光纤、CD-ROM(Compact Di sc Read-Only Memory,便捷式紧凑盘只读存储器)、光学储存设备、磁储存设备、或上述内容的任何合适组合。In the context of this disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. Machine-readable media may include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media would include electrical connections based on one or more wires, laptop disks, hard disks, RAM, ROM, EPROM (Electrically Programmable Read-Only-Memory, erasable programmable read-only memory) Or flash memory, optical fiber, CD-ROM (Compact Disc Read-Only Memory, portable compact disk read-only memory), optical storage device, magnetic storage device, or any suitable combination of the above.
为了提供与用户的交互,可以在计算机上实施此处描述的系统和技术,该计算机具有:用于向用户显示信息的显示装置(例如,CRT(Cathode-Ray Tube,阴极射线管)或者LCD(Liquid Crystal Display,液晶显示器)监视器);以及键盘和指向装置(例如,鼠标或者轨迹球),用户可以通过该键盘和该指向装置来将输入提供给计算机。其它种类的装置还可以用于提供与用户的交互;例如,提供给用户的反馈可以是任何形式的传感反馈(例如,视觉反馈、听觉反馈、或者触觉反馈);并且可以用任何形式(包括声输入、语音输入或者、触觉输入)来接收来自用户的输入。To provide interaction with a user, the systems and techniques described herein may be implemented on a computer having a display device (eg, CRT (Cathode-Ray Tube, cathode ray tube) or LCD (Cathode-Ray Tube)) for displaying information to the user. Liquid Crystal Display (liquid crystal display) monitor); and a keyboard and pointing device (eg, a mouse or a trackball) through which a user can provide input to the computer. Other kinds of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and may be provided in any form, including Acoustic input, voice input or tactile input) to receive input from the user.
可以将此处描述的系统和技术实施在包括后台部件的计算系统(例如,作为数据服务器)、或者包括中间件部件的计算系统(例如,应用服务器)、或者包括前端部件的计算系统(例如,具有图形用户界面或者网络浏览器的用户计算机,用户可以通过该图形用户界面或者该网络浏览器来与此处描述的系统和技术的实施方式交互)、或者包括这种后台部件、中间件部件、或者前端部件的任何组合的计算系统中。可以通过任何形式或者介质的数字数据通信(例如,通信网络)来将系统的部件相互连接。通信网络的示例包括:LAN(LocalArea Network,局域网)、WAN(Wide Area Network,广域网)、互联网和区块链网络。The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., A user's computer having a graphical user interface or web browser through which the user can interact with implementations of the systems and technologies described herein), or including such backend components, middleware components, or any combination of front-end components in a computing system. The components of the system may be interconnected by any form or medium of digital data communication (eg, a communications network). Examples of communication networks include: LAN (Local Area Network), WAN (Wide Area Network), the Internet, and blockchain networks.
计算机系统可以包括客户端和服务器。客户端和服务器一般远离彼此并且通常通过通信网络进行交互。通过在相应的计算机上运行并且彼此具有客户端-服务器关系的计算机程序来产生客户端和服务器的关系。服务器可以是云服务器,又称为云计算服务器或云主机,是云计算服务体系中的一项主机产品,以解决了传统物理主机与VPS服务("Virtual Private Server",或简称"VPS")中,存在的管理难度大,业务扩展性弱的缺陷。服务器也可以为分布式系统的服务器,或者是结合了区块链的服务器。Computer systems may include clients and servers. Clients and servers are generally remote from each other and typically interact over a communications network. The relationship of client and server is created by computer programs running on corresponding computers and having a client-server relationship with each other. The server can be a cloud server, also known as cloud computing server or cloud host. It is a host product in the cloud computing service system to solve the problem of traditional physical host and VPS service ("Virtual Private Server", or "VPS" for short) Among them, there are defects such as difficult management and weak business scalability. The server can also be a distributed system server or a server combined with a blockchain.
其中,需要说明的是,人工智能是研究使计算机来模拟人的某些思维过程和智能行为(如学习、推理、思考、规划等)的学科,既有硬件层面的技术也有软件层面的技术。人工智能硬件技术一般包括如传感器、专用人工智能芯片、云计算、分布式存储、大数据处理等技术;人工智能软件技术主要包括计算机视觉技术、语音识别技术、自然语言处理技术以及机器学习/深度学习、大数据处理技术、知识图谱技术等几大方向。Among them, it should be noted that artificial intelligence is the study of using computers to simulate certain human thinking processes and intelligent behaviors (such as learning, reasoning, thinking, planning, etc.). It has both hardware-level technology and software-level technology. Artificial intelligence hardware technology generally includes technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing, etc.; artificial intelligence software technology mainly includes computer vision technology, speech recognition technology, natural language processing technology, and machine learning/depth Learning, big data processing technology, knowledge graph technology and other major directions.
应该理解,可以使用上面所示的各种形式的流程,重新排序、增加或删除步骤。例如,本公开中记载的各步骤可以并行地执行也可以顺序地执行也可以不同的次序执行,只要能够实现本公开公开的技术方案所期望的结果,本文在此不进行限制。It should be understood that various forms of the process shown above may be used, with steps reordered, added or deleted. For example, each step described in the present disclosure can be executed in parallel, sequentially, or in a different order. As long as the desired results of the technical solutions disclosed in the present disclosure can be achieved, there is no limitation here.
上述具体实施方式,并不构成对本公开保护范围的限制。本领域技术人员应该明白的是,根据设计要求和其他因素,可以进行各种修改、组合、子组合和替代。任何在本公开的精神和原则之内所作的修改、等同替换和改进等,均应包含在本公开保护范围之内。The above-mentioned specific embodiments do not constitute a limitation on the scope of the present disclosure. It will be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions are possible depending on design requirements and other factors. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of this disclosure shall be included in the protection scope of this disclosure.
Claims (10)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202311595541.9A CN117573543A (en) | 2023-11-27 | 2023-11-27 | Test data generation method and device, electronic equipment and storage medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202311595541.9A CN117573543A (en) | 2023-11-27 | 2023-11-27 | Test data generation method and device, electronic equipment and storage medium |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN117573543A true CN117573543A (en) | 2024-02-20 |
Family
ID=89895230
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202311595541.9A Pending CN117573543A (en) | 2023-11-27 | 2023-11-27 | Test data generation method and device, electronic equipment and storage medium |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN117573543A (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN119097290A (en) * | 2024-11-01 | 2024-12-10 | 纳龙健康科技股份有限公司 | A method, device and medium for generating test data of a multi-parameter monitor system |
-
2023
- 2023-11-27 CN CN202311595541.9A patent/CN117573543A/en active Pending
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN119097290A (en) * | 2024-11-01 | 2024-12-10 | 纳龙健康科技股份有限公司 | A method, device and medium for generating test data of a multi-parameter monitor system |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN107688533B (en) | Application testing method, apparatus, computer equipment and storage medium | |
| CN112860995B (en) | Interaction method, device, client, server and storage medium | |
| CN114881129A (en) | Model training method and device, electronic equipment and storage medium | |
| CN115292467B (en) | Information processing and model training methods, devices, equipment, media and program products | |
| CN111597336A (en) | Processing method and device of training text, electronic equipment and readable storage medium | |
| CN113297371A (en) | Method, device and equipment for generating recommended question library and storage medium | |
| WO2021135322A1 (en) | Automatic question setting method, apparatus and system | |
| CN113835987B (en) | Chaos experiment execution file generation method, device, electronic device and storage medium | |
| CN114942979A (en) | Short text problem matching method and device | |
| CN117573543A (en) | Test data generation method and device, electronic equipment and storage medium | |
| CN117421403A (en) | Intelligent conversation method, device and electronic equipment | |
| CN115222444B (en) | Methods, apparatus, devices, media, and products for outputting model information. | |
| CN113360602B (en) | Method, device, equipment and storage medium for outputting information | |
| CN120763419A (en) | Website cluster detection method, device and electronic equipment | |
| CN115641284A (en) | Data enhancement method, model training method, image processing method and device | |
| CN113391989A (en) | Program evaluation method, device, equipment, medium and program product | |
| CN118297162A (en) | Question and answer method, device, electronic device and storage medium | |
| CN116244740B (en) | Log desensitization method and device, electronic equipment and storage medium | |
| CN117668908A (en) | Data desensitizing method, device, electronic equipment and storage medium | |
| CN116774673A (en) | Data calibration method and device, electronic equipment and storage medium | |
| CN116954570A (en) | Method, device, equipment and storage medium for generating analog data | |
| CN117421400A (en) | Dialogue interaction method, device and electronic device | |
| CN115934987A (en) | Sample text generation method, device and electronic equipment | |
| CN114141236A (en) | Language model updating method and device, electronic equipment and storage medium | |
| CN112817463A (en) | Method, equipment and storage medium for acquiring audio data by input method |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination |