Information synchronization method, information synchronization system, related device and storage medium
Patent Information
- Application Number
- PCT/CN2025/071443
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-03-08
- Filing Date
- 2025-01-09
- Publication Date
- 2025-10-02
AI Technical Summary
In edge-cloud converged services, ONTs and NERGs cannot directly use existing Layer 2 protocols for IP address synchronization because they cannot obtain the other party's IP address.
By using MAC address-based target Layer 2 protocol messages for information synchronization between the ONT and NERG, the optical network device broadcasts a request message carrying the IP address and MAC address, and the virtual gateway sends a response message carrying its IP address and MAC address based on the MAC address, thereby achieving IP address synchronization.
Without relying on the peer IP address, information synchronization between the ONT and NERG is achieved, which improves the reliability and stability of the system and avoids connection problems caused by IP address changes.
Smart Images

Figure CN2025071443_02102025_PF_FP_ABST
Abstract
Description
Information synchronization method, information synchronization system, related equipment and storage medium
[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office on March 8, 2024, with application number 202410268834.4 and application name “An information synchronization method, information synchronization system, related equipment and storage medium”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The embodiments of the present application relate to the field of communication technologies, and in particular to an information synchronization method, an information synchronization system, related devices, and a storage medium. Background Art
[0003] Edge-cloud converged services are a new network architecture that combines advanced technologies such as cloud computing, edge computing, and fifth-generation mobile networks (5G) to achieve deep integration and optimization of computing, storage, and network resources. In this scenario, the edge cloud gateway (ECGW) creates a virtual network-enhanced residential gateway (NERG) for each user. The NERG is isolated by user and connects the optical network terminal (ONT) to the edge cloud.
[0004] To meet service needs between the ONT and NERG, the two devices need to synchronize their Internet Protocol (IP) addresses. Network-layer protocols require the peer's IP address to connect. In the NERG-ONT scenario, the peer's IP address is unknown after system startup and cannot be used directly. Summary of the Invention
[0005] The present application provides an information synchronization method, an information synchronization system, related devices and a storage medium for realizing information synchronization between an optical network device and a virtual gateway.
[0006] In a first aspect, the present application provides an information synchronization method, which is applied to a virtual gateway, which is deployed on a gateway device, and the gateway device is used to connect an optical network device and a cloud network. Optionally, the execution subject of the method can be a virtual gateway, a logic module or software that can implement all or part of the virtual gateway functions, a gateway device, a component or device (such as a processor, a chip, or a chip system, etc.) applied to the gateway device, or a logic module or software that can implement all or part of the gateway device functions. In this method, the virtual gateway receives a request message broadcast by the optical network device in the local area network, and the request message is used to register the optical network device with the virtual gateway. The virtual gateway creates an instance of the optical network device based on the request message, and the request message carries first information for synchronization. The first information for synchronization includes at least an IP address and a media access control (MAC) address of the optical network device. The IP address of the optical network device is used for subsequent virtual gateway and optical network device to detect address conflicts, forward messages, or save online status information, and the MAC address of the optical network device is used to generate an instance of the optical network device in the virtual gateway. Based on the MAC address of the optical network device, the virtual gateway sends a response message to the request message, namely a first response message, to the optical network device. The first response message carries second information for synchronization, which includes the IP address and MAC address of the virtual gateway. Both the request message and the first response message are based on the target Layer 2 protocol.
[0007] In this implementation, the virtual gateway receives a request message broadcast by an optical network device based on its MAC address, thereby obtaining the MAC address of the optical network device. It then sends a first response message to the optical network device based on the MAC address of the optical network device, achieving IP address synchronization. By using the target Layer 2 protocol for information synchronization, the problem of existing Layer 2 protocols being unable to achieve IP address synchronization is resolved.
[0008] A second aspect of the present application provides a gateway device having a virtual gateway deployed thereon, the gateway device being used to connect an optical network device and a cloud network. The gateway device comprises:
[0009] A receiving unit, configured to receive a request message broadcasted by an optical network device, where the request message is used for the optical network device to register with the virtual gateway and generate an instance of the optical network device on the virtual gateway, and the request message carries first information for synchronization, where the first information includes at least an IP address and a MAC address of the optical network device, and the MAC address of the optical network device is used to generate an instance of the optical network device on the virtual gateway;
[0010] A sending unit is used to send a first response message to the optical network device, the first response message carries second information for synchronization, the second information includes at least the IP address and MAC address of the virtual gateway, the first response message is a response message to the request message, and the request message and the first response message are messages based on the target Layer 2 protocol.
[0011] Based on the first and second aspects of the present application, in some possible implementations, the source MAC address of the request message is the MAC address of the optical network device, the destination MAC address of the request message is the broadcast address, and the IP address and MAC address of the optical network device are stored in the payload of the request message.
[0012] Based on the first and second aspects of the present application, in some possible implementations, the source MAC address of the first response message is the MAC address of the virtual gateway, the destination MAC address of the request message is the MAC address of the optical network device, and the IP address and MAC address of the virtual gateway are stored in the payload of the first response message.
[0013] In this embodiment, since the virtual gateway and the optical network device communicate based on the MAC address, information synchronization can be performed without knowing the IP address of the other end.
[0014] Based on the first and second aspects of the present application, in some possible implementations, the request message and the first response message further include a sequence field. Before sending the first response message to the optical network device, the virtual gateway generates the first response message based on the sequence field of the request message, such that the sequence field of the first response message is the same as the sequence field of the request message.
[0015] In this embodiment, the virtual gateway extracts the sequence field from the request message to generate the first response message, so that the sequence field of the first response message is the same as that of the request message, thereby ensuring the reliability of message transmission.
[0016] Based on the first and second aspects of the present application, in some possible implementations, if the IP address of the virtual gateway changes, the virtual gateway sends a first notification message to the optical network device, and the first notification message includes the changed IP address of the virtual gateway. The first notification message is a message based on the target Layer 2 protocol.
[0017] Specifically, the virtual gateway sends a first notification message to the optical network device at an interval of X seconds until the virtual gateway receives a second response message from the optical network device, where the second response message is a response message to the first notification message, and the second response message is a message based on the target Layer 2 protocol, and X is greater than 0. If the virtual gateway does not receive the second response message after sending the first notification message to the optical network device N times, the virtual gateway destroys the instance of the optical network device, and the virtual gateway no longer communicates with the optical network device after the instance is destroyed, where N is a positive integer.
[0018] Exemplarily, the virtual gateway sends a first notification message to the optical network device at intervals of 5 seconds. If the second response message is not received within 5 seconds, the virtual gateway retries sending until the virtual gateway receives the second response message.
[0019] In this embodiment, when the IP address of the virtual gateway changes due to configuration changes, the changed IP address is synchronized to the optical network device through the first notification message, avoiding problems such as failure to connect due to incorrect IP addresses in messages sent based on IP addresses.
[0020] Based on the first and second aspects of the present application, in some possible implementations, the source MAC address of the first notification message is the MAC address of the virtual gateway, the destination MAC address of the first notification message is the MAC address of the optical network device, and the payload of the first notification message includes the MAC address of the virtual gateway and the changed IP address.
[0021] In this implementation, since the first notification message is sent based on the MAC address, the sending of the message is not affected by changes in the IP address and can be accurately sent to the peer end.
[0022] Based on the first and second aspects of the present application, in some possible implementations, if the virtual gateway does not receive a message from the optical network device within a first period of time, the virtual gateway sends a second notification message to the optical network device. The second notification message is used to detect whether the link between the virtual gateway and the optical network device is normal. The second notification message is a message based on the target Layer 2 protocol. Exemplarily, if the virtual gateway does not receive any message within 60 seconds, the second notification message is sent to the optical network device.
[0023] In this embodiment, the virtual gateway sends the notification message as a heartbeat message to the optical network device, so there is no need to define a new heartbeat message format, which reduces the communication protocol resource usage and ensures the lightweight nature of the target layer 2 protocol.
[0024] Based on the first and second aspects of the present application, in some possible implementations, the virtual gateway sends a second notification message to the optical network device once at an interval of Y seconds until the virtual gateway receives a third response message from the optical network device, where the third response message is a response message to the second notification message, and the third response message is a message based on the target Layer 2 protocol, and Y is greater than 0. If the virtual gateway does not receive the third response message after sending the second notification message to the optical network device M times, the virtual gateway destroys the instance of the optical network device. After the instance is destroyed, the virtual gateway needs to re-register with the optical network device before re-establishing a connection with the optical network device, where M is a positive integer.
[0025] In this implementation, by sending the second notification message to detect the link status, the link connection and disconnection status can be effectively detected, thereby improving the availability and stability of the system.
[0026] Based on the first and second aspects of the present application, in some possible implementations, the source MAC address of the second notification message is the MAC address of the virtual gateway, and the destination MAC address of the second notification message is the MAC address of the optical network device.
[0027] Based on the first and second aspects of the present application, in some possible implementations, the payload of the second notification message includes the IP address and MAC address of the virtual gateway.
[0028] In this implementation, since the first notification message is sent based on the MAC address, the sending of the message is not affected by changes in the IP address and can be accurately sent to the peer end.
[0029] Based on the first and second aspects of the present application, in some possible implementations, the virtual gateway further receives a third notification message from the optical network device, where the third notification message is used to indicate that the IP address of the optical network device has changed, and the third notification message includes the changed IP address of the optical network device. The virtual gateway sends a fourth response message to the optical network device, where the fourth response message is a response message to the third notification message, and both the third notification message and the fourth response message are messages based on the target Layer 2 protocol.
[0030] Based on the first and second aspects of the present application, in some possible implementations, the third notification message and the fourth response message include a sequence field. Before sending the fourth response message to the optical network device, the virtual gateway generates a fourth response message based on the sequence field of the third notification message, where the sequence field of the fourth response message is the same as the sequence field of the third notification message.
[0031] Based on the first and second aspects of the present application, in some possible implementations, the virtual gateway further receives a fourth notification message from the optical network device, where the fourth notification message is used to detect whether the link between the virtual gateway and the optical network device is normal. The virtual gateway sends a fifth response message to the optical network device, where the fifth response message is a response message to the fourth notification message.
[0032] Based on the first and second aspects of the present application, in some possible implementations, the fourth notification message and the fifth response message include a sequence field. Before sending the fifth response message to the optical network device, the virtual gateway generates a fifth response message based on the sequence field of the fourth notification message, the sequence field of the fifth response message being the same as the sequence field of the fourth notification message, and both the fourth notification message and the fifth response message are messages based on the target Layer 2 protocol.
[0033] The third aspect of the present application provides an information synchronization method. Optionally, the execution subject of the method can be an optical network device, or a component or device (such as a processor, chip, or chip system) applied to the optical network device, or a logic module or software that can realize all or part of the functions of the optical network device. In this method, the optical network device broadcasts a request message based on the MAC address. The request message is used for the optical network device to register with the virtual gateway and generate an instance of the optical network device on the virtual gateway. The request message carries first information for synchronization. The first information includes at least the IP address and MAC address of the optical network device. The IP address of the optical network device is used for subsequent virtual gateway and optical network device to detect address conflicts, forward messages, or save Internet status information. The MAC address of the optical network device is used to generate an instance of the optical network device on the virtual gateway. The optical network device receives a first response message from the virtual gateway based on the MAC address. The first response message carries second information for synchronization. The second information includes the IP address and MAC address of the virtual gateway. Wherein, both the request message and the first response message are messages based on the target Layer 2 protocol.
[0034] In this implementation, because the optical network device broadcasts request messages based on MAC addresses, IP address synchronization can be achieved even without knowing the peer address. By using the target Layer 2 protocol for information synchronization, the problem of existing Layer 2 protocols being unable to achieve IP address synchronization is resolved.
[0035] A fourth aspect of the present application provides an optical network device, the optical network device comprising:
[0036] a sending unit, configured to broadcast a request message, where the request message is used for the optical network device to register and generate an instance of the optical network device on the virtual gateway, the request message carrying first information for synchronization, where the first information includes at least an IP address and a MAC address of the optical network device, and the MAC address of the optical network device is used to generate an instance of the optical network device on the virtual gateway;
[0037] A receiving unit is used to receive a first response message from the virtual gateway, the first response message carries second information for synchronization, the second information includes at least the IP address and MAC address of the virtual gateway, the first response message is a response message to the request message, and the request message and the first response message are messages based on the target Layer 2 protocol.
[0038] Based on the third and fourth aspects of the present application, in some possible implementations, the source MAC address of the request message is the MAC address of the optical network device, the destination MAC address of the request message is the broadcast address, and the IP address and MAC address of the optical network device are carried in the payload of the request message.
[0039] Based on the third and fourth aspects of the present application, in some possible implementations, the source MAC address of the first response message is the MAC address of the virtual gateway, the destination MAC address of the request message is the MAC address of the optical network device, and the IP address and MAC address of the virtual gateway are carried in the payload of the first response message.
[0040] Based on the third and fourth aspects of the present application, in some possible implementations, the optical network device broadcasts a request message at intervals of a third time length within the second time length until the optical network device receives the first response message, and the third time length is 2 n-1 -a seconds to 2 n-1 +a is a random value in seconds, n is the number of times the message is sent, and a is the preset duration. For example, the second duration is 60 seconds.
[0041] In this embodiment, the optical network device broadcasts a request message according to the backoff retry mechanism during registration, thereby avoiding network congestion caused by multiple ONTs sending messages simultaneously, and improving the reliability and success rate of data transmission.
[0042] Based on the third and fourth aspects of the present application, in some possible implementations, if the IP address of the optical network device changes, the optical network device sends a third notification message to the virtual gateway, and the third notification message includes the changed IP address of the optical network device. The third notification message is a message based on the target Layer 2 protocol.
[0043] Based on the third and fourth aspects of the present application, in some possible implementations, the optical network device sends a third notification message to the virtual gateway once every x seconds until the optical network device receives a fourth response message from the virtual gateway, where the fourth response message is a response message to the third notification message and is based on the target Layer 2 protocol. Where x is greater than 0. If the optical network device does not receive the fourth response message after sending the third notification message to the virtual gateway n times, the optical network device rebroadcasts the request message. Where n is a positive integer.
[0044] Based on the third and fourth aspects of the present application, in some possible implementations, the source MAC address of the third notification message is the MAC address of the optical network device, the destination MAC address of the third notification message is the MAC address of the optical network device, and the payload of the third notification message includes the MAC address of the optical network device and the changed IP address.
[0045] Based on the third and fourth aspects of the present application, in some possible implementations, if the optical network device does not receive a message from the virtual gateway within a fourth time period, the optical network device sends a fourth notification message to the virtual gateway, and the fourth notification message is used to detect whether the link between the virtual gateway and the optical network device is normal. The fourth notification message is a message based on the target Layer 2 protocol.
[0046] Based on the third and fourth aspects of the present application, in some possible implementations, the optical network device sends a fourth notification message to the virtual gateway once at an interval of y seconds until the optical network device receives a fifth response message from the virtual gateway, where the fifth response message is a response message to the fourth notification message, the fifth response message is a message based on the target Layer 2 protocol, and y is greater than 0. If the optical network device does not receive the fifth response message after sending the fourth notification message to the virtual gateway m times, the optical network device rebroadcasts the request message, where m is a positive integer.
[0047] Based on the third and fourth aspects of the present application, in some possible implementations, the source MAC address of the fourth notification message is the MAC address of the optical network device, and the destination MAC address of the fourth notification message is the MAC address of the virtual gateway.
[0048] Based on the third and fourth aspects of the present application, in some possible implementations, the payload of the fourth notification message includes the IP address and MAC address of the virtual gateway.
[0049] Based on the third and fourth aspects of the present application, in some possible implementations, an optical network device receives a first notification message from a virtual gateway, the first notification message being used to indicate a change in the IP address of the virtual gateway, the first notification message including the changed IP address of the virtual gateway. The optical network device sends a second response message to the virtual gateway, the second response message being a response message to the first notification message, and both the first notification message and the second response message being messages based on a target Layer 2 protocol.
[0050] Based on the third and fourth aspects of the present application, in some possible implementations, the first notification message and the second response message include a sequence field. Before sending the second response message to the virtual gateway, the optical network device generates the second response message based on the sequence field of the first notification message, where the sequence field of the second response message is the same as the sequence field of the first notification message.
[0051] Based on the third and fourth aspects of the present application, in some possible implementations, the optical network device receives a second notification message from the virtual gateway, where the second notification message is used to detect whether the link between the virtual gateway and the optical network device is normal. The optical network device sends a third response message to the virtual gateway, where the third response message is a response message to the second notification message, and both the second notification message and the third response message are messages based on the target Layer 2 protocol.
[0052] Based on the third and fourth aspects of the present application, in some possible implementations, the second notification message and the third response message include a sequence field. Before sending the third response message to the virtual gateway, the optical network device generates a third response message based on the sequence field of the second notification message, where the sequence field of the third response message is the same as the sequence field of the second notification message.
[0053] A fifth aspect of the present application provides a gateway device, including:
[0054] The processor is used to execute a program so that the gateway device executes the method described in the first aspect above.
[0055] A sixth aspect of the present application provides an optical network device, including:
[0056] The processor is used to execute a program so that the optical network device executes the method described in the third aspect above.
[0057] A seventh aspect of the present application provides an information synchronization system, including:
[0058] A gateway device for executing the method according to the first aspect, and an optical network device for executing the method according to the third aspect.
[0059] In an eighth aspect, the present application provides a computer-readable storage medium comprising instructions. When the instructions are executed on a computer, the computer executes the method as described in the first aspect, or the computer executes the method as described in the third aspect.
[0060] The ninth aspect of the present application provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute the method as described in the first aspect above, or enables the computer to execute the method as described in the third aspect above.
[0061] The beneficial effects of the fifth to ninth aspects can be understood by referring to the beneficial effects of the first to fourth aspects and their corresponding implementation methods, and will not be described in detail here. BRIEF DESCRIPTION OF THE DRAWINGS
[0062] FIG1 is a system architecture diagram according to an embodiment of the present application;
[0063] FIG2 is a possible application scenario of the information synchronization method according to an embodiment of the present application;
[0064] FIG3 is a schematic diagram of an embodiment of an information synchronization method according to an embodiment of the present application;
[0065] FIG4 is a schematic diagram of an embodiment of the optical network terminal synchronization state according to an embodiment of the present application;
[0066] FIG5 is a schematic diagram of an embodiment of the network enhanced home gateway synchronization state according to an embodiment of the present application;
[0067] FIG6 is a diagram of a system architecture for information synchronization based on JSON-RPC in an embodiment of the present application;
[0068] FIG7 is a schematic diagram of an embodiment of a gateway device in an embodiment of the present application;
[0069] FIG8 is a schematic diagram of an embodiment of an optical network device according to an embodiment of the present application;
[0070] FIG9 is a schematic diagram of another embodiment of a gateway device according to an embodiment of the present application;
[0071] FIG10 is a schematic diagram of another embodiment of an optical network device in an embodiment of the present application. DETAILED DESCRIPTION
[0072] The embodiments of the present application are described below in conjunction with the accompanying drawings. Those skilled in the art will appreciate that, with the development of technology and the emergence of new scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0073] The terms "first", "second" etc. in the specification, claims and drawings of the present application are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequential order. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances, and this is merely a way of distinguishing the objects of the same attributes when describing them in the embodiments of the present application. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, so that the process, method, system, product or equipment comprising a series of units need not be limited to those units, but may include other units that are not clearly listed or inherent to these processes, methods, products or equipment.
[0074] First, some technical terms involved in the embodiments of this application are introduced.
[0075] The converged edge solution combines cloud computing, edge computing, and the Internet of Things (IoT). It brings computing power to the edge of the network to enable faster and more reliable data processing and analysis. The core concept of the converged edge solution is to deploy computing, storage, and network resources at the edge, thereby reducing data transmission latency, improving data processing efficiency, and alleviating pressure on central cloud services. This solution is suitable for applications requiring real-time response, high bandwidth, and low latency, such as smart manufacturing, smart transportation, smart homes, and smart security. In the converged edge solution, edge devices are responsible for data collection and processing, and perform preliminary data analysis and processing through edge computing. Furthermore, edge devices can collaborate with the cloud, transmitting some data to the cloud for further analysis and processing. The cloud is responsible for global data management, model training, and advanced analytics.
[0076] Edge cloud is a cloud computing platform built on edge infrastructure, leveraging the core capabilities of cloud computing and edge computing. It extends some cloud services or capabilities (including but not limited to storage, computing, networking, artificial intelligence, big data, and security) to edge infrastructure. By offloading network forwarding, storage, computing, and intelligent data analysis to the edge, edge cloud can reduce response latency, alleviate pressure on the cloud, lower bandwidth costs, and provide cloud services such as network-wide scheduling and distributed computing power.
[0077] ECGW is a gateway device running on the edge cloud, primarily responsible for connecting and managing communications between IoT devices and the cloud. Specifically, ECGW can be a bridge device that connects IoT devices and cloud computing centers, enabling efficient and secure data transmission between the two. ECGW also has routing and network address translation (NAT) functions.
[0078] Please refer to Figure 1. The following briefly describes the system architecture based on the information synchronization method in the embodiment of the present application:
[0079] As shown in Figure 1, a virtual gateway 101-1 is deployed on gateway device 101. Virtual gateway 101-1 is isolated by user, with each user corresponding to one virtual gateway 101-1 and two optical network devices, such as optical network device 102 and optical network device 103. Gateway device 101 is used to connect the optical network devices to cloud network 104. It should be understood that the two optical network devices shown in Figure 1 are merely examples. In actual applications, the number of optical network devices corresponding to a user can be greater or lesser, and this is not specifically limited here. Optical network device 102 and optical network device 103 actively register with virtual gateway 101-1 and are managed by virtual gateway 101-1.
[0080] Figure 2 illustrates a possible application scenario. Gateway device 101 in Figure 1 is an ECGW, and virtual gateway 101-1 is a NERG. A NERG is a virtualized home gateway that provides common home gateway functions, including dial-up internet access, NAT, firewall, and Domain Name System (DNS) proxy. It runs in the containerized operating environment provided by the ECGW. Optical network devices 102 and 103 can be ONTs.
[0081] The ONT and NERG require information synchronization in various scenarios. For example, in one possible implementation, the ONT is connected to one or more user devices, and the NERG is connected to one or more cloud devices. The ONT and NERG each assign addresses to their devices and maintain their own address pools. To detect address conflicts, the ONT and NERG need to synchronize IP address and address pool information.
[0082] In a possible implementation, when the ONT accesses the shared service, a static route needs to be added on the ONT, and the NERG's IP address is used as the next hop. Therefore, the NERG's IP address needs to be synchronized to the ONT.
[0083] In a possible implementation, a master / slave switch needs to be performed between the ONT and the NERG. In this case, the ONT and the NERG need to synchronize information about the Internet access channel status.
[0084] In a possible implementation, the NERG needs to manage the information of the devices connected to the ONT, and the ONT needs to synchronize the information of the devices connected to the NERG.
[0085] In the above scenario, information synchronization is required between the ONT and the NERG. However, since all network-layer protocols require the peer's IP address as the destination IP address to send messages, the system architecture shown in Figure 1 does not know the peer's IP and MAC address. Therefore, the requirements of the above scenario cannot be met, especially the IP address synchronization.
[0086] In view of this, an embodiment of the present application proposes an information synchronization method, which can realize information synchronization between an optical network device and a gateway device based on a layer 2 protocol message.
[0087] Referring to FIG3 , an information synchronization method according to an embodiment of the present application includes:
[0088] 301. The optical network device broadcasts a request message.
[0089] Since the optical network device does not know the media access control (MAC) address or IP address of the virtual gateway, and the optical network device and the gateway device are in the same local area network, the optical network device broadcasts a request message within the local area network to register with the virtual gateway on the gateway device. The request message is based on the target Layer 2 protocol, which is used for information synchronization. The format of the target Layer 2 protocol message is shown in Table 1 below:
[0090] Table 1:
[0091] The DMAC field is 6 bytes long and indicates the destination MAC address of the message, which can be unicast or broadcast. If the message is unicast, this field contains the MAC address of the bridge interface (BR0) of the optical network device or virtual gateway. If the message is broadcast, this field contains FFFFFF, indicating that the message is a broadcast message.
[0092] The SMAC field is 6 bytes long and is used to represent the source MAC address of the message, specifically represented by the BR0 MAC address of the optical network device or virtual gateway.
[0093] The VLAN TAG is an optional 4-byte field used to implement virtual local area network (VLAN) separation and forwarding. Specifically, the VLAN TAG adds a tag to the message, allowing the switch to forward the data packet to the corresponding VLAN based on the tag value. In this way, different VLANs can be isolated from each other, thereby protecting data security. For example, some data that needs to be kept confidential can be placed in a specific VLAN, and only user devices with access rights can access this VLAN. This field includes a 2-byte TAG identifier and a 2-byte VLAN or priority (PRI) content.
[0094] The ETH TYPE field is 2 bytes long and is used to indicate the protocol used by the message. In the embodiment of the present application, the ETH TYPE field corresponding to the target layer 2 protocol is 0xAACC.
[0095] The version field is 2 bytes long, with the first byte being a check byte. In one possible implementation, the check byte is written as 0x55. The second byte is used to indicate the version.
[0096] The length field is 2 bytes long and is used to indicate the length of the payload in the message.
[0097] Payload is the effective load carried by the message, which is used to indicate the content of LAN information synchronization. The specific format is shown in Table 2 below:
[0098] Table 2:
[0099] As shown in Table 2, the payload includes a 2-byte MsgType, a 2-byte SeqNum, and a Data part. Among them, MsgType is used to indicate the type of the message. In one possible implementation, when the value of MsgType is 1, the type of the message is a REQ message, that is, a request message, which is used for the optical network device to register with the virtual gateway, and is accompanied by the IP address and MAC address of the optical network device. When the value of MsgType is 2, the type of the message is an ACK message, that is, a response message, which is used to respond, indicating that the message sent by the other party has been received, and can carry its own IP address and MAC address. When the value of MsgType is 3, the type of the message is a NOTIFY message, that is, a notification message, which is used to notify the other party that its own IP address has changed or as a heartbeat message to detect the link, and can carry a new IP address.
[0100] SeqNum is a 2-byte field, also known as the sequence field. In one possible implementation, when the message being sent is a request message or a notification message, the optical network device or virtual gateway increments the SeqNum field in the message by 1. When generating a response message to the message, the SeqNum field is obtained from the corresponding request message or notification message, and the SeqNum field in the response message is equal to the SeqNum field in the corresponding message.
[0101] In the embodiment of the present application, the target layer 2 protocol uses the SeqNum field to confirm the correspondence between the request message and its response message, as well as the correspondence between the notification message and its response message, thereby ensuring the reliability of message transmission.
[0102] In one possible implementation, the Data field is in TLV format. This field includes the data type (type), length (length), and value (value). Type occupies 1 byte, length occupies 1 byte, and the value of length is the length of value, as shown in Table 3 below:
[0103] Table 3:
[0104] Table 3 shows a possible implementation of the Data field, which includes the MAC address, Internet Protocol version 4 (IPv4) address, and Internet Protocol version 6 (IPv6) address of the optical network device or virtual gateway. Big-endian format is a computer byte order storage method, whereby high-order bytes are stored at the low-order end of memory and low-order bytes are stored at the high-order end of memory. For example, for a 16-bit number 0x1234, in big-endian format, 0x12 would be stored at the low-order end of memory, while 0x34 would be stored at the high-order end of memory.
[0105] During initialization, the optical network device broadcasts a request message to register with the virtual gateway. The source MAC address in the request message is the optical network device's MAC address, and the destination MAC address is the broadcast address. The payload of the request message carries the optical network device's MAC address and IP address. The IP address of the optical network device is used for subsequent address conflict detection between the virtual gateway and the optical network device, message forwarding, and storage of online status information (specific details are not limited here). The MAC address of the optical network device is used to generate an instance of the optical network device in the virtual gateway.
[0106] In the embodiment of the present application, since the request message is sent based on MAC address broadcast, it is possible to synchronize the IP address without knowing the MAC address or IP address of the other end. It should be understood that the Layer 2 protocol can be expanded to synchronize other information by adding TLVs, which is not limited here.
[0107] For example, when the optical network device is an ONT and the virtual gateway is a NERG, the synchronization state of the ONT is shown in Figure 4. When the ONT comes online, it enters the initialization state. At this point, the ONT begins broadcasting a request message to register with the NERG. When sending the request message, the ONT uses a backoff-retry mechanism. This backoff-retry mechanism is used to improve data transmission reliability and success rate by implementing a retry strategy when encountering network congestion, transmission errors, timeouts, and other issues during data transmission. If a transmission error or timeout occurs during data transmission, the data transmission will be interrupted and resent. During the retry, a delay is implemented according to a specific backoff strategy to avoid network congestion and resource waste caused by frequent retries.
[0108] In a possible implementation, the average backoff time of the ONT is 1 second (s), 2s, 4s...32s...2 n-1 s increases exponentially, and the maximum backoff time is 60s, that is, the time interval between two transmissions does not exceed 60s, and the backoff time is 2 n-1 -a seconds to 2 n-1 +A random value in seconds, where n is the number of times it is sent and a is the preset duration.
[0109] 302. The virtual gateway sends a first response message to the optical network device;
[0110] After receiving the request message from the optical network device, the virtual gateway records the IP address and MAC address of the optical network device, and sends a response message to the request message, i.e., a first response message, to the optical network device based on the MAC address of the optical network device. The SeqNum field of the first response message is the same as the SeqNum field of the request message, so that the first response message corresponds to the request message. The payload of the first response message carries the MAC address and IP address of the virtual gateway, thereby achieving IP address synchronization between the optical network device and the virtual gateway. It should be understood that the virtual gateway can communicate with multiple optical network devices at the same time. The virtual gateway maintains an optical network device status list, which includes status information of multiple optical network devices.
[0111] Exemplarily, the synchronization state of NERG is shown in FIG5 . After receiving the request message from the ONT, the NERG sends a first response message to the ONT, and the NERG enters the synchronization completion state.
[0112] As shown in Figure 4, after receiving the first response message, the ONT enters the Synchronization Completed state, indicating that the ONT has completed the registration and discovery process, communicated with the NERG, and obtained configuration and network parameters. At this point, the ONT can begin transmitting and receiving data normally, and users can begin using network services.
[0113] Optionally, 303, the virtual gateway sends a first notification message to the optical network device;
[0114] When the configuration of the virtual gateway changes, the virtual gateway needs to synchronize the changed configuration to the optical network device. Take the change of the IP address of the virtual gateway as an example. The virtual gateway sends a first notification message to the optical network device. The source MAC address of the first notification message is the MAC address of the virtual gateway, and the destination MAC address of the first notification message is the MAC address of the optical network device. The first notification message carries the MAC address of the virtual gateway and the changed IP address. If no response message is received from the optical network device within X seconds, the virtual gateway retries to send the first notification message, where X is greater than 0. If no response message is received from the optical network device for N consecutive times, the virtual gateway determines that the other end is unreachable and the link fails, and destroys the instance of the optical network device, where N is a positive integer. In one possible implementation, the virtual gateway sends the first notification message to the optical network device at intervals of 5s. After the virtual gateway sends the first notification message N times in a row, the virtual gateway destroys the instance of the optical network device.
[0115] For example, as shown in Figure 5, when the NERG's local IP address changes, it immediately sends a first notification message, transitioning from the synchronization-completed state to the synchronization or probing state. While in this state, the NERG resends the first notification message every five seconds. If the first notification message is sent more than N times in a row, the NERG destroys the ONT instance.
[0116] It should be understood that the virtual gateway can communicate with multiple optical network devices, and the virtual gateway needs to send first notification messages to the multiple optical network devices so that the multiple optical network devices can synchronize the changed configuration information of the virtual gateway.
[0117] In the embodiment of the present application, sending the first notification message via the MAC address can make the information synchronization between the optical network device and the virtual gateway independent of the IP address. Even if the IP addresses of both parties change, the message can still be transmitted normally.
[0118] Optionally, 304, the optical network device sends a second response message to the virtual gateway;
[0119] After receiving the first notification message, the optical network device updates the virtual gateway's synchronization information based on the changed virtual gateway IP address carried in the payload of the first notification message. The optical network device obtains the SeqNum field from the first notification message and generates a second response message based on this field. The SeqNum field in the second response message is the same as the SeqNum field in the first notification message. The source MAC address of the second response message is the MAC address of the optical network device, and the destination MAC address is the MAC address of the virtual gateway. In one possible implementation, the second response message may not carry the IP address or MAC address of the optical network device.
[0120] Optionally, 305, the virtual gateway sends a second notification message to the optical network device;
[0121] In an embodiment of the present application, a notification message can be used as a heartbeat message to detect the link status between the optical network device and the virtual gateway. If the virtual gateway does not receive any messages from the optical network device within a first duration, the virtual gateway enters a synchronization or probing state and sends a second notification message to the optical network device. The source MAC address of the second notification message is the MAC address of the virtual gateway, and the destination MAC address is the MAC address of the optical network device. The second notification message may carry the IP address and MAC address of the virtual gateway, or may not carry any information, as is not specifically defined herein.
[0122] In one possible implementation, the virtual gateway sends a second notification message to the optical network device at intervals of Y seconds. If no response message is received from the optical network device after M consecutive notification messages, the virtual gateway determines that the peer end is unreachable and a link failure has occurred, and destroys the instance of the optical network device. Y is greater than 0, and M is a positive integer.
[0123] It should be noted that the first notification message and the second notification message are of the same message type. The X seconds in step 303 and the Y seconds in step 305 can be the same duration or different durations, and are not specifically limited here. The number of repetitions N in step 303 and the number of repetitions M in step 305 can be the same or different, and are not specifically limited here.
[0124] For example, as shown in Figure 5, if the NERG does not receive any messages from the ONT within 60 seconds, it immediately sends a second notification message, transitioning from the synchronization complete state to the synchronization or probing state. While in this state, the NERG resends the second notification message every 5 seconds. If the second notification message is sent more than N times in a row, the NERG destroys the ONT instance.
[0125] Optionally, 306 , the optical network device sends a third response message to the virtual gateway;
[0126] After receiving the second notification message, the optical network device sends a third response message to the virtual gateway, which is used to indicate that the optical network device has received the second notification message.
[0127] In the embodiment of the present application, the virtual gateway sends the notification message as a heartbeat message to the optical network device, so there is no need to define a new heartbeat message format, which reduces the communication protocol resource usage and ensures the lightweight nature of the Layer 2 protocol.
[0128] Optionally, 307, the optical network device sends a third notification message to the virtual gateway;
[0129] When the configuration of the optical network device changes, the optical network device sends a third notification message to the virtual gateway to inform the virtual gateway of the changed configuration. The optical network device sends the third notification message to the virtual gateway at intervals of x seconds, where x is greater than 0. After the optical network device sends the third notification message n times in a row and does not receive a response message from the virtual gateway, the optical network device re-enters the initialization state and re-executes step 301, where n is a positive integer.
[0130] For example, as shown in Figure 4, when the local IP address of the ONT changes, the ONT immediately sends a third notification message, and the ONT enters the synchronization or detection state from the synchronization complete state. While in this state, the ONT resends the third notification message every 5 seconds. If the third notification message is sent continuously for more than N times, the ONT enters the initialization state.
[0131] Optionally, 308, the virtual gateway sends a fourth response message to the optical network device;
[0132] Optionally, 309, the optical network device sends a fourth notification message to the virtual gateway;
[0133] The optical network device is limited to the first time length. If no message is received from the optical network device within the fourth time length, the virtual gateway will enter the synchronization or detection state and send a second notification message to the optical network device.
[0134] For example, as shown in Figure 4, if the ONT does not receive any NERG messages within 60 seconds, the ONT immediately sends a fourth notification message, and the ONT enters the Synchronization or Detection state from the Synchronization Completed state. While in this state, the ONT resends the fourth notification message every 5 seconds. If the fourth notification message is sent continuously for more than N times, the ONT enters the Initialization state.
[0135] Optionally, 310, the virtual gateway sends a fifth response message to the optical network device;
[0136] The specific implementation method of steps 308 to 310 can refer to steps 303 to 305. At this time, the steps implemented by the virtual gateway in steps 303 to 305 are implemented by the optical network device, and the steps implemented by the optical network device are implemented by the virtual gateway. The details will not be repeated here.
[0137] It should be noted that for home private networks, where the network is simple and secure, using only the Layer 2 synchronization protocol is sufficient to meet most requirements. However, for synchronization of large amounts of information (which requires multiple messages to send and involves message reassembly) or for scenarios with high security requirements, the JSON-RPC protocol can be used for extended synchronization.
[0138] JSON-RPC is a lightweight remote procedure call (RPC) protocol that uses JSON (JavaScript object notation) as the data format for communication. This protocol allows a client to call functions or methods on a remote server over the network and return the results to the client. The JSON-RPC protocol only defines the JSON format at the application layer; the underlying layer can be implemented using protocols such as the Transmission Control Protocol (TCP), Hypertext Transfer Protocol (HTTP), or Secure Hypertext Transfer Protocol (HTTPS). The JSON-RPC protocol operates in a client-server mode, and requests can only be initiated by the client. Therefore, in use, the client and server can be started separately at both ends, as shown in Figure 6.
[0139] After obtaining the peer IP address, other information synchronization can be completed based on JSON-RPC. Taking the optical network device as ONT and the virtual gateway as NERG as an example, the details are shown in Table 4 below:
[0140] Table 4:
[0141] JSON-RPC request messages can be used to request data or actively send data. The return value indicates the success of the operation. When based on the TCP protocol, large amounts of data can be sent simultaneously, as shown in Figure 5. In scenarios where high security is required over public networks, communication can be accomplished using Secure Sockets Layer (SSL) encryption, such as HTTPS-encapsulated JSON-RPC. This only requires changing the underlying bearer protocol; the service remains unchanged.
[0142] A possible implementation of the JSON-RPC request message is as follows:
[0143] In the embodiment of the present application, the synchronized parameter items will overwrite the previous values, thus ensuring consistency.
[0144] It should be understood that the actual functions of the IP address and MAC address in the embodiments of the present application are not limited to specific names and can also be other names, which are not specifically limited here.
[0145] The above describes the information synchronization method in the embodiment of the present application. The following describes the gateway device and optical network device in the embodiment of the present application. Please refer to Figure 7. An embodiment of the gateway device 700 in the embodiment of the present application includes:
[0146] A receiving unit 701 is configured to receive a request message broadcasted by an optical network device, where the request message is used for the optical network device to register with a virtual gateway and generate an instance of the optical network device on the virtual gateway. The request message carries first information for synchronization, where the first information includes at least an IP address and a MAC address of the optical network device.
[0147] The sending unit 702 is used to send a first response message to the optical network device, where the first response message carries second information for synchronization, where the second information includes at least the Internet Protocol address of the virtual gateway, and the first response message is a response message to the request message. The request message and the first response message are messages based on the target Layer 2 protocol.
[0148] Referring to FIG8 , an embodiment of an optical network device 800 in the present application includes:
[0149] A sending unit 801 is configured to broadcast a request message, where the request message is used for the optical network device to register and generate an instance of the optical network device on the virtual gateway. The request message carries first information for synchronization, where the first information includes at least an IP address and a MAC address of the optical network device.
[0150] The receiving unit 802 is used to receive a first response message from the virtual gateway, the first response message carries second information for synchronization, the second information includes at least the IP address and MAC address of the virtual gateway, the first response message is a response message to the request message, and the request message and the first response message are messages based on the target Layer 2 protocol.
[0151] Next, a gateway device provided in an embodiment of the present application will be introduced. Please refer to Figure 9, which is a structural diagram of the gateway device provided in an embodiment of the present application.
[0152] The gateway device is specifically a communication device, including: a receiver 901, a transmitter 902, a processor 903, and a memory 904 (wherein the number of processors 903 in the gateway device can be one or more), wherein the processor 903 can include an application processor 903-1 and a communication processor 903-2. In some embodiments of the present application, the receiver 901, the transmitter 902, the processor 903, and the memory 904 can be connected via a bus or other means.
[0153] If wireless communication is used, the receiver 901 and the transmitter 902 may be connected to an antenna. If wired communication is used, the receiver 901 and the transmitter 902 may be connected to a cable.
[0154] The memory 904 may include a read-only memory and a random access memory, and provides instructions and data to the processor 903. A portion of the memory 904 may also include non-volatile random access memory (NVRAM). The memory 904 stores processor and operation instructions, executable modules, or data structures, or subsets or extended sets thereof. The operation instructions may include various operation instructions for implementing various operations.
[0155] Processor 903 controls the operation of the gateway device. In specific applications, the various components of the gateway device are coupled together via a bus system. In addition to a data bus, the bus system may also include a power bus, a control bus, and a status signal bus. However, for clarity, the various buses are collectively referred to as a bus system in the figure.
[0156] The method of the aforementioned embodiment can be applied to the processor 903 or implemented by the processor 903. The processor 903 can be an integrated circuit chip with signal processing capabilities. During the implementation process, each step of the aforementioned method can be completed by the hardware integrated logic circuit or software instructions in the processor 903. The above-mentioned processor 903 can be a general-purpose processor, a digital signal processor (DSP), a microprocessor or a microcontroller, a vision processing unit (VPU), a tensor processing unit (TPU), and other processors suitable for AI computing. It can also further include an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, and discrete hardware components. The processor 903 can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in conjunction with the embodiments of the present application can be directly embodied as being executed by a hardware decoding processor, or can be executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium well-known in the art, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, an electrically erasable programmable memory, or a register. The storage medium is located in the memory 904, and the processor 903 reads the information in the memory 904 and executes the method based on the above-mentioned embodiment in conjunction with its hardware.
[0157] Receiver 901 can be used to receive input digital or character information and generate signal input related to executing device-related settings and function control. Transmitter 902 can be used to output digital or character information through the first interface. Transmitter 902 can also be used to send instructions to the disk pack through the first interface to modify data in the disk pack. Transmitter 902 can also include a display device such as a display screen.
[0158] Next, an optical network device provided in an embodiment of the present application will be introduced. Please refer to FIG10 , which is a schematic structural diagram of the optical network device provided in an embodiment of the present application.
[0159] The optical network device is specifically a communication device, including: a receiver 1001, a transmitter 1002, a processor 1003, and a memory 1004 (wherein the number of processors 1003 in the optical network device can be one or more), wherein the processor 1003 can include an application processor 1003-1 and a communication processor 1003-2. In some embodiments of the present application, the receiver 1001, the transmitter 1002, the processor 1003, and the memory 1004 can be connected via a bus or other means.
[0160] If it is wireless communication, the receiver 1001 and the transmitter 1002 can be connected to an antenna. If it is wired communication, the receiver 1001 and the transmitter 1002 can be connected to a cable.
[0161] The memory 1004 may include a read-only memory and a random access memory, and provides instructions and data to the processor 1003. A portion of the memory 1004 may also include non-volatile random access memory (NVRAM). The memory 1004 stores processor and operation instructions, executable modules, or data structures, or subsets or extended sets thereof. The operation instructions may include various operation instructions for implementing various operations.
[0162] Processor 1003 controls the operation of the optical network device. In specific applications, the various components of the optical network device are coupled together via a bus system. In addition to a data bus, the bus system may also include a power bus, a control bus, and a status signal bus. However, for clarity, all of these buses are referred to as a bus system in the figure.
[0163] The method of the foregoing embodiment can be applied to the processor 1003, or implemented by the processor 1003. The processor 1003 can be an integrated circuit chip with signal processing capabilities. During the implementation process, the steps of the foregoing method can be completed by the integrated logic circuit of the hardware in the processor 1003 or the instructions in the form of software. The above-mentioned processor 1003 can be a general-purpose processor, a digital signal processor (digital signal processing, DSP), a microprocessor or a microcontroller, and a vision processor (vision processing unit, VPU), a tensor processor (tensor processing unit, TPU) and other processors suitable for AI computing, and can further include an application specific integrated circuit (ASIC), a field programmable gate array (field-programmable gate array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The processor 1003 can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiments of the present application. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in conjunction with the embodiments of this application can be directly implemented as being executed by a hardware decoding processor, or by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium well-known in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, etc. The storage medium is located in memory 1004, and processor 1003 reads the information in memory 1004 and, in conjunction with its hardware, executes the method based on the aforementioned embodiments.
[0164] Receiver 1001 can be used to receive input digital or character information and generate signal input related to executing relevant device settings and function control. Transmitter 1002 can be used to output digital or character information through the first interface. Transmitter 1002 can also be used to send instructions to the disk pack through the first interface to modify the data in the disk pack. Transmitter 1002 can also include a display device such as a display screen.
[0165] 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.
[0166] 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 an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0167] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0168] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0169] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
Claims
1. An information synchronization method, characterized in that: The method is applied to a virtual gateway, which is deployed on a gateway device. The gateway device is used to connect an optical network device and a cloud network. The method includes: The virtual gateway receives a request message broadcasted by the optical network device, where the request message is used for the optical network device to register with the virtual gateway and generate an instance of the optical network device on the virtual gateway, and the request message carries first information for synchronization, where the first information includes at least an Internet Protocol (IP) address and a Media Access Control (MAC) address of the optical network device; The virtual gateway sends a first response message to the optical network device according to the MAC address of the optical network device, where the first response message carries second information for synchronization, where the second information includes at least the IP address and MAC address of the virtual gateway, and the first response message is a response message to the request message, and the request message and the first response message are messages based on the target Layer 2 protocol.
2. The method according to claim 1, characterized in that After the virtual gateway sends the first response message to the optical network device, the method further includes: If the IP address of the virtual gateway changes, the virtual gateway sends a first notification message to the optical network device, where the first notification message includes the changed IP address of the virtual gateway, and the first notification message is a message based on the target layer 2 protocol.
3. The method according to claim 2, characterized in that The virtual gateway sends a first notification message to the optical network device, including: The virtual gateway sends the first notification message to the optical network device once at an interval of X seconds until the virtual gateway receives a second response message from the optical network device, where the second response message is a response message to the first notification message, and the second response message is a message based on the target Layer 2 protocol, and X is greater than 0; The method further comprises: If the virtual gateway does not receive the second response message after sending the first notification message to the optical network device N times, the virtual gateway destroys the instance of the optical network device, where N is a positive integer.
4. The method according to claim 1, wherein After the virtual gateway sends the first response message to the optical network device, the method further includes: If the virtual gateway does not receive a message from the optical network device within the first time period, the virtual gateway sends a second notification message to the optical network device, where the second notification message is used to detect whether the link between the virtual gateway and the optical network device is normal, and the second notification message is a message based on the target Layer 2 protocol.
5. The method according to claim 4, characterized in that The virtual gateway sends a second notification message to the optical network device, including: The virtual gateway sends the second notification message to the optical network device once at an interval of Y seconds until the virtual gateway receives a third response message from the optical network device, where the third response message is a response message to the second notification message and is a message based on the target Layer 2 protocol, and Y is greater than 0; The method further comprises: If the virtual gateway does not receive the third response message after sending the second notification message to the optical network device M times, the virtual gateway destroys the instance of the optical network device, where M is a positive integer.
6. The method according to any one of claims 1 to 5, characterized in that The request message and the first response message further include a sequence field; Before the virtual gateway sends the first response message to the optical network device, the method further includes: The virtual gateway generates the first response message according to the sequence field of the request message, and the sequence field of the first response message is the same as the sequence field of the request message.
7. The method according to any one of claims 1 to 6, characterized in that After the virtual gateway sends the first response message to the optical network device, the method further includes: The virtual gateway receives a third notification message from the optical network device, where the third notification message is used to indicate that the IP address of the optical network device has changed, and the third notification message includes the changed IP address of the optical network device; The virtual gateway sends a fourth response message to the optical network device, where the fourth response message is a response message to the third notification message, and the third notification message and the fourth response message are messages based on the target layer 2 protocol.
8. The method according to claim 7, characterized in that The third notification message and the fourth response message include a sequence field; Before the virtual gateway sends the fourth response message to the optical network device, the method further includes: The virtual gateway generates the fourth response message according to the sequence field of the third notification message, and the sequence field of the fourth response message is the same as the sequence field of the third notification message.
9. The method according to any one of claims 1 to 8, characterized in that After the virtual gateway sends the first response message to the optical network device, the method further includes: The virtual gateway receives a fourth notification message from the optical network device, where the fourth notification message is used to detect whether a link between the virtual gateway and the optical network device is normal; The virtual gateway sends a fifth response message to the optical network device, where the fifth response message is a response message to the fourth notification message, and the fourth notification message and the fifth response message are messages based on the target layer 2 protocol.
10. The method according to claim 9, characterized in that The fourth notification message and the fifth response message include a sequence field; Before the virtual gateway sends the fifth response message to the optical network device, the method further includes: The virtual gateway generates the fifth response message according to the sequence field of the fourth notification message, and the sequence field of the fifth response message is the same as the sequence field of the fourth notification message.
11. An information synchronization method, characterized in that: The method comprises: The optical network device broadcasts a request message, where the request message is used for the optical network device to register with a virtual gateway and generate an instance of the optical network device on the virtual gateway. The request message carries first information for synchronization, where the first information includes at least an IP address and a MAC address of the optical network device. The optical network device receives a first response message from the virtual gateway, the first response message carries second information for synchronization, the second information includes at least the IP address and MAC address of the virtual gateway, the first response message is a response message to the request message, and the request message and the first response message are messages based on the target Layer 2 protocol.
12. The method according to claim 11, characterized in that The optical network device broadcasts a request message, including: The optical network device broadcasts the request message at intervals of a third time length within the second time length until the optical network device receives the first response message, and the third time length is 2 n-1 -a seconds to 2 n-1 + a random value in seconds, where n is the number of times sent and a is the preset duration.
13. The method according to claim 11 or 12, characterized in that After the optical network device receives the first response message from the virtual gateway, the method further includes: If the IP address of the optical network device changes, the optical network device sends a third notification message to the virtual gateway, the third notification message including the changed IP address of the optical network device, and the third notification message is a message based on the target layer 2 protocol.
14. The method according to claim 13, characterized in that The optical network device sending a third notification message to the virtual gateway includes: The optical network device sends the third notification message to the virtual gateway once at an interval of x seconds until the optical network device receives a fourth response message from the virtual gateway, where the fourth response message is a response message to the third notification message and the fourth response message is a message based on the target Layer 2 protocol, and x is greater than 0; The method further comprises: If the optical network device does not receive the fourth response message after sending the third notification message to the virtual gateway n times, the optical network device rebroadcasts the request message, where n is a positive integer.
15. The method according to claim 11 or 12, characterized in that After the optical network device receives the first response message from the virtual gateway, the method further includes: If the optical network device does not receive a message from the virtual gateway within a fourth time period, the optical network device sends a fourth notification message to the virtual gateway, where the fourth notification message is used to detect whether the link between the virtual gateway and the optical network device is normal, and the fourth notification message is a message based on the target Layer 2 protocol.
16. The method according to claim 15, characterized in that The optical network device sending a second notification message to the virtual gateway includes: The optical network device sends the fourth notification message to the virtual gateway once at an interval of y seconds until the optical network device receives a fifth response message from the virtual gateway, wherein the fifth response message is a response message to the fourth notification message, and the fifth response message is a message based on the target Layer 2 protocol, and y is greater than 0; The method further comprises: If the optical network device does not receive the fifth response message after sending the fourth notification message to the virtual gateway m times, the optical network device rebroadcasts the request message, where m is a positive integer.
17. The method according to any one of claims 11 to 16, characterized in that After the optical network device receives the first response message from the virtual gateway, the method further includes: The optical network device receives a first notification message from the virtual gateway, where the first notification message is used to indicate that the IP address of the virtual gateway has changed, and the first notification message includes the changed IP address of the virtual gateway; The optical network device sends a second response message to the virtual gateway, where the second response message is a response message to the first notification message, and the first notification message and the second response message are messages based on the target layer 2 protocol.
18. The method according to claim 17, characterized in that The first notification message and the second response message include a sequence field; Before the optical network device sends the second response message to the virtual gateway, the method further includes: The optical network device generates the second response message according to the sequence field of the first notification message, and the sequence field of the second response message is the same as the sequence field of the first notification message.
19. The method according to any one of claims 11 to 16, characterized in that After the optical network device receives the first response message from the virtual gateway, the method further includes: The optical network device receives a second notification message from the virtual gateway, where the second notification message is used to detect whether a link between the virtual gateway and the optical network device is normal; The optical network device sends a third response message to the virtual gateway, where the third response message is a response message to the second notification message, and the second notification message and the third response message are messages based on the target layer 2 protocol.
20. The method according to claim 19, characterized in that The second notification message and the third response message include a sequence field; Before the optical network device sends the third response message to the virtual gateway, the method further includes: The optical network device generates the third response message according to the sequence field of the second notification message, and the sequence field of the third response message is the same as the sequence field of the second notification message.
21. A gateway device, characterized in that: The gateway device is deployed with a virtual gateway, and the gateway device is used to connect the optical network device and the cloud network, including: a receiving unit, configured to receive a request message broadcasted by the optical network device, wherein the request message is used for the optical network device to register with the virtual gateway, and the request message carries first information for synchronization, wherein the first information includes at least an IP address and a MAC address of the optical network device; A sending unit is used to send a first response message to the optical network device, where the first response message carries second information for synchronization, the second information includes at least the IP address and MAC address of the virtual gateway, and the first response message is a response message to the request message. The request message and the first response message are messages based on the target Layer 2 protocol.
22. An optical network device, characterized in that: include: A sending unit, configured to broadcast a request message for the optical network device to register with a virtual gateway, the request message carrying first information for synchronization, the first information including at least an IP address and a MAC address of the optical network device; A receiving unit is used to receive a first response message from the virtual gateway, the first response message carries second information for synchronization, the second information includes at least the IP address and MAC address of the virtual gateway, the first response message is a response message to the request message, and the request message and the first response message are messages based on the target Layer 2 protocol.
23. A gateway device, characterized in that: include: A processor, configured to execute a program so that the gateway device performs the method according to any one of claims 1 to 10.
24. An optical network device, characterized in that: include: A processor, configured to execute a program so that the optical network device executes the method according to any one of claims 11 to 20.
25. An information synchronization system, characterized in that: include: A gateway device for executing the method according to any one of claims 1 to 10, and a gateway device for executing the method according to any one of claims 11 to 20.
26. A computer-readable storage medium comprising instructions, which, when executed on a computer, cause the computer to execute the method according to any one of claims 1 to 10, or cause the computer to execute the method according to any one of claims 11 to 20.
27. A computer program product comprising instructions which, when run on a computer, causes the computer to perform the method according to any one of claims 1 to 10, or causes the computer to perform the method according to any one of claims 11 to 20.