CN107809345B - Gateway data checking tool, method and device for checking gateway data - Google Patents

Gateway data checking tool, method and device for checking gateway data Download PDF

Info

Publication number
CN107809345B
CN107809345B CN201710786597.0A CN201710786597A CN107809345B CN 107809345 B CN107809345 B CN 107809345B CN 201710786597 A CN201710786597 A CN 201710786597A CN 107809345 B CN107809345 B CN 107809345B
Authority
CN
China
Prior art keywords
data
communication protocol
gateway
relation
frames
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
CN201710786597.0A
Other languages
Chinese (zh)
Other versions
CN107809345A (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.)
Gree Electric Appliances Inc of Zhuhai
Original Assignee
Gree Electric Appliances Inc of Zhuhai
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 Gree Electric Appliances Inc of Zhuhai filed Critical Gree Electric Appliances Inc of Zhuhai
Priority to CN201710786597.0A priority Critical patent/CN107809345B/en
Publication of CN107809345A publication Critical patent/CN107809345A/en
Application granted granted Critical
Publication of CN107809345B publication Critical patent/CN107809345B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing packet switching networks
    • H04L43/08Monitoring based on specific metrics
    • H04L43/0823Errors
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/0078Avoidance of errors by organising the transmitted data in a format specifically designed to deal with errors, e.g. location
    • H04L1/0083Formatting with frames or packets; Protocol or part of protocol for error control
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/66Arrangements for connecting between networks having differing types of switching systems, e.g. gateways

Abstract

The invention discloses a gateway data checking tool, a method and a device for checking gateway data. The method comprises the following steps: acquiring input data and output data of a gateway, wherein the input data and the output data respectively comprise at least one data frame; judging whether the input data and the output data meet a preset mapping relation or not, wherein the mapping relation represents the relation between data frames with the same meaning under a first communication protocol and a second communication protocol, the first communication protocol is a communication protocol before gateway conversion, and the second communication protocol is a communication protocol after gateway conversion; and if the output data and the input data do not meet the mapping relationship, determining that the output data is correct, and if the output data and the input data do not meet the mapping relationship, determining that the output data is wrong. The invention solves the problems of low working efficiency and easy error when the gateway data is checked.

Description

Gateway data checking tool, method and device for checking gateway data
Technical Field
The present invention relates to the field of gateway technologies, and in particular, to a gateway data checking tool, a method for checking gateway data, and an apparatus for checking gateway data.
Background
Data of two different communication media need to be transmitted, and a gateway needs to be added in the middle for conversion. The gateway is also called an internetwork connector and a protocol converter. The gateway realizes network interconnection above a network layer, is the most complex network interconnection equipment and is used for interconnection of two networks with different high-level protocols. The gateway can be used for interconnection of both wide area networks and local area networks. The gateway is a translator used between two systems that differ in communication protocol, data format or language, or even in an entirely different architecture. Instead of the bridge simply communicating the information, the gateway repackages the received information to accommodate the needs of the destination system.
For the development of the gateway, protocol conversion is more important, and for example, when a 485 communication device and a CAN bus communication device are interconnected, protocol conversion is required. The most important thing in the field application of the gateway is to ensure the correctness of data before and after protocol conversion, in the prior art, the data before and after conversion is usually compared manually, and when the data volume is large, the corresponding data under two protocols are compared one by one, so that the probability of human error is high, and the working efficiency is low.
Aiming at the problems of low working efficiency and easy error when the data before and after the protocol conversion is carried out on the gateway is compared in the related technology, no effective solution is provided at present.
Disclosure of Invention
The invention provides a gateway data checking tool, a method and a device for checking gateway data, which are used for at least solving the problems in the prior art.
To solve the above technical problem, according to an aspect of an embodiment of the present invention, a method for checking gateway data is provided.
The method for checking the gateway data comprises the following steps: acquiring input data and output data of a gateway, wherein the input data and the output data respectively comprise at least one data frame; judging whether the input data and the output data meet a preset mapping relation or not, wherein the mapping relation represents the relation between data frames with the same meaning under a first communication protocol and a second communication protocol, the first communication protocol is a communication protocol before gateway conversion, and the second communication protocol is a communication protocol after gateway conversion; and if the output data and the input data do not meet the mapping relationship, determining that the output data is correct, and if the output data and the input data do not meet the mapping relationship, determining that the output data is wrong.
Further, before the step of collecting input data and output data of the gateway, the method further comprises: responding to a first configuration operation, configuring data frames which need to be acquired by an input data acquisition port and an output data acquisition port, wherein the data frames which need to be acquired by the input data acquisition port meet the first communication protocol, and the data frames which need to be acquired by the output data acquisition port meet the second communication protocol; the steps of collecting the input data and the output data of the gateway specifically comprise: the input data is collected through the input data collection port, and the output data is collected through the output data collection port.
Further, before the step of collecting input data and output data of the gateway, the method further comprises: and responding to the second configuration operation, and configuring the mapping relation.
Further, the mapping relationship includes: the data frame position corresponding relation, the data value size corresponding relation and the data precision corresponding relation under the first communication protocol and the second communication protocol are the same.
Further, the position corresponding relationship is a position corresponding relationship of data frames with the same meaning in the first communication protocol and the second communication protocol after the data frames in the first communication protocol are arranged according to a first sequence and the data frames in the second communication protocol are arranged according to a second sequence.
Further, the step of determining whether the input data and the output data satisfy a preset mapping relationship includes: arranging the data frames of the input data according to the first sequence, and arranging the data frames of the output data according to the second sequence; searching a pair of data frames which meet the position corresponding relation in the input data and the output data; and judging whether a pair of data frames meeting the position corresponding relation meets the data value size corresponding relation and the data precision corresponding relation.
Further, after the steps of arranging the data frames of the input data in the first order and arranging the data frames of the output data in the second order, the method further includes: and displaying the data frames of the input data arranged according to the first sequence in a first table, and displaying the data frames of the output data arranged according to the second sequence in a second table.
Further, the method further comprises: after determining that the output data is erroneous, the erroneous data frame is indicated in the second table.
Further, the method further comprises: after the output data is determined to be erroneous, data frames satisfying the position correspondence with the erroneous data frames are indicated in the first table.
To solve the above technical problem, according to another aspect of the embodiments of the present invention, an apparatus for checking gateway data is provided.
The device for checking the gateway data comprises: the gateway comprises an acquisition module, a data processing module and a data processing module, wherein the acquisition module is used for acquiring input data and output data of the gateway, and the input data and the output data respectively comprise at least one data frame; the judging module is used for judging whether the input data and the output data meet a preset mapping relation or not, wherein the mapping relation represents the relation between data frames with the same meaning under a first communication protocol and a second communication protocol, the first communication protocol is a communication protocol before gateway conversion, and the second communication protocol is a communication protocol after gateway conversion; and the determining module is used for determining that the output data is correct when the output data and the input data meet the mapping relation, and determining that the output data is wrong when the output data and the input data do not meet the mapping relation.
Further, the mapping relationship includes: the data frame position corresponding relation, the data value size corresponding relation and the data precision corresponding relation under the first communication protocol and the second communication protocol are the same.
Further, the position corresponding relationship is a position corresponding relationship of data frames with the same meaning in the first communication protocol and the second communication protocol after the data frames in the first communication protocol are arranged according to a first sequence and the data frames in the second communication protocol are arranged according to a second sequence.
Further, the judging module comprises: an arranging unit configured to arrange the data frames of the input data in the first order and arrange the data frames of the output data in the second order; the searching unit is used for searching a pair of data frames which meet the position corresponding relation in the input data and the output data; and the judging unit is used for judging whether a pair of data frames meeting the position corresponding relation meets the data value size corresponding relation and the data precision corresponding relation.
To solve the above technical problem, according to another aspect of the embodiments of the present invention, a gateway data checking tool is provided.
The gateway data verification tool comprises: a data acquisition port; a human-computer interaction unit; and the controller is respectively connected with the data acquisition port and the human-computer interaction unit, wherein the controller comprises any device for checking gateway data provided by the invention.
In the invention, the input data before gateway conversion and the output data obtained after gateway conversion are collected, and whether the output data is correct is judged by using the mapping relation determined according to the communication protocols before and after gateway conversion, so that whether a software program part for protocol conversion in the gateway is correct can be judged, manual data check is not needed, errors generated by manual protocol comparison are effectively reduced, and the working efficiency is greatly improved.
Drawings
Fig. 1 is a flowchart illustrating steps of a method for checking gateway data according to embodiment 1 of the present invention;
fig. 2 is a flowchart illustrating steps of a method for checking gateway data according to embodiment 2 of the present invention;
fig. 3 is a flowchart illustrating steps of a method for checking gateway data according to embodiment 3 of the present invention;
fig. 4 is a schematic block diagram of an apparatus for checking gateway data according to embodiment 4 of the present invention;
fig. 5 is a schematic block diagram of a gateway data checking tool according to embodiment 5 of the present invention;
fig. 6 is a flowchart of the operation of the gateway data checking tool according to embodiment 5 of the present invention.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the invention, as detailed in the appended claims.
The invention relates to a gateway data checking tool, a method and a device for checking gateway data, and aims to realize automatic checking of correctness of data converted by a gateway after a communication protocol is converted, specifically, according to the communication protocol before the gateway is converted and the communication protocol after the gateway is converted, a mapping relation between data frames with the same meaning under two communication protocols is confirmed, in the process of data conversion by the gateway, input data (namely data under the communication protocol before the gateway is converted) and output data (namely data under the communication protocol after the gateway is converted) of the gateway are collected, and the correctness of the output data is judged through the input data and the confirmed mapping relation, so that the correctness of a software program part for protocol conversion in the gateway can be judged, and the data checking is not required manually.
Embodiments of a method and an apparatus for checking gateway data and a gateway data checking tool are respectively described in detail below.
Example 1
Embodiment 1 of the present invention provides a method for checking gateway data, and fig. 1 is a flowchart illustrating steps of the method for checking gateway data according to embodiment 1 of the present invention, as shown in fig. 1, the method includes the following steps S101 to S104.
Step S101: the input data and the output data of the gateway are collected.
When data acquisition is carried out, the acquisition port is simultaneously accessed to the bus before and after gateway conversion, and then the acquisition port is controlled to carry out data acquisition. For the acquisition port, port frame format solidification can be carried out aiming at a specific gateway, the frame format of an input data acquisition port is solidified into a data frame which needs to be acquired on a bus of a communication protocol before the conversion of the specific gateway, and the frame format of an output data acquisition port is solidified into a data frame which needs to be acquired on the bus of the communication protocol after the conversion of the specific gateway, so that the acquisition port can be directly accessed into the bus without port configuration when data acquisition is carried out each time. Or before each acquisition, configuring the frame format of the acquisition port for the gateway to be checked, so as to configure the frame format of the input data acquisition port as a data frame to be acquired on the bus of the communication protocol before the conversion of the gateway to be checked, and configure the frame format of the output data acquisition port as a data frame to be acquired on the bus of the communication protocol after the conversion of the gateway to be checked.
The collected input data and output data respectively comprise at least one data frame, and each data frame is used as a data unit. For example, the physical interface of the input end before gateway conversion is a 485 communication interface, and the protocol uses a Modbus protocol, so that 03 function codes of 01-05 equipment addresses can be configured, and the number of effective data is a reply frame of 0x 44; and if the output end physical interface after the conversion of the gateway is a CAN communication interface, configuring data frames to be acquired according to a CAN protocol, such as acquiring only by using data frames with ID numbers of 0x18, 0x03, 0x01 and 0x 05.
Step S102: and judging whether the input data and the output data meet a preset mapping relation.
The mapping relation represents the relation between data frames with the same meaning under a first communication protocol and a second communication protocol, wherein the first communication protocol is a communication protocol before gateway conversion, and the second communication protocol is a communication protocol after gateway conversion.
The mapping relationship includes a position corresponding relationship between data frames with the same meaning under the first communication protocol and the second communication protocol, for example, the data frames under the first communication protocol and the data frames under the second communication protocol are respectively arranged according to the same or different predetermined sequences, and after the arrangement, the serial numbers of the data frames with the same meaning under the first communication protocol and the second communication protocol can be used as the position corresponding relationship between the data frames with the same meaning, specifically, for a certain data frame with the same meaning under the first communication protocol and the second communication protocol, the serial number in the data frame under the first communication protocol is a, the serial number in the data frame under the second communication protocol is b, and a-b is the position corresponding relationship between the data frames with the same meaning under the first communication protocol and the second communication protocol; for another example, after the data frames under the first communication protocol and the data frames under the second communication protocol are arranged according to the same or different predetermined sequence, the data frames are put into the table in sequence, the positions of the data frames with the same meaning under the first communication protocol and the second communication protocol in the table can be used as the position corresponding relationship between the data frames with the same meaning, specifically, for example, for a data frame with the same meaning under the first communication protocol and the second communication protocol, the position of the data frame under the first communication protocol in the two-dimensional table is (A1, B1), i.e. A1 th row, B1 th column, the position of the data frame under the second communication protocol in the two-dimensional table is (a2, B2), i.e., row a2, column B2, then (a1, B1) - (a2, B2) are the corresponding relationship of the positions of the frames of data with the same meaning under the first communication protocol and the second communication protocol. Or may be a location correspondence relationship of other rows, and in short, the location correspondence relationship may be used to correspond data frames with the same meaning in the first communication protocol and the second communication protocol.
The mapping relationship further includes a corresponding relationship between the data frame data values of the first communication protocol and the data frame data values of the second communication protocol, such as whether the data frame data values are equal, and the difference values. The mapping relationship also includes data precision correspondence, for example, data precision is increased or data precision is reduced, wherein the data precision refers to the number of data frames representing the same meaning.
The mapping relation is a preset relation according to the first communication protocol and the second communication protocol, and the input data and the output data meet the mapping relation, namely the process of converting the first communication protocol into the second communication protocol is correct. Specifically, when the determination is made, the mapping calculation may be performed on the input data according to the mapping relationship, and it is determined whether the calculated data is consistent with the output data, or the input data and the output data may be compared to obtain whether the relationship between the input data and the output data is consistent with the mapping relationship.
Step S103: and if the output data and the input data meet the mapping relation, determining that the output data is correct.
Step S104: and if the output data and the input data do not meet the mapping relation, determining that the output data is wrong.
By adopting the method for checking gateway data provided by the embodiment, the input data before gateway conversion and the output data obtained after gateway conversion are collected, whether the output data is correct is judged by using the mapping relation determined according to the communication protocols before and after gateway conversion, and whether the software program part for protocol conversion in the gateway is correct can be further judged, manual data checking is not needed, errors caused by manual protocol comparison are effectively reduced, and the working efficiency is greatly improved.
Example 2
Embodiment 2 of the present invention provides a preferred method for checking gateway data based on the above embodiment 1, and fig. 2 is a flowchart illustrating steps of the method for checking gateway data according to embodiment 2 of the present invention, and as shown in fig. 2, the method includes the following steps S201 to S206.
Step S201: and responding to the first configuration operation, configuring the data frames which need to be acquired by the input data acquisition port and the output data acquisition port.
The configuration operation of a user can be received through the touch control screen, and the frame formats of the input data acquisition port and the output data acquisition port are configured, so that the data frames required to be acquired by the input data acquisition port meet a first communication protocol, the data frames required to be acquired by the output data acquisition port meet a second communication protocol, the first communication protocol is a communication protocol before gateway conversion, and the second communication protocol is a communication protocol after gateway conversion.
Step S202: and responding to the second configuration operation to configure the mapping relation.
The configuration operation of the user can be received through the touch control screen, and the mapping relationship is configured, where the mapping relationship represents a relationship between data frames with the same meaning in the first communication protocol and the second communication protocol, which is specifically described in the foregoing embodiment 1, and details are not repeated here.
Step S203: the input data is collected through the input data collection port, and the output data is collected through the output data collection port.
Step S204: and judging whether the input data and the output data meet a preset mapping relation.
Step S205: and if the output data and the input data meet the mapping relation, determining that the output data is correct.
Step S206: and if the output data and the input data do not meet the mapping relation, determining that the output data is wrong.
By adopting the method for checking gateway data provided by the embodiment, on the basis of checking whether the gateway output data is correct or not, the gateway data checking tool adopting the method for checking network management data can be applicable to any gateway through the configuration of the input data port, the output data port and the mapping relation, and has strong universality.
Example 3
Embodiment 3 of the present invention provides a preferred method for checking gateway data based on the foregoing embodiment 1, and fig. 3 is a flowchart illustrating steps of the method for checking gateway data according to embodiment 3 of the present invention, as shown in fig. 3, the method includes the following steps S301 to S308.
Step S301: the input data and the output data of the gateway are collected.
For details of this step, reference may be made to the related contents of the above embodiments 1 and 2, and details are not repeated here.
Step S302: the data frames of the input data are arranged in a first order and the data frames of the output data are arranged in a second order.
The mapping relation comprises a position corresponding relation, wherein the position corresponding relation comprises that data frames under a first communication protocol are arranged according to a first sequence, the data frames under a second communication protocol are arranged according to a second sequence, then the data frames of input data and the data frames of output data are respectively filled in a preset first table and a preset second table, and the position corresponding relation between the data frames with the same meaning under the first communication protocol and the second communication protocol in the tables is obtained, wherein the first sequence and the second sequence can be the same or different, for example, the data frames are sequenced according to the sequence of the collected data frames, or the data frames are sequenced according to ID numbers of the data frames.
When judging whether the actually acquired output data subjected to protocol conversion by the gateway is correct, firstly, the acquired input data and the acquired output data are respectively sequenced according to a first sequence and a second sequence in sequence.
Step S303: the data frames of the input data arranged in the first order are displayed in a first table, and the data frames of the output data arranged in the second order are displayed in a second table.
After the input data and the output data are sorted, the sorted input data and output data are respectively displayed in the first table and the second table, for example, the first table is a table with N rows and M columns, when the specific display is performed, each data frame of the arranged input data is sequentially filled in the first table from the position of the first row and the first column, then the first row and the second column, the first table is sequentially filled from the position of the second row and the first column after the first row is filled, and finally all data frames of the input data are filled in the first table. The process of displaying each data frame of the arranged output data in the second table is the same.
By this step, the input data and the output data are finally displayed in the form of two tables.
Step S304: and searching each pair of data frames which satisfy the corresponding relation of positions in the input data and the output data.
After the table display is completed, each pair of data frames satisfying the position correspondence relationship in the two tables is found, for example, the position correspondence relationship includes "(a 1, B1) - (C1, D1)", a first data frame located at row a1, column B1 in the first table is found, a second data frame located at row C1, column D1 in the second table is found, and the first data frame and the second data frame are corresponding to each other to serve as a first pair of data frames. The position correspondence relationship comprises [ (A2, B2), (A3, B3) ] - (C2, D2) ] that a third data frame positioned at a line A2 and a column B2 in a first table, a fourth data frame positioned at a line A3 and a column B3 in a second table, a fifth data frame positioned at a line C2 and a column D2 in the second table are found, and the third data frame and the fourth data frame correspond to the fifth data frame as a second pair of data frames.
Step S305: and judging whether each pair of data frames meeting the position corresponding relation meets the data value size corresponding relation and the data precision corresponding relation.
For example, for the first pair of data frames, the corresponding relationship of the data value size is equal to two data frames, and the corresponding relationship of the data precision is accuracy indentation unchanged, then in this step, it is determined whether the first pair of data frames found in the step S305 are equal to each other, and if so, it is determined that the output data in the pair of data frames is correct, that is, the following step S306 is executed, otherwise, it is determined that the output data in the pair of data frames is incorrect, that is, the following step S307 is executed. If the output data in each pair of data frames are correct, the gateway is correct in the process of protocol conversion.
Step S306: and if a certain pair of data frames meets the corresponding data value size corresponding relation and data precision corresponding relation, determining that the output data in the pair of data frames is correct.
Step S307: and if a certain pair of data frames does not meet the corresponding data value size corresponding relation and data precision corresponding relation, determining that the output data in the pair of data frames is wrong.
Step S308: after the output data is determined to be erroneous, the erroneous data frame is indicated in the second table, and the data frame satisfying the positional correspondence with the erroneous data frame is indicated in the first table.
Through the step, the wrong data is marked, so that the user can conveniently and visually locate the wrong data frame, and further, the data frame of which the wrong data frame meets the position corresponding relation, namely the data frame in the input data, which has the same meaning as the wrong data frame in the output data, is marked, so that the user can conveniently find a data source and determine the reason of the error when data checking is carried out.
The above is an embodiment of the method for checking gateway data according to the embodiment of the present invention, and the present invention further provides an embodiment of a device for checking gateway data. The following describes an embodiment of the apparatus for checking gateway data provided by the present invention, and based on the same inventive concept as the method for checking gateway data provided by the present invention, when describing the apparatus for checking gateway data, it is relatively simple, and relevant parts may refer to the related description of some embodiments of the method for checking gateway data.
Example 4
Embodiment 4 of the present invention provides a device for checking gateway data, where the device may be set in acquisition hardware as a third party application program, so that the acquisition hardware can achieve the purpose of checking gateway data, for example, the third party application program is installed in a computer, and acquires data on a field bus in a USB to serial port manner. Alternatively, the device is fixed in a tool and becomes a special device for gateway data verification. Fig. 4 is a schematic block diagram of an apparatus for checking gateway data according to embodiment 4 of the present invention, and as shown in fig. 4, the apparatus includes an acquisition module 10, a determination module 20, and a determination module 30.
The acquisition module 10 is configured to acquire input data and output data of a gateway, where the input data and the output data each include at least one data frame.
The judging module 20 is configured to judge whether the input data and the output data satisfy a preset mapping relationship, where the mapping relationship represents a relationship between data frames with the same meaning under a first communication protocol and a second communication protocol, the first communication protocol is a communication protocol before gateway conversion, and the second communication protocol is a communication protocol after gateway conversion;
the determining module 30 is configured to determine that the output data is correct when the output data and the input data satisfy the mapping relationship, and determine that the output data is incorrect when the output data and the input data do not satisfy the mapping relationship.
By adopting the device for checking gateway data provided by the embodiment, the input data before gateway conversion and the output data obtained after gateway conversion are collected, whether the output data is correct is judged by using the mapping relation determined according to the communication protocols before and after gateway conversion, and whether the software program part for protocol conversion in the gateway is correct can be further judged, manual data checking is not needed, errors caused by manual protocol comparison are effectively reduced, and the working efficiency is greatly improved.
Preferably, the apparatus further comprises: the first configuration module is used for responding to a first configuration operation before the step of acquiring the input data and the output data of the gateway by the acquisition module, and configuring data frames which need to be acquired by the input data acquisition port and the output data acquisition port, wherein the data frames which need to be acquired by the input data acquisition port meet a first communication protocol, and the data frames which need to be acquired by the output data acquisition port meet a second communication protocol; when the acquisition module acquires input data and output data of the gateway, the acquisition module specifically acquires the input data through the input data acquisition port and acquires the output data through the output data acquisition port.
By adopting the preferred embodiment, the user can configure the input data acquisition port according to the communication protocol before the gateway conversion and configure the output data acquisition port according to the communication protocol after the gateway conversion, so that the device for checking the gateway data is suitable for different gateways, and the universality of the device is improved.
Preferably, the apparatus further comprises: and the second configuration module is used for responding to the second configuration operation and configuring the mapping relation before the step of acquiring the input data and the output data of the gateway by the acquisition module.
By adopting the preferred embodiment, the user can configure the mapping relation according to the attention point of the user and the communication protocol before gateway conversion and the communication protocol after conversion, on one hand, the user can configure the mapping relation of the device according to different gateway communication protocols, and the universality of the device is improved; on the other hand, when the gateway data is checked, the user can configure the mapping relation according to the data relation which needs to be paid attention to in the checking, and the flexibility of the device for checking the gateway data is improved.
Preferably, the mapping relationship includes: the data frame position corresponding relation, the data value size corresponding relation and the data precision corresponding relation under the first communication protocol and the second communication protocol are the same.
Preferably, the position correspondence relationship is a position correspondence relationship between data frames with the same meaning in the first communication protocol and data frames with the same meaning in the second communication protocol after the data frames in the first communication protocol are arranged according to the first sequence and the data frames in the second communication protocol are arranged according to the second sequence.
Preferably, the judging module includes: the arrangement unit is used for arranging the data frames of the input data according to a first sequence and arranging the data frames of the output data according to a second sequence; the searching unit is used for searching a pair of data frames which satisfy the corresponding relation of positions in the input data and the output data; and the judging unit is used for judging whether the pair of data frames meeting the position corresponding relation meets the data value size corresponding relation and the data precision corresponding relation.
Preferably, the apparatus further comprises: and the display module is used for displaying the data frames of the input data arranged according to the first sequence in the first table and displaying the data frames of the output data arranged according to the second sequence in the second table.
Preferably, the apparatus further comprises: and the marking module is used for marking the erroneous data frame in the second table after determining that the output data is erroneous.
Preferably, the marking module is further configured to mark, after determining that the output data is erroneous, a data frame satisfying a position correspondence with the erroneous data frame in the first table.
Example 5
Embodiment 5 of the present invention provides a gateway data checking tool, where a data acquisition port of the checking tool is connected to a communication bus of input data and a communication bus of output data of a gateway, respectively, so as to achieve a purpose of checking gateway data. Fig. 5 is a schematic block diagram of a gateway data checking tool according to embodiment 5 of the present invention, and fig. 6 is a flowchart of a working process of the gateway data checking tool according to embodiment 5 of the present invention, as shown in fig. 5, the gateway data checking tool includes a data acquisition port 01, a human-computer interaction unit 02, and a controller 03.
The data acquisition port 01 and the human-computer interaction unit 02 are respectively connected with the controller 03, wherein the controller 03 comprises any device for checking gateway data provided by the invention.
For the gateway data checking tool provided in this embodiment, the mapping relationship between the data acquisition port and the controller is configured according to the communication protocols before and after the gateway conversion, the gateway data checking tool is used to acquire and compare the data before and after the conversion of the gateway to be tested in real time, and finally the data on the corresponding protocol is displayed in the form of a protocol table and whether the data after the conversion is correct is indicated.
Specifically, as shown in fig. 6, the workflow of the gateway data auditing tool includes the following parts:
the first part is a configuration part of a protocol format, and according to a communication protocol before and after conversion, configuration is carried out on a configuration serial port of a gateway data checking tool, for example, a physical interface of an input end before conversion is a 485 communication interface, and a frame format is required to be configured for the tool if the protocol uses a Modbus protocol, and the frame format is a data frame which needs to be acquired on a 485 bus, for example, only 03 function codes of 01-05 equipment addresses are configured, and the number of effective data is a reply frame of 0x 44; after the conversion, the physical interface end is in CAN communication, and data frames required to be acquired need to be configured according to a CAN protocol, for example, data frames with ID numbers of 0x18, 0x03, 0x01 and 0x05 are only acquired.
After the allocation, the data frames collected by the tool on the data bus are valid data collected according to the allocation relation, and the valid data are cached.
The second part is data mapping configuration, and the mapping relationship comprises the relationship position corresponding relationship between data frames with the same meaning under the communication protocols before and after conversion, the data value size corresponding relationship representing the fixed value change of the data, the data precision corresponding relationship representing the precision indentation change of the data and the like. Specifically, a fixed-format EXCEL table may be set, where the table is the first table and the second table mentioned above, and the data of the communication protocols before and after conversion is stored in the table according to a predetermined sequence, and the corresponding relationship of the positions of the data frames in the table with the same meaning under the communication protocols before and after conversion is found.
The third part is a data acquisition display part, after the tool acquires data on a data bus, introducing EXCEL tables before and after conversion on the tool, displaying corresponding tables in windows before and after conversion after the tool identifies the tables, storing each data frame according to the tables according to the fixed format of the tables, wherein the data frames can be displayed in decimal or hexadecimal format and the like.
And the fourth part is data checking display, after the tool completes protocol format configuration and data mapping configuration, the tool is used for data acquisition, after the data is acquired, the data before and after conversion is displayed according to the introduction of the third part, then the inside of the tool compares the data according to the data mapping relationship configured by the second part, if the data is inconsistent with the mapping relationship, a mark can be made on the display according to the converted data, and meanwhile, the mark can indicate the mapping relationship with the original data, and a user is given the data source for checking.
By adopting the gateway data checking tool provided by the embodiment, the data before and after the gateway conversion is acquired by using the tool through configuring the protocol format and the data mapping relation before and after the conversion, the tool can check whether the converted data is abnormal according to the configuration, and the tool has strong universality.
The protocol format configuration before and after the conversion of the gateway, the mapping relation of the data and the comparison logic can be written into the controller in advance, the controller is accessed to the data bus before and after the conversion of the gateway to collect the data, then the data is displayed in a form mode through the display screen, and wrong data information is marked.
Or, the controller may design a general program, where the program has a function design of processing protocol format configuration, data mapping relationship and comparison logic, and configures the protocol format and the data mapping relationship before and after conversion on an interface of the touch screen through an external touch screen, that is, a human-computer interaction unit, and then similarly accesses the controller to a data bus before and after conversion of the gateway to be tested to acquire data, and the controller compares and checks the data, and finally displays the checking result through the touch screen.
Although some specific embodiments of the present invention have been described in detail by way of examples, it should be understood by those skilled in the art that the above examples are for illustrative purposes only and are not intended to limit the scope of the present invention. It will be appreciated by those skilled in the art that modifications may be made to the above embodiments without departing from the scope and spirit of the invention. The scope of the invention is defined by the appended claims.
Other embodiments of the invention will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the invention and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the invention being indicated by the following claims.
It will be understood that the invention is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the invention is limited only by the appended claims.

Claims (8)

1. A method for verifying gateway data, comprising:
acquiring input data and output data of a gateway, wherein the input data and the output data respectively comprise at least one data frame;
judging whether the input data and the output data meet a preset mapping relation or not, wherein the mapping relation represents the relation between data frames with the same meaning under a first communication protocol and a second communication protocol, the first communication protocol is a communication protocol before gateway conversion, and the second communication protocol is a communication protocol after gateway conversion;
if the output data and the input data meet the mapping relation, determining that the output data is correct, and if the output data and the input data do not meet the mapping relation, determining that the output data is wrong;
wherein the mapping relationship comprises: the method comprises the steps that the position corresponding relation, the data value size corresponding relation and the data precision corresponding relation of data frames with the same meaning under a first communication protocol and a second communication protocol are obtained;
the position corresponding relationship is the position corresponding relationship of the data frames with the same meaning under the first communication protocol and the second communication protocol after the data frames under the first communication protocol are arranged according to a first sequence and the data frames under the second communication protocol are arranged according to a second sequence;
the step of judging whether the input data and the output data meet a preset mapping relation comprises the following steps:
arranging the data frames of the input data according to the first sequence, and arranging the data frames of the output data according to the second sequence;
searching a pair of data frames which meet the position corresponding relation in the input data and the output data;
and judging whether a pair of data frames meeting the position corresponding relation meets the data value size corresponding relation and the data precision corresponding relation.
2. The method for auditing gateway data according to claim 1,
prior to the step of collecting input data and output data of the gateway, the method further comprises: responding to a first configuration operation, configuring data frames which need to be acquired by an input data acquisition port and an output data acquisition port, wherein the data frames which need to be acquired by the input data acquisition port meet the first communication protocol, and the data frames which need to be acquired by the output data acquisition port meet the second communication protocol;
the steps of collecting the input data and the output data of the gateway specifically comprise: the input data is collected through the input data collection port, and the output data is collected through the output data collection port.
3. The method of auditing gateway data according to claim 2, characterized in that prior to the step of collecting input data and output data of the gateway, the method further comprises:
and responding to the second configuration operation, and configuring the mapping relation.
4. The method of checking gateway data according to claim 1, wherein after the steps of arranging the data frames of the input data in the first order and arranging the data frames of the output data in the second order, the method further comprises:
and displaying the data frames of the input data arranged according to the first sequence in a first table, and displaying the data frames of the output data arranged according to the second sequence in a second table.
5. The method for auditing gateway data according to claim 4, the method further comprising:
after determining that the output data is erroneous, the erroneous data frame is indicated in the second table.
6. The method for auditing gateway data according to claim 5, the method further comprising:
after the output data is determined to be erroneous, data frames satisfying the position correspondence with the erroneous data frames are indicated in the first table.
7. An apparatus for auditing gateway data, comprising:
the gateway comprises an acquisition module, a data processing module and a data processing module, wherein the acquisition module is used for acquiring input data and output data of the gateway, and the input data and the output data respectively comprise at least one data frame;
the judging module is used for judging whether the input data and the output data meet a preset mapping relation or not, wherein the mapping relation represents the relation between data frames with the same meaning under a first communication protocol and a second communication protocol, the first communication protocol is a communication protocol before gateway conversion, and the second communication protocol is a communication protocol after gateway conversion;
a determining module, configured to determine that the output data is correct when the output data and the input data satisfy the mapping relationship, and determine that the output data is incorrect when the output data and the input data do not satisfy the mapping relationship;
wherein the mapping relationship comprises: the method comprises the steps that the position corresponding relation, the data value size corresponding relation and the data precision corresponding relation of data frames with the same meaning under a first communication protocol and a second communication protocol are obtained;
the position corresponding relationship is the position corresponding relationship of the data frames with the same meaning under the first communication protocol and the second communication protocol after the data frames under the first communication protocol are arranged according to a first sequence and the data frames under the second communication protocol are arranged according to a second sequence;
the judging module comprises:
an arranging unit configured to arrange the data frames of the input data in the first order and arrange the data frames of the output data in the second order;
the searching unit is used for searching a pair of data frames which meet the position corresponding relation in the input data and the output data;
and the judging unit is used for judging whether a pair of data frames meeting the position corresponding relation meets the data value size corresponding relation and the data precision corresponding relation.
8. A gateway data auditing tool, comprising:
a data acquisition port;
a human-computer interaction unit; and
a controller connected to the data acquisition port and the human-computer interaction unit, respectively, wherein the controller comprises the apparatus for checking gateway data as claimed in claim 7.
CN201710786597.0A 2017-09-04 2017-09-04 Gateway data checking tool, method and device for checking gateway data Active CN107809345B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710786597.0A CN107809345B (en) 2017-09-04 2017-09-04 Gateway data checking tool, method and device for checking gateway data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710786597.0A CN107809345B (en) 2017-09-04 2017-09-04 Gateway data checking tool, method and device for checking gateway data

Publications (2)

Publication Number Publication Date
CN107809345A CN107809345A (en) 2018-03-16
CN107809345B true CN107809345B (en) 2020-03-06

Family

ID=61569852

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710786597.0A Active CN107809345B (en) 2017-09-04 2017-09-04 Gateway data checking tool, method and device for checking gateway data

Country Status (1)

Country Link
CN (1) CN107809345B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112104522A (en) * 2020-09-10 2020-12-18 国家工业信息安全发展研究中心 Numerical control system data acquisition gateway test method and equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102650996A (en) * 2011-02-28 2012-08-29 国际商业机器公司 Method and device for determining data mapping relationship between database tables
CN103188094A (en) * 2011-12-28 2013-07-03 中国移动通信集团贵州有限公司 Resource data verification system and resource data verification method
CN104702585A (en) * 2014-02-28 2015-06-10 杭州海康威视系统技术有限公司 Protocol conversion method and protocol conversion gateway equipment
CN106301833A (en) * 2015-05-22 2017-01-04 上海研电电力科技有限公司 A kind of transformer station schedule information method of testing

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009205479A (en) * 2008-02-28 2009-09-10 Kddi Corp Calibration equipment, method, and program for image pickup device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102650996A (en) * 2011-02-28 2012-08-29 国际商业机器公司 Method and device for determining data mapping relationship between database tables
CN103188094A (en) * 2011-12-28 2013-07-03 中国移动通信集团贵州有限公司 Resource data verification system and resource data verification method
CN104702585A (en) * 2014-02-28 2015-06-10 杭州海康威视系统技术有限公司 Protocol conversion method and protocol conversion gateway equipment
CN106301833A (en) * 2015-05-22 2017-01-04 上海研电电力科技有限公司 A kind of transformer station schedule information method of testing

Also Published As

Publication number Publication date
CN107809345A (en) 2018-03-16

Similar Documents

Publication Publication Date Title
CN102478797B (en) Monitoring system with configurable communication protocol
CN107133323A (en) Data model construction method, the implementation method of government affairs service business and device
CN109933051A (en) A kind of automobile diagnostic software configuration method, system, equipment and computer media
CN103869801A (en) Test method of nuclear power plant instrumentation control logic function block and system
CN106330593B (en) Protocol detection method and device
CN107809345B (en) Gateway data checking tool, method and device for checking gateway data
CN108965052A (en) A kind of data reading system for the electronic control unit software debugging after entrucking
CN102707710A (en) Diagnosis function verification method and system for automobile electronic control unit
CN103514092A (en) Method for automatic testing of software system of ATM
CN104615928A (en) Metrological verification method and system and server
CN107944731A (en) The method for building up and device of typical project cost template
EP2942714B1 (en) Monitoring method, monitoring apparatus, and electronic device
CN109542385A (en) A kind of multiple data stream Display on the same screen method, system, device and readable storage medium storing program for executing
CN1312587C (en) An embedded real time operating system fault analysis positioning system and method
CN106851513A (en) The method of testing and system of a kind of electronic product
CN104361155B (en) Relay protection fault analysis method based on vector graphics and analytical equipment
CN105610530A (en) Satellite data acquisition and analysis method and system
CN103092752B (en) Error identification method of instrument attributes
CN107819621B (en) Gateway configuration method and device and gateway
CN102722592B (en) Universal digital information recording device and method
CN108255629B (en) Breakpoint data obtaining method and terminal equipment
KR101513056B1 (en) Requirement Traceability Management System and its Method
CN105183954A (en) PXI based serial bus health monitoring platform
CN106055351A (en) Development method and apparatus of control system
CN102043759A (en) Method for validating numerical calculation programs of mathematical model

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