Data communication method, device, computer equipment and storage medium

By sending packets carrying network addresses to stacked devices and determining the target address according to a preset strategy, the problem of data packet loss caused by inconsistent addresses after network devices are destacking is solved, and the reliability of data transmission is improved.

CN116132359BActive Publication Date: 2025-09-30INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310068232.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-01-13
Publication Date
2025-09-30
Estimated Expiration
2043-01-13

AI Technical Summary

Technical Problem

After the network devices are dismantled, data transmission reliability is low due to inconsistent port network addresses, resulting in packet loss during forwarding.

Method used

A target message carrying network address information is sent to the stacking device to generate a feedback message, and a target network address is determined according to a preset address selection policy. A notification message is sent to instruct the stacking device to use the address for communication.

Benefits of technology

This ensures that even if a network device fails, the stacked device can still communicate with other devices, improving the reliability of data transmission and avoiding data packet loss.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116132359B_ABST
    Figure CN116132359B_ABST
Patent Text Reader

Abstract

The present application relates to a data communication method, system, apparatus, computer device, storage medium and computer program product, and relates to the field of cloud computing technology. The method comprises: sending a target message carrying a network address to each stacking device, which can instruct each stacking device to generate a feedback message after receiving each target message, and then determining the target network address according to a preset address selection strategy and the feedback message. When the local network address and the target network address are different, the target network address is used as the current network address. By sending a notification message containing the target network address to each stacking device, each stacking device can be instructed to communicate with the network device through the target network address, and the effect of forwarding the message to each network device can be achieved. The use of this method can solve the problem of data packet loss caused by the inconsistency between the target network address and the port network address, and improve the high reliability of data transmission.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of cloud computing technology, and in particular to a data communication method, apparatus, computer equipment, storage medium, and computer program product. Background Art

[0002] With the development of cloud computing technology, network virtualization technology for data center networks has emerged. By connecting multiple network devices through stacking, multiple devices are virtualized into one device, which forwards data as a whole.

[0003] Traditionally, stacked network devices can cause service interruptions and packet loss during maintenance and upgrades. Therefore, de-stacking network devices can reduce device coupling and improve reliability.

[0004] However, after the current cross-device link aggregation technology is destacking, since the target network addresses of the ports connected to the two network devices on the other end and the stacking device on the local end may be different, if one of the network devices fails, the stacking device on the local end will not be able to communicate with the other network devices, resulting in packet loss in message forwarding, resulting in low data transmission reliability. Summary of the Invention

[0005] Based on this, it is necessary to provide a data communication method, device, computer equipment, computer-readable storage medium and computer program product that can enable the first network device to learn the network address of the second network device and achieve high reliability of data transmission to address the above technical problems.

[0006] In a first aspect, the present application provides a data communication method. The method comprises:

[0007] Sending a target message to each stacking device; the target message carries a target field containing network address information, which is used to instruct each stacking device to summarize the target fields carried by each target message after receiving each target message, and generate a feedback message containing the summarized target fields;

[0008] receiving the feedback message, where the feedback message carries a target field corresponding to each network device;

[0009] determining target network address information in each target field included in the feedback message according to a preset address selection strategy, and using the target network address as the currently used network address if the local network address is different from the target network address;

[0010] A notification message including the target network address information is sent to each of the stacking devices; the notification message is used to instruct each of the stacking devices to communicate with the network device through the target network address information.

[0011] In one embodiment, before sending the target message to each stacking device, the method further includes:

[0012] The preset port identifier, Internet protocol address and network address are added to the type-length-value TLV field to obtain a target field, and a target message is generated according to a preset message generation strategy and the target field.

[0013] In one embodiment, determining the target network address information in each target field included in the feedback message according to a preset address selection strategy includes:

[0014] Filtering the target fields contained in the feedback message to select the target fields that meet the preset selection conditions by using the preset port identifier and the Internet Protocol address;

[0015] According to a preset address selection strategy, the target network address information is determined in each target field that meets the preset selection conditions.

[0016] In one embodiment, using the target network address as the currently used network address includes:

[0017] The target network address is set as the network address of the port communicating with each of the stacking devices.

[0018] In one embodiment, the method further comprises:

[0019] When it is detected that the network device is restarted, a step of sending a target message to each of the stacking devices is performed.

[0020] In a second aspect, the present application provides a data communication method. The method comprises:

[0021] receiving a target message sent by each network device, wherein the target message carries a target field including network address information;

[0022] Summarizing the target fields carried by each of the target messages, and generating a feedback message including the summarized target fields;

[0023] Sending a feedback message to each network device; the feedback message is used to instruct each network device to determine the target network address information in each target field included in the feedback message according to a preset address selection strategy;

[0024] A notification message including the target network address is received, where the notification message is used to instruct each of the stacking devices to communicate with each of the network devices through the target network address information.

[0025] In one embodiment, the method further comprises:

[0026] When a failure of the first network device is detected, a data transmission message is sent to the second network device according to the target network address information.

[0027] In a third aspect, the present application provides a data communication system. The system includes a network device and a stacking device, wherein:

[0028] The network device is used to send a target message to each stacking device; the target message carries a target field containing network address information;

[0029] The stacking device is configured to summarize the target fields carried by each target message, generate a feedback message containing the summarized target fields, and send the feedback message to each network device;

[0030] The network device is further configured to receive a feedback message, the feedback message carrying a target field corresponding to each of the network devices; determine target network address information in each of the target fields contained in the feedback message according to a preset address selection strategy, and use the target network address as the currently used network address if the local network address is different from the target network address; and send a notification message containing the target network address information to each of the stacking devices;

[0031] The stacking device is further configured to receive a notification message including the target network address information; and communicate with the network device via the target network address information.

[0032] In a fourth aspect, the present application further provides a data communication device. The device includes:

[0033] A first sending module is configured to send a target message to each stacking device; the target message carries a target field containing network address information, and is configured to instruct each stacking device to summarize the target fields carried by each target message after receiving each target message, and generate a feedback message containing the summarized target fields;

[0034] A receiving module, configured to receive the feedback message, wherein the feedback message carries a target field corresponding to each network device;

[0035] a determination module, configured to determine target network address information in each target field included in the feedback message according to a preset address selection strategy, and use the target network address as the currently used network address if the local network address is different from the target network address;

[0036] The second sending module is configured to send a notification message including the target network address information to each of the stacking devices; the notification message is used to instruct each of the stacking devices to communicate with the network device through the target network address information.

[0037] In one embodiment, the apparatus further comprises:

[0038] The generation module is used to add the preset port identifier, Internet protocol address and network address to the type-length-value TLV field to obtain the target field, and generate the target message according to the preset message generation strategy and the target field.

[0039] In one embodiment, the determining module is specifically configured to:

[0040] Filtering the target fields contained in the feedback message to select the target fields that meet the preset selection conditions by using the preset port identifier and the Internet Protocol address;

[0041] According to a preset address selection strategy, the target network address information is determined in each target field that meets the preset selection conditions.

[0042] In one embodiment, the determining module is specifically configured to:

[0043] The target network address is set as the network address of the port communicating with each of the stacking devices.

[0044] In one embodiment, the apparatus further comprises:

[0045] The restart module is used to execute the step of sending a target message to each stacking device when it is detected that the network device is restarted.

[0046] In a fifth aspect, the present application further provides a data communication device. The device includes:

[0047] A first receiving module is configured to receive a target message sent by each network device, wherein the target message carries a target field including network address information;

[0048] A generating module, configured to summarize the target fields carried by each of the target messages and generate a feedback message containing the summarized target fields;

[0049] A first sending module is configured to send a feedback message to each network device; the feedback message is configured to instruct each network device to determine target network address information in each target field included in the feedback message according to a preset address selection strategy;

[0050] The second receiving module is configured to receive a notification message including the target network address, where the notification message is used to instruct each of the stacking devices to communicate with each of the network devices through the target network address information.

[0051] In one embodiment, the apparatus further comprises:

[0052] The second sending module is configured to send a data transmission message to the second network device according to the target network address information when a failure of the first network device is detected.

[0053] In a sixth aspect, the present application further provides a computer device. The computer device includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0054] Sending a target message to each stacking device; the target message carries a target field containing network address information, which is used to instruct each stacking device to summarize the target fields carried by each target message after receiving each target message, and generate a feedback message containing the summarized target fields;

[0055] receiving the feedback message, where the feedback message carries a target field corresponding to each network device;

[0056] determining target network address information in each target field included in the feedback message according to a preset address selection strategy, and using the target network address as the currently used network address if the local network address is different from the target network address;

[0057] A notification message including the target network address information is sent to each of the stacking devices; the notification message is used to instruct each of the stacking devices to communicate with the network device through the target network address information.

[0058] In a seventh aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the following steps:

[0059] Sending a target message to each stacking device; the target message carries a target field containing network address information, which is used to instruct each stacking device to summarize the target fields carried by each target message after receiving each target message, and generate a feedback message containing the summarized target fields;

[0060] receiving the feedback message, where the feedback message carries a target field corresponding to each network device;

[0061] determining target network address information in each target field included in the feedback message according to a preset address selection strategy, and using the target network address as the currently used network address if the local network address is different from the target network address;

[0062] A notification message including the target network address information is sent to each of the stacking devices; the notification message is used to instruct each of the stacking devices to communicate with the network device through the target network address information.

[0063] In an eighth aspect, the present application further provides a computer program product. The computer program product includes a computer program that, when executed by a processor, implements the following steps:

[0064] Sending a target message to each stacking device; the target message carries a target field containing network address information, which is used to instruct each stacking device to summarize the target fields carried by each target message after receiving each target message, and generate a feedback message containing the summarized target fields;

[0065] receiving the feedback message, where the feedback message carries a target field corresponding to each network device;

[0066] determining target network address information in each target field included in the feedback message according to a preset address selection strategy, and using the target network address as the currently used network address if the local network address is different from the target network address;

[0067] A notification message including the target network address information is sent to each of the stacking devices; the notification message is used to instruct each of the stacking devices to communicate with the network device through the target network address information.

[0068] The data communication method, apparatus, computer device, storage medium, and computer program product for network devices described above can instruct each stacked device to generate a feedback message after receiving each target message by sending a target message carrying a network address to each stacked device. The method then determines the target network address based on a preset address selection strategy and the feedback message, and uses the target network address as the currently used network address if the local network address differs from the target network address. By sending a notification message containing the target network address to each stacked device, the method can instruct each stacked device to communicate with the network device via the target network address. Therefore, if one of the network devices fails, the stacked device at the local end can communicate with the other network devices, thereby resolving the problem of data packet loss caused by inconsistency between the target network address and the port network address and improving the reliability of data transmission. BRIEF DESCRIPTION OF THE DRAWINGS

[0069] Figure 1 A diagram of an application environment of a data communication method in one embodiment;

[0070] Figure 2 A schematic diagram of a flow chart of a data communication method applied to a network device in one embodiment;

[0071] Figure 3 FIG1 is a schematic diagram of an optional type-length-value TLV field format in one embodiment;

[0072] Figure 4 A schematic diagram of a process for determining target network address information in one embodiment;

[0073] Figure 5 A schematic diagram of a flow chart of a data communication method applied to a stacking device in one embodiment;

[0074] Figure 6 A signaling diagram illustrating a process in which a network device sends a notification message to each stacking device in one embodiment;

[0075] Figure 7 is a structural block diagram of a data communication device in one embodiment;

[0076] Figure 8 is a structural block diagram of a data communication device in another embodiment;

[0077] Figure 9 FIG. 1 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0078] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.

[0079] The data communication method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. Data communication includes preset networking and network devices. The preset networking and network devices can communicate with each other through link aggregation, and each port can be virtualized into a logical port. The preset networking includes a first stacking device 102 and a second stacking device 104. The first stacking device 102 and the second stacking device 104 communicate with the first network device 106 and the second network device 108 through the port. The preset networking mode of each stacking device takes M-LAG networking as an example. The network device and the stacking device are network devices that can run the target protocol, wherein the network device is a non-stacked device, and the Internet Protocol address of each network device is the same. Each stacking device and each network device can be but not limited to various network security devices, access control devices and network transmission devices, such as switches, routers, firewall devices, etc.

[0080] In one embodiment, Figure 2 As shown, a data communication method is provided, which is applied to Figure 1 The network device in the example is used to illustrate the process, including the following steps:

[0081] Step 202: Send a target message to each stacking device.

[0082] The target message carries a target field including network address information, which is used to instruct each stacking device to summarize the target fields carried by each target message after receiving each target message and generate a feedback message including the summarized target fields.

[0083] In an embodiment of the present application, a target communication protocol may be pre-configured in the network device. The network device then sends a target message containing a target field of network address information to each stacking device through the port for communicating with each stacking device based on the target communication protocol, wherein the network address is a MAC address (Media Access Control Address). After each stacking device receives each target message through the communication port, it parses each target message, obtains the target field carried by each target message, aggregates the target fields, and generates a feedback message containing the aggregated target fields. Optionally, each port for communicating with each stacking device can be virtualized into a single logical port through link aggregation.

[0084] Step 204: Receive a feedback message.

[0085] The feedback message carries a target field corresponding to each network device.

[0086] In the embodiment of the present application, the network device receives a feedback message sent by the stacking device, the message carrying a target field corresponding to each network device.

[0087] Step 206: According to the preset address selection strategy, determine the target network address information in each target field included in the feedback message, and use the target network address as the currently used network address when the local network address is different from the target network address.

[0088] Among them, the preset address selection strategy can be to compare the sizes of network addresses and select one of the network addresses. For the preset address selection strategy, any algorithm with a selection function can be applied to this application, and the embodiments of this application do not limit this.

[0089] In an embodiment of the present application, the network device selects, from each target field included in the feedback message, the network address information corresponding to one of the network devices in the network address of each target field, using a preset address selection policy, as the target network address information. Specifically, from each target field included in the feedback message, the network device selects, from each target field, the network address with the largest network address in the target field, using the preset address selection policy, as the target network address. Optionally, the network device may select the network address with the smallest network address in the target field as the target network address. If the local network address and the target network address are different, the network device uses the target network address as the currently used network address.

[0090] Step 208: Send a notification message containing target network address information to each stacking device.

[0091] The notification message is used to instruct each stacking device to communicate with the network device through the target network address information.

[0092] In an embodiment of the present application, the network device sends an ARP (Address Resolution Protocol) message to each stacking device according to the target network address, binds the network address by sending an ARP message to each stacking device, and notifies each stacking device to communicate with the network device through the target network address information.

[0093] In the above-mentioned data communication method, by sending a target message carrying a network address to each stacking device, each stacking device can be instructed to generate a feedback message after receiving each target message. Then, based on a preset address selection strategy and the feedback message, the target network address is determined. If the local network address and the target network address are different, the target network address is used as the current network address. By sending a notification message containing the target network address to each stacking device, each stacking device can be instructed to communicate with the network device via the target network address. Therefore, if one of the network devices fails, the local stacking device will be able to communicate with the other network devices, thereby solving the problem of data packet loss caused by inconsistency between the target network address and the port network address, and improving the reliability of data transmission.

[0094] In one embodiment, before step 202, the method further includes:

[0095] The preset port identifier, Internet protocol address and network address are added to the type-length-value TLV field to obtain the target field, and the target message is generated according to the preset message generation strategy and target field.

[0096] The preset network protocol may be the LLDP (Link Layer Discovery Protocol) protocol.

[0097] In an embodiment of the present application, the network device obtains a pre-stored extended preset protocol as the target network protocol, and obtains the optional type-length-value TLV field in the target network protocol. Then, the network device adds the TLV type, TLV preset port identifier, Internet Protocol address and network address to the type-length-value TLV field to obtain the target field, and then the network device generates a target message according to the corresponding target field. Among them, the preset TLV type can be a preset type, for example, the TLV type is 77. In the embodiment of the present application, the value of the TLV type is not limited. The preset port identifier is a pre-defined interface group identifier, the Internet Protocol address is an IP address (Internet Protocol Address), and the network address is a MAC address. The length of the preset port identifier, Internet Protocol address and network address can be a pre-defined data length. For example, the preset port identifier can be 2 bytes in length, the Internet Protocol address can be 4 bytes in length, and the network address can be 6 bytes. The format of the optional type-length-value TLV field is as follows: Figure 3As shown, the type of the optional type length value TLV field is the TLVtype field, the string length of the optional type length value TLV field is the TLV information string length field, and the data content of the optional type length value TLV field is the TLV information string field.

[0098] In this embodiment, a pre-stored target network protocol is obtained through a network device, and a preset port identifier, Internet Protocol address, and network address are added to the type-length-value TLV field of the target network protocol to obtain a target field and a target message, so that subsequent stacking devices can perform subsequent parsing and aggregation processing on the target message.

[0099] In one embodiment, Figure 4 As shown, step 206 includes:

[0100] Step 402: Filter the target fields included in the feedback message to find the target fields that meet the preset selection conditions by using the preset port identifier and Internet Protocol address.

[0101] In an embodiment of the present application, after the network device receives a feedback message through a port that communicates with the stacking device, it parses the feedback message to obtain the target fields contained in the feedback message, and then identifies the preset port identifier and Internet Protocol address of each target field, and filters out the target fields that have the same preset port identifier and Internet Protocol address.

[0102] Step 404: Determine target network address information in each target field that meets the preset selection conditions according to the preset address selection strategy.

[0103] In an embodiment of the present application, the network device selects, in a target field having the same preset port identifier and the same Internet Protocol address, one of the network address information in the target field having the same preset port identifier as the target network address information, using a preset address selection policy. Specifically, the network device selects, in each target field included in the feedback message, the target field having the larger network address as the target network address, using the preset address selection policy. Optionally, the network device may select the target field having the smaller network address as the target network address.

[0104] In this embodiment, the preset port identifier and Internet Protocol address of each target field are identified by the network device, and the target fields with the same preset port identifier and the same Internet Protocol address can be screened out, and one of the network address information in the target fields with the same preset port identifier and the same Internet Protocol address is selected as the target network address information. This can achieve the goal of selecting another network device with the same preset interface identifier and Internet Protocol address as its own from multiple target fields, and selecting the target network address in one of the target fields.

[0105] In one embodiment, step 206 includes:

[0106] Set the target network address to the network address of the port that communicates with each stacking device.

[0107] In the embodiments of the present application, the network device compares the local network address of the communication port with the target network address. If the local network address and the target network address are different, the network device uses the target network address as the current network address and solidifies the target network address using a preset solidification algorithm, without aging the network address. Any algorithm with a solidification function can be applied to the present application, and the embodiments of the present application are not limited thereto. If the local network address and the target network address are the same, the local network address remains unchanged.

[0108] In this embodiment, the target network address is solidified through the network device, and the target network address can be set to the network address currently used by each port communicating with each stacking device, so that the network address of the communicating port remains consistent when each network device communicates with each stacking device.

[0109] In one embodiment, it further includes:

[0110] When it is detected that the network device has restarted, a step of sending a target message to each stacking device is performed.

[0111] In an embodiment of the present application, when the network device is restarted, the network device re-executes the step of sending the target message to each stacked device; receives the feedback message, determines the target network address information in each target field contained in the feedback message according to the preset address selection strategy, and uses the target network address as the currently used network address when the local network address is different from the target network address.

[0112] In this embodiment, when the network device is restarted, the step of setting the target network address of the network device port is re-executed, so that the port network address can be reset, thereby further improving the reliability of the network device.

[0113] In one embodiment, Figure 5 As shown, a data communication method is provided, which is applied to Figure 1 The following steps are used as an example to describe the stacking device in Figure 1:

[0114] Step 502: Receive target messages sent by each network device.

[0115] The target message carries a target field containing network address information.

[0116] In the embodiments of the present application, stacking devices run a preset protocol on their communication ports and receive, through their communication ports, target messages sent by various network devices, each carrying a target field containing network address information. Optionally, the network devices and the communication ports of the stacking devices can communicate via link aggregation. Stacking devices are network devices that are networked according to preset networking rules. Stacking devices may include, but are not limited to, various network security devices, access control devices, and network transmission devices, such as switches, routers, and firewalls, although these are not limited in the embodiments of the present application.

[0117] Step 504: Summarize the target fields carried in each target message and generate a feedback message containing the summarized target fields.

[0118] In the embodiment of the present application, the stacking device parses and summarizes the target fields carried in each target message, and generates a feedback message according to the summarized target fields.

[0119] Step 506: Send a feedback message to each network device.

[0120] The feedback message is used to instruct each network device to determine the target network address information in each target field included in the feedback message according to a preset address selection strategy.

[0121] In an embodiment of the present application, the stacking device sends a feedback message to each network device through the communication port. After receiving the feedback message, each network device determines the target network address information in each target field included in the feedback message according to a preset address selection strategy.

[0122] Step 508: Receive a notification message including the target network address.

[0123] The notification message carries a target network address, which is used to instruct each stacking device to communicate with each network device through the target network address information.

[0124] In an embodiment of the present application, the stacking device receives an ARP message carrying a target network address, binds the network address according to the ARP message sent by each network device, and notifies each stacking device to communicate with the network device through the target network address information.

[0125] In the above data communication method, by receiving the target message sent by each network device, and then summarizing the target fields carried by each target message, a feedback message containing the summarized target fields is generated, and a feedback message is sent to each network device. A notification message containing the target network address is received to instruct each stacked device to communicate with the network device through the target network address. Therefore, the effect of forwarding the message to each network device can be achieved, thereby solving the problem of data packet loss due to inconsistency between the target network address and the port network address, and improving the high reliability of data transmission.

[0126] In one embodiment, it further includes:

[0127] When a failure of the first network device is detected, a data transmission message is sent to the second network device according to the target network address information.

[0128] In an embodiment of the present application, upon detecting a failure in a first network device, the stacking device transmits a data transmission message to a second network device based on the target network address information according to a preset device switching algorithm. Alternatively, if the network devices are operating normally, the stacking device may also transmit a data transmission message to any device based on the target network address information according to a preset device switching algorithm, where the data transmission message may be a message of a preset type. Any preset device switching algorithm capable of switching devices may be applied in the present application, and this embodiment of the present application does not limit this.

[0129] In this embodiment, the stacking device can be used to switch between the first network device and the second network device when a network device fails, thereby achieving high reliability of data transmission.

[0130] In one embodiment, Figure 6 As shown, an example of a processing process of a network device sending a notification message to each stacking device in a data communication method is also provided, and the specific contents include:

[0131] Step 601: The network device generates a target message according to a target field corresponding to a target network protocol.

[0132] In the embodiment of the present application, the network device obtains a pre-stored extended preset protocol as the target network protocol and obtains the optional type-length-value TLV field in the target network protocol. The network device then adds the TLV type, TLV preset port identifier, Internet Protocol address, and network address to the type-length-value TLV field to obtain the target field. The network device then generates a target message based on the corresponding target field.

[0133] Step 602: The network device sends a target message containing a target field of network address information to each stack device.

[0134] In an embodiment of the present application, the network device obtains a pre-stored target protocol, runs the target protocol on the communication port, and then the network device sends a target message containing a target field of network address information to each stacking device through the port for communicating with each stacking device.

[0135] Step 603: The stacking device generates a feedback message including the summarized target fields.

[0136] In the embodiment of the present application, after receiving each target message at the communication port, the stacking device parses and summarizes the target fields carried in each target message, and generates a feedback message including the summarized target fields.

[0137] Step 604: The stacking device sends a feedback message to each network device through the communication port.

[0138] Step 605: The network device receives a feedback message sent by the stacking device, the message carrying a target field corresponding to each network device.

[0139] Step 606: The network device filters out target fields with the same preset port identifier and the same Internet Protocol address.

[0140] In an embodiment of the present application, after the network device receives the target fields contained in the feedback message through the port that communicates with the stacking device, it identifies the preset port identifier and Internet Protocol address of each target field, and filters out the target fields with the same preset port identifier and the same Internet Protocol address.

[0141] In step 607, the network device selects one of the network address information in the target field with the same preset port identifier as the target network address information according to the preset address selection strategy.

[0142] In an embodiment of the present application, the network device selects, in the target fields having the same preset port identifier and the same Internet Protocol address, one of the network address information in the target fields having the same preset port identifier and the same Internet Protocol address as the target network address information, using a preset address selection policy. Specifically, the network device selects, in each target field included in the feedback message, the target field having the larger network address as the target network address, using the preset address selection policy. Optionally, the network device may select the target field having the smaller network address as the target network address.

[0143] In step 608 , the network device uses the target network address as the currently used network address and solidifies the target network address using a preset solidification algorithm.

[0144] In an embodiment of the present application, the network device will compare the local network address of the communication port with the target network address. If the local network address is different from the target network address, the network device will use the target network address as the currently used network address and solidify the target network address through a preset solidification algorithm, and will not age the network address.

[0145] Step 609: The network device sends an ARP message to each stack device according to the target network address.

[0146] In step 610 , the stack device binds the network address according to the ARP message and communicates with the network device through the target network address information.

[0147] Step 611: When the network device is restarted, the network device re-executes the step of sending the target message to each stacking device.

[0148] Step 612: When the stacking device detects that the first network device fails, the stacking device sends a data transmission message to the second network device according to the target network address information based on a preset device switching algorithm.

[0149] In an embodiment of the present application, upon detecting a failure of a first network device, the stacking device sends a data transmission message to a second network device based on the target network address information according to a preset device switching algorithm. Alternatively, if the network devices are operating normally, the stacking device may also send a data transmission message to any device based on the target network address information according to a preset device switching algorithm.

[0150] It should be understood that, although the various steps in the flowcharts involved in the various embodiments described above are displayed in sequence according to the instructions of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowcharts involved in the various embodiments described above can include multiple steps or multiple stages, and these steps or stages are not necessarily executed and completed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of steps or stages in other steps.

[0151] In one embodiment, Figure 1 As shown, a data communication system is provided, including a first stacking device 102, a second stacking device 104, a first network device 106 and a second network device 108, wherein:

[0152] The network device is used to send a target message to each stacking device; the target message carries a target field containing network address information;

[0153] The stacking device is configured to summarize the target fields carried by each target message, generate a feedback message containing the summarized target fields, and send the feedback message to each network device;

[0154] The network device is further configured to receive a feedback message, the feedback message carrying a target field corresponding to each of the network devices; determine target network address information in each of the target fields contained in the feedback message according to a preset address selection strategy, and use the target network address as the currently used network address if the local network address is different from the target network address; and send a notification message containing the target network address information to each of the stacking devices;

[0155] The stacking device is further configured to receive a notification message including the target network address information; and communicate with the network device via the target network address information.

[0156] Based on the same inventive concept, embodiments of the present application further provide a data communication device for implementing the aforementioned data communication method. The implementation solution provided by this device is similar to the implementation solution described in the aforementioned method. Therefore, the specific limitations in one or more data communication device embodiments provided below can be found in the above-mentioned limitations on the data communication method and will not be further elaborated here.

[0157] In one embodiment, Figure 7 As shown, a data communication device is provided, including: a first sending module 702, a receiving module 704, a determining module 706 and a second sending module 708, wherein:

[0158] The first sending module 702 is configured to send a target message to each stacking device; the target message carries a target field including network address information, and is configured to instruct each stacking device to summarize the target fields carried by each target message after receiving each target message, and generate a feedback message including the summarized target fields;

[0159] The receiving module 704 is configured to receive the feedback message, where the feedback message carries a target field corresponding to each network device;

[0160] a determination module 706 configured to determine target network address information in each target field included in the feedback message according to a preset address selection strategy, and use the target network address as the currently used network address if the local network address is different from the target network address;

[0161] The second sending module 708 is configured to send a notification message including the target network address information to each stacking device; the notification message is used to instruct each stacking device to communicate with the network device through the target network address information.

[0162] In one embodiment, the apparatus further comprises:

[0163] The generation module is used to add the preset port identifier, Internet protocol address and network address to the type-length-value TLV field to obtain the target field, and generate the target message according to the preset message generation strategy and the target field.

[0164] In one embodiment, the determining module 706 is specifically configured to:

[0165] Filtering the target fields contained in the feedback message to select the target fields that meet the preset selection conditions by using the preset port identifier and the Internet Protocol address;

[0166] According to a preset address selection strategy, the target network address information is determined in each target field that meets the preset selection conditions.

[0167] In another embodiment, the determining module 706 is specifically configured to:

[0168] The target network address is set as the network address of the port communicating with each of the stacking devices.

[0169] In one embodiment, the apparatus further comprises:

[0170] The restart module is used to execute the step of sending a target message to each stacking device when it is detected that the network device is restarted.

[0171] In one embodiment, Figure 8 As shown, a data communication device is provided, including: a first receiving module 802, a generating module 804, a first sending module 806 and a second receiving module 808, wherein:

[0172] A first receiving module 802 is configured to receive a target message sent by each network device, wherein the target message carries a target field including network address information;

[0173] A generating module 804 is configured to summarize the target fields carried by each target message and generate a feedback message including the summarized target fields;

[0174] A first sending module 806 is configured to send a feedback message to each network device; the feedback message is configured to instruct each network device to determine target network address information in each target field included in the feedback message according to a preset address selection strategy;

[0175] The second receiving module 808 is configured to receive a notification message including the target network address, where the notification message is used to instruct each of the stacking devices to communicate with each of the network devices through the target network address information.

[0176] In one embodiment, the apparatus further comprises:

[0177] The second sending module is configured to send a data transmission message to the second network device according to the target network address information when a failure of the first network device is detected.

[0178] Each module in the above-mentioned data communication device can be implemented in whole or in part through software, hardware, or a combination thereof. Each module can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the corresponding operations of each module.

[0179] In one embodiment, a computer device is provided. The computer device may be a network device or a stacking device. The internal structure diagram thereof may be as follows: Figure 9 As shown. The computer device includes a processor, a memory, an input / output interface and a communication interface, and an input device. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface and the input device are connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a data communication method is implemented.

[0180] Those skilled in the art will understand that Figure 9 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.

[0181] In one embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program, and the processor implements the steps in the above method embodiments when executing the computer program.

[0182] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0183] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.

[0184] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions.

[0185] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, database or other media used in the embodiments provided in this application may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory may include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, distributed databases based on blockchains. The processor involved in the various embodiments provided herein may be, but are not limited to, a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, and the like.

[0186] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0187] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.

Claims

1. A data communication method, characterized in that: The method is applied to a network device, and the method includes: Adding a preset port identifier, an Internet Protocol address, and a network address to a type-length-value TLV field to obtain a target field, and generating a target message according to a preset message generation strategy and the target field; Sending a target message to each stacking device, used to instruct each stacking device to summarize the target fields carried by each target message after receiving each target message, and generate a feedback message containing the summarized target fields; receiving the feedback message, where the feedback message carries a target field corresponding to each network device; By identifying the preset port identifier and the Internet Protocol address, filtering out target fields having the same preset port identifier and the same Internet Protocol address from the target fields included in the feedback message; determining, according to a preset address selection policy, target network address information in a target field having the same preset port identifier and Internet Protocol address, and using the target network address as a currently used network address if the local network address is different from the target network address; A notification message including the target network address information is sent to each of the stacking devices; the notification message is used to instruct each of the stacking devices to communicate with the network device through the target network address information.

2. The method according to claim 1, characterized in that The using the target network address as the currently used network address includes: The target network address is set as the network address of the port communicating with each of the stacking devices.

3. The method according to claim 1, characterized in that The method further comprises: When it is detected that the network device is restarted, a step of sending a target message to each of the stacking devices is performed.

4. A data communication method, characterized in that: The method is applied to a stacking device, and the method includes: receiving a target message sent by each network device, the target message carrying a target field including network address information; wherein the target message is generated by adding a preset port identifier, an Internet Protocol address, and a network address to a type-length-value (TLV) field to obtain the target field, and generating the target message according to a preset message generation policy and the target field; Summarizing the target fields carried by each of the target messages, and generating a feedback message including the summarized target fields; Sending a feedback message to each network device; the feedback message is used to instruct each network device to identify the preset port identifier and the Internet Protocol address, filter out target fields in each target field included in the feedback message in which the preset port identifier and the Internet Protocol address are the same; and determine target network address information in the target fields in which the preset port identifier and the Internet Protocol address are the same according to a preset address selection policy; A notification message including the target network address is received, where the notification message is used to instruct each of the stacking devices to communicate with each of the network devices through the target network address information.

5. The method according to claim 4, characterized in that The method further comprises: When a failure of the first network device is detected, a data transmission message is sent to the second network device according to the target network address information.

6. A data communication system, characterized in that: The system includes a network device and a stacking device, wherein: The network device is configured to add a preset port identifier, an Internet Protocol address, and a network address to a type-length-value TLV field to obtain a target field, and generate a target message according to a preset message generation policy and the target field; and send the target message to each stacking device; the target message carries a target field including network address information; The stacking device is configured to summarize the target fields carried by each target message, generate a feedback message containing the summarized target fields, and send the feedback message to each network device; The network device is further configured to receive a feedback message, the feedback message carrying a target field corresponding to each of the network devices; by identifying the preset port identifier and the Internet Protocol address, filtering out target fields in which the preset port identifier and the Internet Protocol address are the same from each of the target fields contained in the feedback message; determining target network address information in the target fields in which the preset port identifier and the Internet Protocol address are the same according to a preset address selection strategy, and using the target network address as the currently used network address if the local network address is different from the target network address; and sending a notification message containing the target network address information to each of the stacking devices; The stacking device is further configured to receive a notification message including the target network address information; and communicate with the network device via the target network address information.

7. A data communication device, characterized in that: The device comprises: A generation module, configured to add a preset port identifier, an Internet Protocol address, and a network address to a type-length-value TLV field to obtain a target field, and generate a target message according to a preset message generation strategy and the target field; A first sending module is configured to send a target message to each stacking device; the target message carries a target field containing network address information, and is configured to instruct each stacking device to summarize the target fields carried by each target message after receiving each target message, and generate a feedback message containing the summarized target fields; A receiving module, configured to receive the feedback message, wherein the feedback message carries a target field corresponding to each network device; a determination module configured to identify the preset port identifier and the Internet Protocol address, and filter out target fields in each target field included in the feedback message, in which the preset port identifier and the Internet Protocol address are identical; determine target network address information in the target fields in which the preset port identifier and the Internet Protocol address are identical, according to a preset address selection policy; and use the target network address as the currently used network address if the local network address is different from the target network address; The second sending module is configured to send a notification message including the target network address information to each of the stacking devices; the notification message is used to instruct each of the stacking devices to communicate with the network device through the target network address information.

8. A data communication device, characterized in that: The device comprises: a first receiving module, configured to receive a target message sent by each network device, the target message carrying a target field including network address information; wherein the target message is generated by adding a preset port identifier, an Internet Protocol address, and a network address to a type-length-value (TLV) field to obtain the target field, and is generated according to a preset message generation policy and the target field; A generating module, configured to summarize the target fields carried by each of the target messages and generate a feedback message containing the summarized target fields; a sending module, configured to send a feedback message to each network device; the feedback message is configured to instruct each network device to identify the preset port identifier and the Internet Protocol address, filter out target fields in each target field included in the feedback message in which the preset port identifier and the Internet Protocol address are identical; and determine target network address information in the target fields in which the preset port identifier and the Internet Protocol address are identical according to a preset address selection policy; The second receiving module is configured to receive a notification message including the target network address, where the notification message carries the target network address and is configured to instruct each stacking device to communicate with each network device through the target network address information.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 3 or claims 4 to 5 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 3 or claims 4 to 5 are implemented.

11. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 3 or claims 4 to 5 are implemented.