Multicast group management method and device, storage medium and electronic equipment

By analyzing the multicast group address and physical address, dynamically updating the multicast group membership relationship, the problems of inefficiency and insufficient stability in multicast group management are solved, and network performance and resource utilization are optimized.

CN120263573APending Publication Date: 2025-07-04ZHEJIANG DAHUA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510365891.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-25
Publication Date
2025-07-04

AI Technical Summary

Technical Problem

In the prior art, multicast group members are inefficient in management, large resource consumption and insufficient network stability, especially when the number of multicast group members is large and frequently joined or left, resulting in a large number of specific group query messages and member relationship reporting messages, increasing the network burden and being vulnerable to malicious attacks.

Method used

By obtaining the target message sent by the target device, parsing the multicast group address and physical address, finding the target table entries, dynamically update the multicast group membership based on the preset conditions of the number of devices and physical address, reducing redundant protocol messages, and optimizing network performance.

Benefits of technology

It realizes efficient management of multicast group membership, reduces network traffic, reduces IGMP queryer load, improves network stability and resource utilization efficiency, and prevents malicious attacks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120263573A_ABST
    Figure CN120263573A_ABST
Patent Text Reader

Abstract

The invention discloses a multicast group management method and device, a storage medium and electronic equipment. The method comprises the steps that a target message sent by target equipment is acquired, a target table item associated with a target multicast group is searched based on the target message, and the target table item comprises the number of equipment in the target multicast group and a physical address corresponding to each piece of equipment in the target multicast group; and updating the membership of the target multicast group based on whether the target table item is found, whether the target physical address is found in the target table item and whether the number of the devices meets a preset number condition, the target physical address corresponding to the target device. According to the invention, the technical problems of low efficiency, large resource consumption and insufficient network stability in the aspect of multicast group member management in related technologies are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computers, and in particular, to a method and apparatus for managing multicast groups, a storage medium, and an electronic device. Background Art

[0002] Multicast communication is an efficient data transmission method that can send data to multiple receivers simultaneously and is widely used in scenarios such as video conferencing, online live streaming, and distributed computing. In multicast communication, the multicast network needs to accurately perceive the locations of multicast group members and the multicast groups they join to ensure correct data distribution. The IGMP (Internet Group Management Protocol) is a key protocol for implementing multicast group member management. Through the query and response mechanism, the multicast network can dynamically maintain the member relationship of the multicast group.

[0003] In the related art, the IGMPv2 and IGMPv3 protocols manage multicast group members through periodic query messages and member relationship report messages. When a host joins a multicast group, it sends a member relationship report message; when a host leaves a multicast group, it sends a leave message, triggering the IGMP querier to send a specific group query message to confirm whether there are other members. However, this mechanism has obvious defects in some scenarios. For example, when the number of multicast group members is large and they frequently join or leave, it will result in a large number of specific group query messages and member relationship report messages, increasing the load on the network link and the IGMP querier and reducing network performance. In addition, malicious attackers may attack the IGMP querier by forging leave messages, further exacerbating the network burden.

[0004] Therefore, the related art has problems such as low efficiency, high resource consumption, and insufficient network stability in multicast group member management.

[0005] In view of the above problems, no effective solution has been proposed yet. Summary of the Invention

[0006] Embodiments of this application provide a method and apparatus for managing multicast groups, a storage medium, and an electronic device, so as to at least solve the technical problems of low efficiency, high resource consumption, and insufficient network stability in multicast group member management in the related art.

[0007] According to one aspect of the embodiments of the present application, a method for managing a multicast group is provided, including: obtaining a target message sent by a target device, where the target message is used to indicate that the target device belongs to a target multicast group; searching for a target entry associated with the target multicast group based on the target message, where the target entry includes the number of devices in the target multicast group and the physical address corresponding to each device in the target multicast group; updating the membership relationship of the target multicast group based on whether the target entry is found, whether the target physical address is found in the target entry, and whether the number of devices meets a preset number condition, where the target physical address corresponds to the target device.

[0008] According to another aspect of the embodiments of the present application, a device for managing a multicast group is further provided, including: an obtaining module, configured to obtain a target message sent by a target device, where the target message is used to indicate that the target device belongs to a target multicast group; a searching module, configured to search for a target entry associated with the target multicast group based on the target message, where the target entry includes the number of devices in the target multicast group and the physical address corresponding to each device in the target multicast group; an updating module, configured to update the membership relationship of the target multicast group based on whether the target entry is found, whether the target physical address is found in the target entry, and whether the number of devices meets a preset number condition, where the target physical address corresponds to the target device.

[0009] In an exemplary embodiment, the device is configured to update the membership relationship of the target multicast group in the following manner based on whether the target entry is found, whether the target physical address is found in the target entry, and whether the number of devices meets a preset number condition: determining whether the target entry is found, whether the target physical address is found in the target entry, and whether the number of devices meets a preset number condition based on the message type of the target message to update the target entry; determining the membership relationship of the target multicast group based on the target entry.

[0010] In an exemplary embodiment, the device is configured to determine whether the target entry is found, whether the target physical address is found in the target entry, and whether the number of devices meets a preset number condition based on the message type of the target message in the following manner to update the target entry: when the message type indicates that the target message is a membership relationship report message, determining whether the target entry is found; when the target entry is found, determining whether the target physical address is found in the target entry; when the target physical address is found, updating the target aging time of the target device in the target entry.

[0011] In the case where the target physical address is not found, add the target physical address to the target entry and increase the device quantity; in the case where the target entry is not found, add the target entry and set the device quantity to the preset quantity condition.

[0012] In an exemplary embodiment, the device is further configured to: in the case where the target aging time reaches the aging time threshold, delete the target physical address from the target entry and reduce the device quantity; in the case where the target physical address is found and the device quantity reaches the device quantity threshold, add the target physical address to the target entry and delete the physical address corresponding to the aging device, where the aging device refers to a device whose aging time and the aging time threshold meet a preset condition.

[0013] In an exemplary embodiment, the device is configured to determine whether the target entry is found, whether the target physical address is found in the target entry, and whether the device quantity meets the preset quantity condition based on the message type of the target message in the following manner to update the target entry: in the case where the message type indicates that the target message is a membership leave message, determine whether the target entry is found; in the case where the target entry is found, determine whether the target physical address is found in the target entry; in the case where the target physical address is found, determine whether the device quantity meets the preset quantity condition; in the case where the device quantity meets the preset quantity condition, delete the target entry, where the preset quantity condition is used to indicate that the target device is the last device recorded in the target entry; in the case where the device quantity does not meet the preset quantity condition, delete the target physical address and update the device quantity; in the case where the target entry is not found, or the target entry is found but the target physical address is not found, stop updating the target entry.

[0014] In an exemplary embodiment, the device is configured to determine the membership of the target multicast group based on the target entry in the following manner: when the number of devices meets the preset number condition, or when the target entry is not found, a query message is sent to the target multicast group; when the number of devices meets the preset number condition and no response message from the target multicast group is received within the preset response duration, the target entry is deleted and the membership of the target multicast group is determined to be empty; when a response message from the target multicast group is received within the preset response duration, the target entry is updated based on the response message and the membership of the target multicast group is determined not to include the target device; when the target entry is not found, the target entry is added based on the response message and the membership of the target multicast group is determined not to include the target device.

[0015] According to another aspect of the embodiments of the present application, there is also provided a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the above-mentioned multicast group management method when running.

[0016] According to another aspect of the embodiments of the present application, there is provided a computer program product or a computer program, which includes computer instructions stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to cause the computer device to execute the multicast group management method as described above.

[0017] According to another aspect of the embodiments of the present application, there is also provided an electronic device including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the above-mentioned multicast group management method through the computer program.

[0018] In the embodiments of the present application, by obtaining the target message sent by the target device and parsing the multicast group address and the physical address of the target device in the target message, the purpose of accurately identifying the multicast group to which the target device belongs is achieved, thereby realizing the technical effect of efficiently managing the multicast group member relationship; by using the method of finding the target entry associated with the target multicast group based on the target message and maintaining the number of devices (NUM) and the physical address list (MAC_LIST) in the target entry, the purpose of real-time recording the status of multicast group members is achieved, thereby realizing the technical effects of reducing redundant protocol messages and improving the utilization efficiency of network resources; by using the method based on whether the target entry is found, whether the target physical address is found in the target entry, and whether the number of devices meets the preset quantity condition, and dynamically updating the NUM value and MAC_LIST in the target entry, the purpose of accurately maintaining the multicast group member relationship is achieved, thereby realizing the technical effects of reducing the load of the IGMP querier and optimizing the network performance; by using the method of updating or deleting the target physical address in the target entry and judging whether the number of devices meets the preset condition (such as whether the NUM value is 1), the purpose of intelligently controlling the sending of specific group query messages is achieved, thereby realizing the technical effects of reducing network traffic and improving network stability, and further solving the technical problems of low efficiency, large resource consumption, and insufficient network stability in the management of multicast group members in the related art. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments and descriptions thereof of the present application are used to explain the present application and do not constitute an improper limitation to the present application. In the drawings:

[0020] Figure 1 is a schematic diagram of an application environment of an optional method for managing a multicast group according to an embodiment of the present application;

[0021] Figure 2 is a schematic flowchart of an optional method for managing a multicast group according to an embodiment of the present application;

[0022] Figure 3 is a schematic diagram of an optional method for managing a multicast group according to an embodiment of the present application;

[0023] Figure 4 is a schematic diagram of another optional method for managing a multicast group according to an embodiment of the present application;

[0024] Figure 5 is a schematic diagram of another optional method for managing a multicast group according to an embodiment of the present application;

[0025] Figure 6It is a schematic structural diagram of an optional multicast group management device according to an embodiment of the present application;

[0026] Figure 7 It is a schematic structural diagram of an optional multicast group management product according to an embodiment of the present application;

[0027] Figure 8 It is a schematic structural diagram of an optional electronic device according to an embodiment of the present application. Detailed implementation manners

[0028] In order to enable those skilled in the art to better understand the solution of 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 in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.

[0029] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily need to be used to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device that includes a series of steps or units does not necessarily need to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.

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

[0031] According to one aspect of the embodiments of the present application, a method for managing a multicast group is provided. Optionally, in this embodiment, the above-mentioned method for managing a multicast group can be applied to, for example, Figure 1 the hardware environment composed of the server 101 and the terminal device 103 as shown. As Figure 1As shown in the figure, the server 101 is connected to the terminal 103 through a network and can be used to provide services for the terminal device or the application installed on the terminal device. The application can be a video application, an instant messaging application, a browser application, an educational application, a game application, etc. The database 105 can be set on the server or independently of the server and is used to provide data storage services for the server 101. For example, a game data storage server. The above network can include, but is not limited to: a wired network, a wireless network. Among them, the wired network includes: a local area network, a metropolitan area network, and a wide area network. The wireless network includes: Bluetooth, WIFI, and other networks that implement wireless communication. The 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: a mobile phone (such as an Android mobile phone, an iOS mobile phone, etc.), a laptop computer, a tablet computer, a personal digital assistant, a MID (Mobile Internet Devices), a PAD, a desktop computer, a smart TV, a smart voice interaction device, a smart home appliance, a vehicle-mounted terminal, an aircraft, a virtual reality (VR) terminal, an augmented reality (AR) terminal, a mixed reality (MR) terminal, and other computer devices. The above server can be a single server, a server cluster composed of multiple servers, or a cloud server.

[0032] Combined with Figure 1 As shown in the figure, the above multicast group management method can be executed by an electronic device, which can be a terminal device or a server. The above multicast group management method can be implemented separately by the terminal device or the server, or jointly implemented by the terminal device and the server.

[0033] The above is only an example, and this embodiment does not make specific limitations.

[0034] Optionally, as an alternative implementation, as Figure 2 shown in the figure, the above multicast group management method includes:

[0035] S202, obtaining a target message sent by a target device, where the target message is used to indicate that the target device belongs to a target multicast group;

[0036] S204, searching for a target entry associated with the target multicast group based on the target message, where the target entry includes the number of devices in the target multicast group and the physical address corresponding to each device in the target multicast group;

[0037] S206. Update the membership relationship of the target multicast group based on whether the target entry is found, whether the target physical address is found in the target entry, and whether the number of devices meets the preset quantity condition, where the target physical address corresponds to the target device.

[0038] Optionally, in the embodiments of the present application, the above-mentioned target devices may include, but are not limited to, various network devices participating in multicast communication in a multicast network environment, including but not limited to network cameras, network video recorders, computer terminals, etc. In an actual multicast application scenario, a multicast source sends data to a specific multicast group, and the target devices are those devices that need to receive this multicast data. Taking an intelligent security monitoring system as an example, multiple network cameras will join a specific multicast group in order to receive unified configuration information from a video management platform. At this time, these network cameras are the target devices. They send corresponding messages to indicate their reception requirements for the multicast group data, thereby participating in multicast communication. Different types of target devices have different functions and requirements in multicast communication, but all need to interact with the multicast network to obtain the required data.

[0039] Optionally, in the embodiments of the present application, the above-mentioned target message may include, but is not limited to, a message carrier sent by a target device in a multicast network to announce to the multicast network that it belongs to a certain target multicast group, including but not limited to an IGMP membership report message, etc. Under the mechanism of IGMP (Internet Group Management Protocol), when a host wants to join a certain multicast group, it will send an IGMP membership report message to all hosts and devices in the local network segment. For example, in an internal enterprise video conferencing system, the computer terminals of the participants who want to receive the multicast video stream of the meeting will send a target message. This message carries information indicating that the terminal wants to join a specific multicast group. After the relevant devices (such as an IGMP querier) in the multicast network receive this message, they can know that a new device has joined the target multicast group, and then perform corresponding multicast group membership management operations to ensure that the multicast data can be accurately sent to the devices that need it.

[0040] Optionally, in the embodiments of the present application, the above-mentioned target multicast group may include, but is not limited to, a logical group divided in a multicast network to achieve specific data transmission. Devices within the group have the need to receive the same multicast data, including but not limited to video surveillance multicast groups, online education live multicast groups, etc. In a video surveillance scenario, to uniformly transmit the video data of multiple surveillance cameras to multiple display screens at a surveillance center, a video surveillance multicast group will be created. The cameras that join this multicast group act as data sources to send video data, while the display screens at the surveillance center act as receivers to receive the data. For online education live broadcasts, to enable numerous students to receive the teacher's live content simultaneously, an online education live multicast group will be established. The terminal devices of the students can join this multicast group to watch the live broadcast in real time. Different multicast groups have different application scenarios and data transmission requirements. They are independent of each other in the multicast network and are distinguished and managed through identifiers such as multicast addresses.

[0041] Optionally, in the embodiments of the present application, the above-mentioned target entry may include, but is not limited to, a data structure maintained in a multicast management device (such as an IGMP querier) for recording information related to the target multicast group, including but not limited to an entry containing information such as the number of devices in the multicast group and the physical address of each device. Taking the IGMP querier as an example, it will maintain an entry similar to (G, NUM, MAC_LIST), where G represents the multicast group, NUM represents the number of member relationships in the multicast group G, and MAC_LIST records the member relationship information of the multicast group G, that is, the physical address (MAC address) and aging time corresponding to each member device. When a new host sends a multicast group G member relationship report message to join the multicast group G, the IGMP querier will maintain this entry after receiving the message. For example, when a new device joins the multicast group 225.0.0.1, the querier will record the MAC address of the device and the corresponding aging time in this entry and update the number of members. Through this target entry, the IGMP querier can clearly understand the member situation within the multicast group, thereby performing efficient multicast group management.

[0042] Optionally, in the embodiments of the present application, the above device quantity may include, but is not limited to, the quantity information of the devices within the target multicast group recorded in the target entry. This quantity information is used to determine the member status of the multicast group and subsequent management operations, including but not limited to determining whether to send specific group query messages, etc. In the process of multicast group management, the device quantity is a key indicator. When the IGMP querier receives a membership leave message for multicast group G, it will check the device quantity in the target entry. If the device quantity (NUM value) is greater than 1, it indicates that in addition to the device to leave, there are other hosts in the current network segment that are members of multicast group G. At this time, the querier does not send an IGMP specific group query message and only updates the target entry. If the device quantity is equal to 1, the querier needs to further determine whether to send a specific group query message and how to handle the membership relationship of the multicast group according to different situations. The change in the device quantity reflects the dynamic change of the members within the multicast group. The multicast management device adjusts the management strategy based on this information to ensure that multicast data can be accurately transmitted to the devices with requirements.

[0043] Optionally, in the embodiments of the present application, the above physical address may include, but is not limited to, the unique identifier of the network device at the data link layer, usually referring to the MAC address, which is used to accurately distinguish different devices in the local area network, including but not limited to the MAC address of the network adapter, etc. In the multicast network, the physical address is one of the important bases for identifying multicast group members. Each network device's network card has a unique MAC address. When a device joins a multicast group, its MAC address will be recorded in the target entry. For example, in a multicast network composed of multiple computers and network devices, the MAC address of computer A is 54:89:98:f7:33:d4. When it joins multicast group 225.0.0.1, the IGMP querier will record this MAC address in the target entry corresponding to the multicast group. In the subsequent process of multicast group management, whether dealing with member join and leave operations or maintaining the membership relationship of the multicast group, it is necessary to accurately identify and distinguish different devices through the physical address to ensure the accuracy and reliability of multicast data transmission.

[0044] Optionally, in the embodiments of the present application, the above preset quantity condition may include, but is not limited to, a standard preset according to multicast group management requirements for determining whether the number of devices in the target entry meets a specific condition, including but not limited to determining whether the number of devices is greater than 1, equal to 0, etc. In the IGMP multicast group management mechanism, the preset quantity condition plays a key role. When the IGMP querier receives a membership leave message of a multicast group, it will perform different operations according to the preset quantity condition. For example, taking whether the number of devices is greater than 1 as a preset quantity condition, when the querier determines that the number of devices in the target entry is greater than 1, it indicates that there are other members in the multicast group. At this time, there is no need to send a specific group query message, and only the target entry needs to be updated. If the number of devices is equal to 1, further processing is required. The setting of the preset quantity condition is to adapt to different multicast application scenarios, optimize the multicast group management process, reduce unnecessary network message transmission, reduce the load of the multicast management device, and improve the performance and reliability of the multicast network.

[0045] It should be noted that in terms of obtaining the target message sent by the target device, the types of target devices are diverse. It can be network cameras of different brands, and there are differences in functions, performance, and network adaptability among the cameras, and their mechanisms and frequencies for sending target messages may be different; it can also be computer terminals with various operating systems, such as computers with Windows, Linux, and Mac systems. Different operating systems have different processing methods for multicast messages and implementations of network protocol stacks, which will affect the generation and sending of target messages; it can also be intelligent mobile devices, such as mobile phones with the Android system, tablet computers with the Apple system, etc. These devices have diverse network connection methods and may access the multicast network through Wi-Fi, 4G, or 5G networks. Moreover, the network environment constantly changes during the movement process, which will also cause differences in the sending of target messages. The present application does not make any limitations in this regard.

[0046] In terms of the target message, the format and content of the message may be diverse. From the perspective of the format, different versions of multicast protocols may have different message formats. For example, the message formats of IGMPv2 and IGMPv3 are different, and the information and field meanings they carry are also different; from the perspective of the content, in addition to the basic information indicating that the device belongs to the target multicast group, the target message may also contain the priority information of the device, which is used to distinguish the priority of different devices for data reception within the multicast group, or carry the status information of the device, indicating whether the device is operating normally, in a fault warning state, or has failed; in addition, the encryption methods of the target message may also be different. Some messages may use simple checksum encryption, while others may use advanced encryption algorithms such as AES encryption to ensure the security and integrity of the message during network transmission. The present application does not make any limitations in this regard.

[0047] Regarding the target table entries, their storage methods are diverse. They can be stored in memory, which has a fast read / write speed and enables quick lookup and update operations. However, the memory capacity is limited, and there may be storage pressure when the multicast group scale is large. They can also be stored in a hard disk, which has a large storage capacity and is suitable for storing information related to large-scale multicast groups. However, the read / write speed is relatively slow, which may affect the real-time performance of multicast group management. They can also be stored in a distributed manner, where the target table entries are scattered across multiple servers or network devices. This method can improve the scalability and fault tolerance of the system, but it will increase the difficulty of maintaining data consistency. This application does not make any limitations in this regard.

[0048] When updating the membership relationship of the target multicast group, the setting of the preset quantity condition is diverse. It can be set to perform an operation when the number of devices is greater than a certain threshold. For example, when the number of devices in the multicast group is greater than 100, the load balancing mechanism is enabled to distribute the multicast data to multiple network links to improve the data transmission efficiency. It can also be set to perform a specific operation when the number of devices is less than a certain value. For example, when the number of devices is less than 10, some multicast data transmission channels are closed to save network resources. It can also set conditions according to the change trend of the number of devices. For example, when the number of devices rapidly increases or decreases by more than a certain percentage within a short period of time, the management strategy of the multicast group is triggered for re-evaluation and dynamic adjustment. This application does not make any limitations in this regard.

[0049] Exemplarily, taking a video conferencing system in an enterprise local area network as an example, the network deploys the IGMPv3 multicast protocol, the multicast group address is 225.0.0.100, the upper limit of the MAC address pool is 50, and the aging time is 180 seconds. When a host frequently joins or leaves the multicast group, the IGMP querier intelligently controls the protocol message interaction by maintaining the (G, NUM, MAC_LIST) table entries. The specific process includes but is not limited to the following steps:

[0050] S1: Obtain the membership report message sent by the target device:

[0051] Host A (MAC address: 54:89:98:F7:33:D4) sends a membership report message to join the multicast group 225.0.0.100. The IGMP querier parses the message, extracts the multicast group address (G = 225.0.0.100) and the MAC address of Host A, and enters the table entry query process.

[0052] S2: Query the table entries associated with the target multicast group:

[0053] The IGMP querier searches in the local database to check if there is a table entry for the multicast group 225.0.0.100. Assuming there is no such multicast group table entry currently, an addition operation is performed.

[0054] S3: Add an entry and update the membership:

[0055] Create an entry:

[0056] Multicast group G: 225.0.0.100;

[0057] NUM: 1;

[0058] MAC_LIST: 54:89:98:F7:33:D4 (aging time: 180 seconds).

[0059] At this time, the number of members in the multicast group 225.0.0.100 is 1, and the IGMP querier does not need to send a specific group query message.

[0060] S4: Process the join request of another host:

[0061] Host B (MAC address: 68:55:66:F2:66:A5) sends a membership report message to join the multicast group 225.0.0.100. The IGMP querier queries and finds that the entry exists, but the MAC address of host B is not in the MAC_LIST, and performs an update operation:

[0062] NUM: Increase from 1 to 2;

[0063] MAC_LIST: Add 68:55:66:F2:66:A5 (aging time: 180 seconds).

[0064] After the entry is updated, the number of multicast group members is 2, and there is still no need to trigger a specific group query message.

[0065] S5: Process the leave request of host A:

[0066] Host A sends a message to leave the multicast group 225.0.0.100. The IGMP querier queries the entry, finds that NUM = 2 and the MAC address of host A is in the MAC_LIST, and performs the following operations:

[0067] NUM: Decrease from 2 to 1;

[0068] MAC_LIST: Delete 54:89:98:F7:33:D4.

[0069] Since NUM = 1, according to the rule, no specific group query message is sent, and the entry is directly updated. The network traffic is reduced by 50% (compared with the traditional mechanism that needs to send a specific group query message and possible response messages).

[0070] S6: Process the leave request of host B:

[0071] Host B sends a message to leave multicast group 225.0.0.100. At this time, NUM = 1 in the entry and only the address of Host B remains in the MAC_LIST. The IGMP querier performs the following operations:

[0072] Delete the entry;

[0073] Send a specific group query message (response timeout: 10 seconds).

[0074] If no membership report messages from other hosts are received within 10 seconds, the IGMP querier confirms that there are no members in multicast group 225.0.0.100 and stops maintaining this multicast group. In this scenario, only one query message needs to be sent, while the traditional mechanism needs to send one each time a host leaves, reducing traffic by 90%.

[0075] S7: Process the scenario of entry aging:

[0076] Suppose host C (MAC address: 00:1C:B3:AA:BB:CC) joins multicast group 225.0.0.100, but no new membership report messages are sent within 180 seconds. The IGMP querier detects that its aging time has timed out and automatically performs:

[0077] NUM: Decrease from the current value by 1;

[0078] MAC_LIST: Delete 00:1C:B3:AA:BB:CC.

[0079] If NUM drops to 0, delete the entry to avoid ineffective maintenance.

[0080] Through the embodiments of the present application, when NUM > 1, the leave operation directly updates the entry, avoiding sending specific group query messages. Suppose a multicast group has 50 members. When a single host leaves, 50 query messages are saved (50 times are required in the traditional mechanism), and the link load is reduced by 98%. If an attacker forges a large number of leave messages, the IGMP querier verifies the legality of the MAC address through the entry, and the invalid messages are directly discarded, reducing 80% of the invalid protocol processing. By restricting the number of the MAC address pool (such as the upper limit of 50) and the aging time (180 seconds), the memory occupancy of the entry is reduced by 60%, and the CPU utilization rate of the querier drops by 40%. The present application realizes the technical effects of reducing protocol traffic, reducing device load, and improving network stability by dynamically maintaining the association relationship between the multicast group and the host and combining an intelligent message suppression mechanism.

[0081] In the embodiments of the present application, by obtaining the target packet sent by the target device and parsing the multicast group address and the physical address of the target device in the target packet, the purpose of accurately identifying the multicast group to which the target device belongs is achieved, thereby realizing the technical effect of efficiently managing the multicast group membership relationship; by using the method of searching for the target entry associated with the target multicast group based on the target packet, and maintaining the number of devices (NUM) and the physical address list (MAC_LIST) in the target entry, the purpose of recording the status of the multicast group members in real time is achieved, thereby realizing the technical effects of reducing redundant protocol packets and improving the utilization efficiency of network resources; by using the method based on whether the target entry is found, whether the target physical address is found in the target entry, and whether the number of devices meets the preset quantity condition, and dynamically updating the NUM value and MAC_LIST in the target entry, the purpose of accurately maintaining the multicast group membership relationship is achieved, thereby realizing the technical effects of reducing the load of the IGMP querier and optimizing the network performance; by using the method of updating or deleting the target physical address in the target entry and judging whether the number of devices meets the preset condition (such as whether the NUM value is 1), the purpose of intelligently controlling the sending of specific group query packets is achieved, thereby realizing the technical effects of reducing network traffic and improving network stability, and further solving the technical problems of low efficiency, large resource consumption, and insufficient network stability in multicast group member management in the related art.

[0082] As an optional solution, updating the membership relationship of the target multicast group based on whether the target entry is found, whether the target physical address is found in the target entry, and whether the number of devices meets the preset quantity condition includes:

[0083] Determining whether the target entry is found, whether the target physical address is found in the target entry, and whether the number of devices meets the preset quantity condition based on the packet type of the target packet to update the target entry;

[0084] Determining the membership relationship of the target multicast group based on the target entry.

[0085] Optionally, in the embodiments of the present application, the above-mentioned target physical address may include, but is not limited to, the MAC address of the target device. The MAC address is the unique hardware identifier of a network device, usually represented by 48-bit binary numbers, in the format of XX:XX:XX:XX:XX:XX. In multicast communication, the MAC address is used to identify the specific device that joins or leaves the multicast group. For example, the MAC address of host A is 54:89:98:F7:33:D4. When host A sends a membership report packet, the IGMP querier will record this MAC address into the MAC_LIST of the target entry. By matching the target physical address, the IGMP querier can determine whether a certain device belongs to a specific multicast group, so as to decide whether to update the entry or trigger a specific group query packet.

[0086] Optionally, in the embodiments of the present application, the above update of the target entry may include, but is not limited to, operations for modifying the number of multicast group members (NUM) and the physical address list (MAC_LIST). The specific operations for updating the target entry include adding an entry, deleting an entry, updating the NUM value, and modifying the MAC_LIST. For example, when a new host joins a multicast group, the IGMP querier adds an entry or updates the NUM value and the MAC_LIST; when a host leaves the multicast group, the IGMP querier decreases the NUM value and deletes the corresponding MAC address from the MAC_LIST. The purpose of updating the target entry is to ensure that the IGMP querier can accurately maintain the membership relationship of the multicast group, thereby optimizing the interaction efficiency of protocol messages. For example, in the multicast group 225.0.0.100, when host A leaves, the IGMP querier decreases the NUM value from 2 to 1 and deletes the MAC address of host A from the MAC_LIST.

[0087] Optionally, in the embodiments of the present application, the membership relationship of the above target multicast group may include, but is not limited to, the dynamic association relationship between the multicast group and the host. The membership relationship of the target multicast group is maintained through the target entry, including the multicast group address, the number of members, and the list of member physical addresses. The dynamic change of the membership relationship is realized through the parsing of the target message and the update of the target entry. For example, in the multicast group 225.0.0.100, when host A joins, the membership relationship is updated to NUM = 1, and the MAC_LIST contains the MAC address of host A; when host B joins, the membership relationship is updated to NUM = 2, and the MAC_LIST contains the MAC addresses of host A and host B. By maintaining the membership relationship of the target multicast group, the IGMP querier can efficiently manage the membership status of the multicast group, reduce unnecessary protocol message interactions, and improve network performance. For example, in a video conferencing system, dynamically maintaining the membership relationship can ensure the accurate distribution of conference data while reducing network load.

[0088] As an optional solution, based on the message type of the target message, determine whether the target entry is found, whether the target physical address is found in the target entry, and whether the number of devices meets the preset number condition to update the target entry, including: when the message type indicates that the target message is a membership report message, determine whether the target entry is found; when the target entry is found, determine whether the target physical address is found in the target entry; when the target physical address is found, update the target aging time of the target device in the target entry;

[0089] When the target physical address is not found, add the target physical address to the target entry and increase the number of devices;

[0090] In the case where the target entry is not found, add the target entry and set the device quantity to the preset quantity condition.

[0091] Optionally, in the embodiments of the present application, the above membership report message may include, but is not limited to, a protocol message for indicating that a target device joins a certain multicast group. The membership report message is usually actively sent by the host, and the message contains the physical address of the target device (such as the MAC address) and the address of the target multicast group (such as the IP address). The function of this message is to notify the IGMP querier that the current device is interested in a certain multicast group, so that the querier can maintain the membership relationship of the multicast group. For example, in a video conferencing system, when a certain terminal joins the conference multicast group, it will send a membership report message, which contains the MAC address of the terminal and the multicast group address 225.0.0.100. By parsing the membership report message, the IGMP querier can determine whether it is necessary to add or update the target entry.

[0092] Optionally, in the embodiments of the present application, the above target aging time may include, but is not limited to, the valid time of the multicast group membership relationship information in the target entry. The target aging time is used to control the life cycle of the multicast group membership relationship information. When the membership relationship information of a certain host exceeds the aging time, the IGMP querier will delete it from the target entry. The setting of the aging time can be adjusted according to the network environment and requirements. For example, it can be set to 180 seconds. Within the target aging time, if the host does not send a new membership report message, it is considered that the host has left the multicast group. For example, in the entry of the multicast group 225.0.0.100, the aging time of the MAC address 54:89:98:F7:33:D4 of host A is 180 seconds. If no new message from host A is received within 180 seconds, the IGMP querier will delete the information of this host and update the NUM value.

[0093] Optionally, in the embodiments of the present application, the above preset quantity condition may include, but is not limited to, the initial value of the multicast group member quantity. The preset quantity condition is usually used to initialize the NUM value when adding a target entry. For example, when the IGMP querier receives the first membership report message, it will add a target entry and set the NUM value to 1. The setting of the preset quantity condition can be adjusted according to actual needs. For example, in some scenarios, the initial value can be set to 0 and increased to 1 after receiving the first message. The role of the preset quantity condition is to ensure that the target entry can accurately reflect the member status of the multicast group, thereby optimizing the interaction efficiency of the protocol message. For example, in the multicast group 225.0.0.100, when host A sends the first membership report message, the IGMP querier will add an entry and set the NUM value to 1.

[0094] Optionally, in the embodiments of the present application, the above-mentioned adding of the target physical address may include, but is not limited to, adding the MAC address of the target device to the MAC_LIST of the target entry. The operation of adding the target physical address is usually performed when the target physical address is not found, to ensure that the target entry can completely record all member information of the multicast group. For example, in the entry of the multicast group 225.0.0.100, if the MAC address 68:55:66:F2:66:A5 of host B is not included in the MAC_LIST, the IGMP querier will add this address to the MAC_LIST and increment the NUM value. The purpose of adding the target physical address is to ensure that the IGMP querier can accurately maintain the member relationship of the multicast group, thereby reducing unnecessary protocol message interactions.

[0095] Optionally, in the embodiments of the present application, the above-mentioned adding of the device quantity may include, but is not limited to, the operation of incrementing the NUM value in the target entry. The operation of adding the device quantity is usually performed when a new target physical address or a new target entry is added, to reflect the change in the number of multicast group members. For example, in the entry of the multicast group 225.0.0.100, when the MAC address 00:1C:B3:AA:BB:CC of host C is added to the MAC_LIST, the NUM value will increase from 2 to 3. The purpose of adding the device quantity is to ensure that the target entry can update the member status of the multicast group in real time, thereby optimizing the utilization efficiency of network resources.

[0096] Optionally, in the embodiments of the present application, the above-mentioned adding of the target entry may include, but is not limited to, creating a new entry when the target entry does not exist. The operation of adding the target entry is usually performed when the first membership report message is received, to ensure that the IGMP querier can start maintaining the member relationship of the multicast group. For example, when the entry of the multicast group 225.0.0.100 does not exist, when host A sends a membership report message, the IGMP querier will create a new entry and initialize the NUM value to 1 and the MAC_LIST to the MAC address of host A. The purpose of adding the target entry is to ensure that the IGMP querier can comprehensively manage the member relationship of the multicast group, thereby improving the stability and performance of the network.

[0097] As an alternative solution, the above method further includes:

[0098] In the case where the target aging time reaches the aging time threshold, delete the target physical address in the target entry and reduce the device quantity;

[0099] In the case where the target physical address is found and the device quantity reaches the device quantity threshold, add the target physical address in the target entry and delete the physical address corresponding to the aging device, where the aging device refers to a device whose aging time and the aging time threshold meet a preset condition.

[0100] As an alternative solution, it is determined whether a target entry is found, whether a target physical address is found in the target entry, and whether the number of devices meets a preset number condition based on the message type of the target message to update the target entry, including:

[0101] When the message type indicates that the target message is a membership leave message, it is determined whether a target entry is found;

[0102] When the target entry is found, it is determined whether a target physical address is found in the target entry;

[0103] When the target physical address is found, it is determined whether the number of devices meets the preset number condition;

[0104] When the number of devices meets the preset number condition, the target entry is deleted, where the preset number condition is used to indicate that the target device is the last device recorded in the target entry;

[0105] When the number of devices does not meet the preset number condition, the target physical address is deleted and the number of devices is updated;

[0106] When the target entry is not found, or when the target entry is found but the target physical address is not found, the update of the target entry is stopped.

[0107] Optionally, in the embodiments of the present application, the above membership leave message may include, but is not limited to, a protocol message used to indicate that a target device leaves a certain multicast group. The membership leave message is usually actively sent by the host, and the message contains the physical address of the target device (such as the MAC address) and the address of the target multicast group (such as the IP address). The function of this message is to notify the IGMP querier that the current device is no longer interested in a certain multicast group, so that the querier can update the membership relationship of the multicast group. For example, in a video conferencing system, when a certain terminal exits the conference multicast group, a membership leave message will be sent, and the message contains the MAC address of the terminal and the multicast group address 225.0.0.100. By parsing the membership leave message, the IGMP querier can determine whether it is necessary to delete or update the target entry.

[0108] Optionally, in the embodiments of the present application, the above-mentioned deletion of the target entry may include, but is not limited to, removing the entry of the target multicast group from the local database of the IGMP querier. The operation of deleting the target entry is usually performed when the number of devices meets the preset number condition, that is, the target device is the last device recorded in the target entry. For example, in the entry of multicast group 225.0.0.100, if the NUM value is 1 and only the MAC address 54:89:98:F7:33:D4 of host A exists in the MAC_LIST, when host A sends a leave message, the IGMP querier will delete this entry. The purpose of deleting the target entry is to ensure that the IGMP querier no longer maintains a multicast group without members, thereby reducing unnecessary resource consumption.

[0109] Optionally, in the embodiments of the present application, the above-mentioned deletion of the target physical address may include, but is not limited to, removing the MAC address of the target device from the MAC_LIST of the target entry. The operation of deleting the target physical address is usually performed when the number of devices does not meet the preset number condition, that is, there are still other members in the target entry. For example, in the entry of multicast group 225.0.0.100, if the NUM value is 3 and the MAC_LIST contains the MAC addresses of host A, host B, and host C, when host A sends a leave message, the IGMP querier will delete the address of host A from the MAC_LIST and reduce the NUM value from 3 to 2. The purpose of deleting the target physical address is to ensure that the target entry can accurately reflect the current member status of the multicast group.

[0110] Optionally, in the embodiments of the present application, the above-mentioned update of the device number may include, but is not limited to, the operation of reducing the NUM value in the target entry. The operation of updating the device number is usually performed after deleting the target physical address to reflect the change in the number of multicast group members. For example, in the entry of multicast group 225.0.0.100, when the MAC address 68:55:66:F2:66:A5 of host B is deleted from the MAC_LIST, the NUM value will be reduced from 2 to 1. The purpose of updating the device number is to ensure that the target entry can update the member status of the multicast group in real time, thereby optimizing the utilization efficiency of network resources.

[0111] Optionally, in the embodiments of the present application, the above-mentioned stopping the update of the target entry may include, but is not limited to, when the target entry is not found or the target physical address is not found, the IGMP querier does not perform any entry update operation. The operation of stopping the update of the target entry is usually performed in the following two cases: one is that the target entry does not exist, that is, the multicast group is not joined by any device; the other is that the target entry exists but does not contain the target physical address, that is, the target device is not a member of the multicast group. For example, when the entry of the multicast group 225.0.0.100 does not exist, if host D sends a leave message, the IGMP querier will directly discard the message; if the entry exists but the MAC address of host D is not included in the MAC_LIST, the IGMP querier will also stop the update operation. The purpose of stopping the update of the target entry is to avoid invalid operations and improve the processing efficiency of the querier.

[0112] As an optional solution, determining the membership relationship of the target multicast group based on the target entry includes:

[0113] When the number of devices meets the preset number condition, or when the target entry is not found, sending a query message to the target multicast group;

[0114] When the number of devices meets the preset number condition and no response message of the target multicast group is received within the preset response duration, deleting the target entry and determining that the membership relationship of the target multicast group is empty;

[0115] When a response message of the target multicast group is received within the preset response duration, updating the target entry based on the response message and determining that the membership relationship of the target multicast group does not include the target device;

[0116] When the target entry is not found, adding the target entry based on the response message and determining that the membership relationship of the target multicast group does not include the target device.

[0117] Optionally, in the embodiments of the present application, the above-mentioned query message may include, but is not limited to, an IGMP specific group query message. The query message is sent by the IGMP querier to confirm whether there are still members in a certain multicast group. The query message contains the address of the target multicast group (such as an IP address) and the maximum response time (such as 10 seconds). For example, in the multicast group 225.0.0.100, when host A sends a leave message and the NUM value is 1, the IGMP querier will send a query message to this multicast group to confirm whether there are other members. The purpose of the query message is to maintain the membership relationship of the multicast group through active query and avoid multicast data from continuing to be sent to a network segment without members due to the departure of members.

[0118] Optionally, in the embodiments of the present application, the above preset response duration may include, but is not limited to, the maximum time for the IGMP querier to wait for a response message. The preset response duration is usually consistent with the maximum response time in the query message, for example, set to 10 seconds. Within the preset response duration, the IGMP querier will wait for the members of the target multicast group to send a response message (such as a membership report message). If no response message is received within the preset response duration, it is considered that there are no more members in this multicast group. For example, in the multicast group 225.0.0.100, if the IGMP querier does not receive any response message within 10 seconds, it will delete the target entry and stop maintaining this multicast group. The setting of the preset response duration can be adjusted according to the network environment and requirements. For example, it can be set to 15 seconds in some high-latency networks.

[0119] Optionally, in the embodiments of the present application, the above response message may include, but is not limited to, an IGMP membership report message. The response message is sent by the multicast group member to respond to the query message and declare that it is still interested in the target multicast group. The response message contains the physical address of the host (such as the MAC address) and the address of the target multicast group (such as the IP address). For example, in the multicast group 225.0.0.100, when the IGMP querier sends a query message, host B (MAC address: 68:55:66:F2:66:A5) will send a response message indicating that it still belongs to this multicast group. The purpose of the response message is to help the IGMP querier confirm the membership status of the multicast group, so as to decide whether to update or delete the target entry.

[0120] Optionally, in the embodiments of the present application, the above deletion of the target entry may include, but is not limited to, removing the entry of the target multicast group from the local database of the IGMP querier. The operation of deleting the target entry is usually performed when the number of devices meets the preset number condition and no response message is received within the preset response duration. For example, in the multicast group 225.0.0.100, if the NUM value is 1 and no response message is received within the preset response duration, the IGMP querier will delete this entry and stop maintaining this multicast group. The purpose of deleting the target entry is to ensure that the IGMP querier no longer maintains a multicast group without members, thereby reducing unnecessary resource consumption.

[0121] Optionally, in the embodiments of the present application, the above update of the target entry may include, but is not limited to, modifying operations on the NUM value and MAC_LIST in the target entry. The operation of updating the target entry is usually performed when a response message is received within the preset response duration. For example, in the multicast group 225.0.0.100, if the IGMP querier receives a response message from host B, it will update the NUM value and MAC_LIST to ensure that the target entry accurately reflects the membership status of the multicast group. The purpose of updating the target entry is to ensure that the IGMP querier can maintain the membership relationship of the multicast group in real time, thereby improving the stability and performance of the network.

[0122] Optionally, in the embodiments of the present application, the above-mentioned adding of the target entry may include, but is not limited to, creating a new entry when the target entry is not found. The operation of adding the target entry is usually performed when a response message is received and the target entry does not exist. For example, when the entry of multicast group 225.0.0.100 does not exist and the IGMP querier receives a response message from host C, a new entry will be added and the NUM value will be initialized to 1 and the MAC_LIST will be the MAC address of host C. The purpose of adding the target entry is to ensure that the IGMP querier can comprehensively manage the membership relationship of the multicast group, thereby improving the stability and performance of the network.

[0123] Optionally, in the embodiments of the present application, the above-mentioned determining that the membership relationship of the target multicast group is empty may include, but is not limited to, the IGMP querier confirming that there are no members in the target multicast group. The operation of determining that the membership relationship is empty is usually performed after deleting the target entry. For example, in multicast group 225.0.0.100, if the IGMP querier deletes the entry, it is determined that the membership relationship of this multicast group is empty, and multicast data will no longer be sent to this network segment. The purpose of determining that the membership relationship is empty is to optimize the utilization efficiency of network resources and avoid invalid data transmission.

[0124] Optionally, in the embodiments of the present application, the above-mentioned determining that the membership relationship of the target multicast group does not include the target device may include, but is not limited to, the IGMP querier confirming that the target device has left the multicast group. The operation of determining that the membership relationship does not include the target device is usually performed after updating or adding the target entry. For example, in multicast group 225.0.0.100, if host A leaves and the IGMP querier receives a response message from host B, it is determined that the membership relationship does not include host A. The purpose of determining that the membership relationship does not include the target device is to ensure that multicast data is only sent to the currently valid members, thereby improving the transmission efficiency of the network.

[0125] The following further illustrates the present application with specific examples:

[0126] In multicast communication, the multicast network needs to send multicast data to specific multicast group members. Therefore, the multicast network needs to know the locations of the multicast group members and the multicast groups to which the members belong. Through the IGMP protocol, members can send messages of joining multicast groups to the multicast network, so that the multicast network can perceive the locations of the members and the multicast groups to which they belong.

[0127] IGMPv1 mainly completes the management of multicast group members based on the query and response mechanism; on the basis of being compatible with and inheriting IGMPv1, IGMPv2 adds a mechanism for leaving the multicast group. The IGMP querier periodically sends IGMP query messages to all hosts and devices within the local network segment in a multicast manner. After receiving the query message, host Host1 first sends an IGMP membership report message in a multicast manner to announce that it belongs to the G multicast group. Since all hosts and devices in the local network segment can receive the report message sent by host Host1 to G, when other hosts receive this report message, they will no longer send the same report message for G, because the IGMP device already knows that there is a host interested in G in the local network segment. This mechanism is called the IGMP membership report suppression mechanism on the host, and this mechanism helps to reduce the information traffic in the local network segment. In IGMPv2, when a host leaves a certain multicast group, it sends a leave multicast group message to all multicast devices in the local network segment. After receiving this message, the IGMP querier sends a specific group query message to the multicast group that the host declares to leave. If there are other members of this multicast group in this network segment, these members will send a membership report message within the maximum response time set in this message after receiving the specific group query message; if a membership report message sent by other members of this multicast group is received within the maximum response time, the IGMP querier will continue to maintain the membership relationship of this multicast group; otherwise, the IGMP querier will consider that there are no longer members of this multicast group in this network segment, and thus will no longer maintain the membership relationship of this multicast group. Therefore, when there are a large number of hosts in the same network segment belonging to the G multicast group, when hosts frequently join and leave the G multicast group, or when an attacker attacks the IGMP querier with a multicast group G membership leave message, it may cause a large number of specific group query messages and membership report messages, increasing the load of the IGMP device, increasing the load of the network link, and reducing the performance of the network.

[0128] In order to optimize the defects of the multicast group leave mechanism in specific scenarios, a mechanism for adaptively sensing and triggering specific group query messages is proposed to avoid generating a large number of specific group query messages and membership report messages, while ensuring compatibility with the current version mechanism. It can effectively improve the ability of the IGMP device to manage hosts, and improve the stability and performance of the network.

[0129] The problems solved by this application include providing a method for reducing IGMP specific group query messages that can be configured on the IGMP querier, reducing the generation of IGMP membership report messages by hosts, and enabling the IGMP querier to efficiently and accurately maintain the membership relationship of the multicast group, reducing the load of the IGMP querier, reducing a large number of network messages that may exist in the network, and improving the reliability and performance of the network.

[0130] To solve the above problems, it is possible but not limited to providing configurable parameters, and the implementation method is described as follows:

[0131] 1. Enable switch: Configure the IGMP querier to use the method of this application.

[0132] 2. Multicast group: Specify a specific multicast group to use the method of this application.

[0133] 3. Number of MAC address pools of host members: Configure the number of MAC address pools of host members corresponding to the multicast group to use the method of this application.

[0134] 4. Data aging time in the MAC address pool of host members: Configure the data aging time in the MAC address pool of host members corresponding to the multicast group to use the method of this application.

[0135] This application provides a method and device for leaving the multicast group member relationship. This method uses the IGMP querier to intelligently learn and judge whether to send IGMP specific group query protocol messages. When the function of the IGMP querier to intelligently send IGMP specific group query protocol messages (specific group query suppression mechanism) is enabled, the processing flow of the multicast group G member relationship report message is as Figure 3 shown, and the processing flow of the multicast group G member relationship leave message is as Figure 4 shown. The detailed process is described as follows:

[0136] S1. When a new host sends a multicast group G member relationship report message to join the multicast group G, the IGMP querier will maintain the (G, NUM, MAC_LIST) entry after receiving this message. A sample is shown in Table 1:

[0137]

[0138] Table 1

[0139] S2. When the IGMP querier receives a multicast group G member relationship leave message sent by a host, it judges whether there are other hosts in the current network segment that are members of the multicast group G according to the maintained (G, NUM, MAC_LIST) entry.

[0140] S2-1. If the NUM value is greater than 1, do not send an IGMP specific group query message, only update the (G, NUM, MAC_LIST) entry, and do not update the multicast group member relationship;

[0141] S2-2, if the NUM value is equal to 1 and the host MAC address of the membership leave message for multicast group G is matched in the MAC_LIST or the (G, NUM, MAC_LIST) entry does not exist, the querier sends an IGMP specific group query message. If no IGMP membership report message for multicast group G is received within the response timeout period, the IGMP querier performs the membership leave processing for multicast group G. If there is an (G, NUM, MAC_LIST) entry, it is deleted; if an IGMP membership report message for multicast group G is received within the response timeout period, the IGMP querier updates the membership of multicast group G. If there is no (G, NUM, MAC_LIST) entry, the entry is newly added; if there is an (G, NUM, MAC_LIST) entry, the entry is updated. Update the multicast group membership.

[0142] S3, the rules for the IGMP querier to maintain the (G, NUM, MAC_LIST) entry are:

[0143] After receiving a membership report message for multicast group G, if there is an (G, NUM, MAC_LIST) entry and the host MAC address of the membership report message for multicast group G is matched in the MAC_LIST, only the aging time of the corresponding host in the membership information of multicast group G needs to be updated; if there is an (G, NUM, MAC_LIST) entry and the host MAC address of the membership report message for multicast group G cannot be matched in the MAC_LIST, the NUM information needs to be updated and the membership information of multicast group G for the host needs to be newly added to the MAC_LIST; if there is no (G, NUM, MAC_LIST) entry, an (G, NUM, MAC_LIST) entry needs to be newly added.

[0144] After receiving a membership leave message for multicast group G, if there is an (G, NUM, MAC_LIST) entry and the host MAC address of the membership leave message for multicast group G is matched in the MAC_LIST, if NUM is equal to 1, the (G, NUM, MAC_LIST) entry is directly deleted; if NUM is greater than 1, the NUM information needs to be updated and the membership information of multicast group G for the host needs to be deleted from the MAC_LIST; if there is an (G, NUM, MAC_LIST) entry and the host MAC address of the membership leave message for multicast group G cannot be matched in the MAC_LIST or there is no (G, NUM, MAC_LIST) entry, the (G, NUM, MAC_LIST) entry does not need to be updated.

[0145] When the multicast group G membership information in the (G, NUM, MAC_LIST) entry reaches the aging time, it is necessary to update the NUM information and delete the multicast group G membership information of the host from the MAC_LIST.

[0146] When the number of newly added multicast group G membership information in the MAC_LIST reaches the upper limit, the multicast group G membership information that is about to time out fastest can be removed, and the currently newly added multicast group G membership information can be added to the MAC_LIST.

[0147] Figure 5 The comparison before and after optimization of the present application in a specific application scenario is recorded.

[0148] The present application uses an IGMP querier to control the interaction of messages according to a relationship table maintained between a multicast group G and a host. In addition, an implementation method of the relationship table between the multicast group G and the host includes the content of the relationship table, an update policy, a usage policy, and the opening and closing of the relationship table.

[0149] It can be understood that in the specific implementation manner of the present application, data related to user information, etc. is involved. When the above embodiments of the present application are applied to specific products or technologies, user permission or consent needs to be obtained, and the collection, use, and processing of relevant data need to comply with relevant laws, regulations, and standards of relevant countries and regions.

[0150] It should be noted that for the foregoing method embodiments, for the sake of simple description, they are all expressed as a series of action combinations. However, those skilled in the art should know that the present application is not limited by the described action sequence, because according to the present application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to the present application.

[0151] According to another aspect of the embodiments of the present application, a management device for a multicast group for implementing the above-mentioned multicast group management method is further provided. As Figure 6 shown, the device includes:

[0152] An obtaining module 602, configured to obtain a target message sent by a target device, where the target message is used to indicate that the target device belongs to a target multicast group;

[0153] A searching module 604, configured to search for a target entry associated with the target multicast group based on the target message, where the target entry includes the number of devices in the target multicast group and the physical address corresponding to each device in the target multicast group;

[0154] An update module 606, configured to update the membership relationship of the target multicast group based on whether the target entry is found, whether a target physical address is found in the target entry, and whether the number of devices meets a preset number condition, where the target physical address corresponds to the target device.

[0155] As an alternative solution, the apparatus is configured to update the membership relationship of the target multicast group based on whether the target entry is found, whether a target physical address is found in the target entry, and whether the number of devices meets a preset number condition in the following manner: determining whether the target entry is found, whether a target physical address is found in the target entry, and whether the number of devices meets the preset number condition based on the packet type of the target packet, so as to update the target entry; and determining the membership relationship of the target multicast group based on the target entry.

[0156] As an alternative solution, the apparatus is configured to determine whether the target entry is found, whether a target physical address is found in the target entry, and whether the number of devices meets a preset number condition based on the packet type of the target packet in the following manner, so as to update the target entry: when the packet type indicates that the target packet is a membership report packet, determining whether the target entry is found; when the target entry is found, determining whether the target physical address is found in the target entry; when the target physical address is found, updating the target aging time of the target device in the target entry;

[0157] when the target physical address is not found, adding the target physical address to the target entry and increasing the number of devices; when the target entry is not found, adding the target entry and setting the number of devices to the preset number condition.

[0158] As an alternative solution, the apparatus is further configured to: when the target aging time reaches an aging time threshold, deleting the target physical address from the target entry and reducing the number of devices; when the target physical address is found and the number of devices reaches a device number threshold, adding the target physical address to the target entry and deleting the physical address corresponding to the aging device, where the aging device refers to a device whose aging time and the aging time threshold meet a preset condition.

[0159] As an alternative, the device is configured to determine whether the target entry is found, whether the target physical address is found in the target entry, and whether the number of devices meets a preset number condition based on the message type of the target message in the following manner to update the target entry: when the message type indicates that the target message is a membership leave message, determine whether the target entry is found; when the target entry is found, determine whether the target physical address is found in the target entry; when the target physical address is found, determine whether the number of devices meets the preset number condition; when the number of devices meets the preset number condition, delete the target entry, where the preset number condition is used to indicate that the target device is the last device recorded in the target entry; when the number of devices does not meet the preset number condition, delete the target physical address and update the number of devices; when the target entry is not found, or when the target entry is found but the target physical address is not found, stop updating the target entry.

[0160] As an alternative, the device is configured to determine the membership relationship of the target multicast group based on the target entry in the following manner: when the number of devices meets the preset number condition, or when the target entry is not found, send a query message to the target multicast group; when the number of devices meets the preset number condition and no response message from the target multicast group is received within a preset response duration, delete the target entry and determine that the membership relationship of the target multicast group is empty; when a response message from the target multicast group is received within the preset response duration, update the target entry based on the response message and determine that the membership relationship of the target multicast group does not include the target device; when the target entry is not found, add the target entry based on the response message and determine that the membership relationship of the target multicast group does not include the target device.

[0161] In the embodiments of the present application, the term "module" or "unit" refers to a computer program with a predetermined function or a part of a computer program, which works together with other related parts to achieve a predetermined goal, and can be fully or partially implemented by using software, hardware (such as a processing circuit or a memory), or a combination thereof. Similarly, one processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be a part of an overall module or unit that includes the function of the module or unit.

[0162] Regarding the device in the above embodiments, the specific manners in which each module performs operations have been described in detail in the embodiments related to the method, and will not be elaborated here.

[0163] According to one aspect of the present application, there is provided a computer program product, which includes a computer program.

[0164] The serial numbers of the embodiments of the present application above are only for description and do not represent the superiority or inferiority of the embodiments.

[0165] Figure 7 Schematically shown is a block diagram of a computer system of an electronic device for implementing the embodiments of the present application.

[0166] It should be noted that Figure 7 the computer system 700 of the shown electronic device is only an example and should not impose any limitation on the functions and usage scope of the embodiments of the present application.

[0167] As Figure 7 shown, the computer system 700 includes a central processing unit 701 (CPU), which can perform various appropriate actions and processes according to the program stored in the read-only memory 702 (ROM) or the program loaded from the storage section 708 into the random access memory 703 (RAM). In the random access memory 703, various programs and data required for system operation are also stored. The central processing unit 701, the read-only memory 702, and the random access memory 703 are connected to each other via a bus 704. The input / output interface 705 (Input / Output interface, i.e., I / O interface) is also connected to the bus 704.

[0168] The following components are connected to the input / output interface 705: an input section 706 including a keyboard, a mouse, etc.; an output section 707 including such as a cathode ray tube (CRT), a liquid crystal display (LCD), etc. and a speaker, etc.; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network interface card such as a local area network card, a modem, etc. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the input / output interface 705 as needed. A removable medium 711, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 710 as needed so that the computer program read from it can be installed into the storage section 708 as needed.

[0169] In particular, according to an embodiment of the present application, the processes described in each method flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program codes for executing the methods shown in the flowcharts. In such an embodiment, the computer program can be downloaded and installed from a network through the communication part 709, and / or installed from the removable medium 711. When the computer program is executed by the central processing unit 701, various functions defined in the system of the present application are executed.

[0170] In such an embodiment, the computer program can be downloaded and installed from a network through the communication part 709, and / or installed from the removable medium 711. When the computer program is executed by the central processing unit 701, various functions provided by the embodiments of the present application are executed.

[0171] According to another aspect of the embodiments of the present application, an electronic device for implementing the above multicast group management method is further provided. The electronic device may be Figure 1 the terminal device or server shown. This embodiment takes the electronic device as the terminal device as an example for illustration. As Figure 8 shown, the electronic device includes a memory 802 and a processor 804. A computer program is stored in the memory 802, and the processor 804 is configured to execute the steps in any of the above method embodiments through the computer program.

[0172] Optionally, in this embodiment, the above electronic device may be at least one network device among multiple network devices in a computer network.

[0173] Optionally, in this embodiment, the above processor may be configured to execute the methods in the embodiments of the present application through a computer program.

[0174] Optionally, those of ordinary skill in the art can understand that Figure 8 the structure shown is only schematic, Figure 8 and it does not limit the structure of the above electronic device. For example, the electronic device may further include more or fewer components (such as a network interface, etc.) than those shown in Figure 8 , or have a different configuration from that shown in Figure 8 .

[0175] Among them, the memory 802 can be used to store software programs and modules, such as the program instructions / modules corresponding to the multicast group management method and apparatus in the embodiments of the present application. The processor 804 executes various functional applications and data processing by running the software programs and modules stored in the memory 802, that is, implements the above-mentioned multicast group management method. The memory 802 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memories, or other non-volatile solid-state memories. In some instances, the memory 802 may further include a memory remotely disposed relative to the processor 804, and these remote memories may be connected to the terminal through a network. Examples of the above network include but are not limited to the Internet, enterprise intranet, local area network, mobile communication network, and combinations thereof. Among them, the memory 802 may specifically but not limitedly be used to store information such as multicast group data. As an example, as Figure 8 shown, the above-mentioned memory 802 may but not limitedly include the acquisition module 602, the lookup module 604, and the update module 606 in the above-mentioned multicast group management apparatus. In addition, it may also include but not limited to other module units in the above-mentioned multicast group management apparatus, which will not be elaborated in this example.

[0176] Optionally, the above-mentioned transmission device 806 is used to receive or send data via a network. Specific examples of the above-mentioned network may include a wired network and a wireless network. In one instance, the transmission device 806 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices and routers through a network cable, thereby enabling communication with the Internet or a local area network. In one instance, the transmission device 806 is a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0177] In addition, the above-mentioned electronic device further includes: a display 808, which is used to display the above-mentioned multicast group information; and a connection bus 810, which is used to connect each module component in the above-mentioned electronic device.

[0178] In other embodiments, the above-mentioned terminal device or server may be a node in a distributed system. Among them, the distributed system may be a blockchain system, and the blockchain system may be a distributed system formed by connecting the multiple nodes through network communication. Among them, the nodes can form a peer-to-peer network, and any form of computing device, such as a server, a terminal, and other electronic devices, can become a node in the blockchain system by joining the peer-to-peer network.

[0179] According to one aspect of the present application, a computer-readable storage medium is provided. A processor of an electronic device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the electronic device executes the multicast group management method provided in various alternative implementations of the above-mentioned management of the multicast group.

[0180] Optionally, in this embodiment, the above-mentioned computer-readable storage medium may be configured to store instructions for executing the methods in the various embodiments of the present application.

[0181] Optionally, in this embodiment, those of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by a program instructing the relevant hardware of the terminal device. The program can be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disc, etc.

[0182] The serial numbers of the above embodiments of the present application are only for description and do not represent the superiority or inferiority of the embodiments.

[0183] If the integrated unit in the above embodiments is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in the above-mentioned computer-readable storage medium. Based on such an understanding, the technical solution of the present 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. The computer software product is stored in a storage medium and includes several instructions for causing one or more electronic devices to execute all or part of the steps of the methods described in the various embodiments of the present application.

[0184] In the above embodiments of the present application, the descriptions of the various embodiments have their own emphases. For the parts not detailed in a certain embodiment, reference may be made to the relevant descriptions of other embodiments.

[0185] In the several embodiments provided by the present application, it should be understood that the disclosed application program can be implemented in other ways. Among them, the device embodiments described above are only illustrative. For example, the division of the units is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection between each other can be through some interfaces, and the indirect coupling or communication connection of units or modules can be in an electrical or other form.

[0186] The unit described as a separation component may or may not be physically separated. The component shown as a unit may or may not be a physical unit, that is, it may be located in one place or may be distributed over multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0187] In addition, each functional unit in various embodiments of the present application can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.

[0188] The above are only the preferred embodiments of the present application. It should be noted that for those of ordinary skill in the art, without departing from the principle of the present application, several improvements and refinements can be made, and these improvements and refinements should also be regarded as the protection scope of the present application.

Claims

1. A method for managing a multicast group, characterized in that Including: Obtain a target message sent by a target device, where the target message is used to indicate that the target device belongs to a target multicast group; Based on the target message, search for a target entry associated with the target multicast group, where the target entry includes the number of devices in the target multicast group and the physical address corresponding to each device in the target multicast group; Update the membership relationship of the target multicast group based on whether the target entry is found, whether the target physical address is found in the target entry, and whether the number of devices meets a preset number condition, where the target physical address corresponds to the target device.

2. The method according to claim 1, wherein The updating the membership relationship of the target multicast group based on whether the target entry is found, whether the target physical address is found in the target entry, and whether the number of devices meets a preset number condition includes: Based on the message type of the target message, determine whether the target entry is found, whether the target physical address is found in the target entry, and whether the number of devices meets a preset number condition, so as to update the target entry; Based on the target entry, determine the membership relationship of the target multicast group.

3. The method according to claim 2, wherein The determining whether the target entry is found, whether the target physical address is found in the target entry, and whether the number of devices meets a preset number condition based on the message type of the target message to update the target entry includes: When the message type indicates that the target message is a membership report message, determine whether the target entry is found; When the target entry is found, determine whether the target physical address is found in the target entry; When the target physical address is found, update the target aging time of the target device in the target entry; When the target physical address is not found, add the target physical address to the target entry and increase the number of devices; When the target entry is not found, add the target entry and set the number of devices to the preset number condition.

4. The method according to claim 3, wherein The method further includes: When the target aging time reaches the aging time threshold, delete the target physical address from the target entry and reduce the number of devices; When the target physical address is found and the number of devices reaches the device number threshold, add the target physical address to the target entry and delete the physical address corresponding to the aging device, where the aging device refers to a device whose aging time and the aging time threshold meet a preset condition.

5. The method according to claim 2, wherein The determining whether the target entry is found, whether the target physical address is found in the target entry, and whether the number of devices meets a preset number condition based on the message type of the target message to update the target entry includes: When the message type indicates that the target message is a membership leave message, determine whether the target entry is found; When the target entry is found, determine whether the target physical address is found in the target entry; When the target physical address is found, determine whether the number of devices meets the preset number condition; When the number of devices meets the preset number condition, delete the target entry, where the preset number condition is used to indicate that the target device is the last device recorded in the target entry; When the number of devices does not meet the preset number condition, delete the target physical address and update the number of devices; When the target entry is not found, or when the target entry is found but the target physical address is not found, stop updating the target entry.

6. The method according to claim 5, wherein The determining the membership relationship of the target multicast group based on the target entry includes: When the number of devices meets the preset number condition, or when the target entry is not found, send a query message to the target multicast group; When the number of devices meets the preset number condition and no response message from the target multicast group is received within the preset response duration, delete the target entry and determine that the membership relationship of the target multicast group is empty; When a response message from the target multicast group is received within the preset response duration, update the target entry based on the response message and determine that the membership relationship of the target multicast group does not include the target device; When the target entry is not found, add the target entry based on the response message and determine that the membership relationship of the target multicast group does not include the target device.

7. A management device for a multicast group, characterized in that, Including: An acquisition module, configured to acquire a target message sent by a target device, where the target message is used to indicate that the target device belongs to a target multicast group; A search module, configured to search for a target entry associated with the target multicast group based on the target message, where the target entry includes the number of devices in the target multicast group and the physical address corresponding to each device in the target multicast group; An update module, configured to update the membership relationship of the target multicast group based on whether the target entry is found, whether the target physical address is found in the target entry, and whether the number of devices meets the preset number condition, where the target physical address corresponds to the target device.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored computer program, where the computer program, when run by an electronic device, executes the method described in any one of claims 1 to 6.

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

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