CN110825617B - Method and device for simulating communication interaction between devices - Google Patents

Method and device for simulating communication interaction between devices Download PDF

Info

Publication number
CN110825617B
CN110825617B CN201910922461.7A CN201910922461A CN110825617B CN 110825617 B CN110825617 B CN 110825617B CN 201910922461 A CN201910922461 A CN 201910922461A CN 110825617 B CN110825617 B CN 110825617B
Authority
CN
China
Prior art keywords
data
software
verification
communication
simulating
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
CN201910922461.7A
Other languages
Chinese (zh)
Other versions
CN110825617A (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.)
Fujian Nebula Electronics Co Ltd
Original Assignee
Fujian Nebula Electronics 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 Fujian Nebula Electronics Co Ltd filed Critical Fujian Nebula Electronics Co Ltd
Priority to CN201910922461.7A priority Critical patent/CN110825617B/en
Publication of CN110825617A publication Critical patent/CN110825617A/en
Application granted granted Critical
Publication of CN110825617B publication Critical patent/CN110825617B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3696Methods or tools to render software testable
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test 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)
  • Maintenance And Management Of Digital Transmission (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention provides a method for simulating communication interaction between devices, which comprises the following steps of S1, simulating a communication monitoring port corresponding to a connecting device through software; editing a corresponding test instruction format, and storing an edited protocol file; and S2, selecting edited protocol files on a simulation test interface of the software, simulating a sending request, and monitoring data waiting to be received through the communication monitoring port. The invention also provides a system corresponding to the method. The invention has the advantages that: the method can effectively solve the inconvenience caused by the fact that the conventional equipment cannot perform normal test when debugging software due to certain hardware reasons, and effectively improves the debugging progress.

Description

Method and device for simulating communication interaction between devices
Technical Field
The invention relates to the field of simulation test, in particular to a method and a device for simulating communication interaction between devices.
Background
In industrial automation projects, normal testing is often not performed when software is debugged due to certain hardware reasons, which not only brings great inconvenience to software testers, but also affects the progress of the whole project.
Of course, some assistant software, such as serial port assistant, ethernet assistant, etc., exist in the prior art, but these software assistant functions are relatively single, and most of them only support the send-receive mode, which is very inconvenient for practical application.
Disclosure of Invention
The invention aims to solve the technical problem of providing a method for simulating communication interaction between devices, and solves the problem that normal test cannot be performed when software is debugged due to certain hardware reasons.
The invention is realized in the following way: a method for simulating communication interactions between devices, the method comprising the steps of:
step S1, simulating a communication monitoring port corresponding to a connecting device through software; editing a corresponding test instruction format, and storing an edited protocol file;
and S2, selecting edited protocol files on a simulation test interface of the software, simulating transmission request data, and monitoring the transmission data waiting to be set through the communication monitoring port.
Further, the method further comprises: and S3, using an assistant to simulate the upper computer to send request data to the software, monitoring the sending data waiting to be set through the communication monitoring port, and returning the set sending data to the assistant for display.
Further, in the step S1, the simulating, by software, a communication monitoring port corresponding to the device specifically includes:
if the connection equipment of the RS232 communication mode needs to be simulated, a serial port with corresponding parameter settings set is created when clicking on software is started; if the connection equipment in the Ethernet communication mode needs to be simulated, a server with corresponding parameter settings set is created to wait for connection when clicking on software is started.
Further, in the step S1, the editing of the corresponding test instruction format and the saving of the edited protocol file are specifically:
editing a corresponding test instruction format, wherein the test instruction format comprises a protocol list, a receiving identifier and sending data; the transmitted data and the received identification are divided into hexadecimal characters and ASCII common characters;
the data transmission method comprises the steps of freely splitting and combining the transmitted data in a mode of adding, deleting, moving upwards or moving downwards, splicing and transmitting the split and combined data in a sequence from top to bottom, and providing a verification mode through a verification column.
Further, the step S2 specifically includes:
importing an edited protocol file on a simulation test interface of the software, selecting a communication mode to be simulated, and simulating to send request data to the software; after receiving the request data, the software analyzes the request data into hexadecimal characters or ASCII common characters, compares the hexadecimal characters or ASCII common characters with a set receiving identification, and prepares set sending data if the hexadecimal characters or ASCII common characters are equal to the set receiving identification; if the set receiving identification is not equal to the set receiving identification, not preparing the set sending data, and ending the flow;
when the set transmission data is prepared, judging whether the number of the data to be transmitted is zero, if so, not executing transmission, and ending the flow; if the data is not zero, analyzing the data to be transmitted from top to bottom one by one, converting the corresponding set value into a byte array according to the analyzed data type, judging whether the verification is needed or not, and providing a corresponding verification mode through a verification column if the verification is needed; if not, a verification mode is not provided;
and finally, combining all byte arrays into a new byte array according to the sequence from top to bottom, executing transmission, and monitoring the transmission data waiting for setting through the communication monitoring port.
The invention is realized in the following way: a system for simulating communication interactions between devices, the system comprising an instruction format editing module and a simulation interaction module;
the instruction format editing module is used for simulating a communication monitoring port corresponding to the connecting equipment through software; editing a corresponding test instruction format, and storing an edited protocol file;
the simulation interaction module is used for selecting edited protocol files on a simulation test interface of software, simulating sending request data and monitoring sending data waiting to be set through the communication monitoring port.
Further, the system also comprises an interactive verification module;
and the interactive verification module is used for simulating the upper computer to send request data to the software by using the assistant, monitoring the sending data waiting to be set through the communication monitoring port, and returning the set sending data to the assistant for display.
Further, in the instruction format editing module, the communication monitoring port corresponding to the device is simulated by software specifically includes:
if the connection equipment of the RS232 communication mode needs to be simulated, a serial port with corresponding parameter settings set is created when clicking on software is started; if the connection equipment in the Ethernet communication mode needs to be simulated, a server with corresponding parameter settings set is created to wait for connection when clicking on software is started.
Further, in the instruction format editing module, the editing the corresponding test instruction format and saving the edited protocol file specifically includes:
editing a corresponding test instruction format, wherein the test instruction format comprises a protocol list, a receiving identifier and sending data; the transmitted data and the received identification are divided into hexadecimal characters and ASCII common characters;
the data transmission method comprises the steps of freely splitting and combining the transmitted data in a mode of adding, deleting, moving upwards or moving downwards, splicing and transmitting the split and combined data in a sequence from top to bottom, and providing a verification mode through a verification column.
Further, the simulation interaction module specifically comprises:
importing an edited protocol file on a simulation test interface of the software, selecting a communication mode to be simulated, and simulating to send request data to the software; after receiving the request data, the software analyzes the request data into hexadecimal characters or ASCII common characters, compares the hexadecimal characters or ASCII common characters with a set receiving identification, and prepares set sending data if the hexadecimal characters or ASCII common characters are equal to the set receiving identification; if the set receiving identification is not equal to the set receiving identification, not preparing the set sending data, and ending the flow;
when the set transmission data is prepared, judging whether the number of the data to be transmitted is zero, if so, not executing transmission, and ending the flow; if the data is not zero, analyzing the data to be transmitted from top to bottom one by one, converting the corresponding set value into a byte array according to the analyzed data type, judging whether the verification is needed or not, and providing a corresponding verification mode through a verification column if the verification is needed; if not, a verification mode is not provided;
and finally, combining all byte arrays into a new byte array according to the sequence from top to bottom, executing transmission, and monitoring the transmission data waiting for setting through the communication monitoring port.
The invention has the following advantages: by adopting the mode of self-defining the test instruction format, the method and the device can automatically return the set transmission data after receiving a certain receiving identification, so that in the specific test process, when the equipment cannot perform normal test when debugging software due to certain hardware reasons, the method and the device can automatically return the set transmission data according to the receiving identification, thereby effectively solving the inconvenience caused by the fact that the traditional equipment cannot perform normal test when debugging software due to certain hardware reasons and effectively improving the debugging progress.
Drawings
The invention will be further described with reference to examples of embodiments with reference to the accompanying drawings.
FIG. 1 is a flow chart illustrating an implementation of a method for simulating communication interactions between devices according to the present invention.
Fig. 2 is a schematic block diagram of a system for simulating communication interactions between devices in accordance with the present invention.
Fig. 3 is a schematic diagram of a communication monitoring port corresponding to an ethernet communication method in the present invention.
Fig. 4 is a schematic diagram of a communication monitoring port corresponding to an RS232 communication method in the present invention.
FIG. 5 is a schematic diagram of a simulation test performed in the present invention.
Detailed Description
Referring to fig. 1 and fig. 3 to 5, a preferred embodiment of a method for simulating communication interaction between devices according to the present invention includes the following steps:
step S1, simulating a communication monitoring port corresponding to a connecting device through software; editing a corresponding test instruction format, and storing an edited protocol file;
in the step S1, the communication monitoring port corresponding to the device is simulated by software specifically includes:
if the connection equipment of the RS232 communication mode needs to be simulated, a serial port with corresponding parameter setting set is created when clicking is started on software, and when the RS232 communication mode is adopted, the corresponding parameters at least comprise COM numbers and baud rates, and of course, other parameters can be set according to the needs. If the connection equipment of the Ethernet (TCP) communication mode needs to be simulated, a server which sets corresponding parameter settings is created to wait for connection when clicking on software is started, and when the Ethernet communication mode is adopted, the corresponding parameters at least comprise an IP address and a port number, and other parameters can be set according to the needs.
In the step S1, the editing of the corresponding test instruction format and the saving of the edited protocol file specifically includes:
editing a corresponding test instruction format, wherein the test instruction format comprises a protocol list, a receiving identifier and sending data; the transmitted data and the received identification are divided into hexadecimal characters and ASCII common characters;
the sending data is freely split and combined in a mode of adding, deleting, moving upwards or moving downwards, that is, in a specific editing process, the sending data can be freely split and combined in a mode of adding, deleting, moving upwards or moving downwards, split and combined data are spliced and sent in a sequence from top to bottom, and a verification mode is provided through a verification column. The check mode provided by the check column can comprise modes of carriage return and line change, carriage return, line change, CRC, parity, high-low exchange and the like.
Of course, in the specific implementation, the protocol list is also configured with functions of creating, deleting, storing and the like, so as to realize the creation of a protocol, deleting of a protocol, storing of a protocol and the like in the protocol list according to actual needs; the receiving identifier is also provided with functions of adding, deleting, moving upwards and the like so as to realize operations of adding, deleting, moving upwards and the like on the receiving identifier according to actual needs; meanwhile, the receiving identifier is correspondingly provided with a serial number (used for sequencing the receiving identifiers), an enabling option and a type (used for representing the data type of the receiving identifier), and in the implementation, if which receiving identifier needs to be enabled, the receiving identifier can be enabled by checking the enabling option.
As shown in fig. 3, fig. 3 shows a communication monitoring port corresponding to an ethernet communication mode, where the set IP address is 10.0.7.119 and the set port number is 9600; as shown in fig. 4, fig. 4 shows a communication monitoring port corresponding to the RS232 communication method, wherein baud rates 9600, n,8,1 are set, and COM number is set to COM1.
And S2, selecting edited protocol files on a simulation test interface of the software, simulating transmission request data, and monitoring the transmission data waiting to be set through the communication monitoring port.
In the present invention, the step S2 specifically includes:
importing an edited protocol file on a simulation test interface of the software, selecting a communication mode to be simulated, and simulating to send request data to the software; after receiving the request data, the software analyzes the request data into hexadecimal characters or ASCII common characters, compares the hexadecimal characters or ASCII common characters with a set receiving identification, and prepares set sending data if the hexadecimal characters or ASCII common characters are equal to the set receiving identification; if the set receiving identification is not equal to the set receiving identification, not preparing the set sending data, and ending the flow;
when the set transmission data is prepared, judging whether the number of the data to be transmitted is zero, if so, not executing transmission, and ending the flow; if the data is not zero, analyzing the data to be transmitted from top to bottom one by one, converting the corresponding set value into a byte array according to the analyzed data type, judging whether the verification is needed or not, and providing a corresponding verification mode through a verification column if the verification is needed; if not, a verification mode is not provided;
and finally, combining all byte arrays into a new byte array according to the sequence from top to bottom, executing transmission, and monitoring the transmission data waiting for setting through the communication monitoring port.
As shown in fig. 5, an edited protocol file is imported into an import frame of a simulation test interface of software, and a simulated communication mode is selected as a serial port; then clicking a [ beginning ] button to realize simulation of sending request data;
in the present invention, the method further comprises: and S3, using an assistant to simulate the upper computer to send request data to the software, monitoring the sending data waiting to be set through the communication monitoring port, and returning the set sending data to the assistant for display. The step S3 is mainly used for verifying the function of the software to determine whether the simulation test can be really implemented by the software.
The invention is further illustrated by the following example of a transmission procedure for an analog multimeter:
firstly, a protocol file is newly established in a corresponding protocol list according to a communication mode, and a corresponding test instruction format is edited, wherein the receiving identification is set as Read, the type is Str, the Read instruction is a Read instruction of the multimeter, a piece of transmission data is newly added to the Read instruction, the data is 1.234556666 to represent a test value, and the type is Str; the COM number is set to COM1, the baud rate is set to 9600, the data bit is 8, the check bit is zero, the stop bit is 1, and the edited protocol file is stored after setting. In order to simulate test, we need to virtualize two serial ports, then save the protocol file, return to the simulation test interface of the software, import the protocol file in the simulation test interface, select serial port communication simulation, click [ start ] button, and start monitoring the sending data waiting for setting; as can be seen from the left part of fig. 5, when the received data (i.e., the reception flag) is Read, the transmitted data (i.e., the transmission data) is 1.234556666.
Finally, an assistant (such as a cat serial port assistant) is used for simulating the connection of the upper computer, after the parameters are set, the connection is clicked, hexadecimal is not checked, and a Read is sent; from the right part of fig. 5, it can be seen that the assistant quickly receives 1.234556666 which we set, so that the upper computer software can take this value as the measurement value of the multimeter, then perform the corresponding analysis and continue to test itself.
Referring to fig. 2 to 5, a preferred embodiment of a system for simulating communication interaction between devices according to the present invention includes an instruction format editing module and a simulation interaction module;
the instruction format editing module is used for simulating a communication monitoring port corresponding to the connecting equipment through software; editing a corresponding test instruction format, and storing an edited protocol file;
in the instruction format editing module, the communication monitoring port corresponding to the device is simulated by software specifically comprises:
if the connection equipment of the RS232 communication mode needs to be simulated, a serial port with corresponding parameter setting set is created when clicking is started on software, and when the RS232 communication mode is adopted, the corresponding parameters at least comprise COM numbers and baud rates, and of course, other parameters can be set according to the needs. If the connection equipment of the Ethernet (TCP) communication mode needs to be simulated, a server which sets corresponding parameter settings is created to wait for connection when clicking on software is started, and when the Ethernet communication mode is adopted, the corresponding parameters at least comprise an IP address and a port number, and other parameters can be set according to the needs.
In the instruction format editing module, the step of editing the corresponding test instruction format and storing the edited protocol file specifically includes:
editing a corresponding test instruction format, wherein the test instruction format comprises a protocol list, a receiving identifier and sending data; the transmitted data and the received identification are divided into hexadecimal characters and ASCII common characters;
the sending data is freely split and combined in a mode of adding, deleting, moving upwards or moving downwards, that is, in a specific editing process, the sending data can be freely split and combined in a mode of adding, deleting, moving upwards or moving downwards, split and combined data are spliced and sent in a sequence from top to bottom, and a verification mode is provided through a verification column. The check mode provided by the check column can comprise modes of carriage return and line change, carriage return, line change, CRC, parity, high-low exchange and the like.
Of course, in the specific implementation, the protocol list is also configured with functions of creating, deleting, storing and the like, so as to realize the creation of a protocol, deleting of a protocol, storing of a protocol and the like in the protocol list according to actual needs; the receiving identifier is also provided with functions of adding, deleting, moving upwards and the like so as to realize operations of adding, deleting, moving upwards and the like on the receiving identifier according to actual needs; meanwhile, the receiving identifier is correspondingly provided with a serial number (used for sequencing the receiving identifiers), an enabling option and a type (used for representing the data type of the receiving identifier), and in the implementation, if which receiving identifier needs to be enabled, the receiving identifier can be enabled by checking the enabling option.
As shown in fig. 3, fig. 3 shows a communication monitoring port corresponding to an ethernet communication mode, where the set IP address is 10.0.7.119 and the set port number is 9600; as shown in fig. 4, fig. 4 shows a communication monitoring port corresponding to the RS232 communication method, wherein baud rates 9600, n,8,1 are set, and COM number is set to COM1.
The simulation interaction module is used for selecting edited protocol files on a simulation test interface of software, simulating sending request data and monitoring sending data waiting to be set through the communication monitoring port.
In the invention, the simulation interaction module specifically comprises:
importing an edited protocol file on a simulation test interface of the software, selecting a communication mode to be simulated, and simulating to send request data to the software; after receiving the request data, the software analyzes the request data into hexadecimal characters or ASCII common characters, compares the hexadecimal characters or ASCII common characters with a set receiving identification, and prepares set sending data if the hexadecimal characters or ASCII common characters are equal to the set receiving identification; if the set receiving identification is not equal to the set receiving identification, not preparing the set sending data, and ending the flow;
when the set transmission data is prepared, judging whether the number of the data to be transmitted is zero, if so, not executing transmission, and ending the flow; if the data is not zero, analyzing the data to be transmitted from top to bottom one by one, converting the corresponding set value into a byte array according to the analyzed data type, judging whether the verification is needed or not, and providing a corresponding verification mode through a verification column if the verification is needed; if not, a verification mode is not provided;
and finally, combining all byte arrays into a new byte array according to the sequence from top to bottom, executing transmission, and monitoring the transmission data waiting for setting through the communication monitoring port.
As shown in fig. 5, an edited protocol file is imported into an import frame of a simulation test interface of software, and a simulated communication mode is selected as a serial port; then clicking a [ beginning ] button to realize simulation of sending request data;
in the invention, the system also comprises an interactive verification module;
and the interactive verification module is used for simulating the upper computer to send request data to the software by using the assistant, monitoring the sending data waiting to be set through the communication monitoring port, and returning the set sending data to the assistant for display. The interactive checking module is mainly used for checking the functions of the software to determine whether the simulation test can be realized through the software.
The invention is further illustrated by the following example of a transmission procedure for an analog multimeter:
firstly, a protocol file is newly established in a corresponding protocol list according to a communication mode, and a corresponding test instruction format is edited, wherein the receiving identification is set as Read, the type is Str, the Read instruction is a Read instruction of the multimeter, a piece of transmission data is newly added to the Read instruction, the data is 1.234556666 to represent a test value, and the type is Str; the COM number is set to COM1, the baud rate is set to 9600, the data bit is 8, the check bit is zero, the stop bit is 1, and the edited protocol file is stored after setting. In order to simulate test, we need to virtualize two serial ports, then save the protocol file, return to the simulation test interface of the software, import the protocol file in the simulation test interface, select serial port communication simulation, click [ start ] button, and start monitoring the sending data waiting for setting; as can be seen from the left part of fig. 5, when the received data (i.e., the reception flag) is Read, the transmitted data (i.e., the transmission data) is 1.234556666.
Finally, an assistant (such as a cat serial port assistant) is used for simulating the connection of the upper computer, after the parameters are set, the connection is clicked, hexadecimal is not checked, and a Read is sent; from the right part of fig. 5, it can be seen that the assistant quickly receives 1.234556666 which we set, so that the upper computer software can take this value as the measurement value of the multimeter, then perform the corresponding analysis and continue to test itself.
In summary, the invention has the advantages that the method of adopting the self-defined test instruction format realizes that a certain set transmission data is automatically returned after a certain receiving identification is received, so that in the specific test process, when the equipment cannot perform normal test in debugging software due to certain hardware reasons, the method and the device can realize that the transmission data of a certain set is automatically returned according to the receiving identification, thereby effectively solving the inconvenience caused by the fact that the equipment cannot perform normal test in debugging software due to certain hardware reasons in the past and effectively improving the debugging progress.
While specific embodiments of the invention have been described above, it will be appreciated by those skilled in the art that the specific embodiments described are illustrative only and not intended to limit the scope of the invention, and that equivalent modifications and variations of the invention in light of the spirit of the invention will be covered by the claims of the present invention.

Claims (2)

1. A method for simulating communication interactions between devices, comprising: the method comprises the following steps:
step S1, simulating a communication monitoring port corresponding to a connecting device through software; editing a corresponding test instruction format, and storing an edited protocol file;
the communication monitoring port corresponding to the equipment is simulated by software specifically comprises the following steps:
if the connection equipment of the RS232 communication mode needs to be simulated, a serial port with corresponding parameter settings set is created when clicking is started on software, and when the RS232 communication mode is adopted, the corresponding parameters at least comprise COM numbers and baud rates; if the connection equipment of the Ethernet communication mode needs to be simulated, creating a server with corresponding parameter setting set to wait for connection when clicking on software is started, and when the Ethernet communication mode is adopted, the corresponding parameters at least comprise an IP address and a port number;
the method comprises the steps of editing the corresponding test instruction format and storing the edited protocol file specifically as follows:
editing a corresponding test instruction format, wherein the test instruction format comprises a protocol list, a receiving identifier and sending data; the transmitted data and the received identification are divided into hexadecimal characters and ASCII common characters;
the method comprises the steps of freely splitting and combining the transmitted data in a mode of adding, deleting, moving upwards or moving downwards, splicing and transmitting the split and combined data in a sequence from top to bottom, and providing a verification mode through a verification column;
s2, selecting edited protocol files on a simulation test interface of the software, simulating transmission request data, and monitoring transmission data waiting to be set through the communication monitoring port;
step S3, using an assistant to simulate the upper computer to send request data to the software, monitoring the sending data waiting to be set through the communication monitoring port, and returning the set sending data to the assistant for display;
the step S2 specifically comprises the following steps:
importing an edited protocol file on a simulation test interface of the software, selecting a communication mode to be simulated, and simulating to send request data to the software; after receiving the request data, the software analyzes the request data into hexadecimal characters or ASCII common characters, compares the hexadecimal characters or ASCII common characters with a set receiving identification, and prepares set sending data if the hexadecimal characters or ASCII common characters are equal to the set receiving identification; if the set receiving identification is not equal to the set receiving identification, not preparing the set sending data, and ending the flow;
when the set transmission data is prepared, judging whether the number of the data to be transmitted is zero, if so, not executing transmission, and ending the flow; if the data is not zero, analyzing the data to be transmitted from top to bottom one by one, converting the corresponding set value into a byte array according to the analyzed data type, judging whether the verification is needed or not, and providing a corresponding verification mode through a verification column if the verification is needed; if not, a verification mode is not provided;
and finally, combining all byte arrays into a new byte array according to the sequence from top to bottom, executing transmission, and monitoring the transmission data waiting for setting through the communication monitoring port.
2. A system for simulating communication interactions between devices, comprising: the system comprises an instruction format editing module, an analog interaction module and an interaction verification module;
the instruction format editing module is used for simulating a communication monitoring port corresponding to the connecting equipment through software; editing a corresponding test instruction format, and storing an edited protocol file;
the communication monitoring port corresponding to the equipment is simulated by software specifically comprises the following steps:
if the connection equipment of the RS232 communication mode needs to be simulated, a serial port with corresponding parameter settings set is created when clicking is started on software, and when the RS232 communication mode is adopted, the corresponding parameters at least comprise COM numbers and baud rates; if the connection equipment of the Ethernet communication mode needs to be simulated, creating a server with corresponding parameter setting set to wait for connection when clicking on software is started, and when the Ethernet communication mode is adopted, the corresponding parameters at least comprise an IP address and a port number;
the method comprises the steps of editing the corresponding test instruction format and storing the edited protocol file specifically as follows:
editing a corresponding test instruction format, wherein the test instruction format comprises a protocol list, a receiving identifier and sending data; the transmitted data and the received identification are divided into hexadecimal characters and ASCII common characters;
the method comprises the steps of freely splitting and combining the transmitted data in a mode of adding, deleting, moving upwards or moving downwards, splicing and transmitting the split and combined data in a sequence from top to bottom, and providing a verification mode through a verification column;
the simulation interaction module is used for selecting edited protocol files on a simulation test interface of software, simulating sending request data and monitoring sending data waiting to be set through the communication monitoring port;
the interactive verification module is used for simulating the upper computer to send request data to the software by using the assistant, monitoring the sending data waiting to be set through the communication monitoring port, and returning the set sending data to the assistant for display;
the simulation interaction module specifically comprises:
importing an edited protocol file on a simulation test interface of the software, selecting a communication mode to be simulated, and simulating to send request data to the software; after receiving the request data, the software analyzes the request data into hexadecimal characters or ASCII common characters, compares the hexadecimal characters or ASCII common characters with a set receiving identification, and prepares set sending data if the hexadecimal characters or ASCII common characters are equal to the set receiving identification; if the set receiving identification is not equal to the set receiving identification, not preparing the set sending data, and ending the flow;
when the set transmission data is prepared, judging whether the number of the data to be transmitted is zero, if so, not executing transmission, and ending the flow; if the data is not zero, analyzing the data to be transmitted from top to bottom one by one, converting the corresponding set value into a byte array according to the analyzed data type, judging whether the verification is needed or not, and providing a corresponding verification mode through a verification column if the verification is needed; if not, a verification mode is not provided;
and finally, combining all byte arrays into a new byte array according to the sequence from top to bottom, executing transmission, and monitoring the transmission data waiting for setting through the communication monitoring port.
CN201910922461.7A 2019-09-27 2019-09-27 Method and device for simulating communication interaction between devices Active CN110825617B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910922461.7A CN110825617B (en) 2019-09-27 2019-09-27 Method and device for simulating communication interaction between devices

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910922461.7A CN110825617B (en) 2019-09-27 2019-09-27 Method and device for simulating communication interaction between devices

Publications (2)

Publication Number Publication Date
CN110825617A CN110825617A (en) 2020-02-21
CN110825617B true CN110825617B (en) 2023-09-08

Family

ID=69548428

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910922461.7A Active CN110825617B (en) 2019-09-27 2019-09-27 Method and device for simulating communication interaction between devices

Country Status (1)

Country Link
CN (1) CN110825617B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112667454A (en) * 2020-12-21 2021-04-16 南京能云电力科技有限公司 Software simulation system of power device tester and design method of simulation system
CN113253033A (en) * 2021-05-25 2021-08-13 科世达(上海)机电有限公司 Simulation power supply testing arrangement

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103019939A (en) * 2012-12-27 2013-04-03 广州广电运通金融电子股份有限公司 Method and system for testing driver
CN107038118A (en) * 2017-03-28 2017-08-11 福建星云电子股份有限公司 The universal process method that a kind of distinct electronic apparatuses assembling is tested
CN109213673A (en) * 2017-07-07 2019-01-15 深圳市有方科技股份有限公司 A kind of development approach and device based on serial ports simulation software
CN109299193A (en) * 2018-09-25 2019-02-01 深圳市佰仟金融服务有限公司 Method of data synchronization and relevant device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
FR2958427B1 (en) * 2010-03-30 2016-11-18 Eurocopter France METHOD FOR ARRANGING AN APPLICATION SOFTWARE ON COMPUTER EQUIPMENT OF REAL OR VIRTUAL EQUIPMENT AND ARCHITECTURE FOR CONTROLLING EQUIPMENT COMPRISING SUCH SOFTWARE

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103019939A (en) * 2012-12-27 2013-04-03 广州广电运通金融电子股份有限公司 Method and system for testing driver
CN107038118A (en) * 2017-03-28 2017-08-11 福建星云电子股份有限公司 The universal process method that a kind of distinct electronic apparatuses assembling is tested
CN109213673A (en) * 2017-07-07 2019-01-15 深圳市有方科技股份有限公司 A kind of development approach and device based on serial ports simulation software
CN109299193A (en) * 2018-09-25 2019-02-01 深圳市佰仟金融服务有限公司 Method of data synchronization and relevant device

Also Published As

Publication number Publication date
CN110825617A (en) 2020-02-21

Similar Documents

Publication Publication Date Title
CN108959068B (en) Software interface testing method, device and storage medium
WO2017000424A1 (en) Protocol detection method and apparatus
CN110825617B (en) Method and device for simulating communication interaction between devices
CN106933729A (en) A kind of method of testing and system based on cloud platform
CN113190454A (en) Real-vehicle test method and system for vehicle-mounted terminal software
CN107102949B (en) Application program offline testing method and tool
CN109413678A (en) A kind of Wi-Fi module automatic test approach and test macro
CN103580942B (en) A kind of simulative serial port method of testing and device
CN112463467B (en) Automated integrated test system and method thereof
CN110347539B (en) Test method, device, system, computing device and medium applied to server
CN111858373A (en) Internet of things application testing method based on dynamic simulation control panel serial port protocol
CN112463511B (en) Automatic test system and test method for serial port equipment of Internet of things
CN111078547A (en) Automatic testing framework system for PYTHON general APP software
CN113572658A (en) Vehicle control signal testing method and device, electronic equipment and storage medium
CN105808510A (en) Debugging data verification method and device
CN111651232A (en) One-machine multi-control method, device and system and electronic equipment
CN113064618B (en) System and method for simulating new energy vehicle conformance detection
CN113126993B (en) Automatic test method and system applied to vehicle detection software
CN102620746A (en) Navigator testing system
CN112583663B (en) Automatic network performance testing method based on domestic operating system
CN116974835A (en) Method, system, equipment and storage medium for testing serial port communication
CN112634685A (en) Remote experiment teaching system
CN116545891A (en) Automatic distribution network testing method based on intelligent equipment
CN116306398A (en) Verification platform of multi-channel IO interface IP and stopping algorithm thereof
CN112543110A (en) Network communication simulation method and system of mass power distribution automatic terminal

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