CN111190802B - Method for automatically generating performance test configuration - Google Patents
Method for automatically generating performance test configuration Download PDFInfo
- Publication number
- CN111190802B CN111190802B CN201911332483.4A CN201911332483A CN111190802B CN 111190802 B CN111190802 B CN 111190802B CN 201911332483 A CN201911332483 A CN 201911332483A CN 111190802 B CN111190802 B CN 111190802B
- Authority
- CN
- China
- Prior art keywords
- mapping table
- protocol
- fields
- rule
- configuration
- 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
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/34—Recording 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/3409—Recording 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/3414—Workload generation, e.g. scripts, playback
Landscapes
- Engineering & Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computer And Data Communications (AREA)
- Debugging And Monitoring (AREA)
Abstract
The invention relates to a method for automatically generating performance test configuration, which comprises the following steps: step 1, preprocessing configuration data; and 2, automatically generating the target file. Compared with the prior art, the invention has the following advantages: the problem of unmatched configuration files of the upper computer and the lower computer caused by manual configuration is solved, and meanwhile, the development flexibility, the free space and the like of software are improved.
Description
Technical Field
The invention relates to embedded computer software testing, in particular to a method for automatically generating performance test configuration.
Background
Generally, the traditional embedded computer software test is based on various general instruments or special equipment, various instrument equipment is adopted to monitor the operation of a tested system, the development period of the test receipt is long, the cost is high, the reusability is poor, the test receipt cannot be reused in other embedded systems, and the test method adopts a mainstream upper computer mode and a mainstream lower computer mode; the upper computer is responsible for peripheral input information simulation, and the lower computer, namely the object to be tested, is responsible for processing received information and feedback.
The upper computer test platform runs on a windows operating system and has the main functions of managing an automatic test tool and testing activity management; the tested object of the lower computer is composed of an industrial personal computer, a mainboard, a display and the like, the real-time operating system is operated to perform data communication receiving between the tested equipment and the real-time host computer through IO and buses provided by the network, the RS232, the RS422, the RS483, the CAN and other systems, the configuration file and the script of the testing host computer are analyzed and executed, real-time communication is performed, and data are controlled or collected.
The test activities comprise test data preparation, test environment construction, test execution and test result analysis; in the embedded software test, the joint debugging of the upper computer and the lower computer is a time-consuming and labor-consuming work, the configuration files of the upper computer and the lower computer are not matched due to the most unfavorable debugging reasons, and more fatal problems that the configuration files of the upper computer and the lower computer are not matched are aggravated by adopting manual configuration, so that the problem that the configuration of the upper computer and the lower computer are not matched needs to be solved urgently, the joint debugging cost is reduced, the test efficiency is improved, the research and development test is promoted, the progress of the project is ensured, and the high-quality delivery is guaranteed.
Disclosure of Invention
The invention aims to overcome the defects in the prior art and provide a method for automatically generating performance test configuration, which solves the problem of unmatched configuration files of upper and lower computers caused by manual configuration.
The purpose of the invention can be realized by the following technical scheme:
a method of automatically generating a performance test configuration, the method comprising the steps of:
step 1, preprocessing configuration data;
and 2, automatically generating the target file.
Preferably, the step 1 specifically comprises the following steps:
step 1.1, inputting a source configuration file;
and step 1.2, scanning all fields in all files, and creating a mapping table according to the file content.
Preferably, the mapping table in step 1.2 specifically includes an index mapping table, a key field mapping table, an equipment protocol mapping table, and a protocol rule mapping table.
Preferably, the specific content of the created index mapping table includes:
firstly, extracting information dispersed in a plurality of source configuration files into a plurality of tables by adopting a database technology;
secondly, selecting a main key and an external key according to an index rule during protocol configuration;
and finally, creating a data relation table, and uniquely indexing the mapping relation of the multiple tables to the target value through the data relation table.
Preferably, the specific content of creating the key field mapping table includes:
and scanning all fields of the lower computer configuration file and the target source file, checking whether the fields are used in a mixed manner, and if so, keeping the original field format and adding the original field format into a field mapping table.
Preferably, the specific content of creating the device protocol mapping table includes:
the protocol itself has set configuration rule constraints, the constraints are converted into functions to realize, fields needing to be processed in the protocol are gathered together through creating an index table in the processing process, and the fields are processed according to the protocol rule functions when being read.
Preferably, the specific content of the protocol rule mapping table includes: and converting the artificial convention rule in the configuration file of the upper computer and the lower computer into a function to realize.
Preferably, the specific content of step 2 includes the following steps:
step 2.1, scanning all fields of the target file, checking whether the fields are in a key field mapping table, and if the fields exist in the key field mapping table, adopting values stored in the mapping table to carry out replacement operation; if not, continuing to execute downwards;
step 2.2, checking whether the field exists in the protocol mapping table of the equipment, if so, processing according to the protocol rule, and if not, continuing to process downwards;
step 2.3, caching the information into tempOut;
step 2.4, scanning protocol rule mapping table fields, searching corresponding data index information from the data relation table according to the convention rule, and processing according to the convention rule; and finally processing the output data according to the self-defined rule.
Compared with the prior art, the invention has the following advantages:
1. the method comprises the steps of extracting source file information into a data table, creating a data relation table and creating a special processing information mapping table, wherein the tables have the function of quick indexing in application and have strong expandability, the information filtering function is also realized when a main key and an external key are selected, the influence of fields with small influence factors in the tables is reduced, the fields without the main key and the external key can be arbitrarily increased and deleted without influencing other tables and the whole software, the coupling is reduced, and the development flexibility and the free space of the software are improved.
2. The three-layer data relation design greatly enhances the expandability of the configuration tool and enhances the expandability of the configuration tool. When a new protocol is added into the configuration file of the lower computer, a user can put the new protocol into the configuration generation tool to automatically generate a target file matched with the source file only by giving the source file format of the protocol, and other protocols are not affected, so that the expandability of the configuration tool and the stability of a software architecture are enhanced.
Drawings
FIG. 1 is a diagram of the data generation process of the present invention;
FIG. 2 is a data relationship diagram of the present invention;
FIG. 3 is a flow chart of the present invention for creating a key field mapping table;
FIG. 4 is a flow chart of the present invention for checking whether a field is in a field mapping table;
FIG. 5 is a flow chart of the present invention for checking whether a field is in the protocol rule mapping table.
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 obtained by a person skilled in the art without making any creative effort based on the embodiments in the present invention, shall fall within the protection scope of the present invention.
The principle of the invention is as follows:
the invention relates to a method for automatically generating performance test configuration, which solves the problem of unmatched configuration files of an upper computer and a lower computer through software design and comprises the following steps:
step 1, preprocessing configuration data;
and 2, generating a target file.
The step 1 specifically comprises the following steps: step 1.1, inputting a source configuration file; and step 1.2, scanning all fields in all files, and creating a mapping table according to the file content.
The mapping table in step 1.2 specifically includes an index mapping table, a key field mapping table, an equipment protocol mapping table, and a protocol rule mapping table.
The specific contents of the created index mapping table include: the information dispersed in the multiple source configuration files is extracted into multiple tables by adopting a database technology, the main key and the external key are selected according to an index rule during protocol configuration, in addition, a data relation table is created, and the mapping relation of the multiple tables can be uniquely indexed to a target value through the data relation table.
The specific content of creating the key field mapping table comprises: irregular names such as case and case mixed use exist in the source configuration file, and the target file needs to be consistent with the source file, so that the original field format needs to be reserved in the processing process, and the original field is output and adopted after the processing.
The specific content of creating the device protocol mapping table comprises: the protocol itself has certain configuration rule constraints, the constraints need to be converted into functions for realization, an index table needs to be created in the processing process, fields needing to be processed in the protocol are gathered, and when the fields are read, the fields are processed according to the protocol rule functions.
The specific contents of the protocol rule mapping table are as follows: the configuration files of the upper computer and the lower computer are provided with a plurality of artificial agreement rules, the artificial agreement rules are converted into functions to be realized, and the functions are processed according to artificial constraint functions when the artificial agreement rules are required to be processed.
The specific content of the step 2 comprises the following steps:
step 2.1, scanning all fields of the target file, checking whether the fields are in a key field mapping table, and if the fields exist in the key field mapping table, adopting values stored in the mapping table to carry out replacement operation; if not, continuing to execute downwards;
step 2.2, checking whether the field exists in the protocol mapping table of the equipment, if so, processing according to the protocol rule, and if not, continuing to process downwards;
step 2.3, caching the information into tempOut;
step 2.4, scanning protocol rule mapping table fields, searching corresponding data index information from the data relation table according to the convention rule, and processing according to the convention rule; and finally processing the output data according to the self-defined rule.
As shown in fig. 1, the present embodiment is used for completing the work of automatically generating the upper computer configuration file matched with the given lower computer configuration file, and the main work of the present embodiment is divided into two major parts, the first part is the work of preprocessing the configuration data, and the second part is the work of generating the target file. The configuration data preprocessing operation steps are as follows:
1. reading the lower computer configuration file, scanning all fields in all files, creating a data table according to the file content, and creating a lower computer information storage table as shown in fig. 2;
2. through analysis of the configuration process, selecting a primary key and a foreign key, creating a data relation table, as shown in fig. 2, and creating a device protocol mapping table;
3. as shown in fig. 3, scanning all fields of the lower computer configuration file and the target source file, checking whether the fields are used in a case-case mixed manner, and if so, adding a field mapping table;
generating an object file:
4. as shown in fig. 4, scanning all fields of the target file, checking whether the field is in the field mapping table, and if yes, performing a replacement operation using the value stored in the mapping table; if not, continuing to execute downwards;
5. as shown in fig. 5, checking whether the field exists in the protocol rule mapping table, if so, processing according to the protocol rule, and if not, continuing to process downwards;
6. caching the information into tempOut;
7. scanning the fields of the agreed rule mapping table of the upper computer and the lower computer, searching corresponding data index information from the data relation table according to the agreed rule, and processing according to the agreed rule; and finally processing the output data according to the self-defined rule.
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 (7)
1. A method for automatically generating a performance test configuration, the method comprising the steps of:
step 1, preprocessing configuration data;
step 2, automatically generating a target file;
the specific content of the step 2 comprises the following steps:
step 2.1, scanning all fields of the target file, checking whether the fields are in a key field mapping table, and if the fields exist in the key field mapping table, adopting values stored in the mapping table to carry out replacement operation; if not, continuing to execute downwards;
step 2.2, checking whether the field exists in the protocol mapping table of the equipment, if so, processing according to the protocol rule, and if not, continuing to process downwards;
step 2.3, caching the information into tempOut;
step 2.4, scanning protocol rule mapping table fields, searching corresponding data index information from the data relation table according to a convention rule, and processing according to the convention rule; and finally processing the output data according to the self-defined rule.
2. The method for automatically generating a performance test configuration according to claim 1, wherein the step 1 specifically comprises the following steps:
step 1.1, inputting a source configuration file;
and 1.2, scanning all fields in all files, and creating a mapping table according to the content of the files.
3. The method according to claim 2, wherein the mapping table in step 1.2 specifically includes an index mapping table, a key field mapping table, a device protocol mapping table, and a protocol rule mapping table.
4. The method of claim 3, wherein the specific contents of the index mapping table creation step comprise:
firstly, extracting information dispersed in a plurality of source configuration files into a plurality of tables by adopting a database technology;
secondly, selecting a main key and an external key according to an index rule during protocol configuration;
and finally, creating a data relation table, and uniquely indexing the mapping relation of the multiple tables to the target value through the data relation table.
5. The method of claim 3, wherein the creating the key field mapping table specifically comprises:
and scanning all fields of the lower computer configuration file and the target source file, checking whether the fields are used in a mixed manner, and if so, keeping the original field format and adding the original field format into a field mapping table.
6. The method of claim 3, wherein the creating of the device protocol mapping table specifically comprises:
the protocol itself has set configuration rule constraints, the constraints are converted into functions to realize, fields needing to be processed in the protocol are gathered together through creating an index table in the processing process, and the fields are processed according to the protocol rule functions when being read.
7. The method of claim 3, wherein the creating of the specific contents of the protocol rule mapping table comprises: and converting the manually appointed rules in the configuration files of the upper computer and the lower computer into functions for realization.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911332483.4A CN111190802B (en) | 2019-12-22 | 2019-12-22 | Method for automatically generating performance test configuration |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911332483.4A CN111190802B (en) | 2019-12-22 | 2019-12-22 | Method for automatically generating performance test configuration |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111190802A CN111190802A (en) | 2020-05-22 |
CN111190802B true CN111190802B (en) | 2022-09-30 |
Family
ID=70709251
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911332483.4A Active CN111190802B (en) | 2019-12-22 | 2019-12-22 | Method for automatically generating performance test configuration |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111190802B (en) |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7653847B1 (en) * | 2005-05-05 | 2010-01-26 | Seagate Technology Llc | Methods and structure for field flawscan in a dynamically mapped mass storage device |
CN105262644A (en) * | 2015-11-03 | 2016-01-20 | 株洲南车时代电气股份有限公司 | General test system based on protocol configuration and method |
CN105512042A (en) * | 2015-12-22 | 2016-04-20 | 广东金赋信息科技有限公司 | Automatic generation method and device for testing data of database and testing system |
CN105912469A (en) * | 2016-04-11 | 2016-08-31 | 卡斯柯信号有限公司 | Automatic detection method of testing scripts for rail transit vehicle-mounted controller software |
CN109558525A (en) * | 2018-12-12 | 2019-04-02 | 北京锐安科技有限公司 | A kind of generation method of test data set, device, equipment and storage medium |
CN109901888A (en) * | 2019-02-01 | 2019-06-18 | 卡斯柯信号有限公司 | A kind of design method of configuration file Auto-Generation Tool |
-
2019
- 2019-12-22 CN CN201911332483.4A patent/CN111190802B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7653847B1 (en) * | 2005-05-05 | 2010-01-26 | Seagate Technology Llc | Methods and structure for field flawscan in a dynamically mapped mass storage device |
CN105262644A (en) * | 2015-11-03 | 2016-01-20 | 株洲南车时代电气股份有限公司 | General test system based on protocol configuration and method |
CN105512042A (en) * | 2015-12-22 | 2016-04-20 | 广东金赋信息科技有限公司 | Automatic generation method and device for testing data of database and testing system |
CN105912469A (en) * | 2016-04-11 | 2016-08-31 | 卡斯柯信号有限公司 | Automatic detection method of testing scripts for rail transit vehicle-mounted controller software |
CN109558525A (en) * | 2018-12-12 | 2019-04-02 | 北京锐安科技有限公司 | A kind of generation method of test data set, device, equipment and storage medium |
CN109901888A (en) * | 2019-02-01 | 2019-06-18 | 卡斯柯信号有限公司 | A kind of design method of configuration file Auto-Generation Tool |
Non-Patent Citations (2)
Title |
---|
Orthogonal Array and Virtualization as a Method for Configuration Testing Improvement;Snežana P.等;《2009 First IEEE Eastern European Conference on the Engineering of Computer Based Systems》;20091023;第148-149页 * |
基于Robot框架的自动化测试平台设计与实现;乔艳茹 等;《铁路计算机应用》;20171031;第26卷(第10期);第8-11页 * |
Also Published As
Publication number | Publication date |
---|---|
CN111190802A (en) | 2020-05-22 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110764753B (en) | Business logic code generation method, device, equipment and storage medium | |
CN109739766B (en) | System and method for rapidly building FPGA digital simulation model | |
CN109739855B (en) | Method and system for realizing data sheet splicing and automatically training machine learning model | |
US8434062B2 (en) | Enhancing source code debugging and readability using visual symbols | |
Maróti et al. | Online collaborative environment for designing complex computational systems | |
CN103092761A (en) | Method and device of recognizing and checking modifying code blocks based on difference information file | |
US11681685B1 (en) | System for uploading information into a metadata repository | |
CN113360144B (en) | Auxiliary processing method, device, storage medium and program product for software development | |
CN111158656B (en) | Test code generation method and device based on fruit tree method | |
US8296723B2 (en) | Configurable unified modeling language building blocks | |
WO2021068692A1 (en) | Method, apparatus and device for workflow migration, and computer-readable storage medium | |
US9311345B2 (en) | Template based database analyzer | |
CN114282752A (en) | Method and device for generating flow task, electronic equipment and storage medium | |
CN114270313A (en) | Computer-implemented method, computer program and physical computing environment | |
CN110889013B (en) | Data association method, device, server and storage medium based on XML | |
JP2003114813A (en) | Analysis server, program analysis network system and program analysis method | |
CN109616215B (en) | Medical data extraction method, device, storage medium and electronic equipment | |
CN111190802B (en) | Method for automatically generating performance test configuration | |
CN112668314A (en) | Data standard conformance detection method, device, system and storage medium | |
CN113627816A (en) | Evaluation management method and device, electronic equipment and storage medium | |
JP2016143106A (en) | Business influence portion extraction method based on business variation and business influence portion extraction device | |
JP4683535B2 (en) | Job net management system | |
US20100145747A1 (en) | Automated enterprise architecture assessment | |
WO2024009496A1 (en) | Construction management device and construction management method | |
CN114692382B (en) | Management method and device for nuclear power simulation model development data and computer equipment |
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 |