CN118250119A - Industrial communication monitoring method and device, intelligent master station and computer storage medium - Google Patents

Industrial communication monitoring method and device, intelligent master station and computer storage medium Download PDF

Info

Publication number
CN118250119A
CN118250119A CN202410645070.6A CN202410645070A CN118250119A CN 118250119 A CN118250119 A CN 118250119A CN 202410645070 A CN202410645070 A CN 202410645070A CN 118250119 A CN118250119 A CN 118250119A
Authority
CN
China
Prior art keywords
station
slave station
instruction
intelligent master
slave
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202410645070.6A
Other languages
Chinese (zh)
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.)
Shenzhen Wellauto Technology Co ltd
Original Assignee
Shenzhen Wellauto Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Wellauto Technology Co ltd filed Critical Shenzhen Wellauto Technology Co ltd
Priority to CN202410645070.6A priority Critical patent/CN118250119A/en
Publication of CN118250119A publication Critical patent/CN118250119A/en
Pending legal-status Critical Current

Links

Landscapes

  • Small-Scale Networks (AREA)

Abstract

The present application relates to the field of data processing technologies, and in particular, to an industrial communication monitoring method and apparatus, an intelligent master station, and a computer storage medium. According to the application, communication connection is established between the intelligent master station and the plurality of slave stations, each slave station in the plurality of slave stations is further monitored according to the monitoring sequence, so that the monitoring of each slave station is realized in real time, the intelligent master station further sends a read-write instruction to the slave station to be monitored when a communication bus for connecting the intelligent master station and the slave stations is idle, the receiving condition of the intelligent master station for the data of the slave stations returned by the slave stations is judged in a preset time period, the data or error codes of the slave stations are visually displayed according to the receiving condition, and the communication efficiency and the system response speed are improved.

Description

Industrial communication monitoring method and device, intelligent master station and computer storage medium
Technical Field
The present application relates to the field of data processing technologies, and in particular, to an industrial communication monitoring method and apparatus, an intelligent master station, and a computer storage medium.
Background
At present, modern industrial manufacturing has entered an intelligent age, and processing and manufacturing equipment increasingly adopts an intelligent technology, so that the processing and manufacturing equipment can automatically operate, and the requirement for personnel monitoring at any time is reduced.
Conventional industrial communication monitoring methods typically communicate in a broadcast manner. In the broadcast mode, the master station transmits the same command to all the slaves and then waits for the response of the slaves. In the broadcast mode, all the secondary stations respond simultaneously, resulting in an increase in communication delay.
Disclosure of Invention
In view of the above, the present application provides an industrial communication monitoring method, an industrial communication monitoring device, an intelligent master station and a computer storage medium, which improve communication efficiency between the master station and a slave station.
A first aspect of the present application provides an industrial communication monitoring method, the method comprising:
the intelligent master station establishes communication connection with each slave station in the plurality of slave stations respectively;
The intelligent master station determines a first target slave station of the plurality of slave stations according to the monitoring sequence corresponding to the plurality of slave stations;
When the intelligent master station receives an operation instruction of a user aiming at the first target slave station and a communication bus between the intelligent master station and the plurality of slave stations is idle, the intelligent master station sends a read-write instruction to the first target slave station according to the operation instruction, so that the first target slave station returns corresponding slave station data in a preset communication frame format according to the read-write instruction;
Judging whether the intelligent master station receives the slave station data returned by the first target slave station in a first preset time period;
When the intelligent master station receives the slave station data in the first preset time period, the intelligent master station records the slave station data and visually displays the slave station data;
when the intelligent master station does not receive the slave station data in the first preset time period, the intelligent master station determines that the first target slave station is in error, and visually displays the error code of the first target slave station;
the intelligent master station repeatedly performs the above operations based on the monitoring sequence until the intelligent master station visually displays the slave station data or error codes of each of the plurality of slave stations.
In an alternative embodiment, the intelligent master station establishing a communication connection with each of a plurality of slave stations respectively includes:
The intelligent master station determines a second target slave station according to the slave station number of each slave station in the plurality of slave stations, wherein the second target slave station is the slave station with the slave station number at the first position in the plurality of slave stations;
The intelligent master station sequentially sends m first instructions to the second target station, wherein m is an integer greater than or equal to 1;
When the intelligent master station sequentially receives m second instructions corresponding to the m first instructions returned by the second target slave station, determining that the intelligent master station and the second target slave station establish communication connection;
And repeatedly executing the operation until the intelligent master station establishes communication connection with each slave station in the plurality of slave stations.
In an alternative embodiment, the smart master station sequentially sending m first instructions to the second target slave station includes:
the intelligent master station sends a first sub-instruction in the m first instructions to the second target station, wherein the first sub-instruction is the first sub-instruction in the m first instructions;
judging whether the intelligent master station receives an instruction corresponding to the first sub-instruction returned by the second target slave station in a second preset time period;
When the intelligent master station is determined to receive an instruction corresponding to the first sub-instruction returned by the second target slave station in the second preset time period, the intelligent master station acquires the slave station information of the second target slave station corresponding to the first sub-instruction and sends a second sub-instruction to the second target slave station, wherein the second sub-instruction is a sub-instruction with the instruction number adjacent to the first sub-instruction in the m first instructions;
Judging whether the intelligent master station receives an instruction corresponding to the second sub-instruction returned by the second target slave station in the second preset time period;
When the fact that the second target slave station receives the command corresponding to the second sub-command is received within the second preset time period is determined, the intelligent master station acquires the slave station information of the second target slave station corresponding to the second sub-command and sends a third sub-command to the second target slave station, wherein the third sub-command is a command with a command number adjacent to the second sub-command in the m first commands, and the command number of the third sub-command is located behind the command number of the second sub-command;
and repeatedly executing the operation until the intelligent master station sends the m first instructions to the second target slave station, and acquiring corresponding slave station information.
In an alternative embodiment, when it is determined that the second target slave station does not receive the instruction corresponding to the first sub-instruction within the second preset time period, the method further includes:
the intelligent master station determines the instruction sending times of sending the first sub-instruction to the second target station at the current moment;
The intelligent master station judges whether the instruction sending times meet a first preset times threshold value or not;
when the instruction sending frequency does not meet the first preset frequency threshold, the intelligent master station continues to send the first sub-instruction to the second target slave station until the instruction sending frequency meets the first preset frequency threshold;
When the instruction sending frequency meets the first preset frequency threshold, the intelligent master station sends the first instruction to a third target slave station, wherein the third target slave station is a slave station with a station number adjacent to the second target slave station in the plurality of slave stations, and the station number of the third target slave station is located behind the station number of the second target slave station.
In an alternative embodiment, the preset communication frame format includes: the intelligent master station comprises a start frame, a station number of the intelligent master station, a slave station number, an instruction type, a data length returned by the slave station, data returned by the slave station and a check code, wherein the start frame occupies 1 byte, the master station number occupies 1 byte, the slave station number occupies 1 byte, the instruction type occupies 2 bytes, the data length returned by the slave station occupies 1 byte, the data returned by the slave station occupies X bytes, and the check code occupies 2 bytes, wherein X is determined according to actual data returned by the slave station.
In an alternative embodiment, the intelligent master station recording the slave station data and visually displaying the slave station data includes:
the intelligent master station extracts a check code in the slave station data, and checks the slave station data according to the check code to determine whether the slave station data corresponds to the read-write instruction or not;
When the secondary station data is determined to correspond to the read-write instruction, the intelligent master station records the secondary station data and visually displays the secondary station data;
And when the data of the slave station is not corresponding to the read-write instruction, sending the read-write instruction to the first target slave station again according to the operation instruction until the times of sending the read-write instruction to the first target slave station reach a second preset times threshold.
In an alternative embodiment, the method further comprises:
determining the data of the secondary stations corresponding to each secondary station in the plurality of secondary stations, and generating a plurality of secondary station data tables according to the secondary station data, wherein one secondary station corresponds to one secondary station data table;
Generating a secondary station configuration book according to the secondary station data tables, and visually displaying the secondary station configuration book according to the secondary station numbers.
A second aspect of the present application provides an industrial communication monitoring device, the device comprising:
The communication connection module is used for respectively establishing communication connection between the intelligent master station and each slave station in the plurality of slave stations;
The determining module is used for determining a first target slave station of the plurality of slave stations according to the monitoring sequence corresponding to the plurality of slave stations by the intelligent master station;
The intelligent master station is used for sending a read-write command to the first target slave station according to the operation command when the intelligent master station receives the operation command of a user aiming at the first target slave station and a communication bus between the intelligent master station and the plurality of slave stations is idle, so that the first target slave station returns corresponding slave station data in a preset communication frame format according to the read-write command;
the judging module is used for judging whether the intelligent master station receives the slave station data returned by the first target slave station in a first preset time period;
the first visualization module is used for recording the slave station data and visually displaying the slave station data when the intelligent master station receives the slave station data in the first preset time period;
The second visualization module is used for determining that the first target slave station is in error when the intelligent master station does not receive the slave station data in the first preset time period, and performing visual display on an error code of the first target slave station;
and the repeated execution module is used for repeatedly executing the operations based on the monitoring sequence by the intelligent master station until the intelligent master station visually displays the slave station data or the error codes of each slave station in the plurality of slave stations.
A third aspect of the present application provides an intelligent master station comprising a memory, a processor and a computer program stored on the memory and operable on the processor, the processor implementing the steps of the industrial communications monitoring method when executing the computer program.
A fourth aspect of the present application provides a computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of the industrial communication monitoring method described above.
In summary, according to the industrial communication monitoring method, the device, the intelligent master station and the computer storage medium provided by the application, the intelligent master station establishes communication connection with each slave station in the plurality of slave stations in a polling mode, and the intelligent master station determines the first target slave station according to the monitoring sequence of the plurality of slave stations, so that the target slave station is prevented from being searched during each communication. When the communication bus is idle, the intelligent master station immediately sends a read-write instruction to the first target slave station without waiting for a specific time window, so that the communication resources can be fully utilized, and the communication efficiency is improved. And secondly, if the secondary station data is not received in a preset time period, the intelligent master station can quickly determine that the first target secondary station is wrong, and visually display the error code, so that a user can be helped to quickly find a problem and take corresponding measures, the time for troubleshooting is shortened, and the reliability and stability of communication are improved.
Drawings
FIG. 1 is a schematic diagram of an industrial communication monitoring system according to an embodiment of the present application;
FIG. 2 is a flow chart of an industrial communication monitoring method according to an embodiment of the present application;
FIG. 3 is a flow chart of a method for establishing a communication connection between an intelligent master station and a slave station according to an embodiment of the present application;
FIG. 4 is a table diagram of a slave station configuration book output by an embodiment of the present application;
FIG. 5 is a functional block diagram of an industrial communication monitoring device according to an embodiment of the present application;
Fig. 6 is a schematic structural diagram of an intelligent master station according to an embodiment of the present application.
Detailed Description
The terminology used in the following embodiments of the application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in the specification of the present application, the singular forms "a", "an", "the" and "the" are intended to include the plural forms as well, unless the context clearly indicates to the contrary. It should also be understood that the term "and/or" as used in this disclosure is intended to encompass any or all possible combinations of one or more of the listed items.
The terms "first," "second," and the like, are used below for descriptive purposes only and are not to be construed as implying or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include one or more such feature, and in the description of embodiments of the application, unless otherwise indicated, the meaning of "a plurality" is two or more.
Referring to fig. 1, a schematic structural diagram of an industrial communication monitoring system according to an embodiment of the present application is shown.
An industrial communication monitoring system 1 comprises an intelligent master station 10 and a plurality of slave stations 12. Each secondary station 12 is connected to the intelligent master station 10.
The intelligent master station 10 is a main body that performs monitoring control of a plurality of slave stations 12. The intelligent master station 10 is configured to monitor each of the slave stations 12, determine a target slave station in the slave stations 12 according to an operation instruction input by a user when the operation instruction is received, and perform a control operation on the target slave station according to the operation instruction.
In some embodiments, the smart master station 10 refers to a terminal device, such as a user device, for performing monitoring actions on the plurality of slave stations 12, where the user device includes, but is not limited to, any electronic product that can interact with a user by using a keyboard, a mouse, a remote controller, a touch pad, or a voice control device, such as a personal computer, a tablet, a smart phone, etc. The intelligent master station 10 may also be a device capable of automatically performing numerical calculation and/or information processing according to a preset or stored instruction, and its hardware includes, but is not limited to, a microprocessor, an application specific integrated circuit, a programmable gate array, a digital processor, an embedded device, etc.
In some embodiments, the secondary station 12 may include a plurality of execution devices, a plurality of control devices, a plurality of sensor devices, and a plurality of output devices. In the industrial intelligent factory, the execution device is used for executing corresponding operation according to the operation instruction. The execution device may include, but is not limited to: motors, valves, hydraulic cylinders, etc. The control device is used for managing and controlling the operation of the execution device. The control device may include, but is not limited to: programmable logic controllers (Programmable Logic Controller, PLC), relays, and frequency converters, etc. The sensor device is used for monitoring various parameters in the running process of the environment or other devices, and converting the parameters into electric signals or digital signals for the industrial communication monitoring system 1. The sensor device may include, but is not limited to: temperature sensors, pressure sensors, photoelectric sensors, and other sensors, etc. The output device is used for transmitting information or data to a user, related staff or other systems. The output devices may include, but are not limited to: display means, alarm means, printing means, etc.
In an embodiment of the application, each of the secondary stations 12 may be connected to the intelligent master station 10 via a communication bus. The communication bus can comprise RS485, RS232, VGA, SDI and the like. However, a communication bus that enables a communication connection between the intelligent master station 10 and each slave station 12 is included in the embodiments of the present application, and the present application is not illustrated. In other embodiments, the intelligent master station 10 and each slave station 12 may also be communicatively connected by wireless means (e.g., WIFI, zigBee, etc.).
Referring to fig. 2, a flowchart of an industrial communication monitoring method is shown in an embodiment of the present application. The industrial communication monitoring method comprises the following steps.
S21, the intelligent master station and each slave station in the plurality of slave stations respectively establish communication connection.
Only after the communication connection is established between the intelligent master station and the slave station, a user or a related staff member can realize the monitoring operation executed by the slave station for establishing the communication connection through the intelligent master station.
In an alternative embodiment, the intelligent master station establishing a communication connection with each of a plurality of slave stations respectively includes:
The intelligent master station determines a second target slave station according to the slave station number of each slave station in the plurality of slave stations, wherein the second target slave station is the slave station with the slave station number at the first position in the plurality of slave stations;
The intelligent master station sequentially sends m first instructions to the second target station, wherein m is an integer greater than or equal to 1;
When the intelligent master station sequentially receives m second instructions corresponding to the m first instructions returned by the second target slave station, determining that the intelligent master station and the second target slave station establish communication connection;
And repeatedly executing the operation until the intelligent master station establishes communication connection with each slave station in the plurality of slave stations.
In the embodiment of the application, the intelligent master station is used as a monitoring main body, the master station number of the intelligent master station is set to be 1 by default, and the slave station number, such as 2,3, N, N+1, is distributed to each of a plurality of slave stations through the intelligent master station, wherein N is the number of the slave stations. That is, the plurality of slaves includes a first slave, a second slave, a. The N-th slave, the slave number corresponding to the first slave is 2, the slave number of the second slave is 3, the slave number of the N-1-th slave is N, and the slave number of the N-th slave is N+1.
In some embodiments, the intelligent master station may assign each slave station a slave station number according to the user's selection. In other embodiments, the intelligent master station may also obtain the importance level of each slave station, and assign a slave station number to each slave station according to the priority of the importance level.
After determining the number of the secondary station of each secondary station, the intelligent master station detects whether to establish communication connection with each secondary station in a polling mode. Specifically, the intelligent master station selects a first slave station with the slave station number as a second target slave station according to the arrangement mode of the slave station numbers, namely, selects a slave station with the slave station number of 2 as the second target slave station, or selects a slave station with the slave station number of n+1 as the second target slave station. Further, the intelligent master station sequentially transmits m instructions to the second target slave station, when the slave station receives the m instructions, the slave station correspondingly returns the m instructions to the intelligent master station, in order to distinguish the instructions transmitted by the intelligent master station from the received instructions, the instructions transmitted by the intelligent slave station are called as first instructions, and the instructions returned by the slave station are called as second instructions. When the intelligent master station sequentially sends m first instructions to the second target slave stations, and the second target slave stations return one second instruction after receiving one first instruction, and finally return m second instructions to the intelligent master station, communication connection between the second target slave stations and the intelligent master station can be determined, and slave station information of the second target slave stations corresponding to the m first instructions is acquired, wherein m is an integer greater than or equal to 1.
After the second target slave station establishes communication connection with the intelligent master station, the intelligent master station continuously detects whether communication connection is established with other slave stations. According to the same embodiment, the intelligent master station selects the slave station corresponding to the second slave station number arrangement as the third target slave station, namely, selects the slave station with the slave station number of 3 as the third target slave station, or selects the slave station with the slave station number of N as the third target slave station. Further, the intelligent master station sequentially sends m first instructions to the third target slave station, when the third target slave station sequentially returns m second instructions, it can be determined that the third target slave station and the intelligent master station are in communication connection, and slave station information of the third target slave station corresponding to the m first instructions is obtained.
And so on, the intelligent master station can sequentially send m first instructions to the fourth target slave station, the fifth target slave station, & gtth and (n+1) th target slave stations until each slave station returns m second instructions to the intelligent master station after sequentially receiving the m first instructions, and the intelligent master station and the N slave stations can be determined to establish communication connection.
Through the optional implementation manner, the intelligent master station establishes communication connection with the slave stations in an automatic allocation slave station number and polling mode, so that the intelligent master station can realize the capability of intelligently managing a plurality of slave stations, so that the intelligent master station dynamically manages the slave stations according to requirements, stable communication connection is established among the plurality of slave stations, and the communication efficiency and reliability between the intelligent master station and the plurality of slave stations are improved. And secondly, communication connection is established by automatically distributing station numbers and polling modes, so that the workload of manual configuration can be reduced, and the reliability and maintainability of the system are improved.
In an alternative embodiment, the smart master station sequentially sending m first instructions to the second target slave station includes:
the intelligent master station sends a first sub-instruction in the m first instructions to the second target station, wherein the first sub-instruction is the first sub-instruction in the m first instructions;
judging whether the intelligent master station receives an instruction corresponding to the first sub-instruction returned by the second target slave station in a second preset time period;
When the intelligent master station is determined to receive an instruction corresponding to the first sub-instruction returned by the second target slave station in the second preset time period, the intelligent master station acquires the slave station information of the second target slave station corresponding to the first sub-instruction and sends a second sub-instruction to the second target slave station, wherein the second sub-instruction is a sub-instruction with the instruction number adjacent to the first sub-instruction in the m first instructions;
Judging whether the intelligent master station receives an instruction corresponding to the second sub-instruction returned by the second target slave station in the second preset time period;
When the fact that the second target slave station receives the command corresponding to the second sub-command is received within the second preset time period is determined, the intelligent master station acquires the slave station information of the second target slave station corresponding to the second sub-command and sends a third sub-command to the second target slave station, wherein the third sub-command is a command with a command number adjacent to the second sub-command in the m first commands, and the command number of the third sub-command is located behind the command number of the second sub-command;
and repeatedly executing the operation until the intelligent master station sends the m first instructions to the second target slave station, and acquiring corresponding slave station information.
When the intelligent master station sequentially transmits m first instructions to each of the intelligent master stations, the number of the first instructions, namely the value of m, needs to be determined.
When m=1, that is, after the intelligent master station only needs to send 1 first instruction to the second target slave station, it can determine whether the intelligent master station and the second target slave station establish communication connection by determining whether the intelligent master station receives the second instruction from the second target slave station within a second preset time period (for example, 3 seconds).
In some embodiments, when it is determined that the second target slave station returns the second instruction to the intelligent master station within the second preset time period, it may be determined that the intelligent master station establishes a communication connection with the second target slave station, and the intelligent master station may further acquire slave station information of the second target slave station corresponding to the first instruction. For convenience of distinction, the information of the secondary station returned by the second target secondary station and corresponding to the first instruction is referred to as first secondary station information, for example, the first instruction is a manufacturer number of the secondary station requesting from the secondary station, when the secondary station returns the second instruction, the manufacturer number of the second target secondary station can be obtained, and the manufacturer number is the first secondary station information.
After the intelligent master station and the second target slave station are determined to establish communication connection, the intelligent master station can further send a first instruction to the third target slave station, judge whether the intelligent master station receives a second instruction returned by the third target slave station in a second preset time period, and when the third target slave station returns the second instruction to the intelligent master station in the second preset time period, the intelligent master station and the third target slave station can be determined to establish communication connection, and the intelligent master station can further acquire slave station information of the third target slave station corresponding to the first instruction. For convenience of distinction, the slave station information returned for the first instruction returned by the third target slave station is referred to as second slave station information.
Similarly, after the intelligent master station establishes communication connection with the third target slave station, the intelligent master station can sequentially send a first instruction to the fourth target slave station, the fifth target slave station, & gtthe N+1th target slave station, and when the fourth target slave station, the fifth target slave station, & gtthe N+1th target slave station sequentially return to the second instruction, the intelligent master station and the N slave stations can be determined to establish communication connection.
In some embodiments, when it is determined that the second target slave station does not return the second instruction to the intelligent master station within the second preset time period, further determining the instruction transmission times corresponding to the current time of the first instruction transmitted by the intelligent slave station, comparing the instruction transmission times with a preset time threshold (for example, 3 times), when it is determined that the instruction transmission times do not meet the preset time threshold, retransmitting the first instruction to the second target slave station by the intelligent master station, and continuing to determine whether the second instruction returned by the second target slave station is received by the intelligent master station within the second preset time period, and so on until the instruction transmission times meet the preset time threshold. When the instruction sending times meet the preset times threshold, the intelligent master station does not send the first instruction to the second target slave station any more, the intelligent master station and the second target slave station are determined to be not in communication connection, and then the slave station number corresponding to the second target slave station is recorded in the slave station information table corresponding to the second target slave station.
When it is determined that the intelligent master station has not established a communication connection with the second target slave station, according to the same embodiment, the intelligent master station can sequentially send a first instruction to the third target slave station, the fourth target slave station, & gtth and (n+1) th target slave stations so as to determine whether the intelligent master station establishes communication connection with other slave stations.
When m=2, that is, the intelligent master station needs to sequentially send 2 first instructions to the second target slave station, and the intelligent master station sequentially receives 2 second instructions corresponding to the 2 first instructions returned by the second target slave station, it can be determined that the intelligent master station and the second target slave station are connected. Specifically, the intelligent master station firstly sends a first sub-instruction corresponding to the first order number array in m first orders to the second target slave station, for example, selects the first order with the order number of 1 or the first order with the order number of m as the first sub-instruction, judges whether an order corresponding to the first sub-instruction in the second order returned by the second target slave station is received in a second preset time period, and when determining that the second target slave station returns the order corresponding to the first sub-instruction in the second order to the intelligent master station in the second preset time period, can acquire the slave station information of the second target slave station corresponding to the first sub-instruction. When the intelligent master station determines that the intelligent master station successfully receives the instruction corresponding to the first sub-instruction in the second instruction, the intelligent master station continuously sends the second sub-instruction corresponding to the second in the m first instructions to the second target slave station, namely, selects the first instruction with the instruction number of 2 or the first instruction with the instruction number of m-1, judges whether the second target slave station returns the instruction corresponding to the second sub-instruction in the second instruction in a second preset time period, and when the second target slave station returns the instruction corresponding to the second sub-instruction in the second preset time period, acquires the slave station information of the second target slave station corresponding to the second sub-instruction, namely, the intelligent master station sequentially receives the second instruction returned by the second target slave station, so that the intelligent master station and the second target slave station can be determined to establish communication connection.
Similarly, after the intelligent master station and the second target slave station are determined to establish communication connection, the intelligent master station can sequentially send the first sub-instruction and the second sub-instruction to the third target slave station, the fourth target slave station, & gtthe N+1th target slave station until N slave stations sequentially return instructions corresponding to the first sub-instruction and the second sub-instruction, and the intelligent master station and the N slave stations can be determined to establish communication connection. If the N secondary stations do not return the instruction corresponding to the first sub instruction or the instruction corresponding to the second sub instruction, the intelligent master station can determine that the intelligent master station does not establish communication connection with any secondary station in the N secondary stations.
According to the same embodiment, when determining that the second target slave station does not return the instruction corresponding to the first sub-instruction within the second preset time period, the intelligent master station may determine the instruction sending number of the first sub-instruction and compare the instruction sending number with the preset number threshold, and when determining that the instruction sending number does not meet the preset number threshold, the intelligent master station may further continue to send the first sub-instruction to the second target slave station and determine whether the second target slave station returns the instruction corresponding to the first sub-instruction within the second preset time period, and so on until the second target slave station returns the instruction corresponding to the first sub-instruction within the preset number threshold within the second preset time period, or the instruction sending index meets the preset number threshold. When the instruction sending times meet the preset times threshold, the intelligent master station does not send the first sub-instruction to the second target slave station any more, and the intelligent master station is determined to not establish communication connection with the second target slave station.
When the intelligent master station and the second target slave station are determined not to establish communication connection, the intelligent master station can sequentially send a first sub-instruction and a second sub-instruction to the third target slave station, the fourth target slave station, the (4) th target slave station and the (n+1) th target slave station. It should be noted that, the intelligent master station only sends the second sub-instruction to the slave station when the instruction corresponding to the first sub-instruction returned by the slave station is successfully received.
When m=3, the intelligent master station receives the instruction corresponding to the first sub-instruction returned by the second target slave station in the second preset time period, and receives the instruction corresponding to the second sub-instruction returned by the second target slave station in the second preset time period, and the intelligent master station sends a third sub-instruction which is arranged in the third m first instructions, namely the first instruction with the instruction number of 3 or the first instruction with the instruction number of m-2, to the second target slave station. And judging whether an instruction corresponding to a third sub-instruction returned by the second target slave station is received in a second preset time period, and when the intelligent master station is determined to receive the instruction corresponding to the third sub-instruction in the preset second time period, establishing communication connection between the intelligent master station and the second target slave station and acquiring slave station information of the second target slave station corresponding to the third sub-instruction. And the same is said until the intelligent master station sends the m first instructions to the second target slave station and obtains the slave station information of the second target slave station corresponding to each first instruction in the m first instructions.
According to the same embodiment, when it is determined that the intelligent master station does not receive the instruction corresponding to the third sub-instruction returned by the second target slave station within the second preset time period, and the instruction sending frequency of the third sub-instruction meets the preset frequency threshold, it may be determined that communication connection is not established between the intelligent master station and the second target slave station.
And so on, the intelligent master station can sequentially send the first sub-instruction, the second sub-instruction and the third sub-instruction to the third target slave station, the fourth target slave station, & gtand the n+1th target slave station until the N slave stations sequentially return the instructions corresponding to the first sub-instruction, the second sub-instruction and the third sub-instruction, and can determine that the intelligent master station and the N slave stations all establish communication connection. If the instruction corresponding to the first sub-instruction, the instruction corresponding to the second sub-instruction, or the instruction corresponding to the third sub-instruction is not returned from the N secondary stations, it can be determined that the intelligent master station does not establish communication connection with any one secondary station of the N primary stations. When the intelligent master station needs to be described, the intelligent master station sends a third sub-instruction to the slave station only after the intelligent master station successfully receives the instruction corresponding to the first sub-instruction and the instruction corresponding to the second sub-instruction returned by the slave station. And the same is said until the intelligent master station sends m first instructions to N slave stations and the slave stations return m second instructions in turn, the intelligent master station is determined to establish communication connection with N slave stations, and the slave station information corresponding to each first instruction in the m first instructions is obtained.
Through the optional implementation manner, the multipoint communication and information acquisition in the distributed system are realized by sequentially establishing communication connection between the intelligent master station and the plurality of slave stations. And secondly, judging the communication establishment condition by utilizing the preset instruction sending times and the preset time period, and effectively ensuring the reliability and stability of the communication. By gradually verifying the communication connection with the slave stations, it is possible to quickly identify which slave stations successfully establish the connection and which failed or need to be retried, improving the degree of automation and robustness of the system.
In the embodiment of the application, m first instructions sent by the intelligent master station to each slave station are called A1 to Am instructions, and m second instructions returned by each slave station to the intelligent master station are called B1 to Bm services. In the embodiment of the present application, m=6, the A1 to A6 instructions and the B1 to B6 services are in one-to-one correspondence, respectively, for example, if the intelligent master station sends an A1 instruction to the slave station, the slave station returns to the intelligent master station B1 service; and if the intelligent master station sends an A2 instruction to the slave station, the slave station returns to the intelligent master station B2 service, and so on. For ease of understanding, the following description of the A1 to A6 instructions, B1 to B6 services, is provided in connection with specific examples.
For example:
a1 instruction refers to an instruction of the intelligent master station requesting the slave station for the number of the slave station's manufacturer;
A2 instruction refers to an instruction of the intelligent master station requesting the slave station for the name of the manufacturer of the slave station;
A3 instruction refers to an instruction of the intelligent master station for requesting the device type code of the slave station from the slave station;
a4 instruction refers to an instruction of the intelligent master station requesting the device name of the slave station from the slave station;
a5 instruction refers to an instruction of requesting the intelligent master station to the slave station for the device hardware version number of the slave station;
a6 instruction refers to an instruction of requesting a device software version number from the intelligent master station to the slave station;
B1 service refers to the slave station returning the manufacturer number of the duplicate slave station to the intelligent master station;
b2 service refers to the name of the manufacturer of the secondary station that copies back to the intelligent master station;
B3 services refer to the device type code of the secondary station back to the intelligent primary station to copy the secondary station;
b4 service refers to the device name of the secondary station back to the intelligent master station to copy the secondary station;
B5 service refers to the slave station returning a duplicate slave station's device hardware version number to the intelligent master station;
b6 services refer to the slave station's device software version number back to the intelligent master station as a copy of the slave station.
In some embodiments, in conjunction with fig. 3, the intelligent master station may monitor whether the communication bus is in an idle state, when the communication bus is in the idle state, the intelligent master station may send an A1 instruction to the slave station with the slave station number 2, determine whether the intelligent master station receives the slave station with the slave station number 2 within a second preset time period and return the slave station to the B1 service, and if the intelligent master station receives the B1 service within the second preset time period, allocate a slave station information table for the slave station with the slave station number 2, acquire slave station information corresponding to the A1 instruction, and record the slave station information into the slave station information table. And if the intelligent master station does not receive the B1 service within the second preset time period, sending an A1 instruction to the slave station with the slave station number of 3. According to the same implementation mode, whether the intelligent master station receives the slave station with the slave station number of 3 in a second preset time period and returns to the B1 service is judged, if the intelligent master station receives the B1 service in the second preset time period, the intelligent master station allocates a slave station information table for the slave station with the slave station number of 3, acquires slave station information corresponding to the A1 instruction, and records the slave station information in the slave station information table. If the intelligent master station does not receive the B1 service within the second preset time period, an A1 instruction is sent to the slave station with the number of 4, and the like.
If the intelligent master station receives the B1 service in the second preset time period, a slave station information table is allocated to the slave station with the slave station number of 2, slave station information corresponding to the A1 instruction is acquired, the slave station information is recorded in the slave station information table, the intelligent master station further continues to send the A2 instruction to the slave station with the slave station number of 2, whether the intelligent master station receives the slave station with the slave station number of 2 to return to the B2 service in the second preset time period is judged, and if the intelligent master station receives the B2 service in the second preset time period, the intelligent master station acquires the slave station information corresponding to the A2 instruction and records the slave station information in the slave station information table. And if the intelligent master station does not receive the B2 service within the second preset time period, sending an A1 instruction to the slave station with the slave station number of 3.
According to the same embodiment, the intelligent master station may sequentially send the A1 to A6 instructions to the slave station with the slave station number 2 until the A1 to A6 instructions are sent, and the B1 to B6 services are received, and record the acquired slave station information into the slave station information table. Similarly, the master station can sequentially send an A1 to A6 instruction to the slave stations with the slave station number of 3 until the A1 to A6 instruction is sent completely and the B1 to B6 service is received completely, and record the acquired slave station information into a slave station information table, and the intelligent master station can sequentially send the A1 to A6 instruction to each slave station and receive the B1 to B6 service returned by the slave station.
Through the optional implementation manner, by defining a set of corresponding relation between the instruction and the service, information interaction and management between the intelligent master station and the slave stations and acquisition and recording of data of the slave stations by the intelligent master station are realized, a large number of slave station devices can be effectively managed, information acquisition is actively carried out when a communication bus is idle, the efficiency and the response speed of the system are improved, and meanwhile, the integrity and the accuracy of information are ensured.
In an alternative embodiment, the secondary station may return secondary station information corresponding to the m first instructions according to a preset data frame format. Specifically, the preset data frame format may include: the intelligent master station comprises a start frame, a station number of the intelligent master station, a slave station number, an instruction type, a data length returned by the slave station, data returned by the slave station and a check code, wherein the start frame occupies 1byte, the master station number occupies 1byte, the slave station number occupies 1byte, the instruction type occupies 2 bytes, the information length returned by the slave station occupies 1byte, the information returned by the slave station occupies X bytes, and the check code occupies 2 bytes, wherein X is determined according to the data returned by the slave station. Note that 8 binary values are 1byte, i.e., 1 byte=8 bits.
In some embodiments, the secondary station may return secondary station data according to the starting frame, the station number of the intelligent primary station, the secondary station number, the instruction type, the length of data returned by the secondary station, and the sequential ordering of the data returned by the secondary station. Illustratively, assume that the master station transmits a read data command to the slave station A requesting the temperature data of the slave station A to be read. After receiving the data reading instruction, the slave station A returns a data start frame (0 xAA), a station number (0 x 01) of the intelligent master station, a slave station number (0 x 02), an instruction type (0 x 0001) of temperature data, a data length (0 x 02) returned by the slave station, temperature data (0 x1A,0x 2B) returned by the slave station and a check code (0 xCD) according to a preset communication frame format, and the data of the slave station returned by the slave station is [0xAA 0x01 0x02 0x0001 0x02 0x1A,0x2B 0xCD ].
Through the optional implementation manner, the intelligent master station can accurately analyze the slave station information returned by the slave station through the clearly defined data frame format, so that reliable transmission and analysis of the information are realized. And the preset data frame format has good compatibility and expandability, can adapt to different types of instructions and information requirements, and improves the flexibility and the universality of the system. Meanwhile, through presetting the data frame format, the design and the implementation process of a communication protocol can be simplified, the development and maintenance cost of the system is reduced, and the reliability and the stability of the system are improved.
S22, the intelligent master station determines a first target slave station of the plurality of slave stations according to the monitoring sequence corresponding to the plurality of slave stations.
The first target slave station refers to a slave station corresponding to a first slave station number arrangement in the monitoring sequence.
After determining that the intelligent master station establishes communication connection with the plurality of slave stations, the intelligent master station can realize remote monitoring control on each of the plurality of slave stations. In some embodiments, the intelligent master station first needs to determine the monitoring sequence of each slave station, specifically, the monitoring sequence may be determined according to the slave station number corresponding to each slave station, for example, the monitoring sequence may be determined according to the size of the slave station number, and may be from large to small or from small to large. And if the slave station numbers are ordered from big to small, the first target slave station refers to a slave station corresponding to the slave station number N+1 in the plurality of slave stations. And if the descending order is performed according to the slave station numbers, the first target slave station refers to a slave station corresponding to the slave station number 2 in the plurality of slave stations. In other embodiments, the secondary station to be monitored is selected according to the user demand, and the monitoring sequence is generated according to the secondary station number corresponding to the secondary station selected by the user. For example, assuming that there are 5 slaves, the user wants to monitor the slave corresponding to the slave number 3, then monitor the slave corresponding to the slave number 4, then monitor the slave corresponding to the slave number 5, then monitor the slave corresponding to the slave number 6, and finally monitor the slave corresponding to the slave number 2, the monitoring order is [3,4,5,6,2], and the first target slave is the slave corresponding to the slave number 3.
Through the optional implementation manner, the intelligent master station provides a highly customized monitoring strategy by flexibly setting the monitoring sequence of the slave stations, and can effectively perform remote monitoring control according to actual operation requirements and user preferences, so that the monitoring process is more efficient and targeted. For example, by preferentially monitoring critical or user-specified secondary stations, it is possible to quickly respond to critical or emergency situations, ensuring the sustainability and safety of critical operations. In addition, the flexibility and the adaptability of the monitoring system are enhanced by setting the monitoring sequence according to the requirement, and different operation and maintenance scenes and requirement changes can be dealt with, so that the operation and maintenance efficiency and the response speed of the whole monitoring system are improved.
In some embodiments, the intelligent master station may also provide a Human-computer interaction (Human MACHINE INTERFACE, HMI) interface, so that a user or related staff may implement the monitoring operation of the intelligent master station on the slave station through the Human-computer interaction interface. For example, when a user monitors a slave station through an intelligent master station, the user can select the slave station number to be monitored through an HMI interface and input an operation instruction of the slave station corresponding to the slave station number, so that the monitoring operation of the slave station corresponding to the slave station number can be realized.
S23, when the intelligent master station receives an operation instruction of a user aiming at the first target slave station and a communication bus between the intelligent master station and the plurality of slave stations is idle, the intelligent master station sends a read-write instruction to the first target slave station according to the operation instruction, so that the first target slave station returns corresponding slave station data in a preset communication frame format according to the read-write instruction.
S24, judging whether the intelligent master station receives the slave station data returned by the first target slave station in a first preset time period.
In some embodiments, when a user sends an operation instruction on the intelligent master station, the intelligent master station receives the corresponding operation instruction, and when no other communication activities exist on the communication bus, that is, the communication bus is idle, the intelligent master station can generate a corresponding read-write instruction according to the operation instruction of the user. The first target slave station generates corresponding data according to a preset communication frame format after receiving the read-write command, and returns the corresponding data to the intelligent master station through the communication bus. After receiving the secondary station data returned by the first target secondary station, the intelligent primary station analyzes the secondary station data to acquire required information, and extracts a check code in a preset communication frame format to verify whether the secondary station data is correct or not so as to ensure the integrity and the accuracy of the secondary station data.
In the embodiment of the application, a read-write instruction can be predefined, specifically, firstly, an A7 instruction is defined by a read data instruction sent by an intelligent master station to a slave station, and then the read data instruction returned by the slave station to the intelligent master station is changed into a B7 service; defining a write-in data instruction sent by the intelligent master station to the slave station as an A8 instruction, and enabling the write-in data instruction returned by the slave station to the intelligent master station to be B8 service; and defining the read-write data instruction sent by the intelligent master station to the slave station as an A9 instruction, and enabling the read-write data instruction returned by the slave station to the intelligent master station to be B8 service. When the read-write command is determined to be an A7 command, the intelligent master station sends the A7 command to the first target slave station, and judges whether the intelligent master station receives the B7 service in a first preset time period (for example, 3 seconds). And when the intelligent master station receives the B7 service in the first preset time period, acquiring the slave station data corresponding to the first target slave station corresponding to the A7 instruction. If the intelligent master station needs to acquire the device state of the first target slave station, the intelligent master station sends a read data instruction carrying the device state to the first target slave station, and the returned device state is called as the slave station data of the first target slave station corresponding to the read data instruction.
It should be noted that the first preset time period and the second preset time period are only illustrative, and the first preset time period may be the same as the second preset time period or may be different from the second preset time period.
In an alternative embodiment, the secondary station data is returned to the intelligent primary station by the secondary station in accordance with a predetermined communication frame format. The preset communication frame format includes: the intelligent master station comprises a start frame, a station number of the intelligent master station, a slave station number, an instruction type, a data length returned by the slave station, data returned by the slave station and a check code, wherein the start frame occupies 1 byte, the master station number occupies 1 byte, the slave station number occupies 1 byte, the instruction type occupies 2 bytes, the data length returned by the slave station occupies 1 byte, the data returned by the slave station occupies X bytes, and the check code occupies 2 bytes, wherein X is determined according to the data returned by the slave station.
And S25, when the intelligent master station receives the slave station data in the first preset time period, the intelligent master station records the slave station data and visually displays the slave station data.
S26, when the intelligent master station does not receive the slave station data in the first preset time period, the intelligent master station determines that the first target slave station is in error, and visually displays the error code of the first target slave station.
When the intelligent master station receives the slave station data of the first target slave station corresponding to the read-write instruction returned by the first target slave station in a first preset time period, whether the received slave station data are correct or not needs to be checked. The secondary station data is returned according to the preset communication frame format, so that the intelligent master station can extract the check code in the secondary station data, check whether the received secondary station data is correct or not by using the check code, and record the secondary station data into a secondary station information table corresponding to the first target secondary station when the received secondary station data is correct, and visually display the secondary station data through an HMI interface provided by the intelligent master station. When the received secondary station data is incorrect, firstly determining the instruction sending times of the read-write instruction at the current moment, comparing the instruction sending times with a second preset time threshold (for example, 3 times), and when the instruction sending times are determined not to meet the second preset time threshold, continuously sending the read-write instruction to the first target secondary station according to the operation executed by the user by the intelligent primary station. And when the command sending times meet a second preset time threshold, the intelligent master station stops sending the read-write command to the first target slave station, namely, the intelligent master station does not respond to the operation command of the user any more, and displays the error code corresponding to the second target slave station. Specifically, the slave station data corresponding to the read-write instruction is determined, and a corresponding error code is generated according to the slave station data corresponding to the read-write instruction. For example, the intelligent master station may set different error codes in advance according to different slave station data, where one slave station data corresponds to one error code, for example, the temperature data corresponds to the error code a, the power data corresponds to the code b, and so on. In some embodiments, the check code may be a frame check Sequence (FRAME CHECK Sequence, FCS), i.e., a tail field of a predetermined communication frame format. In other embodiments, the check code may also be a cyclic redundancy check code (Cycle Redundancy Check, CRC).
The accuracy of the received slave station data can be ensured by extracting the check code in the preset communication frame format to perform data check. Meanwhile, based on comparison of the instruction sending times and a preset times threshold value and automatic processing of error data and display of error codes, stability and reliability of the monitoring system are improved, better operation experience and fault detection capability are provided for users, and accordingly overall performance and maintainability of the monitoring system are improved.
It should be noted that the first preset number of times threshold and the second preset number of times threshold are only illustrative, and the first preset number of times threshold may be the same as the second preset number of times threshold, or may be different from the second preset number of times threshold.
And S27, the intelligent master station repeatedly performs the operation based on the monitoring sequence until the intelligent master station visually displays the slave station data or the error codes of each slave station in the plurality of slave stations.
When the intelligent master station sends a read-write command to the first target slave station and the first target slave station successfully returns the slave station data of the first target slave station corresponding to the read-write command, the intelligent master station can determine the slave station needing to be monitored after the first target slave station according to the monitoring sequence, and monitor each of a plurality of slave stations arranged after the first target slave station in the monitoring sequence according to the same embodiment mode of the steps S13, S14, S15 and S16 until the intelligent master station visually displays the slave station data or error codes of each of the plurality of slave stations.
Through the optional implementation manner, the circulation monitoring of a plurality of secondary stations is realized through the automatic monitoring sequence, so that all secondary station data or error codes are completely and visually displayed, the efficiency and the instantaneity of the monitoring system are improved, the need of manual intervention is reduced, and meanwhile, the comprehensiveness and the accuracy of the monitoring process are ensured, so that the overall performance and the operability of the monitoring system are improved.
In an alternative embodiment, the method further comprises:
determining the data of the secondary stations corresponding to each secondary station in the plurality of secondary stations, and generating a plurality of secondary station data tables according to the secondary station data, wherein one secondary station corresponds to one secondary station data table;
Generating a secondary station configuration book according to the secondary station data tables, and visually displaying the secondary station configuration book according to the secondary station numbers.
In some embodiments, the secondary station data may include, but is not limited to: vendor number, vendor name, device type code, device name, device hardware version number, device software version number, temperature data, pressure data, and the like. Referring to fig. 4 together, for each secondary station, a corresponding secondary station information table may be generated according to the secondary station data, and a plurality of secondary station information tables may be integrated to obtain a corresponding secondary station configuration book, and visually displayed through an HMI interface provided by the intelligent primary station.
In some embodiments, when it is determined that a communication connection is established between the intelligent master and slave, it may be represented by code 1, and when no communication connection is established between the intelligent master and slave, it may be represented by code 0. By using the codes 1 and 0 to represent the communication connection state between the intelligent master station and the slave stations, the judgment and processing of the state are simplified, and the readability and usability of the monitoring system are improved.
In an alternative embodiment, when the intelligent master station successfully connects each of the plurality of slave stations, the intelligent master station may sequentially acquire the state information corresponding to each slave station according to a preset time period (for example, 10 minutes) and the arrangement sequence of the slave station numbers of each slave station, and classify the plurality of slave stations according to the state information. The status information may include, but is not limited to: signal strength, data transmission efficiency, error rate, etc. Specifically, the intelligent master station may determine whether an abnormal slave station exists among the plurality of slave stations according to the state information. For the abnormal slave stations, the intelligent master station can determine the abnormal problems existing in the abnormal slave stations according to the abnormal state information of each abnormal slave station. Furthermore, the intelligent master station can acquire the number of the slave stations of the abnormal slave stations, when the number of the slave stations is equal to 1, the intelligent master station can clearly know that only one abnormal slave station needs to be processed, and the processing mode of the abnormal slave station can be determined without considering other influencing factors of the abnormal slave station, and the abnormal slave station is processed according to the processing mode. The intelligent master station firstly needs to determine the abnormal problem of the abnormal slave station, and judges whether the abnormal slave station can autonomously process the abnormal problem according to the abnormal problem. When the abnormal slave station can autonomously process the abnormal problem, the intelligent master station can send a control instruction carrying an abnormal processing mode for processing the abnormal problem to the abnormal slave station, and when the abnormal slave station receives the control instruction, the abnormal slave station can process the abnormal problem according to the control instruction. When the abnormal slave station cannot autonomously process the abnormal problem, the intelligent master station can send an abnormal processing mode carrying the abnormal problem to the terminal equipment (for example, the mobile phone of the related staff) of the related staff to inform the related staff that the abnormal problem of the abnormal slave station can be processed in time according to the abnormal processing mode.
When the number of the slave stations is greater than or equal to 2, determining an abnormal problem corresponding to each abnormal slave station in the plurality of abnormal slave stations, determining whether the abnormal slave stations exist or not, and if so, grouping the abnormal slave stations capable of automatically processing the abnormal problem into one class to obtain a first abnormal slave station set, and grouping the abnormal slave stations incapable of automatically processing the abnormal problem into 1 class to obtain a second abnormal slave station set. Aiming at the first abnormal slave station set, the intelligent master station can send a control instruction carrying an abnormal processing mode for processing the abnormal problem to each abnormal slave station in the first abnormal slave station set, and when the abnormal slave station receives the control instruction, the abnormal slave station can process the abnormal problem according to the control instruction. For the second abnormal secondary station set, the intelligent master station needs to further determine the abnormality degree and the abnormality influence range of each abnormal secondary station in the second abnormal secondary station set, so that the intelligent master station can determine the processing sequence of the abnormal secondary stations in the second abnormal secondary station set according to the abnormality degree and the abnormality influence range of each abnormal secondary station, and the staff can process each abnormal secondary station in the second abnormal secondary station set according to the processing sequence. Specifically, an anomaly degree assessment model may be previously based on deep neural networks based on anomaly secondary station data (e.g., anomaly problem types, anomaly secondary station types, etc.) and trained in a quantized manner with the advance. In addition, the range of influence of the abnormal slave station on each of the plurality of slave stations is determined in consideration of the dependency relationship and propagation paths of the abnormal slave station. Further, the intelligent master station can formulate processing priority, such as priority processing of the abnormal slave stations with high abnormality degree and wide influence range, by combining the abnormality degree and the abnormality influence range. For example, assume that there are multiple slaves in one industrial production system, wherein a second set of anomalous slaves includes pressure sensor anomalies, temperature controller anomalies, and flow meter anomalies. The abnormality degree of each abnormal slave station can be determined by an abnormality degree evaluation model, for example, the abnormality degree of the pressure sensor belongs to a type with high severity degree, and the abnormality degree of the temperature controller belongs to a type with medium degree. Meanwhile, the abnormal influence range of each abnormal slave station is analyzed, and it is found that the abnormal temperature controller may cause the reduction of production quality, and the abnormal flow meter may influence the production efficiency. Therefore, the intelligent master station can determine that the pressure sensor is firstly processed abnormally, then the temperature controller is processed abnormally, and finally the flowmeter is processed abnormally, so that the stable operation and the production quality of the production system are guaranteed to the greatest extent.
Through the optional implementation manner, the anomaly detection and anomaly processing for the plurality of secondary stations are realized through the combination analysis of the preset time period, the arrangement sequence of the secondary station numbers and the state information. Through the abnormality degree and the influence range, the processing priority of the abnormal secondary station is formulated, the abnormal secondary station is ensured to be processed in time, the accuracy of abnormality detection and the processing efficiency are improved, the abnormality problem in the abnormal secondary station is found and solved in time, and the stability of the abnormal secondary station is improved.
In some embodiments, after determining the degree of anomaly and the anomaly impact range for each anomaly secondary station, the intelligent primary station may utilize a graph theory algorithm to construct an anomaly secondary station network topology map to visualize the degree of anomaly and the anomaly impact range.
In the embodiment of the application, the intelligent master station can match and classify the abnormal state information and the known abnormal problems based on the pattern recognition method, so as to determine the abnormal problems in the abnormal slave station. Specifically, the intelligent master station firstly collects historical abnormal state information of a plurality of abnormal slave stations, marks the historical abnormal state information and classifies the historical abnormal state information into different abnormal problem types. And then extracting features in the historical abnormal state information, such as signal strength, data transmission efficiency, error rate and the like, selecting features with higher distinction degree for abnormal problem identification, further training and verifying the marked historical abnormal state information by using a machine learning algorithm, such as a Support Vector Machine (SVM), a decision tree and the like, and establishing an abnormal problem classification model. When the abnormal state information of the abnormal slave stations is acquired, the abnormal state information is input into a trained abnormal problem classification model to determine abnormal problems existing in each abnormal slave station. Therefore, the intelligent master station can determine whether the abnormal slave station has the capability of autonomously processing the abnormal problem according to the characteristics of the abnormal problem and the information such as the processing capability and the equipment specification of the abnormal slave station. For example, for an abnormal problem of one pressure sensor, if the abnormal slave station has a function of autonomously adjusting pressure, it may be determined that the abnormal problem may be autonomously handled by the abnormal slave station, otherwise it may be determined that the abnormal problem may not be autonomously handled by the abnormal slave station.
Through the optional implementation manner, the diagnosis efficiency and accuracy of the abnormal problems are improved, the manual intervention requirement is reduced, the degree of automation of the abnormal secondary station and the response speed of processing the abnormal state are improved, and therefore the stability and reliability of the abnormal secondary station are enhanced.
Referring to fig. 5, a functional block diagram of an industrial communication monitoring device according to an embodiment of the present application is shown.
In some embodiments, the industrial communication monitoring device 50 can include a plurality of functional modules comprised of computer program segments. The computer program of each program segment of the industrial communication monitoring device 50 can be stored in the memory of the intelligent master station and executed by at least one processor to perform the industrial communication monitoring functions.
In this embodiment, the industrial communication monitoring device 50 can be divided into a plurality of functional modules according to the functions performed by the industrial communication monitoring device. The functional module may include: the device comprises a communication connection module 501, a determination module 502, an instruction sending module 503, a judging module 504, a first visualization module 505, a second visualization module 506 and a repeated execution module 507. The module referred to in the present application refers to a series of computer program segments capable of being executed by at least one processor and of performing a fixed function, stored in a memory. In the present embodiment, the functions of the respective modules will be described in detail in the following embodiments.
The communication connection module 501 is configured to establish a communication connection between the intelligent master station and each of the plurality of slave stations.
The communication connection module 501 is further specifically configured to:
The intelligent master station determines a second target slave station according to the slave station number of each slave station in the plurality of slave stations, wherein the second target slave station is the slave station with the slave station number at the first position in the plurality of slave stations;
The intelligent master station sequentially sends m first instructions to the second target station, wherein m is an integer greater than or equal to 1;
When the intelligent master station sequentially receives m second instructions corresponding to the m first instructions returned by the second target slave station, determining that the intelligent master station and the second target slave station establish communication connection;
And repeatedly executing the operation until the intelligent master station establishes communication connection with each slave station in the plurality of slave stations.
The communication connection module 501 is further specifically configured to:
the intelligent master station sends a first sub-instruction in the m first instructions to the second target station, wherein the first sub-instruction is the first sub-instruction in the m first instructions;
judging whether the intelligent master station receives an instruction corresponding to the first sub-instruction returned by the second target slave station in a second preset time period;
When the intelligent master station is determined to receive an instruction corresponding to the first sub-instruction returned by the second target slave station in the second preset time period, the intelligent master station acquires the slave station information of the second target slave station corresponding to the first sub-instruction and sends a second sub-instruction to the second target slave station, wherein the second sub-instruction is a sub-instruction with the instruction number adjacent to the first sub-instruction in the m first instructions;
Judging whether the intelligent master station receives an instruction corresponding to the second sub-instruction returned by the second target slave station in the second preset time period;
When the fact that the second target slave station receives the command corresponding to the second sub-command is received within the second preset time period is determined, the intelligent master station acquires the slave station information of the second target slave station corresponding to the second sub-command and sends a third sub-command to the second target slave station, wherein the third sub-command is a command with a command number adjacent to the second sub-command in the m first commands, and the command number of the third sub-command is located behind the command number of the second sub-command;
and repeatedly executing the operation until the intelligent master station sends the m first instructions to the second target slave station, and acquiring corresponding slave station information.
The determining module 502 is configured to determine, by the intelligent master station, a first target slave station of the plurality of slave stations according to monitoring orders corresponding to the plurality of slave stations.
The instruction sending module 503 is configured to, when the intelligent master station receives an operation instruction of a user for the first target slave station and a communication bus between the intelligent master station and the plurality of slave stations is idle, send a read-write instruction to the first target slave station according to the operation instruction, so that the first target slave station returns corresponding slave station data in a preset communication frame format according to the read-write instruction.
The determining module 504 is configured to determine whether the intelligent master station receives the slave station data returned by the first target slave station in a first preset time period.
The first visualization module 505 is configured to record the secondary station data and visually display the secondary station data when the intelligent master station receives the secondary station data within the first preset time period.
The first visualization module 505 is further specifically configured to:
the intelligent master station extracts a check code in the slave station data, and checks the slave station data according to the check code to determine whether the slave station data corresponds to the read-write instruction or not;
When the secondary station data is determined to correspond to the read-write instruction, the intelligent master station records the secondary station data and visually displays the secondary station data;
And when the data of the slave station is not corresponding to the read-write instruction, sending the read-write instruction to the first target slave station again according to the operation instruction until the times of sending the read-write instruction to the first target slave station reach a second preset times threshold.
The second visualization module 506 is configured to, when the intelligent master station does not receive the slave station data within the first preset time period, determine that an error occurs in the first target slave station, and visually display an error code of the first target slave station.
The repeated execution module 507 is configured to repeatedly perform the foregoing operations by the intelligent master station based on the monitoring sequence until the intelligent master station visually displays slave station data or error codes of each of the plurality of slave stations.
The determining module 502 is further configured to:
the intelligent master station determines the instruction sending times of sending the first sub-instruction to the second target station at the current moment;
judging whether the instruction sending times meet a first preset times threshold value or not;
when the instruction sending frequency does not meet the first preset frequency threshold, the intelligent master station continues to send the first sub-instruction to the second target slave station until the instruction sending frequency meets the first preset frequency threshold;
When the instruction sending frequency meets the first preset frequency threshold, the intelligent master station sends the first instruction to a third target slave station, wherein the third target slave station is a slave station with a station number adjacent to the second target slave station in the plurality of slave stations, and the station number of the third target slave station is located behind the station number of the second target slave station.
The second visualization module 506 is further configured to:
determining the data of the secondary stations corresponding to each secondary station in the plurality of secondary stations, and generating a plurality of secondary station data tables according to the secondary station data, wherein one secondary station corresponds to one secondary station data table;
Generating a secondary station configuration book according to the secondary station data tables, and visually displaying the secondary station configuration book according to the secondary station numbers.
It should be understood that the various modifications and embodiments of the industrial communication monitoring method provided in the foregoing embodiments are equally applicable to the industrial communication monitoring device of the present embodiment, and those skilled in the art will clearly know the implementation method of the industrial communication monitoring device of the present embodiment through the foregoing detailed description of the industrial communication monitoring method, which is not described in detail herein for brevity of description.
Referring to fig. 6, a schematic structural diagram of an intelligent master station according to an embodiment of the present application is shown. In the preferred embodiment of the present application, the intelligent master station 6 comprises a memory 61, at least one processor 62 and at least one communication bus 63.
It will be appreciated by those skilled in the art that the configuration of the intelligent master station shown in fig. 6 is not limiting of the embodiments of the present application, and that it may be a bus-type configuration or a star-type configuration, and that the intelligent master station 6 may include more or less other hardware or software than that shown, or a different arrangement of components.
It should be noted that the intelligent master station 6 is only an example, and other electronic products that may be present in the present application or may be present in the future are also included in the scope of the present application by way of reference.
In some embodiments, the memory 61 stores a computer program that, when executed by the at least one processor 62, performs all or part of the steps in an industrial communication monitoring method as described above. The Memory 61 includes Read-Only Memory (ROM), programmable Read-Only Memory (Programmable Read-Only Memory, PROM), erasable programmable Read-Only Memory (Erasable Programmable Read-Only Memory, EPROM), one-time programmable Read-Only Memory (OTPROM), electrically erasable rewritable Read-Only Memory (EEPROM), compact disc Read-Only Memory (Compact Disc Read-Only Memory, CD-ROM) or other optical disc Memory, magnetic tape Memory, or any other medium that can be used for carrying or storing data. Further, the computer-readable storage medium 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 for at least one function, and the like; the storage data area may store data created from the use of blockchain nodes, and the like. The blockchain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, encryption algorithm and the like. The blockchain (Blockchain), essentially a de-centralized database, is a string of data blocks that are generated in association using cryptographic methods, each of which contains information from a batch of network transactions for verifying the validity (anti-counterfeit) of its information and generating the next block. The blockchain may include a blockchain underlying platform, a platform product services layer, an application services layer, and the like.
In some embodiments, the at least one processor 62 is a Control core (Control Unit) of the intelligent master station 6, connects the various components of the entire intelligent master station 6 using various interfaces and lines, and performs various functions and processes of the intelligent master station 6 by running or executing programs or modules stored in the memory 61, and invoking data stored in the memory 61. For example, the at least one processor 62, when executing the computer program stored in the memory, implements all or part of the steps of the industrial communication monitoring method described above in embodiments of the present application; or to implement all or part of the functionality of an industrial communication monitoring device. The at least one processor 62 may be comprised of integrated circuits, such as a single packaged integrated circuit, or may be comprised of multiple integrated circuits packaged with the same or different functionality, including one or more central processing units (Central Processing Unit, CPU), microprocessors, digital processing chips, graphics processors, combinations of various control chips, and the like.
In some embodiments, the at least one communication bus 63 is configured to enable connection communication between the memory 61 and the at least one processor 62, etc. Although not shown, the intelligent master station 6 may also include a power source (e.g., a battery) for powering the various components, preferably the power source is logically connected to the at least one processor 62 via a power management device, such that functions such as charge, discharge, and power consumption management are performed by the power management device. The power supply may also include one or more of any of a direct current or alternating current power supply, recharging device, power failure detection circuit, power converter or inverter, power status indicator, etc. The intelligent master station 6 may further include various sensors, bluetooth modules, wi-Fi modules, etc., which will not be described herein.
The integrated units implemented in the form of software functional modules described above may be stored in a computer readable storage medium. The software functional modules described above are stored in a storage medium that includes instructions for causing an intelligent master station or processor (processor) to perform portions of the methods described in the various embodiments of the application.
In the several embodiments provided by the present application, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is merely a logical function division, and there may be other manners of division when actually implemented.
The modules described as separate components may or may not be physically separate, and components shown as modules may or may not be physical units, may be located in one place, or may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
The above embodiments are not intended to limit the scope of the present application, so: all equivalent changes in structure, shape and principle of the application should be covered in the scope of protection of the application.

Claims (10)

1. An industrial communication monitoring method, comprising:
the intelligent master station establishes communication connection with each slave station in the plurality of slave stations respectively;
The intelligent master station determines a first target slave station of the plurality of slave stations according to the monitoring sequence corresponding to the plurality of slave stations;
When the intelligent master station receives an operation instruction of a user aiming at the first target slave station and a communication bus between the intelligent master station and the plurality of slave stations is idle, the intelligent master station sends a read-write instruction to the first target slave station according to the operation instruction, so that the first target slave station returns corresponding slave station data in a preset communication frame format according to the read-write instruction;
Judging whether the intelligent master station receives the slave station data returned by the first target slave station in a first preset time period;
When the intelligent master station receives the slave station data in the first preset time period, the intelligent master station records the slave station data and visually displays the slave station data;
when the intelligent master station does not receive the slave station data in the first preset time period, the intelligent master station determines that the first target slave station is in error, and visually displays the error code of the first target slave station;
the intelligent master station repeatedly performs the above operations based on the monitoring sequence until the intelligent master station visually displays the slave station data or error codes of each of the plurality of slave stations.
2. The industrial communication monitoring method of claim 1, wherein the intelligent master station establishing a communication connection with each of a plurality of slave stations respectively comprises:
The intelligent master station determines a second target slave station according to the slave station number of each slave station in the plurality of slave stations, wherein the second target slave station is the slave station with the slave station number at the first position in the plurality of slave stations;
The intelligent master station sequentially sends m first instructions to the second target station, wherein m is an integer greater than or equal to 1;
When the intelligent master station sequentially receives m second instructions corresponding to the m first instructions returned by the second target slave station, determining that the intelligent master station and the second target slave station establish communication connection;
And repeatedly executing the operation until the intelligent master station establishes communication connection with each slave station in the plurality of slave stations.
3. The industrial communication monitoring method according to claim 2, wherein when m is greater than 3, the intelligent master station sequentially transmitting m first instructions to the second target slave station comprises:
the intelligent master station sends a first sub-instruction in the m first instructions to the second target station, wherein the first sub-instruction is the first sub-instruction in the m first instructions;
judging whether the intelligent master station receives an instruction corresponding to the first sub-instruction returned by the second target slave station in a second preset time period;
When the intelligent master station is determined to receive an instruction corresponding to the first sub-instruction returned by the second target slave station in the second preset time period, the intelligent master station acquires the slave station information of the second target slave station corresponding to the first sub-instruction and sends a second sub-instruction to the second target slave station, wherein the second sub-instruction is a sub-instruction with the instruction number adjacent to the first sub-instruction in the m first instructions;
Judging whether the intelligent master station receives an instruction corresponding to the second sub-instruction returned by the second target slave station in the second preset time period;
When the fact that the second target slave station receives the command corresponding to the second sub-command is received within the second preset time period is determined, the intelligent master station acquires the slave station information of the second target slave station corresponding to the second sub-command and sends a third sub-command to the second target slave station, wherein the third sub-command is a command with a command number adjacent to the second sub-command in the m first commands, and the command number of the third sub-command is located behind the command number of the second sub-command;
and repeatedly executing the operation until the intelligent master station sends the m first instructions to the second target slave station, and acquiring corresponding slave station information.
4. The industrial communication monitoring method of claim 3, wherein when it is determined that the second target slave station has not received an instruction corresponding to the first sub-instruction within the second preset time period, the method further comprises:
the intelligent master station determines the instruction sending times of sending the first sub-instruction to the second target station at the current moment;
The intelligent master station judges whether the instruction sending times meet a first preset times threshold value or not;
when the instruction sending frequency does not meet the first preset frequency threshold, the intelligent master station continues to send the first sub-instruction to the second target slave station until the instruction sending frequency meets the first preset frequency threshold;
When the instruction sending frequency meets the first preset frequency threshold, the intelligent master station sends the first instruction to a third target slave station, wherein the third target slave station is a slave station with a station number adjacent to the second target slave station in the plurality of slave stations, and the station number of the third target slave station is located behind the station number of the second target slave station.
5. The industrial communication monitoring method according to any one of claims 1 to 4, wherein the preset communication frame format includes: the intelligent master station comprises a start frame, a station number of the intelligent master station, a slave station number, an instruction type, a data length returned by the slave station, data returned by the slave station and a check code, wherein the start frame occupies 1 byte, the master station number occupies 1 byte, the slave station number occupies 1 byte, the instruction type occupies 2 bytes, the data length returned by the slave station occupies 1 byte, the data returned by the slave station occupies X bytes, and the check code occupies 2 bytes, wherein X is determined according to the data returned by the slave station.
6. The industrial communication monitoring method of claim 5, wherein the intelligent master station recording the slave station data and visually displaying the slave station data comprises:
the intelligent master station extracts a check code in the slave station data, and checks the slave station data according to the check code to determine whether the slave station data corresponds to the read-write instruction or not;
When the secondary station data is determined to correspond to the read-write instruction, the intelligent master station records the secondary station data and visually displays the secondary station data;
And when the data of the slave station is not corresponding to the read-write instruction, sending the read-write instruction to the first target slave station again according to the operation instruction until the times of sending the read-write instruction to the first target slave station reach a second preset times threshold.
7. The industrial communication monitoring method of claim 6, further comprising:
determining the data of the secondary stations corresponding to each secondary station in the plurality of secondary stations, and generating a plurality of secondary station data tables according to the secondary station data, wherein one secondary station corresponds to one secondary station data table;
Generating a secondary station configuration book according to the secondary station data tables, and visually displaying the secondary station configuration book according to the secondary station numbers.
8. An industrial communications monitoring device, the device comprising:
The communication connection module is used for respectively establishing communication connection between the intelligent master station and each slave station in the plurality of slave stations;
The determining module is used for determining a first target slave station of the plurality of slave stations according to the monitoring sequence corresponding to the plurality of slave stations by the intelligent master station;
The intelligent master station is used for sending a read-write command to the first target slave station according to the operation command when the intelligent master station receives the operation command of a user aiming at the first target slave station and a communication bus between the intelligent master station and the plurality of slave stations is idle, so that the first target slave station returns corresponding slave station data in a preset communication frame format according to the read-write command;
the judging module is used for judging whether the intelligent master station receives the slave station data returned by the first target slave station in a first preset time period;
the first visualization module is used for recording the slave station data and visually displaying the slave station data when the intelligent master station receives the slave station data in the first preset time period;
The second visualization module is used for determining that the first target slave station is in error when the intelligent master station does not receive the slave station data in the first preset time period, and performing visual display on an error code of the first target slave station;
and the repeated execution module is used for repeatedly executing the operations based on the monitoring sequence by the intelligent master station until the intelligent master station visually displays the slave station data or the error codes of each slave station in the plurality of slave stations.
9. An intelligent primary station comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the industrial communication monitoring method of any one of claims 1 to 7 when the computer program is executed.
10. A computer readable storage medium having stored thereon a computer program, characterized in that the computer program when executed by a processor realizes the steps of the industrial communication monitoring method according to any of claims 1 to 7.
CN202410645070.6A 2024-05-23 2024-05-23 Industrial communication monitoring method and device, intelligent master station and computer storage medium Pending CN118250119A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410645070.6A CN118250119A (en) 2024-05-23 2024-05-23 Industrial communication monitoring method and device, intelligent master station and computer storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410645070.6A CN118250119A (en) 2024-05-23 2024-05-23 Industrial communication monitoring method and device, intelligent master station and computer storage medium

Publications (1)

Publication Number Publication Date
CN118250119A true CN118250119A (en) 2024-06-25

Family

ID=91551255

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410645070.6A Pending CN118250119A (en) 2024-05-23 2024-05-23 Industrial communication monitoring method and device, intelligent master station and computer storage medium

Country Status (1)

Country Link
CN (1) CN118250119A (en)

Similar Documents

Publication Publication Date Title
CN105103061B (en) The method of control and data transmission set, processing unit and the process control for redundancy with dispersion redundancy
CN108304299A (en) Server power-up state monitors system and method, computer storage and equipment
CN107924171B (en) Slave device, control method for slave device, and recording medium
CN112653738A (en) Internet of things network debugging system and method
US20130116801A1 (en) System, method and recording medium for driving a programmable logic controller
CN108363477A (en) Server power-up state monitors system and method, computer storage and equipment
CN106126362B (en) A kind of optical module I2C bus unrest sequential diagnosis method and device
CN108363368A (en) Run method and automated system, the field device and controller of automated system
CN101163039A (en) Apparatus for restoring network information for home network system and method thereof
CN112134946B (en) Elevator Internet of things testing method, device, storage medium, terminal and system
CN108983695A (en) A kind of master-slave switching method and device based on Complex Programmable Logic Devices
CN118250119A (en) Industrial communication monitoring method and device, intelligent master station and computer storage medium
CN108399116A (en) A kind of server power-up state monitoring system and method
US8566630B2 (en) Apparatus, methods and computer program products supporting automatic network identification for power supplies
CN113424116A (en) Setting information generating device, setting information generating method, and control program
CN110162499A (en) A kind of PECI bus switch device, method and system
CN104767995A (en) Method for recording electronic product test data and recording module
EP3920545A1 (en) Wireless communication for industrial automation
CN114740739A (en) Method, device, system and storage medium for intelligent household electrical appliance centralized control
CN115705267A (en) Monitoring acquisition equipment, and main/standby switching method and system based on monitoring acquisition equipment
US20210262727A1 (en) Secure remote access to a reefer control system
CN114201232B (en) Battery management system parameter configuration method, device and system and upper computer
JP6926703B2 (en) Electric energy management system, electric energy monitor recognition program and recording medium
US10447769B2 (en) Enhanced time-series data streams for transmission to mobile devices
KR102302434B1 (en) HMI for enhancing operational reliability and safety of data storage, and power management system therewith

Legal Events

Date Code Title Description
PB01 Publication