Field bus protocol operation state test method and device, electronic equipment and storage medium
Through automated detection planning and target connection mechanism, the problem of low detection efficiency in the prior art is solved, and the communication status between the automated detection controller and the field equipment is realized, which significantly improves the detection efficiency.
Patent Information
- Application Number
- CN202510103200.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-22
- Publication Date
- 2025-05-06
AI Technical Summary
In industrial control scenarios, it is normal to detect whether the communication status between the controller and the field device is based on the field bus protocol. The prior art requires manual connection and detection, resulting in extremely low detection efficiency.
A fieldbus protocol operation status testing method is proposed. By obtaining the detection plan, a target connection between the target controller and the target number of target field devices is established, and the detection plan is executed based on the target connection, and the detection result of the operation status of the target controller based on the target type fieldbus protocol is obtained.
No manual connection is required, which significantly reduces labor consumption, improves detection efficiency, and can automatically detect the communication status between the controller and the field equipment.
Smart Images

Figure CN119945932A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of computer technology, and in particular, relates to a method, device, electronic device and storage medium for testing the operating status of a field bus protocol. Background Art
[0002] In industrial control scenarios, the controller is connected to the field devices through a bus and communicates with the field devices based on different types of fieldbus protocols. Therefore, it is very important to detect whether the communication status between the controller and the field devices based on the fieldbus protocol is normal.
[0003] Generally, to detect whether the communication between a controller and a field device based on the fieldbus protocol is normal, it is necessary to manually connect the controller to the field device and simulate the process of the controller and the field device communicating based on the fieldbus protocol. However, with the increase in field devices and the increasing variety of fieldbus protocols, manual detection consumes a lot of manpower, resulting in extremely low detection efficiency. Summary of the invention
[0004] The present application aims to solve at least one of the technical problems existing in the prior art. To this end, the present application proposes a fieldbus protocol operation status test method, device, electronic device and storage medium to improve the detection efficiency.
[0005] In a first aspect, the present application provides a method for testing a fieldbus protocol operating status, the method comprising:
[0006] Obtaining a detection plan for a target controller; the detection plan includes a target type and a target number of fieldbus protocols to be detected; each field device is connected to the target controller via a relay included in a hardware interface unit, the field device communicates with the target controller based on different types of fieldbus protocols, and the number of field devices is multiple;
[0007] Based on the detection plan, a target connection is established between the target controller and a target number of target field devices; the target field devices communicate with the target controller based on a fieldbus protocol of the target type; the target field devices include at least one of the field devices;
[0008] Based on the target connection, the detection plan is executed to obtain the detection result of the operation status of the target controller based on the field bus protocol of the target type.
[0009] According to the field bus protocol operation status test method of the present application, a target connection between a target controller and a target number of target field devices is established based on the acquired detection plan, and the detection plan is executed based on the target connection to obtain the detection result of the target controller's operation status based on the field bus protocol of the target type. There is no need to manually connect the target controller to the target field devices according to the target number, and then detect the operation status of the target controller based on the field bus protocol of the target type, so as to reduce the manpower consumption in the process of detecting whether the communication status between the controller and the field devices based on the field bus protocol is normal, thereby improving the detection efficiency.
[0010] According to one embodiment of the present application, obtaining a detection plan for a target controller includes:
[0011] Receiving a target input based on a target human-machine interface; the target input carries information of a target type and a target quantity; the target human-machine interface is used to display the types of selectable fieldbus protocols, and the target type includes at least one of the types of selectable fieldbus protocols;
[0012] Based on the target input, obtain the inspection plan.
[0013] According to one embodiment of the present application, the target input also carries information of the target on / off mode and the target on / off times;
[0014] The test plan also includes target on-off mode and target on-off times.
[0015] According to one embodiment of the present application, establishing a target connection between a target controller and a target number of target field devices based on a detection plan includes:
[0016] Based on the inspection plan, determine the target number of target field devices;
[0017] Control the target relay to close so that the target field device is connected to the target controller.
[0018] According to one embodiment of the present application, after executing the detection plan based on the target connection and obtaining the detection result of the running state of the target controller based on the fieldbus protocol of the target type, the method further includes:
[0019] In the case where the detection result is abnormal, the target relay is controlled to be turned off so that the target connection is disconnected.
[0020] According to one embodiment of the present application, obtaining a detection result of an operation state of a target controller based on a fieldbus protocol of a target type includes:
[0021] sending first data to a target controller so that the target controller forwards the first data to a target field device based on a target connection;
[0022] Acquire second data from the target controller; the second data is response data of the target field device corresponding to the first data;
[0023] Based on the second data, a detection result is obtained.
[0024] According to an embodiment of the present application, obtaining a detection result based on the second data includes:
[0025] Based on the second data, a target detection method is executed to obtain a detection result; the target detection method includes at least one of a heartbeat detection method, a resource utilization detection method and a packet capture detection method.
[0026] According to an embodiment of the present application, the second data includes a heartbeat value; based on the second data, executing a target detection method to obtain a detection result includes:
[0027] When the heartbeat value is greater than the first preset value, the detection result is determined to be abnormal, and an abnormal event script is triggered.
[0028] According to an embodiment of the present application, the second data includes a CPU utilization rate and a memory utilization rate; based on the second data, executing a target detection method to obtain a detection result includes:
[0029] When the CPU utilization or the memory utilization is greater than the second preset value, the detection result is determined to be abnormal, and an abnormal event script is triggered.
[0030] In a second aspect, the present application provides a fieldbus protocol operation status test device, the device comprising:
[0031] An acquisition module is used to acquire a detection plan for a target controller; the detection plan includes a target type and a target number of the field bus protocol to be detected; each field device is connected to the target controller via a relay included in a hardware interface unit, the field device communicates with the target controller based on different types of field bus protocols, and the number of field devices is multiple;
[0032] A connection module, for establishing a target connection between a target controller and a target number of target field devices based on a detection plan; the target field devices communicate with the target controller based on a fieldbus protocol of a target type; the target field devices include at least one of the field devices;
[0033] The execution module is used to execute the detection plan based on the target connection and obtain the detection result of the running state of the target controller based on the field bus protocol of the target type.
[0034] According to the field bus protocol operation status test device of the present application, a target connection between a target controller and a target number of target field devices is established based on the acquired detection plan, and the detection plan is executed based on the target connection to obtain the detection result of the operation status of the target controller based on the field bus protocol of the target type. There is no need to manually connect the target controller to the target field devices according to the target number, and then detect the operation status of the target controller based on the field bus protocol of the target type, so as to reduce the manpower consumption in the process of detecting whether the communication status between the controller and the field devices based on the field bus protocol is normal, thereby improving the detection efficiency.
[0035] In a third aspect, the present application provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the field bus protocol operating status test method as described in the first aspect above is implemented.
[0036] In a fourth aspect, the present application provides a non-transitory computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the method for testing the operating status of a field bus protocol as described in the first aspect above is implemented.
[0037] In a fifth aspect, the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the field bus protocol operating status testing method as described in the first aspect above.
[0038] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:
[0040] Figure 1 It is one of the flow charts of the fieldbus protocol operation status testing method provided in the embodiment of the present application;
[0041] Figure 2 This is the second flow chart of the fieldbus protocol operation status testing method provided in the embodiment of the present application;
[0042] Figure 3 is a schematic diagram of the structure of a hardware-in-the-loop test system provided in an embodiment of the present application;
[0043] Figure 4 It is a flowchart of the script operation provided in the embodiment of the present application;
[0044] Figure 5 It is a structural diagram of a fieldbus protocol operating status test device provided in an embodiment of the present application;
[0045] Figure 6 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0046] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.
[0047] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0048] In conjunction with the accompanying drawings, the field bus protocol operation status test method, field bus protocol operation status test device, electronic device and readable storage medium provided in the embodiments of the present application are described in detail below through specific embodiments and their application scenarios.
[0049] The fieldbus protocol operation status test method can be applied to a terminal, and can be specifically executed by hardware or software in the terminal.
[0050] The terminal includes, but is not limited to, a portable communication device such as a mobile phone or tablet computer with a touch-sensitive surface (e.g., a touch screen display and / or a touch pad). It should also be understood that in some embodiments, the terminal may not be a portable communication device, but a desktop computer with a touch-sensitive surface (e.g., a touch screen display and / or a touch pad).
[0051] In the following various embodiments, a terminal including a display and a touch-sensitive surface is described. However, it should be understood that the terminal may include one or more other physical user interface devices such as a physical keyboard, a mouse and a joystick.
[0052] The field bus protocol operation status test method provided in the embodiment of the present application may be executed by an electronic device or a functional module or functional entity in the electronic device that can implement the field bus protocol operation status test method. The electronic devices mentioned in the embodiment of the present application include but are not limited to mobile phones, tablet computers, computers, cameras and wearable devices, etc. The field bus protocol operation status test method provided in the embodiment of the present application is described below using the electronic device as an example of the execution subject.
[0053] like Figure 1 As shown, the field bus protocol operation status testing method includes: step 110, step 120 and step 130.
[0054] Step 110, obtaining a detection plan for the target controller; the detection plan includes the target type and target number of the field bus protocol to be detected; each field device is connected to the target controller via a relay included in a hardware interface unit, and the field device communicates with the target controller based on different types of field bus protocols, and the number of field devices is multiple.
[0055] In actual execution, the detection plan input by the target user can be obtained through the target terminal device. The target terminal device can be any theoretically feasible device such as a mobile phone, a computer, a tablet computer, etc., and this application does not make specific limitations on this.
[0056] In actual implementation, the target controller can be connected to multiple field devices through a hardware interface unit, which includes multiple relays, each relay is connected to the target controller and a field device, and each field device communicates with the target controller based on a field bus protocol.
[0057] In actual implementation, the types of fieldbus protocols may include but are not limited to ModbusTCP, ModbusRTU, EtherCAT, Profinet, S7, CANopen, etc. Obtain the target type and target quantity included in the detection plan for the target controller, for example, the target type included in the detection plan for the target controller is ModbusTCP and ModbusRTU, and the target quantity is 1.
[0058] In actual implementation, the detection plan may also include a target on-off mode and a target on-off number.
[0059] Step 120: Based on the detection plan, establish a target connection between the target controller and a target number of target field devices; the target field devices communicate with the target controller based on a fieldbus protocol of the target type; the target field devices include at least one of the field devices.
[0060] In some embodiments, the fieldbus protocol operating status test method can be executed in a hardware-in-the-loop test system, which includes a target terminal device, a target controller, a plurality of fieldbuses that execute different types of fieldbus protocols, and field devices corresponding to each fieldbus protocol. The target terminal device may include a hardware control unit and a monitoring and analysis unit. After obtaining the detection plan, the target terminal device can establish a target connection between the target controller and the target field device that communicates with the target controller based on the fieldbus protocol of the target type through the hardware control unit according to the target quantity based on the detection plan.
[0061] In some embodiments, the target field device includes at least one of the field devices. In some embodiments, the target field device may be one of a plurality of field devices connected to the target controller via a hardware interface unit, or may be a plurality of a plurality of field devices connected to the target controller via a hardware interface unit.
[0062] In some embodiments, the hardware control unit can run based on a hardware control script. After obtaining the detection plan, the target quantity and target type in the detection plan can be used as input parameters of the hardware control script, so that the hardware control unit can establish a target connection between the target controller and the target field device that communicates with the target controller through a field bus protocol based on the target type based on the hardware control script and according to the target quantity.
[0063] Step 130: Based on the target connection, execute the detection plan to obtain the detection result of the target controller's operating status based on the fieldbus protocol of the target type.
[0064] In actual execution, after establishing the target connection between the target controller and the target number of target field devices, the communication interaction between the target controller and the target field devices can be performed based on the field bus protocol of the target type in the detection plan to detect the operating status of the target controller based on the field bus protocol of the target type.
[0065] In some embodiments, the target terminal device may include a hardware control unit and a monitoring and analysis unit. After acquiring a detection plan and establishing a target connection between a target controller and a target field device that communicates with the target controller based on a field bus protocol of a target type through a hardware control unit according to a target quantity based on the detection plan, the target terminal device may, through the monitoring and analysis unit, instruct the target controller based on the detection plan to send detection request data for detecting a communication status to the target field device based on the field bus protocol of the target type, receive response data of the target field device to the detection request data, and determine a detection result of the operating status of the target controller based on the field bus protocol of the target type based on the response data.
[0066] In actual execution, the monitoring and analysis unit can run based on the detection script. After the target connection is established, the monitoring and analysis unit can instruct the target controller to send detection request data for detecting the communication status to the target field device based on the field bus protocol of the target type, receive response data of the target field device to the detection request data, and determine the detection result of the running status of the target controller based on the field bus protocol of the target type based on the response data.
[0067] In some embodiments, when the target controller detects that the operating status of the fieldbus protocol based on the target type is abnormal, the target connection between the target controller and the target field device is disconnected to terminate the communication between the target controller and the target field device.
[0068] In actual execution, when the target controller detects that the running state of the field bus protocol based on the target type is abnormal, the target connection between the target controller and the target field device may be disconnected by the hardware control unit.
[0069] According to the field bus protocol operation status test method of the embodiment of the present application, a target connection between a target controller and a target number of target field devices is established based on the acquired detection plan, and the detection plan is executed based on the target connection to obtain the detection result of the operation status of the target controller based on the field bus protocol of the target type. There is no need to manually connect the target controller to the target field devices according to the target number, and then detect the operation status of the target controller based on the field bus protocol of the target type, so as to reduce the manpower consumption in the process of detecting whether the communication status between the controller and the field devices based on the field bus protocol is normal, thereby improving the detection efficiency.
[0070] In some embodiments, a target input based on a target human-machine interface can be received; the target input carries information on the target type and the target quantity; the target human-machine interface is used to display the types of available fieldbus protocols, and the target type includes at least one of the available fieldbus protocol types; based on the target input, a detection plan is obtained.
[0071] In some embodiments, the monitoring and analysis unit mentioned above may obtain a detection plan based on target input.
[0072] In actual implementation, the target human-machine interface can be displayed by the visualization device (such as a display, etc.) of the target terminal device mentioned above. The target human-machine interface may include target components such as buttons, input boxes, and drop-down menus. The user may perform target input based on the target components in the target human-machine interface to input information carrying the target type and target quantity.
[0073] In some embodiments, the user can click the target button component on the target human-machine interface to trigger the event script to call the "!OpenSubWnd(VM1 combination, 200, 80, 518, 327, 1)" function to display the types of fieldbus protocols available for selection, the addresses and available quantities of field devices that execute each fieldbus protocol, and the selection component for the fieldbus protocol on the target human-machine interface. The user can enter the target type based on the selection component for the fieldbus protocol, for example, the user clicks the selection component for the fieldbus protocol ModbusRTU to enter the target type information ModbusRTU, and enters 2 in the quantity input box to enter the target quantity information to enter the target.
[0074] According to the field bus protocol operation status test method of the embodiment of the present application, a target input based on a target human-machine interface is received; the target input carries information of a target type and a target quantity; based on the target input, a detection plan is obtained, and based on the obtained detection plan, a target connection between a target controller and a target quantity of target field devices is established, and the detection plan is executed based on the target connection to obtain a detection result of the operation status of the field bus protocol of the target controller based on the target type, without manually connecting the target controller to the target field devices according to the target quantity, and then detecting the operation status of the field bus protocol of the target controller based on the target type, so as to reduce the manpower consumption in the process of detecting whether the communication status based on the field bus protocol between the controller and the field devices is normal.
[0075] In some embodiments, the target input may also carry information of a target on-off mode and a target on-off number; the detection plan may also include a target on-off mode and a target on-off number.
[0076] In actual execution, the target on-off mode may include the on-off cycle and whether it is a step-by-step on-off cycle. The on-off cycle may include the duration of the target connection being connected and the duration of the disconnection being disconnected. When the step-by-step on-off mode is selected, the step interval may be entered to achieve that after the connection and disconnection of the target connection in one cycle is established, the duration of the connection and disconnection of the target connection in the next cycle will be based on the last executed cycle plus the step interval. For example, if the step interval of the target input is 2 minutes and the on-off cycle is 5 minutes, then the cycle of the first target connection is 5 minutes and the cycle of the second target connection is 7 minutes.
[0077] In some embodiments, the detection plan can be obtained by receiving information on target type, target quantity, address information of target field equipment, target on-off mode and target on-off times carried by target input based on the target human-machine interface.
[0078] In actual execution, the target type in the detection plan can be obtained based on the target type information carried by the target input, the target number in the detection plan can be obtained based on the target quantity information carried by the target input, and the target on-off mode and target on-off number of times in the detection plan can be obtained based on the target on-off mode and target on-off number of times carried by the target input.
[0079] In some embodiments, a target number of target field devices may be determined based on the detection plan; and the target relays may be controlled to be closed so that the target field devices are connected to the target controller.
[0080] In actual implementation, in addition to the target terminal device, the target controller, several fieldbuses executing different types of fieldbus protocols, and field devices corresponding to each fieldbus protocol, the hardware-in-the-loop test system also includes several relays, each of which is used to connect a field device corresponding to a type of fieldbus protocol to the target controller. For each relay, when the relay is closed, the target controller and the field device connected at both ends of the relay are connected, and conversely, when the relay is closed, the target controller and the field device connected at both ends of the relay are disconnected.
[0081] In actual execution, based on the target type in the detection plan, it can be determined to close the target relay between the target controller and the target field device that executes the field bus protocol of the target type. Based on the target quantity in the detection plan, the target number of target relays can be closed to achieve the target connection between the target number of target field devices that execute the field bus protocol of the target type and the target controller.
[0082] In actual implementation, the target quantity may be less than or equal to the total number of target field devices corresponding to the field bus protocol executing the target type.
[0083] In some embodiments, when there are 2 field buses executing Profinet and field devices corresponding to Profinet, 2 field buses executing ModbusRTU and field devices corresponding to ModbusRTU, the target type in the detection plan is ModbusRTU, and the target quantity is 2, then the field devices corresponding to the 2 field buses executing ModbusRTU are determined as target field devices, and the target relay between the field devices corresponding to the 2 field buses executing ModbusRTU and the target controller is closed to connect the target field device to the target controller.
[0084] In some embodiments, when there are 2 field buses executing Profinet and field devices corresponding to Profinet, 2 field buses executing ModbusRTU and field devices corresponding to ModbusRTU, and the device addresses of the 2 field devices corresponding to the field buses executing Profinet are 20001 and 20002 respectively, the target type in the detection plan is Profinet, the target quantity is 1, and the address of the target field device is 20002, then the field device corresponding to the field bus executing Profinet with address 20002 is determined as the target field device, and the target relay between the field device corresponding to the field bus executing Profinet with address 20002 and the target controller is closed to connect the target field device to the target controller.
[0085] In some embodiments, after obtaining the detection plan, the target terminal device can, based on the detection plan, close the target relay between the target controller and the target field device that communicates with the target controller based on a field bus protocol of the target type through a hardware control unit according to the target number and the address of the target field device, so as to establish a target connection between the target controller and the target field device that communicates with the target controller based on a field bus protocol of the target type.
[0086] In some embodiments, the hardware control unit can run based on a hardware control script (such as a MaVIEW script). After obtaining the detection plan, the target quantity, the address of the target field device and the target type in the detection plan can be used as input parameters of the hardware control script, so that the hardware control unit can close the target relay between the target controller and the target field device that communicates with the target controller based on the field bus protocol of the target type based on the hardware control script according to the target quantity and the address of the target field device, so as to establish a target connection between the target controller and the target field device that communicates with the target controller based on the field bus protocol of the target type.
[0087] According to the field bus protocol operation status test method of the embodiment of the present application, a target number of target field devices is determined based on the acquired detection plan; the target relay is controlled to be closed so that the target field device is connected to the target controller, and the detection plan is executed based on the target connection to obtain the detection result of the operation status of the target controller based on the field bus protocol of the target type. There is no need to manually connect the target controller to the target field device according to the target number, and then detect the operation status of the target controller based on the field bus protocol of the target type, so as to reduce the manpower consumption in the process of detecting whether the status of communication between the controller and the field device based on the field bus protocol is normal, thereby improving the detection efficiency of detecting whether the status of communication between the controller and the field device based on the field bus protocol is normal.
[0088] In some embodiments, after executing a detection plan based on a target connection and obtaining a detection result of the target controller's operating status based on the fieldbus protocol of the target type, if the detection result is abnormal, the target relay can be controlled to disconnect to disconnect the target connection.
[0089] In some embodiments, when it is detected that the operating status of the target controller based on the field bus protocol of the target type is abnormal, the target relay between the target field device and the target controller can be disconnected based on the address of the target field device corresponding to the field bus protocol of the target type, so as to disconnect the target connection between the target field device and the target controller.
[0090] In some embodiments, after detecting that the operating status of the target controller based on the field bus protocol of the target type is abnormal, the target terminal device can disconnect the target relay between the target field device and the target controller based on the address of the target field device corresponding to the field bus protocol of the target type through the hardware control unit, so as to disconnect the target connection between the target field device and the target controller.
[0091] In some embodiments, after the monitoring and analysis unit in the target terminal device detects that the operating status of the target controller based on the field bus protocol of the target type is abnormal, the monitoring and analysis unit can send an abnormal feedback signal to the hardware control unit based on the OPCUA protocol to instruct the hardware control unit to disconnect the target connection between the target field device and the target controller.
[0092] In some embodiments, the hardware control unit can run based on a hardware control script (e.g., a MaVIEW script). After detecting that the operating status of the target controller based on the field bus protocol of the target type is abnormal, the address of the target field device corresponding to the field bus protocol of the target type can be used as an input parameter of the hardware control script, so that the hardware control unit can disconnect the target relay between the target field device and the target controller based on the hardware control script and the address of the target field device corresponding to the field bus protocol of the target type, so as to disconnect the target connection between the target field device and the target controller.
[0093] In some embodiments, when it is detected that the operating status of the target controller based on the field bus protocol of the target type is abnormal, the target terminal device can display abnormal information that the operating status of the target controller based on the field bus protocol of the target type is abnormal in a visual interface through the monitoring and analysis unit.
[0094] According to the field bus protocol operation status test method of an embodiment of the present application, when the detection result is abnormal, the target connection is disconnected by controlling the target relay to terminate the communication between the target controller and the target field device based on the field bus protocol of the target type, so as to prevent the occurrence of abnormal problems.
[0095] In some embodiments, based on the target connection, first data can be sent to the target controller so that the target controller forwards the first data to the target field device; second data is obtained from the target controller; the second data is data corresponding to the response of the target field device to the first data; and the detection result is obtained based on the second data.
[0096] In actual execution, the first data may be request data for requesting to detect whether the communication between the target controller and the target field device based on the field bus protocol of the target type is normal. The second data may include data corresponding to the response of the target field device to the first data, and the second data may be used to feedback the communication status between the target controller and the target field device based on the field bus protocol of the target type.
[0097] In some embodiments, the second data may include at least one of heartbeat data, resource utilization data, and packet capture data of the target field device after receiving the first data, and the resource utilization data may include CPU utilization and memory utilization.
[0098] In some embodiments, after establishing a target connection between the target controller and the target field device, the detection and analysis unit in the target terminal device can send first data to the target controller based on a detection script (such as an HMI script or a main loop script), so that the target controller forwards the first data to the target field device through the target connection, and receives second data fed back by the target field device in response to the first data.
[0099] In some embodiments, the monitoring and analysis unit can use the target on-off mode in the detection plan as an input parameter of the detection script, so that the monitoring and analysis unit can control the target controller to send first data to the target field device based on the detection script according to the on-off cycle and step interval in the target on-off mode, and obtain second data from the target field device according to the on-off cycle and step interval in the target on-off mode.
[0100] According to the field bus protocol operation status test method of the embodiment of the present application, a target connection between a target controller and a target number of target field devices is established based on the acquired detection plan, and the detection plan is executed based on the target connection. Based on the target connection, first data is sent to the target controller so that the target controller forwards the first data to the target field device; second data is obtained from the target controller; the second data is data corresponding to the response of the target field device to the first data; based on the second data, the detection result is obtained, without manually connecting the target controller to the target field devices according to the target number, and then detecting the operation status of the field bus protocol of the target controller based on the target type, so as to reduce the manpower consumption in the process of detecting whether the status of communication between the controller and the field devices based on the field bus protocol is normal.
[0101] In some embodiments, a target detection method can be executed based on the second data to obtain a detection result; the target detection method includes at least one of a heartbeat detection method, a resource utilization detection method, and a packet capture detection method.
[0102] In actual execution, the detection script may include an anomaly detection script. After the monitoring and analysis unit receives the second data, the anomaly detection script executes the target detection method based on the second data to obtain the detection result.
[0103] In some embodiments, the second data may include a heartbeat value; when the heartbeat value is greater than a first preset value, the detection result may be determined to be abnormal, and an abnormal event script may be triggered.
[0104] In some embodiments, the second data may include the heartbeat value of the target field device after receiving the first data. The monitoring and analysis unit may call the !SetDevice() function in the abnormal detection script, execute the heartbeat detection method according to the heartbeat value, and calculate the heartbeat fluctuation range, heartbeat average value, etc. through the heartbeat value to obtain the detection result. In some embodiments, a heartbeat data model may be established based on historical heartbeat data (e.g., heartbeat data of 10 historical cycles or heartbeat data of 100 historical cycles). When the heartbeat fluctuation range calculated by the heartbeat value exceeds the standard heartbeat fluctuation range in the heartbeat data model, or the heartbeat average value exceeds the first preset value (e.g., the standard heartbeat average value) in the heartbeat data model, the detection result is determined to be abnormal, and the abnormal event script is triggered.
[0105] In some embodiments, the second data may include CPU utilization and memory utilization; when the CPU utilization or the memory utilization is greater than a second preset value, the detection result is determined to be abnormal and an abnormal event script is triggered.
[0106] In some embodiments, the monitoring and analysis unit may call an anomaly detection script to detect CPU utilization data and memory utilization data to obtain a detection result. In some embodiments, when the CPU utilization data is greater than a second preset value (e.g., a preset CPU utilization) or the memory utilization data is greater than a second preset value (e.g., a preset memory utilization), the detection result is determined to be abnormal.
[0107] In some embodiments, the abnormal event script in the trigger event script generates a detection report and stores it in a database by calling the abnormal function "HscDate01.SaveData()". The server corresponding to the target terminal device can be accessed through the PC and app to obtain the detection report from the database.
[0108] In some embodiments, the second data may include a target message sent by a target field device based on a target field bus protocol and received by the target controller, and the target message may be obtained by a packet capture tool preinstalled on the target controller. The monitoring and analysis unit may detect the target message through an abnormality detection script to obtain a detection result. In some embodiments, when an abnormality is detected in the target message, the detection result is determined to be abnormal.
[0109] According to the field bus protocol operation status test method of the embodiment of the present application, a target detection method is executed based on the second data to obtain a detection result. There is no need for manual connection between the target controller and the target field device according to the target quantity, and then the operation status of the field bus protocol of the target controller based on the target type is detected, so as to reduce the manpower consumption in the process of detecting whether the status of communication between the controller and the field device based on the field bus protocol is normal.
[0110] In order to better understand the field bus protocol operating status testing method provided in the embodiment of the present application, further explanation is given below. It should be understood that the discussion below is only exemplary.
[0111] The present application provides a method for testing the operation status of a fieldbus protocol. The specific steps can be as follows: Figure 2 As shown:
[0112] Step 210: Receive target input based on the target human-machine interface; and obtain a detection plan based on the target input.
[0113] In some embodiments, the fieldbus protocol operation status test method can be executed in a hardware-in-the-loop test system, which includes a target terminal device, a target controller, several fieldbuses that execute different types of fieldbus protocols, and field devices corresponding to each fieldbus protocol. Among them, a monitoring and analysis unit and a hardware control unit are run on the target terminal device, the target terminal device can be connected to the cloud server through IoT (Internet of Things), the monitoring and analysis unit running on the target terminal device can be connected to the target controller through ModbusTCP driver, and the communication between the monitoring and analysis unit and the hardware control unit can be realized by OPCUA driver.
[0114] In some embodiments, Figure 3 As shown, the hardware-in-the-loop test system includes 16 buses running different fieldbus protocols, each bus is connected to a field device that supports the fieldbus protocol running on the bus, wherein the 1st to 6th buses run the EtherCAT protocol, the 7th to 8th buses run the ModbusRTU protocol, the 9th to 10th and the 13th to 14th buses run the ModbusTCP protocol, and the 11th to 12th and the 15th to 16th buses run the Profinet protocol. The hardware-in-the-loop test system also includes a hardware interface unit, and the hardware includes 16 relays, each relay connecting the target controller to a bus.
[0115] In actual execution, the target human-machine interface can be displayed through a visualization device (such as a display, etc.) of the target terminal device. The target human-machine interface may include target components such as buttons, input boxes, and drop-down menus. The user may perform target input based on the target components in the target human-machine interface to input information carrying target type, target quantity, target on / off mode, and target on / off times.
[0116] In some embodiments, the user can click the target button component on the target human-machine interface to trigger the event script to call the "!OpenSubWnd(VM1 combination, 200, 80, 518, 327, 1)" function to display the types of available fieldbus protocols, the addresses and available quantities of field devices that execute each fieldbus protocol, and the selection component for the fieldbus protocol in the form of a window on the target human-machine interface. The user can enter the target type based on the selection component for the fieldbus protocol. For example, the user clicks the selection component for the fieldbus protocol ModbusRTU to enter the target type information ModbusRTU, and enters 2 in the quantity input box to enter the target quantity information to enter the target. When the user is testing the compatibility and performance of different fieldbus protocols, the user can select a combination of different fieldbus protocols on the target human-machine interface to test the compatibility and performance of different fieldbus protocols, thereby obtaining more accurate test results.
[0117] In some embodiments, the monitoring and analysis unit can obtain a detection plan based on the target input. For example, the target input includes the target types Profinet, EtherCAT, ModbusRTU and ModbusTCP, the target quantity is 1, the address information of the target field device is the address corresponding to the 1st, 7th, 9th and 15th roads, the on-off cycle in the target on-off cycle is 5 seconds, and the target on-off number is 20 times. The detection plan determined by the monitoring and analysis unit is that the target controller is NewPre3102 including Profinet, EtherCAT, ModbusRTU and ModbusTCP interfaces, and based on the detection plan, the field device servo driver corresponding to the 1st road, the field device IO card or stepper driver corresponding to the 7th road, the field device IO card corresponding to the 9th road and the field device IO card corresponding to the 15th road are detected.
[0118] Step 220: Determine a target number of target field devices based on the detection plan; and control the target relays to close so that the target field devices are connected to the target controller.
[0119] In some embodiments, after obtaining the detection plan, the monitoring and analysis unit sends the detection plan to the hardware control unit. The hardware control unit determines to close the target relay between the target controller and the target field device that executes the field bus protocol of the target type based on the target type in the detection plan. The target number of target relays can be closed based on the target quantity in the detection plan to achieve the target connection between the target number of target field devices that execute the field bus protocol of the target type and the target controller.
[0120] In some embodiments, when the detection plan includes the address information of the target field devices corresponding to the 1st, 7th, 9th and 15th buses, the target on-off cycle is 5 seconds and the target on-off times is 100 times, the hardware control unit controls the target relays corresponding to the 1st, 7th, 9th and 15th buses based on the hardware control script (such as a MaVIEW script), and switches on and off 100 times with a cycle of 5 seconds to establish a target connection between the target field devices corresponding to the 1st, 7th, 9th and 15th buses and the target controller.
[0121] Step 230: Based on the target connection, send first data to the target controller so that the target controller forwards the first data to the target field device; obtain second data from the target controller; the second data is response data of the target field device corresponding to the first data.
[0122] In actual execution, the monitoring and analysis unit can send first data to the target controller based on the detection script and obtain second data from the target controller to detect the communication status between the target controller and the target field device based on the target field bus protocol. The first data and the second data can be ModbusTCP protocol data packets.
[0123] In some embodiments, the monitoring and analysis unit can obtain second data from the target controller based on the detection script, with the target on-off cycle in the detection plan as the collection frequency. The second data may include heartbeat data, resource utilization data and packet capture data of the target field device after receiving the first data. The resource utilization data may include CPU utilization and memory utilization.
[0124] Step 240: Execute a target detection method based on the second data to obtain a detection result.
[0125] In actual execution, the detection script may include an anomaly detection script. After the monitoring and analysis unit receives the second data, the anomaly detection script executes the target detection method based on the second data to obtain the detection result.
[0126] In some embodiments, the second data may include the heartbeat data, resource utilization data and packet capture data of the target field device after receiving the first data. The monitoring and analysis unit may call the !SetDevice() function in the abnormal detection script, execute the heartbeat detection method according to the heartbeat data, and calculate the heartbeat fluctuation range, heartbeat average value, etc. through the heartbeat data to obtain the detection result. In some embodiments, a heartbeat data model may be established based on historical heartbeat data (e.g., heartbeat data of 10 historical cycles or heartbeat data of 100 historical cycles). When the heartbeat fluctuation range calculated by the heartbeat data exceeds the standard heartbeat fluctuation range in the heartbeat data model, or the heartbeat average value exceeds the standard heartbeat average value in the heartbeat data model, the detection result is determined to be abnormal. For example, the monitoring and analysis unit calls the !SetDevice(device 0,6,"Read(0,10,BT00=Heart)") function in the abnormal detection script, reads the heartbeat data with the address of 10 in zone 0, and determines that the detection result is abnormal when the heartbeat data indicates that no heartbeat fluctuation is detected for 2S.
[0127] In some embodiments, the resource utilization data may include CPU utilization data and memory utilization data, and the monitoring and analysis unit may call an anomaly detection script to detect the CPU utilization data and the memory utilization data to obtain a detection result. In some embodiments, when the CPU utilization data is greater than a preset CPU utilization or the memory utilization data is greater than a preset memory utilization, the detection result is determined to be abnormal.
[0128] In some embodiments, the second data may include a target message sent by a target field device based on a target field bus protocol and received by the target controller, and the target message may be obtained by a packet capture tool preinstalled on the target controller. The monitoring and analysis unit may detect the target message through an abnormality detection script to obtain a detection result. In some embodiments, when an abnormality is detected in the target message, the detection result is determined to be abnormal.
[0129] In some embodiments, when the target message of the second data includes a Modbus TCP message, it is detected whether the function code field in the Modbus TCP message used to indicate the operation type of this communication is legal. For example, the target controller only uses function codes 03 and 06 to read and write holding registers. If a value that does not belong to the standard function code list or a function code that does not match the current communication scenario (for example, a function code other than function codes 03 and 06) appears, it can be determined that the function code is illegal, and then the detection result is determined to be abnormal.
[0130] In some embodiments, when the target message of the second data includes an EtherCAT message, the cycle time of the captured EtherCAT message is monitored. If the cycle time does not meet the target on-off cycle set in the detection plan (for example, the cycle is extended or shortened), it indicates that there are network problems, insufficient processing power of the target controller, or target field bus protocol execution errors, and the detection result is determined to be abnormal.
[0131] Step 250: When the detection result is abnormal, control the target relay to be disconnected to disconnect the target connection.
[0132] In actual execution, after controlling the target relay to close so that the target field device is connected to the target controller, the monitoring and analysis unit may send a normal feedback signal (e.g., an abnormal feedback signal with a value of 1) to the hardware control unit. When the monitoring and analysis unit in the target terminal device detects that the operating state of the target controller based on the fieldbus protocol of the target type is abnormal, the monitoring and analysis unit may send an abnormal feedback signal (e.g., an abnormal feedback signal with a value of 0) to the hardware control unit based on the OPC UA protocol to instruct the hardware control unit to disconnect the target connection between the target field device and the target controller.
[0133] In some embodiments, the hardware control unit can display abnormal information through a visual display device of the target terminal device. In some embodiments, the hardware control unit can display the detection report and issue warning information (such as sound, scroll bar, pop-up window, etc.) to prompt abnormal conditions through a display interface. Among them, the detection report can also be output in the form of a file to facilitate further analysis and archiving, providing a strong basis for subsequent target controller optimization and troubleshooting.
[0134] In some embodiments, the abnormal feedback signal can also be used to trigger the abnormal event script in the event script. By calling the abnormal function "HscDate01.SaveData()" to generate a detection report and store it in a database, the server corresponding to the target terminal device can be accessed through the PC and app to obtain the detection report from the database, so that developers can further analyze and solve problems based on the detection report.
[0135] In some embodiments, the target terminal device can run MaVIEW software, and the detection script and hardware control script mentioned above can be scripts written based on MaVIEW software. Figure 4As shown, the detection plan selected by the user can be obtained through the event script, and the detection plan includes the information of the target field device. The second data sent by the target field device to the target controller can be obtained based on the detection plan through the detection script (such as the main loop script), and based on the second data, the abnormality detection of the communication state between the target controller and the target field device based on the target field bus protocol can be performed. The detection results of the abnormal detection can also be uploaded to the historical database through the event script, so that the cloud device can access the historical database through IoT and obtain the historical detection results.
[0136] The embodiment of the present application also provides a field bus protocol operation status testing device.
[0137] like Figure 5 As shown, the fieldbus protocol operation status testing device 500 includes: an acquisition module 510 , a connection module 520 and an execution module 530 .
[0138] The acquisition module 510 is used to acquire a detection plan for the target controller; the detection plan includes the target type and target number of the field bus protocol to be detected; each field device is connected to the target controller through a relay included in a hardware interface unit, the field device communicates with the target controller based on different types of field bus protocols, and the number of field devices is multiple;
[0139] A connection module 520 is used to establish a target connection between a target controller and a target number of target field devices based on the detection plan; the target field devices communicate with the target controller based on a fieldbus protocol of a target type; the target field devices include at least one of the field devices;
[0140] The execution module 530 is used to execute the detection plan based on the target connection and obtain the detection result of the operation status of the target controller based on the field bus protocol of the target type.
[0141] According to the field bus protocol operation status test device of the present application, a target connection between a target controller and a target number of target field devices is established based on the acquired detection plan, and the detection plan is executed based on the target connection to obtain the detection result of the operation status of the target controller based on the field bus protocol of the target type. There is no need to manually connect the target controller to the target field devices according to the target number, and then detect the operation status of the target controller based on the field bus protocol of the target type, so as to reduce the manpower consumption in the process of detecting whether the communication status between the controller and the field devices based on the field bus protocol is normal.
[0142] In some embodiments, the acquisition module 510 includes:
[0143] A receiving unit, configured to receive a target input based on a target human-machine interface; the target input carries information on a target type and a target quantity; the target human-machine interface is configured to display the types of selectable fieldbus protocols, the target type including at least one of the selectable fieldbus protocol types;
[0144] The first acquisition unit is used to acquire a detection plan based on a target input.
[0145] In some embodiments, the target input also carries information of a target on-off mode and a target on-off number; the detection plan also includes a target on-off mode and a target on-off number.
[0146] In some embodiments, the connection module 520 includes:
[0147] a determination unit, configured to determine a target number of target field devices based on a detection plan;
[0148] The connection unit is used to control the target relay to close so that the target field device is connected to the target controller.
[0149] In some embodiments, the fieldbus protocol operation status testing device 500 further includes a disconnection module, which is used to control the target relay to disconnect so as to disconnect the target connection when the detection result is abnormal.
[0150] In some embodiments, the execution module 530 includes:
[0151] A sending unit, configured to send first data to a target controller, so that the target controller forwards the first data to a target field device based on a target connection;
[0152] A second acquisition unit is used to acquire second data from the target controller; the second data is response data of the target field device corresponding to the first data;
[0153] The third acquisition unit is used to acquire the detection result based on the second data.
[0154] In some embodiments, the third acquisition unit includes an execution subunit, which is used to execute a target detection method based on the second data to obtain a detection result; the target detection method includes at least one of a heartbeat detection method, a resource utilization detection method, and a packet capture detection method.
[0155] In some embodiments, the second data includes a heartbeat value; the execution subunit is specifically used to determine that the detection result is abnormal and trigger an abnormal event script when the heartbeat value is greater than a first preset value.
[0156] In some embodiments, the second data includes CPU utilization and memory utilization; the execution subunit is specifically used to determine that the detection result is abnormal and trigger an abnormal event script when the CPU utilization or the memory utilization is greater than a second preset value.
[0157] The fieldbus protocol running state test device in the embodiment of the present application can be an electronic device, or a component in an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal, or other devices other than a terminal. Exemplary, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a palmtop computer, a vehicle-mounted electronic device, a mobile Internet device (Mobile Internet Device, MID), augmented reality (augmented reality, AR) / virtual reality (virtual reality, VR) equipment, a robot, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant, PDA), etc., and can also be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., and the embodiment of the present application is not specifically limited.
[0158] The field bus protocol operation status test device in the embodiment of the present application can be a device with an operating system. The operating system can be a Microsoft (Windows) operating system, an Android (Android) operating system, an IOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.
[0159] The fieldbus protocol operation status test device 500 provided in the embodiment of the present application can achieve Figures 1 to 3 To avoid repetition, the various processes implemented by the method embodiment are not described here.
[0160] In some embodiments, Figure 6 As shown, an embodiment of the present application also provides an electronic device 600, including a processor 601, a memory 602, and a computer program stored in the memory 602 and executable on the processor 601. When the program is executed by the processor 601, each process of the above-mentioned field bus protocol operation status test method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0161] It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and non-mobile electronic devices mentioned above.
[0162] An embodiment of the present application also provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the various processes of the above-mentioned field bus protocol operation status test method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0163] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.
[0164] An embodiment of the present application also provides a computer program product, including a computer program, which implements the above-mentioned field bus protocol operation status testing method when executed by a processor.
[0165] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.
[0166] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned field bus protocol operation status test method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0167] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.
[0168] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.
[0169] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0170] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
[0171] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "illustrative embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials, or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0172] Although the embodiments of the present application have been shown and described, those skilled in the art will appreciate that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present application, and that the scope of the present application is defined by the claims and their equivalents.
Claims
1. A method for testing the running status of a fieldbus protocol, characterized in that: include: Obtaining a detection plan for a target controller; the detection plan includes a target type and a target quantity of a fieldbus protocol to be detected; Each field device is connected to the target controller via a relay included in a hardware interface unit, each field device communicates with the target controller based on different types of field bus protocols, and there are multiple field devices; establishing target connections between the target controller and the target number of target field devices based on the detection plan; The target field device communicates with the target controller based on a fieldbus protocol of the target type; Based on the target connection, the detection plan is executed to obtain a detection result of the operating status of the target controller based on the field bus protocol of the target type.
2. The fieldbus protocol operating status testing method according to claim 1, characterized in that: The obtaining of a detection plan for the target controller includes: Receiving a target input based on a target human-machine interface; the target input carries information of the target type and the target quantity; the target human-machine interface is used to display the types of selectable fieldbus protocols, and the target type includes at least one of the types of selectable fieldbus protocols; Based on the target input, the inspection plan is obtained.
3. The fieldbus protocol operating status testing method according to claim 2, characterized in that: The target input also carries information on the target on / off mode and the target on / off times; The detection plan also includes the target on-off mode and the target on-off times.
4. The fieldbus protocol operating status testing method according to claim 1, characterized in that: The step of establishing a target connection between the target controller and the target number of target field devices based on the detection plan includes: Based on the detection plan, determining the target number of target field devices; The target relay is controlled to be closed so that the target field device is connected to the target controller.
5. The fieldbus protocol operating status testing method according to claim 4, characterized in that: After executing the detection plan based on the target connection and obtaining the detection result of the running state of the target controller based on the field bus protocol of the target type, the method further includes: When the detection result is abnormal, the target relay is controlled to be turned off so that the target connection is disconnected.
6. The fieldbus protocol operating status testing method according to any one of claims 1 to 5, characterized in that: Acquiring a detection result of the target controller based on the running state of the field bus protocol of the target type, comprising: sending first data to the target controller so that the target controller forwards the first data to the target field device based on the target connection; Acquire the second data from the target controller; the second data is response data corresponding to the first data by the target field device; Based on the second data, the detection result is obtained.
7. The fieldbus protocol operating status testing method according to claim 6, characterized in that: The acquiring the detection result based on the second data includes: Based on the second data, a target detection method is executed to obtain the detection result; the target detection method includes at least one of a heartbeat detection method, a resource utilization detection method and a packet capture detection method.
8. The fieldbus protocol operating status testing method according to claim 7, characterized in that: The second data includes a heartbeat value; and executing the target detection method based on the second data to obtain the detection result includes: When the heartbeat value is greater than a first preset value, the detection result is determined to be abnormal, and an abnormal event script is triggered.
9. The fieldbus protocol operating status testing method according to claim 7, characterized in that: The second data includes CPU utilization and memory utilization; The executing the target detection method based on the second data to obtain the detection result includes: When the CPU utilization or the memory utilization is greater than a second preset value, the detection result is determined to be abnormal, and an abnormal event script is triggered.
10. A fieldbus protocol operation status test device, characterized in that: include: An acquisition module, used to acquire a detection plan for a target controller; the detection plan includes a target type and a target quantity of a fieldbus protocol to be detected; Each field device is connected to the target controller via a relay included in a hardware interface unit, the field device communicates with the target controller based on different types of field bus protocols, and there are multiple field devices; a connection module, configured to establish target connections between the target controller and the target number of target field devices based on the detection plan; The target field device communicates with the target controller based on a fieldbus protocol of the target type; The target field device includes at least one of the field devices; An execution module is used to execute the detection plan based on the target connection and obtain a detection result of the operating state of the target controller based on the field bus protocol of the target type.