Device status detection method, device, electronic device and storage medium

By analyzing the type and destination address of the reference data packet, judging the device status and stopping the sending of invalid data, the problem of excessive network resources occupied when the equipment is disconnected in the building automation system is solved, and communication efficiency is improved.

CN118827459BActive Publication Date: 2024-12-06WUXI YANQI INTELLIGENT TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411311901.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-20
Publication Date
2024-12-06
Estimated Expiration
2044-09-20

AI Technical Summary

Technical Problem

In the building automation system, it is impossible to determine whether the communication equipment is in a disconnected state, resulting in the equipment still sending valid and invalid data to the disconnected equipment, resulting in excessive network resources occupied and affecting communication efficiency.

Method used

By obtaining the reference data packet, determine the packet type and destination address, and determine the operating status of the device. If the device does not reply, it is determined to be a disconnected state, stop sending the requested data packet, sending the instruction data packet until the device returns to online .

Benefits of technology

It effectively avoids the waste of network resources caused by the inability to determine the status of the device, improves the communication efficiency between devices, and ensures the accuracy and efficiency of data transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118827459B_ABST
    Figure CN118827459B_ABST
Patent Text Reader

Abstract

The present invention discloses a device status detection method, apparatus, electronic device and storage medium. The method comprises: obtaining a reference data packet, the reference data packet is data transmitted from a first reference device to a second reference device; the reference data packet comprises at least a first destination address; the first destination address is the address of the second device; determining the data packet type of the reference data packet, the data packet type is determined according to the data type of the reference data packet, and the data type is determined by the execution function of the data; determining the operating state of the second reference device according to the data packet type and the first destination address of the reference data packet, the operating state comprises an online state and an offline state. The technical solution of this embodiment solves the problem of too much network resource occupation due to the inability to determine whether the communication device is in an offline state and still sending valid data and invalid data to the communication device, thereby improving the communication efficiency between devices.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of communication technology, and in particular to a device state detection method, device, electronic device and storage medium. Background Art

[0002] Building automation plays an important role in modern buildings. In order to be compatible with different devices and different systems, Bacnet is one of the most widely used communication protocols in building automation scenarios. MSTP communication is a communication standard requirement based on RS485 hardware in the bacnet protocol.

[0003] The communication between devices includes valid data and invalid data. The corresponding request command for data transmission belongs to the valid data expenditure. The token (MSTP token) and poll (Poll for master) transmitted and received between devices are invalid data. Because valid data and invalid data are transmitted between devices in real time, it does not matter whether the device is offline. This will cause too much data throughput on the line between devices, resulting in the occupation of network resources and greatly affecting communication efficiency. Summary of the invention

[0004] The present invention provides a device status detection method, apparatus, electronic device and storage medium to solve the problem of excessive network resource usage caused by sending valid data and invalid data to a communication device because it is impossible to determine whether the communication device is in a disconnected state, thereby improving the communication efficiency between devices.

[0005] According to one aspect of the present invention, a device status detection method is provided, which is applied to a main controller associated with a target object, the main controller is associated with a preset number of reference devices, the main controller is used to receive data packets communicated between the reference devices and send data packets to the reference devices, the method comprising:

[0006] Acquire a reference data packet, wherein the reference data packet is data transmitted from a first reference device to a second reference device; the reference data packet at least includes a first destination address; the first destination address is an address of the second device; the first reference device includes a preset number of reference devices associated with the main controller, and the second reference device includes the main controller and a preset number of reference devices associated with the main controller;

[0007] Determine a data packet type of the reference data packet, wherein the data packet type is determined according to a data type of the reference data packet, wherein the data type is determined by an execution function of the data;

[0008] The operating state of the second reference device is determined according to the data packet type of the reference data packet and the first destination address; the data packet type and the first destination address are associated with the operating state of the second reference device, and the operating state includes an online state and an offline state.

[0009] Optionally, determining the data packet type of the reference data packet includes:

[0010] If the data in the reference data packet is data of a request for preset data initiated by the first reference device to the second reference device, the data packet type of the reference data packet is a request type;

[0011] If the data in the reference data packet is data sent by the first reference device to the second reference device in response to request-type data, the data packet type of the reference data packet is a reply type; the request-type data is sent by the second reference device to the first reference device;

[0012] If the data in the reference data packet is data of a token sent by the first reference device to the second reference device, the data packet type of the reference data packet is a command type.

[0013] Optionally, determining the operating state of the second reference device according to the data packet type of the reference data packet and the first destination address includes:

[0014] If the data packet type of the reference data packet is a request type, and the device corresponding to the first destination address is not the main controller, determining whether the second reference device sends a reply type data packet for the reference data packet to the first reference device;

[0015] If the second reference device sends a reply data packet to the first reference device for the reference data packet, it is determined that the second reference device is in an online state;

[0016] If the second reference device does not send a reply data packet to the first reference device in response to the reference data packet, it is determined that the second reference device is in an offline state.

[0017] Optionally, determining the operating state of the second reference device according to the data packet type of the reference data packet and the first destination address includes:

[0018] If the data packet type of the reference data packet is a reply type, it is determined that the second reference device is in an online state.

[0019] Optionally, determining the operating state of the second reference device according to the data packet type of the reference data packet and the first destination address includes:

[0020] If the data packet type of the reference data packet is a command type, and the first destination address is not the address of the main controller, in response to the instruction of the first reference device to send a token to the second reference device, receiving a query command sent by the first reference device, and setting the second reference device to a query state;

[0021] Determine whether a candidate data packet is received within a preset time, the candidate data packet being a reply data packet for a query command sent by the second reference device to the main controller;

[0022] If the candidate data packet is received within a preset time, determining that the second reference device is in an online state;

[0023] If the candidate data packet is not received within a preset time, it is determined that the second reference device is in an offline state.

[0024] Optionally, after determining that the second reference device is in an offline state, the method further includes:

[0025] Stop sending the first data packet to the second reference device, and send the second data packet normally. If a data packet is received from the second reference device in response to the second data packet, it is determined that the second reference device has recovered to an online state. The first data packet is a request type data packet, and the second data packet is an instruction type data packet.

[0026] Optionally, the method further comprises:

[0027] A target data packet is sent to a target reference device. If the target reference device does not feedback a data packet in response to the target data packet, it is determined that the target reference device is in an offline state. The target reference device is one of a preset number of reference devices associated with the main controller, and the target data packet is used to describe the request data or token sent by the main controller to the target reference device.

[0028] According to another aspect of the present invention, there is provided a device state detection apparatus, which is applied to a main controller associated with a target object, wherein the main controller is associated with a preset number of reference devices, and the main controller is used to receive data packets communicated between the reference devices and send data packets to the reference devices, wherein the apparatus comprises:

[0029] A data acquisition module is used to acquire a reference data packet, wherein the reference data packet is data transmitted from a first reference device to a second reference device; the reference data packet at least includes a first destination address; the first destination address is an address of a second device; the first reference device includes a preset number of reference devices associated with the main controller, and the second reference device includes the main controller and a preset number of reference devices associated with the main controller;

[0030] A data packet type determination module, used to determine the data packet type of the reference data packet, wherein the data packet type is determined according to the data type of the reference data packet, and the data type is determined by the execution function of the data;

[0031] A status determination module is used to determine the operating status of the second reference device based on the data packet type of the reference data packet and the first destination address; the data packet type and the first destination address are associated with the operating status of the second reference device, and the operating status includes an online status and an offline status.

[0032] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0033] at least one processor; and,

[0034] a memory communicatively connected to the at least one processor; wherein,

[0035] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the device status detection method described in any embodiment of the present invention.

[0036] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the device status detection method described in any embodiment of the present invention when executed.

[0037] The technical solution of the embodiment of the present invention obtains a reference data packet, which is data transmitted from a first reference device to a second reference device, and the reference data packet includes at least a first destination address, which is the address of the second device; that is, the reference data packet is obtained in order to accurately know that it is the first reference device that transmits the reference data packet back to the main controller and that the reference data packet includes at least the first destination address, so as to facilitate subsequent device status analysis; further, the data type is determined by analyzing the data execution function of the reference data packet, thereby accurately determining the data packet type of the reference data packet according to the data type; finally, because the data packet type and the first destination address are associated with the operating status of the second reference device, it is determined whether the second reference device is online or offline according to the data packet type and the first destination address of the reference data packet, thereby solving the problem of too much network resources being occupied due to the inability to determine whether the communication device is offline and still sending valid data and invalid data to the communication device, thereby improving the communication efficiency between devices.

[0038] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0040] Figure 1 The present invention provides a flow chart of a device status detection method according to an embodiment of the present invention.

[0041] Figure 2 It is a topological diagram of equipment in a building to which the embodiment of the present invention is applicable.

[0042] Figure 3 is a flow chart of another device status detection method provided according to an embodiment of the present invention.

[0043] Figure 4 It is a structural schematic diagram of a device status detection apparatus provided according to an embodiment of the present invention.

[0044] Figure 5 It is a structural schematic diagram of an electronic device implementing a device status detection method according to an embodiment of the present invention. DETAILED DESCRIPTION

[0045] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0046] It should be noted that the terms "first", "second", "reference" and "target" in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices. Embodiment 1

[0047] Figure 1 A flow chart of a device status detection method provided in an embodiment of the present invention. This embodiment can be applicable to the case of detecting the status of a device based on MSTP communication. The method can be executed by a device status detection device. The device status detection device can be implemented in the form of hardware and / or software. The device status detection device can be configured in any electronic device with a network communication function.

[0048] like Figure 1 As shown, the device status detection method of the present invention includes the following process:

[0049] S110. Obtain a reference data packet, where the reference data packet is data transmitted from a first reference device to a second reference device; the reference data packet includes at least a first destination address; the first destination address is the address of the second device; the first reference device includes a preset number of reference devices associated with a main controller, and the second reference device includes the main controller and a preset number of reference devices associated with the main controller.

[0050] The device status detection method of the present invention is applied to a main controller associated with a target object. The main controller is associated with a preset number of reference devices. The main controller is used to receive data packets communicated between the reference devices and send data packets to the reference devices.

[0051] For example, Figure 2The relationship between the main controller and the reference device is shown. Each reference device has a corresponding unique MAC address, which can be any value between 0 and 127. The main controller is associated with a preset number of reference devices, which does not exceed 128. This ensures that the MAC address of each reference device is unique, and a reference device list is set in the main controller. The reference device list includes the MAC address of each reference device, and is arranged from small to large according to the size of the MAC address of the reference device.

[0052] The main controller of this embodiment sends a token to a preset reference device. After receiving the token, the preset reference device passes the token to the next reference device, and continues to pass the token in sequence until the last reference device passes the token back to the main controller, completing a round of polling. During the token passing process, the token is passed according to the address size of each reference device, and is passed first to reference devices that are larger than the preset reference device and adjacent to the preset reference device.

[0053] For example, Figure 2 , the main controller associates lighting equipment, air conditioning equipment, sensor equipment, electric meter equipment and controller. The addresses of lighting equipment, air conditioning equipment, sensor equipment, electric meter equipment and controller are a, b, c, d and e respectively, and a<b<c<d<e, that is, the order of the reference device list set in the main controller is lighting equipment a, air conditioning equipment b, sensor equipment c, electric meter equipment d and controller e; the preset reference device is generally the reference device with the smallest address among the reference devices. The main controller transfers tokens starting from the preset reference device, and the reference devices transfer tokens from small to large according to the addresses of the reference devices, such as Figure 2 , the preset reference device is the lighting device. The main controller first passes the token to the lighting device, then the lighting device passes the token to the air conditioning device, the air conditioning device passes the token to the sensor device, the sensor device passes the token to the meter device, the meter device passes the token to the controller, and the controller returns the token to the main controller so that the main controller can start the next token transfer. The data packet of the token transfer between devices will also inform the main controller so that the main controller knows the current token transfer location. For example, when the air conditioning device passes the token to the sensor device, the air conditioning device will also pass the information of the air conditioning device passing the token to the sensor device to the main controller in the form of a data packet.

[0054] In this embodiment, in addition to passing the token, the main controller also sends request data to each reference device to obtain the operating data of each reference device. For example, the main controller sends a temperature request to the air-conditioning device to obtain the room temperature, and the air-conditioning device will reply to the main controller with relevant data packets in response to the temperature request.

[0055] The reference devices of this embodiment will also send request data to each other to request the other party's device operation related data. For example, the air conditioning device sends the first data packet of the first request data to the sensor device, and the sensor device returns a reply data packet to the air conditioning device in response to the first request data. The transmission of the data packet between the devices will also be returned to the main controller, and the data packet is returned to the main controller by the initiating reference device. For example, the air conditioning device sends the first data packet of the first request data to the sensor device, and the first data packet will be transmitted from the air conditioning device to the main controller; the sensor device returns a reply data packet to the air conditioning device in response to the first request data, and the sensor device will also transmit a copy of the reply data packet to the main controller.

[0056] Based on the above description, the master controller of this embodiment obtains a reference data packet, which includes data packets returned by each reference device to the master controller. One type is that the master controller itself initiates a request to the reference device, so the reference device will reply to the master controller and pass the corresponding reference data packet to the master controller. Because the reference data packet is the data passed from the first reference device to the second reference device, the second reference device is the master controller at this time. One type is the reference data packet passed between reference devices, and a copy of the reference data packet will also be passed to the master controller, but the first reference device and the second reference device in the reference data packet are both reference devices.

[0057] S120. Determine a data packet type of the reference data packet, where the data packet type is determined according to a data type of the reference data packet, where the data type is determined by an execution function of the data.

[0058] Specifically, the reference data packet is data transmitted from the first reference device to the second reference device, and different execution functions have a first preset correspondence with data types, and different data types have a second preset correspondence with data packet types. Furthermore, the functions executed by the data in different reference data packets are different, so the data in the reference data packet is analyzed, and the data type of the reference data packet is determined according to the analysis result and the first preset correspondence, and the data packet type of the reference data packet is determined according to the data type of the reference data packet and the second preset correspondence. The first preset correspondence and the second preset correspondence are set according to actual application requirements.

[0059] S130. Determine the operating state of the second reference device according to the data packet type and the first destination address of the reference data packet; the data packet type and the first destination address are associated with the operating state of the second reference device, and the operating state includes an online state and an offline state.

[0060] Specifically, the reference data packet is data transmitted from the first reference device to the second reference device. Since the first reference device can transmit data to the second reference device, the first reference device must be online. It is further necessary to determine the operating status of the second reference device.

[0061] Through the first destination address, it can be clearly known what device the second reference device is and whether it is the main controller. If it is the main controller, the second reference device must be online. If it is not the main controller, it is necessary to make further judgment based on the data packet type of the reference data packet. Different data packet types have a preset association with the status of the reference device. Therefore, the operating status of the second reference device can be accurately determined based on the preset association and the data packet type of the reference data packet, so that after it is determined that the second reference device is offline, the first data packet is stopped from being sent to the second reference device, and the second data packet is sent normally. Furthermore, if a data packet is received from the second reference device in response to the second data packet, it is determined that the second reference device has resumed its online status; the first data packet is a request-type data packet, and the second data packet is an instruction-type data packet.

[0062] Optionally, the device status detection method of the present invention further includes: the main controller sends a target data packet to the target reference device, and if the target reference device does not feedback a data packet for the target data packet, it is determined that the target reference device is in an offline state; the target reference device is one of a preset number of reference devices associated with the main controller, and the target data packet is used to describe the request data or token sent by the main controller to the target reference device. The request data can be data related to the operating parameters of the target reference device requested by the main controller to the target reference device.

[0063] For example, the main controller sends a token to the air-conditioning device, but the air-conditioning device does not respond within the preset time, indicating that the air-conditioning device is in an offline state; the main controller sends temperature request data to the air-conditioning device, but the air-conditioning device does not respond within the preset time, indicating that the air-conditioning device is in an offline state.

[0064] The technical solution of the embodiment of the present invention obtains a reference data packet, which is data transmitted from a first reference device to a second reference device, and the reference data packet includes at least a first destination address, which is the address of the second device; that is, the reference data packet is obtained in order to accurately know that it is the first reference device that transmits the reference data packet back to the main controller and that the reference data packet includes at least the first destination address, so as to facilitate subsequent device status analysis; further, the data type is determined by analyzing the data execution function of the reference data packet, thereby accurately determining the data packet type of the reference data packet according to the data type; finally, because the data packet type and the first destination address are associated with the operating status of the second reference device, it is determined whether the second reference device is online or offline according to the data packet type and the first destination address of the reference data packet, thereby solving the problem of too much network resources being occupied due to the inability to determine whether the communication device is offline and still sending valid data and invalid data to the communication device, thereby improving the communication efficiency between devices. Embodiment 2

[0065] Figure 3 A flowchart of another device status detection method provided in an embodiment of the present invention. The technical solution of this embodiment further optimizes the processes S120 and S130 in the aforementioned embodiment on the basis of the aforementioned embodiment. This embodiment can be combined with various optional solutions in one or more of the aforementioned embodiments.

[0066] like Figure 3 As shown, the device status detection method of the present invention includes the following process:

[0067] S210. Obtain a reference data packet, which is data transmitted from a first reference device to a second reference device; the reference data packet includes at least a first destination address; the first destination address is the address of the second device; the first reference device includes a preset number of reference devices associated with a main controller, and the second reference device includes a main controller and a preset number of reference devices associated with the main controller.

[0068] S220. If the data in the reference data packet is data of a request for preset data initiated by the first reference device to the second reference device, the data packet type of the reference data packet is a request type, and the operating status of the second reference device is further determined based on the data packet type of the reference data packet and the first destination address.

[0069] The preset data may be valid data related to the operation of the device.

[0070] Specifically, if the packet type of the reference data packet is a request type, and the device corresponding to the first destination address is not the main controller, determine whether the second reference device sends a reply data packet for the reference data packet to the first reference device; if the second reference device sends a reply data packet for the reference data packet to the first reference device within a preset time, it means that the second reference device can respond, and then determine that the second reference device is online; if the second reference device does not send a reply data packet for the reference data packet to the first reference device within the preset time, it means that the second reference device cannot respond, and then determine that the second reference device is offline.

[0071] Furthermore, after determining that the second reference device is in an offline state, the main controller and other reference devices associated with the main controller stop sending the first data packet to the second reference device, but send the second data packet normally. If a data packet is received from the second reference device in response to the second data packet, it is determined that the second reference device has resumed its online state; the first data packet is a request type data packet, and the second data packet is an instruction type data packet.

[0072] S230. If the data in the reference data packet is data sent by the first reference device to the second reference device in response to request-type data, the data packet type of the reference data packet is a reply type. Further, based on the data packet type of the reference data packet and the first destination address, the operating status of the second reference device is determined, and the request-type data is sent by the second reference device to the first reference device.

[0073] Specifically, if the data packet type of the reference data packet is reply type, and the request type data is sent by the second reference device to the first reference device, which means that the second reference device can respond, then it is determined that the second reference device is online.

[0074] S240. If the data in the reference data packet is data of a token sent by the first reference device to the second reference device, the data packet type of the reference data packet is a command type, and the operating status of the second reference device is further determined based on the data packet type of the reference data packet and the first destination address.

[0075] Specifically, if the data packet type of the reference data packet is a command type, and the first destination address is not the address of the master controller, in response to the instruction of the first reference device to send a token to the second reference device, the query command sent by the first reference device is received, and the second reference device is set to a query state; it is determined whether a candidate data packet is received within a preset time, and the candidate data packet is a reply-type data packet for the query command sent by the second reference device to the master controller; if the candidate data packet is received within the preset time, it means that the second reference device can respond, and the second reference device is determined to be in an online state; if the candidate data packet is not received within the preset time, it means that the second reference device cannot respond, and the second reference device is determined to be in an offline state. For example, the query command can be a poll for master command.

[0076] Furthermore, after determining that the second reference device is in an offline state, the main controller and other reference devices associated with the main controller stop sending the first data packet to the second reference device, and send the second data packet normally. If a data packet is received from the second reference device in response to the second data packet, it is determined that the second reference device has resumed its online state; the first data packet is a request type data packet, and the second data packet is an instruction type data packet.

[0077] The technical solution of this embodiment obtains a reference data packet, which is data transmitted from a first reference device to a second reference device; the reference data packet includes at least a first destination address; the first destination address is the address of the second device; the first reference device includes a preset number of reference devices associated with a main controller, and the second reference device includes a main controller and a preset number of reference devices associated with the main controller. Further, by determining whether the data packet type of the reference data packet is a request type, a reply type, or a command type, the operating state of the second reference device is further determined according to the data packet type of the reference data packet and the first destination address, thereby solving the problem of too much network resource usage caused by sending valid data and invalid data to the communication device because it is impossible to determine whether the communication device is in a disconnected state, thereby improving the communication efficiency between devices. Embodiment 3

[0078] Figure 4 A schematic diagram of the structure of a device status detection device provided in an embodiment of the present invention. This embodiment can be applied to the case of detecting the status of a device based on MSTP communication. The device status detection device can be implemented in the form of hardware and / or software. The device status detection device can be configured in any electronic device with a network communication function.

[0079] like Figure 4As shown, the device state detection device of the present invention is applied to a main controller associated with a target object, the main controller is associated with a preset number of reference devices, the main controller is used to receive data packets communicated between reference devices and send data packets to the reference devices, and the device includes:

[0080] The data acquisition module 310 is used to acquire a reference data packet, wherein the reference data packet is data transmitted from the first reference device to the second reference device; the reference data packet at least includes a first destination address; the first destination address is the address of the second device; the first reference device includes a preset number of reference devices associated with the main controller, and the second reference device includes the main controller and a preset number of reference devices associated with the main controller;

[0081] A data packet type determination module 320, configured to determine a data packet type of the reference data packet, wherein the data packet type is determined according to a data type of the reference data packet, wherein the data type is determined by an execution function of the data;

[0082] The status determination module 330 is used to determine the operating status of the second reference device based on the data packet type of the reference data packet and the first destination address; the data packet type and the first destination address are associated with the operating status of the second reference device, and the operating status includes an online status and an offline status.

[0083] Based on the above embodiment, optionally, the data packet type determination module is used to:

[0084] If the data in the reference data packet is data of a request for preset data initiated by the first reference device to the second reference device, the data packet type of the reference data packet is a request type;

[0085] If the data in the reference data packet is data sent by the first reference device to the second reference device in response to request-type data, the data packet type of the reference data packet is a reply type; the request-type data is sent by the second reference device to the first reference device;

[0086] If the data in the reference data packet is data of a token sent by the first reference device to the second reference device, the data packet type of the reference data packet is a command type.

[0087] Based on the above embodiment, optionally, the state determination module includes a first state determination unit, and the first state determination unit is used to:

[0088] If the data packet type of the reference data packet is a request type, and the device corresponding to the first destination address is not the main controller, determining whether the second reference device sends a reply type data packet for the reference data packet to the first reference device;

[0089] If the second reference device sends a reply data packet to the first reference device for the reference data packet, it is determined that the second reference device is in an online state;

[0090] If the second reference device does not send a reply data packet to the first reference device in response to the reference data packet, it is determined that the second reference device is in an offline state.

[0091] On the basis of the above embodiment, optionally, the state determination module includes a second state determination unit, and the second state determination unit is used to: if the data packet type of the reference data packet is a reply type, determine that the second reference device is in an online state.

[0092] Based on the above embodiment, optionally, the state determination module includes a third state determination unit, and the third state determination unit is used to:

[0093] If the data packet type of the reference data packet is a command type, and the first destination address is not the address of the main controller, in response to the instruction of the first reference device to send a token to the second reference device, receiving a query command sent by the first reference device, and setting the second reference device to a query state;

[0094] Determine whether a candidate data packet is received within a preset time, the candidate data packet being a reply data packet for a query command sent by the second reference device to the main controller;

[0095] If the candidate data packet is received within a preset time, determining that the second reference device is in an online state;

[0096] If the candidate data packet is not received within a preset time, it is determined that the second reference device is in an offline state.

[0097] Based on the above embodiment, optionally, the status determination module also includes an execution unit, which is used to: stop sending the first data packet to the second reference device, and send the second data packet normally, and if a data packet is received from the second reference device in response to the second data packet, it is determined that the second reference device has recovered to an online state; the first data packet is a request type data packet, and the second data packet is an instruction type data packet.

[0098] On the basis of the above embodiment, optionally, the device status detection device also includes a judgment module, which is used to: send a target data packet to a target reference device, and if the target reference device does not feedback a data packet for the target data packet, determine that the target reference device is in an offline state; the target reference device is one of a preset number of reference devices associated with the main controller, and the target data packet is used to describe the request data or token sent by the main controller to the target reference device.

[0099] The device state detection apparatus provided in the embodiment of the present invention can execute the device state detection method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method. Embodiment 4

[0100] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.

[0101] Figure 5 A schematic diagram of the structure of an electronic device that can be used to implement the device state detection method of an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0102] like Figure 5 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. The input / output (I / O) interface 15 is also connected to the bus 14.

[0103] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0104] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as a device status detection method.

[0105] In some embodiments, the device state detection method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the device state detection method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the device state detection method in any other appropriate manner (e.g., by means of firmware).

[0106] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0107] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0108] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, device, or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0109] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0110] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0111] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0112] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0113] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A device status detection method, characterized in that: A main controller applied to target object association, the main controller is associated with a preset number of reference devices, the main controller is used to receive data packets communicated between reference devices and send data packets to the reference devices, the method comprising: Acquire a reference data packet, the reference data packet being data transmitted from a first reference device to a second reference device; the reference data packet at least comprising a first destination address; the first destination address being an address of the second reference device; the first reference device comprising a preset number of reference devices associated with the main controller, and the second reference device comprising the main controller and a preset number of reference devices associated with the main controller; Determine a data packet type of the reference data packet, wherein the data packet type is determined according to a data type of the reference data packet, wherein the data type is determined by an execution function of the data; Determine the operating state of the second reference device according to the data packet type of the reference data packet and the first destination address; the data packet type and the first destination address are associated with the operating state of the second reference device, the operating state includes an online state and an offline state, and the operating state is a state of the reference device based on MSTP communication; Wherein, determining the data packet type of the reference data packet includes: If the data in the reference data packet is data for requesting preset data initiated by the first reference device to the second reference device, the data packet type of the reference data packet is a request type; wherein the preset data is data related to device operation; If the data in the reference data packet is data sent by the first reference device to the second reference device in response to request-type data, the data packet type of the reference data packet is a reply type; the request-type data is sent by the second reference device to the first reference device; If the data in the reference data packet is data of a token sent by the first reference device to the second reference device, the data packet type of the reference data packet is a command type.

2. The method according to claim 1, characterized in that: Determining the operating state of the second reference device according to the data packet type of the reference data packet and the first destination address includes: If the data packet type of the reference data packet is a request type, and the device corresponding to the first destination address is not the main controller, determining whether the second reference device sends a reply type data packet for the reference data packet to the first reference device; If the second reference device sends a reply data packet to the first reference device for the reference data packet, it is determined that the second reference device is in an online state; If the second reference device does not send a reply data packet to the first reference device in response to the reference data packet, it is determined that the second reference device is in an offline state.

3. The method according to claim 1, characterized in that Determining the operating state of the second reference device according to the data packet type of the reference data packet and the first destination address includes: If the data packet type of the reference data packet is a reply type, it is determined that the second reference device is in an online state.

4. The method according to claim 1, characterized in that: Determining the operating state of the second reference device according to the data packet type of the reference data packet and the first destination address includes: If the data packet type of the reference data packet is a command type, and the first destination address is not the address of the main controller, in response to the instruction of the first reference device to send a token to the second reference device, receiving a query command sent by the first reference device, and setting the second reference device to a query state; Determine whether a candidate data packet is received within a preset time, the candidate data packet being a reply data packet for a query command sent by the second reference device to the main controller; If the candidate data packet is received within a preset time, determining that the second reference device is in an online state; If the candidate data packet is not received within a preset time, it is determined that the second reference device is in an offline state.

5. The method according to claim 2 or 4, characterized in that: After determining that the second reference device is in an offline state, the method further includes: Stop sending the first data packet to the second reference device, and send the second data packet normally. If a data packet is received from the second reference device in response to the second data packet, it is determined that the second reference device has recovered to an online state. The first data packet is a request type data packet, and the second data packet is an instruction type data packet.

6. The method according to claim 1, characterized in that The method further comprises: A target data packet is sent to a target reference device. If the target reference device does not feedback a data packet in response to the target data packet, it is determined that the target reference device is in an offline state. The target reference device is one of a preset number of reference devices associated with the main controller, and the target data packet is used to describe the request data or token sent by the main controller to the target reference device.

7. A device status detection device, characterized in that: A main controller applied to target object association, the main controller is associated with a preset number of reference devices, the main controller is used to receive data packets communicated between reference devices and send data packets to the reference devices, the device includes: A data acquisition module is used to acquire a reference data packet, wherein the reference data packet is data transmitted from a first reference device to a second reference device; the reference data packet at least includes a first destination address; the first destination address is an address of a second device; the first reference device includes a preset number of reference devices associated with the main controller, and the second reference device includes the main controller and a preset number of reference devices associated with the main controller; A data packet type determination module, used to determine the data packet type of the reference data packet, wherein the data packet type is determined according to the data type of the reference data packet, and the data type is determined by the execution function of the data; a state determination module, configured to determine an operating state of the second reference device according to a data packet type of the reference data packet and the first destination address; the data packet type and the first destination address are associated with an operating state of the second reference device, the operating state includes an online state and an offline state, and the operating state is a state of the reference device based on MSTP communication; Among them, the data packet type determination module is used to: if the data in the reference data packet is data for requesting preset data initiated by the first reference device to the second reference device, then the data packet type of the reference data packet is a request type; wherein the preset data is data related to the operation of the device; if the data in the reference data packet is data sent by the first reference device to the second reference device in response to request-type data, then the data packet type of the reference data packet is a reply type; the request-type data is sent by the second reference device to the first reference device; if the data in the reference data packet is data for the first reference device to send a token to the second reference device, then the data packet type of the reference data packet is an instruction type.

8. An electronic device, characterized in that: The electronic device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the device status detection method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the device status detection method according to any one of claims 1 to 6 when executed.