CN-122027539-A - Edge gateway message routing coordination method and system based on distributed network
Abstract
The invention discloses an edge gateway message routing collaborative method and system based on a distributed network, which are implemented by firstly inquiring a local routing table after a first edge gateway receives a message routing request, and when the first edge gateway is matched with a target device in other edge gateway domains, a special forwarding path can be dynamically and quickly established with a second edge gateway without global routing inquiry or central server intervention, so that localization and automation of route discovery are realized, wherein the direct forwarding path between the first edge gateway and the second edge gateway is established, and the directional and efficient transmission of messages among devices crossing different edge network domains is realized by combining with a pre-established device connection path, meanwhile, redundant revolution of the messages in a central cloud or an upper network is avoided, the time delay and network load of end-to-end transmission are reduced, and the communication interruption risk caused by a central node fault is reduced.
Inventors
- ZHU DEJIANG
- Tao Renyong
- CHEN HAIYANG
Assignees
- 深圳市绿联科技股份有限公司
Dates
- Publication Date
- 20260512
- Application Date
- 20260206
Claims (10)
- 1. An edge gateway message routing collaboration method based on a distributed network, the method being applied to an electronic device having an application installed thereon and communicatively coupled to a network attached storage device through which the electronic device accesses the network attached storage device, the method comprising: when a first edge gateway detects a long connection request triggered by the electronic equipment, the first edge gateway executes target connection operation on the electronic equipment according to the long connection request to obtain a target connection result aiming at the electronic equipment, wherein the target connection result at least comprises a first connection path of the first edge gateway and the electronic equipment; When the first edge gateway detects a message routing request triggered by the electronic device, the first edge gateway executes a device query operation for a local routing table according to the message routing request, and when a device query result indicates that the local routing table records a device ID of a network additional storage device matched with the message routing request, a first forwarding path between the first edge gateway and a second edge gateway is established according to the device query result, and a message to be transmitted, which is included in the message routing request, is transmitted to the second edge gateway through the first forwarding path; Pushing the message to be transmitted to the network additional storage device through a pre-constructed second connection path by the second edge gateway, and after the network additional storage device receives the message to be transmitted, returning a first receiving identification aiming at the message to be transmitted to the electronic device through a first transmission path by the network additional storage device, wherein the flow sequence of a path corresponding to the first receiving identification transmitted to the electronic device through the first transmission path is the second connection path, the first forwarding path and the first connection path.
- 2. The distributed network-based edge gateway message routing collaboration method of claim 1, wherein the performing, by the first edge gateway, a device query operation for a local routing table based on the message routing request comprises: determining, by the first edge gateway, a first device ID of a network attached storage device according to the message routing request; Performing equipment query operation on a local routing table by the first edge gateway according to the first equipment ID to obtain equipment query results aiming at the first equipment ID, wherein the equipment query results are used for indicating the existence or non-existence of a recorded ID matched with the first equipment ID in the local routing table; And establishing a first forwarding path between the first edge gateway and the second edge gateway according to the device query result, including: determining a gateway address corresponding to a second edge gateway registered by the recorded ID according to the equipment query result; And establishing a first forwarding path between the first edge gateway and the second edge gateway according to the gateway address of the first edge gateway and the gateway address corresponding to the second edge gateway.
- 3. The distributed network-based edge gateway message routing collaboration method of claim 2, wherein the method further comprises: When the device query result indicates that the local routing table does not record the device ID of the network additional storage device matched with the message routing request, calculating a first hash value corresponding to the first device ID by the first edge gateway; Performing a distributed query operation on the first hash value by the first edge gateway to obtain a distributed query result for the first hash value, wherein the distributed query result comprises a third edge gateway responsible for managing the first hash value and a gateway address of the third edge gateway; establishing a second transmission path between the electronic equipment and the network additional storage equipment by the first edge gateway according to the distributed query result, updating the first equipment ID and the second transmission path into the local routing table, and transmitting a message to be transmitted, which is included in the message routing request, to the network additional storage equipment through the second transmission path; and after the network additional storage device receives the message to be transmitted, returning a second receiving identification aiming at the message to be transmitted to the electronic device through the second transmission path in a primary way.
- 4. A distributed network-based edge gateway message routing co-ordination method as claimed in claim 3, wherein the second transmission path comprises the first connection path, a second forwarding path between the first edge gateway and the third edge gateway, a third connection path between the third edge gateway and the network attached storage device; The path flow sequence of the message to be transmitted, which is transmitted to the network additional storage device through the second transmission path, is the first connection path, the second forwarding path and the third connection path in sequence; the distributed query operation is an XOR distance based distributed node query operation.
- 5. The edge gateway message routing collaboration method according to any one of claims 1-4, wherein the performing, by the first edge gateway, a target connection operation on the electronic device according to the long connection request, to obtain a target connection result for the electronic device, includes: Acquiring equipment authentication information of the electronic equipment by the first edge gateway according to the long connection request, and executing verification operation on the electronic equipment according to the equipment authentication information and a preset verification strategy to obtain a verification result aiming at the electronic equipment; when the verification result shows that verification is passed, creating a target session for the electronic device by the first edge gateway according to the device authentication information, wherein the target session at least comprises a connection handle, a second device ID of the electronic device and a context subjected to authentication and authorization; and the first edge gateway stores the second equipment ID and the position information of the target session into a distributed network corresponding to the first edge gateway according to a preset registration flow, and sends a response message of successful connection to the electronic equipment.
- 6. The method according to claim 5, wherein the storing, by the first edge gateway, the second device ID and the location information of the target session into the distributed network corresponding to the first edge gateway according to a preset registration procedure, includes: Calculating a second hash value corresponding to the second equipment ID by the first edge gateway according to a preset registration flow; And generating a key value pair aiming at the electronic equipment and the target session by taking the second hash value as a distributed key and the position information of the target session as a value, and writing the key value pair into a distributed storage corresponding to a distributed network corresponding to the first edge gateway, wherein the position information at least comprises a network service port of the first edge gateway, a timestamp aiming at the latest record of the target session and a connection state of the electronic equipment, and the connection state comprises any one of an equipment on-line state, an equipment off-line state and unstable connection.
- 7. The distributed network-based edge gateway message routing collaboration method of claim 6, wherein the writing the key value pairs into their corresponding distributed storage in the distributed network corresponding to the first edge gateway comprises: inquiring the local routing table by the first edge gateway according to the distributed key to obtain a target node in the local routing table, wherein the target node is responsible for managing the distributed key; transmitting, by the first edge gateway, the key-value pair to the target node; And storing the key value pairs by the target node, taking the second hash value as a query benchmark, determining a plurality of adjacent hash values corresponding to the second hash value and distributed nodes corresponding to each adjacent hash value, and copying the key value pairs into each distributed node.
- 8. An edge gateway message routing collaboration system based on a distributed network, the system being for an electronic device having an application installed thereon and the electronic device being communicatively coupled to a network attached storage device, the electronic device accessing the network attached storage device through the application, the system comprising: The first connection control module is used for executing target connection operation on the electronic equipment by the first edge gateway according to the long connection request when the first edge gateway detects the long connection request triggered by the electronic equipment, so as to obtain a target connection result aiming at the electronic equipment, wherein the target connection result at least comprises a first connection path of the first edge gateway and the electronic equipment; The device query module is used for executing device query operation for a local routing table according to the message routing request by the first edge gateway when the first edge gateway detects the message routing request triggered by the electronic device; The first connection management and control module is further configured to, when the device query result indicates that the local routing table records a device ID of a network additional storage device that matches the message routing request, establish, by the first edge gateway, a first forwarding path between the first edge gateway and the second edge gateway according to the device query result; The first transmission module is used for transmitting the message to be transmitted, which is included in the message routing request, to the second edge gateway through the first forwarding path by the first edge gateway; The first transmission module is further configured to push the message to be transmitted to the network additional storage device through a second connection path that is pre-built by the second edge gateway, and after the network additional storage device receives the message to be transmitted, return a first receiving identifier for the message to be transmitted to the electronic device through a first transmission path by the network additional storage device, where a sequence of a path flow corresponding to the first receiving identifier transmitted to the electronic device through the first transmission path is the second connection path, the first forwarding path and the first connection path.
- 9. The electronic equipment is characterized by being in communication connection with a network additional storage device, wherein an application program is installed on the electronic equipment; The electronic device is configured to perform the distributed network-based edge gateway message routing coordination method of any of claims 1-7.
- 10. An edge gateway message routing collaboration apparatus based on a distributed network, wherein the apparatus is applied to an electronic device, and the apparatus performs a request response operation on an interaction request triggered for the network additional storage device according to the edge gateway message routing collaboration method based on the distributed network as claimed in any one of claims 1 to 7.
Description
Edge gateway message routing coordination method and system based on distributed network Technical Field The present invention relates to the field of data transmission technologies, and in particular, to a method and a system for edge gateway message routing coordination based on a distributed network. Background When the mobile terminal (such as a mobile phone terminal) accesses the storage data on the network additional storage device (such as NAS device), the conventional mode needs to register the mobile phone terminal and the NAS device to a central gateway respectively, and then uses the central gateway as a transit node to inquire the node address currently registered by the opposite party. Therefore, the central gateway needs to maintain all node registration information in the whole network and instruct how to establish connection between the mobile phone end and the NAS device. However, the "central gateway" in the current architecture has a single point of failure risk, which can lead to a full network crash once the system is down. In addition, according to the data interaction architecture based on the central gateway, other nodes in butt joint with the central gateway need to forward data through the central gateway, so that even if two devices are in the same intranet, when the two devices perform data interaction, the data forwarding is required to be performed at the central node, and direct interaction of the two devices cannot be performed directly, and message delay and extra performance cost are increased. In addition, when the central gateway accesses to the mass equipment, the read-write pressure of the central gateway can also cause performance bottleneck of the system. Disclosure of Invention The invention provides a distributed network-based edge gateway message routing collaborative method and a distributed network-based edge gateway message routing collaborative system, which can realize the unification of low delay and high availability of message routing under the condition of complex and massive equipment access scenes. The first aspect of the invention discloses a distributed network-based edge gateway message routing collaboration method, which comprises the following steps: When a first edge gateway detects a long connection request triggered by electronic equipment, the first edge gateway executes target connection operation on the electronic equipment according to the long connection request to obtain a target connection result aiming at the electronic equipment, wherein the target connection result at least comprises a first connection path of the first edge gateway and the electronic equipment; When the first edge gateway detects a message routing request triggered by the electronic device, the first edge gateway executes a device query operation for a local routing table according to the message routing request, and when a device query result indicates that the local routing table records a device ID of a network additional storage device matched with the message routing request, a first forwarding path between the first edge gateway and a second edge gateway is established according to the device query result, and a message to be transmitted, which is included in the message routing request, is transmitted to the second edge gateway through the first forwarding path; Pushing the message to be transmitted to the network additional storage device through a pre-constructed second connection path by the second edge gateway, and after the network additional storage device receives the message to be transmitted, returning a first receiving identification aiming at the message to be transmitted to the electronic device through a first transmission path by the network additional storage device, wherein the flow sequence of a path corresponding to the first receiving identification transmitted to the electronic device through the first transmission path is the second connection path, the first forwarding path and the first connection path. As an optional implementation manner, in the first aspect of the present invention, the performing, by the first edge gateway, a device query operation for a local routing table according to the message routing request includes: determining, by the first edge gateway, a first device ID of a network attached storage device according to the message routing request; Performing equipment query operation on a local routing table by the first edge gateway according to the first equipment ID to obtain equipment query results aiming at the first equipment ID, wherein the equipment query results are used for indicating the existence or non-existence of a recorded ID matched with the first equipment ID in the local routing table; And establishing a first forwarding path between the first edge gateway and the second edge gateway according to the device query result, including: determining a gateway address corresponding to a second edge gateway regist