CN114661604A - Data generation method, device, equipment and computer storage medium - Google Patents

Data generation method, device, equipment and computer storage medium Download PDF

Info

Publication number
CN114661604A
CN114661604A CN202210301746.0A CN202210301746A CN114661604A CN 114661604 A CN114661604 A CN 114661604A CN 202210301746 A CN202210301746 A CN 202210301746A CN 114661604 A CN114661604 A CN 114661604A
Authority
CN
China
Prior art keywords
data type
data
preset rule
type
generating
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210301746.0A
Other languages
Chinese (zh)
Inventor
林莉萍
刘强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Construction Bank Corp
Original Assignee
China Construction Bank Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Construction Bank Corp filed Critical China Construction Bank Corp
Priority to CN202210301746.0A priority Critical patent/CN114661604A/en
Publication of CN114661604A publication Critical patent/CN114661604A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The embodiment of the application provides a data generation method, a data generation device, data generation equipment and a computer storage medium. The method comprises the following steps: the method comprises the steps of obtaining user configuration information, determining a target data type to be generated based on the user configuration information, and generating target test data based on the target data type according to a preset rule. According to the data generation method, the test data can be generated based on the incidence relation among the data, the incidence relation among the data is improved, and meanwhile the accuracy of the test data is improved.

Description

Data generation method, device, equipment and computer storage medium
Technical Field
The present application belongs to the field of big data technologies, and in particular, to a data generation method, apparatus, device, and computer storage medium.
Background
When an application system is developed and tested, a large amount of test data is often needed to meet various test requirements. With the gradual increase of software scale and complexity, the traditional way of manually designing and writing test data not only increases the test cost, but also is difficult to ensure the test coverage rate. Especially, the data relevance is strong when multiple application systems are relevant. Therefore, the high-efficiency and feasible automatic test data generation device has very important significance for the test automation process.
The existing scheme is to set a template file, write an original statement of test data to be generated in the template, wherein the original statement comprises a dynamic change part and a fixed value part of the test data represented by variables, and identify the variable and fixed value parts in the template file and generate the dynamic change part and the static part of the test data by analyzing the template file, so as to finally obtain batch test data. However, the relevance between the data obtained by the method is poor, and the accuracy of subsequent tests is influenced.
Disclosure of Invention
The embodiment of the application provides a data generation method, a data generation device, equipment and a computer storage medium, which can generate test data based on incidence relation between data and a preset rule, improve the incidence of the test data and improve the test accuracy of the test data.
In a first aspect, an embodiment of the present application provides a data method, where the method includes:
acquiring user configuration information;
determining a target data type based on the user configuration information, wherein the target data type comprises a first data type and an associated data type of the first data type;
and generating target test data according to a preset rule based on the first data type and the associated data type of the first data type.
According to one aspect of the application, generating target test data according to a preset rule based on a first data type and an associated data type of the first data type comprises: acquiring a first data type and a preset rule corresponding to the associated data type of the first data type; and generating target test data of the first data type and the associated data type of the first data type according to a preset rule.
According to one aspect of the application, acquiring a first data type and a preset rule corresponding to an associated data type of the first data type includes: acquiring a first data type and a rule code corresponding to the associated data type of the first data type; and acquiring the first data type and a preset rule corresponding to the associated data type of the first data type from a rule base based on the rule code.
According to one aspect of the application, the preset rule includes a preset threshold range, and the generating of the target test data of the first data type and the associated data type of the first data type according to the preset rule includes: and randomly generating target test data of the first data type and the associated data type of the first data type within a preset threshold range.
According to an aspect of the application, the preset rule includes a corresponding relationship between a target data type and a data format, and target test data of the first data type and an associated data type of the first data type is generated according to the preset rule based on the first data type and the associated data type of the first data type, including: determining a first data type and a data format of an associated data type of the first data type based on the corresponding relation between the target data type and the data format; target test data of the first data type and an associated data type of the first data type are generated based on the data format.
In a second aspect, an embodiment of the present application provides a data generating apparatus, where the apparatus includes:
the acquisition module is used for acquiring user configuration information;
the determining module is used for determining a target data type based on the user configuration information, wherein the target data type comprises a first data type and an associated data type of the first data type;
and the generating module is used for generating target test data according to a preset rule based on the first data type and the associated data type of the first data type.
According to an aspect of the application, a generating module, configured to generate target test data according to a preset rule based on a first data type and an associated data type of the first data type, includes: the acquisition module is further used for acquiring the first data type and a preset rule corresponding to the associated data type of the first data type; the generating module is further used for generating target test data of the first data type and the associated data type of the first data type according to a preset rule.
According to an aspect of the application, the obtaining module is further configured to obtain a first data type and a preset rule corresponding to an associated data type of the first data type, and includes: the acquisition module is also used for acquiring the first data type and the rule code corresponding to the associated data type of the first data type; the obtaining module is further used for obtaining the first data type and a preset rule corresponding to the associated data type of the first data type from the rule base based on the rule code.
According to an aspect of the application, the preset rule includes a preset threshold range, and the generating module is further configured to generate target test data of the first data type and the associated data type of the first data type according to the preset rule based on the first data type and the associated data type of the first data type, including: the generating module is further used for randomly generating target test data of the first data type and the associated data type of the first data type within a preset threshold range.
According to an aspect of the application, the preset rule includes a corresponding relationship between a target data type and a data format, and the generating module is further configured to generate target test data of the first data type and an associated data type of the first data type according to the preset rule based on the first data type and the associated data type of the first data type, including: the determining module is used for determining the first data type and the data format of the associated data type of the first data type based on the corresponding relation between the target data type and the data format; and the generating module is used for generating target test data of the first data type and the associated data type of the first data type based on the data format.
In a third aspect, an embodiment of the present application provides a data generating device, where the device includes:
a processor, and a memory storing computer program instructions;
the processor reads and executes the computer program instructions to implement the data generation method of the first aspect.
In a fourth aspect, the present application provides a computer storage medium, on which computer program instructions are stored, and when executed by a processor, the computer program instructions implement the data generation method of the first aspect.
In a fifth aspect, the present application provides a computer program product, and when executed by a processor of an electronic device, the instructions in the computer program product cause the electronic device to execute the data generation method of the first aspect.
The data generation method, the data generation device, the data generation equipment and the computer storage medium can determine the data type and the associated data type of the test data to be generated based on the acquired user configuration information, generate the test data based on the preset rule corresponding to each data type, and generate the test data based on the association relationship among the data, so that the association relationship among the data is improved, and meanwhile, the accuracy of the test data is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed to be used in the embodiments of the present application will be briefly described below, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic flowchart of a data generation method provided in an embodiment of the present application;
fig. 2 is a schematic structural diagram of a data generating apparatus according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of a data generation device according to an embodiment of the present application.
Detailed Description
Features and exemplary embodiments of various aspects of the present application will be described in detail below, and in order to make objects, technical solutions and advantages of the present application more apparent, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are intended to be illustrative only and are not intended to be limiting. It will be apparent to one skilled in the art that the present application may be practiced without some of these specific details. The following description of the embodiments is merely intended to provide a better understanding of the present application by illustrating examples thereof.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
At present, when an application system is tested, a large amount of test data needs to be generated, an original sentence of the test data to be generated is written in a template by a method of setting the template, the original sentence comprises a dynamic change part and a fixed value part of the test data which are expressed by variables, and the test data is obtained by analyzing a template file. In the process of generating the test data, the relevance between the data is poor, so that the relevance between the generated test data is poor, and the test accuracy is further influenced.
In order to solve the prior art problems, embodiments of the present application provide a data generation method, apparatus, device, and computer storage medium. First, a data generation method provided in the embodiment of the present application is described below.
Fig. 1 shows a schematic flow chart of a data generation method according to an embodiment of the present application. As shown in fig. 1, the method may include the steps of:
and S110, acquiring user configuration information.
And acquiring configuration information of the user, wherein the configuration information comprises the data type which is selected by the user and needs to generate the test data. Wherein the configuration information may be obtained in the form of a data table.
And S120, determining a target data type based on the user configuration information, wherein the target data type comprises the first data type and an associated data type of the first data type.
And determining the type of target data required to generate the test data according to the configuration information of the user. Specifically, a first data type is determined according to configuration information of a user, after the first data type is determined, an associated data type under the first data type is determined according to the configuration information of the user, and the first data type and the associated data type under the first data type form a final target data type. The first data type and the associated data type of the first data type are in a dependency relationship.
In one example, the determined first data type is a credit contract type, and the associated data of the first data type is a general loan contract, a guaranteed commitment contract, and a committed loan contract.
S130, generating target test data according to a preset rule based on the first data type and the associated data type of the first data type.
After the first data type and the associated data type of the first data type are obtained, a preset test data generation rule is obtained to generate a data value corresponding to each target data type, and then final target test data are obtained. Wherein the target test data may be in the form of a data table.
The preset rule may be data randomly generated within a preset threshold range, or may be set as needed, which is not limited to this.
The data generation method provided by the embodiment of the application can determine the data type and the associated data type of the test data to be generated based on the acquired user configuration information, generate the test data based on the preset rule corresponding to each data type, and generate the test data based on the association relationship among the data, so that the association relationship among the data is improved, and meanwhile, the accuracy of the test data is improved.
In some embodiments, generating the target test data according to the preset rule based on the first data type and the associated data type of the first data type includes: acquiring a first data type and a preset rule corresponding to the associated data type of the first data type; and generating target test data of the first data type and the associated data type of the first data type according to a preset rule. And acquiring a preset generation rule corresponding to each data type from the rule base according to the target data type, and generating corresponding test data based on the rule corresponding to each data type. The preset generation rules in the rule base comprise: the data items except the code values are main keys or have a uniform generation rule; randomly generating required data within a preset threshold range; and generating required data according to the character string and the number combination with the user-defined length, the number with the user-defined length and the date with the user-defined format.
In some embodiments, obtaining the first data type and the preset rule corresponding to the associated data type of the first data type includes: acquiring a first data type and a rule code corresponding to the associated data type of the first data type; and acquiring the first data type and a preset rule corresponding to the associated data type of the first data type from a rule base based on the rule code. After the target data types are determined, rule codes corresponding to the target data types are obtained, and data generation rules of the target data types are determined according to the codes.
In some embodiments, the preset rule includes a preset threshold range, and the generating of the target test data of the first data type and the associated data type of the first data type according to the preset rule may include: and randomly generating target test data of the first data type and the associated data type of the first data type within a preset threshold range. When the target test data is generated according to the preset rule, the data value of each target data type can be randomly generated within the range of the preset threshold value
In some embodiments, the preset rule includes a corresponding relationship between a target data type and a data format, and the generating of the target test data of the first data type and the associated data type of the first data type according to the preset rule includes: determining a first data type and a data format of an associated data type of the first data type based on the corresponding relation between the target data type and the data format; target test data of the first data type and an associated data type of the first data type are generated based on the data format. And determining the corresponding relation between the target data type and the data format, the character string and the number combination of the user-defined length, the number of the user-defined length and the date of the user-defined format, which are set by the user, based on the user configuration information, and generating test data according to the determined data format and length.
In some embodiments, the data generation method is based on a system implementation. Before obtaining user configuration information, a data generation system needs to be constructed, and the data generation system specifically comprises data item definition, rule base definition and imported application system physical model information. The configuration information of the system is shown in table 1, and includes: metadata information, rule configuration, threshold information, and data generation task plans, which are acquired in the form of metadata _ info, regular _ info, domain _ info, and Project _ plan data tables, respectively. Wherein, the metadata information table records the definition, type and generation rule type of the data item; the rule configuration table defines rules generated by the data items; the domain value information defines a domain value used for generating random numbers in a value domain range; and the data generation task schedule registers the user-defined running tasks. The metadata information table is shown in table 2 and includes data item number, data item classification, business domain, data type, rule classification number, and threshold value encoding, for example, one set of data is data item number 106194, data item classification is business data, information major category is basic data, information minor category is contract, chinese name is organization number, english name is instid, data type is VARCHAR (9), rule classification number is reg _13452, and threshold number is 13452. The rule configuration table is shown in table 3, and includes rule classification numbers, rule classification names, rule classification modules, and rule generation modes, for example, the rule classification number reg14198, the rule classification name is an interest rate type code, the rule module is cre _ rate _ cd, and the rule generation mode is 2, where a corresponding preset generation rule may be determined according to a value of the rule generation mode. The threshold information table is shown in table 4, and includes a domain number, a code table name, a code value, a code chinese name, and a code english abbreviation, for example, the domain number is 11471, the code table name is currency, the code value is 008, the code chinese name is list, and the code english abbreviation is ALL. The manufactured number task schedule table is shown in table 5, and includes a task name, a creation time, an execution start time, an execution end time, a table name, a data item name, a rule classification number, and an execution condition, for example, the task name is for public loan balance statistics, the creation time is 20201031, the execution start time is 202111011800, the execution end time is 202111011900, the table name is for a public credit contract account, the data item name is a loan internal account number, the rule classification number is reg _10077, and the execution condition is set to null.
TABLE 1
Figure BDA0003565856190000071
Figure BDA0003565856190000081
TABLE 2
Figure BDA0003565856190000082
TABLE 3
Rule classification numbering Rule class name Rule module Rule generation schema
reg_10001 Date of day cre_date 3
reg_14198 Interest rate type code cre_rate_cd 2
reg_13451 Customer number cre_cstid 1
TABLE 4
Figure BDA0003565856190000083
TABLE 5
Figure BDA0003565856190000084
In some embodiments, when the data generation method is implemented based on a constructed system, a build task configured by a user is acquired through a system interface, and execution time and application field selection are set. When the user selects the application field needing to generate test data, the system automatically lists all tables in the field, lists all fields by expanding the table-level tree diagram, and highlights the table lists related to all the main key foreign keys. And acquiring a data table selected by a user, and generating test data.
In some embodiments, before generating the test data, threshold information set by a user may be acquired, and the test data is generated based on the threshold information.
The data generation method provided by the embodiment of the application can determine the data type and the associated data type of the test data to be generated based on the acquired user configuration information, generate the test data based on the preset rule corresponding to each data type, and generate the test data based on the association relationship among the data, so that the association relationship among the data is improved, and meanwhile, the accuracy of the test data is improved.
Fig. 2 is a schematic structural diagram of a data generation apparatus according to an embodiment of the present application. As shown in fig. 2, the apparatus 200 may include an acquisition module 210, a determination module 220, and a generation module 230.
An obtaining module 210, configured to obtain user configuration information;
a determining module 220, configured to determine a target data type based on the user configuration information, where the target data type includes the first data type and an associated data type of the first data type;
the generating module 230 is configured to generate the target test data according to a preset rule based on the first data type and the associated data type of the first data type.
The data generation device 200 provided in the embodiment of the application can determine the data type and the associated data type of the test data to be generated based on the acquired user configuration information, generate the test data based on the preset rule corresponding to each data type, and generate the test data based on the association relationship between the data, thereby improving the association relationship between the data and improving the accuracy of the test data.
In some embodiments, the generating module 230 is configured to generate the target test data according to a preset rule based on the first data type and the associated data type of the first data type, and includes: the obtaining module 210 is further configured to obtain the first data type and a preset rule corresponding to an associated data type of the first data type; the generating module 230 is further configured to generate the target test data of the first data type and the associated data type of the first data type according to a preset rule.
In some embodiments, the obtaining module 210 is further configured to obtain the first data type and the preset rule corresponding to the associated data type of the first data type, where the preset rule includes: the obtaining module 210 is further configured to obtain the first data type and a rule code corresponding to an associated data type of the first data type; the obtaining module 210 is further configured to obtain the first data type and a preset rule corresponding to the associated data type of the first data type from the rule base based on the rule code.
In some embodiments, the preset rule includes a preset threshold range, and the generating module 230 is further configured to generate the target test data of the first data type and the associated data type of the first data type according to the preset rule, including: the generating module 230 is further configured to randomly generate the target test data of the first data type and the associated data type of the first data type within a preset threshold range.
In some embodiments, the preset rule includes a corresponding relationship between a target data type and a data format, and the generating module 230 is further configured to generate target test data of the first data type and an associated data type of the first data type according to the preset rule, including: a determining module 220, configured to determine a first data type and a data format of an associated data type of the first data type based on a corresponding relationship between a target data type and the data format; a generating module 230, configured to generate target test data of the first data type and an associated data type of the first data type based on the data format.
The data generation device provided by the embodiment of the application can determine the data type and the associated data type of the test data to be generated based on the acquired user configuration information, generate the test data based on the preset rule corresponding to each data type, and generate the test data based on the association relationship among the data, so that the association relationship among the data is improved, and meanwhile, the accuracy of the test data is improved.
Each module/unit in the apparatus shown in fig. 2 has a function of implementing each step in fig. 1, and can achieve the corresponding technical effect, and for brevity, the description is not repeated here.
Fig. 3 shows a hardware structure diagram of a data generation device according to an embodiment of the present application.
The data generating device may comprise a processor 301 and a memory 302 in which computer program instructions are stored.
Specifically, the processor 301 may include a Central Processing Unit (CPU), an Application Specific Integrated Circuit (ASIC), or one or more Integrated circuits configured to implement the embodiments of the present Application.
Memory 302 may include mass storage for data or instructions. By way of example, and not limitation, memory 302 may include a Hard Disk Drive (HDD), a floppy Disk Drive, flash memory, an optical Disk, a magneto-optical Disk, magnetic tape, or a Universal Serial Bus (USB) Drive or a combination of two or more of these. In one example, memory 302 can include removable or non-removable (or fixed) media, or memory 302 is non-volatile solid-state memory. The memory 302 may be internal or external to the integrated gateway disaster recovery device.
In one example, memory 302 may include Read Only Memory (ROM), Random Access Memory (RAM), magnetic disk storage media devices, optical storage media devices, flash memory devices, electrical, optical, or other physical/tangible memory storage devices. Thus, in general, the memory 302 includes one or more tangible (non-transitory) computer-readable storage media (e.g., a memory device) encoded with software comprising computer-executable instructions and when the software is executed (e.g., by one or more processors), it is operable to perform operations described with reference to a method according to an aspect of the present application.
The processor 301 reads and executes the computer program instructions stored in the memory 302 to implement the methods/steps S110 to S130 in the embodiment shown in fig. 1, and achieve the corresponding technical effects achieved by the embodiment shown in fig. 1 executing the methods/steps thereof, which are not described herein again for brevity.
In one example, the data generating device may also include a communication interface 303 and a bus 310. As shown in fig. 3, the processor 301, the memory 302, and the communication interface 303 are connected via a bus 310 to complete communication therebetween.
The communication interface 303 is mainly used for implementing communication between modules, apparatuses, units and/or devices in the embodiment of the present application.
Bus 310 includes hardware, software, or both coupling the components of the data generation device to each other. By way of example, and not limitation, a Bus may include an Accelerated Graphics Port (AGP) or other Graphics Bus, an Enhanced Industry Standard Architecture (EISA) Bus, a Front-Side Bus (Front Side Bus, FSB), a Hyper Transport (HT) interconnect, an Industry Standard Architecture (ISA) Bus, an infiniband interconnect, a Low Pin Count (LPC) Bus, a memory Bus, a Micro Channel Architecture (MCA) Bus, a Peripheral Component Interconnect (PCI) Bus, a PCI-Express (PCI-X) Bus, a Serial Advanced Technology Attachment (SATA) Bus, a video electronics standards association local (VLB) Bus, or other suitable Bus or a combination of two or more of these. Bus 310 may include one or more buses, where appropriate. Although specific buses are described and shown in the embodiments of the application, any suitable buses or interconnects are contemplated by the application.
The data generation device may execute the data generation method in the embodiment of the present application based on the configuration information of the user, thereby implementing the data generation method described in conjunction with fig. 1.
In addition, in combination with the data generation method in the foregoing embodiments, the embodiments of the present application may provide a computer storage medium to implement. The computer storage medium having computer program instructions stored thereon; the computer program instructions, when executed by a processor, implement any of the data generation methods in the above embodiments.
The present application provides a computer program product, and when executed by a processor of an electronic device, instructions in the computer program product cause the electronic device to execute any one of the data generation methods in the foregoing embodiments.
When it needs to be explained, the data acquisition, storage, use, processing and the like in the technical scheme of the application all conform to the relevant regulations of the national laws and regulations.
It is to be understood that the present application is not limited to the particular arrangements and instrumentality described above and shown in the attached drawings. A detailed description of known methods is omitted herein for the sake of brevity. In the above embodiments, several specific steps are described and shown as examples. However, the method processes of the present application are not limited to the specific steps described and illustrated, and those skilled in the art can make various changes, modifications, and additions or change the order between the steps after comprehending the spirit of the present application.
The functional blocks shown in the above-described structural block diagrams may be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, it may be, for example, an electronic Circuit, an Application Specific Integrated Circuit (ASIC), suitable firmware, plug-in, function card, or the like. When implemented in software, the elements of the present application are the programs or code segments used to perform the required tasks. The program or code segments can be stored in a machine-readable medium or transmitted by a data signal carried in a carrier wave over a transmission medium or a communication link. A "machine-readable medium" may include any medium that can store or transfer information. Examples of a machine-readable medium include electronic circuits, semiconductor memory devices, ROM, flash memory, Erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, fiber optic media, Radio Frequency (RF) links, and so forth. The code segments may be downloaded via computer networks such as the internet, intranets, etc.
It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, the present application is not limited to the order of the above-described steps, that is, the steps may be performed in the order mentioned in the embodiments, may be performed in an order different from the order in the embodiments, or may be performed simultaneously.
Aspects of the present application are described above with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, enable the implementation of the functions/acts specified in the flowchart and/or block diagram block or blocks. Such a processor may be, but is not limited to, a general purpose processor, a special purpose processor, an application specific processor, or a field programmable logic circuit. It will also be understood that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware for performing the specified functions or acts, or combinations of special purpose hardware and computer instructions.
As described above, only the specific embodiments of the present application are provided, and it can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the system, the module and the unit described above may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again. It should be understood that the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive various equivalent modifications or substitutions within the technical scope of the present application, and these modifications or substitutions should be covered within the scope of the present application.

Claims (13)

1. A method of generating data, comprising:
acquiring user configuration information;
determining a target data type based on the user configuration information, wherein the target data type comprises a first data type and an associated data type of the first data type;
and generating target test data according to a preset rule based on the first data type and the associated data type of the first data type.
2. The method according to claim 1, wherein generating the target test data according to a preset rule based on the first data type and an associated data type of the first data type comprises:
acquiring a first data type and a preset rule corresponding to the associated data type of the first data type;
and generating target test data of the first data type and the associated data type of the first data type according to the preset rule.
3. The method according to claim 2, wherein the obtaining the first data type and the preset rule corresponding to the associated data type of the first data type comprises:
acquiring rule codes corresponding to the first data type and the associated data type of the first data type;
and acquiring the first data type and a preset rule corresponding to the associated data type of the first data type from a rule base based on the rule code.
4. The method according to any one of claims 1 to 3, wherein the preset rule includes a preset threshold range, and the generating target test data of the first data type and the associated data type of the first data type according to the preset rule based on the first data type and the associated data type of the first data type includes:
and randomly generating target test data of the first data type and the associated data type of the first data type within the preset threshold range.
5. The method according to any one of claims 1 to 3, wherein the preset rule includes a corresponding relationship between a target data type and a data format, and the generating target test data of the first data type and the associated data type of the first data type according to the preset rule based on the first data type and the associated data type of the first data type includes:
determining the data format of the first data type and the associated data type of the first data type based on the corresponding relation between the target data type and the data format;
and generating target test data of the first data type and the associated data type of the first data type based on the data format.
6. An apparatus for generating data, the apparatus comprising:
the acquisition module is used for acquiring user configuration information;
a determining module, configured to determine a target data type based on the user configuration information, where the target data type includes a first data type and an associated data type of the first data type;
and the generating module is used for generating target test data according to a preset rule based on the first data type and the associated data type of the first data type.
7. The apparatus of claim 6, wherein the generating module is configured to generate the target test data according to a preset rule based on the first data type and an associated data type of the first data type, and includes:
the acquisition module is further configured to acquire the first data type and a preset rule corresponding to an associated data type of the first data type;
the generating module is further configured to generate the first data type and target test data of the associated data type of the first data type according to the preset rule.
8. The apparatus according to claim 7, wherein the obtaining module is further configured to obtain the first data type and a preset rule corresponding to an associated data type of the first data type, and includes:
the obtaining module is further configured to obtain the first data type and a rule code corresponding to an associated data type of the first data type;
the obtaining module is further configured to obtain the first data type and a preset rule corresponding to the associated data type of the first data type from a rule base based on the rule code.
9. The apparatus according to any one of claims 6 to 8, wherein the preset rule includes a preset threshold range, and the generating module is further configured to generate target test data of the first data type and the associated data type of the first data type according to the preset rule based on the first data type and the associated data type of the first data type, including:
the generating module is further configured to randomly generate the first data type and target test data of the associated data type of the first data type within a preset threshold range.
10. The apparatus according to any one of claims 6 to 8, wherein the preset rule includes a correspondence between a target data type and a data format, and the generating module is further configured to generate target test data of an associated data type of the first data type and the first data type according to the preset rule based on the first data type and the associated data type of the first data type, including:
the determining module is used for determining the first data type and the data format of the associated data type of the first data type based on the corresponding relation between the target data type and the data format;
the generating module is used for generating the first data type and target test data of the associated data type of the first data type based on the data format.
11. A data generation device, characterized in that the data generation device comprises: a processor, and a memory storing computer program instructions;
the processor reads and executes the computer program instructions to implement the data generation method of any one of claims 1 to 5.
12. A computer storage medium having computer program instructions stored thereon which, when executed by a processor, implement a data generation method as claimed in any one of claims 1 to 5.
13. A computer program product, wherein instructions in the computer program product, when executed by a processor of an electronic device, cause the electronic device to perform the data generation method of any of claims 1-5.
CN202210301746.0A 2022-03-25 2022-03-25 Data generation method, device, equipment and computer storage medium Pending CN114661604A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210301746.0A CN114661604A (en) 2022-03-25 2022-03-25 Data generation method, device, equipment and computer storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210301746.0A CN114661604A (en) 2022-03-25 2022-03-25 Data generation method, device, equipment and computer storage medium

Publications (1)

Publication Number Publication Date
CN114661604A true CN114661604A (en) 2022-06-24

Family

ID=82031338

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210301746.0A Pending CN114661604A (en) 2022-03-25 2022-03-25 Data generation method, device, equipment and computer storage medium

Country Status (1)

Country Link
CN (1) CN114661604A (en)

Similar Documents

Publication Publication Date Title
CN114510902B (en) Simulation result verification method, device, equipment and computer storage medium
CN116257223A (en) Data isolation development method, device, equipment, readable storage medium and product
CN115222361A (en) Business process flow transfer method, device, equipment and computer storage medium
CN114036147A (en) Data warehouse construction method, device, equipment and storage medium
CN115544991A (en) Report generation method, device, equipment, medium and program product
CN114398394A (en) Data blood margin analysis method, device, equipment and storage medium
CN116775110A (en) Data synchronization method, device, equipment, medium and product
CN114661604A (en) Data generation method, device, equipment and computer storage medium
CN114090014A (en) Program splitting method, device, equipment and computer storage medium
CN115186741A (en) Method, device and equipment for verifying POI fusion data
CN114443634A (en) Data quality checking method, device, equipment and storage medium
CN113986762A (en) Test case generation method and device
CN108416056B (en) Dependency learning method, device, equipment and medium based on condition containing dependency
CN117762814A (en) Test result recording method, device, equipment, medium and product
CN116186063A (en) Data query method, device, equipment and computer storage medium
CN114547101B (en) Data quality evaluation method, device, equipment and storage medium for data center
CN116303337A (en) Data migration method, device, equipment and computer storage medium
CN116306545A (en) Form generation method, device, equipment, medium and program product
CN118070742B (en) Document generation method, device, equipment, storage medium and product
CN117312149A (en) Method, apparatus, device, storage medium and program product for generating dummy data
CN114723249A (en) Method, device, equipment and medium for evaluating innovation stability of science and technology enterprise
CN118820061A (en) Method, device and equipment for detecting software defects and computer storage medium
CN117234925A (en) Automated data processing method, apparatus, device, and readable storage medium
CN116186245A (en) Method, device, equipment, storage medium and product for displaying code table level
CN115375277A (en) Report generation method, device, equipment and computer readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination