CN112100068A - Method for testing redirection of communication object of terminal software - Google Patents
Method for testing redirection of communication object of terminal software Download PDFInfo
- Publication number
- CN112100068A CN112100068A CN202010961986.4A CN202010961986A CN112100068A CN 112100068 A CN112100068 A CN 112100068A CN 202010961986 A CN202010961986 A CN 202010961986A CN 112100068 A CN112100068 A CN 112100068A
- Authority
- CN
- China
- Prior art keywords
- communication
- test
- terminal
- testing
- electric energy
- 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 76
- 238000004891 communication Methods 0.000 title claims abstract description 65
- 238000000034 method Methods 0.000 title claims abstract description 35
- 238000004088 simulation Methods 0.000 claims abstract description 27
- 230000006870 function Effects 0.000 claims description 46
- 238000012545 processing Methods 0.000 claims description 4
- 230000008569 process Effects 0.000 description 6
- 238000013500 data storage Methods 0.000 description 2
- 239000000463 material Substances 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 238000006467 substitution reaction Methods 0.000 description 2
- 238000010998 test method Methods 0.000 description 2
- 230000004075 alteration Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000007726 management method Methods 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 238000013522 software testing Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3688—Test management for test execution, e.g. scheduling of test suites
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Debugging And Monitoring (AREA)
Abstract
The invention discloses a terminal software communication object redirection testing method, when the method is used for testing terminal software, an electric energy meter is not needed, a complex communication link is not needed to be built, and the complexity of a testing environment is reduced; compared with the prior art, the communication between the terminal software and the electric energy meter or the master station is realized through internal communication simulation, and the occurrence of unknown problems caused by external link factors is reduced.
Description
Technical Field
The invention relates to the technical field of communication, in particular to a method for testing redirection of a communication object of terminal software.
Background
The debugging of terminal software needs to build a whole communication link from a master station to a terminal electric energy meter, and the test result depends on the reliability of the hardware communication link. The existing testing method mainly has the following defects:
1. the test environment is complex to build. The existing terminal communication test scheme is realized by depending on a whole communication link from a master station to a concentrator to an electric energy meter, and a test result depends on the reliability of a hardware communication link.
2. Limitations of the test method. The data of the entity electric energy meter communication is realized by an internal program of the electric energy meter, the data storage is on a storage chip in the electric energy meter, the data stored in the electric energy meter cannot be changed at will outside, and partial test cases are not easy to realize during the function test of the terminal.
Disclosure of Invention
In view of the above, a first aspect of the present invention is to provide a method for testing redirection of a communication object of terminal software. For solving the problems existing in the prior art.
The purpose of the first aspect of the invention is realized by the following technical scheme:
the redirection testing method for the communication object of the terminal software is characterized by comprising the following steps: the method is that
The terminal is internally provided with a test function module which can simulate the functions of an electric energy meter and the functions of a simulation part main station, and the test function module comprises a plurality of different communication protocols and is used for matching with the terminal to carry out communication and protocol consistency tests;
the user realizes the selection of the simulation object when the test function module is started through the soft switch;
if the analog electric energy meter is selected, waiting for a communication data frame, then analyzing the communication data frame, performing corresponding logic processing according to the content of the data frame, reading corresponding data of a preset file and organizing a return frame;
and if the simulation master station is selected, the simulation master station is controlled to execute a corresponding test scheme, execute the test scheme and print a test log by externally modifying preset file data of the simulation master station.
Particularly, the communication between the terminal and the test function module is realized through pipelines, and pipelines with different names simulate different serial ports so as to distinguish different data sources.
Particularly, the function of the analog electric energy meter is used for simulating the electric energy meter to carry out communication and data reading in the environment that the test environment is not externally connected with the electric energy meter, so that the link integrity of the test environment is realized; the simulation master station function is that the simulation master station issues a master station communication data frame for realizing the operation of the terminal.
In particular, the soft switch is realized by selecting whether to create and start an analog electric energy meter thread or create and start an analog master station thread through parameters input when an executable file of the test function module is started.
Particularly, when the master station is simulated, execution of different test schemes can be realized according to reading of internal preset files after the threads are started, the test schemes comprise timing, data attack, data acquisition and parameter setting, and different test schemes are executed by configuring different preset scheme files.
In particular, the test function module comprises communication protocols including DL/T645-1997, DL/T645-2007, 698.45, 376.1.
In particular, the terminal is a metering automation terminal.
It is an object of a second aspect of the invention to provide a computer automation terminal device comprising a memory, a processor and a software program stored on the memory and capable of running on the processor, the processor implementing the method as described above when executing the software program.
It is an object of a third aspect of the invention to provide a readable storage medium having stored thereon a software program, said software program comprising all functions of a test function module, which when executed by a processor implements the method as described above.
The invention has the beneficial effects that:
1. the invention provides a method for building a terminal software testing environment without an electric energy meter, and when the method is used for testing the terminal software, a complex communication link is not required to be built, so that the complexity of the testing environment is reduced;
2. the method for simulating communication between the terminal software and the electric energy meter or the master station comprises the steps that communication between different apps inside the terminal is achieved through a specific communication method, and the communication comprises but is not limited to pipeline communication, shared memory communication and the like.
Additional advantages, objects, and features of the invention will be set forth in part in the description which follows and in part will become apparent to those having ordinary skill in the art upon examination of the following or may be learned from practice of the invention. The objectives and other advantages of the present invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
Drawings
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention will be further described in detail with reference to the accompanying drawings, in which:
FIG. 1 is a flow chart of the method of the present invention.
Detailed Description
Hereinafter, preferred embodiments of the present invention will be described in detail with reference to the accompanying drawings. It should be understood that the preferred embodiments are illustrative of the invention only and are not limiting upon the scope of the invention.
As shown in fig. 1, the present invention provides a redirection test method for a communication object of terminal software, where a test function module (the module is installed inside a terminal in the form of a test APP) is built in the terminal, the test function module can simulate an electric energy meter function and a part of a master station function, and the test function module includes a plurality of different communication protocols, in this embodiment, the communication protocols included in the test function module include DL/T645-1997, DL/T645-2007, 698.45, 376.1, and are used for performing communication and protocol conformance tests in cooperation with the terminal; the terminal is a metering automation terminal, and the covered range comprises electric power metering equipment in the form of specific terminals such as a power grid concentrator, a power grid load management terminal, a power grid distribution transformer terminal and the like.
The user realizes the selection of the simulation object when the test function module is started through the soft switch; in this embodiment, the soft switch is implemented by selecting whether to create and start the analog energy meter thread or create and start the analog master station thread according to the parameters input when the executable file of the test function module is started. The embodiment provides a soft switch program code which can be realized as follows, wherein a test App executable file is a SimlateApp, and the execution command is as follows (parameter: 0, running simulation electric energy meter function; 1, running simulation main station function):
SimulaneApp parameter
The main function program pseudo code is as follows:
in the embodiment, if the analog electric energy meter is selected, waiting for a communication data frame, analyzing the communication data frame, performing corresponding logic processing according to the content of the data frame, reading corresponding data of a preset file and organizing a return frame; when the test App simulates the electric energy meter, the downlink communication test of the terminal does not need to be connected with the entity electric energy meter. Data reading is directly realized in the terminal in an inter-process communication mode, and the data storage condition of the entity table is simulated by configuring different data input files for the simulated electric energy meter.
And if the simulation master station is selected, the simulation master station is controlled to execute a corresponding test scheme, execute the test scheme and print a test log by externally modifying preset file data of the simulation master station.
In this embodiment, the communication between the terminal and the test function module is realized through pipeline communication, and pipelines with different names simulate different serial ports, so as to distinguish different data sources. Pipeline communication is a communication method between processes, and one of practical examples of process communication is pipeline communication of a Unix system. The Unix system provides two data communication modes, named pipes and nameless pipes, starting from SystemV. The nameless pipe provides a communication for the process that establishes the pipe and its descendants that carries messages in a bit stream fashion. The pipe is logically viewed as a pipe file, physically consisting of a cache of the file system, and rarely enables peripherals. Named pipes can be used for communication between two unrelated processes. Pipe is one of the first Unix IPC forms supported by Linux, which is a very frequently used communication mechanism.
The function of the simulated electric energy meter is used for simulating the electric energy meter to carry out communication and data reading in the environment that the test environment is not externally connected with the electric energy meter, so that the link integrity of the test environment is realized; the simulation master station function is that the simulation master station issues a master station communication data frame for realizing the operation of the terminal. When the master station is simulated, the execution of different test schemes can be realized according to the reading of internal preset files after the threads are started, the test schemes comprise timing, data attack, data acquisition and parameter setting, and different test schemes are executed by configuring different preset scheme files.
In this embodiment, the software test module is packaged into an APP form, and the simulation function of the software test module is developed based on the existing electric energy meter function and the simulation part master station function, which is developed in C language in this embodiment. Of course, other programming languages may be used for development as long as the related functions are realized.
Any process or method descriptions in flow charts or otherwise herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing specific logical functions or steps in the process, and alternate implementations are included within the scope of the preferred embodiment of the present invention in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the present invention.
The logic and/or steps represented in the flowcharts or otherwise described herein, e.g., an ordered listing of executable instructions that can be considered to implement logical functions, can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For the purposes of this description, a "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of the computer-readable medium would include the following: an electrical connection (electronic device) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium could even be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, via for instance optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner if necessary, and then stored in a computer memory.
It should be understood that portions of the present invention may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
It will be understood by those skilled in the art that all or part of the steps carried by the method for implementing the above embodiments may be implemented by hardware related to instructions of a program, and the program may be stored in a computer readable storage medium, and when executed, the program includes one or a combination of the steps of the method embodiments.
In addition, functional units in the embodiments of the present invention may be integrated into one processing module, or each unit may exist alone physically, or two or more units are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a stand-alone product, may also be stored in a computer readable storage medium.
The storage medium mentioned above may be a read-only memory, a magnetic or optical disk, etc.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention, and that variations, modifications, substitutions and alterations can be made in the above embodiments by those of ordinary skill in the art without departing from the principle and spirit of the present invention. Finally, the above embodiments are only intended to illustrate the technical solutions of the present invention and not to limit the present invention, and although the present invention has been described in detail with reference to the preferred embodiments, it will be understood by those skilled in the art that modifications or equivalent substitutions may be made on the technical solutions of the present invention without departing from the spirit and scope of the technical solutions, and all of them should be covered by the claims of the present invention.
Claims (9)
1. A terminal software communication object redirection testing method is characterized in that: the method is that
The terminal is internally provided with a test function module which can simulate the functions of an electric energy meter and the functions of a simulation part main station, and the test function module comprises a plurality of different communication protocols and is used for matching with the terminal to carry out communication and protocol consistency tests;
the user realizes the selection of the simulation object when the test function module is started through the soft switch;
if the analog electric energy meter is selected, waiting for a communication data frame, then analyzing the communication data frame, performing corresponding logic processing according to the content of the data frame, reading corresponding data of a preset file and organizing a return frame;
and if the simulation master station is selected, the simulation master station is controlled to execute a corresponding test scheme, execute the test scheme and print a test log by externally modifying preset file data of the simulation master station.
2. The method for testing the redirection of the communication object of the terminal software according to claim 1, wherein: the communication between the terminal and the test function module is realized through pipeline communication, and pipelines with different names simulate different serial ports so as to distinguish different data sources.
3. The method for testing the redirection of the communication object of the terminal software according to claim 1, wherein: the function of the simulated electric energy meter is used for simulating the electric energy meter to carry out communication and data reading in the environment that the test environment is not externally connected with the electric energy meter, so that the link integrity of the test environment is realized; the simulation master station function is that the simulation master station issues a master station communication data frame for realizing the operation of the terminal.
4. The method for testing the redirection of the communication object of the terminal software according to claim 1, wherein: the soft switch is realized by selecting whether to create and start a simulation electric energy meter thread or a simulation main station thread through parameters input when an executable file of the test function module is started.
5. The method for testing the redirection of the communication object of the terminal software according to claim 1, wherein: when the master station is simulated, the execution of different test schemes can be realized according to the reading of internal preset files after the threads are started, the test schemes comprise timing, data attack, data acquisition and parameter setting, and different test schemes are executed by configuring different preset scheme files.
6. The method for testing the redirection of the communication object of the terminal software according to claim 1, wherein: the communication protocols contained in the test function module comprise DL/T645-1997, DL/T645-2007, 698.45 and 376.1.
7. The method for testing the redirection of the communication object of the terminal software according to claim 1, wherein: the terminal is a metering automation terminal.
8. A computing automation terminal device comprising a memory, a processor, and a software program stored on the memory and capable of running on the processor, characterized in that: the processor, when executing the software program, implements the method of any one of claims 1-7.
9. A readable storage medium having stored thereon a software program, characterized in that: the software program comprising all the functionality of the test function module according to any of the claims 1-7, when executed by a processor implementing the method according to any of the claims 1-7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010961986.4A CN112100068A (en) | 2020-09-14 | 2020-09-14 | Method for testing redirection of communication object of terminal software |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010961986.4A CN112100068A (en) | 2020-09-14 | 2020-09-14 | Method for testing redirection of communication object of terminal software |
Publications (1)
Publication Number | Publication Date |
---|---|
CN112100068A true CN112100068A (en) | 2020-12-18 |
Family
ID=73752642
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010961986.4A Pending CN112100068A (en) | 2020-09-14 | 2020-09-14 | Method for testing redirection of communication object of terminal software |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112100068A (en) |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104391499A (en) * | 2014-10-29 | 2015-03-04 | 江苏林洋电子股份有限公司 | Simulated electric energy meter used for testing electric power centralized meter reading system and test method thereof |
CN105279952A (en) * | 2015-11-30 | 2016-01-27 | 国网江西省电力科学研究院 | Whole-event acquisition testing system of intelligent ammeter based on virtual ammeter module |
WO2016090908A1 (en) * | 2014-12-12 | 2016-06-16 | 国家电网公司 | Memory simulation testing board system and testing method for embedded application of intelligent electric meter |
CN109618364A (en) * | 2018-12-26 | 2019-04-12 | 华立科技股份有限公司 | Terminal uplink communication module detection system and detection method |
CN110380939A (en) * | 2019-08-08 | 2019-10-25 | 重庆邮电大学 | The conformance test method and system of local communication protocol in a kind of power information acquisition system |
CN110427314A (en) * | 2019-06-14 | 2019-11-08 | 广西电网有限责任公司电力科学研究院 | A kind of metering automation end message security reliability test method and system |
CN111258898A (en) * | 2020-01-15 | 2020-06-09 | 平安医疗健康管理股份有限公司 | Automatic testing method and device, computer equipment and storage medium |
-
2020
- 2020-09-14 CN CN202010961986.4A patent/CN112100068A/en active Pending
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104391499A (en) * | 2014-10-29 | 2015-03-04 | 江苏林洋电子股份有限公司 | Simulated electric energy meter used for testing electric power centralized meter reading system and test method thereof |
WO2016090908A1 (en) * | 2014-12-12 | 2016-06-16 | 国家电网公司 | Memory simulation testing board system and testing method for embedded application of intelligent electric meter |
CN105279952A (en) * | 2015-11-30 | 2016-01-27 | 国网江西省电力科学研究院 | Whole-event acquisition testing system of intelligent ammeter based on virtual ammeter module |
CN109618364A (en) * | 2018-12-26 | 2019-04-12 | 华立科技股份有限公司 | Terminal uplink communication module detection system and detection method |
CN110427314A (en) * | 2019-06-14 | 2019-11-08 | 广西电网有限责任公司电力科学研究院 | A kind of metering automation end message security reliability test method and system |
CN110380939A (en) * | 2019-08-08 | 2019-10-25 | 重庆邮电大学 | The conformance test method and system of local communication protocol in a kind of power information acquisition system |
CN111258898A (en) * | 2020-01-15 | 2020-06-09 | 平安医疗健康管理股份有限公司 | Automatic testing method and device, computer equipment and storage medium |
Non-Patent Citations (2)
Title |
---|
张敏: "电能计量终端自动化测试平台的研究与设计", 《中国优秀硕士学位论文全文数据库 (信息科技辑)》, no. 1 * |
王莉: "自动化远方电量采集终端功能检测平台研制", 《电测与仪表》, vol. 49, no. 1, pages 1 - 11 * |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8935573B2 (en) | Reliable unit testing through cached mocking | |
CN107807881B (en) | Code coverage rate testing method and device and computer equipment | |
CN112580295A (en) | Automatic verification method, system and device for multi-core SoC chip | |
CN113961453B (en) | Full-digital simulation test system for airborne software | |
CN110632499B (en) | Test vector generation method based on test object and storage medium | |
US11250193B1 (en) | Productivity platform using system-on-chip with programmable circuitry | |
US8117499B2 (en) | Generation of a stimuli based on a test template | |
CN102831058B (en) | Testing method and testing device | |
CN113657069B (en) | SOC simulation verification method and device, verification server and storage medium | |
CN115983173A (en) | Register model generation method and device, computer equipment and storage medium | |
US8224614B2 (en) | Generating a combination exerciser for executing tests on a circuit | |
CN111427839B (en) | Remote online configuration and debugging method for Intel SoC FPGA | |
CN103440133A (en) | Development method and system of chip testing software | |
CN101458653A (en) | Automatic test method for tax controller of cash register | |
CN110727611B (en) | Configurable consistency verification system with state monitoring function | |
CN117330935A (en) | Integrated circuit testing method, device and medium | |
CN112100068A (en) | Method for testing redirection of communication object of terminal software | |
CN117076227A (en) | Simulation test system, method, device and medium for monitoring function of hard disk backboard | |
CN110334385B (en) | Test method, device and equipment for central controller of comprehensive energy system | |
US10474610B1 (en) | Hardware trace and introspection for productivity platform using a system-on-chip | |
US8554522B2 (en) | Detection of design redundancy | |
JP2019179284A (en) | Simulation system and simulation program | |
CN109684661B (en) | Simulation method of metering instrument based on IEC62056 protocol | |
CN104133174A (en) | FPGA development board test method based on SignaltapII | |
CN114721286A (en) | Distributed compiled parallel real-time simulation system and simulation method |
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 |