CN113127321B - Data reading method, device and equipment based on Jmeter and storage medium - Google Patents

Data reading method, device and equipment based on Jmeter and storage medium Download PDF

Info

Publication number
CN113127321B
CN113127321B CN202110432226.9A CN202110432226A CN113127321B CN 113127321 B CN113127321 B CN 113127321B CN 202110432226 A CN202110432226 A CN 202110432226A CN 113127321 B CN113127321 B CN 113127321B
Authority
CN
China
Prior art keywords
data
target
database
command
type
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.)
Active
Application number
CN202110432226.9A
Other languages
Chinese (zh)
Other versions
CN113127321A (en
Inventor
汤胜
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Bank Co Ltd
Original Assignee
Ping An Bank Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Bank Co Ltd filed Critical Ping An Bank Co Ltd
Priority to CN202110432226.9A priority Critical patent/CN113127321B/en
Publication of CN113127321A publication Critical patent/CN113127321A/en
Application granted granted Critical
Publication of CN113127321B publication Critical patent/CN113127321B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/34Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
    • G06F11/3409Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment for performance assessment
    • G06F11/3433Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment for performance assessment for load management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/302Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a software system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/34Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
    • G06F11/3466Performance evaluation by tracing or monitoring

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Quality & Reliability (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Telephonic Communication Services (AREA)

Abstract

The embodiment of the invention discloses a data reading method, a data reading device, computer equipment and a storage medium based on a Jmeter, wherein the method comprises the steps of obtaining a database selection instruction of a user to determine a target database; reading a target configuration file of the target database to obtain characteristic parameters of the target database; importing the characteristic parameters into an API (application program interface) of a Jmeter platform to complete the configuration of the API, and establishing a service data link with a target database; determining a target command type according to a data type selection command of a user, and confirming preset command content associated with the target command type; sending the validated command content to the target database over the service data link to retrieve data of a type matching the command content. The invention can enable the Jmeter platform to support the system-level operation commands of the complete database and various types of data.

Description

Data reading method, device and equipment based on Jmeter and storage medium
Technical Field
The present invention relates to the field of data processing, and in particular, to a data reading method and apparatus based on a meter, a computer device, and a storage medium.
Background
Jmeter is a Java-based stress testing tool developed by the Apache organization for stress testing of software, originally designed for Web application testing, but later extended to other testing areas, which can be used for testing static and dynamic resources such as static files, java servlets, CGI scripts, java objects, databases, FTP servers. At present, a test platform is provided as a test tool, but a meter as a platform cannot be completely connected with a Redis database to perform various api interface operations, that is, cannot completely support system level commands of the Redis database and read five data types.
Disclosure of Invention
Embodiments of the present invention provide a data reading method and apparatus based on a meter, a computer device, and a storage medium, which enable a meter platform to support a complete system-level operation command of a database and various types of data.
In a first aspect, an embodiment of the present invention provides a data reading method based on a meter, where the method includes:
acquiring a database selection instruction of a user to determine a target database;
reading a target configuration file of the target database to obtain characteristic parameters of the target database;
importing the characteristic parameters into an API (application program interface) of a Jmeter platform to complete the configuration of the API, and establishing a service data link with a target database;
determining a target command type according to a data type selection command of a user, and confirming preset command content associated with the target command type; wherein different target command types are associated with different command contents;
sending the confirmed command content to the target database over the service data link to retrieve data of a type matching the command content.
In a second aspect, an embodiment of the present invention further provides a data reading apparatus based on a meter, where the apparatus includes:
the database determining unit is used for acquiring a database selection instruction of a user to determine a target database;
the parameter acquisition unit is used for reading a target configuration file of the target database to obtain characteristic parameters of the target database;
the configuration unit is used for importing the characteristic parameters into an API (application program interface) of the Jmeter platform to complete the configuration of the API, and establishing a service data link with a target database;
the content confirmation unit is used for determining a target command type according to a data type selection command of a user and confirming preset command content associated with the target command type; wherein different target command types are associated with different command contents;
a data retrieving unit, configured to send the confirmed command content to the target database through the service data link to retrieve data of a type matching the command content.
In a third aspect, an embodiment of the present invention further provides a computer device, which includes a memory and a processor, where the memory stores a computer program, and the processor implements the above method when executing the computer program.
In a fourth aspect, the present invention also provides a computer-readable storage medium, which stores a computer program, and the computer program can implement the above method when being executed by a processor.
The embodiment of the invention provides a data reading method and device based on a Jmeter, computer equipment and a storage medium. Wherein the method comprises the following steps: acquiring a database selection instruction of a user to determine a target database; reading a target configuration file of the target database to obtain characteristic parameters of the target database; importing the characteristic parameters into an API (application program interface) of a Jmeter platform to complete the configuration of the API, and establishing a service data link with a target database; determining a target command type according to a data type selection command of a user, and confirming preset command content associated with the target command type; wherein different target command types are associated with different command contents; sending the validated command content to the target database over the service data link to retrieve data of a type matching the command content. The embodiment of the invention can enable the Jmeter platform to support commands of different data types to complete corresponding operations or call corresponding data by configuring the characteristic parameters matched with the target data, thereby realizing the support of system-level operation commands of a complete database and data of different types and improving the technical effect of the use experience of users.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a schematic flow chart of a data reading method based on a Jmeter according to an embodiment of the present invention;
fig. 1a is a schematic view of an application scenario of a data reading method based on a meter according to an embodiment of the present invention;
FIG. 2 is a sub-flow diagram of a data reading method based on a Jmeter according to an embodiment of the present invention;
FIG. 3 is a sub-flow diagram of a data reading method based on a Jmeter according to an embodiment of the present invention;
FIG. 4 is a sub-flow diagram illustrating a method for reading data based on a Jmeter according to an embodiment of the present invention;
FIG. 5 is a flowchart illustrating a data reading method based on a Jmeter according to another embodiment of the present invention;
FIG. 6 is a schematic block diagram of a Jmeter-based data reading apparatus according to an embodiment of the present invention;
FIG. 7 is a schematic block diagram of a database determination unit of a Jmeter-based data reading apparatus according to an embodiment of the present invention;
FIG. 8 is a schematic block diagram of a parameter obtaining unit of a Jmeter-based data reading apparatus according to an embodiment of the present invention;
FIG. 9 is a schematic block diagram of a configuration unit of a data reading apparatus based on a Jmeter according to an embodiment of the present invention;
FIG. 10 is a schematic block diagram of a Jmeter-based data reading apparatus according to another embodiment of the present invention;
fig. 11 is a schematic structural diagram of a computer device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It is also to be understood that the terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting. As used in the specification of the present invention and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
Referring to fig. 1 and fig. 1a, fig. 1 is a schematic flowchart of a data reading method based on a Jmeter according to an embodiment of the present application, and fig. 1a is a schematic view of a scenario of the data reading method based on a Jmeter according to the embodiment of the present application. The data reading method based on the Jmeter is applied to the management server 10. The management server 10 may determine the target database 20 according to a database selection instruction of a user, and read a target configuration file of the target database 20 to obtain characteristic parameters such as an IP address, a port number, and a connection password of the target database 20; determining a target command type according to a data type selection command of a user, and importing preset command content associated with the target command type; and calling the data of the type matched with the command content from a database according to the command content. The respective steps of the meter-based data reading method will be described in detail below in the perspective of the management server 10.
As shown in fig. 1, the steps of the method include steps S101 to S105.
Step S101, a database selection instruction of a user is obtained to determine a target database.
In this embodiment, the Jmeter platform is used as a stress testing tool, and can support interaction of different data types. The management server of the meter platform can acquire a database selection instruction of a user. The target database capable of exchanging data with the Jmeter platform can be determined through the analysis of the database selection instruction. For example, the target database may be a Redis database. The database selection instruction may include data flag information indicating the identity information, different data flag information may be associated with the corresponding database in advance, and the corresponding target database may be determined by determining the data flag information.
Further, as shown in fig. 2, the database selection instruction includes data flag information, where different databases are associated with different data flag information, and the step S101 includes steps S201 to S203.
Step S201, if a database selection instruction sent by a user is detected, the database selection instruction is analyzed to determine corresponding data flag information.
After detecting a database selection instruction sent by a user, the management server can analyze the database selection instruction so as to determine corresponding data mark information, wherein the data mark information can be unique identity mark information of the database, so that the unique database corresponding to the data mark information can be determined through the data mark information.
And step S202, determining a database associated with the data mark information according to the data mark information.
Wherein the management server can determine the database associated with the management server according to the determined data mark information.
Step S203, the determined database is determined as a target database.
The management server can also determine the determined database as target data so as to set corresponding parameters to realize data interaction between the Jmeter platform and the corresponding database.
And step S102, reading a target configuration file of the target database to obtain characteristic parameters of the target database.
In this embodiment, after determining the target database, the management server may further read a target configuration file of the target database, and determine and obtain the characteristic parameter of the target database according to the target configuration file. Through the acquisition of the characteristic parameters, the Jmeter platform can construct a data interaction link with the target database. The characteristic parameters may include an IP address, a port number, a connection password, and the like of the target database, and the specific embodiment is not limited thereto.
Further, as shown in fig. 3, the characteristic parameters at least include an IP address, a port number, and a connection password of the target database, and the step S102 includes steps S301 to S303.
Step S301, reading a target configuration file of the target database.
The management server can read the target configuration file of the target database, namely, obtain the target configuration file.
Step S302, analyzing the target configuration file.
The management server can also analyze the target configuration file, so that the information in the target configuration file can be read.
Step S303, the IP address, the port number, and the connection password in the parsed target configuration file are read.
The management server can acquire the required IP address, port number and connection password by analyzing the content in the target configuration file, and configure the API interface of the Jmeter platform by using the IP address, the port number and the connection password so that the API interface can realize data interaction with the database.
Step S103, importing the characteristic parameters into an API (application program interface) of the Jmeter platform to complete the configuration of the API, and establishing a service data link with a target database.
In this embodiment, the management server may further import the acquired feature parameters into an API interface of the meter platform, so as to implement configuration of the API interface, so that the API interface may implement data communication interaction with the target database, so that a user may initiate instruction information to the target database through the meter platform and read information required for association from the target database.
Further, as shown in fig. 4, the step S103 includes steps S401 to S402.
Step S401, determining parameter selection input boxes of the API of the Jmeter platform, wherein different parameter selection input boxes are used for inputting different types of characteristic parameters in a correlated mode.
The management server can determine a parameter selection input box of an API (application program interface) of the Jmeter platform, and a user can select and input corresponding different types of characteristic parameters through the parameter selection input box of the API to perform parameter configuration.
Step S402, the IP address, the port number and the connection password are respectively input into the corresponding parameter selection input boxes associated with the IP address, the port number and the connection password.
The management server can input characteristic parameters such as IP address, port number, connection password and the like into corresponding parameter selection input boxes associated with the characteristic parameters respectively so as to complete corresponding configuration.
Step S104, determining a target command type according to a data type selection command of a user, and confirming preset command content associated with the target command type; wherein different target command types are associated with different command content.
In this embodiment, the management server is further capable of determining a target command type according to a data type selection command of a user, and confirming command content associated with a preset target command type through parsing of the target command type. In general, the management server may pre-associate different command contents with different target command types.
For example, the target command may be a complete system level command, and the type of the command may also be five data types of Redis databases such as String, hash, sortedSet, and the like. Redis is an open source (BSD license), memory-stored data structure server that can be used as a database, cache, and message queue broker. It supports data types such as strings, hash tables, lists, collections, ordered collections, bitmaps, hyperlogs, etc. By constructing a service data link, data interaction between the Jmeter platform and the Redis database can be realized.
Step S105, the confirmed command content is sent to the target database through the service data link so as to call data of the type matched with the command content.
In this embodiment, the management server can analyze the confirmed command content according to the command content, and then connect to the target database through the configured API interface, so as to retrieve data of a type matching the command content, thereby implementing connection between the JMeter platform and the database.
For example, taking a Get command in a String type as an example, when a user selects a "String" command type on a Jmeter platform, the command type is associated with all command contents, and then selects a data reading command request, such as a Get command, and then sends the request, the Redis database returns the corresponding obtained data contents to the Jmeter platform upon receiving the data reading command request of the String type, so that the user can perform the next operation, that is, the reading of data of all data types is realized, and the use experience of the user is greatly improved.
In addition, by determining the data type, the management server can also automatically realize the construction of a service data link, thereby further improving the use experience of the user.
In a further embodiment, the method further comprises the steps of:
and if a data printing instruction of the user is received, printing the called data.
In this embodiment, if the management server receives a data printing instruction from the user, the called data may be printed. Of course, this operation is not limited in this embodiment, and other analysis operations may be performed on the retrieved data.
In conclusion, the embodiment of the invention can enable the Jmeter platform to support the system level operation command of the complete database and various different types of data, and improves the use experience of the user.
Referring to fig. 5, fig. 5 is a schematic flowchart illustrating a method for reading data based on a Jmeter according to another embodiment of the present invention. As shown in fig. 5, the steps of the method include steps S501 to S506. The related explanations and detailed descriptions of the steps similar to steps S101-S105 in the above embodiment are not repeated herein, and the following detailed descriptions are the added steps in this embodiment.
Step S501, a database selection instruction of a user is obtained to determine a target database.
In this embodiment, the Jmeter platform is used as a stress testing tool, and can support interaction of different data types. The management server of the meter platform can acquire a database selection instruction of a user. The target database capable of exchanging data with the Jmeter platform can be determined through the analysis of the database selection instruction. For example, the target database may be a Redis database. The database selection instruction may include data flag information indicating the identity information, different data flag information may be associated with the corresponding database in advance, and the corresponding target database may be determined by determining the data flag information.
Step S502, reading the target configuration file of the target database to obtain the characteristic parameters of the target database.
In this embodiment, after determining the target database, the management server may further read a target configuration file of the target database, and determine and obtain the characteristic parameter of the target database according to the target configuration file. By acquiring the characteristic parameters, the Jmeter platform can construct a data interaction link with the target database. The characteristic parameters may include an IP address, a port number, a connection password, and the like of the target database, and the specific embodiment is not limited thereto.
Step S503, importing the characteristic parameters into an API of the Jmeter platform to complete the configuration of the API, and establishing a service data link with the target database.
In this embodiment, the management server may further import the acquired feature parameters into an API interface of the meter platform, so as to implement configuration of the API interface, so that the API interface may implement data communication interaction with the target database, so that a user may initiate instruction information to the target database through the meter platform and read information required for association from the target database.
Step S504, determining a target command type according to a data type selection command of a user, and confirming preset command content associated with the target command type; wherein different target command types are associated with different command content.
In this embodiment, the management server is further capable of determining a target command type according to a data type selection command of a user, and confirming command content associated with a preset target command type through parsing of the target command type. In general, the management server may pre-associate different command contents with different target command types.
And step S505, sending the confirmed command content to the target database through the service data link so as to call data of a type matched with the command content.
Step S506, sending the called data to the processing master node, so as to send the data to the corresponding processing slave node for processing according to the type of the called data, wherein different processing slave nodes are used for associating and processing different types of data.
In this embodiment, the management server can send the retrieved data to the processing master node to perform corresponding processing. Generally, in order to improve the utilization efficiency of threads, a processing master node and a plurality of processing slave nodes may be provided, and different processing slave nodes may process different types of data, that is, the processing master node may transmit the called data to an associated processing slave node capable of directly processing the type of data according to the type of the data, thereby improving the efficiency of data processing.
In an embodiment, the method further includes step S506a, modifying an original test script of the meter platform obtained according to the type of the called data into a new test script, and sending the new test script to a corresponding processing slave node through the processing master node, where the new test script is adapted to the type of the called data;
at this time, step S506 may be to transmit the called data to the processing master node, so as to transmit the data to the corresponding processing slave node according to the type of the called data, so as to process the data according to the new test script.
Specifically, the management server can also call the original test script of the Jmeter platform according to the type of the called data, modify the original test script according to the type of the called data, generate a new test script, and send the new test script to the corresponding processing slave node through the processing master node, so that the corresponding test can be performed on the processing slave node and a test result can be obtained, the test effectiveness is improved, the automatic change of the test script can be realized, and the use experience of a user is improved.
Step S507, if a feature parameter modification instruction of the user is received, adjusting the feature parameter configured by the API interface according to the feature parameter modification instruction.
In this embodiment, if the management server receives the characteristic parameter modification instruction of the user, the management server may adjust corresponding parameters of the API interface of the meter platform according to the characteristic parameter modification instruction, for example, increase the readable data type, decrease the readable data type, or modify the readable data type, and the specific operation is not limited in this embodiment. In an embodiment, the characteristic parameter modification instruction is any one of a characteristic parameter adding instruction, a characteristic parameter deleting instruction, and a characteristic parameter changing instruction.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), or the like.
Referring to fig. 6, in response to the method for reading data based on a meter, an embodiment of the invention further provides a data reading apparatus based on a meter, where the apparatus 100 includes: a database determination unit 101, a parameter acquisition unit 102, a configuration unit 103, a content confirmation unit 104, and a data retrieval unit 105.
A database determining unit 101, configured to obtain a database selection instruction of a user to determine a target database.
In this embodiment, the management server of the meter platform may obtain the database selection instruction of the user. The target database capable of exchanging data with the Jmeter platform can be determined through the analysis of the database selection instruction. For example, the target database may be a Redis database. The database selection instruction may include data flag information indicating the identity information, different data flag information may be associated with the corresponding database in advance, and the corresponding target database may be determined by determining the data flag information.
Further, as shown in fig. 7, the database selection instruction includes data flag information, where different databases are associated with different data flag information, and the database determination unit 101 includes an information analysis unit 201, an information processing unit 202, and a target determination unit 203.
The information analyzing unit 201 is configured to, if a database selection instruction sent by a user is detected, analyze the database selection instruction to determine corresponding data flag information.
After detecting a database selection instruction sent by a user, the management server can analyze the database selection instruction so as to determine corresponding data mark information, wherein the data mark information can be unique identity mark information of the database, so that the unique database corresponding to the data mark information can be determined through the data mark information.
And an information processing unit 202, configured to determine, according to the data flag information, a database associated therewith.
Wherein the management server can determine the database associated with the management server according to the determined data flag information.
A target determination unit 203 for determining the determined database as a target database.
The management server can also determine the determined database as target data so as to set corresponding parameters to realize data interaction between the Jmeter platform and the corresponding database.
The parameter obtaining unit 102 is configured to read a target configuration file of the target database to obtain a characteristic parameter of the target database.
In this embodiment, after determining the target database, the management server may further read a target configuration file of the target database, and determine and obtain the characteristic parameters of the target database according to the target configuration file. By acquiring the characteristic parameters, the Jmeter platform can construct a data interaction link with the target database. The characteristic parameters may include an IP address, a port number, a connection password, and the like of the target database, and the specific embodiment is not limited thereto.
Further, as shown in fig. 8, the characteristic parameters at least include an IP address, a port number, and a connection password of the target database, and the parameter obtaining unit 102 includes a file reading unit 301, a file parsing unit 302, and an information reading unit 303.
A file reading unit 301, configured to read a target configuration file of the target database.
The management server can read the target configuration file of the target database, namely, obtain the target configuration file.
A file parsing unit 302, configured to parse the target configuration file.
The management server can also analyze the target configuration file, so that the information in the target configuration file can be read.
An information reading unit 303, configured to read the IP address, the port number, and the connection password in the parsed target configuration file.
The management server can acquire the required IP address, port number and connection password by analyzing the content in the target configuration file, and configure the API interface of the Jmeter platform by using the IP address, the port number and the connection password so that the API interface can realize data interaction with the database.
The configuration unit 103 is configured to import the feature parameters into an API interface of the meter platform to complete configuration of the API interface, and establish a service data link with the target database.
In this embodiment, the management server may further import the obtained feature parameters into an API interface of the meter platform, so as to implement configuration of the API interface, so that the API interface can implement data communication interaction with the target database, so that a user may initiate instruction information to the target database and read information required for association from the target database through the meter platform.
Further, as shown in fig. 9, the configuration unit 103 includes steps S401 to S402.
An input box determining unit 401, configured to determine a parameter selection input box of the API interface of the meter platform, where different parameter selection input boxes are used to input different types of feature parameters in an associated manner.
The management server can determine a parameter selection input box of an API (application program interface) of the Jmeter platform, and a user can select and input corresponding different types of characteristic parameters through the parameter selection input box of the API to perform parameter configuration.
A parameter input unit 402 for inputting the IP address, the port number, and the connection password into corresponding parameter selection input boxes associated therewith, respectively.
The management server can input characteristic parameters such as IP address, port number, connection password and the like into corresponding parameter selection input boxes associated with the characteristic parameters respectively so as to complete corresponding configuration.
A content confirmation unit 104, configured to determine a target command type according to a data type selection command of a user, and confirm preset command content associated with the target command type; wherein different target command types are associated with different command content.
In this embodiment, the management server is further capable of determining a target command type according to a data type selection command of a user, and confirming command content associated with a preset target command type through parsing of the target command type. In general, the management server may pre-associate different command contents with different target command types.
For example, the target command may be a complete system level command, and the type thereof may also be five data types of Redis databases such as String, hash, sortedSet, etc.
A data retrieving unit 105, configured to send the confirmed command content to the target database through the service data link to retrieve data of a type matching the command content.
In this embodiment, the management server can analyze the confirmed command content according to the command content, and then connect to the target database through the configured API interface, so as to retrieve data of a type matching the command content, thereby implementing connection between the JMeter platform and the database.
For example, taking a Get command in a String type as an example, when a user selects a "String" command type on a Jmeter platform, the command type is associated with all command contents, and then selects a data reading command request, such as a Get command, and then sends the request, the Redis database returns the corresponding obtained data contents to the Jmeter platform upon receiving the data reading command request of the String type, so that the user can perform the next operation, that is, the reading of data of all data types is realized, and the use experience of the user is greatly improved.
In a further embodiment, the apparatus 100 further comprises:
and the printing unit is used for printing the called data if receiving a data printing instruction of a user.
In this embodiment, if the management server receives a data printing instruction from the user, the called data may be printed. Of course, this operation is not limited in this embodiment, and other analysis operations may be performed on the retrieved data.
Referring to fig. 10, in response to the method for reading data based on a meter, another embodiment of the present invention further provides a data reading apparatus based on a meter, the apparatus 500 including: a database determination unit 501, a parameter acquisition unit 502, a configuration unit 503, a content confirmation unit 504, a data retrieval unit 505, a script adjustment unit 506a, a data processing unit 506, and a modification unit 507.
A database determining unit 501, configured to obtain a database selection instruction of a user to determine a target database.
A parameter obtaining unit 502, configured to read a target configuration file of the target database to obtain a characteristic parameter of the target database.
The configuration unit 503 is configured to import the feature parameters into an API interface of the meter platform to complete configuration of the API interface, and establish a service data link with the target database.
A content confirmation unit 504, configured to determine a target command type according to a data type selection command of a user, and confirm preset command content associated with the target command type; wherein different target command types are associated with different command content.
A data retrieving unit 505, configured to send the confirmed command content to the target database through the service data link to retrieve data of a type matching the command content.
A data processing unit 506, configured to send the called data to the processing master node, so as to send the data to a corresponding processing slave node for processing according to the type of the called data, where different processing slave nodes are used to process different types of data in an associated manner.
In this embodiment, the management server can send the retrieved data to the processing master node to perform corresponding processing. Generally, in order to improve the utilization efficiency of threads, a processing master node and a plurality of processing slave nodes may be provided, and different processing slave nodes may process different types of data, that is, the processing master node may transmit the called data to an associated processing slave node capable of directly processing the type of data according to the type of the data, thereby improving the efficiency of data processing.
In an embodiment, the apparatus may further include a script adjusting unit 506a, configured to modify an original test script of the meter platform, which is obtained according to the type of the called data, into a new test script, and send the new test script to a corresponding processing slave node through the processing master node, where the new test script is adapted to the type of the called data.
At this time, the data processing unit 506 may be configured to send the called data to the processing master node, so as to send the data to the corresponding processing slave node according to the type of the called data, so as to process the data according to the new test script.
Specifically, the management server can also call the original test script of the Jmeter platform according to the type of the called data, modify the original test script according to the type of the called data, generate a new test script, and send the new test script to the corresponding processing slave node through the processing master node, so that the corresponding test can be performed on the processing slave node and a test result can be obtained, the test effectiveness is improved, the automatic change of the test script can be realized, and the use experience of a user is improved.
The modifying unit 507 is configured to, if a feature parameter modifying instruction of a user is received, adjust a feature parameter configured by the API interface according to the feature parameter modifying instruction.
In this embodiment, if the management server receives the characteristic parameter modification instruction of the user, the management server may adjust corresponding parameters of the API interface of the meter platform according to the characteristic parameter modification instruction, for example, increase the readable data type, decrease the readable data type, or modify the readable data type, and the specific operation is not limited in this embodiment. In an embodiment, the characteristic parameter modification instruction is any one of a characteristic parameter adding instruction, a characteristic parameter deleting instruction, and a characteristic parameter changing instruction.
It should be noted that, as can be clearly understood by those skilled in the art, the detailed implementation process of the data reading apparatus 100 based on the Jmeter and each unit may refer to the corresponding description in the foregoing method embodiment, and for convenience and brevity of description, no further description is provided herein.
As can be seen from the above, in terms of hardware implementation, the above database determination unit 101, the parameter acquisition unit 102, the configuration unit 103, the content confirmation unit 104, the data retrieval unit 105, and the like may be embedded in hardware or independent of the data reading device based on the Jmeter, or may be stored in software in the memory of the data reading device based on the Jmeter, so that the processor invokes and executes operations corresponding to the above units. The processor can be a Central Processing Unit (CPU), a microprocessor, a singlechip and the like.
The data reading apparatus based on the Jmeter may be implemented in the form of a computer program, and the computer program may be run on a computer device as shown in fig. 11.
Fig. 11 is a schematic structural diagram of a computer device according to the present invention. The device may be a server, where the server may be an independent server or a server cluster composed of a plurality of servers.
Referring to fig. 11, the computer device 600 includes a processor 602, a memory, an internal memory 604, and a network interface 605 connected by a system bus 601, wherein the memory may include a storage medium 603 and an internal memory 604.
The storage medium 603 may store an operating system 6031 and a computer program 6032, which when executed, may cause the processor 602 to perform a Jmeter-based data reading method.
The processor 602 is used to provide computing and control capabilities that support the operation of the overall computer device 600.
The internal memory 604 provides an environment for the execution of a computer program 6032 in the non-volatile storage medium 603, and the computer program 6032, when executed by the processor 602, causes the processor 602 to perform a Jmeter-based data reading method.
The network interface 605 is used for network communication with other devices. Those skilled in the art will appreciate that the configuration shown in fig. 11 is a block diagram of only a portion of the configuration associated with aspects of the present application, and is not intended to limit the scope of the computer device 600 to which aspects of the present application may be applied, and that a particular computer device 600 may include more or fewer components than those shown, or may combine certain components, or have a different arrangement of components.
The processor 602 is configured to run a computer program 6032 stored in the memory to implement the steps of the data reading method based on the Jmeter as in the above embodiments.
It should be understood that, in the embodiment of the present Application, the Processor 602 may be a Central Processing Unit (CPU), and the Processor 602 may also be other general-purpose processors, digital Signal Processors (DSPs), application Specific Integrated Circuits (ASICs), field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, and the like. Wherein a general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
It will be understood by those skilled in the art that all or part of the flow of the method implementing the above embodiments may be implemented by a computer program instructing associated hardware. The computer program may be stored in a storage medium, which is a computer-readable storage medium. The computer program is executed by at least one processor in the computer system to implement the flow steps of the embodiments of the method described above.
Accordingly, the present invention also provides a storage medium. The storage medium may be a computer-readable storage medium. The storage medium stores a computer program that, when executed by a processor, causes the processor to execute the steps of the Jmeter-based data reading method as in the above-described embodiments.
The storage medium is an entity and non-transitory storage medium, and may be various entity storage media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-only memory (ROM), a magnetic disk, or an optical disk.
Those of ordinary skill in the art will appreciate that the elements and algorithm steps of the examples described in connection with the embodiments disclosed herein may be embodied in electronic hardware, computer software, or combinations of both, and that the components and steps of the examples have been described in a functional general in the foregoing description for the purpose of illustrating clearly the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative. For example, the division of each unit is only one logic function division, and there may be another division manner in actual implementation. For example, various elements or components may be combined or may be integrated in another system or some features may be omitted, or not implemented.
The steps in the method of the embodiment of the invention can be sequentially adjusted, combined and deleted according to actual needs. The units in the device of the embodiment of the invention can be merged, divided and deleted according to actual needs. In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
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 storage medium. Based on such understanding, the technical solution of the present invention essentially or partially contributes to the prior art, or all or part of the technical solution can 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 terminal, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention.
While the invention has been described with reference to specific embodiments, the invention is not limited thereto, and various equivalent modifications and substitutions can be easily made by those skilled in the art within the technical scope of the invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (8)

1. A data reading method based on a Jmeter is characterized by comprising the following steps:
acquiring a database selection instruction of a user to determine a target database;
reading a target configuration file of the target database to obtain characteristic parameters of the target database;
importing the characteristic parameters into an API (application program interface) of a Jmeter platform to complete the configuration of the API, and establishing a service data link with a target database;
determining a target command type according to a data type selection command of a user, and confirming preset command content associated with the target command type; wherein different target command types are associated with different command contents;
sending the confirmed command content to the target database through the service data link to retrieve data of a type matching the command content;
if a data printing instruction of a user is received, printing the called data;
modifying an original test script of the Jmeter platform acquired according to the type of the called data into a new test script, and sending the new test script to a corresponding processing slave node through a processing master node, wherein the new test script is adapted to the type of the called data, and the called data is sent to the processing master node so as to be sent to the corresponding processing slave node according to the type of the called data, so that the data is processed according to the new test script;
and sending the called data to the processing master node so as to send the data to the corresponding processing slave nodes for processing according to the types of the called data, wherein different processing slave nodes are used for processing different types of data in an associated manner.
2. The method of claim 1, wherein the database selection instruction includes data tag information, wherein different databases are associated with different data tag information, and wherein the step of obtaining the database selection instruction of the user to determine the target database comprises:
if a database selection instruction sent by a user is detected, analyzing the database selection instruction to determine corresponding data mark information;
determining a database associated with the data mark information according to the data mark information;
and determining the determined database as a target database.
3. The method of claim 1, wherein the characteristic parameters at least include an IP address, a port number and a connection password of a target database, and the step of reading a target configuration file of the target database to obtain the characteristic parameters of the target database comprises:
reading a target configuration file of the target database;
analyzing the target configuration file;
and reading the IP address, the port number and the connection password in the resolved target configuration file.
4. The method of claim 3, wherein the step of importing the feature parameters into an API interface of a Jmeter platform to complete configuration of the API interface and establish a service data link with a target database comprises:
determining parameter selection input boxes of an API (application program interface) of the Jmeter platform, wherein different parameter selection input boxes are used for inputting different types of characteristic parameters in a correlated mode;
and respectively inputting the IP address, the port number and the connection password into corresponding parameter selection input boxes associated with the IP address, the port number and the connection password.
5. The method of claim 1, wherein the method further comprises:
if a characteristic parameter modification instruction of a user is received, adjusting the characteristic parameters configured by the API interface according to the characteristic parameter modification instruction;
the characteristic parameter modification instruction is any one of a characteristic parameter adding instruction, a characteristic parameter deleting instruction and a characteristic parameter changing instruction.
6. A meter-based data reading apparatus, comprising:
the database determining unit is used for acquiring a database selection instruction of a user to determine a target database;
the parameter acquisition unit is used for reading a target configuration file of the target database to obtain characteristic parameters of the target database;
the configuration unit is used for importing the characteristic parameters into an API (application program interface) of the Jmeter platform to complete the configuration of the API, and establishing a service data link with a target database;
the content confirmation unit is used for determining a target command type according to a data type selection command of a user and confirming preset command content associated with the target command type; wherein different target command types are associated with different command contents;
a data retrieval unit for transmitting the confirmed command content to the target database through the service data link to retrieve data of a type matching the command content;
the data printing module is used for printing the called data if a data printing instruction of a user is received;
the script adjusting unit is used for modifying an original test script of the Jmeter platform acquired according to the type of the called data into a new test script and sending the new test script to a corresponding processing slave node through the processing master node, wherein the new test script is adapted to the type of the called data, the called data is sent to the processing master node, and the data is sent to the corresponding processing slave node according to the type of the called data so as to be processed according to the new test script;
and the data processing unit is used for sending the called data to the processing master node so as to send the data to the corresponding processing slave nodes for processing according to the types of the called data, wherein different processing slave nodes are used for processing different types of data in an associated manner.
7. A computer arrangement, characterized in that the computer arrangement comprises a memory having stored thereon a computer program and a processor implementing the method according to any of claims 1-5 when executing the computer program.
8. A computer-readable storage medium, characterized in that the storage medium stores a computer program which, when executed by a processor, causes the processor to carry out the method according to any one of claims 1-5.
CN202110432226.9A 2021-04-21 2021-04-21 Data reading method, device and equipment based on Jmeter and storage medium Active CN113127321B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110432226.9A CN113127321B (en) 2021-04-21 2021-04-21 Data reading method, device and equipment based on Jmeter and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110432226.9A CN113127321B (en) 2021-04-21 2021-04-21 Data reading method, device and equipment based on Jmeter and storage medium

Publications (2)

Publication Number Publication Date
CN113127321A CN113127321A (en) 2021-07-16
CN113127321B true CN113127321B (en) 2022-11-18

Family

ID=76778712

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110432226.9A Active CN113127321B (en) 2021-04-21 2021-04-21 Data reading method, device and equipment based on Jmeter and storage medium

Country Status (1)

Country Link
CN (1) CN113127321B (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109753438A (en) * 2019-01-14 2019-05-14 上海挚极信息科技有限公司 Testing Platform and method based on jmeter

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109101415A (en) * 2018-06-25 2018-12-28 平安科技(深圳)有限公司 Interface test method, system, equipment and the storage medium compared based on database
CN109376139A (en) * 2018-08-15 2019-02-22 中国平安人寿保险股份有限公司 Centralized database monitoring method, computer installation and storage medium
CN109165260A (en) * 2018-09-25 2019-01-08 安徽信息工程学院 Method of data transfer based on ORACLE data basd link
CN109783426A (en) * 2018-12-14 2019-05-21 深圳壹账通智能科技有限公司 Acquire method, apparatus, computer equipment and the storage medium of data
CN110147328B (en) * 2019-05-24 2023-07-18 深圳市网心科技有限公司 Database performance test method, system, electronic equipment and storage medium
CN111737231A (en) * 2020-06-23 2020-10-02 平安普惠企业管理有限公司 Database automatic analysis method and device, computer equipment and storage medium

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109753438A (en) * 2019-01-14 2019-05-14 上海挚极信息科技有限公司 Testing Platform and method based on jmeter

Also Published As

Publication number Publication date
CN113127321A (en) 2021-07-16

Similar Documents

Publication Publication Date Title
CN110209652B (en) Data table migration method, device, computer equipment and storage medium
CN108829581B (en) Application program testing method and device, computer equipment and storage medium
US20240064058A1 (en) Implementation of compliance settings by a mobile device for compliance with a configuration scenario
US10452522B1 (en) Synthetic data generation from a service description language model
CN111045921A (en) Automatic interface testing method and device, computer equipment and storage medium
CN108255708B (en) Method, device, storage medium and equipment for accessing production file in test environment
CN105302710A (en) Method and apparatus for determining test case in need of regression testing
JP4880376B2 (en) Support apparatus, program, information processing system, and support method
CN108829838B (en) Batch processing method of account information and server
CN110365724B (en) Task processing method and device and electronic equipment
CN110532779B (en) Vulnerability detection method, device, terminal and storage medium
CN111190551B (en) Redis data migration system, migration method, migration device and terminal
CN111679968A (en) Interface calling abnormity detection method and device, computer equipment and storage medium
CN108415998B (en) Application dependency relationship updating method, terminal, device and storage medium
CN111078637A (en) Script file online method and device, computer equipment and storage medium
CN114625723A (en) Data migration method and device, computer equipment and storage medium
CN108900482B (en) Script execution method, server management system, and storage medium
CN113127321B (en) Data reading method, device and equipment based on Jmeter and storage medium
CN111901383A (en) Data request processing method and device, computer equipment and storage medium
CN113360300B (en) Interface call link generation method, device, equipment and readable storage medium
CN112817922B (en) Log dynamic printing method and device, computer equipment and storage medium
CN113626295A (en) Pressure measurement data processing method and system and computer readable storage medium
CN113392010A (en) Common component testing method and device, electronic equipment and storage medium
CN110780983A (en) Task exception handling method and device, computer equipment and storage medium
CN111752559A (en) Front-end and back-end separation system, method, device and storage medium

Legal Events

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