Simulation data generation method and device, generator and storage medium
By extracting feature information from the request and combining basic attributes and variable attribute fields to generate associated simulation data, it solves the problem of data clutter in traditional simulation tools, meets the learning and testing needs in the field of big data, and improves performance through identification numbers and timing markers. improve data management efficiency.
Patent Information
- Application Number
- CN202310403649.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-14
- Publication Date
- 2024-10-18
AI Technical Summary
When traditional data simulation tools generate simulation data, they lack correlation and are difficult to meet the learning and testing needs in the field of big data, resulting in the generated data being messy and difficult to manage.
By extracting feature information from the request to generate simulation data, obtain data from the preset basic attribute fields and variable attribute fields respectively, and generate multiple pieces of related simulation data according to the combination of configuration templates to ensure the relevance of the data. and orderliness, and carry identification numbers and time series markers in the data to facilitate tracking and analysis.
It realizes the generation of relevant and orderly simulation data, meets the learning and testing needs in the field of big data, improves data management efficiency and user experience, and promptly discovers and repairs errors when generating simulation data.
Smart Images

Figure CN118796791A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and more specifically, to a method, device, generator and storage medium for generating simulation data in the field of computer technology. Background Art
[0002] When generating simulated data, traditional data simulation tools simply randomly select certain values through set fields to generate random simulated data.
[0003] For example, user data may include user name, user address, user mobile phone number, and other data. In the traditional data simulation tool, the above user name, user address, user mobile phone number, etc. are set as a separate field. When a request to generate simulated data for a user is received, a data is randomly selected from different fields, and then the data randomly obtained from different fields are combined into one user data. When generating simulated data for different users or multiple simulated data for the same user according to this method, there will be a situation where the same user name corresponds to multiple user mobile phone numbers and multiple user addresses. The multiple data generated are not related and are relatively messy, which makes it difficult to meet the needs of various learning tests in the big data field. Summary of the invention
[0004] The present application provides a method, device, generator and storage medium for generating simulation data. The method can generate multiple related simulation data to meet the needs of various learning tests in the big data field.
[0005] In a first aspect, a method for generating simulation data is provided, the method comprising: obtaining a request for generating simulation data, and extracting characteristic information from the request; obtaining basic attribute data from a preset basic attribute field according to the characteristic information; obtaining variable attribute data from a preset variable attribute field according to the characteristic information; and generating a plurality of related simulation data according to the basic attribute data and the variable attribute data.
[0006] In the above technical solution, multiple pieces of simulation data are generated by extracting feature information from a request for generating simulation data, and obtaining basic attribute data and variable attribute data from a preset basic attribute field and a preset variable attribute field respectively according to the feature information. Since the multiple pieces of simulation data generated are composed of basic attribute data and variable attribute data, and the basic attribute data and variable attribute data are determined according to the feature information extracted from the request. Therefore, the multiple pieces of simulation data generated are related and can meet the needs of various learning tests in the field of big data.
[0007] In combination with the first aspect, in some possible implementations, multiple related simulation data are generated based on basic attribute data and variable attribute data, including: selecting a combination method corresponding to the simulation data based on a preset configuration template; the configuration template includes multiple combination methods; and combining the basic attribute data and the variable attribute data according to the combination method to generate multiple related simulation data.
[0008] In the above technical solution, by configuring different combination methods in the template, the combination method corresponding to the simulation data is selected, the acquired basic attribute data and variable attribute data are combined to generate multiple simulation data required by the user, meet the user's needs, and improve the user experience.
[0009] In combination with the first aspect and the above-mentioned implementation methods, in some possible implementation methods, the characteristic information includes first label information, and basic attribute data is obtained from a preset basic attribute field according to the characteristic information, including: searching for a first label data set corresponding to the first label information from the preset basic attribute field, and obtaining the basic attribute data from the first label data set.
[0010] In combination with the first aspect and the above-mentioned implementation methods, in some possible implementation methods, the characteristic information also includes second label information, and variable attribute data is obtained from a preset variable attribute field according to the characteristic information, including: searching for a second label data set corresponding to the second label information from the preset variable attribute field, and obtaining the variable attribute data from the second label data set.
[0011] In combination with the first aspect and the above-mentioned implementation methods, in some possible implementation methods, multiple related simulation data all carry an identity identification number. After generating multiple related simulation data, the method also includes: outputting the multiple related simulation data to a testing tool for testing; when the testing tool returns simulation data with errors in the test, tracking and analyzing the simulation data with errors according to the identity identification number.
[0012] In the above technical solution, multiple simulation data carry unique identification numbers. When errors occur in the simulation data during testing, the erroneous simulation data can be tracked and analyzed based on the unique identification number, so as to promptly discover the erroneous parts of the simulation tool and improve the user experience.
[0013] In combination with the first aspect and the above-mentioned implementation methods, in some possible implementation methods, multiple related simulation data all carry timing marks, and the simulation data are output to the test tool for testing, including: determining the output order of the multiple related simulation data according to the timing marks carried by the multiple related simulation data; and outputting the multiple related simulation data to the test tool for testing according to the output order.
[0014] In the above technical solution, by carrying timing marks on the generated multiple simulation data and determining the output order of the multiple simulation data, it is possible to generate simulation data that are related and have time sequence, thereby meeting the needs of various learning tests in the big data field.
[0015] In combination with the first aspect and the above-mentioned implementation methods, in some possible implementation methods, after obtaining a request for generating simulation data, the method also includes: extracting keywords representing the first quantity from the request, and obtaining basic attribute data from a preset basic attribute field according to the characteristic information, including: obtaining the first quantity of basic attribute data from the preset basic attribute field according to the characteristic information; and / or, extracting keywords representing the second quantity from the request, and obtaining variable attribute data from a preset variable attribute field according to the characteristic information, including: determining a third quantity based on the keywords representing the second quantity; and obtaining the third quantity of variable attribute data from the preset variable attribute field according to the characteristic information.
[0016] In summary, feature information is extracted from the request for generating simulation data, and basic attribute data and variable attribute data are obtained from the preset basic attribute field and the preset variable attribute field respectively according to the feature information. Then, according to different combination methods in the configuration template, the obtained basic attribute data and variable attribute data are combined, and each simulation data carries a timing mark, so that the simulation data with characteristics that the user needs can be generated. And the generated simulation data carries a unique identification number. When an error occurs in the simulation data during testing, the simulation data with errors can be tracked and analyzed according to the unique identification number, and the steps where the errors occurred when generating the simulation data can be confirmed, which is convenient for later maintenance. Meet the needs of various learning tests in the field of big data.
[0017] In a second aspect, a device for generating simulation data is provided, which includes: an extraction module: used to obtain a request for generating simulation data and extract characteristic information from the request; an acquisition module: used to obtain basic attribute data from a preset basic attribute field according to the characteristic information; obtain variable attribute data from a preset variable attribute field according to the characteristic information; a generation module: generates multiple related simulation data according to the basic attribute data and the variable attribute data.
[0018] In combination with the second aspect, in some possible implementations, multiple related simulation data are generated based on basic attribute data and variable attribute data, including: according to a preset configuration template, selecting a combination method corresponding to the simulation data; wherein the configuration template includes multiple combination methods; and combining the basic attribute data and the variable attribute data according to the combination method to generate multiple related simulation data.
[0019] In combination with the second aspect and the above-mentioned implementation methods, in some possible implementation methods, the characteristic information includes first label information, and basic attribute data is obtained from a preset basic attribute field according to the characteristic information, including: searching for a first label data set corresponding to the first label information from the preset basic attribute field, and obtaining the basic attribute data from the first label data set.
[0020] In combination with the second aspect and the above-mentioned implementation methods, in some possible implementation methods, the characteristic information also includes second label information, and variable attribute data is obtained from a preset variable attribute field according to the characteristic information, including: searching for a second label data set corresponding to the second label information from the preset variable attribute field, and obtaining the variable attribute data from the second label data set.
[0021] In combination with the second aspect and the above-mentioned implementation methods, in some possible implementation methods, multiple related simulation data all carry an identity identification number, and the device also includes: an output module, used to output the simulation data to a test tool for testing; an analysis module, used to track and analyze the erroneous simulation data according to the identity identification number when the test tool returns erroneous simulation data for the test.
[0022] In combination with the second aspect and the above-mentioned implementation methods, in some possible implementation methods, multiple related simulation data all carry timing marks, and the multiple related simulation data are output to the testing tool for testing, including: determining the output order of the multiple related simulation data according to the timing marks carried by the multiple related simulation data; and outputting the multiple related simulation data to the testing tool for testing according to the output order.
[0023] In combination with the second aspect and the above-mentioned implementation methods, in some possible implementation methods, after obtaining a request for generating simulation data, the extraction module is also used to: extract keywords representing the first quantity from the request, and obtain basic attribute data from a preset basic attribute field according to the characteristic information, including: obtaining the first quantity of basic attribute data from the preset basic attribute field according to the characteristic information; and / or, the extraction module is also used to: extract keywords representing the second quantity from the request, and obtain variable attribute data from a preset variable attribute field according to the characteristic information, including: determining a third quantity based on the keywords representing the second quantity; and obtaining the third quantity of variable attribute data from the preset variable attribute field according to the characteristic information.
[0024] In a third aspect, a simulation data generator is provided, comprising a memory and a processor. The memory is used to store executable program code, and the processor is used to call and run the executable program code from the memory, so that the simulation data generator executes the method in the first aspect or any possible implementation of the first aspect.
[0025] In a fourth aspect, a computer program product is provided, comprising: a computer program code, which, when executed on a computer, enables the computer to execute the method in the first aspect or any possible implementation of the first aspect.
[0026] In a fifth aspect, a computer-readable storage medium is provided, which stores a computer program code. When the computer program code runs on a computer, the computer executes the method in the above-mentioned first aspect or any possible implementation manner of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 It is a schematic diagram of a scenario provided in an embodiment of the present application.
[0028] Figure 2 It is a flowchart of a method for generating simulation data provided in an embodiment of the present application.
[0029] Figure 3 It is a flowchart of another method for generating simulation data provided in an embodiment of the present application.
[0030] Figure 4 It is a structural schematic diagram of a device for generating simulation data provided in an embodiment of the present application.
[0031] Figure 5 It is a structural diagram of a simulation data generator provided in an embodiment of the present application. DETAILED DESCRIPTION
[0032] The technical solution in the present application will be described clearly and in detail below in conjunction with the accompanying drawings. In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B: "and / or" in the text is only a description of the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, "multiple" means two or more than two.
[0033] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as suggesting or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features.
[0034] Figure 1 It is a schematic diagram of a scenario provided in an embodiment of the present application.
[0035] For example, Figure 1 As shown, the scenario 100 includes a dictionary set 10 and a data generator 20.
[0036] The dictionary set 10 is a set of elements consisting of a series of key and value pairs, which can be compared to a dictionary in reality. The dictionary set 10 stores internal database information and can be used to describe the operation and management of the database. For example, information such as the owner, creation time, table space, and user access rights of a data table can be found in the data dictionary. When it is necessary to generate simulation data, the original data of the simulation data can be obtained by querying the dictionary set 10. The original data can be the basic attribute data and variable attribute data in the embodiment of the present application.
[0037] The dictionary set 10 includes various tag data sets, for example, any combination of the following: a URL data set tagged with URL (Uniform Resource Locator), an IP address data set tagged with IP address (Internet Protocol Address), an email data set tagged with E-mail (Electronic Mail), a user data set tagged with music users, a user data set tagged with shopping users, a user data set tagged with game users, a user name data set tagged with user names, an account data set tagged with shopping accounts, music accounts, and game accounts, a phone data set tagged with phone, etc. The dictionary set 10 can also be configured in various ways, for example, some fields, tag types, data ranges, and features are defined in advance. Among them, a field refers to a data set with the same attributes.
[0038] The simulation data generator 20 is a simulation data generation tool that can generate different simulation data according to the user's request. The simulation data generator 20 can be an online data generator or an offline data generation tool. This embodiment of the application does not limit this.
[0039] In the embodiment of the present application, the execution subject is taken as the above-mentioned simulation data generator 20 as an example.
[0040] Figure 2 FIG. 1 is a flow chart of a method for generating simulation data provided by an embodiment of the present application. Figure 2 As shown, the method 200 includes:
[0041] Step 201, obtaining a request for generating simulation data, and extracting feature information from the request.
[0042] The request for generating simulation data may be a text request input by a user, or a voice request input by a user through a voice acquisition module.
[0043] Extracting feature information from a request can be understood as: extracting information related to the simulation data to be generated from a text request or a voice request input by a user.
[0044] For example, the request for generating simulation data is a text request input by a user. The simulation data generator 20 detects that the user inputs the text "requires shopping data of one hundred users for seven days" through the interface of the simulation data generator 20, that is, the data generator 20 obtains the request for generating simulation data. Afterwards, the simulation data generator 20 extracts characteristic information such as "user" and "shopping data" from the text.
[0045] Step 202: Obtain basic attribute data from a preset basic attribute field according to the feature information.
[0046] The preset basic attribute field is a field defined in advance when configuring the dictionary set, and the attributes of the data in the field are basic attributes.
[0047] In some embodiments, basic attribute data is also referred to as fixed attribute data. Specifically, basic attribute data can be understood as data that can only exist one-to-one. For example, when generating a set of simulation data for music interest tag testing, the simulation data includes user data, and the user data includes: user name data, user music account data, user mobile phone number data, user age data, user device IP address data, etc. Among them, one user name data can only correspond to one user music account data, and can only correspond to one user mobile phone number data and one user device IP address data, but one user age data can correspond to multiple user name data. User name data, user music account data, user mobile phone number data, user device IP address data, which can only exist one-to-one, are called fixed attribute data.
[0048] It should be understood that the base attribute field can be located in Figure 1 In the dictionary set 10 shown, when configuring the dictionary set 10, the basic attribute fields may be configured according to keywords or tags of different basic attributes.
[0049] Assume that according to the label configuration, the label of the basic attribute data of the above user data including: user name data, user music account data, user mobile phone number data, and user device IP address data is set as "music user". The label of the basic attribute data of the user data including: user name data, user shopping account data, user mobile phone number data, and user device IP address data is set as "shopping user". The label of the basic attribute data of the user data including: user name data, user game account data, user mobile phone number data, and user device IP address data is set as "game user".
[0050] Alternatively, the label of the user name data in the above user data can be set to the user name, the label of the above user account data can be set to the shopping account, music account, game account, etc., the above mobile phone number data can be set to the phone number, and the label of the IP address data of the above user device can be set to the IP address.
[0051] In the embodiments of the present application, there is no limitation on the setting method and setting name of the basic attribute data label.
[0052] In one possible implementation, the characteristic information includes first label information, and basic attribute data is obtained from a preset basic attribute field according to the characteristic information, including: searching for a first label data set corresponding to the first label information from the preset basic attribute field, and obtaining the basic attribute data from the first label data set.
[0053] The first label information is label information of the basic attribute data, and the first label information includes at least one label of the basic attribute data. Alternatively, the simulation data generator can generate the first label information according to the above-mentioned feature information.
[0054] The basic attribute data may be acquired from the first tag data set in at least one of random, polling, and range generation.
[0055] Exemplarily, the first tag information may include a tag of basic attribute data, for example, the first tag information is "shopping user", the simulation data generator 20 searches for a set tagged with "shopping user" from the basic attribute field, and obtains basic attribute data from the set tagged with "shopping user" in a polling manner. Each basic attribute data includes user data of a user, and user data can be understood as data that can characterize the identity of a user, such as the user name, user address, user mobile phone number, and other data of the shopping user mentioned above.
[0056] Exemplarily, the first tag information may include labels for multiple basic attribute data, and the labels for multiple basic attribute data may include, for example: user name, shopping account, phone number, and IP address. The simulation data generator 20 obtains data from each set labeled as user name, shopping account, phone number, and IP address in the basic attribute field and performs one-to-one combination to obtain multiple basic attribute data. For example, multiple basic attribute data include the user name, shopping account, phone number, IP address, etc. of the above-mentioned shopping user. Among them, in order to ensure that the data is not repeated, it can be set that for the same request, in the first tag data set, when a certain data is obtained once, it will not be obtained a second time. The first tag data set is a data set corresponding to the first tag information in the feature information extracted from the request.
[0057] Step 203: Obtain variable attribute data from a preset variable attribute field according to the characteristic information.
[0058] Among them, the preset variable attribute field is also a field defined in advance when configuring the dictionary set, and the attribute of the data in this field is variable attribute data.
[0059] In some embodiments, variable attribute data is also referred to as feature data. Specifically, variable attribute data can be understood as data that can be one-to-many or many-to-one. For example, when generating some simulation data for music interest tag testing, the simulation data includes other data in addition to user data. Such as: music name data, etc. For a basic attribute data, the music name data can be multiple random ones. For different user basic attribute data, the music name data can be different or the same. Therefore, the music name data can be called variable attribute data.
[0060] It should be understood that the variable attribute field can be located in Figure 1 In the dictionary set 10 shown, when configuring the dictionary set 10, the variable attribute fields may be configured according to keywords or tags of different variable attributes.
[0061] Assume that according to the label configuration, the label of the music name data can be set as “music name.” In the embodiment of the present application, there is no limitation on the setting method and setting name of the variable attribute data label.
[0062] In one possible implementation, the characteristic information also includes second label information, and variable attribute data is obtained from a preset variable attribute field based on the characteristic information, including: searching for a second label data set corresponding to the second label information from the preset variable attribute field, and obtaining the variable attribute data from the second label data set.
[0063] The second tag information is tag information of the variable attribute data, and the second tag information includes at least one tag of the variable attribute data. Alternatively, the simulation data generator may generate the second tag information according to the above feature information.
[0064] The method of acquiring the variable attribute data from the second tag data set may be at least one of random, polling, and range generation.
[0065] Exemplarily, the label of the variable attribute data in the second tag information is "commodity", and the simulation data generator 20 searches for a set labeled "commodity" from the variable attribute field, and randomly obtains multiple commodity data from the set labeled "commodity".
[0066] In one possible implementation, after obtaining a request for generating simulation data, the method further includes extracting a keyword representing a first quantity from the request, and obtaining basic attribute data from a preset basic attribute field according to characteristic information, including: obtaining the basic attribute data of the first quantity from the preset basic attribute field according to the characteristic information; and / or, extracting a keyword representing a second quantity from the request, and obtaining variable attribute data from a preset variable attribute field according to the characteristic information, including: determining a third quantity according to the keyword representing the second quantity; and obtaining the variable attribute data of the third quantity from the preset variable attribute field according to the characteristic information.
[0067] The keyword representing the first quantity can be understood as a keyword representing the quantity of basic attribute data, and the keyword representing the second quantity can be understood as a keyword representing the quantity of variable attribute data.
[0068] In some embodiments, the third quantity is determined according to the keyword representing the second quantity, including two ways: determining the third quantity according to a preset rule and determining the third quantity according to a default rule. The preset rule is set by the user according to the actual situation before inputting the request to generate simulation data, and the embodiments of the present application do not limit this. The default rule is a rule stored in the simulation data generator, which is generally a fixed rule.
[0069] Exemplarily, as described above, the request is "need shopping data of one hundred users for seven days", then the keyword representing the first quantity extracted from the request may be "one hundred", and based on the keyword, the simulation data generator 20 can obtain one hundred or one hundred groups of basic attribute data from the basic attribute words. The keyword representing the second quantity extracted from the request may be "seven days". In this application, the third quantity is determined based on a preset rule as an example. For example, in the preset rule, "the third quantity is equal to the number of people multiplied by the number of days", and the third quantity is determined to be "seven hundred". The simulation data generator 20 can obtain seven hundred variable attribute data from the variable attribute field. Each variable attribute data includes one commodity data or multiple commodity data. Step 204, based on the basic attribute data and the variable attribute data, generate multiple related simulation data.
[0070] Specifically, the generated multiple pieces of related simulation data may be: multiple pieces of related simulation data generated with basic attribute data as the core and variable attribute data combined.
[0071] The multiple related data may be understood as: the multiple related data have the same basic attribute data. Each simulation data may include one basic attribute data and n variable attribute data, where n is greater than or equal to 1.
[0072] In this embodiment, multiple pieces of simulation data are generated by extracting feature information from a request for generating simulation data, and obtaining basic attribute data and variable attribute data from a preset basic attribute field and a preset variable attribute field according to the feature information. Since the multiple pieces of simulation data generated are composed of basic attribute data and variable attribute data, and the basic attribute data and variable attribute data are determined according to the feature information extracted from the request. Therefore, the multiple pieces of simulation data generated are related and can meet the needs of various learning tests in the field of big data.
[0073] In a possible implementation, the step 204 generates simulation data according to the basic attribute data and the variable attribute data, specifically including: selecting a combination method corresponding to the simulation data according to a preset configuration template; and combining the basic attribute data and the variable attribute data according to the combination method to generate multiple related simulation data. The configuration template includes multiple combination methods.
[0074] Combine the following Figure 3 Explain this situation.
[0075] Figure 3 It is a flowchart of another method for generating simulation data provided in an embodiment of the present application.
[0076] For example, Figure 3 As shown, step 204 includes:
[0077] Step 301: According to a preset configuration template, select a combination method corresponding to the simulation data.
[0078] The preset configuration template includes a variety of combinations of simulation data. There are a variety of different combinations corresponding to different simulation data. Among these combinations, there are default ones and some that are set by the user according to specific situations.
[0079] For example, for user account data, the default combination may be a user name and an address, and an ID number. Or for user bank account simulation data, the set combination may be a user name and up to four different bank accounts.
[0080] Exemplarily, in this application, the combination method is set as "combining one basic attribute data (user data) and seven sets of variable attribute data (commodity data)".
[0081] Step 302: Combine the basic attribute data and the variable attribute data according to the combination method to generate multiple related synthetic simulation data.
[0082] Among them, when there are multiple basic attribute data types, they should be combined in a one-to-one correspondence to obtain multiple basic attribute data.
[0083] For example, in the above example, one hundred different user name data, one hundred different shopping account data, and one hundred different mobile phone number data are matched one by one to obtain one hundred basic attribute data. The variable attribute data is randomly acquired according to a determined third quantity. Then, according to the above basic attribute data and variable attribute data, the combination method selected and set is "one basic attribute data and seven variable attribute data (commodity data) are combined". According to this combination method, every seven variable attribute data commodity data are combined with the basic attribute data, i.e., the above-mentioned "user data", to obtain multiple related simulation data.
[0084] The third number may also be a number preset by the user, and the user may set the third number according to actual needs, which is not specifically limited in this embodiment.
[0085] In this embodiment, the acquired basic attribute data and variable attribute data are combined by configuring different combination modes in the template to generate simulation data required by the user, thereby meeting the needs of the user and improving the user experience.
[0086] In one possible implementation, multiple related simulation data all carry an identity identification number. After generating the multiple related simulation data, it also includes: outputting the multiple related simulation data to a test tool for testing; when the test tool returns simulation data with errors, tracking and analyzing the simulation data with errors according to the identity identification number.
[0087] The ID number is also called IDentity in English. The ID number is also called a serial number or account number, which is equivalent to an "ID card". In a specific thing, the ID number is generally unchanged. As for what to use to identify the thing, it is determined by the rules set by the designer himself. This rule is somewhat subjective in design according to the specific use environment, such as "employee ID number", "ID card number", "computer website address", etc.
[0088] In an embodiment of the present application, the identity identification number can be a string of numbers such as 1111, 1112, 1113, etc. Each piece of analog data has an identity identification number, and the identity identification number of each piece of analog data is different.
[0089] Multiple related simulation data can be output to the test tool at a preset frequency for testing. When the simulation data is generated by range generation, when the test tool returns simulation data with errors in the test, it can be understood that: the simulation data input into the test tool contains data outside the set range. Among them, the preset frequency can be set by the user according to the actual situation when generating simulation data, and the embodiments of the present application do not limit this.
[0090] In some embodiments, the test tool can perform a variety of learning tests in the field of big data, including interest tag testing, baseline model testing, etc. The configuration and sending connection between the simulation data generator 20 and the test tool can be configured by MQ (Message Queue) or DB (Database) connection. That is, the above-mentioned multiple related simulation data can be sent to the test tool for testing at a preset frequency by MQ connection or DB connection.
[0091] Exemplarily, the request to generate simulation data also includes a range requirement. For example, the text input above is the text "Seven days of shopping data of one hundred 'middle-aged' users is required." Assuming that middle-aged refers to the age between 45 and 65, when generating user data, only user data between 45 and 65 is obtained. When users under 45 or over 65 appear in the generated simulation data, the data in the test tool is the simulation data in which the test has errors. At this time, the test tool will return the simulation data that is not within the generation range to the simulation data generator 20. The simulation data generator 20 performs tracking analysis based on the identity identification number of the simulation data, and can find the steps where the errors occurred when generating the simulation data.
[0092] In this embodiment, the simulation data carries a unique identification number. When an error occurs in the simulation data during testing, the erroneous simulation data can be tracked and analyzed based on the unique identification number, so that the erroneous part of the simulation tool can be discovered in time, thereby improving the user experience.
[0093] In a possible implementation, after outputting the plurality of related simulation data to a test tool for testing, the method further includes receiving a test result of the test tool on the simulation data; and analyzing the test result according to the plurality of related simulation data.
[0094] The test result is a test result generated by the test tool after performing corresponding tests on multiple related simulation data. Different test tools or test contents generate different test results.
[0095] In some embodiments, after the simulation data generator generates multiple pieces of related simulation data, the multiple pieces of related simulation data will be stored locally. In addition, the simulation data generator can also count the variable attribute data in the generated simulation data, and after the statistics, labels corresponding to the multiple pieces of related simulation data can also be obtained.
[0096] Exemplarily, taking the test conducted by the test tool as a label test, after the test tool tests the input simulated data of "seven days of shopping data of one hundred users", it generates interest labels of shopping types that one hundred users like, that is, the above test results. The test tool then sends the interest labels to the simulation data generator 20 through the registrable data write-back interface provided by the simulation data generator 20. The simulation data generator 20 receives the test results, and compares the labels generated after statistics of the variable attribute data in the generated simulation data with the interest labels in the test results to analyze the accuracy of the test results.
[0097] In one possible implementation, multiple related simulation data all carry timing marks, and the multiple related simulation data are output to a test tool for testing, including: determining the output order of the multiple related simulation data based on the timing marks carried by the multiple related simulation data; and outputting the multiple related simulation data to the test tool for testing based on the output order.
[0098] The timing mark can be understood as a mark that can indicate the time sequence. Multiple related simulation data each carry a timing mark, that is, each generated simulation data carries a mark that can indicate the time sequence. The user can preset a rule for generating a timing mark during the process of configuring the dictionary.
[0099] Exemplarily, the above one hundred users include user one, user two, user three, etc. Taking the shopping data of user one for seven days as an example, the simulation data of user one includes: user one basic attribute data plus the first group of commodity data, user one basic attribute data plus the second group of commodity data, user one basic attribute data plus the third group of commodity data, user one basic attribute data plus the fourth group of commodity data, user one basic attribute data plus the fifth group of commodity data, user one basic attribute data plus the sixth group of commodity data, user one basic attribute data plus the seventh group of commodity data. The preset rule for generating the timing mark can be in hours or in days. It is assumed that the preset rule for generating the timing mark in the embodiment of the present application is in days. The timing mark carried by the simulation data of user one can be: user one basic attribute data plus the first group of commodity data is the shopping data of the first day, user one basic attribute data plus the second group of commodity data is the shopping data of the second day, and so on, user one basic attribute data plus the seventh group of commodity data is the shopping data of the seventh day. When outputting the simulation data of user one, the above simulation data is output in sequence from the first day to the seventh day.
[0100] In this embodiment, by carrying a timing mark on the generated multiple related simulation data and determining the output order of multiple related simulation data, it is possible to generate simulation data that is related and has timing, meeting the needs of various learning tests in the field of big data. In summary, in the embodiment of the present application, by extracting feature information from the request for generating simulation data, and obtaining basic attribute data and variable attribute data from the preset basic attribute field and the preset variable attribute field according to the feature information. Then, according to different combination methods in the configuration template, the obtained basic attribute data and variable attribute data are combined, and each simulation data carries a timing mark, which can generate the simulation data with characteristics that are related to each other before and after the user needs. And the generated simulation data carries a unique identity identification number. When the simulation data has an error in the test, the simulation data with the error can be tracked and analyzed according to the unique identity identification number, and the steps where the error occurs when generating the simulation data are confirmed, which is convenient for later maintenance and meets the needs of various learning tests in the field of big data.
[0101] Figure 4 It is a structural schematic diagram of a device for generating simulation data provided in an embodiment of the present application.
[0102] For example, Figure 4 As shown, the device 400 includes:
[0103] Extraction module 401: used to obtain a request for generating simulation data and extract feature information from the request.
[0104] The acquisition module 402 is used to acquire basic attribute data from a preset basic attribute field according to the characteristic information; and acquire variable attribute data from a preset variable attribute field according to the characteristic information.
[0105] Generating module 403: used to generate a plurality of related simulation data according to basic attribute data and variable attribute data.
[0106] In a possible implementation, the generation module 403 is specifically used to: select a combination method corresponding to the simulation data according to a preset configuration template; wherein the configuration template includes multiple combination methods; combine the basic attribute data and the variable attribute data according to the combination method to generate multiple related simulation data.
[0107] In a possible implementation, the feature information includes first label information, and the acquisition module 402 is specifically used to: search for a first label data set corresponding to the first label information from a preset basic attribute field, and acquire basic attribute data from the first label data set.
[0108] In a possible implementation, the feature information includes second label information, and the acquisition module 402 is further used to: search for a second label data set corresponding to the second label information from a preset variable attribute field, and acquire variable attribute data from the second label data set.
[0109] In one possible implementation, multiple related simulation data all carry an identity identification number, and the device also includes: an output module, used to output the multiple related simulation data to a test tool for testing; an analysis module, used to track and analyze the erroneous simulation data according to the identity identification number when the test tool returns erroneous simulation data.
[0110] In one possible implementation, multiple related simulation data all carry timing marks, and the output module is specifically used to determine the output order of the multiple related simulation data based on the timing marks carried by the multiple related simulation data; according to the output order, the multiple related simulation data are output to the test tool for testing.
[0111] In one possible implementation, after obtaining a request for generating simulation data, the extraction module 401 is further used to: extract keywords representing a first quantity from the request, and obtain basic attribute data from a preset basic attribute field according to the characteristic information, including: obtaining the basic attribute data of the first quantity from the preset basic attribute field according to the characteristic information; and / or, the extraction module 401 is further used to: extract keywords representing a second quantity from the request, and obtain variable attribute data from a preset variable attribute field according to the characteristic information, including: determining a third quantity according to the keywords representing the second quantity; and obtaining the variable attribute data of the third quantity from the preset variable attribute field according to the characteristic information.
[0112] Figure 5 It is a structural diagram of a simulation data generator provided in an embodiment of the present application.
[0113] For example, Figure 5 As shown, the simulation data generator 500 includes: a memory 501 and a processor 502, wherein the memory 501 stores an executable program code 5011, and the processor 502 is used to call and execute the executable program code 5011 to perform a method for generating simulation data.
[0114] In this embodiment, the simulation data generator can be divided into functional modules according to the above method example. For example, each functional module can be corresponded to, or two or more functions can be integrated into one processing module. The above integrated module can be implemented in the form of hardware. It should be noted that the division of modules in this embodiment is schematic and is only a logical function division. There may be other division methods in actual implementation.
[0115] In the case of dividing each functional module according to each function, the simulation data generator may include: extraction module, acquisition module, generation module, etc. It should be noted that all relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module, which will not be repeated here.
[0116] The simulation data generator provided in this embodiment is used to execute the above-mentioned method of generating simulation data, and thus can achieve the same effect as the above-mentioned implementation method.
[0117] In the case of an integrated unit, the simulation data generator may include a processing module and a storage module. The processing module may be used to control and manage the actions of the simulation data generator. The storage module may be used to support the simulation data generator to execute mutual program codes and data.
[0118] The processing module may be a processor or a controller, which may implement or execute various exemplary logic blocks, modules and circuits disclosed in the present application. The processor may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of digital signal processing (DSP) and a microprocessor, etc. The storage module may be a memory.
[0119] This embodiment also provides a computer-readable storage medium, in which a computer program code is stored. When the computer program code is executed on a computer, the computer executes the above-mentioned related method steps to implement a method for generating simulation data in the above-mentioned embodiment.
[0120] This embodiment also provides a computer program product. When the computer program product runs on a computer, it enables the computer to execute the above-mentioned related steps to implement a method for generating simulation data in the above-mentioned embodiment.
[0121] In addition, the simulation data generator provided in the embodiments of the present application may specifically be a chip, a component or a module, and the simulation data generator may include a connected processor and a memory; wherein the memory is used to store instructions, and when the simulation data generator is running, the processor may call and execute instructions so that the chip executes a method for generating simulation data in the above-mentioned embodiments.
[0122] Among them, the simulation data generator, computer-readable storage medium, computer program product or chip provided in this embodiment are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above, and will not be repeated here.
[0123] Through the description of the above implementation methods, technical personnel in the relevant field can understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0124] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0125] The above contents are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A method for generating simulation data, characterized in that: The method comprises: Obtaining a request for generating simulation data, and extracting feature information from the request; Acquiring basic attribute data from a preset basic attribute field according to the characteristic information; Acquiring variable attribute data from a preset variable attribute field according to the characteristic information; A plurality of related simulation data are generated based on the basic attribute data and the variable attribute data.
2. The method according to claim 1, characterized in that The step of generating a plurality of related simulation data according to the basic attribute data and the variable attribute data comprises: According to a preset configuration template, selecting a combination method corresponding to the plurality of associated simulation data; the configuration template includes a plurality of combination methods; The basic attribute data and the variable attribute data are combined according to the combination method to generate the plurality of related simulation data.
3. The method according to claim 1 or 2, characterized in that: The characteristic information includes first tag information, and acquiring basic attribute data from a preset basic attribute field according to the characteristic information includes: A first label data set corresponding to the first label information is searched from the preset basic attribute field, and the basic attribute data is acquired from the first label data set.
4. The method according to claim 1 or 2, characterized in that: The characteristic information also includes second tag information, and the acquiring variable attribute data from a preset variable attribute field according to the characteristic information includes: A second label data set corresponding to the second label information is searched from the preset variable attribute field, and the variable attribute data is acquired from the second label data set.
5. The method according to claim 1 or 2, characterized in that: The plurality of associated simulation data all carry an identity identification number. After generating the plurality of associated simulation data, the method further includes: Outputting the plurality of associated simulation data to a test tool for testing; When the test tool returns the simulation data in which the test error occurs, the simulation data in which the error occurs is traced and analyzed according to the identity identification number of the simulation data in which the test error occurs.
6. The method according to claim 5, characterized in that The plurality of associated simulation data all carry time sequence marks, and the simulation data are output to a test tool for testing, including: Determining an output order of the plurality of associated analog data according to the timing marks carried by the plurality of associated analog data; According to the output sequence, the plurality of associated simulation data are output to a test tool for testing.
7. The method according to claim 1 or 2, characterized in that: After obtaining the request for generating simulation data, the method further includes: extracting keywords representing a first quantity from the request; The acquiring basic attribute data from a preset basic attribute field according to the characteristic information includes: According to the characteristic information, acquiring the first amount of basic attribute data from a preset basic attribute field; and / or, extracting keywords representing a second quantity from the request; The acquiring variable attribute data from a preset variable attribute field according to the characteristic information includes: Determining a third quantity according to the keyword representing the second quantity; The third amount of variable attribute data is obtained from a preset variable attribute field according to the characteristic information.
8. A device for generating simulation data, characterized in that: The device comprises: Extraction module: used for obtaining a request for generating simulation data and extracting feature information from the request; Acquisition module: used to acquire basic attribute data from a preset basic attribute field according to the characteristic information; acquire variable attribute data from a preset variable attribute field according to the characteristic information; Generation module: used for generating the simulation data according to the basic attribute data and the variable attribute data.
9. A simulation data generator, characterized in that: include: A memory for storing program instructions; A processor is used to call the program instructions stored in the memory and execute the method according to any one of claims 1 to 7 according to the obtained program.
10. A computer storage medium, characterized in that: The storage medium stores a computer program, wherein the computer program is configured to execute the method according to any one of claims 1 to 7 when executed.
Citation Information
Patent Citations
Method, system and apparatus for test data batch generation
CN101430661A
A method used for mass generation of relational simulation data
CN109241205A
Method for generating driving data in simulated manner, system, simulation terminal and test system
CN109857085A
Data simulation method and device
CN110188037A
Method for constructing data simulator
CN111143963A
