Test data generation method and device
By acquiring and utilizing node and relationship configuration files to generate test data, the problem of being unable to generate hundreds of millions of data units in existing technologies has been solved, enabling comprehensive performance testing of graph databases.
Patent Information
- Application Number
- CN202310835493.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-07
- Publication Date
- 2025-01-07
AI Technical Summary
Existing technologies cannot generate test data with hundreds of millions of data points, resulting in insufficient performance testing of graph databases.
By obtaining node configuration files and relationship configuration files, the attributes and proportions of each target node and relationship are recorded, generating a large amount of test data.
It has achieved the generation of test data with hundreds of millions of data units, which can effectively perform performance testing of graph databases.
Smart Images

Figure CN119271513A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a test data generation method and device. Background Art
[0002] The application scenarios of graph databases are very wide, such as social networks, intelligent recommendation engines, knowledge graphs, etc. Based on graph databases, complex relationship information can be quickly analyzed and queried, and recommendations can be made to users based on the queried relationship information. For example, based on graph databases, relationship information such as which friends the target user has, the products that the target user's friends like, and the target user's browsing history can be analyzed and queried, so as to infer the target user's preferences based on the target user's corresponding relationship information, and then recommend products to the target user. Among them, as the amount of user information increases, the amount of data stored in the graph database will also increase. In order to verify the stability of the graph database under large amounts of data, a large amount of data needs to be generated for testing. At present, test data for graph databases is usually generated through EXCEL programs. However, due to the limited total number of rows in EXCEL files, only test data with a data volume of millions of units can be generated, and test data with a data volume of billions of units cannot be generated, so it is impossible to effectively perform performance testing on graph databases. Summary of the invention
[0003] The embodiments of the present application provide a test data generation method and device, the main purpose of which is to generate a large amount of test data, so as to effectively perform performance testing on a graph database.
[0004] In order to solve the above technical problems, the embodiments of the present application provide the following technical solutions:
[0005] In a first aspect, the present application provides a test data generation method, the method comprising:
[0006] Obtaining a node configuration file and a relationship configuration file, wherein the node configuration file records the node attributes corresponding to each target node and the proportion of the number of entities corresponding to each target node, and the relationship configuration file records the relationship attributes corresponding to each target relationship and the proportion of the number of entity relationships corresponding to each target relationship;
[0007] A plurality of test data are generated according to the total number of entities to be generated, the total number of entity relationships to be generated, the node configuration file and the relationship configuration file.
[0008] In a second aspect, the present application further provides a test data generating device, the device comprising:
[0009] An acquisition unit is used to acquire a node configuration file and a relationship configuration file, wherein the node configuration file records the node attributes corresponding to each target node and the proportion of the number of entities corresponding to each target node, and the relationship configuration file records the relationship attributes corresponding to each target relationship and the proportion of the number of entity relationships corresponding to each target relationship;
[0010] The first generating unit is used to generate a plurality of test data according to the total number of entities to be generated, the total number of entity relationships to be generated, the node configuration file and the relationship configuration file.
[0011] In a third aspect, an embodiment of the present application provides a storage medium, wherein the storage medium includes a stored program, wherein when the program is running, the device where the storage medium is located is controlled to execute the test data generation method described in the first aspect.
[0012] In a fourth aspect, an embodiment of the present application provides a test data generating device, which includes a storage medium; and one or more processors, wherein the storage medium is coupled to the processor, and the processor is configured to execute program instructions stored in the storage medium; when the program instructions are executed, the test data generating method described in the first aspect is executed.
[0013] By means of the above technical solution, the technical solution provided by this application has at least the following advantages:
[0014] The present application provides a test data generation method and device. The present application can generate a large amount of test data for the target graph database during the performance test of the target graph database. The test data generation application first obtains a node configuration file that records the node attributes corresponding to each target node and the proportion of the number of entities corresponding to each target node, and a relationship configuration file that records the relationship attributes corresponding to each target relationship and the proportion of the number of entity relationships corresponding to each target relationship. Then, a plurality of test data are generated according to the total number of entities to be generated, the total number of entity relationships to be generated, the node configuration file, and the relationship configuration file. That is, first, according to the total number of entities to be generated, the node attributes corresponding to each target node contained in the node configuration file, and the proportion of the number of entities corresponding to each target node, a corresponding number of multiple test entities are generated corresponding to each target node. Then, according to the plurality of test entities, the total number of entity relationships to be generated, the relationship attributes corresponding to each target relationship contained in the relationship configuration file, and the proportion of the number of entity relationships corresponding to each target relationship, a corresponding number of multiple test entity relationships are generated corresponding to each target relationship. Finally, a plurality of test data are generated according to the plurality of test entities and the plurality of test entity relationships. Thus, test data with a data volume of 100 million units can be generated, and the performance test of the graph database can be effectively performed.
[0015] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] By reading the detailed description below with reference to the accompanying drawings, the above and other purposes, features and advantages of the exemplary embodiments of the present application will become easy to understand. In the accompanying drawings, several embodiments of the present application are shown in an exemplary and non-limiting manner, and the same or corresponding reference numerals represent the same or corresponding parts, wherein:
[0017] Figure 1 A flow chart of a test data generation method provided by an embodiment of the present application is shown;
[0018] Figure 2 A schematic diagram showing the proportion of the number of entities of multiple target nodes and the proportion of the number of entity relationships of multiple target relationships provided by an embodiment of the present application;
[0019] Figure 3 A block diagram showing a test data generating device provided by an embodiment of the present application is shown;
[0020] Figure 4 A block diagram showing another test data generating device provided in an embodiment of the present application is shown;
[0021] Figure 5 A schematic diagram of an electronic device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0022] The exemplary embodiments of the present application will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present application are shown in the accompanying drawings, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments described herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present application and to fully convey the scope of the present application to those skilled in the art.
[0023] It should be noted that, unless otherwise specified, the technical terms or scientific terms used in this application should have the common meanings understood by technicians in the field to which this application belongs.
[0024] The present application embodiment provides a method for generating test data, specifically, Figure 1 As shown, the method includes:
[0025] 101. Obtain a node configuration file and a relationship configuration file.
[0026] Among them, the node configuration file records the node attributes corresponding to each target node and the proportion of the number of entities corresponding to each target node, and the sum of the proportions of the number of entities corresponding to multiple target nodes is 1. The relationship configuration file records the relationship attributes corresponding to each target relationship and the proportion of the number of entity relationships corresponding to each target relationship, and the sum of the proportions of the number of entity relationships corresponding to multiple target relationships is 1; among them, multiple target nodes may include but are not limited to: schools, teachers, students, etc. When the target node is a school, the node attributes corresponding to the target node may include but are not limited to: school name, address, faculty, etc. When the target node is a teacher, the node attributes corresponding to the target node may include but are not limited to: teacher Name, age, subjects taught, teaching experience, etc. When the target node is a student, the node attributes corresponding to the target node may include but are not limited to: student name, student number, age, grade, etc. Multiple target relationships may include but are not limited to: employment, education, management, etc. When the target relationship is employment, the relationship attributes corresponding to the target relationship may include but are not limited to: starting node (school), destination node (teacher); when the target relationship is education, the relationship attributes corresponding to the target relationship may include but are not limited to: starting node (teacher), destination node (student); when the target relationship is management, the relationship attributes corresponding to the target relationship may include but are not limited to: starting node (school), destination node (student).
[0027] It should be noted that in the embodiment of the present application, the execution entity in each step is a test data generation application running in the target terminal device, wherein the target terminal device can be but is not limited to: a computer, a tablet computer, a server, etc.
[0028] In an embodiment of the present application, during the performance testing of a target graph database, when a large amount of test data needs to be generated for the target graph database, the test data generation application can obtain the node configuration files and relationship configuration files pre-constructed by the staff, so as to subsequently generate a large amount of test data based on the node configuration files and relationship configuration files, wherein the target graph database can be but is not limited to: a Neo4j graph database, which is not specifically limited in the embodiment of the present application.
[0029] 102. Generate multiple test data according to the total number of entities to be generated, the total number of entity relationships to be generated, the node configuration files, and the relationship configuration files.
[0030] Among them, the total number of entities to be generated is the total number of test entities that the staff expects to generate, and the total number of entities to be generated can be but not limited to: 50 million, 100 million, 150 million, etc. The total number of entity relationships to be generated is the total number of entity relationships that the staff expects to generate, and the total number of entity relationships to be generated can be but not limited to: 500,000, 1 million, 2 million, etc.; for any test data, it can be one test entity, or it can be two test entities and the test entity relationship between the two test entities.
[0031] In an embodiment of the present application, after obtaining the node configuration file and the relationship configuration file, the test data generation application can generate multiple test data according to the total number of entities to be generated, the total number of entity relationships to be generated, the node configuration file and the relationship configuration file, that is, firstly generate a corresponding number of multiple test entities corresponding to each target node according to the total number of entities to be generated, the node attributes corresponding to each target node contained in the node configuration file, and the proportion of the number of entities corresponding to each target node, then generate a corresponding number of multiple test entity relationships corresponding to each target relationship according to the multiple test entities, the total number of entity relationships to be generated, the relationship attributes corresponding to each target relationship contained in the relationship configuration file, and the proportion of the number of entity relationships corresponding to each target relationship, finally generate multiple test data according to the multiple test entities and the multiple test entity relationships, such as Figure 2As shown in the figure, the total number of entities to be generated is 100 million, the total number of entity relationships to be generated is 500,000, the node configuration file records the node attributes and entity quantity ratio (0.1) corresponding to the target node (school), the node attributes and entity quantity ratio (0.3) corresponding to the target node (teachers) and the node attributes and entity quantity ratio (0.6) corresponding to the target node (students), and the relationship configuration file records the relationship attributes and entity quantity ratio (0.1) corresponding to the target relationship (employment), the relationship attributes and entity quantity ratio (0.3) corresponding to the target relationship (education) and the relationship attributes and entity quantity ratio (0.6) corresponding to the target relationship (management). According to the total number of entities to be generated, the node attributes corresponding to each target node contained in the node configuration file and the entity quantity ratio corresponding to each target node, the target node is generated. (school), 30 million test entities corresponding to the target node (teacher), and 60 million test entities corresponding to the target node (student). According to multiple test entities, the total number of entity relationships to be generated, the relationship attributes corresponding to each target relationship contained in the relationship configuration file, and the proportion of the number of entity relationships corresponding to each target relationship, 50,000 test entity relationships corresponding to the target relationship (employment), 150,000 test entity relationships corresponding to the target relationship (education), and 300,000 test entity relationships corresponding to the target relationship (management) are generated. According to the 100 million test entities and 500,000 test entity relationships, 500,000 first-category test data (i.e., two test entities and the test entity relationship between the two test entities) and 100 million second-category test data (i.e., one test entity) can be generated, but not limited to this.
[0032] The embodiment of the present application provides a test data generation method. The embodiment of the present application can generate a test data method when a large amount of test data needs to be generated for the target graph database during the performance test of the target graph database. The test data generation application first obtains a node configuration file that records the node attributes corresponding to each target node and the proportion of the number of entities corresponding to each target node, and a relationship configuration file that records the relationship attributes corresponding to each target relationship and the proportion of the number of entity relationships corresponding to each target relationship. Then, a plurality of test data are generated according to the total number of entities to be generated, the total number of entity relationships to be generated, the node configuration file, and the relationship configuration file. That is, first, according to the total number of entities to be generated, the node attributes corresponding to each target node contained in the node configuration file, and the proportion of the number of entities corresponding to each target node, a corresponding number of multiple test entities are generated corresponding to each target node. Then, according to the plurality of test entities, the total number of entity relationships to be generated, the relationship attributes corresponding to each target relationship contained in the relationship configuration file, and the proportion of the number of entity relationships corresponding to each target relationship, a corresponding number of multiple test entity relationships are generated corresponding to each target relationship. Finally, a plurality of test data are generated according to the plurality of test entities and the plurality of test entity relationships. Thus, test data with a data volume of 100 million units can be generated, thereby effectively performing performance testing on the graph database.
[0033] Furthermore, in an embodiment of the present application, the specific process of the test data generation application generating multiple test data according to the total number of entities to be generated, the total number of entity relationships to be generated, the node configuration file and the relationship configuration file is as follows: (1) obtaining the total number of entities to be generated and the total number of entity relationships to be generated; (2) reading the node configuration file and the relationship configuration file, thereby obtaining the node attributes corresponding to each target node, the proportion of the number of entities corresponding to each target node, the relationship attributes corresponding to each target relationship and the proportion of the number of entity relationships corresponding to each target relationship; (3) generating multiple test entities corresponding to each target node according to the total number of entities to be generated, the node attributes corresponding to each target node and the proportion of the number of entities corresponding to each target node, that is, first determining the number of entities to be generated corresponding to each target node according to the total number of entities to be generated and the proportion of the number of entities corresponding to each target node, and then obtaining the node attributes corresponding to each target node according to the number of entities to be generated and the node attributes corresponding to each target node. (4) generating multiple test entity relationships corresponding to each target relationship according to the multiple test entities, the total number of entity relationships to be generated, the relationship attributes corresponding to each target relationship and the proportion of the number of entity relationships corresponding to each target relationship, that is, first determining the number of entity relationships to be generated corresponding to each target relationship according to the total number of entity relationships to be generated and the proportion of the number of entity relationships corresponding to each target relationship, and then generating multiple test entity relationships corresponding to each target relationship according to the multiple test entities, the number of entity relationships to be generated corresponding to each target relationship and the relationship attributes; (5) generating multiple test data according to the multiple test entities and the multiple test entity relationships; wherein, for any test entity, the test entity includes the attribute values of each node attribute under its corresponding target node, and for any test entity relationship, the test entity relationship includes its corresponding starting node name and destination node name.
[0034] Further, in an embodiment of the present application, the specific process of the test data generation application generating multiple test data according to the total number of entities to be generated, the total number of entity relationships to be generated, the node configuration file and the relationship configuration file is: obtain a preset script, wherein the preset script records the total number of entities to be generated and the total number of entity relationships to be generated, and the preset script is specifically a python script; execute the preset script so that the preset script reads the node configuration file and the relationship configuration file, thereby obtaining the node attributes corresponding to each target node, the proportion of the number of entities corresponding to each target node, the relationship attributes corresponding to each target relationship, and the proportion of the number of entity relationships corresponding to each target relationship, and generate multiple test entities corresponding to each target node according to the total number of entities to be generated, the node attributes corresponding to each target node, and the proportion of the number of entities corresponding to each target node (that is, first generate the test entities according to the total number of entities to be generated, the node attributes corresponding to each target node, and the proportion of the number of entities corresponding to each target node). The number of entities to be generated corresponding to each target node is determined according to the total number and the proportion of the number of entities corresponding to each target node, and then multiple test entities corresponding to each target node are generated according to the number of entities to be generated and the node attributes corresponding to each target node); multiple test entity relationships corresponding to each target relationship are generated according to multiple test entities, the total number of entity relationships to be generated, the relationship attributes corresponding to each target relationship, and the proportion of the number of entity relationships corresponding to each target relationship (that is, first determine the number of entity relationships to be generated corresponding to each target relationship according to the total number of entity relationships to be generated and the proportion of the number of entity relationships corresponding to each target relationship, and then generate multiple test entity relationships corresponding to each target relationship according to multiple test entities, the number of entity relationships to be generated corresponding to each target relationship, and the relationship attributes), and generate multiple test data according to multiple test entities and multiple test entity relationships.
[0035] Furthermore, in an embodiment of the present application, the test data generation application also needs to pre-generate a preset script, wherein the specific process of the test data generation application generating the preset script is: first, receiving a script generation request, wherein the script generation request includes the total number of entities to be generated and the total number of entity relationships to be generated; secondly, generating a preset script according to the total number of entities to be generated and the total number of entity relationships to be generated.
[0036] Furthermore, as a response to the above Figure 1 In order to realize the method shown in the figure, another embodiment of the present application also provides a test data generation device. This device embodiment corresponds to the aforementioned method embodiment. For ease of reading, this device embodiment will not repeat the details of the aforementioned method embodiment one by one, but it should be clear that the device in this embodiment can correspond to all the contents of the aforementioned method embodiment. This device is used to generate a large amount of test data, so as to effectively perform performance testing on the graph database, specifically as follows Figure 3 As shown, the device comprises:
[0037] The acquisition unit 21 is used to acquire a node configuration file and a relationship configuration file, wherein the node configuration file records the node attributes corresponding to each target node and the proportion of the number of entities corresponding to each target node, and the relationship configuration file records the relationship attributes corresponding to each target relationship and the proportion of the number of entity relationships corresponding to each target relationship;
[0038] The first generating unit 22 is used to generate a plurality of test data according to the total number of entities to be generated, the total number of entity relationships to be generated, the node configuration file and the relationship configuration file.
[0039] Further, such as Figure 4 As shown, the first generation unit 22 is specifically used to: obtain the total number of entities to be generated and the total number of entity relationships to be generated; read the node configuration file and the relationship configuration file to obtain the node attributes corresponding to each of the target nodes, the proportion of the number of entities corresponding to each of the target nodes, the relationship attributes corresponding to each of the target relationships, and the proportion of the number of entity relationships corresponding to each of the target relationships; generate multiple test entities corresponding to each of the target nodes according to the total number of entities to be generated, the node attributes corresponding to each of the target nodes, and the proportion of the number of entities corresponding to each of the target nodes; generate multiple test entity relationships corresponding to each of the target relationships according to the multiple test entities, the total number of entity relationships to be generated, the relationship attributes corresponding to each of the target relationships, and the proportion of the number of entity relationships corresponding to each of the target relationships; generate multiple test data according to the multiple test entities and the multiple test entity relationships.
[0040] Further, such as Figure 4 As shown, the first generation unit 22 is specifically used to: obtain a preset script, wherein the preset script records the total number of entities to be generated and the total number of entity relationships to be generated; execute the preset script to obtain the node attributes corresponding to each of the target nodes, the proportion of the number of entities corresponding to each of the target nodes, the relationship attributes corresponding to each of the target relationships, and the proportion of the number of entity relationships corresponding to each of the target relationships, so that the preset script reads the node configuration file and the relationship configuration file, and generates multiple test entities corresponding to each of the target nodes according to the total number of entities to be generated, the node attributes corresponding to each of the target nodes, and the proportion of the number of entities corresponding to each of the target nodes, generates multiple test entity relationships corresponding to each of the target relationships according to the multiple test entities, the total number of entity relationships to be generated, the relationship attributes corresponding to each of the target relationships, and the proportion of the number of entity relationships corresponding to each of the target relationships, and generates multiple test data according to the multiple test entities and the multiple test entity relationships.
[0041] Further, such as Figure 4As shown, the device also includes:
[0042] A receiving unit 23, configured to receive a script generation request, wherein the script generation request includes the total number of entities to be generated and the total number of entity relationships to be generated;
[0043] The second generating unit 24 is used to generate the preset script according to the total number of entities to be generated and the total number of entity relationships to be generated.
[0044] Further, such as Figure 4 As shown, the preset script is specifically a python script.
[0045] The embodiment of the present application provides a test data generation method and device. The embodiment of the present application can generate a large amount of test data for the target graph database during the performance test of the target graph database. The test data generation application first obtains a node configuration file that records the node attributes corresponding to each target node and the proportion of the number of entities corresponding to each target node, and a relationship configuration file that records the relationship attributes corresponding to each target relationship and the proportion of the number of entity relationships corresponding to each target relationship. Then, a plurality of test data are generated according to the total number of entities to be generated, the total number of entity relationships to be generated, the node configuration file, and the relationship configuration file. That is, first, according to the total number of entities to be generated, the node attributes corresponding to each target node contained in the node configuration file, and the proportion of the number of entities corresponding to each target node, a corresponding number of multiple test entities are generated corresponding to each target node. Then, according to the plurality of test entities, the total number of entity relationships to be generated, the relationship attributes corresponding to each target relationship contained in the relationship configuration file, and the proportion of the number of entity relationships corresponding to each target relationship, a corresponding number of multiple test entity relationships are generated corresponding to each target relationship. Finally, a plurality of test data are generated according to the plurality of test entities and the plurality of test entity relationships. Thus, test data with a data volume of 100 million units can be generated, thereby effectively performing performance testing on the graph database.
[0046] An embodiment of the present application provides a storage medium, which includes a stored program, wherein when the program is executed, a device where the storage medium is located is controlled to execute the test data generating method described above.
[0047] The storage medium may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM, and the memory includes at least one storage chip.
[0048] An embodiment of the present application also provides a test data generating device, which includes a storage medium; and one or more processors, wherein the storage medium is coupled to the processor, and the processor is configured to execute program instructions stored in the storage medium; when the program instructions are executed, the test data generating method described above is executed.
[0049] The present application embodiment provides a device 30, such as Figure 5 As shown, the device 30 includes at least one processor 301, at least one memory 302 and a bus 303 connected to the processor 301; wherein the processor 301 and the memory 302 communicate with each other through the bus 303; the processor 301 is used to call the program instructions in the memory 302 to execute the above test data generation method. The device in this article can be a server, a PC, a PAD, etc.
[0050] The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing a program that is initialized with the following method steps: obtaining a node configuration file and a relationship configuration file, wherein the node configuration file records the node attributes corresponding to each target node and the proportion of the number of entities corresponding to each of the target nodes, and the relationship configuration file records the relationship attributes corresponding to each target relationship and the proportion of the number of entity relationships corresponding to each of the target relationships;
[0051] A plurality of test data are generated according to the total number of entities to be generated, the total number of entity relationships to be generated, the node configuration file and the relationship configuration file.
[0052] Further, the generating of a plurality of test data according to the total number of entities to be generated, the total number of entity relationships to be generated, the node configuration file and the relationship configuration file comprises:
[0053] Obtaining the total number of entities to be generated and the total number of entity relationships to be generated;
[0054] Read the node configuration file and the relationship configuration file to obtain the node attribute corresponding to each of the target nodes, the proportion of the number of entities corresponding to each of the target nodes, the relationship attribute corresponding to each of the target relationships, and the proportion of the number of entity relationships corresponding to each of the target relationships;
[0055] Generate multiple test entities corresponding to each target node according to the total number of entities to be generated, the node attributes corresponding to each target node, and the proportion of the number of entities corresponding to each target node;
[0056] Generate multiple test entity relationships corresponding to each target relationship according to the multiple test entities, the total number of entity relationships to be generated, the relationship attribute corresponding to each target relationship, and the proportion of the number of entity relationships corresponding to each target relationship;
[0057] A plurality of the test data are generated according to the plurality of the test entities and the plurality of the test entity relationships.
[0058] Further, the generating of a plurality of test data according to the total number of entities to be generated, the total number of entity relationships to be generated, the node configuration file and the relationship configuration file comprises:
[0059] Obtain a preset script, wherein the preset script records the total number of entities to be generated and the total number of entity relationships to be generated;
[0060] Execute the preset script so that the preset script reads the node configuration file and the relationship configuration file to obtain the node attributes corresponding to each of the target nodes, the proportion of the number of entities corresponding to each of the target nodes, the relationship attributes corresponding to each of the target relationships, and the proportion of the number of entity relationships corresponding to each of the target relationships; generate multiple test entities corresponding to each of the target nodes according to the total number of entities to be generated, the node attributes corresponding to each of the target nodes, and the proportion of the number of entities corresponding to each of the target nodes; generate multiple test entity relationships corresponding to each of the target relationships according to the multiple test entities, the total number of entity relationships to be generated, the relationship attributes corresponding to each of the target relationships, and the proportion of the number of entity relationships corresponding to each of the target relationships; and generate multiple test data according to the multiple test entities and the multiple test entity relationships.
[0061] Furthermore, the method further comprises:
[0062] Receive a script generation request, wherein the script generation request includes the total number of entities to be generated and the total number of entity relationships to be generated;
[0063] The preset script is generated according to the total number of entities to be generated and the total number of entity relationships to be generated.
[0064] Furthermore, the preset script is specifically a python script.
[0065] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0066] In a typical configuration, the device includes one or more processors (CPU), memory and bus. The device may also include input / output interface, network interface and the like.
[0067] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip. The memory is an example of a computer-readable medium.
[0068] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0069] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0070] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0071] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.
Claims
1. A test data generation method, characterized in that: include: Obtaining a node configuration file and a relationship configuration file, wherein the node configuration file records the node attributes corresponding to each target node and the proportion of the number of entities corresponding to each target node, and the relationship configuration file records the relationship attributes corresponding to each target relationship and the proportion of the number of entity relationships corresponding to each target relationship; A plurality of test data are generated according to the total number of entities to be generated, the total number of entity relationships to be generated, the node configuration file and the relationship configuration file.
2. The method according to claim 1, characterized in that The generating a plurality of test data according to the total number of entities to be generated, the total number of entity relationships to be generated, the node configuration file and the relationship configuration file comprises: Obtaining the total number of entities to be generated and the total number of entity relationships to be generated; Read the node configuration file and the relationship configuration file to obtain the node attribute corresponding to each of the target nodes, the proportion of the number of entities corresponding to each of the target nodes, the relationship attribute corresponding to each of the target relationships, and the proportion of the number of entity relationships corresponding to each of the target relationships; Generate multiple test entities corresponding to each target node according to the total number of entities to be generated, the node attributes corresponding to each target node, and the proportion of the number of entities corresponding to each target node; Generate multiple test entity relationships corresponding to each target relationship according to the multiple test entities, the total number of entity relationships to be generated, the relationship attributes corresponding to each target relationship, and the proportion of the number of entity relationships corresponding to each target relationship; A plurality of the test data are generated according to the plurality of the test entities and the plurality of the test entity relationships.
3. The method according to claim 1, characterized in that The generating a plurality of test data according to the total number of entities to be generated, the total number of entity relationships to be generated, the node configuration file and the relationship configuration file comprises: Obtain a preset script, wherein the preset script records the total number of entities to be generated and the total number of entity relationships to be generated; Execute the preset script so that the preset script reads the node configuration file and the relationship configuration file to obtain the node attributes corresponding to each of the target nodes, the proportion of the number of entities corresponding to each of the target nodes, the relationship attributes corresponding to each of the target relationships, and the proportion of the number of entity relationships corresponding to each of the target relationships; generate multiple test entities corresponding to each of the target nodes according to the total number of entities to be generated, the node attributes corresponding to each of the target nodes, and the proportion of the number of entities corresponding to each of the target nodes; generate multiple test entity relationships corresponding to each of the target relationships according to the multiple test entities, the total number of entity relationships to be generated, the relationship attributes corresponding to each of the target relationships, and the proportion of the number of entity relationships corresponding to each of the target relationships; and generate multiple test data according to the multiple test entities and the multiple test entity relationships.
4. The method according to claim 3, characterized in that The method further comprises: Receive a script generation request, wherein the script generation request includes the total number of entities to be generated and the total number of entity relationships to be generated; The preset script is generated according to the total number of entities to be generated and the total number of entity relationships to be generated.
5. The method according to claim 3 or 4, characterized in that: The preset script is specifically a python script.
6. A test data generating device, characterized in that: include: An acquisition unit is used to acquire a node configuration file and a relationship configuration file, wherein the node configuration file records the node attributes corresponding to each target node and the proportion of the number of entities corresponding to each target node, and the relationship configuration file records the relationship attributes corresponding to each target relationship and the proportion of the number of entity relationships corresponding to each target relationship; The first generating unit is used to generate a plurality of test data according to the total number of entities to be generated, the total number of entity relationships to be generated, the node configuration file and the relationship configuration file.
7. The device according to claim 6, characterized in that The first generation unit is specifically used to: obtain the total number of entities to be generated and the total number of entity relationships to be generated; read the node configuration file and the relationship configuration file to obtain the node attributes corresponding to each of the target nodes, the proportion of the number of entities corresponding to each of the target nodes, the relationship attributes corresponding to each of the target relationships, and the proportion of the number of entity relationships corresponding to each of the target relationships; Generate multiple test entities corresponding to each target node according to the total number of entities to be generated, the node attributes corresponding to each target node, and the proportion of the number of entities corresponding to each target node; Generate multiple test entity relationships corresponding to each target relationship according to the multiple test entities, the total number of entity relationships to be generated, the relationship attributes corresponding to each target relationship, and the proportion of the number of entity relationships corresponding to each target relationship; A plurality of the test data are generated according to the plurality of the test entities and the plurality of the test entity relationships.
8. The device according to claim 6, characterized in that The first generation unit is specifically used to: obtain a preset script, wherein the preset script records the total number of entities to be generated and the total number of entity relationships to be generated; execute the preset script so that the preset script reads the node configuration file and the relationship configuration file to obtain the node attributes corresponding to each of the target nodes, the proportion of the number of entities corresponding to each of the target nodes, the relationship attributes corresponding to each of the target relationships, and the proportion of the number of entity relationships corresponding to each of the target relationships, and generate multiple test entities corresponding to each of the target nodes according to the total number of entities to be generated, the node attributes corresponding to each of the target nodes, and the proportion of the number of entities corresponding to each of the target nodes; generate multiple test entity relationships corresponding to each of the target relationships according to the multiple test entities, the total number of entity relationships to be generated, the relationship attributes corresponding to each of the target relationships, and the proportion of the number of entity relationships corresponding to each of the target relationships; and generate multiple test data according to the multiple test entities and the multiple test entity relationships.
9. A storage medium, characterized in that: The storage medium includes a stored program, wherein when the program is executed, the device where the storage medium is located is controlled to execute the test data generating method according to any one of claims 1 to 5.
10. A test data generating device, characterized in that: The device includes a storage medium; and one or more processors, the storage medium is coupled to the processor, and the processor is configured to execute program instructions stored in the storage medium; when the program instructions are executed, the test data generation method described in any one of claims 1 to 5 is executed.