Multi-master network and communication method

文档序号:1939632 发布日期:2021-12-07 浏览:16次 中文

阅读说明:本技术 一种多主网络及一种通信方法 (Multi-master network and communication method ) 是由 吴帅 于 2020-06-01 设计创作,主要内容包括:一种多主网络及一种通信方法。本发明实施例涉及消防技术领域,提供了一种包括管理设备及多个事件处理设备的多主网络;其中,第一事件处理设备用于在检测到事件时,向管理设备和各个第二事件处理设备发送事件对应的目标数据包;管理设备用于在接收到目标数据包时,向第一事件处理设备反馈目标数据包对应的第一应答包,并向各个第二事件处理设备发送目标数据包;每个第二事件处理设备,用于在接收到管理设备发送的目标数据包时,向管理设备反馈目标数据包对应的第二应答包,并对目标数据包进行数据响应;以及,在接收到第一事件处理设备发送的目标数据包时,丢弃目标数据包。与现有技术相比,应用本发明实施例提供的方案,能够降低多主网络发生网络崩溃的风险。(A multi-master network and a communication method. The embodiment of the invention relates to the technical field of fire fighting, and provides a multi-master network comprising a management device and a plurality of event processing devices; the first event processing equipment is used for sending a target data packet corresponding to the event to the management equipment and each second event processing equipment when the event is detected; the management equipment is used for feeding back a first response packet corresponding to the target data packet to the first event processing equipment and sending the target data packet to each second event processing equipment when receiving the target data packet; each second event processing device is used for feeding back a second response packet corresponding to the target data packet to the management device and performing data response on the target data packet when receiving the target data packet sent by the management device; and when receiving the target data packet sent by the first event processing device, discarding the target data packet. Compared with the prior art, the scheme provided by the embodiment of the invention can reduce the risk of network collapse of the multi-master network.)

1. A multi-master network, the multi-master network comprising: a management device and a plurality of event processing devices;

the first event processing equipment is used for sending a target data packet corresponding to the event to the management equipment and each second event processing equipment when the event is detected; wherein the first event processing device is: any one of the plurality of event processing devices; the second event processing device is: a device other than the first event processing device among the plurality of event processing devices;

the management device is configured to, when receiving the target data packet, feed back a first response packet corresponding to the target data packet to the first event processing device, and send the target data packet to each second event processing device;

each second event processing device is used for feeding back a second response packet corresponding to the target data packet to the management device and performing data response on the target data packet when receiving the target data packet sent by the management device; and when the target data packet sent by the first event processing equipment is received, discarding the target data packet.

2. The network of claim 1, wherein the management device is further configured to:

for each second event processing device, when the second response packet fed back by the second event processing device is not received within a preset time length, performing retransmission operation on the target data packet for the second event processing device; after the retransmission operation of the target data packet is executed, when the second response packet fed back by the second event processing equipment is not received within the preset time length, setting the second event processing equipment to be in a communication failure state;

wherein the communication failure state is used for representing that the second event processing equipment has communication failure.

3. The network of claim 2, wherein the management device is further configured to:

before the second event processing device is set to a communication failure state, judging whether the number of times of performing retransmission operations on the target data packet for the second event processing device reaches a preset number of times;

if yes, setting the second event processing equipment to be in a communication failure state;

otherwise, returning to execute the retransmission operation of the target data packet for the second event processing device.

4. The network according to claim 2 or 3, wherein the management device transmits the target packet to each second event processing device, and includes:

for each second event processing device, judging whether the second event processing device is in the communication failure state; and if not, sending the target data packet to the second event processing equipment.

5. The network of claim 1,

when detecting an event, the first event processing device sends a target data packet corresponding to the event to the management device and each second event processing device, including:

when detecting an event, the first event processing device generates a plurality of target data packets for forming a target instruction corresponding to the event, and sequentially sends the plurality of target data packets to the management device and each second event processing device;

each second event processing device performs data response on the target data packet, and the data response includes:

judging whether all target data packets forming the target instruction are received or not;

if yes, all target data packets forming the target instruction are checked;

and after the verification is successful, executing the target instruction and emptying all target data packets forming the target instruction.

6. The network of claim 1, wherein a first queue and a second queue are constructed in the management device, a third queue and a fourth queue are constructed in each event processing device, the first queue and the fourth queue are queues for buffering response packets, and the second queue and the third queue are queues for buffering data packets;

when receiving the target data packet, the management device feeds back a first response packet corresponding to the target data packet to the first event processing device, and sends the target data packet to each second event processing device, including:

when receiving the target data packet, the management device generates a first response packet corresponding to the target data packet, caches the first response packet to the first queue, and caches the target data packet to the second queue; according to a first-in first-out transmission principle, transmitting the first response packet located in the first queue to the first event processing equipment, and transmitting the target data packet located in the second queue to each second event processing equipment;

when detecting an event, the first event processing device sends a target data packet corresponding to the event to the management device and each second event processing device, including:

when detecting an event, the first event processing device generates a target data packet corresponding to the event, and buffers the target data packet to the third queue; according to a first-in first-out sending principle, sending the target data packets positioned in the third queue to the management equipment and each second event processing equipment;

each second event processing device feeds back a second response packet corresponding to the target data packet to the management device, and the method includes:

each second event processing device generates a second response packet corresponding to the target data packet, and caches the second response packet to the fourth queue; and feeding back the second response packet positioned in the fourth queue to the management equipment.

7. A communication method applied to a management device in a multi-master network, the multi-master network comprising: the management device and a plurality of event processing devices; the method comprises the following steps:

receiving a target data packet sent by first event processing equipment, and feeding back a first response packet corresponding to the target data packet to the first event processing equipment; the target data packet is a data packet sent to the management device and each second event processing device by the first event processing device when an event is detected, and the target data packet is discarded by each second event processing device after the target data packet sent by the first event processing device is received;

sending the target data packet to each second event processing device, so that each second event processing device feeds back a second response packet corresponding to the target data packet to the management device when receiving the target data packet, and performs data response on the target data packet;

wherein the first event processing device is: any one of the plurality of event processing devices; the second event processing device is: among the plurality of event processing devices, a device other than the first event processing device.

8. A communication method applied to a first event processing device in a multi-master network, the multi-master network comprising: the management device and a plurality of event processing devices; the first event processing device is any one of the plurality of event processing devices; the method comprises the following steps:

when an event is detected, sending a target data packet corresponding to the event to the management device and each second event processing device, so that the management device feeds back a first response packet corresponding to the target data packet to the first event processing device when receiving the target data packet, and each second event processing device discards the target data packet when receiving the target data packet sent by the first event processing device; the management equipment sends the target data packet to each second event processing equipment, so that each second event processing equipment feeds back a second response packet corresponding to the target data packet to the management equipment when receiving the target data packet sent by the management equipment, and performs data response on the target data packet; the second event processing device is: a device other than the first event processing device among the plurality of event processing devices;

and receiving a first response packet corresponding to the target data packet fed back by the management equipment.

9. A communication method applied to a second event processing device in a multi-master network, the multi-master network comprising: the management device and a plurality of event processing devices; the second event processing device is any one of the plurality of event processing devices; the method comprises the following steps:

receiving a target data packet sent by the management equipment, feeding back a second response packet corresponding to the target data packet to the management equipment, and performing data response on the target data packet; the target data packet is a data packet sent to the management device and the second event processing device by a first event processing device when an event is detected, and the management device feeds back a first response packet corresponding to the target data packet to the first event processing device when receiving the target data packet sent by the first event processing device; the first event processing device is: any device of the plurality of event processing devices except the second event processing device;

and receiving the target data packet sent by the first event processing equipment, and discarding the target data packet sent by the first event processing equipment.

10. A communication apparatus, wherein the communication apparatus is applied to a management device in a multi-master network, and wherein the multi-master network comprises: the management device and a plurality of event processing devices; the device comprises:

the first communication module is used for receiving a target data packet sent by first event processing equipment and feeding back a first response packet corresponding to the target data packet to the first event processing equipment; the target data packet is a data packet sent to the management device and each second event processing device by the first event processing device when an event is detected, and the target data packet is discarded by each second event processing device after the target data packet sent by the first event processing device is received;

the second communication module is used for sending the target data packet to each second event processing device, so that each second event processing device feeds back a second response packet corresponding to the target data packet to the management device when receiving the target data packet, and performs data response on the target data packet;

wherein the first event processing device is: any one of the plurality of event processing devices; the second event processing device is: among the plurality of event processing devices, a device other than the first event processing device.

11. A communication apparatus, applied to a first event processing device in a multi-master network, the multi-master network comprising: the management device and a plurality of event processing devices; the first event processing device is any one of the plurality of event processing devices; the device comprises:

a first sending module, configured to send, when an event is detected, a target data packet corresponding to the event to the management device and each of the second event processing devices, so that the management device feeds back, to the first event processing device, a first response packet corresponding to the target data packet when receiving the target data packet, and each of the second event processing devices discards the target data packet when receiving the target data packet sent by the first event processing device; the management equipment sends the target data packet to each second event processing equipment, so that each second event processing equipment feeds back a second response packet corresponding to the target data packet to the management equipment when receiving the target data packet sent by the management equipment, and performs data response on the target data packet; the second event processing device is: a device other than the first event processing device among the plurality of event processing devices; the second event processing device is: a device other than the first event processing device among the plurality of event processing devices;

and the first receiving module is used for receiving a first response packet corresponding to the target data packet fed back by the management device.

12. A communication apparatus, applied to a second event processing device in a multi-master network, the multi-master network comprising: the management device and a plurality of event processing devices; the second event processing device is any one of the plurality of event processing devices; the device comprises:

the second receiving module is used for receiving a target data packet sent by the management equipment, feeding back a second response packet corresponding to the target data packet to the management equipment, and performing data response on the target data packet; the target data packet is a data packet sent to the management device and the second event processing device by a first event processing device when an event is detected, and the management device feeds back a first response packet corresponding to the target data packet to the first event processing device when receiving the target data packet sent by the first event processing device; the first event processing device is: any device of the plurality of event processing devices except the second event processing device;

a third receiving module, configured to receive the target data packet sent by the first event processing device, and discard the target data packet sent by the first event processing device.

13. The management equipment is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor and the communication interface are used for realizing the communication between the processor and the memory through the communication bus;

a memory for storing a computer program;

a processor for implementing the method steps of claim 7 when executing a program stored in the memory.

14. An event processing device is marked as a first event processing device and is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are communicated with each other through the communication bus;

a memory for storing a computer program;

a processor for implementing the method steps of claim 8 when executing a program stored in the memory.

15. The event processing equipment is marked as second event processing equipment and is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are communicated with each other through the communication bus;

a memory for storing a computer program;

a processor for implementing the method steps of claim 9 when executing a program stored in the memory.

Technical Field

The invention relates to the technical field of fire fighting, in particular to a multi-master network and a communication method.

Background

Currently, in order to find out a fire in time to reduce various losses caused by the fire, automatic fire alarm systems are installed in many places, such as shopping malls, schools, office buildings, and the like.

The fire alarm equipment is the core of the automatic fire alarm system. Generally, a plurality of fire alarm devices may be provided in the automatic fire alarm system, and further, in order to improve the real-time performance of the fire alarm system, the plurality of fire alarm devices may form a multi-master network to adopt a multi-master communication scheme.

Wherein, the multi-master network means: the network is composed of a plurality of event processing devices, and the master-slave identities of all the event processing devices in the network are the same, and all the event processing devices can be used as communication initiators to communicate with other event processing devices. For example, in the multi-master network corresponding to the automatic fire alarm system, the event processing devices are multiple fire alarm devices, and each fire alarm device can be used as a communication initiator to communicate with other fire alarm devices.

However, in the communication process of the multi-master network, when there are multiple concurrent events, each event processing device may simultaneously have a large number of data packets that need to be sent to other event processing devices, and thus each event processing device may simultaneously receive a large number of response packets fed back by other event processing devices; accordingly, each event processing device may also receive data packets sent by a large number of other event processing devices at the same time, and need to simultaneously feed back response packets to a large number of other event processing devices. In this way, in the communication process of the multi-master network, if multiple concurrent events exist, a very complex communication relationship may exist in the multi-master network, so that the risk of network breakdown of the multi-master network is greatly increased.

Disclosure of Invention

The embodiment of the invention aims to provide a multi-master network and a communication method so as to reduce the risk of network breakdown of the multi-master network.

The specific technical scheme is as follows:

in a first aspect, an embodiment of the present invention provides a multi-master network, where the multi-master network includes: a management device and a plurality of event processing devices;

the first event processing equipment is used for sending a target data packet corresponding to the event to the management equipment and each second event processing equipment when the event is detected; wherein the first event processing device is: any one of the plurality of event processing devices; the second event processing device is: a device other than the first event processing device among the plurality of event processing devices;

the management device is configured to, when receiving the target data packet, feed back a first response packet corresponding to the target data packet to the first event processing device, and send the target data packet to each second event processing device;

each second event processing device is used for feeding back a second response packet corresponding to the target data packet to the management device and performing data response on the target data packet when receiving the target data packet sent by the management device; and when the target data packet sent by the first event processing equipment is received, discarding the target data packet.

Optionally, in a specific implementation manner, the management device is further configured to:

for each second event processing device, when the second response packet fed back by the second event processing device is not received within a preset time length, performing retransmission operation on the target data packet for the second event processing device; after the retransmission operation of the target data packet is executed, when the second response packet fed back by the second event processing equipment is not received within the preset time length, setting the second event processing equipment to be in a communication failure state;

wherein the communication failure state is used for representing that the second event processing equipment has communication failure.

Optionally, in a specific implementation manner, the management device is further configured to:

before the second event processing device is set to a communication failure state, judging whether the number of times of performing retransmission operations on the target data packet for the second event processing device reaches a preset number of times;

if yes, setting the second event processing equipment to be in a communication failure state;

otherwise, returning to execute the retransmission operation of the target data packet for the second event processing device.

Optionally, in a specific implementation manner, the sending, by the management device, the target data packet to each second event processing device includes:

for each second event processing device, judging whether the second event processing device is in the communication failure state; and if not, sending the target data packet to the second event processing equipment.

Alternatively, in one particular implementation,

when detecting an event, the first event processing device sends a target data packet corresponding to the event to the management device and each second event processing device, including:

when detecting an event, the first event processing device generates a plurality of target data packets for forming a target instruction corresponding to the event, and sequentially sends the plurality of target data packets to the management device and each second event processing device;

each second event processing device performs data response on the target data packet, and the data response includes:

judging whether all target data packets forming the target instruction are received or not;

if yes, all target data packets forming the target instruction are checked;

and after the verification is successful, executing the target instruction and emptying all target data packets forming the target instruction.

Optionally, in a specific implementation manner, a first queue and a second queue are constructed in the management device, a third queue and a fourth queue are constructed in each event processing device, the first queue and the fourth queue are queues for buffering response packets, and the second queue and the third queue are queues for buffering data packets;

when receiving the target data packet, the management device feeds back a first response packet corresponding to the target data packet to the first event processing device, and sends the target data packet to each second event processing device, including:

when receiving the target data packet, the management device generates a first response packet corresponding to the target data packet, caches the first response packet to the first queue, and caches the target data packet to the second queue; according to a first-in first-out transmission principle, transmitting the first response packet located in the first queue to the first event processing equipment, and transmitting the target data packet located in the second queue to each second event processing equipment;

when detecting an event, the first event processing device sends a target data packet corresponding to the event to the management device and each second event processing device, including:

when detecting an event, the first event processing device generates a target data packet corresponding to the event, and buffers the target data packet to the third queue; according to a first-in first-out sending principle, sending the target data packets positioned in the third queue to the management equipment and each second event processing equipment;

each second event processing device feeds back a second response packet corresponding to the target data packet to the management device, and the method includes:

each second event processing device generates a second response packet corresponding to the target data packet, and caches the second response packet to the fourth queue; and feeding back the second response packet positioned in the fourth queue to the management equipment.

In a second aspect, an embodiment of the present invention provides a communication method, where the communication method is applied to a management device in a multi-master network, where the multi-master network includes: the management device and a plurality of event processing devices; the method comprises the following steps:

receiving a target data packet sent by first event processing equipment, and feeding back a first response packet corresponding to the target data packet to the first event processing equipment; the target data packet is a data packet sent to the management device and each second event processing device by the first event processing device when an event is detected, and the target data packet is discarded by each second event processing device after the target data packet sent by the first event processing device is received;

sending the target data packet to each second event processing device, so that each second event processing device feeds back a second response packet corresponding to the target data packet to the management device when receiving the target data packet, and performs data response on the target data packet;

wherein the first event processing device is: any one of the plurality of event processing devices; the second event processing device is: among the plurality of event processing devices, a device other than the first event processing device.

In a third aspect, an embodiment of the present invention provides a communication method, where the communication method is applied to a first event processing device in a multi-master network, where the multi-master network includes: the management device and a plurality of event processing devices; the first event processing device is any one of the plurality of event processing devices; the method comprises the following steps:

when an event is detected, sending a target data packet corresponding to the event to the management device and each second event processing device, so that the management device feeds back a first response packet corresponding to the target data packet to the first event processing device when receiving the target data packet, and each second event processing device discards the target data packet when receiving the target data packet sent by the first event processing device; the management equipment sends the target data packet to each second event processing equipment, so that each second event processing equipment feeds back a second response packet corresponding to the target data packet to the management equipment when receiving the target data packet sent by the management equipment, and performs data response on the target data packet; the second event processing device is: a device other than the first event processing device among the plurality of event processing devices;

and receiving a first response packet corresponding to the target data packet fed back by the management equipment.

In a fourth aspect, an embodiment of the present invention provides a communication method, where the communication method is applied to a second event processing device in a multi-master network, where the multi-master network includes: the management device and a plurality of event processing devices; the second event processing device is any one of the plurality of event processing devices; the method comprises the following steps:

receiving a target data packet sent by the management equipment, feeding back a second response packet corresponding to the target data packet to the management equipment, and performing data response on the target data packet; the target data packet is a data packet sent to the management device and the second event processing device by a first event processing device when an event is detected, and the management device feeds back a first response packet corresponding to the target data packet to the first event processing device when receiving the target data packet sent by the first event processing device; the first event processing device is: any device of the plurality of event processing devices except the second event processing device;

and receiving the target data packet sent by the first event processing equipment, and discarding the target data packet sent by the first event processing equipment.

In a fifth aspect, an embodiment of the present invention provides a communication apparatus, where the communication apparatus is applied to a management device in a multi-master network, where the multi-master network includes: the management device and a plurality of event processing devices; the device comprises:

the first communication module is used for receiving a target data packet sent by first event processing equipment and feeding back a first response packet corresponding to the target data packet to the first event processing equipment; the target data packet is a data packet sent to the management device and each second event processing device by the first event processing device when an event is detected, and the target data packet is discarded by each second event processing device after the target data packet sent by the first event processing device is received;

the second communication module is used for sending the target data packet to each second event processing device, so that each second event processing device feeds back a second response packet corresponding to the target data packet to the management device when receiving the target data packet, and performs data response on the target data packet;

wherein the first event processing device is: any one of the plurality of event processing devices; the second event processing device is: among the plurality of event processing devices, a device other than the first event processing device.

In a sixth aspect, an embodiment of the present invention provides a communication apparatus, where the communication apparatus is applied to a first event processing device in a multi-master network, where the multi-master network includes: the management device and a plurality of event processing devices; the first event processing device is any one of the plurality of event processing devices; the device comprises:

a first sending module, configured to send, when an event is detected, a target data packet corresponding to the event to the management device and each of the second event processing devices, so that the management device feeds back, to the first event processing device, a first response packet corresponding to the target data packet when receiving the target data packet, and each of the second event processing devices discards the target data packet when receiving the target data packet sent by the first event processing device; the management equipment sends the target data packet to each second event processing equipment, so that each second event processing equipment feeds back a second response packet corresponding to the target data packet to the management equipment when receiving the target data packet sent by the management equipment, and performs data response on the target data packet; the second event processing device is: a device other than the first event processing device among the plurality of event processing devices; the second event processing device is: a device other than the first event processing device among the plurality of event processing devices;

and the first receiving module is used for receiving a first response packet corresponding to the target data packet fed back by the management device.

In a seventh aspect, an embodiment of the present invention provides a communication apparatus, where the communication apparatus is applied to a second event processing device in a multi-master network, where the multi-master network includes: the management device and a plurality of event processing devices; the second event processing device is any one of the plurality of event processing devices; the device comprises:

the second receiving module is used for receiving a target data packet sent by the management equipment, feeding back a second response packet corresponding to the target data packet to the management equipment, and performing data response on the target data packet; the target data packet is a data packet sent to the management device and the second event processing device by a first event processing device when an event is detected, and the management device feeds back a first response packet corresponding to the target data packet to the first event processing device when receiving the target data packet sent by the first event processing device; the first event processing device is: any device of the plurality of event processing devices except the second event processing device;

a third receiving module, configured to receive the target data packet sent by the first event processing device, and discard the target data packet sent by the first event processing device.

In an eighth aspect, an embodiment of the present invention provides a management device, including a processor, a communication interface, a memory, and a communication bus, where the processor and the communication interface complete communication between the memory and the processor through the communication bus;

a memory for storing a computer program;

and a processor, configured to implement the steps of any of the communication methods provided by the second aspect when executing the program stored in the memory.

In a ninth aspect, an embodiment of the present invention provides an event processing device, which is denoted as a first event processing device, and includes a processor, a communication interface, a memory, and a communication bus, where the processor and the communication interface are used, and the memory completes mutual communication through the communication bus;

a memory for storing a computer program;

a processor, configured to implement the steps of any of the communication methods provided in the third aspect when executing the program stored in the memory.

In a tenth aspect, an embodiment of the present invention provides an event processing device, which is denoted as a second event processing device, and includes a processor, a communication interface, a memory, and a communication bus, where the processor and the communication interface are used, and the memory completes mutual communication through the communication bus;

a memory for storing a computer program;

a processor, configured to implement the steps of any of the communication methods provided in the fourth aspect when executing the program stored in the memory.

In an eleventh aspect, the present invention provides a computer-readable storage medium, in which a computer program is stored, and the computer program, when executed by a processor, implements the steps of any one of the communication methods provided in the second aspect.

In a twelfth aspect, the present invention provides a computer-readable storage medium, in which a computer program is stored, and when executed by a processor, the computer program implements the steps of any one of the communication methods provided in the third aspect.

In a thirteenth aspect, the present invention provides a computer-readable storage medium, in which a computer program is stored, and when the computer program is executed by a processor, the computer program implements the steps of any one of the communication methods provided in the fourth aspect.

In a fourteenth aspect, an embodiment of the present invention provides a computer program product containing instructions, which when run on a computer, causes the computer to perform the steps of any of the communication methods provided in the second aspect.

In a fifteenth aspect, an embodiment of the present invention provides a computer program product containing instructions, which when run on a computer, causes the computer to perform the steps of any of the communication methods provided in the third aspect.

In a sixteenth aspect, an embodiment of the present invention provides a computer program product containing instructions, which when run on a computer, causes the computer to perform the steps of any of the communication methods provided in the fourth aspect.

The embodiment of the invention has the following beneficial effects:

by applying the scheme provided by the embodiment of the invention, the multi-master network not only comprises a plurality of event processing devices, but also comprises a management device. In this way, during communication, when an event processing device detects an event, the event processing device transmits a target packet corresponding to the event to the management device and other event processing devices. When receiving the target data packet, the management device feeds back a first response packet corresponding to the target data packet to the event processing device, and also sends the target data packet to other event processing devices. Furthermore, after receiving the target data packet sent by the event processing device, the other event processing devices do not discard the target data packet, and correspondingly, after receiving the target data packet sent by the management device, the other event processing devices feed back a second response packet corresponding to the target data packet to the management device, and perform data response on the target data packet.

Based on this, it can be seen that, in the scheme provided in the embodiment of the present invention, each event processing device will only feed back the response packet corresponding to the data packet to the management device when receiving the data packet sent by the management device, and for the data packet sent by another event processing device, the event processing device will discard the data packet and will not feed back the response packet corresponding to the data packet to the other event processing device.

That is to say, in the solution provided in the embodiment of the present invention, during the communication process of the multi-master network, each event processing device only performs data validation with the management device, and data validation is not performed between each event processing device. In this way, when a plurality of concurrent events exist, each event processing device only performs data confirmation with the management device, so that the communication relation in the multi-master network can be greatly simplified, and the risk of network breakdown of the multi-master network is reduced.

Drawings

In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.

Fig. 1 is a schematic diagram illustrating a communication relationship in a multi-master network when there are multiple events occurring concurrently in the related art;

fig. 2 is a schematic structural diagram of a multi-master network according to an embodiment of the present invention;

fig. 3 is a timing diagram of a communication process in a multi-master network according to an embodiment of the present invention;

fig. 4(a) -4 (b) are schematic diagrams illustrating the transmission of a data packet and a response packet when a deadlock occurs between the management device 210 and the event processing device according to the embodiment of the present invention;

fig. 5(a) -5 (b) are schematic diagrams illustrating the transmission of a data packet and a response packet between the management device 210 and the event processing device in the embodiment of the present invention;

fig. 6 is a flowchart illustrating a communication method applied to a management device in a multi-master network according to an embodiment of the present invention;

fig. 7 is a flowchart illustrating a communication method applied to a first event processing device in a multi-master network according to an embodiment of the present invention;

fig. 8 is a flowchart illustrating a communication method applied to a second event processing device in a multi-master network according to an embodiment of the present invention;

fig. 9 is a schematic structural diagram of a communication apparatus applied to a management device in a multi-master network according to an embodiment of the present invention;

fig. 10 is a schematic structural diagram of a communication apparatus applied to a first event processing device in a multi-master network according to an embodiment of the present invention;

fig. 11 is a schematic structural diagram of a communication apparatus applied to a second event processing device in a multi-master network according to an embodiment of the present invention;

fig. 12 is a schematic structural diagram of a communication device in any event processing device in a multi-master network according to an embodiment of the present invention;

fig. 13 is a schematic structural diagram of a management device according to an embodiment of the present invention;

fig. 14 is a schematic structural diagram of a first event processing apparatus according to an embodiment of the present invention;

fig. 15 is a schematic structural diagram of a second event processing device according to an embodiment of the present invention.

Detailed Description

The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.

In the related art, although the multi-master network has the characteristic of high communication real-time performance, in the communication process of the multi-master network, when a plurality of concurrent events exist, a large number of data packets which need to be sent to other event processing devices may exist in each event processing device at the same time, and therefore each event processing device may receive a large number of response packets fed back by other event processing devices at the same time; accordingly, each event processing device may also receive data packets sent by a large number of other event processing devices at the same time, and need to simultaneously feed back response packets to a large number of other event processing devices. In this way, in the communication process of the multi-master network, if multiple concurrent events exist, a very complex communication relationship may exist in the multi-master network, so that the risk of network breakdown of the multi-master network is greatly increased.

For example, fig. 1 shows a communication relationship in a multi-master network when there are multiple events occurring concurrently in the related art. Wherein, the double-arrow line marked with the character of "sending" represents: two connected event processing devices send data packets to each other, and a double-arrow line marked with an "ACK" word indicates that: in the two connected event processing devices, each event processing device feeds back a response packet corresponding to the data packet to the other party after receiving the data packet sent by the other party. In addition, the ACK is an abbreviation of Acknowledgement, where the meaning is an Acknowledgement character, that is, when the event processing apparatus receives a data packet transmitted by another event processing apparatus, the event processing apparatus feeds back a response packet to the other event processing apparatus.

As shown in fig. 1, when there are multiple events occurring concurrently, the communication relationship in the multi-master network is very complex, and as the number of event processing devices included in the multi-master network increases, the communication relationship becomes more complex.

In order to solve the above technical problem, an embodiment of the present invention provides a multi-master network. Wherein the multi-master network includes a management device and a plurality of event processing devices.

The first event processing equipment is used for sending a target data packet corresponding to the event to the management equipment and each second event processing equipment when the event is detected; wherein the first event processing device is: any one of the plurality of event processing devices; the second event processing device is: a device other than the first event processing device among the plurality of event processing devices;

the management device is configured to, when receiving the target data packet, feed back a first response packet corresponding to the target data packet to the first event processing device, and send the target data packet to each second event processing device;

each second event processing device is used for feeding back a second response packet corresponding to the target data packet to the management device and performing data response on the target data packet when receiving the target data packet sent by the management device; and when the target data packet sent by the first event processing equipment is received, discarding the target data packet.

It should be noted that the multi-master network provided in the embodiment of the present invention may be applied to any system that needs to perform multi-master network communication, for example, an automatic fire alarm system, a smoke alarm system, and the like. The embodiments of the present invention are not specifically described.

Further, the management device and the event processing device may be any type of electronic device, for example, a tablet computer, a mobile phone, a fire alarm controller, and the like. In this regard, the embodiments of the present invention are not limited to the specific embodiments.

As can be seen from the above, by applying the solution provided by the embodiment of the present invention, the multi-master network includes not only a plurality of event processing devices but also a management device. In this way, during communication, when an event processing device detects an event, the event processing device transmits a target packet corresponding to the event to the management device and other event processing devices. When receiving the target data packet, the management device feeds back a first response packet corresponding to the target data packet to the event processing device, and also sends the target data packet to other event processing devices. Furthermore, after receiving the target data packet sent by the event processing device, the other event processing devices do not discard the target data packet, and correspondingly, after receiving the target data packet sent by the management device, the other event processing devices feed back a second response packet corresponding to the target data packet to the management device, and perform data response on the target data packet.

Based on this, it can be seen that, in the scheme provided in the embodiment of the present invention, each event processing device will only feed back the response packet corresponding to the data packet to the management device when receiving the data packet sent by the management device, and for the data packet sent by another event processing device, the event processing device will discard the data packet and will not feed back the response packet corresponding to the data packet to the other event processing device.

That is to say, in the solution provided in the embodiment of the present invention, during the communication process of the multi-master network, each event processing device only performs data validation with the management device, and data validation is not performed between each event processing device. In this way, when a plurality of concurrent events exist, each event processing device only performs data confirmation with the management device, so that the communication relation in the multi-master network can be greatly simplified, and the risk of network breakdown of the multi-master network is reduced.

Next, a multi-master network provided in an embodiment of the present invention is specifically described.

Fig. 2 is a schematic structural diagram of a multi-master network according to an embodiment of the present invention. The multi-master network includes a management device 210, and a plurality of event processing devices 220-1, 220-2, …, 220-N (N ≧ 1).

Any one of the event processing devices 220-1, 220-2, …, and 220-N may be used as a first event processing device when detecting an event, and accordingly, in the event processing devices 220-1, 220-2, …, and 220-N, each device except the first event processing device may be used as a second event processing device. Furthermore, the first event processing device, each second event processing device, and the management device 210 can participate in the communication process of the target data packet corresponding to the complete event.

That is to say, in a multi-master network provided in an embodiment of the present invention, the first event processing device may be: any one of a plurality of event processing devices 220-1, 220-2, …, 220-N included in the multi-master network; the second event processing device may be: the multi-master network includes devices other than the first event processing device among the plurality of event processing devices 220-1, 220-2, …, 220-N.

It should be noted that, it is reasonable that the second event processing device may be all devices except the first event processing device in the plurality of event processing devices 220-1, 220-2, …, 220-N, or may be some devices except the first event processing device in the plurality of event processing devices 220-1, 220-2, …, 220-N.

Optionally, the first event processing device may determine each second event processing device according to the detected event type.

The multi-master network will be described below by taking the event processing device 220-1 as a first event processing device and the event processing devices 220-2, …, 220-N as a second event processing device as examples.

The first event processing device 220-1 is configured to, when an event is detected, send a target data packet corresponding to the event to the management device 210 and each of the second event processing devices 220-2, …, and 220-N;

the management device 210 is configured to, when receiving the target data packet, feed back a first response packet corresponding to the target data packet to the first event processing device 220-1, and send the target data packet to each of the second event processing devices 220-2, …, 220-N;

each second event processing device 220-M (M is greater than or equal to 2 and less than or equal to N) is configured to, when receiving the target data packet sent by the management device 210, feed back a second response packet corresponding to the target data packet to the management device 210, and perform data response on the target data packet; and, upon receiving the destination packet sent by the first event processing device 220-1, discarding the destination packet.

To facilitate understanding of the communication process between the management device 210 and the plurality of event processing devices 220-1, 220-2, …, 220-N in the multi-master network, as shown in fig. 3, in order to take the event processing device 220-1 as a first event processing device and the event processing devices 220-2, …, 220-N as a second event processing device as examples, a time sequence diagram of the communication process between the management device 210 and the plurality of event processing devices 220-1, 220-2, …, 220-N in the multi-master network is shown.

When the first event processing device 220-1 detects an event, it may generate a target data packet corresponding to the event, and determine all devices except the first event processing device 220-1, 220-2, …, 220-N as the second event processing device. Thus, the first event processing device 220-1 can transmit the generated destination packet to the management device 210 and the respective second event processing devices 220-2, …, 220-N.

Further, the management device 210 may receive the target data packet sent by the first event processing device 220-1, so that, when receiving the target data packet, the management device 210 may generate a first response packet corresponding to the target data packet, and thus, the management device 210 may send the first response packet to the first event processing device 220-1 to complete data confirmation between the management device 210 and the first event processing device 220-1. When the first event processing device 220-1 receives the first response packet sent by the management device 210, the first event processing device 220-1 can determine that the target data packet has been successfully sent to the management device 210.

Further, upon receiving the destination packet, the management device may also transmit the destination packet to each of the second event processing devices 220-2, …, 220-N.

Optionally, the management device 210 may determine, in the event processing devices 220-2, …, and 220-N, each event processing device that needs to send the target data packet according to the second event processing device information sent by the first event processing device 220-1.

For example, the first event processing device 220-1 may transmit the identification information of the second event processing device at the same time when transmitting the target packet to the management device 210; for another example, the target data packet sent by the first event processing device 220-1 to the management device 210 may carry identification information of the second event processing device, and the like.

Thus, each of the second event processing devices 220-M may receive the above-mentioned destination packet transmitted from the first event processing device 220-1, and the above-mentioned destination packet transmitted from the management device 210. Wherein each second event processing device 220-M is any one of the plurality of event processing devices 220-2, …, 220-N, i.e., 2 ≦ M ≦ N.

In this way, when receiving the target data packet sent by the management device 210, the second event processing device 220-M may generate a second response packet corresponding to the target data packet, and send the second response packet to the management device 210, so as to complete data confirmation between the second event processing device 220-M and the management device 210. When the management device 210 receives the second response packet sent by the second event processing device 220-M, the management device 210 may determine that the target data packet has been successfully sent to the second event processing device 220-M.

In addition, for the target data packet received from the management device 210, the second event processing device 220-M may perform a data response to the target data packet in addition to feeding back the second response packet corresponding to the target data packet to the management device 210.

Accordingly, when receiving the target packet sent by the first event processing device 220-1, the second event processing device 220-M discards the target packet, so that the second event processing device 220-M may not feed back a response packet corresponding to the target packet to the first event processing device 220-1, i.e., does not perform data confirmation with the first event processing device 220-1.

That is, in the above-described multi-master network, data determination links for determining whether transmission of a target packet is successful occur between the first event processing device 220-1 and the management device 210 and between each of the second event processing devices 220-M and the management device 210, while the first event processing device 220-1 and each of the second event processing devices 220-M do not perform data determination.

It is emphasized that the event processing device 220-1 is used as the first event processing device, and the event processing devices 220-2, …, 220-N are used as the second event processing device, which are merely examples of the division of the first event processing device and the second event processing device in the event processing devices 220-1, 220-2, …, 220-N, so as to clearly illustrate the multi-master network, but are not limited thereto.

That is, in the event processing devices 220-1, 220-2, …, and 220-N, the specific division of the first event processing device and the second event processing device is not limited in the embodiments of the present invention. In this embodiment of the present invention, the first event processing device may be: any one of a plurality of event processing devices 220-1, 220-2, …, 220-N included in the multi-master network; the second event processing device may be: the multi-master network includes devices other than the first event processing device among the plurality of event processing devices 220-1, 220-2, …, 220-N.

When any one of the event processing devices 220-2, …, and 220-N included in the multi-master network is the first event processing device, the actions performed by the management device 210, the first event processing device, and the second event processing devices in the multi-master network are similar to the actions performed by the management device 210, the first event processing device, and the second event processing devices in the multi-master network when the event processing device 220-1 is the first event processing device, and thus are not described again.

In addition, when there are multiple concurrent events, any one of the multiple event processing devices 220-2, …, and 220-N included in the multi-master network may be used as the first event processing device or simultaneously as the second event processing device.

That is, if the device and other devices than the device in the plurality of event processing devices 220-2, …, 220-N can detect different events at the same time, the device can be used as a first event processing device for the event detected by the device itself, and can be used as a second event processing device for other events detected by other devices.

When the same device is used as a first event processing device and a second event processing device at the same time, the communication processes respectively participated by the first event processing device and the second event processing device are different.

For example, if the event processing device 220-1 and the event processing device 220-2 detect the events a and B at the same time, respectively, the event processing device 220-1 participates in the communication process of the target packet corresponding to the event a as the first event processing device, and participates in the communication process of the target packet corresponding to the event B as the second event processing device.

That is, the device, as a first event processing device, sends a target packet to each of the corresponding second event processing devices and the management device 210, and receives a first response packet corresponding to the target packet fed back by the management device 210; the data packet sent by the management device 210 and the data packets sent by the other processing devices as the first event processing device may also be received as the second event processing device, and the received response packet corresponding to the data packet sent by the management device 210 is fed back to the management device 210, and the data packets sent by the other processing devices as the first event processing device are discarded. Wherein the device performs data confirmation only with the management device 210 without performing data confirmation with other event processing devices.

Based on this, for any one of the event processing devices 220-2, …, 220-N included in the multi-master network, the device may also participate in a communication process of target packets corresponding to different events as a second event processing device at the same time.

For example, if the event processing device 220-1 and the event processing device 220-2 detect the events a and B at the same time, respectively, the event processing device 220-3 participates in the communication process of the target packet corresponding to the event a as the second event processing device, and participates in the communication process of the target packet corresponding to the event B as the second event processing device.

That is, the apparatus receives, as the second event processing apparatus, the plurality of packets transmitted by the management apparatus 210 and the packets transmitted by the plurality of other processing apparatuses as the first event processing apparatus, and feeds back, to the management apparatus 210, the response packet corresponding to each of the received packets transmitted by the management apparatus 210 and discards the packets transmitted by the plurality of other processing apparatuses as the first event processing apparatus. Wherein the device performs data confirmation only with the management device 210 without performing data confirmation with other event processing devices.

As can be seen from the above, in the solution provided by the embodiment of the present invention, in the communication process of the multi-master network, each event processing device only performs data validation with the management device, and data validation is not performed between each event processing device. In this way, when a plurality of concurrent events exist, each event processing device only performs data confirmation with the management device, so that the communication relation in the multi-master network can be greatly simplified, and the risk of network breakdown of the multi-master network is reduced.

For convenience of description and for clarity of the text, the following description continues with the event processing device 220-1 as a first event processing device, and the event processing devices 220-2, …, 220-N as a second event processing device, to specifically describe related content in the communication process of the multi-master network.

It should also be emphasized that, in the following embodiments, the event processing device 220-1 is used as a first event processing device, and the event processing devices 220-2, …, 220-N are used as second event processing devices, which are merely illustrative and not restrictive of the division of the first event processing device and the second event processing device in the above-mentioned event processing devices 220-1, 220-2, …, 220-N.

Optionally, in a specific implementation manner, the management device 210 may be further configured to:

for each second event processing device 220-M, when a second response packet fed back by the second event processing device 220-M is not received within a preset time period, performing a retransmission operation on the target data packet for the second event processing device 220-M; after the retransmission operation is performed on the target data packet, when a second response packet fed back by the second event processing device 220-M is not received within a preset time period, setting the second event processing device 220-M to a communication failure state;

wherein the communication failure state is used to characterize the second event processing device 220-M that there is a communication failure.

It is to be understood that the management device 210 may perform data validation with each of the second event processing devices 220-M in order to ensure that the target data packet can be successfully transmitted to each of the second event processing devices 220-M. The general data validation method is as follows: after receiving the target data packet sent by the management device 210, each second event processing device 220-M feeds back a second response packet corresponding to the target data packet to the management device 210 within a predetermined time period.

In this way, for each second event processing device 220-M, when the management device 210 receives the second response packet fed back by the second event processing device 220-M within the preset time period, the management device 210 may determine that the target data packet has been successfully sent to the second event processing device 220-M.

Accordingly, when the management device does not receive the second response packet fed back by the second event processing device 220-M within the preset time period, the management device 210 may determine that the target data packet is not successfully sent to the second event processing device 220-M. At this time, the management device 210 may perform a retransmission operation with respect to the target packet with respect to the second event processing device 220-M, and retransmit the target packet to the second event processing device 220-M.

However, after performing the retransmission operation with respect to the target data packet, when the management device 210 has not received the second response packet fed back by the second event processing device 220-M within the preset time period, the management device 210 may determine that the second event processing device 220-M has a communication failure, and thus set the second event processing device 220-M to a communication failure state for representing that the second event processing device 220-M has a communication failure.

In this way, the management device 210 may stop performing the retransmission operation for the target packet again for the second event processing device 220-M to avoid the occurrence of the false death phenomenon in the multi-master network.

The term "false death" refers to: because the preset timeout time for determining that the event processing device has the communication fault is long, when the event processing device serving as the second event processing device has the communication fault, the management device does not receive a response packet corresponding to the data packet fed back by the event processing device within the timeout time after sending the data packet to the event processing device, and also does not receive an indication that the event processing device has the communication fault, so that the management device continuously retransmits the data packet to the event processing device within the timeout time, and other data packets cannot be sent out in time.

Further, optionally, in the communication process of the target data packet corresponding to the subsequent other event, when the second event processing device 220-M is again used as the second event processing device, the management node 210 may first determine whether the second event processing device 220-M is in a communication failure state.

If the determination result is yes, the management node 210 may skip the second event processing device 220-M, so as not to send the target data packet corresponding to the other event to the second event processing device 220-M, and continue to send other data packets to the other second event processing device 220-M, so as to avoid a false death phenomenon in the multi-master network;

on the contrary, if the determination result is negative, the management node 210 may send the target data packet corresponding to the other event to the second event processing device 220-M.

For each second event processing device 220-M, after the management device 210 sends the target data packet to the second event processing device 220-M, the reason for receiving the second response packet fed back by the second event processing device 220-M within the preset time period may be that a communication failure occurs in the second event processing device 220-M, or that a short network congestion occurs in the current communication network, which may cause the feedback of the second response packet to be overtime and not reach the management device 210 within the preset time period.

Based on this, in order to reduce the possibility that the second response packet feedback time-out due to the short network congestion of the communication network is erroneously determined to be due to the communication failure of the second event processing device 220-M, the feedback time-out of the second response packet is caused, and the accuracy of determining that the communication failure of the second event processing device 220-M occurs is improved. Optionally, in a specific implementation manner, the management device 210 may be further configured to:

determining, for each second event processing device 220-M, whether the number of times retransmission operations with respect to a target data packet are performed for the second event processing device 220-M reaches a preset number before the second event processing device is set to the 220-M communication failure state;

if so, performing setting the second event processing device 220-M to a communication failure state;

otherwise, return execution is made with respect to the second event processing device 220-M performing a retransmission operation with respect to the target packet.

When the management apparatus 210 performs a retransmission operation on the target data packet for the second event processing apparatus 220-M, retransmits the target data packet to the second event processing apparatus 220-M, and does not receive the second response packet fed back by the second event processing apparatus 220-M within a preset time period, the management apparatus 210 may determine whether the number of times of performing the retransmission operation on the target data packet for the second event processing apparatus 220-M reaches a preset number of times. I.e., whether the target data packet has been retransmitted to the second event processing device 220-M a preset number of times.

If the determination result is yes, it indicates that the number of times that the management device 210 performs the retransmission operation on the target data packet for the second event processing device 220-M reaches the preset number, and the management node 210 may set the second event processing device 220-M to the communication failure state.

In contrast, if the determination result is no, which indicates that the number of times that the management device 210 performs the retransmission operation on the target data packet with respect to the second event processing device 220-M has not reached the preset number of times, the management node 210 may retransmit the target data packet to the second event processing device 220-M again, i.e., return to performing the retransmission operation on the target data packet with respect to the second event processing device 220-M.

The preset times may be set according to requirements of practical applications, and embodiments of the present invention are not particularly limited. For example, the predetermined number of times may be 2, 3, or the like.

For example, assuming that the preset number of times is 2, after receiving the target data sent by the first event processing device 220-1, the management node 210 sends the target data to the second event processing device 220-2, and does not receive a second response packet corresponding to the target data fed back by the second event processing device 220-2 within a preset time period. Further, the management node 210 retransmits the target data to the second event processing device 220-2, and if the management node 210 still does not receive the second response packet corresponding to the target data fed back by the second event processing device 220-2 within the preset time length, the management node 210 determines that the number of times of retransmission operations performed on the target data packet by the second event processing device 220-2 is 1, and the number of times of retransmission operations performed on the target data packet does not reach the preset number of times 2. Further, the management node 210 retransmits the target data to the second event processing device 220-2 again, and the management node 210 still does not receive the second response packet corresponding to the target data fed back by the second event processing device 220-2 within the preset time length, then the management node 210 determines that the number of times of retransmission operations performed on the target data packet for the second event processing device 220-2 is 2, and reaches the preset number of times 2, then the management node 210 sets the second event processing device 220-2 to be in a communication failure state.

Optionally, in a specific implementation manner, the sending, by the management device 210, the target data packet to each second event processing device 220-2, …, 220-N may include:

for each second event processing device 220-M, determining whether the second event processing device 220-M is in a communication failure state; if not, a destination packet is sent to the second event processing device 220-M.

In this specific implementation manner, before sending the target data packet to each second event processing device 220-M, the management device 210 may first determine whether the second event processing device 220-M is in a communication failure state, so that the target data packet is sent to the second event processing device 220-M only when the second event processing device 220-M is not in the communication failure state.

In this way, the above-mentioned false death phenomenon can be avoided when the management node 210 sends the above-mentioned destination packet to each of the second event processing devices 220-2, …, 220-N.

Optionally, in a specific implementation manner, when detecting an event, the sending, by the first event processing device 220-1, a target data packet corresponding to the event to the management device 210 and each of the second event processing devices 220-2, …, and 220-N may include:

the first event processing device 220-1, upon detecting an event, generates a plurality of target packets for constituting target instructions corresponding to the event, and sequentially transmits the plurality of target packets to the management device 210 and the respective second event processing devices 220-2, …, 220-N;

accordingly, each second event processing device 220-M performs data response to the target data packet, and may include:

judging whether all target data packets forming the target instruction are received or not;

if yes, all data packets forming the target instruction are checked;

and after the verification is successful, executing the target instruction and emptying all target data packets forming the target instruction.

In this specific implementation manner, when the first event processing device 220-1 detects an event, and when the first event processing device 220-1 determines that a target instruction corresponding to the event needs to be generated, the first event processing device 220-1 may determine that a target data packet corresponding to the event that needs to be generated is a data packet constituting the target instruction corresponding to the event. Thus, the first event processing device 220-1 may generate a plurality of target packets constituting the target instruction, i.e., divide the target instruction into a plurality of packets for communication.

Thus, the first event processing device 220-1 may sequentially transmit a plurality of destination packets to the management device 210 and the respective second event processing devices 220-2, …, 220-N.

Accordingly, each second event processing device 220-M may receive the above-mentioned target command, which is forwarded by the management device 210 and constitutes the target command, in turn to obtain a plurality of target packets. Wherein, upon receiving each target packet, the second event processing device 220-M may first determine whether all target packets constituting the target instruction have been received. Further, when the determination result is yes, the second event processing device 220-M may check all the target packets constituting the target instruction, execute the target instruction after the check is successful, and empty all the target packets constituting the target instruction.

In this way, repeated execution of the target instruction due to packet retransmission with respect to the target instruction can be avoided.

Among them, the phenomenon that the target instruction is repeatedly executed is: the target command is composed of a single packet, and the second event processing device 220-M may execute the target command upon receiving the single packet constituting the target command. Thus, if the second event processing device 220-M does not feed back the response packet corresponding to the individual packet to the management device 210 within the preset time period, the management device 210 retransmits the individual packet constituting the target instruction to the second event processing device 220-M, and thus, the second event processing device 220-M executes the target instruction again. By analogy, if the second event processing device 220-M does not feed back the response packet corresponding to the individual data packet to the management device 210 within the preset time length, the management device 210 will always retransmit the individual data packet constituting the target instruction to the second event processing device 220-M, so that the second event processing device 220-M repeatedly executes the target instruction.

Accordingly, in this specific implementation, since the plurality of target packets constituting the target instruction are sequentially sent to the second event processing device 220-M, when the management device 210 retransmits, of the plurality of target packets constituting the target instruction, other packets except the last target packet, the second event processing device 220-M cannot perform packet verification due to lack of a subsequent target packet constituting the target instruction, and thus cannot execute the target instruction;

accordingly, when the management apparatus 210 retransmits the last destination packet among a plurality of destination packets constituting a destination instruction, since the second event processing apparatus 220-M has received all the destination packets constituting the destination instruction before receiving the retransmitted last destination packet, the second event processing apparatus 220-M can have checked all the packets constituting the destination instruction and, after completion of the check, execute the destination instruction and empty all the destination packets constituting the destination instruction, that is, when the second event processing apparatus 220-M receives the retransmitted last destination packet, the second event processing apparatus 220-M still cannot perform packet check due to the absence of other packets constituting the destination instruction before the last destination packet, and thus, the target instruction cannot be executed.

In this way, repeated execution of the target instruction due to packet retransmission with respect to the target instruction can be avoided.

Optionally, in a specific implementation manner, a first queue and a second queue are constructed in the management device 210, a third queue and a fourth queue are constructed in each event processing device 220-1, 220-2, …, 220-N, the first queue and the fourth queue are queues for buffering response packets, and the second queue and the third queue are queues for buffering data packets;

based on this, in this specific implementation, when receiving the target packet, the management device 210 feeds back the first response packet corresponding to the target packet to the first event processing device 220-1, and sends the target packet to each of the second event processing devices 220-2, …, and 220-N, including:

the management device 210, when receiving the target data packet, generates a first response packet corresponding to the target data packet, caches the first response packet to the first queue, and caches the target data packet to the second queue; transmitting the first response packet located in the first queue to the first event processing device 220-1 and transmitting the target data packet located in the second queue to each of the second event processing devices 220-2, …, 220-N on a first-in-first-out transmission basis;

accordingly, when the first event processing device 220-1 detects an event, it may send a target data packet corresponding to the event to the management device 210 and each of the second event processing devices 220-2, …, 220-N, and may include:

the first event processing device 220-1, when detecting an event, generates a target data packet corresponding to the event, and buffers the target data packet into the third queue; the destination packets located in the third queue are transmitted to the management device 210 and the respective second event processing devices 220-2, …, 220-N on a first-in-first-out transmission basis.

Each second event processing device 220-M feeds back a second response packet corresponding to the target data packet to the management device 210, including:

each second event processing device 220-M generates a second response packet corresponding to the target data packet, and buffers the second response packet in the fourth queue; the second response packet at the fourth queue is fed back to the management device 210.

In this embodiment, in the management device 210 and the plurality of event processing devices 220-1, 220-2, …, 220-N, the data packet and the response packet may be buffered in two different queues that are not affected by each other, so that when the management device 210 and any one of the plurality of event processing devices 220-1, 220-2, …, 220-N transmit the data packet and the response packet corresponding to the received data packet to each other, thereby avoiding the occurrence of deadlock.

The deadlock phenomenon is as follows: when any of the plurality of event processing devices 220-1, 220-2, …, 220-N is simultaneously acting as a first event processing device and a second event processing device, it may occur that: the management apparatus 210 and the apparatus transmit a packet to the other side at the same time, and wait for a response packet corresponding to the transmitted packet fed back from the other side. Since the timeout times of the management device 210 and the device may be the same, when the management device 210 and the device both perform a retransmission operation on a transmitted data packet for the other, the management device 210 and the device still transmit the data packet to the other at the same time, and still wait for a response packet corresponding to the transmitted data packet fed back by the other with each other. This causes the management device 210 and the response packet that needs to be sent to the other device in the device to be blocked by the data packet sent by itself, and therefore, the response packet cannot be sent out in time, and a deadlock phenomenon occurs.

For example, as shown in fig. 4(a) -4 (b), which are schematic diagrams of the transmission of the data packet and the response packet when the deadlock phenomenon occurs between the management device 210 and the event processing device. Wherein, the ACK1 is an acknowledgement packet corresponding to the data packet 1, and the ACK2 is an acknowledgement packet corresponding to the data packet 2.

Accordingly, in this embodiment, since the management device 210 and the plurality of event processing devices 220-1, 220-2, …, 220-N buffer the data packets and the response packets into two different queues that are not affected by each other, the management device 210 and the plurality of event processing devices 220-1, 220-2, …, 220-N can send the data packets and the response packets through the different queues at the same time, so as to avoid deadlock.

For example, as shown in fig. 5(a) -5 (b), which are schematic diagrams of the present invention, the management device 210 and the event processing device simultaneously transmit a data packet and a response packet.

Corresponding to the multi-master network provided by the embodiment of the invention, the embodiment of the invention also provides a communication method of the management equipment applied to the multi-master network. Wherein the multi-master network includes the management device and a plurality of event processing devices.

Fig. 6 is a flowchart illustrating a communication method applied to a management device in a multi-master network according to an embodiment of the present invention. As shown in fig. 6, the method may include the steps of:

s601: receiving a target data packet sent by first event processing equipment, and feeding back a first response packet corresponding to the target data packet to the first event processing equipment;

the target data packet is a data packet sent to the management device and each second event processing device by the first event processing device when an event is detected, and the target data packet is discarded by each second event processing device after the target data packet sent by the first event processing device is received;

s602: sending the target data packet to each second event processing device, so that each second event processing device feeds back a second response packet corresponding to the target data packet to the management device when receiving the target data packet, and performs data response on the target data packet;

wherein the first event processing device is: any one of the plurality of event processing devices; the second event processing device is: among the plurality of event processing devices, a device other than the first event processing device.

As can be seen from the above, in the solution provided in the embodiment of the present invention, each event processing device will only feed back the response packet corresponding to the data packet to the management device when receiving the data packet sent by the management device, and for the data packet sent by another event processing device, the event processing device will discard the data packet and will not feed back the response packet corresponding to the data packet to another event processing device.

That is to say, in the solution provided in the embodiment of the present invention, during the communication process of the multi-master network, each event processing device only performs data validation with the management device, and data validation is not performed between each event processing device. In this way, when a plurality of concurrent events exist, each event processing device only performs data confirmation with the management device, so that the communication relation in the multi-master network can be greatly simplified, and the risk of network breakdown of the multi-master network is reduced.

Optionally, in a specific implementation manner, the method further includes:

for each second event processing device, when the second response packet fed back by the second event processing device is not received within a preset time length, performing retransmission operation on the target data packet for the second event processing device; after the retransmission operation of the target data packet is executed, when the second response packet fed back by the second event processing equipment is not received within the preset time length, setting the second event processing equipment to be in a communication failure state;

wherein the communication failure state is used for representing that the second event processing equipment has communication failure.

Optionally, in a specific implementation manner, before the step of setting the second event processing device to the communication failure state, the method further includes:

determining whether the number of times of performing retransmission operations on the target data packet for the second event processing device reaches a preset number of times;

if yes, executing the step of setting the second event processing equipment to be in a communication failure state;

otherwise, returning to execute the retransmission operation of the target data packet for the second event processing device.

Optionally, in a specific implementation manner, the step of sending the target data packet to each second event processing device includes:

for each second event processing device, judging whether the second event processing device is in the communication failure state; and if not, sending the target data packet to the second event processing equipment.

Optionally, in a specific implementation manner, a first queue and a second queue are constructed in the management device, a third queue and a fourth queue are constructed in each event processing device, the first queue and the fourth queue are queues for buffering response packets, and the second queue and the third queue are queues for buffering data packets;

the step of feeding back the first response packet corresponding to the target data packet to the first event processing device includes:

generating a first response packet corresponding to the target data packet, and caching the first response packet into a first queue; according to a first-in first-out sending principle, sending the first response packet positioned in the first queue to the first event processing equipment;

the step of sending the target data packet to each second event processing device includes:

buffering the target data packet to the second queue; and sending the target data packet positioned in the second queue to each second event processing device according to the first-in first-out sending principle.

Accordingly, the method can be used for solving the problems that,

the mode of sending the target data packet to the management device and each second event processing device when the first event processing device detects an event includes:

when detecting an event, the first event processing device generates a target data packet corresponding to the event, and buffers the target data packet to the third queue; according to a first-in first-out sending principle, sending the target data packets positioned in the third queue to the management equipment and each second event processing equipment;

the way that each second event processing device feeds back a second response packet corresponding to the target data packet to the management device includes:

each second event processing device generates a second response packet corresponding to the target data packet, and caches the second response packet to the fourth queue; and feeding back the second response packet positioned in the fourth queue to the management equipment.

Corresponding to the multi-master network provided by the embodiment of the invention, the embodiment of the invention also provides a communication method applied to the first event processing equipment in the multi-master network. Wherein the multi-master network comprises: the management device and a plurality of event processing devices; the first event processing device is any one of the plurality of event processing devices.

Fig. 7 is a flowchart illustrating a communication method applied to a first event processing device in a multi-master network according to an embodiment of the present invention. As shown in fig. 7, the method may include the steps of:

s701: when an event is detected, sending a target data packet corresponding to the event to the management device and each second event processing device, so that the management device feeds back a first response packet corresponding to the target data packet to the first event processing device when receiving the target data packet, and each second event processing device discards the target data packet when receiving the target data packet sent by the first event processing device;

the management equipment sends the target data packet to each second event processing equipment, so that each second event processing equipment feeds back a second response packet corresponding to the target data packet to the management equipment when receiving the target data packet sent by the management equipment, and performs data response on the target data packet; the second event processing device is: a device other than the first event processing device among the plurality of event processing devices;

s702: and receiving a first response packet corresponding to the target data packet fed back by the management equipment.

As can be seen from the above, in the solution provided in the embodiment of the present invention, each event processing device will only feed back the response packet corresponding to the data packet to the management device when receiving the data packet sent by the management device, and for the data packet sent by another event processing device, the event processing device will discard the data packet and will not feed back the response packet corresponding to the data packet to another event processing device.

That is to say, in the solution provided in the embodiment of the present invention, during the communication process of the multi-master network, each event processing device only performs data validation with the management device, and data validation is not performed between each event processing device. In this way, when a plurality of concurrent events exist, each event processing device only performs data confirmation with the management device, so that the communication relation in the multi-master network can be greatly simplified, and the risk of network breakdown of the multi-master network is reduced.

Optionally, in a specific implementation manner, the step of sending, when an event is detected, a target data packet corresponding to the event to the management device and each of the second event processing devices includes:

when an event is detected, generating a plurality of target data packets for forming a target instruction corresponding to the event, and sequentially sending the plurality of target data packets to the management device and each second event processing device;

accordingly, the method can be used for solving the problems that,

the method for each second event processing device to perform data response on the target data packet includes:

judging whether all target data packets forming the target instruction are received or not;

if yes, all target data packets forming the target instruction are checked;

and after the verification is successful, executing the target instruction and emptying all target data packets forming the target instruction.

Optionally, in a specific implementation manner, a first queue and a second queue are constructed in the management device, a third queue and a fourth queue are constructed in each event processing device, the first queue and the fourth queue are queues for buffering response packets, and the second queue and the third queue are queues for buffering data packets;

the step of sending the target data packet corresponding to the event to the management device and each second event processing device when the event is detected includes:

when an event is detected, generating a target data packet corresponding to the event, and caching the target data packet to the third queue; and sending the target data packet positioned in the third queue to the management device and each second event processing device according to a first-in first-out sending principle.

Correspondingly, when receiving the target data packet, the management device feeds back a first response packet corresponding to the target data packet to the first event processing device, and sends the target data packet to each second event processing device, where the method includes:

when receiving the target data packet, the management device generates a first response packet corresponding to the target data packet, caches the first response packet to the first queue, and caches the target data packet to the second queue; according to a first-in first-out transmission principle, transmitting the first response packet located in the first queue to the first event processing equipment, and transmitting the target data packet located in the second queue to each second event processing equipment;

the way that each second event processing device feeds back a second response packet corresponding to the target data packet to the management device includes:

each second event processing device generates a second response packet corresponding to the target data packet, and caches the second response packet to the fourth queue; and feeding back the second response packet positioned in the fourth queue to the management equipment.

Corresponding to the multi-master network provided by the embodiment of the present invention, the embodiment of the present invention further provides a communication method applied to the second event processing device in the multi-master network. Wherein the multi-master network comprises the management device and a plurality of event processing devices; the second event processing device is any one of the plurality of event processing devices.

Fig. 8 is a flowchart illustrating a communication method applied to a second event processing device in a multi-master network according to an embodiment of the present invention. As shown in fig. 8, the method may include the steps of:

s801: receiving a target data packet sent by the management equipment, feeding back a second response packet corresponding to the target data packet to the management equipment, and performing data response on the target data packet;

the target data packet is a data packet sent to the management device and the second event processing device by a first event processing device when an event is detected, and the management device feeds back a first response packet corresponding to the target data packet to the first event processing device when receiving the target data packet sent by the first event processing device; the first event processing device is: any device of the plurality of event processing devices except the second event processing device;

s802: and receiving the target data packet sent by the first event processing equipment, and discarding the target data packet sent by the first event processing equipment.

As can be seen from the above, in the solution provided in the embodiment of the present invention, each event processing device will only feed back the response packet corresponding to the data packet to the management device when receiving the data packet sent by the management device, and for the data packet sent by another event processing device, the event processing device will discard the data packet and will not feed back the response packet corresponding to the data packet to another event processing device.

That is to say, in the solution provided in the embodiment of the present invention, during the communication process of the multi-master network, each event processing device only performs data validation with the management device, and data validation is not performed between each event processing device. In this way, when a plurality of concurrent events exist, each event processing device only performs data confirmation with the management device, so that the communication relation in the multi-master network can be greatly simplified, and the risk of network breakdown of the multi-master network is reduced.

Optionally, in a specific implementation manner, the step of performing data response on the target data packet includes:

judging whether all target data packets forming the target instruction are received or not; wherein, the all target data packets are: the first event processing device generates a plurality of data packets for constituting target instructions corresponding to an event when the event is detected, and sequentially transmits the plurality of target data packets to the management device and the second event processing device;

if yes, all target data packets forming the target instruction are checked;

and after the verification is successful, executing the target instruction and emptying all target data packets forming the target instruction.

Optionally, in a specific implementation manner, a first queue and a second queue are constructed in the management device, a third queue and a fourth queue are constructed in each event processing device, the first queue and the fourth queue are queues for buffering response packets, and the second queue and the third queue are queues for buffering data packets;

the step of feeding back the second response packet corresponding to the target data packet to the management device includes:

each second event processing device generates a second response packet corresponding to the target data packet, and caches the second response packet to the fourth queue; and feeding back the second response packet positioned in the fourth queue to the management equipment.

Accordingly, the method can be used for solving the problems that,

when detecting an event, the first event processing device sends a target data packet corresponding to the event to the management device and each second event processing device, including:

when an event is detected, generating a target data packet corresponding to the event, and caching the target data packet to the third queue; and sending the target data packet positioned in the third queue to the management device and each second event processing device according to a first-in first-out sending principle.

When receiving the target data packet, the management device feeds back a first response packet corresponding to the target data packet to the first event processing device, and sends the target data packet to each second event processing device, including:

when receiving the target data packet, the management device generates a first response packet corresponding to the target data packet, caches the first response packet to the first queue, and caches the target data packet to the second queue; and according to a first-in first-out transmission principle, transmitting the first response packet positioned in the first queue to the first event processing equipment, and transmitting the target data packet positioned in the second queue to each second event processing equipment.

Corresponding to the multi-master network provided by the embodiment of the invention, the embodiment of the invention also provides a communication device of the management equipment applied to the multi-master network. Wherein the multi-master network includes the management device and a plurality of event processing devices.

Fig. 9 is a schematic structural diagram of a communication apparatus applied to a management device in a multi-master network according to an embodiment of the present invention. As shown in fig. 9, the apparatus may include the following modules:

a first communication module 910, configured to receive a target data packet sent by a first event processing apparatus, and feed back a first response packet corresponding to the target data packet to the first event processing apparatus;

the target data packet is a data packet sent to the management device and each second event processing device by the first event processing device when an event is detected, and the target data packet is discarded by each second event processing device after the target data packet sent by the first event processing device is received;

the second communication module 920 is configured to send the target data packet to each second event processing device, so that each second event processing device feeds back a second response packet corresponding to the target data packet to the management device when receiving the target data packet, and performs data response on the target data packet;

wherein the first event processing device is: any one of the plurality of event processing devices; the second event processing device is: among the plurality of event processing devices, a device other than the first event processing device.

As can be seen from the above, in the solution provided in the embodiment of the present invention, each event processing device will only feed back the response packet corresponding to the data packet to the management device when receiving the data packet sent by the management device, and for the data packet sent by another event processing device, the event processing device will discard the data packet and will not feed back the response packet corresponding to the data packet to another event processing device.

That is to say, in the solution provided in the embodiment of the present invention, during the communication process of the multi-master network, each event processing device only performs data validation with the management device, and data validation is not performed between each event processing device. In this way, when a plurality of concurrent events exist, each event processing device only performs data confirmation with the management device, so that the communication relation in the multi-master network can be greatly simplified, and the risk of network breakdown of the multi-master network is reduced.

Optionally, in a specific implementation manner, the apparatus further includes:

the state setting module is used for executing retransmission operation of the target data packet for each second event processing device when the second response packet fed back by the second event processing device is not received within a preset time length; after the retransmission operation of the target data packet is executed, when the second response packet fed back by the second event processing equipment is not received within the preset time length, setting the second event processing equipment to be in a communication failure state;

wherein the communication failure state is used for representing that the second event processing equipment has communication failure.

Optionally, in a specific implementation manner, the apparatus further includes a number determining module, configured to determine, before the step of setting the second event processing device to the communication failure state, whether the number of times of performing the retransmission operation on the target data packet for the second event processing device reaches a preset number of times; if yes, executing the step of setting the second event processing equipment to be in a communication failure state; otherwise, returning to execute the retransmission operation of the target data packet for the second event processing device.

Optionally, in a specific implementation manner, the second communication module 920 is specifically configured to:

for each second event processing device, judging whether the second event processing device is in the communication failure state; and if not, sending the target data packet to the second event processing equipment.

Optionally, in a specific implementation manner, a first queue and a second queue are constructed in the management device, a third queue and a fourth queue are constructed in each event processing device, the first queue and the fourth queue are queues for buffering response packets, and the second queue and the third queue are queues for buffering data packets;

the first communication module 910 is specifically configured to:

generating a first response packet corresponding to the target data packet, and caching the first response packet into a first queue; according to a first-in first-out sending principle, sending the first response packet positioned in the first queue to the first event processing equipment;

the second communication module 920 is specifically configured to:

buffering the target data packet to the second queue; and sending the target data packet positioned in the second queue to each second event processing device according to the first-in first-out sending principle.

Accordingly, the method can be used for solving the problems that,

the mode of sending the target data packet to the management device and each second event processing device when the first event processing device detects an event includes:

when detecting an event, the first event processing device generates a target data packet corresponding to the event, and buffers the target data packet to the third queue; according to a first-in first-out sending principle, sending the target data packets positioned in the third queue to the management equipment and each second event processing equipment;

the way that each second event processing device feeds back a second response packet corresponding to the target data packet to the management device includes:

each second event processing device generates a second response packet corresponding to the target data packet, and caches the second response packet to the fourth queue; and feeding back the second response packet positioned in the fourth queue to the management equipment.

Corresponding to the multi-master network provided by the embodiment of the invention, the embodiment of the invention also provides a communication device applied to the first event processing equipment in the multi-master network. Wherein the multi-master network comprises: the management device and a plurality of event processing devices; the first event processing device is any one of the plurality of event processing devices.

Fig. 10 is a schematic structural diagram of a communication apparatus applied to a first event processing device in a multi-master network according to an embodiment of the present invention. As shown in fig. 10, the apparatus may include the following modules:

a first sending module 1010, configured to send, when an event is detected, a target data packet corresponding to the event to the management device and each second event processing device, so that the management device feeds back, to the first event processing device, a first response packet corresponding to the target data packet when receiving the target data packet, and each second event processing device discards the target data packet when receiving the target data packet sent by the first event processing device; the management equipment sends the target data packet to each second event processing equipment, so that each second event processing equipment feeds back a second response packet corresponding to the target data packet to the management equipment when receiving the target data packet sent by the management equipment, and performs data response on the target data packet; the second event processing device is: a device other than the first event processing device among the plurality of event processing devices;

a first receiving module 1020, configured to receive a first response packet corresponding to the target data packet fed back by the management device.

As can be seen from the above, in the solution provided in the embodiment of the present invention, each event processing device will only feed back the response packet corresponding to the data packet to the management device when receiving the data packet sent by the management device, and for the data packet sent by another event processing device, the event processing device will discard the data packet and will not feed back the response packet corresponding to the data packet to another event processing device.

That is to say, in the solution provided in the embodiment of the present invention, during the communication process of the multi-master network, each event processing device only performs data validation with the management device, and data validation is not performed between each event processing device. In this way, when a plurality of concurrent events exist, each event processing device only performs data confirmation with the management device, so that the communication relation in the multi-master network can be greatly simplified, and the risk of network breakdown of the multi-master network is reduced.

Optionally, in a specific implementation manner, the first sending module 1010 is specifically configured to:

when an event is detected, generating a plurality of target data packets for forming a target instruction corresponding to the event, and sequentially sending the plurality of target data packets to the management device and each second event processing device;

accordingly, the method can be used for solving the problems that,

the method for each second event processing device to perform data response on the target data packet includes:

judging whether all target data packets forming the target instruction are received or not;

if yes, all target data packets forming the target instruction are checked;

and after the verification is successful, executing the target instruction and emptying all target data packets forming the target instruction.

Optionally, in a specific implementation manner, a first queue and a second queue are constructed in the management device, a third queue and a fourth queue are constructed in each event processing device, the first queue and the fourth queue are queues for buffering response packets, and the second queue and the third queue are queues for buffering data packets;

the first sending module 1010 is specifically configured to:

when an event is detected, generating a target data packet corresponding to the event, and caching the target data packet to the third queue; and sending the target data packet positioned in the third queue to the management device and each second event processing device according to a first-in first-out sending principle.

Correspondingly, when receiving the target data packet, the management device feeds back a first response packet corresponding to the target data packet to the first event processing device, and sends the target data packet to each second event processing device, where the method includes:

when receiving the target data packet, the management device generates a first response packet corresponding to the target data packet, caches the first response packet to the first queue, and caches the target data packet to the second queue; according to a first-in first-out transmission principle, transmitting the first response packet located in the first queue to the first event processing equipment, and transmitting the target data packet located in the second queue to each second event processing equipment;

the way that each second event processing device feeds back a second response packet corresponding to the target data packet to the management device includes:

each second event processing device generates a second response packet corresponding to the target data packet, and caches the second response packet to the fourth queue; and feeding back the second response packet positioned in the fourth queue to the management equipment.

Corresponding to the multi-master network provided by the embodiment of the present invention, the embodiment of the present invention further provides a communication apparatus applied to a second event processing device in the multi-master network. Wherein the multi-master network comprises the management device and a plurality of event processing devices; the second event processing device is any one of the plurality of event processing devices.

Fig. 11 is a schematic structural diagram of a communication apparatus applied to a second event processing device in a multi-master network according to an embodiment of the present invention. As shown in fig. 11, the apparatus may include the following modules:

a second receiving module 1110, configured to receive a target data packet sent by the management device, feed back a second response packet corresponding to the target data packet to the management device, and perform data response on the target data packet; the target data packet is a data packet sent to the management device and the second event processing device by a first event processing device when an event is detected, and the management device feeds back a first response packet corresponding to the target data packet to the first event processing device when receiving the target data packet sent by the first event processing device; the first event processing device is: any device of the plurality of event processing devices except the second event processing device;

a third receiving module 1120, configured to receive the target data packet sent by the first event processing device, and discard the target data packet sent by the first event processing device.

As can be seen from the above, in the solution provided in the embodiment of the present invention, each event processing device will only feed back the response packet corresponding to the data packet to the management device when receiving the data packet sent by the management device, and for the data packet sent by another event processing device, the event processing device will discard the data packet and will not feed back the response packet corresponding to the data packet to another event processing device.

That is to say, in the solution provided in the embodiment of the present invention, during the communication process of the multi-master network, each event processing device only performs data validation with the management device, and data validation is not performed between each event processing device. In this way, when a plurality of concurrent events exist, each event processing device only performs data confirmation with the management device, so that the communication relation in the multi-master network can be greatly simplified, and the risk of network breakdown of the multi-master network is reduced.

Optionally, in a specific implementation manner, the second receiving module 1110 is specifically configured to:

judging whether all target data packets forming the target instruction are received or not; wherein, the all target data packets are: the first event processing device generates a plurality of data packets for constituting target instructions corresponding to an event when the event is detected, and sequentially transmits the plurality of target data packets to the management device and the second event processing device;

if yes, all target data packets forming the target instruction are checked;

and after the verification is successful, executing the target instruction and emptying all target data packets forming the target instruction.

Optionally, in a specific implementation manner, a first queue and a second queue are constructed in the management device, a third queue and a fourth queue are constructed in each event processing device, the first queue and the fourth queue are queues for buffering response packets, and the second queue and the third queue are queues for buffering data packets;

the second receiving module 1110 is specifically configured to:

each second event processing device generates a second response packet corresponding to the target data packet, and caches the second response packet to the fourth queue; and feeding back the second response packet positioned in the fourth queue to the management equipment.

Accordingly, the method can be used for solving the problems that,

when detecting an event, the first event processing device sends a target data packet corresponding to the event to the management device and each second event processing device, including:

when an event is detected, generating a target data packet corresponding to the event, and caching the target data packet to the third queue; and sending the target data packet positioned in the third queue to the management device and each second event processing device according to a first-in first-out sending principle.

When receiving the target data packet, the management device feeds back a first response packet corresponding to the target data packet to the first event processing device, and sends the target data packet to each second event processing device, including:

when receiving the target data packet, the management device generates a first response packet corresponding to the target data packet, caches the first response packet to the first queue, and caches the target data packet to the second queue; according to a first-in first-out transmission principle, transmitting the first response packet located in the first queue to the first event processing equipment, and transmitting the target data packet located in the second queue to each second event processing equipment;

it should be noted that, because any event processing device in the multi-master network can be simultaneously used as the first event processing device and the second event processing device, any event processing device can simultaneously include the first sending module 1010, the first receiving module 1020, the second receiving module 1110, and the third receiving module 1120.

Based on this, as shown in fig. 12, a schematic structural diagram of a communication device in any event processing device in a multi-master network according to an embodiment of the present invention is provided.

Corresponding to the multi-master network provided by the above embodiment of the present invention, an embodiment of the present invention further provides a management device, as shown in fig. 13, including a processor 1301, a communication interface 1302, a memory 1303 and a communication bus 1304, where the processor 1301, the communication interface 1302 and the memory 1303 complete mutual communication through the communication bus 1304,

a memory 1303 for storing a computer program;

the processor 1301 is configured to implement the communication method applied to the management device in the multi-master network according to the embodiment of the present invention when executing the program stored in the memory 1303.

Corresponding to the multi-master network provided by the above embodiment of the present invention, the embodiment of the present invention further provides an event processing device, and the event processing device is denoted as a first event processing device, as shown in fig. 14, and includes a processor 1401, a communication interface 1402, a memory 1403 and a communication bus 1404, wherein the processor 1401, the communication interface 1402 and the memory 1403 complete communication with each other through the communication bus 1404,

a memory 1403 for storing a computer program;

the processor 1401 is configured to implement the communication method applied to the first event processing apparatus in the multi-master network according to the embodiment of the present invention when executing the program stored in the memory 1403.

Corresponding to the multi-master network provided by the above embodiment of the present invention, the embodiment of the present invention further provides an event processing device, and the event processing device is denoted as a second event processing device, as shown in fig. 15, and includes a processor 1501, a communication interface 1502, a memory 1503, and a communication bus 1504, wherein the processor 1501, the communication interface 1502, and the memory 1503 complete communication with each other through the communication bus 1504,

a memory 1503 for storing a computer program;

the processor 1501 is configured to implement the communication method applied to the second event processing device in the multi-master network according to the embodiment of the present invention when executing the program stored in the memory 1503.

It should be noted that, because any event processing device in the multi-master network can be simultaneously used as the first event processing device and the second event processing device, the event processing devices shown in fig. 14 and fig. 15 can be the same event processing device, and the event processing device can simultaneously implement the communication method applied to the first event processing device and the second event processing device in the multi-master network according to the embodiment of the present invention.

The communication bus mentioned above for the management device and the event processing device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.

The communication interface is used for communication between the management device and the event processing device and other devices.

The Memory may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.

The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components.

In still another embodiment of the present invention, a first computer readable storage medium is further provided, in which a computer program is stored, and the computer program, when executed by a processor, implements the steps of any one of the above-mentioned communication methods applied to a management device in a multi-master network.

In yet another embodiment provided by the present invention, a second computer readable storage medium is further provided, in which a computer program is stored, and the computer program, when executed by a processor, implements the steps of any of the above-mentioned communication methods applied to the first event processing device in the multi-master network.

In yet another embodiment of the present invention, a third computer readable storage medium is further provided, in which a computer program is stored, and the computer program, when executed by a processor, implements the steps of any of the above communication methods applied to the second event processing device in the multi-master network.

It should be noted that, since any event processing device in the multi-master network can be simultaneously used as the first event processing device and the second event processing device, the second computer-readable storage medium and the third computer-readable storage medium may be the same computer-readable storage medium, and a computer program is stored in the same computer-readable storage medium, and when being executed by a processor, the computer program implements the steps of any communication method applied to the first event processing device and the second event processing device in the multi-master network.

In yet another embodiment of the present invention, there is also provided a first computer program product containing instructions which, when run on a computer, cause the computer to perform the steps of any one of the above embodiments of the communication method applied to a management device in a multi-master network.

In yet another embodiment of the present invention, there is also provided a second computer program product containing instructions, which when run on a computer, causes the computer to perform the steps of any one of the above-mentioned embodiments of the communication method applied to the first event processing device in the multi-master network.

In yet another embodiment of the present invention, there is provided a third computer program product containing instructions which, when run on a computer, causes the computer to perform the steps of any one of the above embodiments of the communication method applied to the second event processing device in the multi-master network.

It should be noted that, since any event processing device in the multi-master network can be simultaneously used as the first event processing device and the second event processing device, the second computer program product containing instructions and the third computer program product containing instructions may exist in the same computer program product containing instructions, and when the computer program product runs on a computer, the computer executes the steps of the communication method applied to the first event processing device and the second event processing device in the multi-master network in any of the above embodiments.

In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the invention to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.

It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.

All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, as for the method embodiments, the apparatus embodiments, the computer-readable storage medium embodiments, and the computer program product embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and reference may be made to some descriptions of the method embodiments for relevant points.

The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

37页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种基于无人机的智能森林防火系统

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!