Test data generation method, device, equipment and medium
By determining the mapping relationship between simulated data and feature data in software testing, and generating test data corresponding to the preset production environment, the problems of high software testing costs and limited application environment in the prior art are solved, and cost reduction and multi-environmental application of test data are achieved.
Patent Information
- Application Number
- CN202210645073.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-08
- Publication Date
- 2025-04-18
- Estimated Expiration
- 2042-06-08
AI Technical Summary
The existing technology requires a large number of R&D and on-site development of testers in software testing, resulting in high R&D costs. At the same time, the generated test data requires strict confidentiality of the production environment, limiting the application environment of the test data.
By determining the mapping relationship between the simulation data and the feature data, obtaining configuration data, obtaining feature construction rules from the feature database based on the parsed configuration data, and generating test data corresponding to the preset production environment.
Reduces the cost of deploying test environments, can generate test data suitable for multiple test environments, reduces dependence on production environments, and reduces software R&D costs.
Smart Images

Figure CN114896167B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computers, and more specifically to a method, apparatus, device, medium and program product for generating test data. Background Art
[0002] For software testing, it is necessary to generate test data that matches the software for testing. In related technologies, test data is generated based on the running log of the software to be tested in the production environment. The generated test data needs to be implemented in the production environment, which requires a large number of R&D personnel and testers to carry out on-site development, increasing the cost of software development. In addition, since the collected operation logs are directly generated based on the actual terminal equipment, it not only has strict requirements on the production environment, but also has strict requirements on the confidentiality of the running data in the production environment, which further limits the application environment of the test data and increases the cost of software development. Summary of the invention
[0003] In view of the above problems, the present disclosure provides a method, apparatus, device, medium and program product for generating test data.
[0004] According to a first aspect of the present disclosure, a method for generating test data is provided, comprising: determining a mapping relationship between simulation data and feature data to obtain configuration data, wherein the simulation data includes simulation data for data generated by a target user in a preset production environment, and the feature data includes definition data for limiting the simulation data; in response to a received generation request for generating test data, determining parsed configuration data; based on the parsed configuration data, acquiring a feature construction rule corresponding to the feature data from a feature database; based on the feature construction rule and the parsed configuration data, determining construction data; and generating test data corresponding to the preset production environment according to the construction data.
[0005] According to an embodiment of the present disclosure, determining the mapping relationship between simulation data and feature data to obtain configuration data includes: acquiring simulation data; analyzing the acquired simulation data to determine feature dimensions of the simulation data, the feature dimensions including at least one of the following: data format, transmission mode, and transmission quantity; and determining the mapping relationship between the feature dimensions and the feature data to obtain configuration data.
[0006] According to an embodiment of the present disclosure, obtaining simulation data includes: obtaining operation logs of various terminal devices collected by a security operation center, the various terminal devices including various production environments, and the various terminal devices including network devices, mobile terminals and servers in various production environments; and determining simulation data corresponding to the operation logs based on the operation logs.
[0007] According to an embodiment of the present disclosure, generating test data corresponding to a preset production environment based on construction data includes: receiving construction data in response to a received request for collecting test data; parsing the construction data by field to determine the parsed construction data; and generating test data corresponding to the preset production environment based on the data format of the preset production environment.
[0008] According to an embodiment of the present disclosure, in response to a received generation request for collecting construction data, determining the parsed configuration data includes: in response to a received generation request for generating test data, parsing the data format and field characteristic information of the configuration data to obtain the parsed configuration data.
[0009] According to an embodiment of the present disclosure, the parsed configuration data includes identification data of the data to be constructed, and based on the parsed configuration data, obtaining feature construction rules corresponding to the feature data from a feature database includes: determining and obtaining feature construction rules corresponding to the feature data from the feature database based on the identification data of the data to be constructed.
[0010] A second aspect of the present disclosure provides a test data generation device, including: a first determination module, used to determine a mapping relationship between simulation data and feature data to obtain configuration data, wherein the simulation data includes simulation data for data generated by a target user in a preset production environment, and the feature data includes definition data for limiting the simulation data; a second determination module, used to determine parsed configuration data in response to a received generation request for generating test data; an acquisition module, used to acquire feature construction rules corresponding to the feature data from a feature database based on the parsed configuration data; a third determination module, used to determine construction data based on the feature construction rules and the parsed configuration data; and a fourth determination module, used to generate test data corresponding to the preset production environment according to the construction data.
[0011] A third aspect of the present disclosure provides an electronic device, comprising: one or more processors; and a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors execute the above-mentioned test data generation method.
[0012] A fourth aspect of the present disclosure further provides a computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, causes the processor to execute the above-mentioned test data generation method.
[0013] The fifth aspect of the present disclosure also provides a computer program product, including a computer program, which implements the above-mentioned test data generation method when executed by a processor. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] The above contents and other objects, features and advantages of the present disclosure will become more apparent through the following description of the embodiments of the present disclosure with reference to the accompanying drawings, in which:
[0015] Figure 1 A diagram schematically illustrates an application scenario of a method for generating test data according to an embodiment of the present disclosure;
[0016] Figure 2 A flowchart schematically shows a method for generating test data according to an embodiment of the present disclosure;
[0017] Figure 3 A flowchart of a method for obtaining configuration data according to an embodiment of the present disclosure is schematically shown;
[0018] Figure 4 The network architecture of the method for generating test data according to an embodiment of the present disclosure is schematically shown;
[0019] Figure 5 A schematic diagram showing a structural block diagram of a device for determining test data generation according to an embodiment of the present disclosure; and
[0020] Figure 6 A block diagram of an electronic device suitable for determining a method for generating test data according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION
[0021] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present disclosure. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present disclosure.
[0022] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The terms "comprise", "include", etc. used herein indicate the existence of the features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.
[0023] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification and should not be interpreted in an idealized or overly rigid manner.
[0024] When using expressions such as "at least one of A, B, and C, etc.", they should generally be interpreted according to the meaning of the expression commonly understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).
[0025] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision, disclosure and application of user personal information involved comply with the provisions of relevant laws and regulations, take necessary confidentiality measures, and do not violate public order and good morals.
[0026] In the technical solution of the present disclosure, the user's authorization or consent is obtained before obtaining or collecting the user's personal information.
[0027] An embodiment of the present disclosure provides a method for generating test data, including: determining a mapping relationship between simulation data and feature data to obtain configuration data, wherein the simulation data includes simulation data for data generated by a target user in a preset production environment, and the feature data includes definition data for limiting the simulation data; in response to a received generation request for generating test data, determining parsed configuration data; based on the parsed configuration data, acquiring a feature construction rule corresponding to the feature data from a feature database; based on the feature construction rule and the parsed configuration data, determining construction data; and generating test data corresponding to the preset production environment according to the construction data.
[0028] Figure 1 The application scenario diagram of the test data generation method according to the embodiment of the present disclosure is schematically shown.
[0029] like Figure 1 As shown, the application scenario 100 according to this embodiment may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is used to provide a medium for a communication link between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0030] The user can use the terminal devices 101, 102, 103 to interact with the server 105 through the network 104 to receive or send messages, etc. Various communication client applications can be installed on the terminal devices 101, 102, 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only as examples). Various applications can be the applications to be tested.
[0031] The terminal devices 101 , 102 , and 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers.
[0032] The server 105 may be a server that provides various services, such as a background management server (only as an example) that provides support for websites browsed by users using the terminal devices 101, 102, and 103. The background management server may analyze and process the received data such as user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal device.
[0033] It should be noted that the test data generation method provided in the embodiment of the present disclosure can generally be executed by the server 105. Accordingly, the test data generation device provided in the embodiment of the present disclosure can generally be set in the server 105. The test data generation method provided in the embodiment of the present disclosure can also be executed by a server or server cluster that is different from the server 105 and can communicate with the terminal devices 101, 102, 103 and / or the server 105. Accordingly, the test data generation device provided in the embodiment of the present disclosure can also be set in a server or server cluster that is different from the server 105 and can communicate with the terminal devices 101, 102, 103 and / or the server 105.
[0034] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0035] The following will be based on Figure 1 The scene described by Figure 2~Figure 4 The method for generating test data of the disclosed embodiment is described in detail.
[0036] Figure 2 The flowchart of the method for generating test data according to the embodiment of the present disclosure is schematically shown.
[0037] like Figure 2 As shown, the method includes operations S210 to S250.
[0038] In operation S210, a mapping relationship between simulation data and feature data is determined to obtain configuration data.
[0039] According to an embodiment of the present disclosure, simulation data includes simulation data for data generated by a target user in a preset production environment. Feature data includes definition data for defining simulation data, and data providing declarations for simulation data. Definition data includes data format and field type for defining simulation data, and declaration data is used to declare the transmission method, transmission network protocol, etc. of simulation data. The preset production environment is the data environment required by the application to be tested, including a preset production environment determined according to the actual production environment and a preset production environment determined according to pre-configured data.
[0040] For example, for asset applications, the production environment includes general time information, asset information, transaction information, etc. Time information can be expressed in multiple forms, such as a form that includes "year, month, and day" characters, or a form that only includes numbers. Asset applications include multiple forms such as domestic transactions and international transactions, and corresponding domestic and international transactions also have multiple forms of transaction information representation.
[0041] According to an embodiment of the present disclosure, after determining the mapping relationship between the simulation data and the feature data, the simulation data, the feature data, and the mapping relationship between the simulation data and the feature data are formed into configuration data. The obtained configuration data is stored in a database in the form of a file and can also be directly used for subsequent generation of construction data.
[0042] In operation S220 , in response to the received generation request for generating test data, parsed configuration data is determined.
[0043] According to an embodiment of the present disclosure, in response to a received generation request for generating test data, configuration data is acquired from a database or configuration data is received from a data production client, and the configuration data is parsed to obtain parsed configuration data.
[0044] According to an embodiment of the present disclosure, the parsing method may include a parsing rule based on Morphlines.
[0045] According to an embodiment of the present disclosure, in response to a received generation request for generating test data, the data format and field characteristic information of the configuration data are parsed to obtain the parsed configuration data.
[0046] In operation S230, based on the parsed configuration data, a feature construction rule corresponding to the feature data is acquired from a feature database.
[0047] According to an embodiment of the present disclosure, the parsed configuration data does not include a specific amount of data, but only includes identification information of a corresponding field in the simulation data. Based on the parsed configuration data, a feature construction rule corresponding to the feature data can be obtained from a feature database, so as to generate specific construction data using the feature construction rule.
[0048] According to the embodiments of the present disclosure, the feature construction rules include not only the specific generation method for generating the construction data, but also the data range for generating the construction data. For example, for the construction data including time information, the feature construction rules limit the time to "yyyy year MM month dd day", and also limit the "MM" before the "month" to meet 2 characters, and the first "M" is only 0 or 1, and the second "M" is a number from 0 to 9; the "yyyy" representing the year and the "dd" representing the day are also limited to numbers.
[0049] In operation S240 , construction data is determined based on the feature construction rule and the parsed configuration data.
[0050] According to an embodiment of the present disclosure, after obtaining the parsed configuration data and the feature construction rules, construction data satisfying the configuration data may be randomly generated according to the feature construction rules.
[0051] For example, still taking the construction data including time information as an example, multiple random values are generated according to the feature construction rule of "yyyy-MM-dd-dd", and multiple construction data are obtained: "November 11, 2020", "January 30, 2021", and "February 28, 2022". When the configuration data includes multiple types of time information, although each type of time information corresponds to a feature construction rule, multiple construction data can be generated according to each type of feature construction rule.
[0052] In operation S250, test data corresponding to a preset production environment is generated according to the construction data.
[0053] According to an embodiment of the present disclosure, after the construction data is acquired, the construction data is parsed to generate test data corresponding to a preset production environment, and the generated test data is stored in a test database.
[0054] According to the embodiments of the present disclosure, since the test data produced is obtained based on the simulated data, the test data does not need to meet the requirements of the actual production environment for data confidentiality. In other words, the generated test data can be used not only for application testing in the preset production environment, but also for other application testing similar to the preset production environment, without considering the confidentiality requirements of the test data.
[0055] For example, for the preset production environment A, the time information is expressed in the form A "yyyy-MM-dd-day", and the test data A includes time information "January 30, 2021" and "February 28, 2022", and the data type is data in json format. Production environment B includes time information and asset information in the form of "yyyy-MM-dd-day". The application to be tested that conforms to the preset production environment can combine multiple data types according to the configuration data to obtain the complete test data of the preset production environment A, that is, the time information and data type. Test data A does not conform to production environment B, but the time information representation form A of test data A conforms to production environment B. Since the parsed test data includes multiple types, production environment B can use the time information generated according to the preset production environment A, combined with the asset information determined by other production environments, to obtain test data that conforms to production environment B.
[0056] The Security Operations Center (SOC) uses a centralized management method to uniformly manage related security products. The Security Operations Center can obtain security information of assets, and timely reflect the security status of managed assets through in-depth analysis, statistics and correlation of various security events collected.
[0057] In the business scenario of the security operation center, the relevant technology is to directly collect the actual production data of the application to be tested. The actual production data matches the data format of the application to be tested. Correspondingly, the generated test data must also follow the data format of the application to be tested, otherwise the generated test data cannot be used. This requires developers and testers to generate test data for the production environment to be tested and use the test data for testing. As a result, the test environment only corresponds to the production environment, which limits the generation of test data and increases the cost of software development.
[0058] The present disclosure generates simulation data corresponding to a preset production environment, and only needs to maintain the simulation data and the mapping relationship between the simulation data and the feature data. In the case of distinguishing between the production environment and the test environment, it can also generate test data that can be applied to multiple test environments, thereby reducing the cost of deploying the test environment. In addition, the present disclosure can quickly deploy the generated test data to multiple test environments, thereby reducing the software development cost from both production and testing.
[0059] Figure 3 The flowchart of the method for obtaining configuration data according to an embodiment of the present disclosure is schematically shown.
[0060] like Figure 3 As shown, the determining of feature dimensions and feature data in this embodiment includes operations S311 to S313, which can be used as a specific embodiment of operation S210.
[0061] In operation S311, simulation data is acquired.
[0062] In operation S312, the acquired simulation data is analyzed to determine the characteristic dimension of the simulation data.
[0063] In operation S313, a mapping relationship between feature dimensions and feature data is determined to obtain configuration data.
[0064] According to an embodiment of the present disclosure, after obtaining the simulation data, the simulation data is analyzed to determine multiple characteristic dimensions of the simulation data. There is a unique mapping relationship between the multiple characteristic dimensions and the definition data or declared data included in the characteristic data. After determining the mapping relationship between the characteristic dimensions and the characteristic data, the configuration data is obtained.
[0065] According to an embodiment of the present disclosure, feature dimensions may include: field format, data format, transmission mode, transmission quantity, parsing rules, transmission destination information, and transmission time. Correspondingly, feature data may include definition data or declared data for defining the data of the above feature dimensions. Specifically, the definition data may include field type definition, field format definition, field order definition, etc. for defining the data format. It may also include parsing rules such as Morphline rules for defining simulation data; defining transmission destination information such as user IP, network port, etc. The declared data may include defined transmission protocols such as TCP, UDP, Avro, SNMP, and FTP.
[0066] According to an embodiment of the present disclosure, since the configuration data also includes data that limits the transmission time and the transmission quantity, the data production client can support multiple transmission times, multiple transmission quantities, and multi-threaded requests to generate test data.
[0067] Specifically, by setting the scan time field, the scan quantity field, and the scan thread field, it supports timing, fixed frequency, and multi-threaded initiation of requests to generate test data.
[0068] According to an embodiment of the present disclosure, operation logs of various terminal devices collected by a security operation center are obtained, and simulation data corresponding to the operation logs is determined based on the operation logs. The various terminal devices include various production environments, and the various terminal devices include network devices, mobile terminals, and servers in various production environments.
[0069] Specifically, for the application scenario of the security operation center, the operation logs of various terminal devices can be obtained through open source products such as Flume and Elk, and then simulation data corresponding to the operation logs can be generated, such as simulation logs. The storage form of the simulation log includes files in XML format.
[0070] According to the embodiment of the present disclosure, after the simulation data of the security operation center is determined, the configuration data can be obtained according to the mapping relationship between the simulation data and the feature data, and then the construction data and the test data are generated. For example, if the configuration data includes a time field, the feature construction rules about time can be obtained from the feature database. TIME1 represents the first time feature construction rule, and the corresponding format is "yyyy-MM-dd hh:mm:ss", which means yyyy year MM month dd day, hh hour mm minute ss second; similarly, TIME2 represents the second time feature construction rule, and the corresponding format is "yyyy / MM / dd hh:mm:ss"; TIME3 represents the third time feature construction rule, and the corresponding format is "yyyy-MM-dd'T'hh:mm:ss", where "T" represents the separation between "hh:mm:ss" and "yyyy-MM-dd" on the day; TIME4 represents the fourth time feature construction rule, and the corresponding format is "yyyy year MM month dd day"; TIME5 represents the fifth time feature construction rule, and the corresponding format is "MMM dd yyyy hh:mm:ss", and so on.
[0071] The characteristic construction rule of the source IP field (SIP) includes an IPV4 or IPV6 format; the characteristic construction rule of the source port (SPORT) can be obtained from the SPORT table of the characteristic database.
[0072] According to an embodiment of the present disclosure, after generating the construction data, the data collection service may receive the construction data from the data production service in response to the received request for collecting the construction data, and then parse it according to the defined fields. After parsing the construction data, based on the data form of the preset production environment, generate test data corresponding to the preset production environment. For example, generate test data according to the field order defined by the preset production environment.
[0073] According to an embodiment of the present disclosure, parsing construction data can be similar to parsing configuration data, and parsing can be performed using Morphlines rules. For example, the generated construction data "time= 2022-03-31 11:22:15 mail=zhangsan@aaa.bb.cc login=success", the parsing rules include key-value, and the parsing process is to remove other characters such as spaces and question marks. The data parsed according to the parsing rules are "time" and "2022-03-31 11:22:15", "mail" and "mail=zhangsan@aaa.bb.cc", "login" and "success". It can also include spilt parsing rules to remove special characters, such as "|".
[0074] According to an embodiment of the present disclosure, the constructed data can also be parsed according to the data type to generate test data differentiated by type. For example, the generated test data includes: specific test data of time type, specific test data of transaction type, etc. The parsed data is "time=2022-03-31 11:22:15", "mail=zhangsan@aaa.bb.cc", "login=success".
[0075] According to an embodiment of the present disclosure, the parsed configuration data also includes identification data of the data to be constructed. According to the identification data of the data to be constructed, a feature construction rule corresponding to the feature data can be determined from the data feature library. There is a unique mapping relationship between the feature construction rule and the identification data. For example, for configuration data including address information, the identification data corresponding to the address information in the parsed configuration data is "MAC1", indicating that the specific feature construction rule of "MAC1" is obtained from the feature database.
[0076] Figure 4 The network architecture of the method for generating test data according to an embodiment of the present disclosure is schematically shown.
[0077] like Figure 4 As shown, the network architecture 400 includes a data production client 410 , a data production service 420 , a data collection service 430 , a database 440 , feature data 441 , a feature database 450 , and a test database 460 .
[0078] According to an embodiment of the present disclosure, a user can generate configuration data by operating the production client 410, and generate a generation request for generating test data. Specifically, the user can click an operation button on the display interface of the data production client 410. In response to the user's operation, the data production client 410 obtains pre-configured feature data 441 from the database 440, and then determines the mapping relationship between the simulation data and the feature data 441 to generate configuration data. In response to the received generation request for generating test data, the data production service 420 obtains configuration data from the data production client 410, and then parses the configuration data, extracts feature construction rules from the feature database 450, and generates construction data. In response to the received request for collecting construction data, the data collection service 430 collects construction data from the data production service 420. After parsing the construction data, test data is generated, and the generated test data is entered into the test database 460 for persistent storage. When the tester starts to verify the test data, he only needs to obtain the test data from the test database to perform the test.
[0079] According to an embodiment of the present disclosure, the data collection service 430 may transfer the received construction data into Kafka.
[0080] According to an embodiment of the present disclosure, the feature data 441 stored in the database 440 can be defined by preprocessing. Specifically, when a certain type of data needs to be simulated, the developer generates feature data by analyzing the data feature map of the data type in the production environment and the corresponding data format sequence through a computer. Feature data can also be generated by combining the features of various types of data already in the feature database. Figure 5 The structure block diagram of a device for determining test data generation according to an embodiment of the present disclosure is schematically shown.
[0081] like Figure 5 As shown, the device 500 for determining test data generation in this embodiment includes a first determining module 510 , a second determining module 520 , an acquiring module 530 , a third determining module 540 and a fourth determining module 550 .
[0082] The first determination module 510 is used to determine the mapping relationship between the simulation data and the feature data to obtain the configuration data, wherein the simulation data includes simulation data for the data generated by the target user in the preset production environment, and the feature data includes definition data for limiting the simulation data. In one embodiment, the first determination module 510 can be used to perform the operation S210 described above, which will not be repeated here.
[0083] The second determination module 520 is used to determine the parsed configuration data in response to the received generation request for generating test data. In one embodiment, the second determination module 520 can be used to perform the operation S220 described above, which will not be described in detail here.
[0084] The acquisition module 530 is used to acquire the feature construction rules corresponding to the feature data from the feature database based on the parsed configuration data. In one embodiment, the acquisition module 530 can be used to perform the operation S230 described above, which will not be described in detail here.
[0085] The third determination module 540 is used to determine the construction data based on the feature construction rule and the parsed configuration data. In one embodiment, the third determination module 540 can be used to perform the operation S240 described above, which will not be described in detail here.
[0086] The fourth determination module 550 is used to generate test data corresponding to the preset production environment according to the construction data. In one embodiment, the fourth determination module 550 can be used to perform the operation S250 described above, which will not be described in detail here.
[0087] According to an embodiment of the present disclosure, the first determining module 510 includes an acquiring unit, a first determining unit, and a second determining unit.
[0088] The acquisition unit acquires the simulation data. In one embodiment, the acquisition unit may be used to perform the operation S311 described above, which will not be described in detail herein.
[0089] The first determination unit analyzes the acquired simulation data to determine the characteristic dimension of the simulation data, where the characteristic dimension includes at least one of the following: data format, transmission mode, and transmission quantity. In one embodiment, the first determination unit may be used to perform the operation S312 described above, which will not be described in detail herein.
[0090] The second determination unit is used to determine the mapping relationship between the feature dimension and the feature data to obtain the configuration data. In one embodiment, the second determination unit can be used to perform the operation S313 described above, which will not be described in detail here.
[0091] Figure 6 A block diagram of an electronic device suitable for determining a method for generating test data according to an embodiment of the present disclosure is schematically shown.
[0092] like Figure 6 As shown, the electronic device 600 according to an embodiment of the present disclosure includes a processor 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage part 608 to a random access memory (RAM) 603. The processor 601 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or a related chipset and / or a dedicated microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 601 may also include an onboard memory for caching purposes. The processor 601 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.
[0093] In RAM 603, various programs and data required for the operation of electronic device 600 are stored. Processor 601, ROM 602 and RAM 603 are connected to each other via bus 604. Processor 601 performs various operations of the method flow according to the embodiment of the present disclosure by executing the program in ROM 602 and / or RAM 603. It should be noted that the program can also be stored in one or more memories other than ROM 602 and RAM 603. Processor 601 can also perform various operations of the method flow according to the embodiment of the present disclosure by executing the program stored in the one or more memories.
[0094] According to an embodiment of the present disclosure, the electronic device 600 may further include an input / output (I / O) interface 605, which is also connected to the bus 604. The electronic device 600 may further include one or more of the following components connected to the I / O interface 605: an input portion 606 including a keyboard, a mouse, etc.; an output portion 607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage portion 608 including a hard disk, etc.; and a communication portion 609 including a network interface card such as a LAN card, a modem, etc. The communication portion 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as needed, so that a computer program read therefrom is installed into the storage portion 608 as needed.
[0095] The present disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present disclosure is implemented.
[0096] According to an embodiment of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, for example, it may include but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, an apparatus or a device. For example, according to an embodiment of the present disclosure, the computer-readable storage medium may include the ROM 602 and / or RAM 603 described above and / or one or more memories other than ROM 602 and RAM 603.
[0097] The embodiment of the present disclosure also includes a computer program product, which includes a computer program, and the computer program contains program code for executing the method shown in the flowchart. When the computer program product is run in a computer system, the program code is used to enable the computer system to implement the test data generation method provided by the embodiment of the present disclosure.
[0098] The above functions defined in the system / device of the embodiment of the present disclosure are performed when the computer program is executed by the processor 601. According to the embodiment of the present disclosure, the system, device, module, unit, etc. described above can be implemented by a computer program module.
[0099] In one embodiment, the computer program may rely on tangible storage media such as optical storage devices, magnetic storage devices, etc. In another embodiment, the computer program may also be transmitted and distributed in the form of signals on a network medium, and downloaded and installed through the communication part 609, and / or installed from a removable medium 611. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0100] In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 609, and / or installed from the removable medium 611. When the computer program is executed by the processor 601, the above functions defined in the system of the embodiment of the present disclosure are performed. According to the embodiment of the present disclosure, the system, device, apparatus, module, unit, etc. described above can be implemented by a computer program module.
[0101] According to an embodiment of the present disclosure, the program code for executing the computer program provided by the embodiment of the present disclosure can be written in any combination of one or more programming languages. Specifically, these computing programs can be implemented using high-level process and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, Java, C++, python, "C" language or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on the remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, using an Internet service provider to connect through the Internet).
[0102] The flow charts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0103] It will be appreciated by those skilled in the art that the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways, even if such combinations and / or combinations are not explicitly described in the present disclosure. In particular, the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways without departing from the spirit and teachings of the present disclosure. All of these combinations and / or combinations fall within the scope of the present disclosure.
[0104] The specific embodiments described above further illustrate the purpose, technical solutions and beneficial effects of the present disclosure. It should be understood that the above description is only a specific embodiment of the present disclosure and is not intended to limit the present disclosure. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present disclosure should be included in the protection scope of the present disclosure.
Claims
1. A method for generating test data, comprising: Determine a mapping relationship between simulation data and feature data to obtain configuration data, wherein the simulation data includes simulation data for data generated by a target user in a preset production environment, and the feature data includes definition data for defining the simulation data, wherein the definition data includes a data format and a field type for defining the simulation data; In response to the received generation request for generating test data, determining the parsed configuration data; Based on the parsed configuration data, acquiring a feature construction rule corresponding to the feature data from a feature database; Determining construction data based on the feature construction rule and the parsed configuration data; as well as Generating test data corresponding to the preset production environment according to the construction data; Wherein, generating test data corresponding to the preset production environment according to the construction data includes: In response to receiving the request for collecting the construction data, receiving the construction data; Parsing the structured data by field to determine parsed structured data; and Based on the data form of the preset production environment, test data corresponding to the preset production environment is generated.
2. The method according to claim 1, wherein: Determining the mapping relationship between the simulation data and the feature data to obtain the configuration data includes: Get simulation data; Analyze the acquired simulation data to determine characteristic dimensions of the simulation data, where the characteristic dimensions include at least one of the following: data format, transmission mode, and transmission quantity; and A mapping relationship between the feature dimension and the feature data is determined to obtain configuration data.
3. The method according to claim 2, wherein: The obtaining of simulation data comprises: Obtaining operation logs of various terminal devices collected by the security operation center, wherein the various terminal devices include network devices, mobile terminals, and servers in various production environments; and According to the operation log, simulation data corresponding to the operation log is determined.
4. The method according to claim 1, wherein: The determining, in response to the received generation request for generating test data, the parsed configuration data comprises: In response to the received generation request for generating test data, the data format and field characteristic information of the configuration data are parsed to obtain the parsed configuration data.
5. The method according to claim 1, wherein: The parsed configuration data includes identification data of the data to be constructed, and based on the parsed configuration data, acquiring a feature construction rule corresponding to the feature data from a feature database includes: According to the identification data of the data to be constructed, a feature construction rule corresponding to the feature data is determined from a feature database.
6. A device for generating test data, comprising: A first determination module is used to determine a mapping relationship between simulation data and feature data to obtain configuration data, wherein the simulation data includes simulation data for data generated by a target user in a preset production environment, and the feature data includes definition data for limiting the simulation data, and the definition data includes a data format and a field type for limiting the simulation data; A second determination module, configured to determine the parsed configuration data in response to a received generation request for generating test data; An acquisition module, configured to acquire, based on the parsed configuration data, a feature construction rule corresponding to the feature data from a feature database; A third determination module, configured to determine construction data based on the feature construction rule and the parsed configuration data; as well as A fourth determination module, configured to generate test data corresponding to the preset production environment according to the construction data; Wherein, the fourth determining module is further used for: In response to receiving the request for collecting the construction data, receiving the construction data; Parsing the structured data by field to determine the parsed structured data; as well as Based on the data form of the preset production environment, test data corresponding to the preset production environment is generated.
7. An electronic device comprising: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors execute the method according to any one of claims 1 to 5.
8. A computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, causes the processor to execute the method according to any one of claims 1 to 5.
9. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Method and device for data testing
CN111708701A
Test data generation platform based on banking business
CN113485911A