CN112579604A - Test system number making method, device, equipment and storage medium - Google Patents
Test system number making method, device, equipment and storage medium Download PDFInfo
- Publication number
- CN112579604A CN112579604A CN202011544922.0A CN202011544922A CN112579604A CN 112579604 A CN112579604 A CN 112579604A CN 202011544922 A CN202011544922 A CN 202011544922A CN 112579604 A CN112579604 A CN 112579604A
- Authority
- CN
- China
- Prior art keywords
- data
- text file
- target
- database
- field
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000012360 testing method Methods 0.000 title claims abstract description 71
- 238000000034 method Methods 0.000 title claims abstract description 46
- 238000004519 manufacturing process Methods 0.000 claims abstract description 59
- 238000003780 insertion Methods 0.000 claims abstract description 53
- 230000037431 insertion Effects 0.000 claims abstract description 53
- 238000006243 chemical reaction Methods 0.000 claims abstract description 42
- 230000006870 function Effects 0.000 claims description 57
- 230000009466 transformation Effects 0.000 claims 2
- 238000005516 engineering process Methods 0.000 abstract description 4
- 238000010586 diagram Methods 0.000 description 6
- 230000008569 process Effects 0.000 description 4
- 238000012545 processing Methods 0.000 description 3
- 239000000284 extract Substances 0.000 description 2
- 238000011056 performance test Methods 0.000 description 2
- 230000005540 biological transmission Effects 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000002085 persistent effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000001052 transient effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/22—Indexing; Data structures therefor; Storage structures
- G06F16/2282—Tablespace storage structures; Management thereof
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/16—File or folder operations, e.g. details of user interfaces specifically adapted to file systems
- G06F16/164—File meta data generation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/242—Query formulation
- G06F16/2433—Query languages
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Mathematical Physics (AREA)
- Computational Linguistics (AREA)
- Human Computer Interaction (AREA)
- Software Systems (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention relates to the technical field of big data, and discloses a method, a device, equipment and a storage medium for manufacturing a number of a test system, which are used for reducing the time length of manufacturing the number and improving the efficiency of manufacturing the number. The number making method of the test system comprises the following steps: acquiring a query statement, and acquiring a data field from a database according to the query statement, wherein the data field is a field for storing a data object; acquiring a conversion instruction, executing the conversion instruction, and determining target text file data according to the data field, wherein the target text file data at least comprises an acquisition mode parameter, a data range parameter and a unit execution quantity parameter; acquiring a number instruction, executing the number instruction according to target text file data, and generating target list data; and inserting the target list data into the database by adopting a preset insertion function to obtain a target data table. In addition, the invention also relates to a block chain technology, and the data field can be stored in the block chain.
Description
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a method, an apparatus, a device, and a storage medium for generating a test result.
Background
With the development of science and technology, the functional requirements of people on databases, application software and systems are continuously increased, and developers also continuously improve the performance levels of the databases, the application software and the systems, so that the developers need to test the databases, the application software and the systems for many times before terminals leave factories and before the application software or the systems are put on shelves, and the databases, the application software and the systems can be tested manually or automatically by adopting an automatic testing system.
At present, an automatic testing system is mainly adopted to test application software and a system, when a performance test is carried out on a structured query language database under the environment of an existing open source relational database, tens of millions of data are involved to carry out the performance test, and at the moment, the number making is required.
Disclosure of Invention
The invention provides a method, a device, equipment and a storage medium for manufacturing a test system, which are used for reducing the time length of manufacturing the number and improving the manufacturing efficiency.
The invention provides a number making method of a test system in a first aspect, which comprises the following steps: acquiring a query statement, and acquiring a data field from a database according to the query statement, wherein the data field is a field for storing a data object; acquiring a conversion instruction, executing the conversion instruction, and determining target text file data according to the data field, wherein the target text file data at least comprises an acquisition mode parameter, a data range parameter and a unit execution quantity parameter; acquiring a number instruction, executing the number instruction according to the target text file data, and generating target list data; and inserting the target list data into the database by adopting a preset insertion function to obtain a target data table.
Optionally, in a first implementation manner of the first aspect of the present invention, the obtaining a query statement and obtaining a data field from a database according to the query statement, where the data field is a field for storing a data object includes: acquiring a query instruction; executing the query instruction according to the query statement, and determining a corresponding database table in a database; and extracting a data field corresponding to the query instruction from the database table, wherein the data field is a field for storing a data object.
Optionally, in a second implementation manner of the first aspect of the present invention, the obtaining a conversion instruction, and executing the conversion instruction to determine target text file data according to the data field, where the target text file data at least includes an obtaining mode parameter, a data range parameter, and a unit execution quantity parameter includes: acquiring a conversion instruction, executing the conversion instruction, and converting the data field into initial text file data, wherein the initial text file data is file data in a text format; and carrying out parametric configuration on the initial text file data to obtain target text file data, wherein the target text file data at least comprises an acquisition mode parameter, a data range parameter and a unit execution quantity parameter.
Optionally, in a third implementation manner of the first aspect of the present invention, the performing parameterization configuration on the initial text file data to obtain target text file data, where the target text file data at least includes an acquisition mode parameter, a data range parameter, and a unit execution quantity parameter includes: according to preset keyword parameters, configuring keyword parameters in the initial text file data to obtain text file data after first configuration; according to a preset data acquisition standard, configuring an acquisition mode parameter in the text file data after the first configuration to obtain text file data after the second configuration; according to a preset data range standard, configuring data range parameters in the text file data after the second configuration to obtain the text file data after the third configuration; and according to a preset unit execution quantity parameter, configuring the unit execution quantity parameter in the text file data after the third configuration to obtain target text file data.
Optionally, in a fourth implementation manner of the first aspect of the present invention, the inserting the target list data into the database by using a preset insertion function to obtain the target data table includes: creating a database table to be inserted in a database, wherein the database table to be inserted comprises a database table name, a separator rule and a text representation rule; and inserting the target list data into the database table to be inserted by adopting a preset insertion function to obtain a target database table.
Optionally, in a fifth implementation manner of the first aspect of the present invention, the inserting the target list data into the database table to be inserted by using a preset insertion function to obtain the target database table includes: reading a class file object from the target list data by adopting a preset insertion function, wherein the class file object at least comprises a byte data reading method and a line data reading method; reading buffer space data of a database table by adopting the insertion function; reading byte data of the class file object, and inserting the class file object into the database table to be inserted by adopting the insertion function based on the delimiter rule and the text representation rule when the space data of the buffer area is larger than the byte data of the class file object to obtain a target database table.
Optionally, in a sixth implementation manner of the first aspect of the present invention, before the obtaining the query statement and obtaining a data field from a database according to the query statement, where the data field is a field for storing a data object, the method for making a number of the test system includes: and acquiring an environment test instruction, and carrying out environment test on the database according to the environment test instruction.
The second aspect of the present invention provides a data generating apparatus of a test system, comprising: the query statement acquisition module is used for acquiring a query statement and acquiring a data field from a database according to the query statement, wherein the data field is a field for storing a data object; the text file data determining module is used for acquiring a conversion instruction and executing the conversion instruction to determine target text file data according to the data field, wherein the target text file data at least comprises an acquisition mode parameter, a data range parameter and a unit execution quantity parameter; the execution module is used for acquiring the number instruction, executing the number instruction according to the target text file data and generating target list data; and the inserting module is used for inserting the target list data into the database by adopting a preset inserting function to obtain a target data table.
Optionally, in a first implementation manner of the second aspect of the present invention, the query statement obtaining module may be further specifically configured to: acquiring a query instruction; executing the query instruction according to the query statement, and determining a corresponding database table in a database; and extracting a data field corresponding to the query instruction from the database table, wherein the data field is a field for storing a data object.
Optionally, in a second implementation manner of the second aspect of the present invention, the text file data determining module includes: the conversion instruction execution unit is used for acquiring a conversion instruction, executing the conversion instruction and converting the data field into initial text file data, wherein the initial text file data is file data in a text format; and the configuration unit is used for carrying out parametric configuration on the initial text file data to obtain target text file data, and the target text file data at least comprises an acquisition mode parameter, a data range parameter and a unit execution quantity parameter.
Optionally, in a third implementation manner of the second aspect of the present invention, the configuration unit may be further specifically configured to: according to preset keyword parameters, configuring keyword parameters in the initial text file data to obtain text file data after first configuration; according to a preset data acquisition standard, configuring an acquisition mode parameter in the text file data after the first configuration to obtain text file data after the second configuration; according to a preset data range standard, configuring data range parameters in the text file data after the second configuration to obtain the text file data after the third configuration; and according to a preset unit execution quantity parameter, configuring the unit execution quantity parameter in the text file data after the third configuration to obtain target text file data.
Optionally, in a fourth implementation manner of the second aspect of the present invention, the insertion module includes: the system comprises a creating unit, a searching unit and a processing unit, wherein the creating unit is used for creating a database table to be inserted in a database, and the database table to be inserted comprises a database table name, a delimiter rule and a text representation rule; and the inserting unit is used for inserting the target list data into the database table to be inserted by adopting a preset inserting function to obtain a target data table.
Optionally, in a fifth implementation manner of the second aspect of the present invention, the insertion unit may further be specifically configured to: reading a class file object from the target list data by adopting a preset insertion function, wherein the class file object at least comprises a byte data reading method and a line data reading method; reading buffer space data of a database table by adopting the insertion function; reading byte data of the class file object, and inserting the class file object into the database table to be inserted by adopting the insertion function based on the delimiter rule and the text representation rule when the space data of the buffer area is larger than the byte data of the class file object to obtain a target database table.
Optionally, in a sixth implementation manner of the second aspect of the present invention, the apparatus for testing number of data sets further includes: and the environment testing module is used for acquiring an environment testing instruction and carrying out environment testing on the database according to the environment testing instruction.
A third aspect of the present invention provides a data creation apparatus for a test system, comprising: a memory and at least one processor, the memory having instructions stored therein; the at least one processor calls the instructions in the memory to cause the manufacturing equipment of the test system to execute the manufacturing method of the test system described above.
A fourth aspect of the present invention provides a computer-readable storage medium having stored therein instructions, which, when run on a computer, cause the computer to execute the above-described method of manufacturing a test system.
According to the technical scheme, a query statement is obtained, and a data field is obtained from a database according to the query statement, wherein the data field is a field for storing a data object; acquiring a conversion instruction, executing the conversion instruction, and determining target text file data according to the data field, wherein the target text file data at least comprises an acquisition mode parameter, a data range parameter and a unit execution quantity parameter; acquiring a number instruction, executing the number instruction according to the target text file data, and generating target list data; and inserting the target list data into the database by adopting a preset insertion function to obtain a target data table. In the embodiment of the invention, a data field is converted into target text file data comprising configuration parameters, then data are manufactured according to the target text file data to generate target list data, and finally a copy _ from insertion function is called to insert the target list data into a database to obtain a target data list; by manufacturing data using the target text file data parameters including configuration parameters and the copy _ from insertion function, the number manufacturing time is reduced and the number manufacturing efficiency is improved.
Drawings
FIG. 1 is a diagram of an embodiment of a method for manufacturing a test system according to an embodiment of the present invention;
FIG. 2 is a diagram of another embodiment of a method for manufacturing a test system according to an embodiment of the present invention;
FIG. 3 is a diagram of an embodiment of a data structure of a test system according to the present invention;
FIG. 4 is a diagram of another embodiment of a data logging device of the test system according to the embodiment of the present invention;
FIG. 5 is a diagram of an embodiment of a data creation device of a test system according to an embodiment of the present invention.
Detailed Description
The embodiment of the invention provides a method, a device, equipment and a storage medium for manufacturing a test system, which are used for reducing the time length of manufacturing the number and improving the efficiency of manufacturing the number.
The terms "first," "second," "third," "fourth," and the like in the description and in the claims, as well as in the drawings, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It will be appreciated that the data so used may be interchanged under appropriate circumstances such that the embodiments described herein may be practiced otherwise than as specifically illustrated or described herein. Furthermore, the terms "comprises," "comprising," or "having," and any variations thereof, are intended to cover non-exclusive inclusions, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
For ease of understanding, a detailed flow of an embodiment of the present invention is described below, and referring to fig. 1, an embodiment of a method for manufacturing a test system in an embodiment of the present invention includes:
101. acquiring a query statement, and acquiring a data field from a database according to the query statement, wherein the data field is a field for storing a data object;
the server obtains the query statement and reads the data field as the storage data object in the database according to the query statement. It is emphasized that the data fields may also be stored in nodes of a block chain in order to further ensure privacy and security of the data fields.
The Query statement is Structured Query Language (SQL), by which data fields can be queried from a database. Each database comprises an identifier or a field identifier of a data table, one database comprises one data table or a plurality of data tables, each data table can carry a specific field or a plurality of specific fields (namely fields for storing data objects), and each field comprises a plurality of record data, such as a 'user name' field, corresponding to 'user sex' record data, user age 'record data, user mobile phone number' record data and the like. The server adopts the executable query statement to acquire the data field in the database according to the field of the database table.
It is to be understood that the execution subject of the present invention may be a manufacturing apparatus of a test system, and may also be a terminal or a server, which is not limited herein. The embodiment of the present invention is described by taking a server as an execution subject.
102. Acquiring a conversion instruction, executing the conversion instruction, and determining target text file data according to the data field, wherein the target text file data at least comprises an acquisition mode parameter, a data range parameter and a unit execution quantity parameter;
the server executes the conversion instruction, and converts the data field into target text file data at least comprising an acquisition mode parameter, a data range parameter and an execution time parameter.
For example, assuming that the data fields extracted by the server are [ id, number, name, created _ by, and date _ created ], when the server acquires the conversion instruction, the conversion instruction is executed to convert the data fields of [ id, number, name, created _ by, and date _ created ] into the target text file data, which is shown as follows:
===========attributes===============
id:9d5d110FAjiayb${order[1500001,999999999]}
number:LFAjiayb${order[1500001,999999999]}
name:FAjiayb${order[1500001,999999999]}
created_by:jiayibing
date_created:2020-09-29 11:20:01
===============================
circles:300000
===============================
where, order is the acquisition mode parameter, [1500001,999999999] is the data range parameter, and 300000 is the unit execution number parameter.
103. Acquiring a number instruction, executing the number instruction according to target text file data, and generating target list data;
the server acquires the number instruction and executes the number instruction according to the target text file data, and at the moment, the server performs the number according to the acquisition mode parameter, the data range parameter and the unit execution number parameter in the target text file to generate target list data.
For example, assuming that the target text file is the example 102, the server executes the token instruction to generate the target list data as follows: [ { id:9d5d110FAjiayb1, number: LFAjiayb1, name: FAjiayb1, created _ by: jiayibing, date _ created:2020-09-2911:20:01}, { id:9d5d110FAjiayb2, number: LFAjiayb2, name: FAjiayb2, created _ by: jiayibing, date _ created:2020-09-2911:20:01} … … ], each data is unique, and since the number of unit executions parameter is 300000, the target list data obtained by executing one-time number instruction is 30 pieces.
104. And inserting the target list data into the database by adopting a preset insertion function to obtain a target data table.
And the server inserts the target list data into the database by adopting a preset insertion function to obtain a target data table, wherein the insertion function is copy _ from.
In the embodiment, the copy _ from is adopted to insert the target list data into the database, when 10 thousands of data are inserted into the database, the target list data can be inserted into the database in 15 seconds by adopting the function, while the existing jmeter needs 5 minutes to insert 10 thousands of data, the function shortens the data insertion time, and the data insertion efficiency is improved.
In the embodiment of the invention, a data field is converted into target text file data comprising configuration parameters, then data are manufactured according to the target text file data to generate target list data, and finally a copy _ from insertion function is called to insert the target list data into a database to obtain a target data list; by manufacturing data using the target text file data parameters including configuration parameters and the copy _ from insertion function, the number manufacturing time is reduced and the number manufacturing efficiency is improved.
Referring to fig. 2, another embodiment of the method for manufacturing a test system according to the embodiment of the present invention includes:
201. acquiring an environment test instruction, and carrying out environment test on the database according to the environment test instruction;
after the server obtains the environment test instruction, the server carries out environment test on the database according to the environment test instruction, and therefore a stable and controllable operation environment is created for the task of constructing data. Before the server conducts the manufacture number, the environment test is firstly conducted on the database, so that the database can conduct the manufacture number in a stable and controllable environment, and the influence of the change of the environment on the manufacture number work is reduced.
202. Acquiring a query statement, and acquiring a data field from a database according to the query statement, wherein the data field is a field for storing a data object;
the server obtains the query statement and reads the data field as the storage data object in the database according to the query statement. It is emphasized that the data fields may also be stored in nodes of a block chain in order to further ensure privacy and security of the data fields.
The Query statement is Structured Query Language (SQL), by which data fields can be queried from a database. Each database comprises an identifier or a field identifier of a data table, one database comprises one data table or a plurality of data tables, each data table can carry a specific field or a plurality of specific fields (namely fields for storing data objects), and each field comprises a plurality of record data, such as a 'user name' field, corresponding to 'user sex' record data, user age 'record data, user mobile phone number' record data and the like. The server adopts the executable query statement to acquire the data field in the database according to the field of the database table.
Specifically, the server acquires a query instruction; the server executes the query instruction according to the query statement and determines a corresponding database table in the database; and the server extracts the data fields corresponding to the query instructions from the database table, wherein the data fields are fields for storing data objects.
The server firstly obtains a query instruction, wherein the query instruction is a query instruction sent by a user through a terminal, the query instruction can be used for obtaining 'financial data of company i', the server judges whether the query statement can be executed, if the database comprises a data table identifier or a field identifier matched with the query instruction, the query statement can be executed, otherwise, the query statement cannot be executed. The server executes a query instruction according to an executable query statement, for example, "select from _ free _ table i limit 1" in a database, determines a corresponding database table as "financial data of company i", and then extracts a data field corresponding to the query instruction of "financial data of company i" from the database table.
203. Acquiring a conversion instruction, executing the conversion instruction, and determining target text file data according to the data field, wherein the target text file data at least comprises an acquisition mode parameter, a data range parameter and a unit execution quantity parameter;
the server executes the conversion instruction, and converts the data field into target text file data at least comprising an acquisition mode parameter, a data range parameter and an execution time parameter.
For example, assuming that the data fields extracted by the server are [ id, number, name, created _ by, and date _ created ], when the server acquires the conversion instruction, the conversion instruction is executed to convert the data fields of [ id, number, name, created _ by, and date _ created ] into the target text file data, which is shown as follows:
===========attributes===============
id:9d5d110FAjiayb${order[1500001,999999999]}
number:LFAjiayb${order[1500001,999999999]}
name:FAjiayb${order[1500001,999999999]}
created_by:jiayibing
date_created:2020-09-29 11:20:01
===============================
circles:300000
===============================
where, order is the acquisition mode parameter, [1500001,999999999] is the data range parameter, and 300000 is the unit execution number parameter.
Specifically, the server acquires a conversion instruction, executes the conversion instruction, and converts the data field into initial text file data, wherein the initial text file data is file data in a text format; and the server carries out parametric configuration in the initial text file data to obtain target text file data, wherein the target text file data at least comprises an acquisition mode parameter, a data range parameter and a unit execution quantity parameter.
The server acquires the conversion instruction and then executes the conversion instruction to convert the data field into the initial text file data formatted in a text format, for example, to convert the numeric fields [ id, number, name, created _ by, date _ created ] into the initial text file data as shown below:
===========attributes===============
id:9d5d110
number:LF
name:
created_by:
date_created:2020-09-29 11:20:01
and then the server carries out parameterization configuration in the initial text file data to obtain the target text file data in the second step.
The server carries out parameterization configuration in the initial text file data to obtain target text file data, wherein the target text file data at least comprises an acquisition mode parameter, a data range parameter and a unit execution quantity parameter, and the acquisition mode parameter, the data range parameter and the unit execution quantity parameter comprise:
configuring key word parameters in the initial text file data according to preset key word parameters to obtain the text file data after the first configuration; according to a preset data acquisition standard, configuring an acquisition mode parameter in the text file data after the first configuration to obtain the text file data after the second configuration; configuring data range parameters in the text file data after the second configuration according to a preset data range standard to obtain text file data after the third configuration; and according to the preset unit execution quantity parameter, configuring the unit execution quantity parameter in the text file data after the third configuration to obtain the target text file data.
The server firstly obtains preset keyword parameters, and then configures the keyword parameters in the initial text file data to obtain the text file data after the first configuration, wherein the keywords can be names, such as FAjiayb; the server performs configuration of an acquisition mode parameter in the text file data after the first configuration based on a preset data acquisition standard to obtain the text file data after the second configuration, wherein the acquisition mode parameter can be an order and a random, the order represents a parameter when acquiring sequential data, and the random represents a parameter when acquiring random data. And then configuring data range parameters in the text file data after the second configuration by referring to preset data range standards to obtain text file data after the third configuration, wherein the data range parameters are set to [1500001,999999999] in the embodiment, and in other embodiments, the data range parameters may be other parameters. Finally, in the text file data after the third configuration, the unit execution quantity parameter is configured by referring to the preset unit execution quantity parameter, so as to obtain the target text file data, where the unit execution quantity parameter is a single execution quantity parameter, in this embodiment, the parameter is 300000, and the specific result of the target text file data is as in the example style in step 203.
204. Acquiring a number instruction, executing the number instruction according to target text file data, and generating target list data;
the server acquires the number instruction and executes the number instruction according to the target text file data, and at the moment, the server performs the number according to the acquisition mode parameter, the data range parameter and the unit execution number parameter in the target text file to generate target list data.
For example, assuming that the target text file is the example 102, the server executes the token instruction to generate the target list data as follows: [ { id:9d5d110FAjiayb1, number: LFAjiayb1, name: FAjiayb1, created _ by: jiayibing, date _ created:2020-09-2911:20:01}, { id:9d5d110FAjiayb2, number: LFAjiayb2, name: FAjiayb2, created _ by: jiayibing, date _ created:2020-09-2911:20:01} … … ], each data is unique, and since the number of unit executions parameter is 300000, the target list data obtained by executing one-time number instruction is 30 pieces.
205. And inserting the target list data into the database by adopting a preset insertion function to obtain a target data table.
And the server inserts the target list data into the database by adopting a preset insertion function to obtain a target data table, wherein the insertion function is copy _ from.
In the embodiment, the copy _ from is adopted to insert the target list data into the database, when 10 thousands of data are inserted into the database, the target list data can be inserted into the database in 15 seconds by adopting the function, while the existing jmeter needs 5 minutes to insert 10 thousands of data, the function shortens the data insertion time, and the data insertion efficiency is improved.
Specifically, the server creates a database table to be inserted in the database, wherein the database table to be inserted comprises a database table name, a separator rule and a text expression rule; and the server inserts the target list data into the database table to be inserted by adopting a preset insertion function to obtain the target database table.
Firstly, a server creates a database table to be inserted for placing target list data, and then inserts the target list data into the database table to be inserted in a preset insertion function to obtain a target database table.
In this embodiment, creating a database table to be inserted includes creating a database table name, creating a delimiter rule, and creating a text representation rule by calling a create function, where the text representation rule defaults to a character string "\ n".
The server inserts the target list data into a database table to be inserted by adopting a preset insertion function, and the obtaining of the target database table comprises the following steps: the server reads a class file object from the target list data by adopting a preset insertion function, wherein the class file object at least comprises a byte data reading method and a line data reading method; the server reads the buffer space data of the database table by adopting an insertion function; and the server reads the byte data of the class file object, and inserts the class file object into a database table to be inserted by adopting an insertion function based on a separator rule and a text expression rule when the space data of the buffer area is larger than the byte data of the class file object to obtain a target database table.
The server reads a class file object at least comprising a byte data reading method and a line data reading method from target text file data by adopting a preset insertion function, wherein the byte data reading method is used for reading the next byte of the data from the target list data. Returning int byte values in the range of 0 to 255, the line data read method is used to read the entire line of data from the target list data, including the "\ n" character, and if a non-negative number parameter is specified, returning a byte count of the specified size, including the "\ n" character. And then reading cache space data, namely the size of the cache space, of the database table by adopting a copy _ from insertion function, and when the cache space data is larger than the byte data of the class file object, inserting the class file object into the database table comprising the database name by adopting the copy _ from insertion function according to a separator rule and a text representation rule to obtain a target database table.
In the embodiment of the invention, a data field is converted into target text file data comprising configuration parameters, then data are manufactured according to the target text file data to generate target list data, and finally a copy _ from insertion function is called to insert the target list data into a database to obtain a target data list; by manufacturing data using the target text file data parameters including configuration parameters and the copy _ from insertion function, the number manufacturing time is reduced and the number manufacturing efficiency is improved.
With reference to fig. 3, the method for manufacturing a test system in an embodiment of the present invention is described above, and a manufacturing apparatus of a test system in an embodiment of the present invention is described below, where an embodiment of the manufacturing apparatus of a test system in an embodiment of the present invention includes:
a query statement obtaining module 301, configured to obtain a query statement, and obtain a data field from a database according to the query statement, where the data field is a field for storing a data object;
a text file data determining module 302, configured to obtain a conversion instruction, and execute the conversion instruction to determine target text file data according to the data field, where the target text file data at least includes an obtaining mode parameter, a data range parameter, and a unit execution quantity parameter;
an executing module 303, configured to obtain a manufacture instruction, execute the manufacture instruction according to the target text file data, and generate target list data;
an inserting module 304, configured to insert the target list data into the database by using a preset inserting function, so as to obtain a target data table.
In the embodiment of the invention, a data field is converted into target text file data comprising configuration parameters, then data are manufactured according to the target text file data to generate target list data, and finally a copy _ from insertion function is called to insert the target list data into a database to obtain a target data list; by manufacturing data using the target text file data parameters including configuration parameters and the copy _ from insertion function, the number manufacturing time is reduced and the number manufacturing efficiency is improved.
Referring to fig. 4, another embodiment of the manufacturing apparatus of the test system in the embodiment of the present invention includes:
a query statement obtaining module 301, configured to obtain a query statement, and obtain a data field from a database according to the query statement, where the data field is a field for storing a data object;
a text file data determining module 302, configured to obtain a conversion instruction, and execute the conversion instruction to determine target text file data according to the data field, where the target text file data at least includes an obtaining mode parameter, a data range parameter, and a unit execution quantity parameter;
an executing module 303, configured to obtain a manufacture instruction, execute the manufacture instruction according to the target text file data, and generate target list data;
an inserting module 304, configured to insert the target list data into the database by using a preset inserting function, so as to obtain a target data table.
Optionally, the query statement obtaining module 301 may be further specifically configured to:
acquiring a query instruction;
executing the query instruction according to the query statement, and determining a corresponding database table in a database;
and extracting a data field corresponding to the query instruction from the database table, wherein the data field is a field for storing a data object.
Optionally, the text file data determining module 302 includes:
a conversion instruction executing unit 3021, configured to obtain a conversion instruction, execute the conversion instruction, and convert the data field into initial text file data, where the initial text file data is file data in a text format;
a configuration unit 3022, configured to perform parameterization configuration on the initial text file data to obtain target text file data, where the target text file data at least includes an acquisition mode parameter, a data range parameter, and a unit execution quantity parameter.
Optionally, the configuration unit 3022 may be further specifically configured to:
according to preset keyword parameters, configuring keyword parameters in the initial text file data to obtain text file data after first configuration;
according to a preset data acquisition standard, configuring an acquisition mode parameter in the text file data after the first configuration to obtain text file data after the second configuration;
according to a preset data range standard, configuring data range parameters in the text file data after the second configuration to obtain the text file data after the third configuration;
and according to a preset unit execution quantity parameter, configuring the unit execution quantity parameter in the text file data after the third configuration to obtain target text file data.
Optionally, the inserting module 304 includes:
a creating unit 3041, configured to create a database table to be inserted in a database, where the database table to be inserted includes a database table name, a delimiter rule, and a text expression rule;
an inserting unit 3042, configured to insert the target list data into the database table to be inserted by using a preset inserting function, so as to obtain a target database table.
Optionally, the inserting unit 3042 may be further specifically configured to:
reading a class file object from the target list data by adopting a preset insertion function, wherein the class file object at least comprises a byte data reading method and a line data reading method;
reading buffer space data of a database table by adopting the insertion function;
reading byte data of the class file object, and inserting the class file object into the database table to be inserted by adopting the insertion function based on the delimiter rule and the text representation rule when the space data of the buffer area is larger than the byte data of the class file object to obtain a target database table.
Optionally, the number making device of the test system further includes:
and the environment testing module 305 is configured to obtain an environment testing instruction, and perform an environment test on the database according to the environment testing instruction.
In the embodiment of the invention, a data field is converted into target text file data comprising configuration parameters, then data are manufactured according to the target text file data to generate target list data, and finally a copy _ from insertion function is called to insert the target list data into a database to obtain a target data list; by manufacturing data using the target text file data parameters including configuration parameters and the copy _ from insertion function, the number manufacturing time is reduced and the number manufacturing efficiency is improved.
Fig. 3 and 4 describe the manufacturing apparatus of the test system in the embodiment of the present invention in detail from the perspective of the modular functional entity, and the manufacturing apparatus of the test system in the embodiment of the present invention is described in detail from the perspective of hardware processing.
Fig. 5 is a schematic structural diagram of a manufacturing apparatus of a test system according to an embodiment of the present invention, where the manufacturing apparatus 500 of the test system may have a relatively large difference due to different configurations or performances, and may include one or more processors (CPUs) 510 (e.g., one or more processors) and a memory 520, and one or more storage media 530 (e.g., one or more mass storage devices) for storing applications 533 or data 532. Memory 520 and storage media 530 may be, among other things, transient or persistent storage. The program stored on the storage medium 530 may include one or more modules (not shown), each of which may include a series of instruction operations for the manufacturing equipment 500 of the test system. Further, the processor 510 may be configured to communicate with the storage medium 530 to execute a series of instruction operations in the storage medium 530 on the manufacturing device 500 of the test system.
The test system's build device 500 may also include one or more power supplies 540, one or more wired or wireless network interfaces 550, one or more input-output interfaces 560, and/or one or more operating systems 531, such as Windows Server, Mac OS X, Unix, Linux, FreeBSD, and the like. It will be appreciated by those skilled in the art that the configuration of the manufacturing apparatus of the test system shown in figure 5 does not constitute a limitation of the manufacturing apparatus of the test system and may include more or fewer components than shown, or some components may be combined, or a different arrangement of components.
The invention also provides a manufacturing device of a test system, which comprises a memory and a processor, wherein computer readable instructions are stored in the memory, and when the computer readable instructions are executed by the processor, the processor executes the steps of the manufacturing method of the test system in the embodiments.
The present invention also provides a computer readable storage medium, which may be a non-volatile computer readable storage medium, and which may also be a volatile computer readable storage medium, having stored therein instructions, which, when run on a computer, cause the computer to perform the steps of the method of manufacturing a test system.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
The block chain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a read-only memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.
Claims (10)
1. A method for manufacturing a test system, the method comprising:
acquiring a query statement, and acquiring a data field from a database according to the query statement, wherein the data field is a field for storing a data object;
acquiring a conversion instruction, executing the conversion instruction, and determining target text file data according to the data field, wherein the target text file data at least comprises an acquisition mode parameter, a data range parameter and a unit execution quantity parameter;
acquiring a number instruction, executing the number instruction according to the target text file data, and generating target list data;
and inserting the target list data into the database by adopting a preset insertion function to obtain a target data table.
2. The method according to claim 1, wherein the obtaining a query statement and obtaining a data field from a database according to the query statement, the data field being a field for storing a data object comprises:
acquiring a query instruction;
executing the query instruction according to the query statement, and determining a corresponding database table in a database;
and extracting a data field corresponding to the query instruction from the database table, wherein the data field is a field for storing a data object.
3. The method of claim 1, wherein the obtaining a transformation command and executing the transformation command determines target text file data according to the data field, the target text file data at least comprising an obtaining mode parameter, a data range parameter, and a unit execution quantity parameter comprises:
acquiring a conversion instruction, executing the conversion instruction, and converting the data field into initial text file data, wherein the initial text file data is file data in a text format;
and carrying out parametric configuration on the initial text file data to obtain target text file data, wherein the target text file data at least comprises an acquisition mode parameter, a data range parameter and a unit execution quantity parameter.
4. The method according to claim 3, wherein the parameterization configuration is performed on the initial text file data to obtain target text file data, and the target text file data at least comprises an acquisition mode parameter, a data range parameter and a unit execution quantity parameter, and comprises:
according to preset keyword parameters, configuring keyword parameters in the initial text file data to obtain text file data after first configuration;
according to a preset data acquisition standard, configuring an acquisition mode parameter in the text file data after the first configuration to obtain text file data after the second configuration;
according to a preset data range standard, configuring data range parameters in the text file data after the second configuration to obtain the text file data after the third configuration;
and according to a preset unit execution quantity parameter, configuring the unit execution quantity parameter in the text file data after the third configuration to obtain target text file data.
5. The method as claimed in claim 1, wherein said inserting the target list data into the database by using a preset insertion function to obtain a target data table comprises:
creating a database table to be inserted in a database, wherein the database table to be inserted comprises a database table name, a separator rule and a text representation rule;
and inserting the target list data into the database table to be inserted by adopting a preset insertion function to obtain a target database table.
6. The method as claimed in claim 5, wherein said inserting the target list data into the database table to be inserted by using a preset insertion function to obtain a target data table comprises:
reading a class file object from the target list data by adopting a preset insertion function, wherein the class file object at least comprises a byte data reading method and a line data reading method;
reading buffer space data of a database table by adopting the insertion function;
reading byte data of the class file object, and inserting the class file object into the database table to be inserted by adopting the insertion function based on the delimiter rule and the text representation rule when the space data of the buffer area is larger than the byte data of the class file object to obtain a target database table.
7. The method according to any one of claims 1 to 5, wherein before the obtaining of the query statement and the obtaining of the data field from the database according to the query statement, the data field being a field for storing a data object, the method comprises:
and acquiring an environment test instruction, and carrying out environment test on the database according to the environment test instruction.
8. A test system counter device, comprising:
the query statement acquisition module is used for acquiring a query statement and acquiring a data field from a database according to the query statement, wherein the data field is a field for storing a data object;
the text file data determining module is used for acquiring a conversion instruction and executing the conversion instruction to determine target text file data according to the data field, wherein the target text file data at least comprises an acquisition mode parameter, a data range parameter and a unit execution quantity parameter;
the execution module is used for acquiring the number instruction, executing the number instruction according to the target text file data and generating target list data;
and the inserting module is used for inserting the target list data into the database by adopting a preset inserting function to obtain a target data table.
9. A test system manufacturing apparatus, comprising: a memory and at least one processor, the memory having instructions stored therein;
the at least one processor invoking the instructions in the memory to cause a manufacturing device of the test system to perform a manufacturing method of the test system of any of claims 1-7.
10. A computer-readable storage medium having instructions stored thereon, wherein the instructions, when executed by a processor, implement a method of manufacturing a test system according to any of claims 1-7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011544922.0A CN112579604A (en) | 2020-12-23 | 2020-12-23 | Test system number making method, device, equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011544922.0A CN112579604A (en) | 2020-12-23 | 2020-12-23 | Test system number making method, device, equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN112579604A true CN112579604A (en) | 2021-03-30 |
Family
ID=75139351
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011544922.0A Pending CN112579604A (en) | 2020-12-23 | 2020-12-23 | Test system number making method, device, equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112579604A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113051178A (en) * | 2021-04-21 | 2021-06-29 | 平安普惠企业管理有限公司 | Test data construction method, device, equipment and medium |
CN114138819A (en) * | 2021-12-08 | 2022-03-04 | 中国建设银行股份有限公司 | Data processing method and device |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109815122A (en) * | 2018-12-15 | 2019-05-28 | 深圳壹账通智能科技有限公司 | Test data generating method, device, electronic equipment and storage medium |
CN110908891A (en) * | 2019-09-18 | 2020-03-24 | 泰康保险集团股份有限公司 | Test data generation method and device, electronic equipment and storage medium |
CN111176976A (en) * | 2019-08-05 | 2020-05-19 | 腾讯科技(深圳)有限公司 | Test data generation method and device, storage medium and electronic device |
CN111752549A (en) * | 2020-06-24 | 2020-10-09 | 中国银行股份有限公司 | SQL function generation method and device |
-
2020
- 2020-12-23 CN CN202011544922.0A patent/CN112579604A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109815122A (en) * | 2018-12-15 | 2019-05-28 | 深圳壹账通智能科技有限公司 | Test data generating method, device, electronic equipment and storage medium |
CN111176976A (en) * | 2019-08-05 | 2020-05-19 | 腾讯科技(深圳)有限公司 | Test data generation method and device, storage medium and electronic device |
CN110908891A (en) * | 2019-09-18 | 2020-03-24 | 泰康保险集团股份有限公司 | Test data generation method and device, electronic equipment and storage medium |
CN111752549A (en) * | 2020-06-24 | 2020-10-09 | 中国银行股份有限公司 | SQL function generation method and device |
Non-Patent Citations (1)
Title |
---|
HEIDI1992: "Python百万级数据通过插入函数批量插入postgreSQL数据库, copy_from()执行效率完胜executemany()和to_sql()方法", pages 1 - 2, Retrieved from the Internet <URL:http://blog.csdn.net/skye1208/article/details/90264431, CSDN> * |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113051178A (en) * | 2021-04-21 | 2021-06-29 | 平安普惠企业管理有限公司 | Test data construction method, device, equipment and medium |
CN114138819A (en) * | 2021-12-08 | 2022-03-04 | 中国建设银行股份有限公司 | Data processing method and device |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111722839B (en) | Code generation method and device, electronic equipment and storage medium | |
JP5298117B2 (en) | Data merging in distributed computing | |
EP2597573B1 (en) | Test data generation | |
CN108984155B (en) | Data processing flow setting method and device | |
CN111177788A (en) | Hive dynamic desensitization method and dynamic desensitization system | |
CN104572122A (en) | Software application data generating device and method | |
CN112860727B (en) | Data query method, device, equipment and medium based on big data query engine | |
CN105550206B (en) | The edition control method and device of structured query sentence | |
US20050120014A1 (en) | System and method for generating SQL using templates | |
CN112579604A (en) | Test system number making method, device, equipment and storage medium | |
CN113836038A (en) | Test data construction method, device, equipment and storage medium | |
CN114238381A (en) | Data quality checking method, device and computer readable storage medium | |
JP5651050B2 (en) | Data generation apparatus and data generation program | |
CN111159040A (en) | Test data generation method, device, equipment and storage medium | |
CN113297251A (en) | Multi-source data retrieval method, device, equipment and storage medium | |
CN112433753A (en) | Interface document generation method, device, equipment and medium based on parameter information | |
CN111078668B (en) | Data generation method and device, electronic equipment and storage medium | |
CN113868138A (en) | Method, system, equipment and storage medium for acquiring test data | |
CN112835901A (en) | File storage method and device, computer equipment and computer readable storage medium | |
CN113076365A (en) | Data synchronization method and device, electronic equipment and storage medium | |
CN114547404B (en) | Big data platform system | |
CN115203057B (en) | Low code test automation method, device, equipment and storage medium | |
CN115168399B (en) | Data processing method, device and equipment based on graphical interface and storage medium | |
CN116661758B (en) | Method, device, electronic equipment and medium for optimizing log framework configuration | |
CN118193561A (en) | Database initialization method and device for application deployment |
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 |