Communication method, device and system

By using virtual communication addresses and heartbeat message mechanisms in distributed soft bus networking, the problem of business blackout periods caused by main device disconnection is solved, and the reliability of information synchronization between devices and the continuity of business connections are achieved.

CN115622891BActive Publication Date: 2025-10-10HUAWEI TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110726712.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-06-29
Publication Date
2025-10-10
Estimated Expiration
2041-06-29

AI Technical Summary

Technical Problem

In a distributed soft bus network, when the main device goes offline, it causes a service blackout period, affecting the reliability of the service connection.

Method used

The virtual communication address and heartbeat message mechanism are used to make the networking devices believe that the virtual master device is online and periodically send heartbeat messages to the virtual communication address to ensure the reliability of information synchronization.

Benefits of technology

It avoids the business blackout period caused by the main device being offline, and ensures the reliability of information synchronization between devices and the continuity of business connections.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115622891B_ABST
    Figure CN115622891B_ABST
Patent Text Reader

Abstract

The embodiment of the application provides a communication method, device and system, which can be applied to a first network. A network device in the first network synchronizes network information based on a virtual communication address. The network device can send a heartbeat message with a source address being the virtual communication address to represent that a virtual master device is in an online state. A second network device can perceive the offline of the first network device earlier than a third network device, and can send the heartbeat message with the source address being the virtual communication address to replace the first network device when the first network device is offline, so that the third network device can always perceive that the virtual master device is in the online state. The communication method can avoid the problem that, after the first network device for synchronizing network information is offline, the information synchronized on other devices is considered unreliable, and can avoid the problem that, in a double master device scenario, the processing logic of other devices is too complex.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communications, and in particular to communication methods, devices, and systems. Background Art

[0002] When communication devices are networked using a distributed soft bus, they need to exchange their own information to synchronize information across the entire network, enabling rapid discovery and connection between devices. However, as the number of devices using the distributed soft bus continues to increase, the amount of information that needs to be synchronized between devices is also growing exponentially, occupying a large amount of bandwidth resources.

[0003] In existing technology, after multiple devices are networked, they can first negotiate and select a master device. Then, other devices only need to exchange information with the master device, and the master device then synchronizes all information with other devices to achieve network-wide information synchronization. This method can reduce information exchange between devices and reduce bandwidth resources.

[0004] However, in this solution, since the information synchronized on other devices all originates from the master device, if the master device goes offline, the synchronized information on other devices becomes unreliable, temporarily preventing service connections between devices. Service connections can only be reestablished after the other devices reselect a new master and resynchronize information. This indicates that in this solution, when the master device used for network-wide information synchronization goes offline, service blackout periods occur, impacting the service experience. Summary of the Invention

[0005] The embodiments of the present application provide a communication method, apparatus, and system for solving the problem of a service blackout period in existing networks when a main device used for network-wide information synchronization goes offline.

[0006] To achieve the above objectives, the embodiments of the present application adopt the following technical solutions:

[0007] In a first aspect, a communication method is provided, which includes: a first networking device sending a virtual communication address, the virtual communication address being used by networking devices in a first group network to synchronize network-wide information, wherein the first networking device is a device with the highest weight in the first group network. The first networking device can also periodically send a heartbeat packet with a source address being the virtual communication address. In this scheme, the networking devices in the first group network synchronize network-wide information based on the virtual communication address sent by the first networking device. Except for the first networking device, the networking devices in the first group network consider that the synchronized information comes from a virtual master device corresponding to the virtual communication address. The first networking device also periodically sends a heartbeat packet with a source address being the virtual communication address to represent the online status of the virtual master device. Thus, as long as there is a device maintaining the online status of the virtual master device, the information synchronized by the networking devices in the first group network is considered to be reliable, and the problem of a service black account period caused by a master device for network-wide information synchronization going offline in the prior art can be avoided.

[0008] In combination with the first aspect, in a possible implementation, the virtual communication address being used by the networking devices in the first group network to synchronize network-wide information can include: the first networking device receiving a first packet from other networking devices in the first group network, the first packet including first information of the other networking devices for network-wide information synchronization, wherein a destination address of the first packet is the virtual communication address. The first networking device sending a second packet, the second packet including first information of each networking device in the first group network for network-wide information synchronization, a source address of the second packet being the virtual communication address. Based on this scheme, except for the first networking device, other networking devices send first information of their own devices for network-wide information synchronization according to the virtual communication address, and the first networking device also synchronizes network-wide information for other networking devices using the virtual communication address as a source address, so that other networking devices do not perceive that the device for network-wide information synchronization is the first networking device, but a virtual master device corresponding to the virtual communication address.

[0009] In combination with the first aspect, in a possible implementation, the first networking device sending the virtual communication address can include: the first networking device sending a third packet, wherein a source address of the third packet is the virtual communication address. In other words, the first networking device announces the virtual communication address by sending the third packet with a source address being the virtual communication address.

[0010] In conjunction with the first aspect above, in one possible implementation, the virtual communication address is a virtual network address. The communication method may further include: the first networking device sending a first hardware address corresponding to the virtual communication network address, wherein the first hardware address is the hardware address of the first networking device and is used to address the first networking device. Based on this solution, when the virtual communication address is a virtual network address, networking devices other than the first networking device can identify the real hardware address corresponding to the virtual network address and then send a message with the destination address being the virtual communication address to the first networking device corresponding to the real hardware address.

[0011] In conjunction with the first aspect above, in one possible implementation, before the first networking device sends the first hardware address corresponding to the virtual communication network address, the communication method may further include: the first networking device receiving a first request message, where the first request message is used to request the hardware address corresponding to the virtual communication address. Based on this solution, when the virtual communication address is a virtual network address, other networking devices can also obtain the first hardware address corresponding to the virtual communication network by sending a request message.

[0012] In combination with the first aspect above, in a possible implementation, the communication method provided by the embodiment of the present application may further include: after completing the synchronization of the entire network information, the first networking device generates a first topology serial number and first summary information, wherein the first topology serial number is used to indicate the version of the entire network topology information currently known to the first networking device, and the first summary information includes the identifier of each networking device in the first network and its corresponding first version number, wherein the first version number is used to indicate the version of the corresponding networking device's own topology information. The first networking device sends the first summary information. Based on this solution, the first networking device can record the online networking devices in the first network and the version of the entire network topology information of the first network.

[0013] In combination with the above-mentioned first aspect, in a possible implementation method, the communication method provided by the embodiment of the present application may also include: the first networking device determines that the topology information of a networking device in the first network has changed. The first networking device updates the first topology serial number stored on the first networking device and the first version number corresponding to the networking device where the topology information occurs in the first summary information. The first networking device sends a fourth message, and the fourth message includes the updated first topology serial number of the first networking device and the updated first summary information, wherein the source address of the fourth message is a virtual communication address. Based on this scheme, when the topology information of a networking device in the first network has changed, the first networking device can dynamically update its first topology serial number and first summary information, and can inform other networking devices through the fourth message.

[0014] With reference to the first aspect, in a possible implementation manner, the first networking device determining that the topology information of the networking device existing in the first networking changes comprises: the first networking device determining that the topology information of the first networking device changes. Alternatively, the first networking device receives a fifth message, and the fifth message comprises updated topology information of the networking device whose topology information changes, where the destination address of the fifth message is the virtual communication address. In other words, the first networking device senses that the topology information of any networking device existing in the first networking changes.

[0015] With reference to the first aspect, in a possible implementation manner, the communication method provided by the embodiments of the present application can further comprise: the first networking device determining that a networking device existing in the first networking goes offline. The first networking device updates the first topology sequence number stored on the first networking device, and removes the identifier of the networking device going offline and the first version number corresponding to the identifier from the first digest information stored on the first networking device. The first networking device sends a sixth message, and the sixth message comprises the updated first topology sequence number and the updated first digest information of the first networking device, where the source address of the sixth message is the virtual communication address. Based on the scheme, the first networking device can update the information recorded locally when determining that a networking device existing in the first networking goes offline, and can also inform other networking devices.

[0016] With reference to the first aspect, in a possible implementation manner, the first networking device determining that a networking device existing in the first networking goes offline comprises: in a case where the first networking device does not receive a heartbeat message sent by a certain networking device other than the first networking device for consecutive x times, the first networking device determines that a networking device existing in the first networking goes offline. Based on the scheme, the first networking device can sense the online state of other networking devices through the heartbeat message of the other networking devices.

[0017] In conjunction with the first aspect above, in one possible implementation, the communication method provided in an embodiment of the present application may further include: a first networking device receiving a heartbeat message whose source address is the communication address of a fourth networking device, where the fourth networking device is a newly online networking device in the first network. The first networking device sending a seventh message to the fourth networking device, updating the first topology sequence number stored on the first networking device, and adding the identifier of the fourth networking device and the corresponding first version number to the first summary information stored on the first networking device. The seventh message includes first information for each networking device in the first network to synchronize network-wide information, and the source address of the seventh message is a virtual communication address. The first networking device sending an eighth message, including the updated first topology sequence number and updated first summary information of the first networking device, and the source address of the eighth message is the virtual communication address. Based on this solution, the first networking device can detect the newly added networking device in the first network and synchronize network-wide information for the newly added networking device, as well as synchronize information of the newly added networking device with other currently online networking devices.

[0018] In a second aspect, a communication method is provided, which includes: a second networking device receives a virtual communication address, the virtual communication address is used for networking devices in the first network to synchronize network-wide information, and the second networking device is the networking device with the second highest weight in the first network. After the second networking device fails to receive a heartbeat message with a source address of the virtual communication address for n consecutive times, it determines that the first networking device is offline, where n is less than m, n and m are both positive integers, and m is the number of times the third networking device fails to receive a heartbeat message with a source address of the virtual communication address when determining that the first networking device is offline. The first networking device is the networking device with the highest weight in the first network, and the third networking device is the networking device in the first network other than the first networking device and the second networking device. The second networking device takes over the first networking device's periodic transmission of heartbeat messages with a source address of the virtual communication address. In this solution, the networking devices in the first network synchronize network-wide information based on the virtual communication address sent by the first networking device. Networking devices other than the first networking device will believe that the information they synchronize comes from the virtual master device corresponding to the virtual communication address. The heartbeat messages periodically sent by the first networking device with the source address of the virtual communication address can indicate the online status of the virtual master device. When the first networking device goes offline, the second networking device can take over the role of the first networking device in periodically sending heartbeat messages with the source address of the virtual communication address, allowing other networking devices to always perceive that the virtual master device is online. As a result, the information synchronized by the networking devices in the first network will be considered reliable, avoiding the problem of business blackout periods caused by the master device used for network-wide information synchronization going offline in the existing technology.

[0019] In conjunction with the second aspect described above, in one possible implementation, a virtual communication address is used by networking devices in a first network to synchronize network-wide information, including: a second networking device sends a first message, the first message including first information used by the second networking device for network-wide information synchronization, wherein the destination address of the first message is the virtual communication address. The second networking device receives a second message, the second message including first information used by each networking device in the first network for network-wide information synchronization. The source address of the second message is the virtual communication address. Based on this solution, the second networking device communicates based on the virtual communication address during network-wide information synchronization. As a result, the information synchronized by the second networking device is considered to come from the device corresponding to the virtual communication address.

[0020] In conjunction with the second aspect, in one possible implementation, the second networking device receiving the virtual communication address includes: the second networking device receiving a third message, wherein the source address of the third message is the virtual communication address. In other words, the first networking device notifies the second networking device of the virtual communication address by sending the third message with the source address being the virtual communication address.

[0021] In conjunction with the second aspect above, in one possible implementation, the communication method provided in an embodiment of the present application may further include: a second networking device receiving a hardware address corresponding to the virtual communication address. Based on this solution, when the virtual communication address is a virtual network address, the second networking device can communicate based on the virtual network address.

[0022] In conjunction with the second aspect above, in one possible implementation, after the second networking device receives the virtual communication address and before the second networking device receives the hardware address corresponding to the virtual communication address, the method further includes: the second networking device sending a first request message, where the first request message is used to request the hardware address corresponding to the virtual communication address. In other words, when the virtual communication address is a virtual network address, the second networking device can actively request the hardware address corresponding to the virtual network address.

[0023] In conjunction with the above-mentioned second aspect, in one possible implementation, after the second networking device receives the second message, the communication method provided in the embodiment of the present application may further include: the second networking device generating a second topology sequence number, the second topology sequence number being used to indicate the version of the full network topology information currently known to the second networking device. The second networking device receives first summary information, the first summary information including an identifier of each networking device in the first network and its corresponding first version number, the first version number being used to indicate the version of the corresponding networking device's own topology information.

[0024] In conjunction with the second aspect described above, in one possible implementation, the communication method provided in an embodiment of the present application may further include: after the second networking device's own topology information changes, the second networking device updates a locally stored second topology sequence number and sends a fifth message to the first networking device, where the fifth message includes the updated topology information of the second networking device, and the destination address of the fifth message is a virtual communication address. Based on this solution, after the second networking device's own topology information changes, it notifies the first networking device of the updated topology information.

[0025] In conjunction with the second aspect above, in one possible implementation, a heartbeat message whose source address is a virtual communication address includes a first topology sequence number stored by the first networking device. Before the second networking device sends a fifth message to the first networking device, the communication method further includes: the second networking device determines that the locally stored second topology sequence number is newer than the first topology sequence number stored by the first networking device. Based on this solution, when the topology information of the second networking device changes but has not yet been synchronized to the first networking device, the second topology sequence number locally stored by the second networking device will be newer than the first topology sequence number. In this case, the updated topology information needs to be synchronized to the first networking device.

[0026] In combination with the above-mentioned second aspect, in a possible implementation method, the communication method provided by the embodiment of the present application also includes: the second networking device receives a fourth message, and the fourth message includes the first topology serial number and the first summary information stored by the first networking device. When the second networking device determines that the first topology serial number stored by the first networking device is newer than the second topology serial number locally stored by the second networking device, the second networking device determines whether it is necessary to synchronize the updated topology information based on the first summary information of the first networking device. If necessary, the updated topology information is obtained from the first networking device, and the locally stored second topology serial number is updated. Based on this scheme, after the topology information of the networking device in the first network changes, the second networking device can receive the fourth message, so that it can choose whether to synchronize the updated topology information.

[0027] In combination with the above-mentioned second aspect, in a possible implementation method, the heartbeat message whose source address is the virtual communication address includes the first topology sequence number stored by the first networking device. The communication method also includes: when the second networking device determines that the first topology sequence number stored by the first networking device is newer than the second topology sequence number stored locally by the second networking device, the second networking device determines whether it is necessary to synchronize the updated topology information based on the first summary information of the first networking device. If necessary, the updated topology information is obtained from the first networking device, and the locally stored second topology sequence number is updated. Based on this solution, the second networking device can sense whether there is a change in the topology information of the networking device in the first network based on the first topology sequence number in the heartbeat message, and can selectively synchronize the updated topology information based on the first summary information. Transmitting information through heartbeat messages can save communication resources.

[0028] In a third aspect, a communication method is provided, comprising: a third networking device receiving a virtual communication address, the virtual communication address being used by networking devices in a first network to synchronize network-wide information; and after completing the synchronization of network-wide information, the third networking device receiving a heartbeat message whose source address is the virtual communication address.

[0029] In conjunction with the third aspect, in one possible implementation, a virtual communication address is used by networking devices in a first network to synchronize network-wide information, including: a third networking device sends a first message, the first message including first information used by the third networking device for network-wide information synchronization, wherein the destination address of the first message is the virtual communication address; and the third networking device receives a second message, the second message including first information used by each networking device in the first network for network-wide information synchronization, wherein the source address of the second message is the virtual communication address.

[0030] In combination with the third aspect above, in a possible implementation manner, the third networking device receives the virtual communication address, including: the third networking device receives a third message, wherein the source address of the third message is the virtual communication address.

[0031] In combination with the third aspect above, in a possible implementation, the communication method provided in the embodiment of the present application may further include: the third networking device receives a hardware address corresponding to the virtual communication network address.

[0032] In combination with the above-mentioned third aspect, in a possible implementation method, after the third networking device receives the virtual communication address and before the third networking device receives the hardware address corresponding to the virtual communication address, the communication method provided in the embodiment of the present application may also include: the third networking device sends a first request message, and the first request message is used to request the hardware address corresponding to the virtual communication address.

[0033] In conjunction with the third aspect above, in one possible implementation, after the third networking device receives the second message, the communication method provided in the embodiment of the present application may further include: the third networking generating a third topology sequence number, the third topology sequence number being used to indicate the version of the full network topology information currently known to the third networking device. The third networking device receives first summary information, the first summary information including an identifier of each networking device in the first network and its corresponding first version number, the first version number being used to indicate the version of the corresponding networking device's own topology information.

[0034] In combination with the above-mentioned third aspect, in a possible implementation method, the communication method provided by the embodiment of the present application may also include: after the third networking device's own topology information changes, the third networking device updates the locally stored third topology serial number and sends a fifth message to the first networking device, the fifth message including the updated topology information of the third networking device, wherein the destination address of the fifth message is a virtual communication address.

[0035] In conjunction with the third aspect above, in one possible implementation, a heartbeat message whose source address is the virtual communication address includes a first topology sequence number stored by the first networking device. Before the third networking device sends the fifth message to the first networking device, the communication method provided in this embodiment of the present application further includes: the third networking device determining that the locally stored third topology sequence number is newer than the first topology sequence number stored by the first networking device.

[0036] In conjunction with the third aspect described above, in one possible implementation, the communication method provided in an embodiment of the present application further includes: the third networking device receives a fourth message, the fourth message including the first topology sequence number and first summary information stored by the first networking device. Upon determining that the first topology sequence number stored by the first networking device is newer than the third topology sequence number locally stored by the third networking device, the third networking device determines whether to synchronize the updated topology information based on the first summary information of the first networking device. If necessary, the updated topology information is obtained from the first networking device, and the locally stored third topology sequence number is updated.

[0037] In conjunction with the third aspect described above, in one possible implementation, a heartbeat message whose source address is a virtual communication address includes a first topology sequence number stored by the first networking device. The communication method provided in this embodiment of the present application may further include: upon determining that the first topology sequence number stored by the first networking device is newer than a third topology sequence number locally stored by the third networking device, the third networking device determines whether to synchronize updated topology information based on the first summary information of the first networking device. If necessary, the updated topology information is obtained from the first networking device, and the locally stored third topology sequence number is updated.

[0038] In a fourth aspect, a communication system is provided, comprising a first networking device, a second networking device, and a third networking device. The first networking device is the networking device with the highest weight in the first network, the second networking device is the networking device with the second highest weight in the first network, and the third networking device is the networking device in the first network other than the first and second networking devices. The first networking device is configured to send a virtual communication address, which is used by networking devices in the first network to synchronize network-wide information. The first networking device is further configured to periodically send heartbeat messages with the virtual communication address as the source address after completing network-wide information synchronization. The second networking device is configured to determine that the first networking device is offline after failing to receive heartbeat messages with the virtual communication address as the source address for n consecutive times, where n is less than m, and both n and m are positive integers, and m is the number of times the third networking device failed to receive heartbeat messages with the virtual communication address as the source address when determining that the first networking device is offline. The second networking device is further configured to take over the first networking device's responsibility for periodically sending heartbeat messages with the virtual communication address as the source address.

[0039] Based on this solution, the networking devices in the first network synchronize network-wide information based on the virtual communication address. The first networking device can send a heartbeat message with the virtual communication address as the source address to indicate that the virtual master device is online. The second networking device senses the offline of the first networking device before the third networking device, and can take over the heartbeat message with the virtual communication address as the source address when the first networking device goes offline, allowing the third networking device to always sense that the virtual master device is online. This communication method can avoid the problem of business blackout periods caused by the unreliability of the synchronized information in the networking devices after the device used for network-wide information synchronization goes offline.

[0040] In conjunction with the fourth aspect above, in one possible implementation, the second networking device is further configured to feedback a heartbeat message whose source address is the communication address of the second networking device once every y times it receives a heartbeat message whose source address is the virtual communication address. And / or, the third networking device is further configured to feedback a heartbeat message whose source address is the communication address of the third networking device once every y times it receives a heartbeat message whose source address is the virtual communication address. Wherein, x is a positive integer greater than 1. Based on this solution, networking devices other than the first networking device can feedback a heartbeat message whose source address is the virtual communication address when receiving a heartbeat message whose source address is the virtual communication address, to indicate that they are online.

[0041] In a fifth aspect, the present application provides a communication device, which may be a first networking device or a chip or chip system in the first networking device, or a functional module in the first networking device for implementing the method described in the first aspect or any possible design of the first aspect, or a functional module in the fourth aspect or any possible design of the fourth aspect. The communication device can implement the functions performed by the first networking device in the above-mentioned aspects or possible designs, and the functions can be implemented by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above-mentioned functions. For example, the communication device may include: a transceiver module and a processing module.

[0042] In conjunction with the fifth aspect, in one possible design, the transceiver module is configured to send a virtual communication address, which is used by networking devices in the first network to synchronize network-wide information. The transceiver module is also configured to periodically send heartbeat messages whose source address is the virtual communication address.

[0043] In conjunction with the fifth aspect, in one possible design, the transceiver module is further configured to receive a first message from another networking device in the first network, the first message including first information used by the other networking device for network-wide information synchronization, and the destination address of the first message being the virtual communication address. The transceiver module is further configured to send a second message including first information used by each networking device in the first network for network-wide information synchronization, and the source address of the second message being the virtual communication address.

[0044] In combination with the above-mentioned fifth aspect, in a possible design, the transceiver module is used to send the virtual communication address, including: being used to send a third message, and the source address of the third message is the virtual communication address.

[0045] In conjunction with the fifth aspect, in one possible design, the virtual communication address is a virtual network address. The transceiver module is further configured to send a first hardware address corresponding to the virtual communication network address, wherein the first hardware address is a hardware address of a first networking device and is used to address the first networking device.

[0046] In combination with the above-mentioned fifth aspect, in a possible design, the transceiver module is also used to receive a first request message, and the first request message is used to request the hardware address corresponding to the virtual communication address.

[0047] In conjunction with the fifth aspect above, in one possible design, the processing module is further configured to generate a first topology sequence number and first summary information. The first topology sequence number is used to indicate the version of the full network topology information currently known to the first networking device. The first summary information includes an identifier of each networking device in the first network and its corresponding first version number. The first version number is used to indicate the version of the topology information of the corresponding networking device itself. The transceiver module is further configured to send the first summary information.

[0048] With reference to the fifth aspect above, in a possible design, the processing module is further configured to determine that topology information of a networking device existing in the first group network changes, and update the first topology sequence number stored on the first networking device and the first version number corresponding to the networking device whose topology information changes in the first digest information stored on the first networking device. The transceiver module is further configured to send a fourth message, where the fourth message includes the updated first topology sequence number and the updated first digest information of the first networking device, and the source address of the fourth message is the virtual communication address.

[0049] With reference to the fifth aspect above, in a possible design, the processing module is configured to determine that topology information of a networking device existing in the first group network changes, including: being configured to determine that topology information of the first networking device changes; or being configured to receive, by the transceiver module, a fifth message, where the fifth message includes updated topology information of the networking device whose topology information changes, and the destination address of the fifth message is the virtual communication address.

[0050] With reference to the fifth aspect above, in a possible design, the processing module is further configured to determine that a networking device existing in the first group network is offline, and update the first topology sequence number stored on the first networking device, and remove the identifier of the offline networking device and the first version number corresponding to the offline networking device in the first digest information stored on the first networking device. The transceiver module is further configured to send a sixth message, where the sixth message includes the updated first topology sequence number and the updated first digest information of the first networking device, and the source address of the sixth message is the virtual communication address.

[0051] With reference to the fifth aspect above, in a possible design, the processing module is configured to determine that a networking device existing in the first group network is offline, including: being configured to determine that a networking device existing in the first group network is offline, in a case where heartbeat messages sent by a networking device other than the first networking device in the first group network are not received for x consecutive times, where x is a positive integer.

[0052] With reference to the fifth aspect above, in a possible design, the transceiver module is further configured to receive a heartbeat message with a source address being a communication address of a fourth networking device, where the fourth networking device is a newly online networking device in the first group network. The transceiver module is further configured to send a seventh message to the fourth networking device, where the seventh message includes the first information used for network-wide information synchronization by each networking device in the first group network, and the source address of the seventh message is the virtual communication address. The processing module is further configured to update the first topology sequence number stored on the first networking device, and add the identifier of the fourth networking device and the first version number corresponding to the fourth networking device in the first digest information stored on the first networking device. The transceiver module is further configured to send an eighth message, where the eighth message includes the updated first topology sequence number and the updated first digest information of the first networking device, and the source address of the eighth message is the virtual communication address.

[0053] In a sixth aspect, the present application provides a communication device, which may be a second networking device or a chip or chip system in the second networking device, or a functional module in the second networking device for implementing the method described in the second aspect or any possible design of the second aspect, or a functional module in the fourth aspect or any possible design of the fourth aspect. The communication device can implement the functions performed by the second networking device in the above-mentioned aspects or possible designs, and the functions can be implemented by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above-mentioned functions. For example, the communication device may include: a transceiver module and a processing module.

[0054] The transceiver module is used to receive a virtual communication address, which is used for the networking devices in the first network to synchronize the information of the entire network. The second networking device is the networking device with the second highest weight in the first network. The processing module is used to determine that the first networking device is offline after failing to receive a heartbeat message with a source address of the virtual communication address for n consecutive times, where n is less than m, n and m are both positive integers, and m is the number of times the third networking device fails to receive a heartbeat message with a source address of the virtual communication address when determining that the first networking device is offline. The first networking device is the networking device with the highest weight in the first network, and the third networking device is the networking device in the first network other than the first networking device and the second networking device. The processing module is also used to take over the periodic transmission of heartbeat messages with a source address of the virtual communication address from the first networking device.

[0055] In conjunction with the sixth aspect, in one possible design, the transceiver module is further configured to send a first message, the first message including first information used by the second networking device for network-wide information synchronization, and the destination address of the first message being the virtual communication address. The transceiver module is further configured to receive a second message, the second message including first information used by each networking device in the first network for network-wide information synchronization, and the source address of the second message being the virtual communication address.

[0056] In combination with the above-mentioned sixth aspect, in a possible design, the transceiver module is used to receive the virtual communication address, including: being used to receive a third message, the source address of the third message being the virtual communication address.

[0057] In combination with the sixth aspect mentioned above, in one possible design, the transceiver module is also used to receive the hardware address corresponding to the virtual communication address.

[0058] In combination with the above-mentioned sixth aspect, in a possible design, the transceiver module is also used to send a first request message, and the first request message is used to request the hardware address corresponding to the virtual communication address.

[0059] In conjunction with the sixth aspect, in one possible design, the processing module is further configured to generate a second topology serial number, which is used to indicate the version of the network-wide topology information currently known to the second networking device. The transceiver module is configured to receive first summary information, which includes an identifier of each networking device in the first network and its corresponding first version number, which is used to indicate the version of the topology information of the corresponding networking device itself.

[0060] In conjunction with the sixth aspect, in one possible design, the processing module is further configured to update the locally stored second topology sequence number after its own topology information changes. The transceiver module is further configured to send a fifth message to the first networking device, the fifth message including the updated topology information of the second networking device, and the destination address of the fifth message being the virtual communication address.

[0061] In conjunction with the sixth aspect, in one possible design, a heartbeat message whose source address is a virtual communication address includes a first topology sequence number stored by the first networking device. The processing module is further configured to determine whether the locally stored second topology sequence number is newer than the first topology sequence number stored by the first networking device.

[0062] In conjunction with the sixth aspect, in one possible design, the transceiver module is further configured to receive a fourth message, the fourth message including a first topology sequence number and first summary information stored by the first networking device. The processing module is further configured to determine whether the first topology sequence number stored by the first networking device is newer than a second topology sequence number locally stored by the second networking device, and to determine whether updated topology information needs to be synchronized based on the first summary information of the first networking device. If necessary, the updated topology information is obtained from the first networking device, and the locally stored second topology sequence number is updated.

[0063] In conjunction with the sixth aspect, in one possible design, a heartbeat message whose source address is the virtual communication address includes a first topology sequence number stored by the first networking device. The processing module is further configured to determine whether the first topology sequence number stored by the first networking device is newer than a second topology sequence number locally stored by the second networking device, and to determine whether updated topology information needs to be synchronized based on the first summary information of the first networking device. If necessary, the updated topology information is obtained from the first networking device and the locally stored second topology sequence number is updated.

[0064] In a seventh aspect, the present application provides a communication device, which may be a third networking device or a chip or chip system in the third networking device, or a functional module in the third networking device for implementing the method described in the third aspect or any possible design of the third aspect, or a functional module in the fourth aspect or any possible design of the fourth aspect. The communication device can implement the functions performed by the third networking device in the above aspects or possible designs, and the functions can be implemented by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions. For example, the communication device may include: a transceiver module and a processing module.

[0065] The transceiver module is used to receive a virtual communication address, which is used by networking devices in the first network to synchronize network-wide information. The transceiver module is also used to receive a heartbeat message whose source address is the virtual communication address.

[0066] In conjunction with the seventh aspect, in one possible design, the transceiver module is further configured to send a first message, the first message including first information used by a third networking device for network-wide information synchronization, and the destination address of the first message being the virtual communication address. The transceiver module is further configured to receive a second message, the second message including first information used by each networking device in the first network for network-wide information synchronization, and the source address of the second message being the virtual communication address.

[0067] In combination with the above-mentioned seventh aspect, in a possible design, the transceiver module is used to receive the virtual communication address, including: used to receive a third message, the source address of the third message is the virtual communication address.

[0068] In combination with the above-mentioned seventh aspect, in a possible design, the transceiver module is also used to receive the hardware address corresponding to the virtual communication network address.

[0069] In combination with the above-mentioned seventh aspect, in a possible design, the transceiver module is also used to send a first request message, and the first request message is used to request the hardware address corresponding to the virtual communication address.

[0070] In conjunction with the seventh aspect, in one possible design, the processing module is further configured to generate a third topology serial number, which is used to indicate the version of the network-wide topology information currently known to the third networking device. The transceiver module is further configured to receive first summary information, which includes an identifier of each networking device in the first network and its corresponding first version number, which is used to indicate the version of the topology information of the corresponding networking device itself.

[0071] In conjunction with the seventh aspect, in one possible design, the processing module is further configured to update the locally stored third topology sequence number after its own topology information changes. The transceiver module is further configured to send a fifth message to the first networking device, the fifth message including the updated topology information of the third networking device, wherein the destination address of the fifth message is the virtual communication address.

[0072] In conjunction with the seventh aspect, in one possible design, the heartbeat message whose source address is the virtual communication address includes the first topology sequence number stored by the first networking device. The processing module is further configured to determine whether the locally stored third topology sequence number is newer than the first topology sequence number stored by the first networking device.

[0073] In conjunction with the seventh aspect, in one possible design, the transceiver module is further configured to receive a fourth message, the fourth message including the first topology sequence number and first summary information stored by the first networking device. The processing module is further configured to determine whether the first topology sequence number stored by the first networking device is newer than the third topology sequence number locally stored by the third networking device, and to determine whether the updated topology information needs to be synchronized based on the first summary information of the first networking device. If necessary, the updated topology information is obtained from the first networking device, and the locally stored third topology sequence number is updated.

[0074] In conjunction with the seventh aspect, in one possible design, a heartbeat message whose source address is the virtual communication address includes a first topology sequence number stored by the first networking device. The processing module is further configured to determine whether the first topology sequence number stored by the first networking device is newer than a third topology sequence number locally stored by a third networking device, and to determine whether updated topology information needs to be synchronized based on the first summary information of the first networking device. If necessary, the updated topology information is obtained from the first networking device, and the locally stored third topology sequence number is updated.

[0075] In an eighth aspect, a communication device is provided, which has the function of implementing the method described in the first, second, or third aspects above. The function can be implemented by hardware or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions.

[0076] In the ninth aspect, a communication device is provided, comprising: a processor and a memory; the memory is used to store computer-executable instructions, and when the communication device is running, the processor executes the computer-executable instructions stored in the memory to enable the communication device to perform a communication method as described in any one of the first, second or third aspects above.

[0077] In the tenth aspect, a communication device is provided, comprising: a processor; the processor is used to couple with a memory, and after reading instructions in the memory, execute a communication method as described in any one of the first aspect, second aspect or third aspect according to the instructions.

[0078] In the eleventh aspect, a computer-readable storage medium is provided, in which instructions are stored. When the computer-readable storage medium is run on a computer, the computer can execute the communication method described in any one of the first aspect, the second aspect or the third aspect.

[0079] In a twelfth aspect, a computer program product comprising instructions is provided, which, when executed on a computer, enables the computer to execute the communication method described in any one of the first, second or third aspects above.

[0080] In a thirteenth aspect, a device (e.g., a chip system) is provided, comprising a processor for supporting a communication device in implementing the functions described in the first, second, or third aspects above. In one possible design, the device further comprises a memory for storing program instructions and data necessary for the communication device. When the device is a chip system, it may be composed of a chip or may include a chip and other discrete components.

[0081] Among them, the technical effects brought about by any design method in the fifth to thirteenth aspects can refer to the technical effects brought about by different design methods in the first to third aspects, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0082] Figure 1 A schematic diagram of a near-field device interconnection scenario provided in an embodiment of the present application;

[0083] Figure 2 A schematic diagram of information interaction between networking devices provided in an embodiment of the present application;

[0084] Figure 3 A schematic diagram of a communication system provided in an embodiment of the present application;

[0085] Figure 4 A schematic diagram of the structure of a communication device provided in an embodiment of the present application;

[0086] Figure 5 A flow chart of a communication method provided in an embodiment of the present application;

[0087] Figure 6 A schematic diagram of a first network provided in an embodiment of the present application;

[0088] Figure 7A schematic diagram of another first network provided in an embodiment of the present application;

[0089] Figure 8 A schematic diagram of a dynamic ARP process between networking devices provided in an embodiment of the present application;

[0090] Figure 9 A flowchart of a first network in which networking devices synchronize network-wide information according to a virtual communication address is provided in an embodiment of the present application;

[0091] Figure 10 A schematic diagram of a message format provided in an embodiment of the present application;

[0092] Figure 11 A schematic diagram of another message format provided in an embodiment of the present application;

[0093] Figure 12 A flowchart of another communication method provided in an embodiment of the present application;

[0094] Figure 13 A flowchart of another communication device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0095] In order to facilitate understanding of the technical solutions of the embodiments of the present application, a brief introduction or definition of the relevant technologies of the present application is first given as follows.

[0096] First, distributed device interconnection:

[0097] With the development of Internet of Things (IoT) devices, the demand for interconnection between devices is also increasing. For example, the 1+8+N technology proposed in the existing technology, with mobile phones as the center, realizes the interconnection between mobile phones and personal computers (PCs), tablets, smart screens, speakers, glasses, watches, car machines, headphones, and more smart devices, thereby realizing the following functions: the mobile phone can be projected onto a large display screen, the mobile phone music can be projected to supported devices for playback, and the mobile phone can share files with other mobile phones, tablets, or PCs connected to it. Currently, services can use a local area network based on access point (AP) mode for communication; or, services can use wireless fidelity peer to peer (WiFi P2P) connection for communication; or, services can use Bluetooth connection, such as Bluetooth low energy (BLE) or classic Bluetooth (BR / EDR).

[0098] Second, the computer bus:

[0099] A computer bus is an internal structure of a computer. In a computer system, the various components of the mainframe are connected via the bus, and external devices are connected to the bus via corresponding interface circuits. Therefore, the bus can be considered the common communication trunk for transmitting information between the various functional components of the computer (CPU, memory, input and output devices, etc.). Based on the type of information transmitted, buses can be divided into data buses, address buses, and control buses, used to transmit data, data addresses, and control signals, respectively.

[0100] Third, distributed soft bus:

[0101] In existing technologies, a distributed soft bus is designed for communication between distributed devices, mimicking a computer bus. Distributed soft bus technology is based on the interconnection of near-field devices and is dedicated to achieving unified distributed communication capabilities between near-field devices.

[0102] Among them, the distributed soft bus allows multiple networked devices to merge into "one device", which can bring a smooth connection experience with high throughput, low latency and high reliability within and between devices. Currently, the distributed soft bus includes a data bus and a service bus. The service bus is used to establish service connections, and the data bus is used to transmit data. For example, Figure 1 This is a schematic diagram of a near-field device interconnection scenario, such as Figure 1 As shown, with the mobile phone as the center, the mobile phone, tablet, keyboard and mouse, camera, display, storage device, watch, earphone and speaker are interconnected. Business connections can be established between the devices through the business bus, and data can be transmitted through the data bus.

[0103] Currently, after distributed devices are networked via a distributed soft bus, they need to exchange their own information to synchronize information across the entire network, enabling rapid discovery and connection between devices. For example, after five networked devices A, B, C, D, and E synchronize their information across the entire network, device A can use this synchronized information (including the list of online devices) to initiate service requests and establish service connections with other devices at any time, eliminating the need to perform a new scan and discovery process before establishing a service connection.

[0104] However, as the number of distributed devices increases, the amount of information that needs to be synchronized between devices will also increase exponentially, which will occupy a large amount of network bandwidth resources. Figure 2 As shown in (a) in the figure, when there are only three devices in the network, each device only needs to synchronize with the other two devices; Figure 2 As shown in (b) of Figure 1, when there are five devices in the network, each device needs to synchronize with the other four. Similarly, as the number of devices increases, the number of interactions for information synchronization will also increase exponentially, which will consume a large amount of processing resources and bandwidth resources.

[0105] Based on this, in existing technology, after multiple devices are networked, they can first negotiate and select a master device. Then, other devices only need to exchange information with the master device, and the master device then synchronizes all information with other devices to achieve network-wide information synchronization. This method can reduce information exchange between devices and reduce bandwidth resources.

[0106] However, in this solution, since the information synchronized on other devices all originates from the master device, if the master device goes offline, the synchronized information on other devices becomes unreliable, temporarily preventing service connections between devices. Service connections can only be reestablished after the other devices reselect a new master and resynchronize information. This solution can result in a blackout period when the master device goes offline, impacting the service experience.

[0107] Using dual-master devices in a network can solve the problem of service blackout periods caused by a single master device going offline. However, the dual-master solution always has a backup master device, which makes the logic of other network devices too complicated. In addition, maintaining the backup master device's information in real time also increases the overhead of network interaction.

[0108] The embodiment of the present application provides a communication method that can avoid the problem of service blackout period caused by the disconnection of a single master device without using dual master devices.

[0109] The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application. In the description of the present application, unless otherwise specified, " / " represents an "or" relationship between the objects before and after the " / ", for example, A / B can represent A or B; in the present application, "and / or" is only a description of the relationship between the associated objects, which means that there can be three relationships, for example, A and / or B, which can represent: A alone, A and B together, and B alone, where A and B can be singular or plural. In the description of the present application, unless otherwise specified, "multiple" means two or more than two. "At least one of the following" or similar expressions means any combination of the items, including any combination of single or multiple items. For example, at least one of a, b, or c can represent: a, b, c, a-b, a-c, b-c, or a-b-c, where a, b, and c can be single or multiple. In addition, in order to clearly describe the technical solutions of the embodiments of the present application, in the embodiments of the present application, "first", "second", and the like are used to distinguish the same or similar items with the same function and effect. Those skilled in the art can understand that "first", "second", and the like do not limit the quantity and execution order, and "first", "second", and the like do not necessarily mean different. At the same time, in the embodiments of the present application, "exemplary" or "for example" means to serve as an example, illustration or description. Any embodiment or design scheme described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as more preferred or more advantageous than other embodiments or design schemes. Rather, "exemplary" or "for example" is used to present the relevant concept in a specific manner, and to facilitate understanding.

[0110] In addition, the network architecture and service scenarios described in the embodiments of the present application are used to more clearly illustrate the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided by the embodiments of the present application. Those skilled in the art can know that as the network architecture evolves and new service scenarios appear, the technical solutions provided by the embodiments of the present application are also applicable to similar technical problems.

[0111] First, a brief introduction is made to the communication system to which the communication method provided in the embodiments of the present application is applied. Figure 3 is a schematic diagram of a communication system 30 provided by the embodiments of the present application. As shown in Figure 3As shown, the communication system 30 includes: a first networking device 301, a second networking device 302, and a third networking device 303. Among them, the first networking device 301 is the networking device with the highest weight in the first network (it can also be called the main device in the first network), the second networking device 302 is the networking device with the second highest weight in the first network (it can also be called the alternative device in the first network), and the third networking device 303 is the networking device in the first network other than the first networking device 301 and the second networking device 302. The first networking device 301, the second networking device 302, and the third networking device 303 can communicate using the communication method provided in the embodiment of the present application. For the specific communication method, please refer to the subsequent method embodiments and will not be repeated here. It should be noted that, Figure 3 The communication system 30 shown is illustrated by taking three third networking devices 303 as an example. Of course, the number of the third networking devices 303 is not limited in this embodiment of the present application. For example, the number of the third networking devices 303 can be 2 or 4.

[0112] It should be noted that the weight in the embodiment of the present application refers to the weight of the election of the networking device. The weight can also be called priority. It is explained here uniformly and will not be repeated below.

[0113] It should be noted that the scenarios described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions provided in the embodiments of the present application.

[0114] Optionally, the first networking device, the second networking device, or the third networking device in the embodiment of the present application can also be referred to as a communication device, which can be a general device or a dedicated device. The embodiment of the present application does not make specific limitations on this.

[0115] Optionally, the relevant functions of the first networking device, the second networking device, or the third networking device in the embodiments of the present application can be implemented by a single device, or by multiple devices, or by one or more functional modules within a single device, and the embodiments of the present application do not specifically limit this. It is understood that the above functions can be network elements in hardware devices, software functions running on dedicated hardware, a combination of hardware and software, or virtualized functions instantiated on a platform (e.g., a cloud platform).

[0116] For example, the related functions of the first networking device, the second networking device, or the third networking device involved in this application can be achieved through Figure 4 It is implemented by the communication device 40 in. Figure 4A structural schematic diagram of a communication device 40 provided by an embodiment of the present application is shown. The communication device 40 includes one or more processors 401, a communication line 402, and at least one communication interface 404 (only an example is shown to include the communication interface 404 and the processor 401 is taken as an example for description), and optionally further includes a memory 403. Figure 4 The memory 403 can be a device having a storage function. For example, it can be a read-only memory (ROM) or other type of static storage device that can store static information and instructions, a random access memory (RAM) or other type of dynamic storage device that can store information and instructions, an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disk storage, a magneto-optical disk, a magnetic tape storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited to this. The memory can exist independently and be connected to the processor through the communication line 402. The memory can also be integrated with the processor.

[0117] The processor 401 can be a general central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits for controlling the execution of programs of the present application.

[0118] The communication line 402 can include a path for connecting different components.

[0119] The communication interface 404 can be a transceiver module for communicating with other devices or communication networks, such as Ethernet, RAN, wireless local area networks (WLAN), etc. For example, the transceiver module can be a transceiver or the like. Alternatively, the communication interface 404 can also be a transceiver circuit located in the processor 401 to realize the signal input and output of the processor.

[0120] The memory 403 can be a device having a storage function. For example, it can be a read-only memory (ROM) or other type of static storage device that can store static information and instructions, a random access memory (RAM) or other type of dynamic storage device that can store information and instructions, an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disk storage, a magneto-optical disk, a magnetic tape storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited to this. The memory can exist independently and be connected to the processor through the communication line 402. The memory can also be integrated with the processor.

[0121] The memory 403 is used to store computer-executable instructions for executing the solution of the present application, and the execution is controlled by the processor 401. The processor 401 is used to execute the computer-executable instructions stored in the memory 403, thereby implementing the communication method provided in the embodiment of the present application.

[0122] Alternatively, optionally, in an embodiment of the present application, the processor 401 may also perform processing-related functions in the communication method provided in the following embodiments of the present application, and the communication interface 404 is responsible for communicating with other devices or communication networks, which is not specifically limited in the embodiments of the present application.

[0123] Optionally, the computer-executable instructions in the embodiments of the present application may also be referred to as application code, which is not specifically limited in the embodiments of the present application.

[0124] In a specific implementation, as an embodiment, the processor 401 may include one or more CPUs, such as Figure 4 CPU0 and CPU1 in.

[0125] In a specific implementation, as an embodiment, the communication device 40 may include multiple processors, such as Figure 4 Processor 401 and processor 407 in FIG. Each of these processors can be a single-core processor or a multi-core processor. The processor here can include, but is not limited to, at least one of the following: a central processing unit (CPU), a microprocessor, a digital signal processor (DSP), a microcontroller unit (MCU), or an artificial intelligence processor, etc., and each computing device can include one or more cores for executing software instructions to perform calculations or processing.

[0126] In a specific implementation, as an embodiment, the communication device 40 may further include an output device 405 and an input device 406. The output device 405 communicates with the processor 401 and can display information in a variety of ways. For example, the output device 405 can be a liquid crystal display (LCD), a light emitting diode (LED) display device, a cathode ray tube (CRT) display device, or a projector. The input device 406 communicates with the processor 401 and can receive user input in a variety of ways. For example, the input device 406 can be a mouse, a keyboard, a touch screen device, or a sensor device.

[0127] The communication device 40 may also be referred to as a communication device, which may be a general-purpose device or a dedicated device. For example, the communication device 40 may be a desktop computer, a portable computer, a network server, a personal digital assistant (PDA), a mobile phone, a tablet computer, a wireless terminal device, an embedded device, the above-mentioned terminal, the above-mentioned network device, or a Figure 4 The embodiment of the present application does not limit the type of the communication device 40.

[0128] also, Figure 4 The structure shown in the figure does not constitute a limitation on the communication device, except Figure 4 In addition to the components shown, the communication device may include more or fewer components than shown, or combine certain components, or arrange the components differently.

[0129] Combine Figure 3 The communication system described above takes the interaction among the first networking device, the second networking device and the third networking device as an example. Figure 5 As shown, it is a flowchart of a communication method provided in an embodiment of the present application, and the communication method may include the following steps.

[0130] S501: A first networking device sends a virtual communication address, and correspondingly, a second networking device and a third networking device receive the virtual communication address. The virtual communication address is used by networking devices in the first network to synchronize network-wide information.

[0131] Optionally, the first networking device may set the source address of the third message to the virtual communication address and send the third message in a broadcast format, so that the second networking device and the third networking device can both receive the third message with the source address being the virtual communication address and learn the virtual communication address. As an implementation method, the third message may be a heartbeat message broadcast by the first networking device, with the source address of the heartbeat message being the virtual communication address.

[0132] Optionally, the heartbeat message whose source address is the virtual communication address can also carry a bit flag, which is used to indicate that the heartbeat message whose source address is the virtual communication address is the heartbeat message of the device used to synchronize information across the entire network. This allows the second networking device and the third networking device to subsequently exchange information based on the virtual communication address, thereby achieving synchronization of information across the entire network.

[0133] It should be noted that the virtual communication address in the embodiments of the present application is configured on the first networking device, and the first networking device can communicate based on this virtual communication address. However, when other networking devices in the first network receive a message with the virtual communication address as the source address, they will not perceive that they are interacting with the first networking device, but will instead perceive that they are interacting with the device corresponding to the virtual communication address. This is explained here and will not be further elaborated below.

[0134] It should be noted that, for the convenience of description, in the subsequent embodiments of this application, the device corresponding to the virtual communication address can be referred to as a virtual master device, and the virtual master device can be considered as a device that synchronizes network-wide information for the networking devices in the first network. The virtual master device can be deployed on the networking devices in the first network and maintained by the networking devices in the first network. The embodiments of this application are described uniformly here and will not be repeated below. For example, Figure 6 As shown, the first network includes multiple networking devices, and the multiple networking devices can synchronize network-wide information through a virtual master device.

[0135] As one possible implementation, the actions performed by the virtual master device and the actions performed by the first networking device are both implemented by the processing module of the first networking device, without distinction. As another possible implementation, the first networking device may assign a virtual master module as the processing module of the virtual master device, and the actions performed by the virtual master device are implemented by the virtual master module in the first networking device. This embodiment of the present application is not limited to this.

[0136] As a possible implementation method, the virtual communication address can be generated by the first networking device itself; or, the virtual communication address can also be configured by the user in the first networking device, which is not limited in the embodiment of the present application.

[0137] It should be noted that when networking devices communicate based on a network address (such as an IP address), the virtual communication address can be a virtual network address (such as a virtual IP address). When networking devices communicate via Bluetooth (such as BLE), the virtual communication address can be a random device address. Furthermore, the virtual communication address does not conflict with the communication address of any networking device in the first network.

[0138] For example, the communication address of the networking device is an IP address, and the virtual communication address is a virtual IP address. Figure 7, the IP address of the device 1 is 192.168.1.1, the IP address of the device 2 is 192.168.1.2, the IP address of the device 3 is 192.168.1.3, the IP address of the device 4 is 192.168.1.4, and the IP address of the device 5 is 192.168.1.5. It is assumed that the device 5 is the first group network device with the highest weight, and the device 5 can generate a virtual IP address 192.168.1.6, which does not conflict with the IP addresses of the five group network devices, and the virtual IP address can be used as the IP address of the virtual master device.

[0139] S502, the first group network device periodically sends a heartbeat packet with a source address being the virtual communication address. Correspondingly, the second group network device and the third group network device receive the heartbeat packet with the source address being the virtual communication address.

[0140] Since the synchronization of the whole network information is based on the virtual communication address, the second group network device and the third group network device consider that the synchronized whole network information comes from the virtual master device. Therefore, only when the second group network device and the third group network device perceive that the virtual master device is in an online state, the synchronized information is considered to be reliable. Further, the second group network device and the third group network device establish a service connection by using the synchronized information. Based on this, the first group network device can periodically send the heartbeat packet with the source address being the virtual communication address, for letting the second group network device and the third group network device perceive that the virtual master device is in the online state.

[0141] Optionally, the first group network device can periodically send the heartbeat packet with the source address being the virtual communication address since the virtual communication address is configured in the first group network device.

[0142] S503, the second group network device determines that the first group network device is offline after not receiving the heartbeat packet with the source address being the virtual communication address for n times in succession, where n is less than m, n and m are positive integers, and m is the number of times of not receiving the heartbeat packet with the source address being the virtual communication address corresponding to the determination that the first group network device is offline by the third group network device.

[0143] It should be noted that since the heartbeat packet with the source address being the virtual communication address is actually sent by the first group network device, the online state of the virtual master device is essentially the online state of the first group network device, and the offline of the virtual master device is essentially the offline of the first group network device, which is uniformly described herein.

[0144] In an embodiment of the present application, when the first networking device goes offline, its action of sending heartbeat messages with a source address as the virtual communication address will be interrupted. The second networking device and the third networking device will sense that the virtual master device is offline after failing to receive the heartbeat messages with a source address as the virtual communication address for several consecutive times, thereby determining that the first networking device is offline.

[0145] In this embodiment of the present application, the number n of times the second networking device fails to receive heartbeat messages with a source address of the virtual communication address when it senses the first networking device is offline is set to be less than the number m of times the third networking device fails to receive heartbeat messages with a source address of the virtual communication address when it senses the first networking device is offline. This allows the second networking device to sense the virtual master device's offline status before the third networking device, i.e., to sense the first networking device's offline status. For example, m = 3 and n = 2.

[0146] S504: After determining that the first networking device is offline, the second networking device takes over the first networking device to periodically send a heartbeat message whose source address is the virtual communication address.

[0147] In other words, after the first networking device goes offline, the second networking device takes over from the first networking device to continue maintaining the virtual master device, so that the virtual master device continues to stay online.

[0148] It should be noted that the second networking device will take over the first networking device from sending heartbeat messages with the source address as the virtual communication address according to the original period before the third networking device fails to receive the heartbeat message with the source address as the virtual communication address for m consecutive times, so that the third networking device will not sense the offline of the virtual master device.

[0149] For example, with m=3 and n=2, the second networking device determines that the first networking device is offline after failing to receive heartbeat messages with the virtual communication address as the source address for two consecutive times. It then immediately takes over from the first networking device and sends the next (i.e., third) heartbeat message with the virtual communication address as the source address according to the original cycle. Therefore, the third networking device simply fails to receive heartbeat messages with the virtual communication address as the source address for two consecutive times and is therefore unaware of the virtual master device's offline status.

[0150] As can be seen, in this solution, only the second networking device detects the virtual master device's offline state; the third networking device remains unaware of the virtual master's offline state. Therefore, the information from the virtual master on the third networking device is always reliable, eliminating the "blackout period" issue seen in existing technologies. As for the second networking device, upon sensing the virtual master's offline state, it immediately takes over maintenance from the first networking device, bringing the virtual master back online. The time it senses the virtual master's offline state is very short, and the "blackout period" can be ignored.

[0151] Optionally, the second networking device may further configure the virtual communication address in the second networking device, so that other networking devices can communicate normally based on the virtual communication address.

[0152] In summary, in the communication method provided in the embodiment of the present application, the networking devices in the first network synchronize information of the entire network based on the virtual communication address, and the first networking device can send a heartbeat message with the source address being the virtual communication address to indicate that the virtual master device is online. The second networking device senses the offline of the first networking device before the third networking device, and can take over the heartbeat message with the source address being the virtual communication address from the first networking device when the first networking device goes offline, so that the third networking device can always sense that the virtual master device is online. This communication method can avoid the problem of business black account period caused by the networking device used for network-wide information synchronization going offline, where the information synchronized on other devices will be considered unreliable.

[0153] It should be understood that in the embodiment of the present application, the reason for the first networking device to go offline may be passive offline or active offline, or the device may be abnormally restarted, causing the second networking device to think that it is offline. The embodiment of the present application does not limit this.

[0154] It should be noted that after the first networking device goes offline, the locally stored virtual communication address needs to be cleared to avoid the first networking device continuing to receive messages with the destination address of the virtual communication address from other devices after rejoining the first network after going offline, causing logical confusion for other networking devices in the first network.

[0155] It should be noted that when the networking device is a network device, the communication address in the embodiments of the present application can also be referred to as a network address. When networking devices communicate based on a network address, the sending device needs to encapsulate the hardware address corresponding to the network address in the message, and accordingly, the receiving device also needs to parse the hardware address corresponding to the network address. In this case, after obtaining the network address of another networking device, if the networking device wants to access the corresponding networking device based on the network address, it also needs to obtain the hardware address corresponding to the network address. For example, after receiving the network address, the networking device can broadcast a request message, carrying the network address of the hardware address to be requested in the request message. When there is a device with the network address of the network address in the network, the device with the network address of the network address can send a feedback message to inform the hardware address corresponding to the network address after receiving the request message. Otherwise, the networking device cannot obtain the hardware address corresponding to the network address and cannot access the networking device based on the network address.

[0156] Taking the communication between networking devices based on the Internet Protocol (IP) address (i.e., the communication address is the IP address) as an example, after a networking device obtains the IP address of another networking device, it can learn the Address Resolution Protocol (ARP) table entry to obtain the media access control address (MAC) address corresponding to the IP address. For example, Figure 8 As shown in the figure, the network devices include device A, device B, and device C. Device A's IP address is 1.1.1.1, and its MAC address is 00E0.FC01.1111; device B's IP address is 1.1.1.2, and its MAC address is 00E0.FC02.2222; and device C's IP address is 1.1.1.3, and its MAC address is 00E0.FC03.3333. Assume that device A receives device C's IP address: 1.1.1.3. Figure 8 As shown in (a) in the figure, device A can broadcast an ARP request to other devices. The IP address field in the ARP request is the IP address of device C: 1.1.1.3, and the MAC address field is empty. Since the network address of device C in the network is 1.1.1.3, Figure 8 As shown in (b), after receiving the ARP request, device C can unicast an ARP response to device A. The ARP response carries the MAC address of device C: 00E0.FC03.3333. Thus, device A obtains the MAC address of device C through the ARP request.

[0157] Similarly, in the embodiment of the present application, when the networking device is a network device, the virtual communication address is a virtual network address. After receiving the virtual network address, the second and third networking devices also need to obtain the hardware address corresponding to the virtual network address before they can communicate with the device corresponding to the virtual network address. However, in the embodiment of the present application, since there is no networking device in the first network whose network address is the virtual network address, the second and third networking devices cannot obtain the hardware address corresponding to the virtual network address by sending a request message.

[0158] As an implementation method, the first networking device can notify its own hardware address as the hardware address corresponding to the virtual network address to the second networking device and the third networking device, so that the second networking device and the third networking device can obtain the hardware address corresponding to the virtual communication address to achieve access to the virtual network address, and then subsequently synchronize the entire network information.

[0159] For example, taking the case of the networking devices communicating according to IP addresses. The first networking device can broadcast a gratuitous ARP message, in which the IP field is a virtual IP address and the MAC field is the MAC address of the first networking device. Thus, the second and third networking devices can receive the gratuitous ARP message and learn the MAC address corresponding to the virtual IP address. The second and third networking devices can add the virtual IP address and the MAC address corresponding thereto as an ARP entry to a local ARP table, and can encapsulate subsequent messages having the virtual IP address as the destination address according to the ARP table or can parse messages from the virtual IP address according to the ARP table.

[0160] As another implementation manner, the virtual network address can be configured on the hardware in the first networking device. For example, taking the case of the virtual network address being a virtual IP address, the IP address corresponding to the MAC address of the first networking device can also include the virtual IP address at the hardware level. Based on this scheme, the second and third networking devices can send a first request message to request the hardware address corresponding to the virtual network address after receiving the virtual network address announced by the first networking device. For example, taking the case of the virtual network address being a virtual IP address, the first request message can be an ARP message, and the second and third networking devices can request the MAC address corresponding to the virtual IP address by broadcasting an ARP message in a dynamic ARP process. Thus, the first networking device does not need to actively announce the hardware address corresponding to the virtual network address, for example, can not need to send a gratuitous ARP message. Further, the first networking device can determine that the destination MAC address and the destination IP address of a message correspond to the local MAC address and IP address when receiving a message having the virtual IP address as the destination address, directly parse the MAC header and the IP header of the message, and process the data therein.

[0161] Optionally, when the virtual communication address is a virtual network address, the second networking device can also announce the hardware address corresponding to the virtual network address to other networking devices after taking over the first networking device to maintain the virtual master device, so that other networking devices update the hardware address corresponding to the virtual network address to the hardware address of the second networking device, and further, other networking devices can subsequently normally communicate based on the virtual network address.

[0162] It should be noted that since the Bluetooth device address is a hardware layer address, when the networking devices communicate based on Bluetooth, the corresponding networking device can be directly accessed according to the Bluetooth device address. For example, if the devices in the first networking device use Bluetooth communication, the virtual communication address can be a random device address configured in the first networking device, and the second and third networking devices can directly access the first networking device according to the random device address.

[0163] Alternatively, as Figure 9 As shown, the networking devices in the first network synchronize the entire network information according to the virtual communication address, which may include the following steps.

[0164] S901: The second and third networking devices send a first message, and the first networking device receives the first message accordingly. The first message includes first information used by the corresponding networking devices for network-wide information synchronization, and the destination address of the first message is a virtual communication address.

[0165] In an embodiment of the present application, the first information may include the identity information, capability information, and topology information of the networking device. Among them, the identity information of the networking device may include the name of the networking device (such as the user name currently used by the device), the device type (such as a mobile phone, a computer, a tablet, etc.), the identifier, and the communication address, etc.; the capability information may include the communication capability (such as whether it supports Bluetooth, WIFI, or a mobile network function) and the interaction capability (such as whether it supports the display function, the voice function, or the recording function), etc.; the topology information may include the connection information between the networking device and other networking devices, or the information of the thin client attached to the networking device, etc. In an embodiment of the present application, the first information is synchronized across the entire network so that service connections can be established between the various networking devices to achieve interconnection.

[0166] As described above, since the second and third networking devices receive the virtual communication address announced by the first networking device and can, based on the instruction, learn that the virtual communication address is the communication address for network-wide information synchronization, the second and third networking devices will send a first message carrying the first information, with the destination address of the first message being the virtual communication address.

[0167] It should be noted that, assuming that the networking device is a network device, according to the provisions of the open system interconnection reference model (OSI), the sending device needs to first encapsulate the network layer message and then encapsulate the data link layer message; the receiving device needs to first decapsulate the data link layer message and then decapsulate the network layer message.

[0168] For example, take the networking devices using IP addresses for communication as an example. When the second networking device and the third networking device send the first information, they use their own IP addresses as the source addresses and the virtual IP address as the destination address to encapsulate the network layer message. The encapsulated network layer message can be as follows: Figure 10As shown, the payload can be used to carry the first information. Assume that the second networking device and the third networking device receive the free ARP message broadcast by the first networking device and learn the MAC address corresponding to the virtual IP address (actually the MAC address of the first networking device). Then, the second networking device and the third networking device can use their own MAC address as the source MAC address and the MAC address of the first networking device as the destination MAC address to further encapsulate the network layer message into a data link layer message. The encapsulated data link layer message can be as follows Figure 11 As shown. After processing by other protocol layers, the first message carrying the first information can be sent out. It should be noted that, assuming that the networking devices are connected to the same AP and communicate in a LAN based on AP mode, the outgoing interface through which the second and third networking devices send the first message carrying the first information is the interface connected to the router, generally the wlan0 interface.

[0169] Continuing with this example, since the destination MAC address encapsulated in the first message is the MAC address of the first networking device, the first networking device will receive the first message from the second and third networking devices. Since the destination MAC matches the MAC address of the first networking device, the first networking device can parse the MAC header of the message. However, the destination IP address of the first message is the virtual IP address of the virtual master device, which does not match the IP address of the first networking device. Therefore, the first networking device cannot directly parse the IP header of the first message. However, it should be noted that the first networking device maintains the virtual master device, and this virtual IP address is configured on the local virtual interface of the first networking device. Therefore, the first networking device can query the local forwarding interface information to determine that the destination IP address of the first message is configured on the local virtual interface. The first networking device can then assume that the first message has arrived at the device corresponding to the destination address. The first networking device can then parse the IP header of the first message and process the payload data to obtain the first information therein.

[0170] In one possible implementation, since the virtual master device is configured on the first networking device, the virtual master device can directly read the first information of the first networking device. Therefore, after receiving the first information from the second and third networking devices, the virtual master device can obtain the first information of each networking device in the first network.

[0171] It should be understood that since the virtual master device is configured on the first networking device, the virtual master device obtains the first information of each networking device in the first network, which is equivalent to the first networking device obtaining the first information of each networking device in the first network.

[0172] S902: The first networking device sends a second message, and the second and third networking devices receive the second message accordingly. The second message includes first information used by each networking device in the first network for network-wide information synchronization, and the source address of the second message is a virtual communication address.

[0173] As an implementation method, the first networking device can send the second message by broadcasting, so that the second networking device and the third networking device can know the first information used by each networking device in the first network for synchronizing information of the entire network. Since the first networking device has also obtained the first information used by each networking device in the first network for synchronizing information of the entire network, the synchronization of information of the entire network is achieved based on this.

[0174] In an embodiment of the present application, the source address of the second message can be set to a virtual communication address, so that the second networking device and the third networking device believe that the second message is sent by the virtual master device, and the device perceived by the second networking device and the third networking device to synchronize information across the entire network is the virtual master device.

[0175] Optionally, after completing the synchronization of the entire network information, the first networking device may generate a first topology sequence number, which is used to indicate the version of the entire network topology information known to the first networking device; the second networking device may generate a second topology sequence number, which is used to indicate the version of the entire network topology information known to the second networking device; and the third networking device may generate a third topology sequence number, which is used to indicate the version of the entire network topology information known to the third networking device. It should be understood that upon completing the synchronization of the entire network information, the first topology sequence number, the second topology sequence number, and the third topology sequence number are the same.

[0176] Optionally, after completing the synchronization of the entire network information, the first networking device may further generate first summary information. The first summary information may include the identifier of each networking device in the first network. Furthermore, the first networking device transmits the first summary information. Correspondingly, the second and third networking devices receive the first summary information.

[0177] It should be understood that the identifier of each networking device in the first summary information is equivalent to a list of online devices and can be used to indicate the online networking devices in the first network. The first networking device can broadcast this first summary information, for example, by including it in periodically transmitted heartbeat messages whose source address is the virtual communication address. Thus, after receiving the first summary information from the first networking device, the second and third networking devices can perceive the online status of other networking devices based on the networking device identifiers in the first summary information.

[0178] Optionally, the first networking device may update its locally stored first topology sequence number when it determines that the topology information of the networking devices in the first network has changed. The first networking device may also send an updated first topology sequence number, and the source address of the message carrying the updated topology sequence number is a virtual communication address. After receiving the updated first topology sequence number, the second networking device may obtain the updated topology information from the first networking device and update the locally stored second topology sequence number if the first topology sequence number is newer than the locally stored second topology sequence number. After receiving the updated first topology sequence number, the third networking device may obtain the updated topology information from the first networking device and update the locally stored third topology sequence number if the first topology sequence number is newer than the locally stored third topology sequence number.

[0179] Based on this solution, the first networking device can update its locally stored first topology serial number upon determining that the topology information of a networking device in the first network has changed, so that the first topology serial number is always up to date. Other networking devices other than the first networking device can sense that the topology information of a networking device in the first network has changed through the updated first topology serial number sent by the first networking device, and thereby obtain the updated topology information. Thus, after each networking device in the first network synchronizes the entire network information, it can also obtain the updated topology information when the topology information of a networking device changes, thereby allowing the networking devices in the first network to always maintain synchronization of the entire network information.

[0180] It should be noted that the second networking device or the third networking device obtains the updated topology information from the first networking device, including: the second networking device or the third networking device sends a second request message for obtaining the updated topology information, and the destination address of the second request message is the virtual communication address. Accordingly, the first networking device receives the second request message, and thus sends the updated topology information to the second networking device or the third networking device, wherein the source address of the message carrying the updated topology information is the virtual communication address. In other words, the first networking device synchronizes the updated topology information for other networking devices and also communicates based on the virtual communication address, so that other networking devices believe that the updated topology information also comes from the virtual master device. The embodiments of the present application are uniformly explained here and will not be repeated below.

[0181] Optionally, the first summary information may also include a first version number corresponding to the identifier of each networking device. The first version number is used to indicate the version of the topology information of the corresponding networking device. Upon determining that the topology information of a networking device in the first network has changed, the first networking device may update its locally stored first topology sequence number and the first version number corresponding to the networking device whose topology information has changed in the first summary information. Subsequently, the first networking device may also send a fourth message, which includes the updated first topology sequence number of the first networking device and the updated first summary information. The source address of the fourth message is the virtual communication address. Upon receiving the fourth message, the second networking device may, if the first topology sequence number is newer than the locally stored second topology sequence number, determine based on the first summary information whether to synchronize the updated topology information. If necessary, the second networking device may obtain the updated topology information from the first networking device and update the locally stored second topology sequence number. Upon receiving the fourth message, the third networking device may, if the first topology sequence number is newer than the locally stored third topology sequence number, determine based on the first summary information whether to synchronize the updated topology information. If necessary, the third networking device may obtain updated topology information from the first networking device and update the locally stored third topology serial number.

[0182] Based on this solution, when the first networking device determines that the topology information of the networking device in the first network has changed, it can update its own first topology serial number and the first version number corresponding to the networking device where the topology information occurs in the first summary information, and inform other networking devices of the updated first topology serial number and the updated first summary information of the first networking device, so that other networking devices can be informed that the topology information of the networking device in the first network has changed, and can selectively synchronize the updated topology information based on the first summary information. Therefore, for networking devices that do not have a need, the updated topology information can be synchronized, thereby saving communication resources. For example, when a new thin client is added to the networking device, or the original thin client is disconnected, the topology information of the networking device has changed.

[0183] It should be noted that the second networking device or the third networking device determines whether it is necessary to synchronize the updated topology information based on the first summary information, which may include: the second networking device or the third networking device can determine the networking device whose topology information has changed based on the first version number in the first summary information, and then determine whether it is necessary to obtain the updated topology information based on its own relationship with the networking device whose topology information has changed. For example, the first network may include lightweight networking devices (such as WIFI lamps), and the lightweight networking devices will not use the hanging devices of other networking devices (such as USB devices). Assume that a networking device in the first network has added a hanging device, so that its topology information has changed, but after the lightweight networking device in the first network learns that the topology information of the device has changed, it can determine that there is no need to synchronize the updated topology information.

[0184] Optionally, the first networking device may determine that the topology information of a networking device in the first network has changed after its own topology information has changed. Alternatively, the second or third networking device may update its local first topology sequence number after its own topology information has changed, and may send a fifth message carrying the updated topology information, with the destination address of the fifth message being the virtual communication address. Consequently, the first networking device will receive the fifth message, and upon receiving the fifth message, the first networking device may determine that the topology information of a networking device in the first network has changed.

[0185] Optionally, the first topology sequence number and the first summary information of the first networking device can be carried in a heartbeat message that is periodically sent and whose source address is the virtual communication address. The second networking device or the third networking device can send updated topology information to the first networking device when its locally stored topology sequence number (the second topology sequence number or the third topology sequence number) is newer than the first topology sequence number in the heartbeat message. Alternatively, the second networking device or the third networking device can determine the device whose topology information has changed based on the first summary information when its locally stored topology sequence number (the second topology sequence number or the third topology sequence number) is older than the first topology sequence number in the heartbeat message, and then selectively obtain the updated topology information from the first networking device. It should be noted that the second networking device or the third networking device sends the updated topology information to the first networking device, and obtains the updated topology information from the first networking device, both of which are communicated based on the virtual communication address.

[0186] In other words, based on this solution, after the second or third networking device has its own topology information changed, it may not actively send the updated topology information to the first networking device. Instead, it may send the updated first information to the first networking device only after determining that its local first topology sequence number is newer than the first topology sequence number based on the heartbeat message. Alternatively, after the first networking device has determined that the topology information of a networking device in the first network has changed, the second or third networking device that has not obtained the updated topology information may sense the networking device whose topology information has changed through a heartbeat message, and then selectively obtain the updated topology information. Using heartbeat messages to transmit information can avoid additional message interactions and save communication resources.

[0187] Optionally, after determining that a networking device other than the first networking device in the first network is offline, the first networking device can update the local first topology serial number and remove the identifier of the offline networking device and its corresponding first version number in the local first summary information. The first networking device can also send a sixth message, which includes the updated first topology serial number of the first networking device and the updated first summary information, and the source address of the sixth message is a virtual communication address. Networking devices other than the first networking device and the offline networking device in the first network can receive the sixth message, and when the updated first topology serial number is newer than the locally stored topology serial number (the second topology serial number or the third topology serial number), they can determine that a networking device is offline based on the updated first summary information, and then update the locally stored first topology serial number.

[0188] Optionally, the first networking device determines that the second networking device and / or the third networking device is offline when the first networking device fails to receive heartbeat messages sent by the second networking device and / or the third networking device for x consecutive times, where x is a positive integer.

[0189] Optionally, the fourth networking device is a networking device that is newly added to the first networking device after the networking devices in the first networking complete network-wide information synchronization. The fourth networking device can send a heartbeat message whose source address is the communication address of the fourth networking device. The first networking device can receive the heartbeat message whose source address is the communication address of the fourth networking device, thereby sensing that the fourth networking device has joined the first networking device. Afterwards, the first networking device can send a seventh message to the fourth networking device, and add the identifier of the fourth networking device and the corresponding first version number to the first summary information stored therein, wherein the seventh message includes the first information used by each networking device in the first networking for network-wide information synchronization, and the source address of the seventh message is the virtual communication address. The first networking device can send an eighth message, the eighth message includes the updated first topology sequence number of the first networking device and the updated first summary information, and the source address of the eighth message is the virtual communication address.

[0190] In other words, the first networking device can sense the newly joined device in the first network through the heartbeat message of the newly joined networking device, and can synchronize the information of the entire network for the newly joined networking device, as well as synchronize the information of the newly joined networking device for other currently online networking devices.

[0191] Optionally, the second networking device feeds back a heartbeat message with the communication address of the second networking device once every y times it receives a heartbeat message with the virtual communication address as the source address; and / or the third networking device feeds back a heartbeat message with the communication address of the third networking device once every y times it receives a heartbeat message with the virtual communication address as the source address, where y is a positive integer greater than 1.

[0192] Based on this solution, after achieving network-wide information synchronization, the second and / or third networking devices may not actively send heartbeat messages with their own communication addresses as the source address. Instead, they may only send back heartbeat messages with their own communication addresses when receiving heartbeat messages with the virtual communication address as the source address, allowing the virtual master device to perceive their online status. The second and / or third networking devices can then perceive the online status of other devices using the first summary information. Furthermore, if y is greater than 1, it indicates that the frequency of the second and / or third networking devices sending back heartbeat messages is less than the frequency of sending heartbeat messages with the virtual communication address as the source address. This can be understood as the heartbeat frequency of the virtual master device in the first network being higher than that of other networking devices other than the first networking device, facilitating rapid detection of the virtual master device's offline status. As an implementation method, the heartbeat messages sent back by the second and / or third networking devices may also be broadcast, allowing other networking devices other than the first networking device to perceive each other's online status.

[0193] Combine Figures 5 to 11 The embodiments described, such as Figure 12 As shown, a specific example of a communication method provided in an embodiment of the present application includes the following steps.

[0194] S1201. Networking devices in a first network notify each other of first device information of their own devices, where the first device information includes weights of the networking devices.

[0195] In the embodiment of the present application, the weights of the networking devices are used to determine the first networking device, and the networking device with the highest weight is the first networking device in the first network.

[0196] Optionally, the weight of a device is positively correlated with its reliability and its resources. The device's resources may include its processing resources and / or its bandwidth resources. For example, the more reliable and long-lasting a device's power supply is, the higher its reliability and, consequently, its weight. Alternatively, for example, the more processing resources and / or bandwidth resources a device has, the higher its reliability.

[0197] It should be noted that the communication method provided in the embodiment of the present application can be applied to information synchronization between near-field interconnected devices. When devices communicate based on a local area network in AP mode, devices connected to the same local area network can form a communication network, in which the networking device is a network device. Alternatively, when devices communicate based on Bluetooth, devices that have Bluetooth turned on and are mutually reachable by Bluetooth can form a communication network, in which the networking device is a Bluetooth device. Of course, a device can have both network and Bluetooth functions, so that it can be networked through a local area network or through Bluetooth, and the embodiment of the present application does not limit this.

[0198] Networked devices can communicate using distributed soft bus technology. Each networked device is a single hop away from every other networked device, making them neighbors. Networked devices can broadcast heartbeat messages to discover neighboring devices (other networked devices) and maintain neighbor relationships.

[0199] As an implementation method, each networking device can carry its own device weight in its heartbeat message. Thus, after each networking device broadcasts its heartbeat message, each networking device can also receive heartbeat messages from other networking devices, so that each networking device can know the weights of all devices currently on the network.

[0200] Optionally, the first device information may also include the identification and communication address of the networking device itself. Thus, when the networking devices in the first network communicate their weights to each other, each networking device may also learn the identification and communication address of other networking devices.

[0201] S1202: The networking devices in the first network determine the first networking device according to the weight.

[0202] In step S1201, each networking device in the first network obtains the weights of other networking devices, so that the networking device with the highest weight in the first network becomes the first networking device.

[0203] Optionally, in an embodiment of the present application, the networking device in the first network may further determine a second networking device, where the second networking device is the networking device with the second highest weight in the first network. The second networking device may be used to take over maintenance of the virtual master device in place of the first networking device when the first networking device goes offline.

[0204] S1203, configuring a virtual communication address in the first networking device.

[0205] One virtual communication address can be configured in the first networking device, which is used for the networking devices in the first network to synchronize the network-wide information. Thus, when the other networking devices in the first network except the first networking device receive a packet with the source address being the virtual communication address, they will not perceive that they are interacting with the first networking device, but will consider that they are interacting with the device corresponding to the virtual communication address (i.e. the virtual master device). Therefore, it can be considered that the virtual master device is configured in the first networking device.

[0206] Optionally, if the virtual communication address is a virtual IP address, the virtual IP address can be configured on a virtual interface local to the first networking device as the forwarding interface information. As an implementation manner, the virtual IP address is configured on a virtual loopback interface local to the first networking device, such as loopback0 interface.

[0207] Optionally, a unique device identifier (UDID) can be configured in the first networking device, which can be used as the identity of the virtual master device corresponding to the virtual communication address. The UDID can be generated by the first networking device itself or configured in the first networking device by human, which is not limited in the embodiments of the present application.

[0208] S1204, the first networking device sends the virtual communication address. Correspondingly, the second networking device and the third networking device receive the virtual communication address. The virtual communication address is used for the networking devices in the first network to synchronize the network-wide information.

[0209] The specific implementation of step S1204 can refer to Figure 5 The step S501 in the embodiments is not repeated here.

[0210] Optionally, the first networking device can also send the UDID of the virtual master device. Correspondingly, the second networking device and the third networking device receive the UDID of the virtual master device. The UDID of the virtual master device is used to verify the identity of the virtual master device when the second networking device or the third networking device communicates with the virtual master device.

[0211] As an implementation manner, the first networking device can carry the UDID of the virtual master device in the heartbeat packet with the source address being the virtual communication address. Thus, the second networking device or the third networking device will consider that the UDID is the UDID of the virtual master device corresponding to the virtual communication address after receiving the heartbeat packet with the source address being the virtual communication address.

[0212] S1205: The second and third networking devices send a first message, and the first networking device receives the first message accordingly, wherein the first message includes first information used by the corresponding networking devices for network-wide information synchronization, and the destination address of the first message is a virtual communication address.

[0213] The specific implementation of step S1205 can refer to Figure 9 Step S901 in the embodiment is not described in detail here.

[0214] S1206: The first networking device sends a second message, and correspondingly, the second networking device and the third networking device receive the second message, wherein the second message includes first information used by each networking device in the first network for network-wide information synchronization, and the source address of the second message is the virtual communication address.

[0215] The specific implementation of step S1206 can refer to Figure 9 Step S902 in the embodiment is not described in detail here.

[0216] S1207: The first networking device periodically sends a heartbeat message whose source address is the virtual communication address. Correspondingly, the second networking device and the third networking device receive the heartbeat message whose source address is the virtual communication address.

[0217] The specific implementation of step S1207 can refer to Figure 5 Step S502 in the embodiment is not described in detail here.

[0218] Optionally, the heartbeat message periodically sent by the first networking device with the source address being the virtual communication address may carry the first topology sequence number and first summary information of the first networking device. For relevant content here, reference may also be made to the relevant description above.

[0219] S1208. After the second networking device fails to receive a heartbeat message with a source address of the virtual communication address for n consecutive times, the second networking device determines that the first networking device is offline, where n is less than m, n and m are both positive integers, and m is the number of times the third networking device fails to receive a heartbeat message with a source address of the virtual communication address when determining that the first networking device is offline.

[0220] The specific implementation of step S1208 can refer to Figure 5 Step S503 in the embodiment is not described in detail here.

[0221] S1209: After determining that the first networking device is offline, the second networking device takes over the first networking device to periodically send heartbeat messages whose source address is the virtual communication address.

[0222] The specific implementation of step S1209 can refer to Figure 5Step S504 in the embodiment is not described in detail here.

[0223] In summary, in the communication method provided in the embodiment of the present application, the networking devices in the first network synchronize information of the entire network based on the virtual communication address, and the first networking device can send a heartbeat message with a source address of the virtual communication address to indicate that the virtual master device is online. The second networking device senses the offline of the first networking device before the third networking device, and can take over the heartbeat message with a source address of the virtual communication address from the first networking device when the first networking device goes offline, so that the third networking device can always sense that the virtual master device is online. This communication method can avoid the problem of business black account period caused by the unreliability of the synchronized information in the networking devices after the device used for network-wide information synchronization goes offline.

[0224] It should be noted that in the embodiments of the present application, the networking device that maintains the virtual master device can be considered the master device, and the networking device that takes over the master device to maintain the virtual master device when the master device goes offline can be considered the backup device. For example, in the above embodiment, the first networking device is the master device, and the second networking device is the backup device.

[0225] Accordingly, steps S503 and S1208 may be as follows: after the standby device fails to receive a heartbeat message with a source address of the virtual communication address for n consecutive times, the standby device determines that the master device is offline, where n is less than m, n and m are both positive integers, and m is the number of times that networking devices other than the master device and the standby device fail to receive a heartbeat message with a source address of the virtual communication address when determining that the master device is offline. Steps S504 and S1209 may be as follows: after determining that the master device is offline, the standby device takes over the master device's responsibility to periodically send heartbeat messages with a source address of the virtual communication address.

[0226] It should be noted that the candidate device in the embodiments of this application may refer to the device with the highest weight other than the primary device. Therefore, if the weight of a newly added networking device in the first network is higher than that of the candidate device in the first network, the newly added networking device will become the new candidate device. Furthermore, the weight of the newly added networking device may also be higher than that of the current primary device, but it will not preempt the current primary device. This is explained uniformly in the embodiments of this application.

[0227] Based on this, as an implementation method, the heartbeat message with the source address as the virtual communication address can also carry the weight of the entire network device, so that the newly added networking device can determine its own weight ranking based on the weight of the entire network device.

[0228] It should be understood that when the original master device goes offline and the backup device takes over as the virtual master device, the backup device can be considered the new master device. Thus, the device with the highest weight other than the new master device becomes the new backup device. The actions performed by the new master device and the new backup device are as described above in steps S502 to S504, or S1207 to S1209, and will not be repeated here.

[0229] It should be noted that the action of the first networking device in the above method embodiment can be Figure 4 The processor 401 in the communication device 40 shown calls the application code stored in the memory 402 to instruct the first networking device to execute, and the action of the second networking device can be performed by Figure 4 The processor 401 in the communication device 40 shown calls the application code stored in the memory 402 to instruct the second networking device to execute, and the action of the third networking device can be performed by Figure 4 The processor 401 in the communication device 40 shown calls the application code stored in the memory 402 to instruct the third networking device to execute, and this embodiment does not impose any limitation on this.

[0230] It can be understood that in the above embodiments, the methods and / or steps implemented by the first networking device can also be implemented by components (such as chips or circuits) that can be used for the first networking device; the methods and / or steps implemented by the second networking device can also be implemented by components (such as chips or circuits) that can be used for the second networking device; the methods and / or steps implemented by the third networking device can also be implemented by components (such as chips or circuits) that can be used for the third networking device.

[0231] The above mainly describes the solutions provided by the embodiments of the present application from the perspective of interaction between various networking devices. Accordingly, the embodiments of the present application also provide a communication device, which is used to implement the various methods described above. The communication device can be the first networking device in the above method embodiments, or a device that includes the above first networking device, or a component that can be used for the first networking device; alternatively, the communication device can be the second networking device in the above method embodiments, or a device that includes the above second networking device, or a component that can be used for the second networking device; alternatively, the communication device can be the third networking device in the above method embodiments, or a device that includes the above third networking device, or a component that can be used for the third networking device. It will be understood that in order to implement the above functions, the communication device includes hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should readily appreciate that, in combination with the various exemplary units and algorithm steps described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in hardware or in a hardware-driven manner by computer software depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0232] In the embodiment of the present application, the functional modules of the communication device can be divided according to the above method embodiment. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module. The above integrated modules can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiment of the present application is schematic and is only a logical functional division. In actual implementation, there may be other division methods.

[0233] Figure 13 1 shows a schematic structural diagram of a communication device 130. The communication device 130 includes a transceiver module 1301 and a processing module 1302. The transceiver module 1301, also called a transceiver unit, is used to implement transceiver functions, and can be, for example, a transceiver circuit, a transceiver, a transceiver, or a communication interface.

[0234] Here, the communication device 130 is taken as the first networking device in the above method embodiment as an example:

[0235] The transceiver module 1301 is used to send a virtual communication address, which is used by networking devices in the first network to synchronize network-wide information. The transceiver module 1301 is also used to periodically send heartbeat messages with the virtual communication address as the source address.

[0236] Optionally, transceiver module 1301 is further configured to receive a first message from another networking device in the first network, the first message including first information used by the other networking device for network-wide information synchronization, and the destination address of the first message being the virtual communication address. Transceiver module 1301 is further configured to send a second message including first information used by each networking device in the first network for network-wide information synchronization, and the source address of the second message being the virtual communication address.

[0237] Optionally, the transceiver module 1301 is used to send the virtual communication address, including: being used to send a third message, where the source address of the third message is the virtual communication address.

[0238] Optionally, the virtual communication address is a virtual network address. The transceiver module 1301 is further configured to send a first hardware address corresponding to the virtual communication network address, wherein the first hardware address is a hardware address of a first networking device and is used to address the first networking device.

[0239] Optionally, the transceiver module 1301 is further configured to receive a first request message, where the first request message is used to request a hardware address corresponding to the virtual communication address.

[0240] Optionally, processing module 1302 is further configured to generate a first topology sequence number and first summary information. The first topology sequence number is used to indicate the version of the network-wide topology information currently known to the first networking device. The first summary information includes an identifier of each networking device in the first network and its corresponding first version number. The first version number is used to indicate the version of the topology information of the corresponding networking device itself. Transceiver module 1301 is further configured to send the first summary information.

[0241] Optionally, processing module 1302 is further configured to determine whether topology information of a networking device in the first network has changed, and to update a first topology sequence number stored on the first networking device and a first version number corresponding to the networking device where the topology information in the first summary information occurs. Transceiver module 1301 is further configured to send a fourth message, the fourth message including the updated first topology sequence number of the first networking device and the updated first summary information, the source address of the fourth message being the virtual communication address.

[0242] Optionally, the processing module 1302 is used to determine whether the topology information of the networking device in the first network has changed, including: determining whether its own topology information has changed; or receiving a fifth message through the transceiver module 1301, the fifth message including the updated topology information of the networking device whose topology information has changed, and the destination address of the fifth message is a virtual communication address.

[0243] Optionally, the processing module 1302 is further configured to determine that a networking device in the first group network is offline, update the first topology sequence number stored on the first group networking device, and remove the identifier of the offline networking device and the corresponding first version number in the first digest information stored on the first group networking device. The transceiver module 1301 is further configured to send a sixth message, the sixth message including the updated first topology sequence number and the updated first digest information of the first group networking device, and the source address of the sixth message being the virtual communication address.

[0244] Optionally, the processing module 1302 is configured to determine that a networking device in the first group network is offline, including being configured to determine that a networking device in the first group network is offline in a case that heartbeat messages sent by a certain networking device in the first group network except the first group networking device are not received for x consecutive times, x being a positive integer.

[0245] Optionally, the transceiver module 1301 is further configured to receive a heartbeat message with a source address being a communication address of a fourth group networking device, the fourth group networking device being a newly online networking device in the first group network. The transceiver module 1301 is further configured to send a seventh message to the fourth group networking device, the seventh message including the first information used for synchronization of the whole network information of each networking device in the first group network, and the source address of the seventh message being the virtual communication address. The processing module 1302 is further configured to update the first topology sequence number stored on the first group networking device, and add the identifier of the fourth group networking device and the corresponding first version number in the first digest information stored on the first group networking device. The transceiver module 1301 is further configured to send an eighth message, the eighth message including the updated first topology sequence number and the updated first digest information of the first group networking device, and the source address of the eighth message being the virtual communication address.

[0246] In the above method embodiments, the communication device 130 is taken as an example of the second group networking device.

[0247] The transceiver module 1301 is configured to receive a virtual communication address, the virtual communication address being used for synchronization of the whole network information by the networking devices in the first group network, and the second group networking device being the group networking device with the second highest weight in the first group network. The processing module 1302 is configured to determine that the first group networking device is offline after not receiving a heartbeat message with a source address being the virtual communication address for n consecutive times, n being less than m, n and m being positive integers, and m being the number of times of not receiving the heartbeat message with the source address being the virtual communication address corresponding to the determination that the first group networking device is offline by the third group networking device. In the above, the first group networking device is the group networking device with the highest weight in the first group network, and the third group networking device is a networking device in the first group network except the first group networking device and the second group networking device. The processing module 1302 is further configured to periodically send a heartbeat message with a source address being the virtual communication address in place of the first group networking device.

[0248] Optionally, transceiver module 1301 is further configured to send a first message, the first message including first information used by the second networking device for network-wide information synchronization, the destination address of the first message being the virtual communication address. Transceiver module 1301 is further configured to receive a second message, the second message including first information used by each networking device in the first network for network-wide information synchronization, the source address of the second message being the virtual communication address.

[0249] Optionally, the transceiver module 1301 is used to receive the virtual communication address, including: being used to receive a third message, where the source address of the third message is the virtual communication address.

[0250] Optionally, the transceiver module 1301 is further configured to receive a hardware address corresponding to the virtual communication address.

[0251] Optionally, the transceiver module 1301 is further configured to send a first request message, where the first request message is used to request a hardware address corresponding to the virtual communication address.

[0252] Optionally, processing module 1302 is further configured to generate a second topology sequence number, the second topology sequence number being used to indicate a version of the network-wide topology information currently known to the second networking device. Transceiver module 1301 is configured to receive first summary information, the first summary information including an identifier of each networking device in the first network and its corresponding first version number, the first version number being used to indicate a version of the topology information of the corresponding networking device itself.

[0253] Optionally, the processing module 1302 is further configured to update the locally stored second topology sequence number after its own topology information changes. The transceiver module 1301 is further configured to send a fifth message to the first networking device, the fifth message including the updated topology information of the second networking device, and the destination address of the fifth message being the virtual communication address.

[0254] Optionally, the heartbeat message with the source address being the virtual communication address includes the first topology sequence number stored by the first networking device. The processing module 1302 is further configured to determine whether the locally stored second topology sequence number is newer than the first topology sequence number stored by the first networking device.

[0255] Optionally, the transceiver module 1301 is further configured to receive a fourth message, the fourth message including the first topology sequence number and first summary information stored by the first networking device. The processing module 1302 is further configured to determine whether the first topology sequence number stored by the first networking device is newer than the second topology sequence number locally stored by the second networking device, and to determine whether updated topology information needs to be synchronized based on the first summary information of the first networking device. If necessary, the updated topology information is obtained from the first networking device and the locally stored second topology sequence number is updated.

[0256] Optionally, the heartbeat message with the virtual communication address as the source address includes the first topology sequence number stored by the first networking device. Processing module 1302 is further configured to determine whether the first topology sequence number stored by the first networking device is newer than the second topology sequence number locally stored by the second networking device, and to determine whether updated topology information needs to be synchronized based on the first summary information of the first networking device. If necessary, the updated topology information is obtained from the first networking device and the locally stored second topology sequence number is updated.

[0257] Here, the communication device 130 is taken as the third networking device in the above method embodiment as an example:

[0258] The transceiver module 1301 is configured to receive a virtual communication address, which is used by networking devices in the first network to synchronize network-wide information. The transceiver module 1301 is also configured to receive a heartbeat message whose source address is the virtual communication address.

[0259] Optionally, transceiver module 1301 is further configured to send a first message, the first message including first information used by a third networking device for network-wide information synchronization, the destination address of the first message being the virtual communication address. Transceiver module 1301 is further configured to receive a second message, the second message including first information used by each networking device in the first network for network-wide information synchronization, the source address of the second message being the virtual communication address.

[0260] Optionally, the transceiver module 1301 is used to receive the virtual communication address, including: being used to receive a third message, where the source address of the third message is the virtual communication address.

[0261] Optionally, the transceiver module 1301 is further configured to receive a hardware address corresponding to the virtual communication network address.

[0262] Optionally, the transceiver module 1301 is further configured to send a first request message, where the first request message is used to request a hardware address corresponding to the virtual communication address.

[0263] Optionally, processing module 1302 is further configured to generate a third topology sequence number, the third topology sequence number being used to indicate a version of the network-wide topology information currently known to the third networking device. Transceiver module 1301 is further configured to receive first summary information, the first summary information including an identifier of each networking device in the first network and its corresponding first version number, the first version number being used to indicate a version of the topology information of the corresponding networking device itself.

[0264] Optionally, the processing module 1302 is further configured to update the locally stored third topology sequence number after its own topology information changes. The transceiver module 1301 is further configured to send a fifth message to the first networking device, the fifth message including the updated topology information of the third networking device, wherein the destination address of the fifth message is the virtual communication address.

[0265] Optionally, the heartbeat message with the source address being the virtual communication address includes the first topology sequence number stored by the first networking device. The transceiver module 1301 is further configured to determine that the locally stored third topology sequence number is newer than the first topology sequence number stored by the first networking device.

[0266] Optionally, the transceiver module 1301 is further configured to receive a fourth message, the fourth message including the first topology sequence number and first summary information stored by the first networking device. The processing module 1302 is further configured to determine whether the first topology sequence number stored by the first networking device is newer than the third topology sequence number locally stored by the third networking device, and to determine whether updated topology information needs to be synchronized based on the first summary information of the first networking device. If necessary, the updated topology information is obtained from the first networking device, and the locally stored third topology sequence number is updated.

[0267] Optionally, the heartbeat message with the virtual communication address as the source address includes the first topology sequence number stored by the first networking device. Processing module 1302 is further configured to determine whether the first topology sequence number stored by the first networking device is newer than the third topology sequence number locally stored by the third networking device, and to determine whether updated topology information needs to be synchronized based on the first summary information of the first networking device. If necessary, the updated topology information is obtained from the first networking device and the locally stored third topology sequence number is updated.

[0268] It should be noted that all relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module and will not be repeated here.

[0269] In this embodiment, the communication device 130 is presented in the form of various functional modules divided in an integrated manner. Here, "module" can refer to a specific ASIC, circuit, processor and memory that executes one or more software or firmware programs, integrated logic circuit, and / or other devices that can provide the above functions. In a simple embodiment, those skilled in the art can imagine that the communication device 130 can be used. Figure 4 The form of the communication device 40 is shown.

[0270] for example, Figure 4 The processor 401 in the communication device 40 shown can call the computer-executable instructions stored in the memory 403 to enable the communication device 40 to execute the communication method in the above method embodiment.

[0271] Specifically, Figure 13 The functions / implementation processes of the transceiver module 1301 and the processing module 1302 can be realized by Figure 4The processor 401 in the communication device 40 shown calls the computer execution instructions stored in the memory 403 to implement. Or, Figure 13 The function / implementation process of the processing module 1302 can be achieved by Figure 4 The processor 401 in the communication device 40 shown calls the computer execution instructions stored in the memory 403 to implement, Figure 13 The function / implementation process of the transceiver module 1301 can be achieved by Figure 4 It is implemented by the communication interface 404 in the communication device 40 shown in FIG.

[0272] Since the communication device 130 provided in this embodiment can execute the above communication method, the technical effects that can be obtained can refer to the above method embodiments and will not be repeated here.

[0273] It should be understood that in the various embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0274] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0275] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0276] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0277] The units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, i.e., may be located in one place, or may be distributed on multiple network units. Part or all of the units can be selected to achieve the purpose of the embodiment of the present application according to actual needs.

[0278] In addition, each functional unit in each embodiment of the present application can be integrated in one processing unit, or each unit can be physically present alone, or two or more units can be integrated in one unit.

[0279] In the above embodiments, all or part can be realized by software, hardware, firmware or any combination thereof. When realized by software, all or part can be realized 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, the computer program instructions generate the processes or functions described in the embodiments of the present application. The computer can be a general-purpose computer, a special-purpose computer, a computer network or other programmable devices. The computer instructions can be stored in a computer readable storage medium or transferred from one computer readable storage medium to another, for example, the computer instructions can be transferred from one website, computer, server or data center to another through wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) mode. The computer readable storage medium can be any available medium that can be accessed by a computer or data storage device including one or more servers, data centers, etc. integrated with the medium. The available medium can be magnetic medium (such as floppy disk, hard disk, magnetic tape), optical medium (such as DVD), or semiconductor medium (such as solid state disk (SSD)) and the like.

[0280] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto, any skilled person in the art can easily think of changes or replacements within the technical range disclosed in the present application, which should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. A communication method, characterized in that: The method comprises: The first networking device sends a virtual communication address, where the virtual communication address is used by networking devices in the first network to synchronize network-wide information, wherein the first networking device is the device with the highest weight in the first network; The first networking device periodically sends a heartbeat message with the source address being the virtual communication address, where the message indicates the online status of the virtual master device when the first networking device is offline.

2. The communication method according to claim 1, wherein: The virtual communication address is used by networking devices in the first network to synchronize network-wide information, including: The first networking device receives a first message from another networking device in the first network, where the first message includes first information used by the other networking device for network-wide information synchronization, wherein a destination address of the first message is the virtual communication address; The first networking device sends a second message, where the second message includes first information used by each networking device in the first network for network-wide information synchronization; wherein the source address of the second message is the virtual communication address.

3. The communication method according to claim 1 or 2, characterized in that: The first networking device sending the virtual communication address includes: The first networking device sends a third message, wherein the source address of the third message is the virtual communication address.

4. The communication method according to claim 1 or 2, characterized in that: The virtual communication address is a virtual network address; the method further includes: The first networking device sends a first hardware address corresponding to the virtual network address, wherein the first hardware address is the hardware address of the first networking device, and the first hardware address is used to address the first networking device.

5. The communication method according to claim 4, wherein: Before the first networking device sends the first hardware address corresponding to the virtual network address, the method further includes: The first networking device receives a first request message, where the first request message is used to request a hardware address corresponding to the virtual communication address.

6. The communication method according to claim 1 or 2, characterized in that: The method further comprises: After completing the synchronization of the entire network information, the first networking device generates a first topology sequence number and first summary information, wherein the first topology sequence number is used to indicate a version of the entire network topology information currently known by the first networking device, and the first summary information includes an identifier of each networking device in the first network and a corresponding first version number thereof, wherein the first version number is used to indicate a version of the topology information of the corresponding networking device itself; The first networking device sends the first summary information.

7. The communication method according to claim 6, wherein: The method further comprises: The first networking device determines that topology information of a networking device in the first network has changed; The first networking device updates, stored on the first networking device, a first topology sequence number and a first version number corresponding to the networking device where the topology information in the first summary information is generated; The first networking device sends a fourth message, where the fourth message includes the updated first topology sequence number and updated first summary information of the first networking device, wherein the source address of the fourth message is the virtual communication address.

8. The communication method according to claim 7, wherein: The first networking device determining that topology information of a networking device in the first network has changed includes: The first networking device determines that its own topology information has changed; Alternatively, the first networking device receives a fifth message, where the fifth message includes updated topology information of the networking device whose topology information has changed, wherein the destination address of the fifth message is the virtual communication address.

9. The communication method according to claim 6, wherein: The method further comprises: The first networking device determines that a networking device in the first network is offline; The first networking device updates the first topology sequence number stored on the first networking device, and removes the identifier of the offline networking device and its corresponding first version number from the first summary information stored on the first networking device; The first networking device sends a sixth message, where the sixth message includes the updated first topology sequence number and updated first summary information of the first networking device, wherein the source address of the sixth message is the virtual communication address.

10. The communication method according to claim 9, wherein: The first networking device determining that a networking device in the first network is offline includes: When the first networking device fails to receive a heartbeat message sent by a networking device other than the first networking device in the first network for x consecutive times, the first networking device determines that a networking device in the first network is offline, where x is a positive integer.

11. The communication method according to claim 6, wherein: The method further comprises: The first networking device receives a heartbeat message whose source address is a communication address of a fourth networking device, where the fourth networking device is a newly online networking device in the first network; The first networking device sends a seventh message to the fourth networking device, updates the first topology sequence number stored on the first networking device, and adds the identifier of the fourth networking device and the corresponding first version number to the first summary information stored on the first networking device, wherein the seventh message includes first information used by each networking device in the first network for network-wide information synchronization, and wherein the source address of the seventh message is the virtual communication address; The first networking device sends an eighth message, where the eighth message includes the updated first topology sequence number and updated first summary information of the first networking device, wherein the source address of the eighth message is the virtual communication address.

12. A communication method, characterized in that: The method comprises: The second networking device receives the virtual communication address, where the virtual communication address is used by the networking devices in the first network to synchronize network-wide information, and the second networking device is the networking device with the second highest weight in the first network; The second networking device determines that the first networking device is offline after failing to receive a heartbeat message with a source address of the virtual communication address for n consecutive times, where n is less than m, n and m are both positive integers, and m is the number of times the third networking device fails to receive a heartbeat message with a source address of the virtual communication address when determining that the first networking device is offline; wherein the first networking device is the networking device with the highest weight in the first network, and the third networking device is a networking device in the first network other than the first networking device and the second networking device; The second networking device takes over from the first networking device to periodically send a heartbeat message with a source address of the virtual communication address, where the message indicates an online status of the virtual master device when the first networking device is offline.

13. The communication method according to claim 12, wherein: The virtual communication address is used by networking devices in the first network to synchronize network-wide information, including: The second networking device sends a first message, where the first message includes first information used by the second networking device for network-wide information synchronization, wherein the destination address of the first message is the virtual communication address; The second networking device receives a second message, where the second message includes first information used by each networking device in the first networking for network-wide information synchronization; wherein the source address of the second message is the virtual communication address.

14. The communication method according to claim 12 or 13, characterized in that: The second networking device receiving the virtual communication address includes: The second networking device receives a third message, wherein the source address of the third message is the virtual communication address.

15. The communication method according to claim 12 or 13, characterized in that: The method further comprises: The second networking device receives the hardware address corresponding to the virtual communication address.

16. The communication method according to claim 15, characterized in that: After the second networking device receives the virtual communication address and before the second networking device receives the hardware address corresponding to the virtual communication address, the method further includes: The second networking device sends a first request message, where the first request message is used to request a hardware address corresponding to the virtual communication address.

17. The communication method according to claim 13, wherein: After the second networking device receives the second message, the method further includes: The second networking device generates a second topology serial number, where the second topology serial number is used to indicate a version of the entire network topology information currently known by the second networking device; The second networking device receives first summary information, where the first summary information includes an identifier of each networking device in the first network and a corresponding first version number thereof, where the first version number is used to indicate a version of topology information of the corresponding networking device itself.

18. The communication method according to claim 17, wherein: The method further comprises: After the topology information of the second networking device changes, the second networking device updates the locally stored second topology serial number and sends a fifth message to the first networking device, where the fifth message includes the updated topology information of the second networking device, and the destination address of the fifth message is the virtual communication address.

19. The communication method according to claim 18, wherein: The heartbeat message whose source address is the virtual communication address includes the first topology sequence number stored by the first networking device; Before the second networking device sends the fifth message to the first networking device, the method further includes: The second networking device determines that the locally stored second topology sequence number is newer than the first topology sequence number stored by the first networking device.

20. The communication method according to any one of claims 17 to 19, characterized in that: The heartbeat message whose source address is the virtual communication address includes the first topology sequence number stored by the first networking device; the method further includes: When the second networking device determines that the first topology serial number stored by the first networking device is newer than the second topology serial number locally stored by the second networking device, the second networking device determines whether it is necessary to synchronize the updated topology information based on the first summary information of the first networking device; if necessary, obtains the updated topology information from the first networking device and updates the locally stored second topology serial number.

21. A communication system, characterized in that: The communication system includes a first networking device, a second networking device, and a third networking device, wherein the first networking device is the networking device with the highest weight in the first network, the second networking device is the networking device with the second highest weight in the first network, and the third networking device is the networking device in the first network other than the first networking device and the second networking device; The first networking device is configured to send a virtual communication address, where the virtual communication address is used by networking devices in the first network to synchronize network-wide information; The first networking device is further configured to, after completing synchronization of the entire network information, periodically send a heartbeat message whose source address is the virtual communication address, wherein the message indicates the online status of the virtual master device when the first networking device is offline; The second networking device is configured to determine that the first networking device is offline after failing to receive a heartbeat message with a source address of the virtual communication address for n consecutive times, where n is less than m, n and m are both positive integers, and m is the number of times that the third networking device fails to receive a heartbeat message with a source address of the virtual communication address when determining that the first networking device is offline; The second networking device is further configured to take over from the first networking device to periodically send heartbeat messages whose source address is the virtual communication address.

22. The communication system according to claim 21, wherein: The second networking device is further configured to feedback a heartbeat message with a source address being the communication address of the second networking device every y times when a heartbeat message with a source address being the virtual communication address is received; And / or, the third networking device is further configured to feedback a heartbeat message with a source address of the communication address of the third networking device every y times when the heartbeat message with a source address of the virtual communication address is received Wherein, y is a positive integer greater than 1.

23. A communication device, characterized in that: The communication device includes: a processor and a memory; The memory is used to store computer-executable instructions. When the processor executes the computer-executable instructions, the communication device executes the method according to any one of claims 1 to 11 or 12 to 20.

24. A communication device, characterized in that: The communication device includes: a processor and an interface circuit; The interface circuit is used to receive computer execution instructions and transmit them to the processor; The processor is configured to execute the computer-executable instructions so as to enable the communication device to perform the method according to any one of claims 1-11 or 12-20.

25. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, which, when executed by a computer, enables the computer to perform the method according to any one of claims 1 to 11 or 12 to 20.

Citation Information

Patent Citations

  • Master-slave bidirectional synchronization data storage method

    CN109101370A

  • Storage fault fast switching processing method

    CN109271280A