Disclosure of Invention
Aiming at the technical problems in the prior art, the invention provides a message tracking display method, a message tracking display system, message tracking display equipment and a storage medium of a distributed control system, and aims to solve the technical problems that the existing process for acquiring communication fault information of an upper computer is complicated, the efficiency is low, the accuracy is poor, and the existing fault information tracking software can only display whether message interaction exists between software applications and cannot display specific message interaction contents.
In order to achieve the purpose, the invention adopts the technical scheme that:
the invention provides a message tracking and displaying method of a distributed control system, which comprises the following steps:
setting a keyword of a message to be tracked;
according to the keywords of the message to be tracked, performing keyword matching from the receiving and sending messages of all software applications of the upper computer and the network card of the upper computer to obtain a matching message, and storing the obtained matching message as a local file with a preset format;
analyzing the local file with the preset format through a preset protocol to obtain analyzed information; and displaying the original code stream of the matched message and the analyzed message, namely completing the tracking display of the distributed control system message.
Furthermore, the keywords of the message to be tracked do not contain wildcards.
Further, the local file with the preset format is a pcap file or a preset private format file; the format of the preset private format file is as follows: message sequence number + data packet header + data message content.
Furthermore, a wireshark tool is adopted to analyze the matching message stored in the pcap file, so as to obtain the analyzed message.
Further, a preset message template is adopted to analyze a preset private format file to obtain an analyzed message; the preset message template comprises a message header and a message content template; the message header comprises a sender, a sending node, a receiver, a receiving node, a message content length and sending time.
Further, the analyzed message comprises a message header and message content; and encrypting a sensitive field in the message content, wherein the sensitive field comprises a user name or a password.
Further, according to the keywords of the message to be tracked, matching the keywords from the message receiving and sending of all software applications of the upper computer and the network card of the upper computer to obtain a matched message, which specifically comprises the following steps:
sending keywords of a message to be tracked to a background communication bus program of an upper computer to trigger the background communication bus program of the upper computer, and performing keyword matching in a message receiving and sending queue of all software applications of the upper computer to obtain a matching message;
if the matching message is not obtained or the obtained matching message is not qualified in the message receiving and sending queues of all software applications of the upper computer, sending the keyword of the message to be tracked to tcpdump software of the upper computer to trigger the tcpdump software of the upper computer, and performing keyword matching at a network card of the upper computer to obtain the matching message.
The invention also provides a message tracking and displaying system of the decentralized control system, which comprises a keyword module, a matching module and an analysis module;
the keyword module is used for setting keywords of the message to be tracked;
the matching module is used for matching keywords from the receiving and sending messages of all software applications of the upper computer and the network card of the upper computer according to the keywords of the message to be tracked to obtain a matching message, and storing the obtained matching message as a local file with a preset format;
the analysis module is used for analyzing the local file with the preset format through a preset protocol to obtain analyzed information; and displaying the original code stream of the matched message and the analyzed message, namely completing the tracking display of the distributed control system message.
The invention also provides a message tracking display device of the decentralized control system, which comprises a memory, a processor and a computer program which is stored in the memory and can run on the processor, wherein the processor realizes the steps of the message tracking display method of the decentralized control system when executing the computer program.
The invention also provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to realize the steps of the message tracking display method of the decentralized control system.
Compared with the prior art, the invention has the beneficial effects that:
the invention provides a message tracking and displaying method of a distributed control system, which comprises the steps of matching keywords in the receiving and sending messages of all software applications of an upper computer and a network card of the upper computer by using the keywords of a message to be tracked to obtain a matched message; by analyzing the matched messages, the message tracking and display of the upper computer software applications are realized, the specific information of message interaction between the upper computer software applications or between the upper computer software applications and other systems can be clearly and quickly checked, and the fault problem existing in the communication process can be quickly defined; compared with the traditional mode of analyzing the code stream by capturing the packet by the log, the problem delimiting capability and the problem positioning speed can be greatly improved.
Further, keyword matching is carried out on a message receiving and sending queue of the upper computer software application in a background communication bus program of the upper computer, matching messages are obtained, and message tracking in an application layer is realized; through tcpdump software of the upper computer, keyword matching is carried out at a network card of the upper computer, message tracking at a link layer is realized, and when the condition that a message received by an application layer is inconsistent with a message sent by an opposite terminal or the condition that the application layer does not receive the message sent by the opposite terminal and the like occurs, the message is grabbed at the link layer to check whether the message is modified or discarded by application.
Detailed Description
In order to make the technical problems, technical solutions and advantageous effects of the present invention more apparent, the following embodiments further describe the present invention in detail. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
As shown in fig. 1, the present invention provides a message tracking display method for a decentralized control system, which comprises the following steps;
step 1, setting keywords of a message to be tracked. The keywords of the message to be tracked do not contain wildcards, so that the efficiency and the accuracy of keyword matching at a background bus program and a network card of the upper computer are effectively improved, and the influence of excessive messages on the performance and the network of the upper computer is avoided.
And 2, matching keywords from the receiving and sending messages of all software applications of the upper computer and the network card of the upper computer according to the keywords of the message to be tracked to obtain a matching message, and storing the obtained matching message as a local file with a preset format. The local file with the preset format is a pcap file or a preset private-format file, and the format of the preset private-format file is a message sequence number, a data packet header and data message content.
The process of obtaining the matching message by matching the keywords specifically comprises the following steps:
and sending the keywords of the message to be tracked to a background communication bus program of the upper computer to trigger the background communication bus program of the upper computer, and performing keyword matching in a message receiving and sending queue of all software applications of the upper computer to obtain a matching message.
And if the matching message is not acquired or the acquired matching message is not qualified in the message receiving and transmitting queues of all software applications of the upper computer, sending the keyword of the message to be tracked to tcpdump software of the upper computer to trigger the tcpdump software of the upper computer, and performing keyword matching at a network card of the upper computer to obtain the matching message.
And 3, analyzing the matched message, and displaying the analyzed message and the original code stream.
Analyzing the local file with the preset format through a preset protocol to obtain analyzed information; the analyzed message comprises a message header and message content; wherein, sensitive fields in the message content are encrypted; preferably, the sensitive field comprises a user name or password; and displaying the original code stream of the matched message and the analyzed message by using the upper computer, namely finishing the tracking display of the message of the distributed control system.
Analyzing the matching message stored in the pcap file by adopting a wireshark tool; or a preset message template is adopted to analyze a preset private format file to obtain an analyzed message; the preset message template comprises a message header and a message content template; the message header comprises a sender, a sending node, a receiver, a receiving node, a message content length and sending time.
The method comprises the steps of performing keyword matching from the receiving and sending messages of all software applications of the upper computer and the network card of the upper computer by using keywords of the message to be tracked to obtain matching messages; by analyzing the matched messages, the message tracking and display of the upper computer software applications are realized, the specific information of message interaction between the upper computer software applications or between the upper computer software applications and other systems can be clearly and quickly checked, and the fault problem existing in the communication process can be quickly defined; compared with the traditional mode of analyzing the code stream by capturing the packet by the log, the problem delimiting capability and the problem positioning speed can be greatly improved.
As shown in fig. 2, the invention also provides a message tracking and displaying system of the decentralized control system, which comprises a keyword module, a matching module and an analysis module.
And the keyword module is used for setting keywords of the message to be tracked.
And the matching module is used for matching keywords from the receiving and sending messages of all software applications of the upper computer and the network card of the upper computer according to the keywords of the message to be tracked to obtain a matching message, and storing the obtained matching message as a local file with a preset format.
The analysis module is used for analyzing the local file with the preset format through a preset protocol to obtain analyzed information; and displaying the original code stream of the matched message and the analyzed message, namely completing the tracking display of the distributed control system message.
As shown in fig. 3, the present invention further provides a message tracing display device for a decentralized control system, which includes a memory, a processor and a computer program stored in the memory and operable on the processor, wherein the processor implements the steps of the message tracing display method for the decentralized control system when executing the computer program; the communication interface shown in fig. 3 is used to access an external device to obtain data.
When the processor executes the computer program, the steps of the above method for tracking and displaying messages of the distributed control system are implemented, for example: setting a keyword of a message to be tracked; according to the keywords of the message to be tracked, performing keyword matching from the receiving and sending messages of all software applications of the upper computer and the network card of the upper computer to obtain a matching message, and storing the obtained matching message as a local file with a preset format; analyzing the local file with the preset format through a preset protocol to obtain analyzed information; and displaying the original code stream of the matched message and the analyzed message, namely completing the tracking display of the distributed control system message.
Alternatively, the processor implements the functions of the modules in the system when executing the computer program, for example: the keyword module is used for setting keywords of the message to be tracked; the matching module is used for matching keywords from the receiving and sending messages of all software applications of the upper computer and the network card of the upper computer according to the keywords of the message to be tracked to obtain a matching message, and storing the obtained matching message as a local file with a preset format; the analysis module is used for analyzing the local file with the preset format through a preset protocol to obtain analyzed information; and displaying the original code stream of the matched message and the analyzed message, namely completing the tracking display of the distributed control system message.
Illustratively, the computer program may be partitioned into one or more modules/units that are stored in the memory and executed by the processor to implement the invention. The one or more modules/units may be a series of computer program instruction segments capable of performing preset functions, the instruction segments describing the execution process of the computer program in the decentralized control system message tracking presentation device. For example, the computer program may be divided into a keyword module, a matching module, and an analysis module, and each module has the following specific functions: the keyword module is used for setting keywords of the message to be tracked; the matching module is used for matching keywords from the receiving and sending messages of all software applications of the upper computer and the network card of the upper computer according to the keywords of the message to be tracked to obtain a matching message, and storing the obtained matching message as a local file with a preset format; the analysis module is used for analyzing the local file with the preset format through a preset protocol to obtain analyzed information; and displaying the original code stream of the matched message and the analyzed message, namely completing the tracking display of the distributed control system message.
The information tracking and displaying device of the distributed control system can be a desktop computer, a notebook computer, a palm computer, a cloud server and other computing devices. The decentralized control system message tracking presentation device may include, but is not limited to, a processor, a memory. Those skilled in the art will appreciate that the schematic diagram of fig. 3 is merely an example of a decentralized control system message tracking and display device, and does not constitute a limitation of a decentralized control system message tracking and display device, and may include more components than those shown, or some components in combination, or different components, for example, the decentralized control system message tracking and display device may further include an input output device, a network access device, a bus, etc.
The processor may be a Central Processing Unit (CPU), other general purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components, etc. The general purpose processor may be a microprocessor or the processor may be any conventional processor or the like, the processor being the control center of the decentralized control system message tracking and display device, various interfaces and lines connecting the various parts of the overall decentralized control system message tracking and display device.
The memory may be used to store the computer programs and/or modules, and the processor may implement the various functions of the decentralized control system message tracking and presentation device by running or executing the computer programs and/or modules stored in the memory and invoking the data stored in the memory.
The memory may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the cellular phone, and the like. In addition, the memory may include high speed random access memory, and may also include non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) card, a flash memory card (FlashCard), at least one disk storage device, a flash memory device, or other volatile solid state storage device.
The invention also provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to realize the steps of the message tracking display method of the decentralized control system.
The decentralized control system message tracking presentation system integrated modules/units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium.
Based on such understanding, all or part of the processes in the above message tracing and displaying method for the decentralized control system can be implemented by a computer program, which can be stored in a computer readable storage medium, and the steps of the message tracing and displaying method for the decentralized control system can be implemented when the computer program is executed by a processor. Wherein the computer program comprises computer program code, which may be in source code form, object code form, executable file or preset intermediate form, etc.
The computer-readable storage medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer memory, Read-only memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, etc.
It should be noted that the computer readable storage medium may contain content that is subject to appropriate increase or decrease as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable storage media that does not include electrical carrier signals and telecommunications signals in accordance with legislation and patent practice.
Examples
The method for tracking and displaying the messages of the software application on the upper computer of the decentralized control system of the power plant comprises the following steps:
step 1, setting keywords of a message to be tracked; wherein, the keywords of the message to be tracked do not contain wildcards; the keywords of the message to be tracked include keyword information and communication protocol information.
Step 2, sending keywords of the message to be tracked to a background communication bus program of the upper computer, and performing keyword matching on the bus program in a message receiving and sending queue of all software applications of the upper computer to obtain a matched message; and realizing the message tracking of the application layer of the upper computer.
When the application layer of the upper computer does not acquire the matching message or the acquired matching message, the message sent by the opposite software application end is inconsistent or the application layer does not receive the message sent by the opposite software application end, the link layer of the upper computer is adopted for carrying out message matching for checking whether the communication information is modified or discarded by the application; the method specifically comprises the following steps:
and sending the keywords of the message to be tracked to tcpdump software of the upper computer to trigger the tcpdump software of the upper computer, and performing keyword matching at a network card of the upper computer to obtain a matching message.
Step 3, analyzing the local file with the preset format through a preset protocol to obtain analyzed information; the analyzed message comprises a message header and message content; wherein, sensitive fields in the message content are encrypted; preferably, the sensitive field includes a username or password, for example, the user name: jiang 'is' user name: j × g "; and displaying the original code stream of the matched message and the analyzed message by using the upper computer, namely finishing the tracking display of the message of the distributed control system.
Analyzing the matching message stored in the pcap file by adopting a wireshark tool; or a preset message template is adopted to analyze a preset private format file to obtain an analyzed message; the preset message template comprises a message header and a message content template; the message header comprises a sender, a sending node, a receiver, a receiving node, a message content length and sending time.
In this embodiment, when the application layer of the upper computer performs message tracking, the message to be tracked includes information such as a protocol, an application, an IP, a PORT, a keyword, and the like; when the upper computer carries out message tracking on the link layer, the message to be tracked comprises information such as a network card, a protocol and an IP.
According to the information tracking and displaying method of the distributed control system, keyword matching is carried out from the receiving and sending messages of all software applications of the upper computer by using the keywords of the messages to be tracked, the communication information of the software applications of the upper computer of the received preset protocol or IP can be tracked and displayed on the appointed application layer, or the communication information of the software applications of the upper computer of the received preset protocol or IP can be tracked and displayed on the appointed link layer, so that the tracking and grabbing of the communication information of the software applications of the upper computer can be realized, and the displaying can be realized; the method does not need to adopt a log packet capturing and analyzing mode, realizes the tracking and displaying of the communication fault information applied by the upper computer software, and has the advantages of simple acquisition process, higher acquisition efficiency and better accuracy.
For a description of a relevant part in the system, the device and the storage medium for tracking and displaying a distributed control system message provided in this embodiment, reference may be made to a detailed description of a corresponding part in the method for tracking and displaying a distributed control system message described in this embodiment, which is not described herein again.
The above-described embodiment is only one of the embodiments that can implement the technical solution of the present invention, and the scope of the present invention is not limited by the embodiment, but includes any variations, substitutions and other embodiments that can be easily conceived by those skilled in the art within the technical scope of the present invention disclosed.