Disclosure of Invention
The invention mainly aims to provide a data testing method of a PGNs (packet data networks) receiving and sending system, and aims to solve the technical problems of complex receiving and sending testing mode, poor accuracy and low efficiency of the existing PGNs information.
In order to achieve the above object, the present invention provides a data testing method for PGNs transceiving system, comprising the following steps:
providing a data receiving and transmitting configuration window and a data display window on a user interaction interface of a PGNs receiving and transmitting system, wherein the data receiving and transmitting configuration window comprises a data transmitting configuration area and a request configuration transmitting area;
receiving data input by a user in the data sending configuration area and sending configuration operation carried out on the data;
receiving data request configuration operation performed by a user in the request configuration sending area;
starting a data test according to data input by a user, set sending configuration and data request configuration;
and displaying the test result returned by the data test on the data display window.
Preferably, the step of receiving data input by a user in the data sending configuration area and sending configuration operation performed on the data includes:
writing a data file with a preset format into a text box of the data sending configuration area according to a file reading interface provided by the data sending configuration area;
and determining data to be transmitted in the text box and the transmission configuration of the data to be transmitted, wherein the transmission configuration comprises a transmission mode, a transmission address and a circulation mode.
Preferably, the step of receiving data input by the user in the data sending configuration area and sending configuration operation performed on the data further includes:
and editing the data in the text box to generate new test data.
Preferably, the step of receiving the data request configuration operation performed by the user in the request configuration sending area includes:
providing ISO and Group request configuration options in the request configuration sending area;
when a user selects ISO request configuration, sequentially configuring a global/designated address sending mode, a PGN, a destination address, a source address, sending interval time and a data request sending mode;
when a user selects Group Request configuration, a Request/Command parameter code, the number of parameters, parameter data, a global/designated address sending mode, a PGN, a destination address, a source address, sending interval time and a data Request sending mode are configured in sequence.
Preferably, the data display window includes a received message screening area, a source code display area, a parsing display area and a receiving key operation area, the receiving key operation area provides an ID message receiving start/pause option, a file saving option and a data clearing option, wherein the step of displaying the test result returned by the data test on the data display window includes:
displaying the ID message of the test result in the received message screening area;
displaying the source code data of the ID message in the source code display area;
and displaying the decoded data of the ID message in the analysis display area.
Preferably, the data testing method further comprises:
providing a customized message configuration window on a user interaction interface of a PGNs (packet data networks) transceiving system, wherein the customized message configuration window comprises a private message sending interval option, a GPS (global positioning system) track message sending interval option, an RUT (remote terminal unit) monitoring starting/suspending option and a decryption instruction sending/suspending option;
and sending the customized message according to the customized message sending configuration determined by the user in the customized message configuration window.
The present invention also provides a data testing apparatus for a PGNs transceiving system, comprising:
the system comprises a user data configuration module, a data transmission and reception configuration module and a data display module, wherein the user data configuration module is used for providing a data transmission and reception configuration window and a data display window on a user interaction interface of the PGNs (packet data networks) transmission and reception system, and the data transmission and reception configuration window comprises a data transmission configuration area and a request configuration transmission area;
the input and transmission configuration module is used for receiving data input by a user in the data transmission configuration area and transmitting configuration operation carried out on the data;
the request configuration module is used for receiving data request configuration operation carried out by a user in the request configuration sending area;
the data test module is used for starting data test according to data input by a user, set sending configuration and data request configuration;
and the result display module is used for displaying the test result returned by the data test in the data display window.
Preferably, the input and transmission configuration module includes:
the file reading unit is used for writing a data file with a preset format into a text box of the data sending configuration area according to a file reading interface provided by the data sending configuration area;
and the data selection and transmission configuration unit is used for determining the data to be transmitted in the text box and the transmission configuration of the data to be transmitted, and the transmission configuration comprises a transmission mode, a transmission address and a circulation mode.
Preferably, the input and transmission configuration module further includes:
and the data editing unit is used for editing the data in the text box to generate new test data.
Preferably, the request configuration module includes:
a request mode configuration unit, configured to provide ISO and Group request configuration options in the request configuration sending area;
the system comprises a first request mode selection unit, a second request mode selection unit and a third request mode selection unit, wherein the first request mode selection unit is used for sequentially configuring a global/designated address sending mode, a PGN (packet generation network), a destination address, a source address, sending interval time and a data request sending mode when a user selects ISO request configuration;
and the second Request mode selection unit is used for sequentially configuring Request/Command parameter codes, parameter numbers, parameter data, a global/designated address sending mode, a PGN, a destination address, a source address, sending interval time and a data Request sending mode when the user selects Group Request configuration.
Preferably, the data display window includes a received message screening area, a source code display area, an analysis display area, and a reception key operation area, and the reception key operation area provides an ID message reception start/pause option, a file saving option, and a data clearing option, where the result display module includes:
the screening unit is used for displaying the ID message of the test result in the received message screening area;
a source code unit for displaying source code data of the ID message in the source code display area;
and the analysis unit is used for displaying the decoded data of the ID message in the analysis display area.
Preferably, the data testing apparatus further comprises:
the system comprises a customized message configuration module, a user interaction interface module and a control module, wherein the customized message configuration module is used for providing a customized message configuration window on the user interaction interface of the PGNs transceiver system, and the customized message configuration window comprises a private message sending interval option, a GPS track message sending interval option, an RUT monitoring starting/suspending option and a decryption instruction sending/suspending option;
and the custom message sending express is used for sending the custom message according to the custom message sending configuration determined by the user in the custom message configuration window.
The present invention also provides a computer program storage medium having stored thereon a computer program which, when executed by a processor, performs the steps in the data testing method described above.
The invention also provides a computer device, which comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor executes the computer program to realize the steps in the data testing method.
The data testing method of the PGNs receiving and sending system is mainly used for receiving and sending Parameter Groups (PGNs) information on the NMEA2000 protocol, can greatly improve the efficiency of data testing by providing the user interaction graphical interface with a plurality of independent data processing threads, and solves the problems that the hexadecimal readability of PGNs source code data is poor, multi-packet data is difficult to analyze manually, and the packet packaging is time-consuming and easy to make mistakes when the reply is requested.
Detailed Description
The embodiments described below with reference to the drawings are exemplary and intended to be illustrative of the present invention and should not be construed as limiting the present invention, and all other embodiments that can be obtained by one skilled in the art based on the embodiments of the present invention without inventive efforts shall fall within the scope of protection of the present invention.
The invention provides a data testing method of a PGNs (packet data networks) transceiving system, which is used for transceiving Parameter Groups (PGNs) information on a NMEA2000 protocol, and comprises the following steps with reference to the figure 1 and the figure 2:
step S10, providing a data transceiving configuration window and a data display window on a user interaction interface of the PGNs transceiving system;
the data receiving and sending configuration window is used for providing data input for a user and configuring an interface of data sending and requesting elements, the data display window is used for displaying a result returned by a data receiving party, as shown in fig. 2, the data receiving and sending configuration window is positioned on the left side, the data display window is positioned on the right side and can be realized through a computer software program, and the data receiving and sending configuration window at least comprises a data sending configuration area and a request configuration sending area.
Step S20, receiving data input by user in the data transmission configuration area and the transmission configuration operation of the data;
in this step, the user may input data in the data transmission configuration area, the input data may be multiple pieces, so as to correspond to multiple data testing processes, the data input may be by invoking a relevant file through a program and reading the data from the file, or the user may edit the data in real time and take effect in real time after editing. This data is typically in the relevant instruction language, such as in a marine application device, may be a request to send a DSC call, adjust the brightness of the device on the bus, etc. After the data is input, the transmission of the data needs to be configured accordingly to simulate the actual application of the transmitting device.
Step S30, receiving data request configuration operation performed by the user in the request configuration transmitting area;
in the step, in order to obtain the result returned by the receiving party, a data request configuration input interface is arranged in the request configuration sending area, and a user performs a data request configuration operation in the request configuration sending area, wherein the process of the request configuration operation comprises the input of custom data and the determination of selectable items. Specifically, the content of the reply of the request can be configured for each piece of sent data, and an independent multithread processing process is realized.
Step S40, according to the data input by the user, the set sending configuration and the data request configuration, starting the data test;
in the step, after a user inputs specific data and sets sending configuration and data request configuration, a data testing thread can be started, namely, a sender sends data to a receiver according to a specific format requirement and appoints a result return form, so that a data interaction process between the sender and the receiver is realized, and the purpose of software testing is achieved.
Step S50, displaying the test result returned from the data test in the data display window.
In the step, the data display window is mainly used for receiving the test result returned by the data test, the embodiment form is text data, and the collection display can be performed according to the number of data processing threads started by a user. Particularly, a data analysis function is provided, and a test result is converted into a plaintext form which can be directly read by a user, so that the user can use the test result conveniently.
By the data testing method based on the user interaction graphical interface, a plurality of independent data processing threads can be provided, the data testing efficiency can be greatly improved, and the problems that the hexadecimal readability of PGNs source code data is poor, the manual analysis of multi-packet data is laborious, the packet packing is time-consuming and the error is easy to make when the request is replied are solved.
Referring to fig. 3 and 4, in a preferred embodiment of the present invention, the step S20 may include:
step S21, writing the data file with preset format into the text box of the data transmission configuration area according to the file reading interface provided by the data transmission configuration area;
as shown in fig. 3, a user interaction graphical interface presented in the data transmission configuration area has a text box and data transmission configuration options, for example, the data transmission configuration options include function keys or options such as "Transmit mode", "Open File", "Selected Message", "Source Address", "Rate", and "Start/Stop Send", and a File to be loaded can be Selected from the terminal device by clicking the "Open File" key, in this embodiment, the File is in a text format, when the File is Selected to be opened, the data in the File is automatically read into the text box and presented in a line form, which data or data in the text box can be Selected as a transmission object through the "Selected Message" function option, and as shown in fig. 3, the data range pull-down option selects data in the 3 rd to 7 th lines as a transmission object; in addition, what Address to send data can be selected through a pull-down option provided by the Source Address, a plurality of addresses are prestored in the database, and the data can be correspondingly selected according to test requirements without self-editing input of a user, so that the data transmission method has the characteristics of simplicity and easiness in use; in the aspect of data transmission frequency, a 'Rate' function option can be used to select a required transmission frequency, for example, only transmitting once, or transmitting circularly at a preset time interval, wherein the time interval can be selected within the range of 50-10000 ms; in the sending mode, the Single or the Line by Line can be selected by two mode options provided by the Transmit mode, namely, one piece of data or a plurality of pieces of data are sent in turn. By providing the user interaction graphical interface of the data sending configuration area, the data to be sent can be conveniently displayed, data verification is realized, the data configuration with modularized functions is presented, and the convenience of software testing can be improved.
In step S22, data to be transmitted in the text box and the transmission configuration of the data to be transmitted are determined.
Before starting the software testing thread, the data can be selected by the data sending configuration area and the sending configuration determination operation can be performed, wherein the sending configuration comprises a sending mode, a sending address and a circulation mode, and for example, the sending mode is that one piece of data is sent, the sending address is 0x99, and the circulation mode is that the sending mode is sent once every 10000 ms. After the selection of the data to be transmitted and the confirmation of the transmission configuration are finished, a Start/Stop Send key can be clicked to Start a software testing thread.
Referring to fig. 5, in a preferred embodiment of the present invention, the step S20 further includes:
in step S23, the data in the text box is edited to generate new test data.
Between steps S21 and S22, after the user loads the data in the file into the text box, the data in the text box is configured to be editable, and the user can add other data into the text box or change the data in the text box, and these data operations all take effect in real time after being changed, and are used as the data to be sent, thereby providing convenience for data modification and improving the efficiency of software testing.
Referring to fig. 6 to 8, in a preferred embodiment of the present invention, the step S30 may include:
step S31, providing ISO and Group request configuration options in the request configuration sending area;
a user interaction graphical interface of the Request configuration sending area provides a single-item selected Request configuration option, a user can select 'ISO Request' or 'Request group function' in a single-click mode, the two Request configuration options provide wider test choices for the user, and multiple application scenes are met.
Step S32, when the user selects ISO request configuration, configuring the global/designated address sending mode, PGN, destination address, source address, sending interval time and data request sending mode in turn;
as shown in fig. 7, when selecting the ISO request configuration, the user may determine the address transmission method, the PGN, the destination address, the source address, the transmission interval time, the data request transmission method, and the like through a single selection and a form of a drop-down box, and has the characteristics of simplicity and easy use.
Step S33, when the user selects the Group Request configuration, sequentially configuring the Request/Command parameter code, the number of parameters, the parameter data, the global/designated address transmission mode, the PGN, the destination address, the source address, the transmission interval time, and the data Request transmission mode.
As shown in fig. 8, different from the ISO Request configuration, a Request/Command parameter code, the number of parameters, and parameter data need to be configured, and operation input is implemented in the form of a single selection, a drop-down box, and a text box.
Referring to fig. 9-12, in a preferred embodiment of the present invention, the data display window includes a received message screening area (corresponding to fig. 9), a source code display area (corresponding to fig. 11), a parsing display area (corresponding to fig. 12), and a receiving key operation area (corresponding to fig. 10), wherein the receiving key operation area provides an ID message reception start/pause option, a file saving option, and a data clearing option.
In accordance with the interface function of the data display window, the step S50 may include:
displaying the ID information of the test result in the received information screening area;
displaying source code data of the ID message in a source code display area;
and displaying the decoded data of the ID message in the analysis display area.
The PGNs transceiver system can receive all PGN messages on the NMEA2000 protocol network bus and display the PGN messages in a text line form in the received message screening area, when a user starts an ID message receiving function in the receiving key operation area, all messages on the network bus are displayed, of course, data of a specific ID can be selected in a list box, and only data consistent with the ID is received at the moment; the data saving function of saving the response message To the File through the Save To File and exporting the response message is also provided; in addition, all data in the list box is cleared by configuring a Clear Rx list option, and the state of the previous receiving starting or suspending is kept. And displaying the source code data to a text box, for example, automatically clearing the screen and displaying when the data is equal to 10000. The PGNs receiving and transmitting system also provides a data analysis function, and source code data are converted into analysis data which can be directly understood by a user through a decoding algorithm, so that software test results can be conveniently identified.
Referring to fig. 13 and 14, in a preferred embodiment of the present invention, the data testing method further includes:
step S60, providing a customized message configuration window on the user interactive interface of the PGNs receiving and sending system;
in the embodiment, besides the realization of a conventional data testing function and the adaptation to standardized equipment, a customized message configuration window is provided to realize the customized requirement of message receiving and adapt to more testing application scenarios. As shown in fig. 14, the customized message configuration window includes a private message transmission interval option, a GPS track message transmission interval option, an RUT monitoring start/pause option, a decryption instruction transmission/pause option.
Step S70, sending the customized message according to the customized message sending configuration determined by the user in the customized message configuration window.
The present invention also provides a data testing apparatus for a PGNs transceiving system, referring to fig. 15, which includes:
a user data configuration module 10, configured to provide a data transceiving configuration window and a data display window on a user interaction interface of a PGNs transceiving system, where the data transceiving configuration window includes a data sending configuration area and a request configuration sending area;
an input and transmission configuration module 20, configured to receive data input by a user in the data transmission configuration area and perform a transmission configuration operation on the data;
a request configuration module 30, configured to receive a data request configuration operation performed by a user in a request configuration sending area;
the data test module 40 is used for starting data test according to data input by a user, set sending configuration and data request configuration;
and the result display module 50 is used for displaying the test result returned by the data test in the data display window.
Preferably, the input and transmission configuration module 20 comprises:
the file reading unit is used for writing a data file in a preset format into a text box of the data sending configuration area according to a file reading interface provided by the data sending configuration area;
and the data selection and transmission configuration unit is used for determining the data to be transmitted in the text box and the transmission configuration of the data to be transmitted, and the transmission configuration comprises a transmission mode, a transmission address and a circulation mode.
Preferably, the input and transmission configuration module 20 further includes:
and the data editing unit is used for editing the data in the text box to generate new test data.
Preferably, the request configuration module 30 includes:
a request mode configuration unit, which is used for providing ISO and Group request configuration options in a request configuration sending area;
the system comprises a first request mode selection unit, a second request mode selection unit and a third request mode selection unit, wherein the first request mode selection unit is used for sequentially configuring a global/designated address sending mode, a PGN (packet generation network), a destination address, a source address, sending interval time and a data request sending mode when a user selects ISO request configuration;
and the second Request mode selection unit is used for sequentially configuring Request/Command parameter codes, parameter numbers, parameter data, a global/designated address sending mode, a PGN, a destination address, a source address, sending interval time and a data Request sending mode when the user selects Group Request configuration.
Preferably, the data display window includes a received message screening area, a source code display area, an analysis display area, and a reception key operation area, and the reception key operation area provides an ID message reception start/pause option, a file saving option, and a data clearing option, where the result display module 50 includes:
the screening unit is used for displaying the ID information of the test result in the received information screening area;
a source code unit for displaying source code data of the ID message in a source code display area;
and the analysis unit is used for displaying the decoded data of the ID message in the analysis display area.
Preferably, the data testing apparatus further comprises:
the customized message configuration module is used for providing a customized message configuration window on a user interaction interface of the PGNs transceiver system, wherein the customized message configuration window comprises a private message sending interval option, a GPS track message sending interval option, an RUT monitoring starting/suspending option and a decryption instruction sending/suspending option;
and the custom message sending express is used for sending the custom message according to the custom message sending configuration determined by the user in the custom message configuration window.
All or part of each module in the data testing device of the PGNs transceiving system may be implemented by software, hardware, or a combination thereof. The modules can be embedded in a hardware form or independent of computer equipment in the server, or can be stored in a memory in the server in a software form, so that the computer equipment can call and execute operations corresponding to the modules. The computer device may be a Central Processing Unit (CPU), a microcomputer device, a single chip microcomputer, or the like. The working principle and the function of each functional module can be referred to the implementation process of the data testing method shown in fig. 1 to 14, which is not described herein again.
The present invention also provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of:
providing a data receiving and transmitting configuration window and a data display window on a user interaction interface of a PGNs receiving and transmitting system;
the data receiving and sending configuration window is used for providing data input for a user and configuring an interface of data sending and requesting elements, the data display window is used for displaying a result returned by a data receiving party, as shown in fig. 2, the data receiving and sending configuration window is positioned on the left side, the data display window is positioned on the right side and can be realized through a computer software program, and the data receiving and sending configuration window at least comprises a data sending configuration area and a request configuration sending area.
Receiving data input by a user in a data sending configuration area and sending configuration operation carried out on the data;
in this step, the user may input data in the data transmission configuration area, the input data may be multiple pieces, so as to correspond to multiple data testing processes, the data input may be by invoking a relevant file through a program and reading the data from the file, or the user may edit the data in real time and take effect in real time after editing. This data is typically in the relevant instruction language, such as in a marine application device, which may be to send DSC calls, adjust the brightness of the device on the bus, etc. as requested. After the data is input, the transmission of the data needs to be configured accordingly to simulate the actual application of the transmitting device.
Receiving data request configuration operation performed by a user in a request configuration sending area;
in the step, in order to obtain the result returned by the receiving party, a data request configuration input interface is arranged in the request configuration sending area, and a user performs a data request configuration operation in the request configuration sending area, wherein the process of the request configuration operation comprises the input of custom data and the determination of selectable items. Specifically, the content of the reply of the request can be configured for each piece of sent data, and an independent multithread processing process is realized.
Starting a data test according to data input by a user, set sending configuration and data request configuration;
in the step, after a user inputs specific data and sets sending configuration and data request configuration, a data testing thread can be started, namely, a sender sends data to a receiver according to a specific format requirement and appoints a result return form, so that a data interaction process between the sender and the receiver is realized, and the purpose of software testing is achieved.
And displaying the test result returned by the data test in the data display window.
In the step, the data display window is mainly used for receiving the test result returned by the data test, the embodiment form is text data, and the collection display can be performed according to the number of data processing threads started by a user. Particularly, a data analysis function is provided, and a test result is converted into a plaintext form which can be directly read by a user, so that the user can use the test result conveniently.
By the data testing method based on the user interaction graphical interface, a plurality of independent data processing threads can be provided, the data testing efficiency can be greatly improved, and the problems that the hexadecimal readability of PGNs source code data is poor, the manual analysis of multi-packet data is laborious, the packet packing is time-consuming and the error is easy to make when the request is replied are solved.
When being executed by the processor, the computer program further implements other steps of the data testing method, which can be specifically referred to the descriptions of the embodiments corresponding to fig. 4, 5, 6, and 13, and will not be described herein again.
In one embodiment, the present invention further provides a computer device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, the processor implements the steps of the data testing method provided in the above embodiments.
In particular, the computer device may be a personal computer or a server. The computer device includes a processor, a memory, and a network interface connected by a system bus. The processor is used for providing calculation and control capacity and supporting the operation of the whole computer equipment. The memory includes a nonvolatile storage medium and an internal memory. The non-volatile storage medium has stored therein an operating system and a computer program which, when executed by a processor, implements a data testing method. The internal memory provides an environment for the operating system and the computer program to run in the non-volatile storage medium. The network interface is used for communicating with an external server or terminal through network connection.
The above is only a part or preferred embodiment of the present invention, and neither the text nor the drawings should limit the scope of the present invention, and all equivalent structural changes made by the present specification and the contents of the drawings or the related technical fields directly/indirectly using the present specification and the drawings are included in the scope of the present invention.