Message transmission method and device, storage medium and electronic equipment

By establishing mapping relationships and adjusting states in network devices, the problem of poor message transmission accuracy caused by ambiguous device network relationships is solved, enabling more accurate network topology drawing and efficient network operation and maintenance management.

CN120880959APending Publication Date: 2025-10-31ZHEJIANG DAHUA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510955514.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-10
Publication Date
2025-10-31

AI Technical Summary

Technical Problem

In the prior art, the default forwarding behavior of network devices when receiving link layer packets causes non-directly connected devices to be mistakenly identified as directly connected neighbors, resulting in confusion and overlay of link state information, which affects the accuracy of network structure and data transmission efficiency.

Method used

By establishing a mapping relationship between the target interface and the link layer multicast address, the device is adjusted to a forwarding suppression state. After receiving and updating the link state information, the mapping relationship is deleted, and the device is restored to the packet forwarding state, ensuring that the device accurately receives and sends link layer packets.

Benefits of technology

It enables more accurate network topology mapping, ensuring a true reflection of the physical connections between devices, improving the efficiency and accuracy of network operation and maintenance management, and avoiding interference from link status information updates to the network topology.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120880959A_ABST
    Figure CN120880959A_ABST
Patent Text Reader

Abstract

The invention discloses a message transmission method and device, a storage medium and electronic equipment. The method comprises: establishing a mapping relationship between a target interface and a link layer multicast address to adjust a first device to a forwarding suppression state, the target interface being an interface corresponding to a central processing unit of the first device; a second link layer message sent by a second device is received, link state information of the first device is updated according to the second link layer message, the network structure of the target network is determined, a physical connection relation exists between the first device and the second device, and the first device and the second device are both located in the target network; and in response to completion of updating of the link state information of the first device, deleting the mapping relationship to adjust the first device to a message forwarding state, the message forwarding state indicating that the first device is allowed to send the first link layer message. The message transmission method and device solve the technical problem that the message transmission accuracy is poor due to the fact that the equipment network relation is fuzzy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computers, and more specifically, to a method and apparatus for transmitting messages, a storage medium, and an electronic device. Background Technology

[0002] In related technologies, when some network devices receive link-layer messages to update link-state information, due to their default forwarding behavior, they often send their own link-layer messages at the same time. This not only causes non-directly connected devices to be mistakenly identified as directly connected neighbors, but also causes confusion and overwriting of link-state information, thus misleading the entire network structure. Furthermore, in the transmission of messages, since network devices rely on accurate topology information to make optimal path selection and load balancing decisions, any inaccuracy in topology drawing will directly affect the efficiency and reliability of data transmission.

[0003] In summary, the relevant technologies suffer from the problem of unclear device network relationships, leading to poor message transmission accuracy.

[0004] There is currently no effective solution to the above problems. Summary of the Invention

[0005] This application provides a message transmission method and apparatus, storage medium and electronic device to at least solve the technical problem of poor message transmission accuracy caused by ambiguous device network relationships.

[0006] According to one aspect of the embodiments of this application, a method for transmitting a message is provided, comprising: establishing a mapping relationship between a target interface and a link-layer multicast address to adjust a first device to a forwarding suppression state, wherein the target interface is an interface corresponding to the central processing unit of the first device, the forwarding suppression state indicates that the first device is prohibited from sending a first link-layer message, the first link-layer message including the link-state information of the first device; receiving a second link-layer message sent by a second device, and updating the link-state information of the first device according to the second link-layer message, determining the network structure of a target network, wherein there is a physical connection between the first device and the second device, both the first device and the second device are in the target network, and the second link-layer message includes the link-state information of the second device; and deleting the mapping relationship in response to the completion of the link-state information update of the first device to adjust the first device to a message forwarding state, wherein the message forwarding state indicates that the first device is allowed to send the first link-layer message.

[0007] According to another aspect of the embodiments of this application, a message transmission apparatus is also provided, comprising: an establishment module, configured to establish a mapping relationship between a target interface and a link layer multicast address to adjust a first device to a forwarding suppression state, wherein the target interface is an interface corresponding to the central processing unit of the first device, the forwarding suppression state indicates that the first device is prohibited from sending a first link layer message, the first link layer message including the link state information of the first device; an update module, configured to receive a second link layer message sent by a second device, and update the link state information of the first device according to the second link layer message to determine the network structure of a target network, wherein there is a physical connection relationship between the first device and the second device, both the first device and the second device are in the target network, and the second link layer message includes the link state information of the second device; and a deletion module, configured to delete the mapping relationship in response to the completion of the link state information update of the first device to adjust the first device to a message forwarding state, wherein the message forwarding state indicates that the first device is allowed to send the first link layer message.

[0008] Optionally, the apparatus is further configured to: receive a second link-layer message sent by the second device, and after updating the link state information of the first device according to the second link-layer message, obtain the initial reception time of the first device receiving the first link-layer message, a first time configuration parameter of the first device, and a second time configuration parameter of the second device; determine a target transmission time according to the initial reception time, the first time configuration parameter, and the second time configuration parameter; in response to the completion of the link state information update of the first device, delete the mapping relationship to adjust the first device to the message forwarding state; and send a third link-layer message to the third device at the target transmission time, wherein there is a physical connection between the third device and the first device, the third link-layer message includes at least one of the link state information of the first device and the link state information of the second device, and the third device is located in the target network.

[0009] Optionally, the device is configured to determine the target transmission time based on the initial reception time, the first time configuration parameter, and the second time configuration parameter in the following manner: obtaining a preset transmission duration, a minimum waiting duration, a first transmission period, and the initial transmission time from the first time configuration parameter, and obtaining a second transmission period from the second time configuration parameter, wherein the first transmission period is used to represent the frequency at which the first device transmits its own link status information, and the second transmission period is used to represent the frequency at which the second device transmits its own link status information; determining a secondary reception time based on the initial reception time and the second transmission period, determining a waiting time window based on the preset transmission duration, the minimum waiting duration, the message transmission period, and the initial transmission time, wherein the secondary reception time represents the time when the first device next receives the link status information transmitted by the second device; and determining the target transmission time based on the secondary reception time and the waiting time window.

[0010] Optionally, the device is configured to determine the target transmission time based on the secondary reception time and the waiting time window in the following manner, including at least one of the following: if the secondary reception time is not within the waiting time window, determining the target transmission time as the first time point of the next first transmission cycle; if the secondary reception time is within the waiting time window, determining the target transmission time as the first time point after the end of the waiting time window.

[0011] Optionally, the apparatus is configured to send a third link layer message to a third device at the target transmission time in the following manner, including at least one of the following: sending a first sub-message to the third device at the target transmission time, wherein the first sub-message is generated by the first device, the first sub-message includes the link state information of the first device, and the third link layer message includes the first sub-message; sending a second sub-message to the third device at the target transmission time, wherein the second sub-message is generated by the second device and sent to the first device, the second sub-message includes the link state information of the second device, and the third link layer message includes the second sub-message.

[0012] Optionally, the apparatus is further configured to: establish a mapping relationship between a target interface and a link layer multicast address to obtain a group of devices in the target network before adjusting the first device to a forwarding suppression state; identify the device in the group of devices that cannot configure link layer packet forwarding rules and access control lists and is in an initial forwarding state as the first device, wherein the initial forwarding state indicates that the first device is allowed to update its link state information according to the second link layer packet when it receives the second link layer packet, and forward the second link layer packet to a fourth device, wherein there is a physical connection between the fourth device and the first device, and the fourth device is located in the target network.

[0013] According to another aspect of the embodiments of this application, a computer-readable storage medium is also provided, wherein a computer program is stored in the computer-readable storage medium, and the computer program is configured to execute the above-described message transmission method when running.

[0014] According to another aspect of the embodiments of this application, a computer program product or computer program is provided, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the message transmission method described above.

[0015] According to another aspect of the embodiments of this application, an electronic device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the above-described message transmission method through the computer program.

[0016] In this embodiment, a mapping relationship is established between a target interface and a link-layer multicast address to adjust the first device to a forwarding suppression state. The target interface is the interface corresponding to the central processing unit of the first device. The forwarding suppression state indicates that the first device is prohibited from sending first link-layer packets, which include the link-state information of the first device. A second link-layer packet sent by a second device is received, and the link-state information of the first device is updated based on the second link-layer packet to determine the network structure of the target network. There is a physical connection between the first device and the second device, and both devices are located in the target network. The second link-layer packet includes the link-state information of the second device. In response to the completion of the link-state information update of the first device, the mapping relationship is deleted to adjust the device to a forwarding suppression state. The first device is in the message forwarding state, which indicates the mode in which the first device is allowed to send the first link layer message. This allows the first device to silently receive and process link state information updates from neighboring devices (i.e., the second device) within a specific time period without interfering with the normal communication process of other devices in the network. This ensures that the first device can accurately receive and update its own link state information, while avoiding the impact of its own message broadcasting on network topology drawing during the update reception process. This results in a more accurate network topology drawing, ensuring the true reflection of the physical connection relationships between devices in the network. This achieves the technical effect of improving the efficiency and accuracy of network operation and maintenance management, and solves the technical problem of poor message transmission accuracy caused by ambiguous device network relationships. Attached Figure Description

[0017] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments of this application and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:

[0018] Figure 1 This is a schematic diagram of an application environment for an optional message transmission method according to an embodiment of this application;

[0019] Figure 2 This is a flowchart illustrating an optional message transmission method according to an embodiment of this application;

[0020] Figure 3 This is a schematic diagram of an optional message transmission method according to an embodiment of this application;

[0021] Figure 4 This is a schematic diagram of another optional message transmission method according to an embodiment of this application;

[0022] Figure 5 This is a schematic diagram of another optional message transmission method according to an embodiment of this application;

[0023] Figure 6 This is a schematic diagram of another optional message transmission method according to an embodiment of this application;

[0024] Figure 7 This is a schematic diagram of another optional message transmission method according to an embodiment of this application;

[0025] Figure 8 This is a schematic diagram of an optional message transmission device according to an embodiment of this application. Detailed Implementation

[0026] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.

[0027] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0028] The present application will be described below with reference to embodiments:

[0029] According to one aspect of the embodiments of this application, a message transmission method is provided. Optionally, in this embodiment, the above-described message transmission method can be applied to, for example... Figure 1 The hardware environment shown consists of server 101 and terminal device 103. For example... Figure 1As shown, server 101 is connected to terminal device 103 via a network and can be used to provide services to terminal device or application 107 installed on terminal device. The application can be video application, instant messaging application, browser application, educational application, game application, etc. Database 105 can be set up on the server or independently of the server to provide data storage services for server 101, such as a game data storage server. The network mentioned above can include, but is not limited to, wired networks and wireless networks. The wired network includes local area networks, metropolitan area networks, and wide area networks. The wireless network includes Bluetooth, WIFI, and other networks that enable wireless communication. Terminal device 103 can be a terminal configured with an application, and can include, but is not limited to, at least one of the following: mobile phones (such as Android phones, iOS phones, etc.), laptops, tablets, handheld computers, MID (Mobile Internet Devices), PADs, desktop computers, smart TVs, smart voice interaction devices, smart home appliances, vehicle terminals, aircraft, virtual reality (VR) terminals, augmented reality (AR) terminals, mixed reality (MR) terminals, and other computer devices. The server mentioned above can be a single server, a server cluster composed of multiple servers, or a cloud server.

[0030] Combination Figure 1 As shown, the above message transmission method can be executed by an electronic device, which can be a terminal device or a server. The above message transmission method can be implemented by the terminal device or the server respectively, or by the terminal device and the server together.

[0031] The above is merely an example, and this embodiment does not impose any specific limitations.

[0032] Alternatively, as an alternative implementation method, such as Figure 2 As shown, the transmission method of the above message includes:

[0033] S202, Establish a mapping relationship between the target interface and the link layer multicast address to adjust the first device to a forwarding suppression state, wherein the target interface is the interface corresponding to the central processing unit of the first device, and the forwarding suppression state indicates that the first device is prohibited from sending the first link layer message, and the first link layer message includes the link state information of the first device;

[0034] First, the target interface specifically refers to the interface corresponding to the central processing unit of the first device. By establishing a mapping relationship between this interface and the link layer multicast address, it can be ensured that all received LLDP packets are sent to the CPU for processing, rather than being immediately forwarded to the network. In other words, the device state transition is achieved through software configuration rather than hardware modification.

[0035] Optionally, in this embodiment, the target interface refers to the interface inside the first device used for processing advanced network control functions, and is not limited to the CPU interface, but can also be any control plane interface capable of performing message uploading and processing operations. Similarly, link state information includes, but is not limited to, device identifier, port status, supported protocols, management address information, etc., and can be key data carried in messages by link discovery protocols such as LLDP, which helps network devices accurately identify and construct network topology.

[0036] It should be noted that different network environments and requirements may lead to differences in the specific implementation and configuration of the target interface. For example, some network devices may implement CPU-like interface functions through a dedicated network processing unit (NPU), or use virtualization technology to map the physical interface to multiple virtual control interfaces.

[0037] Furthermore, the update frequency and level of detail of link state information may be adjusted based on the real-time network status, device performance limitations, or network management policies. This application does not impose any limitations in this regard.

[0038] S204, receive the second link layer message sent by the second device, update the link state information of the first device according to the second link layer message, and determine the network structure of the target network. There is a physical connection between the first device and the second device, and both the first device and the second device are in the target network. The second link layer message includes the link state information of the second device.

[0039] Optionally, step S204 above involves the first device receiving and integrating link-state information from neighboring devices (i.e., the second device) to update its own link-state database and ultimately determine the accurate network structure of the target network. During this process, the first device focuses on receiving and processing the link-state information sent by the second device through second link-layer packets.

[0040] Optionally, in this embodiment, the second link layer message refers to a message generated by the second device and sent via a link discovery protocol such as LLDP. The second link layer message carries the link state information of the second device, including but not limited to device identifier, port capabilities, management address, and link type. The first device receiving this type of message can update its own neighbor list based on the information contained therein, thereby adjusting the network topology database to reflect the actual physical connections in the network.

[0041] It should be noted that updating the link status information of the first device is not static, but is dynamically adjusted based on the actual content of the second link layer packets received.

[0042] For example, if the port rate, duplex mode, or supported link layer protocols of the second device change, the first device needs to update the link status information of the second device it records accordingly.

[0043] Furthermore, the update frequency and strategy for link state information can be customized based on the network's operating status, device performance parameters, and specific network management needs.

[0044] For example, in a highly dynamic network environment, the first device receives link status information from neighboring devices more frequently to maintain the real-time nature of the network topology; while under relatively stable network conditions, the information update cycle can be appropriately extended to reduce unnecessary network communication load. This application does not impose any limitations on this.

[0045] S206, in response to the completion of the link state information update of the first device, the mapping relationship is deleted to adjust the first device to the packet forwarding state, wherein the packet forwarding state indicates that the first device is allowed to send the first link layer packet.

[0046] Optionally, step S206 above describes the transition process of the first device returning from the forwarding suppression state to the packet forwarding state. The key to this transition is to de-mapping the mapping relationship between the target interface and the link layer multicast address. When the first device completes the update of the link state information, that is, receives and integrates the latest link layer packets from the second device, the device needs to de-mapping the above mapping relationship to allow normal packet forwarding again. At this time, the first device regains its ability to send the first link layer packets and can participate in network communication with the updated link state information, ensuring real-time synchronization of the network state.

[0047] Optionally, in this embodiment, the aforementioned message forwarding state refers to the ability of the first device, after receiving a send command, to directly forward link-layer messages to the network through its physical interface, without needing to send LLDP messages to the CPU for additional processing. This state allows the first device to broadcast first link-layer messages carrying its own link-state information to neighboring devices during normal network operation, thereby updating the topology and link status of the entire network. The link-state information included in the first link-layer message covers various details such as device identifier, port status, and supported protocols, and is a key way for network devices to transmit critical network status data.

[0048] It should be noted that the criteria for determining whether the link status information of the first device has been updated can be varied, such as based on time intervals, the number of specific packets received, or network activity status.

[0049] For example, based on the time interval, the first device sets a fixed update cycle and automatically removes the mapping relationship at the end of the cycle; in the strategy based on the number of received messages, the first device decides when to complete the update based on the number or type of neighbor information received; while in the scenario of responding to network activity status, the first device flexibly adjusts the timing of removing the mapping relationship according to the dynamic changes in network activity, such as frequent changes in link status or silent periods.

[0050] In an exemplary embodiment, the first device is started. At this time, the first device is in the initial forwarding state, that is, it can directly process various link layer packets received by itself and forward them to the third device (that is, the device that is in the target network at the same time as the first device). At this time, the third device, which is a non-directly connected device, will also learn unexpected neighbor devices and will not be able to generate the correct network topology. Therefore, in the embodiments of this application:

[0051] First, a mapping relationship between the target interface and the link layer multicast address will be established to adjust the first device to a forwarding suppression state. At this time, the first device can only process the various types of link layer packets it receives, but cannot send or forward other link layer packets.

[0052] Next, after the first device completes the update of the target network topology based on the various link layer messages received, it will delete the mapping relationship between the target interface and the link layer multicast address to adjust the first device to the message forwarding state. At this time, the first device can send or forward other link layer messages.

[0053] In an exemplary embodiment, the network environment in which the target network resides includes a first device (referred to as device A) and multiple neighboring devices, one of which is referred to as device B. Device A and device B have a direct physical connection and are both located in the same target network. The target network can be an internal enterprise network, a data center network, or any other network environment that requires accurate network topology and link state information.

[0054] S1, Mapping relationship establishment and forwarding suppression state adjustment:

[0055] Initial configuration: The interface corresponding to the central processing unit (CPU) of device A is configured to receive all LLDP packets. During this stage, device A is in a forwarding state, receiving and forwarding LLDP packets. However, this leads to inaccuracies in the network topology because device A broadcasts its own link-state information while simultaneously receiving information from neighboring devices.

[0056] Establishing a mapping relationship: To solve this problem, a mapping relationship is established between device A's CPU interface and the link-layer multicast address (e.g., the multicast MAC address 01:80:C2:00:00:0E used by LLDP). This operation puts device A into a forwarding suppression state. In this state, device A stops broadcasting its own link-state information, while it can receive and process LLDP packets sent from neighboring devices, which contain the link-state information of the neighboring devices. This means that device A's CPU interface will capture all LLDP packets, preventing them from being forwarded by the network.

[0057] S2, Update link state information and determine network structure:

[0058] Receiving and updating link-state information: In forwarding suppression mode, device A focuses on receiving second-layer link-state packets sent by device B. These packets carry link-state information of device B, including its MAC address, IP address, port capabilities, and status. Device A integrates this information into its link-state database and updates the link-state information associated with device B.

[0059] Network structure determination: Once device A has processed and updated all the second-layer (L2) packets received from device B, it can determine the actual network structure of the target network based on the latest link-state information. By analyzing the link-state information, device A can construct a network topology map that accurately reflects all physical connections.

[0060] S3, Deletion of mapping relationship and restoration of message forwarding status:

[0061] Deletion of mapping relationship: When device A confirms that the update of the link state information has been completed, it will delete the previously established mapping relationship between the CPU interface and the link layer multicast address, adjust device A from the forwarding suppression state to the packet forwarding state, and restore its ability to send the first link layer packet, that is, it can broadcast its updated link state information.

[0062] Operation in message forwarding state: In message forwarding state, device A no longer passively receives information, but can freely send and receive first-layer link-state messages. That is, device A can propagate updated link-state information to other devices in the network, while continuing to receive and process link-state information from neighboring devices, keeping the network state up-to-date and promoting efficient network operation.

[0063] In this embodiment, a mapping relationship is established between a target interface and a link-layer multicast address to adjust the first device to a forwarding suppression state. The target interface is the interface corresponding to the central processing unit of the first device. The forwarding suppression state indicates that the first device is prohibited from sending first link-layer packets, which include the link-state information of the first device. The system receives second link-layer packets sent by a second device and updates the link-state information of the first device based on the second link-layer packets to determine the network structure of the target network. A physical connection exists between the first and second devices, and both devices are located in the target network. The second link-layer packets include the link-state information of the second device. In response to the completion of the link-state information update of the first device, the mapping relationship is deleted to adjust the system. The first device is in the message forwarding state, which indicates the mode in which the first device is allowed to send the first link layer message. This allows the first device to silently receive and process link state information updates from neighboring devices (i.e., the second device) within a specific time period without interfering with the normal communication process of other devices in the network. This ensures that the first device can accurately receive and update its own link state information, while avoiding the impact of its own message broadcasting on network topology drawing during the update reception process. This results in a more accurate network topology drawing, ensuring the true reflection of the physical connection relationships between devices in the network. This achieves the technical effect of improving the efficiency and accuracy of network operation and maintenance management, and solves the technical problem of poor message transmission accuracy caused by ambiguous device network relationships.

[0064] As an optional approach, after receiving the second link layer message sent by the second device and updating the link state information of the first device based on the second link layer message, the method further includes: obtaining the initial reception time of the first device receiving the first link layer message, the first time configuration parameter of the first device, and the second time configuration parameter of the second device; determining the target transmission time based on the initial reception time, the first time configuration parameter, and the second time configuration parameter; deleting the mapping relationship to adjust the first device to the message forwarding state in response to the completion of the link state information update of the first device; and sending a third link layer message to the third device at the target transmission time, wherein there is a physical connection between the third device and the first device, the third link layer message includes at least one of the link state information of the first device and the link state information of the second device, and the third device is located in the target network.

[0065] Optionally, in this embodiment, the first time configuration parameter refers to the configuration parameters set by the first device related to the link layer message transmission period, including but not limited to the LLDP message transmission period time and the waiting time after receiving a message. The second time configuration parameter is for the second device and also includes the LLDP message transmission period time of the second device and the waiting time after the second device receives a message from the first device or another device.

[0066] It should be noted that the operations of obtaining the initial reception time, time configuration parameters, and determining the target transmission time are not fixed, but can be customized according to the dynamic changes in the network environment and the specific needs of the device.

[0067] For example, the first device needs to dynamically optimize its initial configuration parameters based on network load, link status update frequency, or device performance limitations to better adapt to network changes. Similarly, the second device's second configuration parameters may also need to be updated due to changes in network topology, link status stability, or adjustments to inter-device communication protocols. This application does not impose any limitations on this.

[0068] It should also be noted that the second device and the third device mentioned above may be the same or different. There may be multiple second devices and multiple third devices.

[0069] For example, the first device is connected to the second device through port A and to the third device through port B. There is no direct connection between the second device and the third device. The first device can receive link layer messages sent by the second device and the third device synchronously or asynchronously. Similarly, the first device can also send link layer messages to the second device and the third device.

[0070] For example, after completing the link state information update, the first device obtains the initial reception time when it received the first link layer message, and combines it with the first device's preset first time configuration parameters and the second time configuration parameters received from the second device to determine a target transmission time. This ensures that when the first device sends a third link layer message containing its own and neighboring device's link state information, it will not conflict with the transmission time of LLDP messages from the second device or other devices, avoiding interference with the link state information and improving the accuracy of the link state information and the clarity of the network topology.

[0071] In one exemplary embodiment, Figure 3 This is a schematic diagram of an optional message transmission method according to an embodiment of this application. Figure 3For example, the target network environment includes a first device (referred to as device A) and multiple neighboring devices, one of which is called device B. Taking the interaction mechanism between device A and device B as an example, after receiving and integrating the link layer message information from device B, device A records the first time T_recv_1 and T_recv_2 when it receives the link state information. Combining device A's first time configuration parameter T_cycle_A and device B's second time configuration parameter T_cycle_B, device A determines a target transmission time through algorithm calculation. After determining the target transmission time, device A deletes the mapping relationship between the target interface and the link layer multicast address at that time, adjusts to the message forwarding state, and begins to send a third link layer message to a third device in the same network. The message contains the latest link state information of device A and at least one of the link state information of device B, so as to achieve efficient propagation of link state information and accurate mapping of network structure.

[0072] This application's embodiments employ a strategy of dynamically determining the target transmission time, achieving the technical effect of accurately sending third-layer packets containing the latest link state information within the network. This avoids link state information conflicts and improves the accuracy of network topology and the stability of data packet transmission. It effectively solves the common problem of ambiguous device network relationships in network management, avoiding a decrease in data transmission accuracy due to inaccurate or untimely updates to link state information, and providing technical support for efficient network operation and maintenance.

[0073] As an optional approach, determining the target transmission time based on the initial reception time, the first time configuration parameters, and the second time configuration parameters includes: obtaining a preset transmission duration, a minimum waiting duration, a first transmission period, and the initial transmission time from the first time configuration parameters, and obtaining a second transmission period from the second time configuration parameters, wherein the first transmission period represents the frequency at which the first device transmits its own link status information, and the second transmission period represents the frequency at which the second device transmits its own link status information; determining a secondary reception time based on the initial reception time and the second transmission period; determining a waiting time window based on the preset transmission duration, the minimum waiting duration, the message transmission period, and the initial transmission time, wherein the secondary reception time represents the time when the first device next receives the link status information transmitted by the second device; and determining the target transmission time based on the secondary reception time and the waiting time window.

[0074] Optionally, in this embodiment, the preset transmission duration refers to the time length set by the first device for transmitting link state information messages, including but not limited to the transmission time of LLDP messages (link layer messages). The minimum waiting duration represents the shortest waiting time set by the first device after receiving link state information messages from neighboring devices to avoid service interference, ensuring that the first device's transmission of its own link state information does not overlap with the transmission time of messages from neighboring devices. The first transmission period and the second transmission period correspond to the frequency at which the first and second devices transmit link state information, respectively, reflecting the periodicity of the devices broadcasting their own link state information to the network environment. This is used for network topology updates and maintenance, ensuring the real-time performance and accuracy of the link state information. The initial transmission time refers to the moment when the first device first transmits link state information, for example, when the first device just starts up.

[0075] It should be noted that the specific values ​​of the preset sending duration, minimum waiting duration, first sending cycle, and second sending cycle vary depending on the network environment, device performance, and communication protocol.

[0076] For example, in a heavily loaded network, the preset transmission time needs to be increased to ensure the complete transmission of messages; when device performance is limited, the minimum waiting time will be extended accordingly to avoid link state information conflicts caused by insufficient processing capacity.

[0077] In addition, the settings for the first and second transmission cycles may be adjusted depending on the different communication needs between devices.

[0078] For example, the first device may have a shorter first transmission cycle due to real-time requirements, while the second device may have a longer second transmission cycle due to stability and energy consumption control requirements. This application does not impose any limitations on this.

[0079] For example, when determining the target transmission time, the first device first obtains its own first time configuration parameters, including the preset transmission duration, minimum waiting duration, first transmission period, and initial transmission time. These parameters constitute the basis of the first device's link layer packet transmission strategy. Simultaneously, the first device also obtains the second device's second time configuration parameters, i.e., the second transmission period, from the second link layer packet.

[0080] Next, based on the initial reception time and the second transmission period of the second device, the first device predicts the next reception time of the link status information of the second device, ensuring that the first device has enough time to process the neighbor information.

[0081] Subsequently, the first device determines a waiting time window based on the preset transmission duration, minimum waiting duration, first transmission cycle, and its own initial transmission time. This window takes into account the time the first device needs to reserve before and after sending a message to avoid conflicts with the transmission times of other devices. Finally, the first device calculates the target transmission time using the secondary reception time and the waiting time window, ensuring that the link layer message sent at that time is not interfered with by link state information messages from the second device or other devices in the network, thus improving the accuracy and efficiency of link state information updates.

[0082] In one exemplary embodiment, Figure 4 This is a schematic diagram of an optional message transmission method according to an embodiment of this application. Figure 4 For example, firstly, Figure 4 The various pronouns in the text are represented as follows:

[0083] T_recv_N: Initial reception time; T_recv_1 and T_recv_2 are the times when the first device receives the LLDP messages from B1 and B2 in the second device.

[0084] ΔT_send: Preset transmission duration, the duration for the first device to send the LLDP message;

[0085] ΔT_wait: Minimum waiting time, the minimum waiting time for the first device to receive the LLDP from the second device and send the LLDP message;

[0086] T_Cycle_N: The second transmission cycle, the LLDP message transmission cycle of the Nth device B in the second device.

[0087] T_cycle: First transmission cycle, the first LLDP message transmission cycle of the device.

[0088] Furthermore, taking the LLDP message interaction between the first device and the second device as an example, the first device first obtains the first time configuration parameters related to the transmission of link state information, including but not limited to the preset transmission duration ΔT_send, the minimum waiting duration ΔT_wait, the first transmission period T_cycle_A, and the initial transmission time T_send_1 for the first device to transmit link state information. Simultaneously, the first device also parses the second device's second transmission period T_cycle_B from the second device's link state information message. Based on the initial reception time T_recv_1 of the received second device's link state information message and the second device's second transmission period T_cycle_B, the first device predicts the next time it will receive a message from the second device, T_recv_2. Based on this, the first device determines a waiting time window according to the preset transmission duration ΔT_send, the minimum waiting duration ΔT_wait, the first transmission period T_cycle_A, and T_send_1 to avoid conflicts with the message transmission time of the second device or other neighboring devices. Finally, the first device determines the target transmission time T_target based on T_recv_2 and the waiting time window, ensuring that the link status information packets sent at T_target time can be received accurately and without being affected by packets from other devices.

[0089] In yet another exemplary embodiment, with Figure 4 For example, the next transmission time of the second device is determined as T_Cycle_N = (T_recv_N_1 - T_recv_N_0) / 2. The time when the first device receives the next LLDP message from the second device is calculated as T_recv Next N = T_recv_N + T_Cycle_N. T_recv_N is then updated to T_recv Next N.

[0090] Next, calculate the next cycle sending time window (waiting time window) T send win = [Tsend + ΔT_send + T_cycle - ΔT_wait, T send + ΔT_send + T_cycle + ΔT_wait] for the first device, and determine whether T_recv_1...T_recv_N is within the T send win interval. If it is, update T send = (T_recv_N_1 + T_recv_N_2) / 2, where T_recv_N_1 is the time point when the first device receives an LLDP message sent by device B1, and T_recv_N_2 is the time point when the first device receives an LLDP message sent by device B2. Devices B1 and B2 both belong to the second device. Otherwise, wait for T_cycle and then determine whether T_recv_1...T_recv_N is within the T send win interval.

[0091] Through the embodiments of this application, by employing refined time parameter control and algorithm calculation, the first device achieves the technical effect of precisely adjusting the transmission time of link state information messages in complex network environments. This avoids link state information conflicts, improves the accuracy of network topology drawing, and enhances the stability of data packet transmission. This approach effectively solves the common link state information update conflict problem in network management, avoids the decrease in data transmission accuracy caused by improper transmission of link state information, and provides technical support for efficient network operation and maintenance.

[0092] As an optional approach, determining the target transmission time based on the secondary reception time and the waiting time window includes at least one of the following: if the secondary reception time is not within the waiting time window, determining the target transmission time as the first time point of the next first transmission cycle; if the secondary reception time is within the waiting time window, determining the target transmission time as the first time point after the end of the waiting time window.

[0093] Optionally, in this embodiment, the aforementioned secondary reception time refers to the specific time predicted by the first device based on the link state information transmission frequency of the second device, indicating the next time it will receive the link state information from the second device. The waiting time window is a time range set by the first device to ensure that its transmitted link state information does not overlap with the transmission time of the second device's link state information. This window is determined by considering a preset transmission duration, a minimum waiting duration, and the first and second transmission cycles, aiming to avoid conflicts in link state information. The target transmission time is the most appropriate time for the first device to transmit its own link state information next, calculated by an algorithm after completing the link state information update, ensuring the orderly propagation of link state information and accurate updating of the network topology.

[0094] It should be noted that the specific strategy for determining the target transmission time varies depending on the network environment and equipment performance.

[0095] For example, under high network load, the waiting time window needs to be extended to avoid conflicts with the transmission time of link state information from other devices, ensuring the accurate propagation of link state information. Conversely, under low network load or high device performance, the waiting time window can be shortened to accelerate the update frequency of link state information and improve the real-time performance of the network topology.

[0096] Furthermore, the link status information transmission cycle of the first and second devices may vary due to differences in network operation and maintenance strategies, device types, or communication protocols, and this application does not impose any limitations on this.

[0097] For example, when determining the target transmission time, the first device analyzes the positional relationship between the secondary reception time and the waiting time window. This analysis process provides the first device with a decision-making basis for determining the optimal timing for transmitting link status information.

[0098] Specifically, if the second reception time T_recv_2 is not within the waiting time window, that is, the time interval between this time and the message transmission of the first device is far enough that it will not be interfered with by the message transmission of the second device, the first device can determine the target transmission time as the first time point of the next first transmission cycle T_cycle_A.

[0099] Conversely, if T_recv_2 is within the waiting time window, meaning the first device may receive the link status information message from the second device within the predetermined message sending time, in order to avoid conflicts in the link status information, the first device determines the target sending time as the first time point after the end of the waiting time window.

[0100] Through the embodiments of this application, by employing refined secondary reception time analysis and waiting time window calculation, the technical effect of dynamically adjusting the transmission time of link status information messages by the first device in a multi-device communication environment is achieved, thereby avoiding link status information update conflicts, improving the accuracy of network topology drawing, and enhancing the stability of data message transmission.

[0101] As an optional approach, sending a third link layer message to a third device at the target transmission time includes at least one of the following: sending a first sub-message to the third device at the target transmission time, wherein the first sub-message is generated by the first device, the first sub-message includes the link state information of the first device, and the third link layer message includes the first sub-message; sending a second sub-message to the third device at the target transmission time, wherein the second sub-message is generated by the second device and sent to the first device, the second sub-message includes the link state information of the second device, and the third link layer message includes the second sub-message.

[0102] Optionally, in the embodiments of this application, the aforementioned target transmission time refers to the optimal time for the next message transmission determined by the first device based on its own and neighboring second device's time configuration parameters, as well as the analysis of the receiving time of the neighboring device's link status information.

[0103] Optionally, in this embodiment, the first sub-message and the second sub-message refer to link-layer messages generated by the first device and the second device, respectively, containing their respective link-state information. These messages can be LLDP messages or other message types suitable for link-state broadcasting. The first sub-message is generated by the first device and contains the first device's latest link-state information, used to announce its network status and connectivity to other devices in the network. The second sub-message is generated by the second device and sent to the first device, containing the second device's link-state information, used by the first device to update its stored neighbor device status, thereby drawing and maintaining the network topology.

[0104] Optionally, in this embodiment of the application, the aforementioned third link layer message is a composite message sent by the first device to another neighboring device (the aforementioned third device) at the target transmission time. The message may include link state information in the first sub-message and / or the second sub-message, which is used to synchronize the link state of the first device and the second device to the device, so as to ensure the accuracy and integrity of the network topology.

[0105] It should be noted that the format of the third-link layer message sent by the first device at the target transmission time varies depending on network requirements and device performance.

[0106] For example, when network transmission efficiency is a priority, the first device may choose to include only the first sub-message in the third link layer message to update its own link state information as quickly as possible, without undertaking the task of forwarding the link state information of neighboring devices.

[0107] Conversely, in scenarios where the integrity of the network topology is more important, the first device will choose to include both the first and second sub-messages in the third link layer message to ensure that the third device can obtain the link status information of all directly connected devices in the network and build a more comprehensive network topology map.

[0108] For example, when the target transmission time arrives, the first device, based on the needs of device C (the aforementioned third device) and the network environment, can selectively send a first sub-message or a second sub-message, or both simultaneously, to constitute a third link-layer message. If device C only needs to know the link-state information of the first device, the first device will generate a first sub-message containing a description of its latest state and send it to device C at the target transmission time. Conversely, if device C needs to obtain the link-state information of both the first device and B, the first device will package the second sub-message received from the second device, along with its own generated first sub-message, into a third link-layer message and send it to device C at the target transmission time.

[0109] In an exemplary embodiment, taking an enterprise intranet as an example, after updating the link state information and accurately calculating the transmission time, the first device generates and sends a first sub-message to device C when the target transmission time arrives, according to the requirements of network management policies and communication protocols. This first sub-message comprehensively describes the current link state of the first device, including port status, supported protocol types, MAC address, and other information. Simultaneously, if the first device has already received the second sub-message from the second device and determines that the third device also needs this information to maintain network topology integrity, the first device packages the second sub-message into a third link layer message and sends it to the third device along with the first sub-message.

[0110] By employing the method of sending a first sub-message or a third link layer message containing a second sub-message to a third device at the target sending time, the first device achieves the technical effect of flexibly and efficiently synchronizing link state information in a multi-device communication environment. This avoids link state information update delays and data transmission redundancy, and improves the accuracy of network topology drawing and the stability of data packet transmission.

[0111] As an optional approach, before establishing the mapping relationship between the target interface and the link layer multicast address to adjust the first device to the forwarding suppression state, the method further includes: obtaining a group of devices in the target network; identifying the device in the group of devices that cannot configure link layer packet forwarding rules and access control lists and is in an initial forwarding state as the first device, wherein the initial forwarding state indicates that the first device is allowed to update its link state information according to the second link layer packet when it receives the second link layer packet, and forward the second link layer packet to a fourth device, wherein there is a physical connection between the fourth device and the first device, and the fourth device is located in the target network.

[0112] Optionally, in this embodiment, a group of devices refers to all network devices or a portion thereof participating in link-state information exchange within the target network, including but not limited to the first device, the second device, the third device, and the fourth device. These devices can be any hardware with network communication capabilities, such as switches, routers, or network management nodes. Devices unable to configure link-layer packet forwarding rules and access control lists refer to those that do not support advanced packet processing functions, including but not limited to older models of switches, basic network components used in the network, or devices that cannot be configured with relevant rules due to software limitations. The initial forwarding state is a default operating mode, indicating that when a device receives a link-layer packet from a neighboring device, it can update its stored link-state information according to the packet content and continue forwarding the packet to other directly connected devices to ensure the integrity and accuracy of the network topology information. This state reflects the normal processing method of link-state information by network devices without special configuration.

[0113] It should be noted that the ability to automatically detect and analyze devices can dynamically determine which devices belong to the first device category. The first device can be distributed throughout the network, such as in the core layer, aggregation layer, or access layer, or it may be a specific type of device in the network, such as a low-end switch used for edge connections. This application does not limit this.

[0114] For example, the solutions in this application focus on devices in a network that, due to hardware or software limitations, cannot configure link-layer packet forwarding rules and access control lists. For instance, before performing a link-state information update, device A obtains a list of devices from the target network. Through comparison and analysis, it determines which devices meet the criteria of a first device—that is, they cannot configure relevant rules and are in an initial forwarding state. For these devices, device A executes subsequent link-state information update strategies, including establishing a mapping relationship between the target interface and the link-layer multicast address to adjust to a forwarding suppression state. This ensures that update packets from device B are not mistakenly forwarded during link-state information updates, thereby avoiding confusion in network topology information.

[0115] In an exemplary embodiment, taking an enterprise intranet as an example, device A is a high-end router in the network with comprehensive link-layer packet processing capabilities. Devices B, C, and D represent devices of different types and configuration levels in the network, respectively. Before updating its own link-state information, device A first obtains a list of all devices in the network. Through analysis, it learns that device C, due to using an older hardware platform, cannot configure link-layer packet forwarding rules and access control lists, and is currently in an initial forwarding state that allows receiving and forwarding link-state information. Based on this information, device A identifies device C as the first device and executes the subsequent link-state information update process, namely, establishing a mapping relationship between device C's target interface and link-layer multicast address, and adjusting device C to a forwarding suppression state to avoid receiving and incorrectly forwarding link-state information packets from device B when updating its own link-state information.

[0116] Through the embodiments of this application, by employing detailed analysis of network device capabilities and state adjustment strategies, the technical effect of accurately identifying and handling devices in the network that cannot be configured with link-layer packet forwarding rules and access control lists is achieved. This achieves the purpose of avoiding packet conflicts during link state information updates, improving the accuracy of network topology drawing, and enhancing the stability of data packet transmission.

[0117] In an exemplary embodiment, the above-described message transmission method can be applied to network topology drawing. Considering that LLDP topology drawing requires devices to not forward LLDP messages, otherwise the true connection relationship between devices cannot be reflected, chips typically support configuration of LLDP message forwarding rules: forward only, send to CPU and forward, send to CPU but not forward; or restrict the forwarding of LLDP messages through ACL rules.

[0118] However, considering the existence of chips that do not support LLDP (link layer) packet forwarding rule configuration and cannot configure ACL rules (access control lists) (devices using this type of chip are identified as the first device), their LLDP packet processing method is to send them to the CPU and forward them. In this case, traversing the network structure according to the LLDP-based network topology algorithm will result in errors.

[0119] In simple terms, when the first device needs to receive LLDP messages, an LLDP multicast address is added to its CPU port, enabling the message to be sent to the CPU. When the device needs to send LLDP messages, the LLDP multicast address is removed from the CPU port, allowing the message to be successfully sent to the other end. Based on the LLDP transmission avoidance algorithm, it is ensured that when the device needs to send LLDP messages, it will not receive LLDP messages sent by other devices. Based on this, the first device can draw a realistic network topology based on the valid LLDP messages received. This more realistically and accurately reflects the actual network topology, providing users with a WYSIWYG (What You See Is What You Get) effect for network operation and maintenance, saving manpower and time costs.

[0120] In one exemplary embodiment, including but not limited to:

[0121] S1, the weak rule device (first device) processes the LLDP message reception (at this time, device SW1 is in state 1 forwarding state, i.e. the initial forwarding state mentioned above). The weak rule device can forward the LLDP message (the second link layer message mentioned above).

[0122] S2, Figure 5 This is a schematic diagram of another optional message transmission method according to an embodiment of this application, such as... Figure 5 As shown, the weak rule device processes LLDP message transmission (at this time, the first device is in a forwarding suppression state):

[0123] After configuring the MAC address (0180c200000e, link layer multicast address) to the CPU port (the device can recognize and process all packets with the destination MAC address as the LLDP multicast address (01:80:C2:00:00:0E)), the link layer multicast address cannot send LLDP packets, nor can it forward LLDP packets. At this time, the first device can obtain the real LLDP neighbor information (link state information) of the second and third devices.

[0124] S3, when the first device is in the packet forwarding state, the packets of <Second device, port 3> and <Third device, port 4> are forwarded by SW1 (at this time, the first device is in the packet sending state, i.e., the above-mentioned packet forwarding state):

[0125] Figure 6This is a schematic diagram of another optional message transmission method according to an embodiment of this application, such as... Figure 6 As shown, Figure 7 This is a schematic diagram of another optional message transmission method according to an embodiment of this application, such as... Figure 7 As shown, after the MAC address (0180c200000e, link layer multicast address) is removed from the CPU port, ports 1 and 2 of the first device can send LLDP messages carrying their own information. At this time, the second and third devices can obtain the real LLDP neighbor information (link state information) of the first device.

[0126] Furthermore, based on the periodicity of LLDP messages, the first device calculates the timing (the target transmission time) when the second and third devices send the <Second Device, Port 3> and <Third Device, Port 4> messages, ensuring that the CPU port MAC address (0180c200000e) can be deleted before the target transmission time arrives.

[0127] It is understood that in the specific embodiments of this application, data such as user information are involved. When the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.

[0128] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.

[0129] According to another aspect of the embodiments of this application, a message transmission apparatus for implementing the above-described message transmission method is also provided. For example... Figure 8 As shown, the device includes:

[0130] Establishment module 802 is used to establish a mapping relationship between the target interface and the link layer multicast address to adjust the first device to a forwarding suppression state. The target interface is the interface corresponding to the central processing unit of the first device. The forwarding suppression state indicates that the first device is prohibited from sending the first link layer message. The first link layer message includes the link state information of the first device.

[0131] The update module 804 is used to receive the second link layer message sent by the second device, update the link state information of the first device according to the second link layer message, and determine the network structure of the target network. The first device and the second device have a physical connection relationship, and both the first device and the second device are in the target network. The second link layer message includes the link state information of the second device.

[0132] The deletion module 806 is used to delete the mapping relationship in response to the completion of the link state information update of the first device to adjust the first device to the packet forwarding state, wherein the packet forwarding state indicates that the first device is allowed to send the first link layer packet.

[0133] As an optional solution, the above-mentioned apparatus is further configured to: receive a second link layer message sent by a second device, and after updating the link state information of the first device according to the second link layer message, obtain the initial reception time of the first device receiving the first link layer message, the first time configuration parameters of the first device, and the second time configuration parameters of the second device; determine the target transmission time according to the initial reception time, the first time configuration parameters, and the second time configuration parameters; in response to the completion of the link state information update of the first device, delete the mapping relationship to adjust the first device to the message forwarding state; and send a third link layer message to the third device at the target transmission time, wherein there is a physical connection between the third device and the first device, the third link layer message includes at least one of the link state information of the first device and the link state information of the second device, and the third device is in the target network.

[0134] As an optional solution, the above-mentioned device is used to determine the target transmission time based on the initial reception time, a first time configuration parameter, and a second time configuration parameter in the following manner: obtaining the preset transmission duration, minimum waiting duration, first transmission period, and initial transmission time from the first time configuration parameter, and obtaining the second transmission period from the second time configuration parameter, wherein the first transmission period is used to represent the frequency at which the first device transmits its own link status information, and the second transmission period is used to represent the frequency at which the second device transmits its own link status information; determining the secondary reception time based on the initial reception time and the second transmission period, determining the waiting time window based on the preset transmission duration, minimum waiting duration, message transmission period, and initial transmission time, wherein the secondary reception time represents the time when the first device will next receive the link status information transmitted by the second device; and determining the target transmission time based on the secondary reception time and the waiting time window.

[0135] As an optional solution, the above-mentioned apparatus is used to determine the target transmission time based on the secondary reception time and the waiting time window in the following manner, including at least one of the following: when the secondary reception time is not within the waiting time window, the target transmission time is determined as the first time point of the next first transmission cycle; when the secondary reception time is within the waiting time window, the target transmission time is determined as the first time point after the end of the waiting time window.

[0136] As an optional solution, the above-mentioned apparatus is used to send a third link layer message to a third device at a target transmission time in the following manner, including at least one of the following: sending a first sub-message to the third device at the target transmission time, wherein the first sub-message is generated by the first device, the first sub-message includes the link state information of the first device, and the third link layer message includes the first sub-message; sending a second sub-message to the third device at the target transmission time, wherein the second sub-message is generated by the second device and sent to the first device, the second sub-message includes the link state information of the second device, and the third link layer message includes the second sub-message.

[0137] As an optional solution, the above-mentioned apparatus is further used to: establish a mapping relationship between the target interface and the link layer multicast address to obtain a group of devices in the target network before adjusting the first device to the forwarding suppression state; identify the device in the group of devices that cannot configure the link layer packet forwarding rules and access control list and is in the initial forwarding state as the first device, wherein the initial forwarding state indicates that the first device is allowed to update the link state information of the first device according to the second link layer packet when it receives the second link layer packet, and forward the second link layer packet to the fourth device, wherein there is a physical connection relationship between the fourth device and the first device, and the fourth device is in the target network.

[0138] In this application embodiment, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.

[0139] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.

[0140] According to one aspect of this application, a computer program product is provided, the computer program product comprising a computer program.

[0141] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0142] Specifically, according to embodiments of this application, the processes described in the various method flowcharts can be implemented as computer software programs. For example, embodiments of this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication component, and / or installed from a removable medium. When the computer program is executed by a central processing unit, it performs various functions defined in the system of this application.

[0143] In such an embodiment, the computer program can be downloaded and installed from a network via a communication component, and / or installed from a removable medium. When the computer program is executed by a central processing unit, it performs the various functions provided in the embodiments of this application.

[0144] In other embodiments, the aforementioned terminal device or server can be a node in a distributed system, wherein the distributed system can be a blockchain system, which is a distributed system formed by connecting multiple nodes through network communication. The nodes can form a peer-to-peer network, and any form of computing device, such as a server, terminal, or other electronic device, can become a node in the blockchain system by joining this peer-to-peer network.

[0145] According to one aspect of this application, a computer-readable storage medium is provided, wherein a processor of an electronic device reads computer instructions from the computer-readable storage medium, and executes the computer instructions, causing the electronic device to perform the message transmission method provided in various alternative implementations of the above-described message transmission aspect.

[0146] Optionally, in this embodiment, the computer-readable storage medium described above may be configured to store methods for performing the embodiments of this application.

[0147] Optionally, in this embodiment, those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing the hardware related to the terminal device. The program can be stored in a computer-readable storage medium, which may include: flash drive, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.

[0148] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0149] If the integrated units in the above embodiments are implemented as software functional units and sold or used as independent products, they can be stored in the aforementioned computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, 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. This computer software product is stored in a storage medium and includes several instructions to cause one or more electronic devices to execute all or part of the steps of the methods described in the various embodiments of this application.

[0150] In the above embodiments of this application, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0151] In the several embodiments provided in this application, it should be understood that the disclosed application can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual couplings, direct couplings, or communication connections may be through some interfaces; indirect couplings or communication connections between units or modules may be electrical or other forms.

[0152] The units described as separate components may or may not be physically separate. 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 the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0153] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0154] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.

Claims

1. A method for transmitting a message, characterized in that, include: A mapping relationship is established between the target interface and the link layer multicast address to adjust the first device to a forwarding suppression state, wherein the target interface is the interface corresponding to the central processing unit of the first device, and the forwarding suppression state indicates that the first device is prohibited from sending the first link layer message, the first link layer message including the link state information of the first device; The system receives a second link layer message sent by a second device, updates the link state information of the first device based on the second link layer message, and determines the network structure of the target network. The first device and the second device have a physical connection relationship, both the first device and the second device are in the target network, and the second link layer message includes the link state information of the second device. In response to the completion of the link state information update of the first device, the mapping relationship is deleted to adjust the first device to a packet forwarding state, wherein the packet forwarding state indicates that the first device is allowed to send the first link layer packet.

2. The method according to claim 1, characterized in that, After receiving the second link layer message sent by the second device and updating the link state information of the first device according to the second link layer message, the method further includes: Obtain the initial reception time when the first device receives the first link layer message, the first time configuration parameters of the first device, and the second time configuration parameters of the second device; The target transmission time is determined based on the initial reception time, the first time configuration parameter, and the second time configuration parameter. In response to the completion of the link state information update of the first device, the mapping relationship is deleted to adjust the first device to the packet forwarding state; At the target transmission time, a third link layer message is sent to a third device, wherein there is a physical connection between the third device and the first device, the third link layer message includes at least one of the link state information of the first device and the link state information of the second device, and the third device is located in the target network.

3. The method according to claim 2, characterized in that, The step of determining the target transmission time based on the initial reception time, the first time configuration parameter, and the second time configuration parameter includes: The preset transmission duration, minimum waiting duration, first transmission period, and initial transmission time in the first time configuration parameters are obtained, and the second transmission period in the second time configuration parameters is obtained, wherein the first transmission period is used to represent the frequency at which the first device sends its own link status information, and the second transmission period is used to represent the frequency at which the second device sends its own link status information. The second reception time is determined based on the initial reception time and the second transmission period. The waiting time window is determined based on the preset transmission duration, the minimum waiting duration, the message transmission period, and the initial transmission time. The second reception time represents the time when the first device receives the link status information sent by the second device next. The target transmission time is determined based on the secondary reception time and the waiting time window.

4. The method according to claim 3, characterized in that, Determining the target transmission time based on the secondary reception time and the waiting time window includes at least one of the following: If the second reception time is not within the waiting time window, the target transmission time is determined as the first time point of the next first transmission cycle; If the second reception time falls within the waiting time window, the target transmission time is determined as the first time point after the waiting time window ends.

5. The method according to claim 2, characterized in that, Sending a third link layer message to a third device at the target transmission time includes at least one of the following: At the target transmission time, a first sub-message is sent to the third device, wherein the first sub-message is generated by the first device, the first sub-message includes the link state information of the first device, and the third link layer message includes the first sub-message; At the target transmission time, a second sub-message is sent to the third device, wherein the second sub-message is generated by the second device and sent to the first device, the second sub-message includes the link state information of the second device, and the third link layer message includes the second sub-message.

6. The method according to claim 1, characterized in that, Before establishing the mapping relationship between the target interface and the link layer multicast address to adjust the first device to a forwarding suppression state, the method further includes: Obtain a set of devices in the target network; The device in the group of devices that cannot configure link layer packet forwarding rules and access control lists and is in the initial forwarding state is identified as the first device. The initial forwarding state means that when the first device receives the second link layer packet, it is allowed to update the link state information of the first device according to the second link layer packet and forward the second link layer packet to the fourth device. The fourth device and the first device have a physical connection relationship and the fourth device is located in the target network.

7. A message transmission device, characterized in that, include: A module is established to establish a mapping relationship between a target interface and a link layer multicast address to adjust the first device to a forwarding suppression state. The target interface is the interface corresponding to the central processing unit of the first device. The forwarding suppression state indicates that the first device is prohibited from sending a first link layer packet. The first link layer packet includes the link state information of the first device. The update module is used to receive a second link layer message sent by the second device, update the link state information of the first device according to the second link layer message, and determine the network structure of the target network. The first device and the second device have a physical connection relationship, both the first device and the second device are in the target network, and the second link layer message includes the link state information of the second device. The deletion module is used to delete the mapping relationship in response to the completion of the link state information update of the first device, so as to adjust the first device to the packet forwarding state, wherein the packet forwarding state indicates that the first device is allowed to send the first link layer packet.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored computer program, wherein the computer program can be executed by an electronic device to perform the method described in any one of claims 1 to 6.

9. A computer program product, comprising a computer program, characterized in that, When executed by a processor, the computer program implements the steps of the method described in any one of claims 1 to 6.

10. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to execute the method described in any one of claims 1 to 6 through the computer program.