Multicast source configuration method, electronic device and computer program product

By sending discovery messages and analyzing response messages to obtain device address information, and automatically configuring the network communication address of the multicast source, the problems of complex multicast configuration and high maintenance costs in traditional broadcast systems are solved, and the efficiency and accuracy of multicast configuration are achieved.

CN120499152APending Publication Date: 2025-08-15TP-LINK
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510712848.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-29
Publication Date
2025-08-15

AI Technical Summary

Technical Problem

Traditional broadcast systems have complex multicast configurations and high maintenance costs, especially after the host IP address changes, which requires reconfiguration, resulting in failure to create multicasts and difficulty in management.

Method used

Discovery messages are sent through multicast and/or broadcasting methods, monitor the device response messages, parse the device address information and store it in association with the host communication address, configure the network communication address of the multicast source according to the target device selected by the user, and automatically complete the multicast source configuration.

Benefits of technology

It improves the efficiency and success rate of multicast configuration, reduces configuration complexity and maintenance costs, and achieves accurate and efficient configuration of multicast sources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120499152A_ABST
    Figure CN120499152A_ABST
Patent Text Reader

Abstract

The invention provides a multicast source configuration method, electronic equipment and a computer program product. Relates to the technical field of communication. In view of the problems of complex multicast configuration and high maintenance cost of a traditional broadcast system, the invention provides a multicast source configuration method, which comprises the following steps: sending a discovery message in a multicast and / or broadcast mode, and monitoring a response message sent by equipment according to the discovery message; analyzing the equipment address information in the response message, and associatively storing the equipment address information and the communication address of the host sending the discovery message; according to target equipment selected by a user based on the equipment list, target equipment address information of the target equipment and a target host communication address associated with the target equipment address information are determined; and configuring a network communication address of the multicast source based on the host network card configuration, the target device address information and the target host communication address. According to the embodiment of the invention, the multicast configuration efficiency can be improved, and the configuration and maintenance cost can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and in particular to a multicast source configuration method, electronic equipment, and computer program product. Background Art

[0002] Multicast, as a network communication method, can be applied to network broadcast systems. It allows data packets to be sent to multiple specific target nodes in the network without having to transmit them one by one, thereby significantly improving data transmission efficiency. By reducing redundant data in the network, multicast technology can save bandwidth resources and make data transmission more efficient.

[0003] However, traditional broadcast systems require users to manually configure multicast communication settings, and after the communication address of the broadcast system changes, the multicast of the broadcast system needs to be reconfigured, making the configuration and maintenance process of the broadcast system multicast complicated and costly. Summary of the Invention

[0004] According to various embodiments of the present application, a multicast source configuration method, electronic device, and computer program product are provided; the efficiency of multicast configuration can be improved and configuration and maintenance costs can be reduced.

[0005] In a first aspect, the present application provides a multicast source configuration method, the method comprising:

[0006] Send a discovery message by multicast and / or broadcast, and listen for a response message sent by the device based on the discovery message; parse the device address information in the response message, and store the device address information in association with the host communication address that sends the discovery message; determine the target device address information of the target device and its associated target host communication address based on the target device selected by the user based on the device list; configure the network communication address of the multicast source based on the host network card configuration, the target device address information, and the target host communication address; wherein the device list is determined based on the response message of the device, the device address information includes the target device address information, and the host communication address includes the target host communication address.

[0007] Through the above method, based on the response message of the device, the device address information of the device is obtained, and the device address information is associated with the host communication address and stored, so that the target host communication address associated with the target device can be determined based on the target device that needs to be multicast selected by the user, and then the communication address of the multicast source can be automatically configured based on the obtained target device address information, target host communication address, and host network card configuration. There is no need to manually configure the multicast source, and the multicast source address can be accurately determined, thereby improving the success rate and efficiency of creating multicast and reducing the complexity and maintenance cost of multicast configuration; it has strong ease of use and practicality.

[0008] In a possible implementation of the first aspect, configuring the network communication address of the multicast source based on the host network card configuration, the target device address information, and the target host communication address includes:

[0009] In a case where the type of the host network card configuration is a single network card with a single static network address or a single network card with a dynamic network address, the current network address in the host network card configuration is used as the network communication address of the multicast source.

[0010] In a possible implementation of the first aspect, configuring the network communication address of the multicast source based on the host network card configuration, the target device address information, and the target host communication address includes:

[0011] When the host network card configuration type is a single network card with multiple static network addresses, the target network address in the target host communication address is used as the network communication address of the multicast source; wherein the target network address and the network address in the target device address information belong to the same subnet.

[0012] In a possible implementation of the first aspect, configuring the network communication address of the multicast source based on the host network card configuration, the target device address information, and the target host communication address includes:

[0013] When the host network card configuration type is multiple network cards, the target network card in the host network card configuration is determined according to the physical address in the target host communication address; and the current network address corresponding to the target network card is used as the network communication address of the multicast source.

[0014] In a possible implementation manner of the first aspect, after configuring the network communication address of the multicast source, the method further includes:

[0015] The network communication address of the multicast source and the network card interface corresponding to the multicast source are respectively bound to a multicast socket; the multicast socket is used to indicate the sending address of the multicast data packet.

[0016] In a possible implementation manner of the first aspect, after configuring the network communication address of the multicast source, the method further includes:

[0017] A join multicast group message is sent to a target device, where the join multicast group message is used to instruct the target device to join the device in the multicast group; wherein the target device joins the multicast group based on the multicast address.

[0018] In a possible implementation of the first aspect, the method further includes:

[0019] In the event that the network communication address of the multicast source changes, the new network communication address of the multicast source is determined according to the host network card configuration, and a new multicast address corresponding to the new multicast group is created; the new network communication address and the new multicast address are sent to the device to instruct the device to join the new multicast group based on the new multicast address.

[0020] In a possible implementation of the first aspect, the method further includes:

[0021] The multicast source sends a multicast data packet to the target device in the multicast group.

[0022] In a second aspect, the present application provides a multicast source configuration device, the device comprising:

[0023] A message transceiver unit, configured to send discovery messages by multicast and / or broadcast, and monitor response messages sent by devices based on the discovery messages;

[0024] a message parsing unit, configured to parse the device address information in the response message, and associate and store the device address information with the communication address of the host that sent the discovery message;

[0025] An information acquisition unit, configured to determine target device address information of the target device and its associated target host communication address according to the target device selected by the user based on the device list;

[0026] A multicast configuration unit, configured to configure the network communication address of the multicast source based on the host network card configuration, the target device address information, and the target host communication address;

[0027] The device list is determined based on the response message of the device, the device address information includes the target device address information, and the host communication address includes the target host communication address.

[0028] In a third aspect, the present application provides an electronic device comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements any one of the methods described in the first aspect when executing the computer program.

[0029] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the method according to any one of the first aspects is implemented.

[0030] In a fifth aspect, the present application provides a computer program product, which, when executed on a device, enables the device to execute any of the methods described in the first aspect.

[0031] It can be understood that the beneficial effects of the second to fifth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0033] Figure 1 A schematic diagram of the architecture of the multicast system provided in an embodiment of the present application;

[0034] Figure 2 A schematic diagram of the implementation flow of the multicast source configuration method provided in an embodiment of the present application;

[0035] Figure 3 A schematic diagram of the interactive process of the multicast source configuration method provided in an embodiment of the present application;

[0036] Figure 4 A schematic diagram of the structure of a multicast source configuration device provided in an embodiment of the present application;

[0037] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0038] The following embodiments of the technical solution of the present application will be described in detail with reference to the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present application and are therefore only examples and are not intended to limit the scope of protection of the present application.

[0039] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application belongs; the terms used herein are only for the purpose of describing specific embodiments and are not intended to limit this application; the terms "including" and "having" and any variations thereof in the specification and claims of this application and the above-mentioned figure descriptions are intended to cover non-exclusive inclusions.

[0040] In the description of the embodiments of this application, the technical terms "first" and "second" are used only to distinguish different objects and should not be understood to indicate or imply relative importance or implicitly specify the quantity, specific order, or primary and secondary relationship of the indicated technical features. In the description of the embodiments of this application, the meaning of "plurality" is more than two, unless otherwise clearly and specifically defined.

[0041] References herein to "embodiments" mean that a particular feature, structure, or characteristic described in connection with the embodiments may be included in at least one embodiment of the present application. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor does it constitute an independent or alternative embodiment that is mutually exclusive of other embodiments. It is understood, both explicitly and implicitly, by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0042] In the description of the embodiments of this application, the term "and / or" is simply a description of the association relationship between associated objects, indicating that three relationships can exist. For example, A and / or B can represent the following three situations: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the character " / " in this document generally indicates that the associated objects are in an "or" relationship.

[0043] Traditional broadcast systems suffer from short transmission distances, poor sound quality, complex maintenance, and poor interactivity. Multicast-based network broadcast systems allow data packets to be sent to multiple specific destination nodes on the network without having to transmit them individually, significantly improving data transmission efficiency by reducing redundant data in the network. Multicast technology conserves bandwidth resources and makes data transmission more efficient, making it widely used for broadcast announcements in education, businesses, stores, and public places.

[0044] However, in related technologies, the configuration and maintenance costs of broadcast systems are high, requiring users to manually configure multicast and set up various communication items, resulting in high user costs. In addition, current computer hosts typically use dynamic Internet Protocol (IP) addresses. When the host IP address changes, the server IP also needs to change accordingly, requiring the broadcast system's multicast to be reconfigured. Moreover, when creating a multicast, insufficient network information is obtained, resulting in device management defects when the computer host has multiple network cards or multiple IP addresses. For hosts with multiple network cards, when modifying the device IP address, modifying the Layer 2 message may result in modification failures. When setting up a multicast environment, insufficient network information is obtained, making it impossible to accurately configure the multicast source, resulting in multicast creation failures.

[0045] In response to the above technical problems, an embodiment of the present application provides a multicast source configuration method, which obtains the device address information of the device and the host communication address associated with the device by sending a discovery message and listening to the response message of the device. When creating a multicast group based on the target device selected by the user, the multicast source is automatically configured based on the device address information of the target device and the host communication address associated with it, as well as the host network card configuration; by integrating network information from multiple parties, the multicast source can be accurately and efficiently configured, reducing the complexity of the multicast configuration and the maintenance cost.

[0046] The following describes the architecture of a multicast system implemented based on multicast technology provided in an embodiment of the present application.

[0047] See Figure 1 , Figure 1 This is a schematic diagram of the architecture of the multicast system provided in the embodiment of the present application. Figure 1 As shown, the multicast system includes a multicast source, routers R1, R2, R3, and devices A, B, C, and D.

[0048] The multicast source is connected to router R1, which is connected to routers R2 and R3, respectively. Router R2 is connected to devices A and B, respectively. Router R3 is connected to devices C and D. The devices in the created multicast group may only include devices A, C, and D.

[0049] For example, the multicast source sends a data packet (ie, multicast traffic) to router R1, router R1 distributes the data packet to routers R2 and R3, router R2 forwards the data packet to device A, and router R3 forwards the data packet to devices C and D, completing the multicast of the data packet.

[0050] Exemplarily, a multicast source, acting as the source of multicast traffic, has its network interface enabled with multicast functionality and a multicast address configured to send multicast traffic. The multicast address is a Class D IP address, i.e., an address used to create a multicast group. For example, the multicast address range is 224.0.0.0 to 239.255.255.255. During multicast source configuration, the multicast address is first determined, and an address within the aforementioned range is selected as the multicast address. Routers and devices are then notified to join the multicast address, creating a multicast group and identifying the multicast group using the configured multicast address.

[0051] In some embodiments, the multicast source sends multicast data packets to the device based on the router in the multicast group; wherein the router is set up in the form of a multicast distribution tree, and the network interface of the device is configured as an interface for monitoring and receiving multicast data packets of the multicast address.

[0052] For example, routers configured with a multicast distribution tree structure form a path for multicast traffic to be transmitted in the network; in the process of building the multicast distribution tree, information exchange and routing tables between each router are updated, and the router forwards the data packet to the corresponding multicast receiver (i.e., device) based on the routing table.

[0053] For example, device A, device C, and device D act as multicast receivers, receiving data packets sent by the multicast source and forwarded by the router; the network interfaces of device A, device C, and device D enable the multicast monitoring function, specify the multicast address to be received, and are configured to receive multicast traffic from the multicast address.

[0054] It should be noted that the above-mentioned multicast distribution tree architecture is only an example, and other forms of structures can also be set based on actual application scenarios and traffic loads; the number of devices connected to each router is also only an example; the devices joining the multicast group can be set based on user selection, and can also be determined based on the historical records of the multicast group.

[0055] Based on the above architecture, the process of configuring a multicast source is described below through an embodiment.

[0056] See Figure 2 , Figure 2 The implementation flow diagram of the multicast source configuration method provided in the embodiment of the present application is as follows. The execution subject of the method can be Figure 1 The multicast source shown in ; Figure 2 As shown, the method may include the following steps:

[0057] S201: Send a discovery message by multicasting and / or broadcasting, and monitor a response message sent by a device according to the discovery message.

[0058] In some embodiments, multicast is used as a network communication method to send data packets to a specific group of devices (such as devices in a multicast group); broadcast is used as a network communication method to send data packets to all devices in the network. Temporary detection of devices is performed by multicast and / or broadcast to obtain device information based on response messages, and then a formal multicast group is created based on the response messages; for example, when sending a discovery message by multicast, the terminal can try to send a discovery message by traversing multiple network cards or IP addresses until a response message is received; or, when the devices are in the same local subnet, a discovery message is sent to the entire subnet by broadcast to obtain a response message returned by the device; or, in a hybrid network, discovery messages are sent by multicast and broadcast at the same time, so that more devices can be covered, and device information can be obtained based on one of the response messages corresponding to multicast or broadcast, and a formal multicast group can be further created.

[0059] For example, during the configuration of a multicast source, the host of the multicast source (hereinafter referred to as a terminal) can send a discovery message via multicast or broadcast. The discovery message can be a probe data packet used to discover other devices on the network. Through multicast or broadcast, the discovery message can be sent to multiple potential target devices simultaneously. The discovery message can contain key information for device discovery, such as a protocol identifier, a device type identifier, and a query request.

[0060] Exemplarily, a broadcast device management system is running on the terminal, which provides an operation interface based on the broadcast device management system and receives device discovery requests triggered by users through the operation interface. For example, a device discovery control is set on the operation interface, and the device discovery request input by the user by clicking the control is received; based on the device discovery request, the broadcast device management system triggers the device detection process by calling the system's application programming interface (API). The broadcast device management system adds protocol-related identification information, device information, and query parameters to the discovery message based on the discovery protocol used (such as ipcd, onvif, etc.), and combines and encapsulates the above information according to the message format specified by the selected protocol to ensure that the discovery message is in the correct format and can be correctly parsed and processed by devices in the network.

[0061] The discovery message may include information such as the sender's identifier and message type. After sending a discovery message, the terminal listens for response messages from other devices. After receiving the discovery message, the device returns a response message to the terminal based on the information contained in the discovery message. This response message may include device information such as the device identifier and communication address. Multiple devices can return a response message, and the format of the response message follows the same protocol as the discovery message, such as IPCD or ONVIF.

[0062] S202: parse the device address information in the response message, and associate the device address information with the communication address of the host that sent the discovery message and store them.

[0063] In some embodiments, after the terminal receives the response message, the broadcast device management system can obtain the response message through the system API and parse out the device information, such as device address information, device identification information, etc.

[0064] Exemplarily, the device address information may include the device's media access control address (MAC) (device MAC for short) and IP address (device IP for short); the device MAC is a unique identifier used by the device at the data link layer, which is used to uniquely identify a device in the network; the device IP is the address used by the device at the network layer, which is used to locate and identify the device in the network to enable communication between devices.

[0065] For example, the terminal extracts the device address information of each device by parsing the response message. When sending a discovery message, the terminal carries its own communication address (such as the host IP address, host MAC address, etc.) as the sender identifier of the discovery message. The terminal associates the extracted device address information of each device with the host communication address used when sending the discovery message and stores it in advance. This allows for convenient, rapid, and accurate device identification and management based on the device address information.

[0066] For example, the broadcast device management system may also record the network card used when sending the discovery message and the network card's IP address, thereby establishing and storing an association between the device address information (e.g., device MAC address, device IP address) and the host communication address (e.g., network card MAC address, network card IP address). The association between the device address information and the host communication address may be recorded using a database, configuration file, or other data structure; for example, a structure may be created to store the association information between the two.

[0067] S203: Determine the target device address information and the associated target host communication address of the target device according to the target device selected by the user based on the device list, wherein the device list is determined based on the response message of the device, the device address information includes the target device address information, and the host communication address includes the target host communication address.

[0068] In some embodiments, the broadcast device management system generates an available device list based on the stored device information and displays the device list on the display interface; the device list can display the information of each device through the device identifier, such as Figure 1 The terminal receives a selection signal input by the user based on the device list and determines the target device selected by the user, such as Figure 1 Device A, device C, and device D are shown in FIG.

[0069] Exemplarily, after determining the target device, the terminal searches the memory for the target host communication address associated with the target device based on the target device address information of the target device. For example, based on the device MAC, the device IP, the host's network card MAC, and the network card IP are determined.

[0070] S204: Based on the host network card configuration, the target device address information, and the target host communication address, configure the network communication address of the multicast source.

[0071] In some embodiments, the network communication address of the multicast source is configured based on the type of host network card configuration and its specific configuration information, the target device address information, and the target host communication address. The host network card configuration type may include single network card single static IP, single network card multiple static IPs, single network card dynamic IP, multiple network cards, or any combination of these types.

[0072] For example, the broadcast equipment management system in the terminal can obtain the host network card configuration through the system API interface. The host network card configuration may include information such as the network card MAC, the network card IP address list, and the mask. Based on this information, the type of the host network card configuration can be determined. For example, when a network card MAC is obtained and there is only one IP address, it means that the host network card configuration type is a single network card with a single IP address; if the pre-stored IP address is different from the current IP address, it means that the host network card configuration type is a single network card with a dynamic IP address; if the IP address list includes multiple IP addresses, it means that the host network card configuration type is a single network card with multiple static IP addresses.

[0073] For example, when the host network card configuration type is a single network card with multiple static IPs, the network communication address of the multicast source is configured based on the target host communication address queried from the target device address information; for example, the network card IP address in the target host communication address is used as the network communication address of the multicast source, that is, the multicast source IP address.

[0074] Correspondingly, for other types except single network card multiple static IPs, the network card MAC in the target host communication address is determined based on the target device address information, and the current IP address corresponding to the network card (that is, the current actual IP address of the network card) is selected as the multicast source IP address.

[0075] In some embodiments, configuring the network communication address of the multicast source based on the host network card configuration, the target device address information, and the target host communication address includes:

[0076] When the host network card configuration type is a single network card with a single static network address or a single network card with a dynamic network address, the current network address in the host network card configuration is used as the network communication address of the multicast source.

[0077] For example, when the host network card configuration type is a single network card single static network address (such as a single network card single static IP) or a single network card dynamic network address (such as a single network card dynamic IP), the type is a single network card single static IP, the IP address remains unchanged, and the multicast source IP is configured as the current network address of the network card, that is, the current IP of the network card; for a single network card dynamic IP, the IP address may have changed, then the multicast source IP is configured as the current network address of the network card, that is, the current IP of the network card.

[0078] Alternatively, when the host network card configuration type is single network card multiple static network addresses, the target network address in the target host communication address is used as the network communication address of the multicast source; wherein the target network address and the network address in the target device address information belong to the same subnet.

[0079] For example, for a single network card with multiple static IP addresses, the network communication address of the multicast source can also be configured based on the network segment the device is located in. For example, if network card eth0 is configured with two static IP addresses: 192.168.1.10 and 10.0.0.50, and if the device IP in the target device address information is 192.168.1.11, then 192.168.1.10 of the two static IP addresses is used as the target network address (i.e., the IP address in the same subnet) and is configured as the multicast source IP. If the device IP in the target device address information is 10.0.0.100, then 10.0.0.50 of the two static IP addresses is used as the target network address and is configured as the multicast source IP.

[0080] Alternatively, when the host network card configuration type is multiple network cards, the target network card in the host network card configuration is determined according to the physical address in the target host communication address; and the current network address corresponding to the target network card is used as the network communication address of the multicast source.

[0081] Exemplarily, the physical address in the target host communication address can be the network card MAC address; when the host network card configuration type is multiple network cards, the network card used to send the discovery message can be determined based on the network card MAC in the target host communication address, and then the current network address of the network card (such as the current IP address) can be selected as the network communication address of the multicast source.

[0082] For example, after determining the network card to be used, the multicast source network communication address can be configured based on the number and type of IP addresses configured for the network card, using the same implementation principles as described above. For example, if the network card is configured with a single IP or a dynamic IP, the current IP address of the network card is used as the multicast source IP. For another example, if the network card is configured with multiple static IP addresses, an IP address belonging to the same subnet as the network address in the target device address information is selected as the multicast source IP.

[0083] In some embodiments, after configuring the network communication address of the multicast source, the method further includes:

[0084] The network communication address of the multicast source and the network card interface corresponding to the multicast source are respectively bound to the multicast socket; the multicast socket is used to indicate the sending address of the multicast data packet.

[0085] For example, a multicast socket is a programming interface for network communication provided by the operating system. It is an abstract representation of an endpoint in network communication, allowing applications to send and receive data over the network and enabling data packets to be transmitted between applications on different hosts. After configuring the multicast source IP address, the multicast source IP address is associated with the network communication socket (or network interface) to ensure that multicast data packets are sent from the specified multicast source IP address.

[0086] Exemplarily, the broadcast equipment management system creates a socket for network communication by calling a function to create a socket, and binds it to the multicast source IP. For example, the socket is bound to the multicast source IP address and the network card interface respectively through the binding function bind(), and the multicast parameters are configured. The network interface or IP of the multicast traffic is specified through the multicast parameters to ensure that the multicast data packets can be correctly sent to each device in the multicast group, thereby realizing accurate multicast communication.

[0087] In some embodiments, after monitoring the response message sent by the device, the method further includes: setting a multicast address of the multicast source, where the multicast address is used to indicate a multicast group for multicast communication.

[0088] Accordingly, after configuring the network communication address of the multicast source, the method further includes: sending a join multicast group message to the target device, the join multicast group message is used to instruct the target device to join the multicast group; wherein the target device joins the multicast group based on the multicast address.

[0089] For example, in the process of creating a multicast group, the multicast address of the multicast source is set based on the Class D IP address; and after configuring the network communication address of the multicast source, a join multicast group message is sent to the router based on the Internet Group Management Protocol (IGMP). The join multicast group message may include the identifier of the device joining the multicast group, thereby notifying the router of the target devices joining the multicast group, such as device A, device C, and device D. IGMP is a protocol used between hosts and routers to manage multicast group membership. The host sends a Membership Report message to the router to inform the router of the devices joining the multicast group. The router then maintains the device information in the multicast group based on this information and forwards multicast traffic to the devices in the multicast group based on the device information. Figure 1 The data flow is indicated by the arrow in the figure; the router is used to receive multicast data packets sent by the multicast source and distribute the multicast data packets to the devices that join the multicast group; the router is set up in the form of a multicast distribution tree, and the network interface of the target device is configured as an interface that listens for and receives multicast data packets from the multicast address.

[0090] For example, Figure 1 In the architecture shown, devices join a multicast group based on the IGMP protocol. For example, device A sends an IGMP Membership Report message to its directly connected router (R2), indicating its desire to join multicast group 239.0.0.1 (multicast address). Devices C and D then send the same IGMP message to their directly connected router (R3) to join the multicast group.

[0091] Accordingly, after receiving the IGMP message, routers R2 and R3 mark the downstream interface (ie, the interface of the connected device) of the multicast group in the local routing table and initiate a multicast path request to the upstream router (R1).

[0092] For example, routers interact with each other based on the PIM protocol to establish a multicast path. For example, using the PIM-SM protocol to build a multicast tree, R2 sends a Join message to R1, requesting to join the path to multicast group 239.0.0.1. R3 sends the same Join message to R1. After receiving the Join messages from R2 and R3, R1 discovers that it is the direct next hop of multicast source S and therefore forwards the multicast traffic to R2 and R3.

[0093] In the router, a multicast routing table (usually referred to as Multicast Routing Table or Mrib) records and updates the forwarding path of the multicast stream.

[0094] For example, R1's multicast routing table is:

[0095] (*, 239.0.0.1) → Next hop: empty (local interface Eth2 is directly connected to the multicast source) → RPF interface: Eth2;

[0096] (S, 239.0.0.1) → Next hop: R2 (interface Eth0) and R3 (interface Eth1): → RPF interface: Eth2;

[0097] R2's multicast routing table is:

[0098] (*, 239.0.0.1) → Next hop: R1 (interface Eth0) → RPF interface: Eth0;

[0099] (S, 239.0.0.1) → Next hop: local interface Eth1 (pointing to the subnet of device A) → RPF interface: Eth0;

[0100] R3's multicast routing table is:

[0101] (*, 239.0.0.1) → Next hop: R1 (interface Eth0) → RPF interface: Eth0;

[0102] (S, 239.0.0.1) → Next hop: Local interface Eth1 (pointing to the subnet of device C / D) → RPF interface: Eth0.

[0103] The Reverse Path Forwarding Interface (RPF) is a key interface used for reverse path forwarding checks in multicast routing. RPF checks ensure that multicast packets arrive along the reverse unicast path (the shortest path from the source to the router), preventing the same packet from arriving repeatedly through multiple paths and thus preventing loops. If the interface a packet enters matches the RPF interface, the path is considered correct and forwarding is allowed. Otherwise, the packet is discarded.

[0104] For example, the multicast traffic forwarding process includes the following steps:

[0105] The multicast source sends a multicast packet:

[0106] The multicast source sends the data packet to the multicast group address 239.0.0.1;

[0107] The data packet first arrives at R1 (e.g. Figure 1 The multicast source shown is directly connected to R1);

[0108] R1 forwards the packet:

[0109] R1 checks the multicast routing table and finds that the next hops for (S,239.0.0.1) are R2 and R3.

[0110] R1 copies the data packet and forwards it to R2 (Eth0 interface) and R3 (Eth1 interface).

[0111] R2 forwards the packet:

[0112] After receiving the data packet, R2 checks the multicast routing table and finds that the next hop for (S, 239.0.0.1) is the local interface (which forwards it directly to device A).

[0113] R2 forwards the data packet through the interface connected to device A;

[0114] R3 forwards the packet:

[0115] R3 operates similarly to R2 and forwards the data packet to devices C and D.

[0116] Accordingly, after the device successfully joins the multicast group, it will also send a joining result to the broadcast device management system via the Internet Group Management Protocol to determine whether the device has successfully joined the multicast group.

[0117] In some embodiments, the method further includes: when the network communication address of the multicast source changes, determining the new network communication address of the multicast source according to the host network card configuration, and creating a new multicast address corresponding to the new multicast group; sending the new network communication address and the new multicast address to the device to instruct the device to join the new multicast group based on the new multicast address.

[0118] For example, if the terminal's host network card is configured for a dynamic IP, changes to the dynamic IP address may invalidate the IP address configured for the multicast source. For static IP scenarios, users may also manually modify the IP address, causing the multicast source IP address to become invalid. The broadcast device management system can automatically detect changes in the host network card configuration. If the multicast source IP address becomes invalid due to a change in the host network card's IP address (for example, the device cannot receive audio), the broadcast device management system will re-determine the optimal multicast source IP address based on the host network card configuration to ensure service continuity and reliability.

[0119] For example, by evaluating the network performance (such as network connectivity) corresponding to different IP addresses in the host network card configuration, the optimal IP address can be selected as the new IP address of the multicast source. At the same time, a new multicast address can be set based on the Class D IP address; the new network communication address and the new multicast address are sent to the device to instruct the device to join a new multicast group based on the new multicast address, triggering the device to automatically reconnect without manual intervention, so that users do not perceive service interruption and the broadcast service can continue to operate.

[0120] In an embodiment of the present application, when the IP address configured by the host network card changes, resulting in a change in the multicast source IP address, the optimal multicast source IP address can be automatically selected to ensure seamless recovery and efficient operation of the service.

[0121] like Figure 3 As shown in FIG. 1 , a schematic diagram of an interaction process of a multicast source configuration method provided in an embodiment of the present application is based on the same implementation principle as the above embodiment and is not repeated here. The interaction process may include the following steps:

[0122] 1. The broadcast device management system receives the device discovery request initiated by the user on the real interface.

[0123] 2. The broadcast equipment management system triggers the equipment detection process by calling the system API.

[0124] 3. The terminal host sends a discovery message to the device using the broadcast / multicast protocol.

[0125] 4. The device returns a response message containing device information to the host.

[0126] 5. The host uploads the device information to the broadcast device management system and stores it in the system memory.

[0127] 6. The broadcast equipment management system displays a list of equipment on the interface based on the equipment information.

[0128] 7. The broadcast device management system receives the target device selected based on the device list and starts broadcasting.

[0129] 8. Associate the pre-stored network address with the target device.

[0130] 9. The broadcast equipment management system obtains the host's network card configuration information (i.e., host network card configuration) based on the system API.

[0131] 10. The host returns the network card configuration information to the broadcast equipment management system.

[0132] 11. The broadcast device management system intelligently selects and configures the multicast source IP based on the type of host network card configuration.

[0133] 12. In one case, for a single network card with multiple static IP addresses, use the pre-stored IP address.

[0134] 13. In another case, for other scenarios, use the current IP address of the network card.

[0135] 14. The broadcast device management system establishes a multicast session with the host and binds the host's network interface to the multicast source IP.

[0136] 15. The broadcast device management system sends a join instruction to the device, instructing the device to join the multicast group.

[0137] 16. The device joins the multicast group and notifies the host of the joining result.

[0138] 17. The broadcast equipment management system pushes data streams to the host.

[0139] 18. The host acts as a multicast source to distribute data streams through multicast.

[0140] 19. After receiving the data stream, the device starts to broadcast and output the data stream.

[0141] The embodiment of the present application can be applied to an audio broadcasting system. The broadcasting equipment management system in the entire audio broadcasting system pushes audio data to the host. The host distributes the audio data through multicast as a multicast source. After the device receives the audio data, it broadcasts it to the outside. Through broadcasting or multicasting discovery messages, a response message is obtained, and the communication address information of the host that sends the discovery message is recorded. At the same time, the device address information is obtained based on the response message, which enhances the integrity of the obtained device information. Not only the device identification is obtained, but also the network attribute information of the device, such as the device communication address, so that the system can quickly locate the device based on the complete network attribute information and manage and maintain the device. When the multicast source IP address changes, the broadcasting equipment management system can automatically select the optimal multicast source address without the user understanding the details of the multicast configuration. The new IP address is automatically configured through internal system decision-making to ensure service continuity and user non-perception. The multicast source configuration method provided by the embodiment of the present application is compatible with complex network scenarios. For example, for scenarios such as multiple network cards and dynamic IP, it can realize the configuration of automated multicast sources, improve the convenience, efficiency and accuracy of multicast source configuration, and reduce the complexity of configuration.

[0142] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0143] Corresponding to the multicast source configuration method provided in the above embodiment, Figure 4 As shown, this is a structural diagram of the multicast source configuration device provided in an embodiment of the present application. For the sake of convenience, only the parts related to the embodiment of the present application are shown.

[0144] The multicast source configuration device includes:

[0145] A message transceiver unit 41 is configured to send a discovery message by multicast and / or broadcast, and to monitor a response message sent by a device according to the discovery message;

[0146] a message parsing unit 42, configured to parse the device address information in the response message, and associate and store the device address information with the communication address of the host that sent the discovery message;

[0147] An information acquisition unit 43 is configured to determine target device address information of the target device and its associated target host communication address according to the target device selected by the user based on the device list;

[0148] A multicast configuration unit 44 is configured to configure a network communication address of a multicast source based on a host network card configuration, target device address information, and the target host communication address;

[0149] The device list is determined based on the response message of the device, the device address information includes the target device address information, and the host communication address includes the target host communication address.

[0150] In a possible implementation, the multicast configuration unit 44 is further configured to use the current network address in the host network card configuration as the network communication address of the multicast source when the host network card configuration type is a single network card single static network address or a single network card dynamic network address.

[0151] In one possible implementation, the multicast configuration unit 44 is also used to use the target network address in the target host communication address as the network communication address of the multicast source when the host network card configuration type is a single network card with multiple static network addresses; wherein the target network address and the network address in the target device address information belong to the same subnet.

[0152] In one possible implementation, the multicast configuration unit 44 is also used to determine the target network card in the host network card configuration according to the physical address in the target host communication address when the host network card configuration type is multiple network cards; and use the current network address corresponding to the target network card as the network communication address of the multicast source.

[0153] In a possible implementation, the multicast configuration unit 44 is further configured to bind the network communication address of the multicast source and the network card interface corresponding to the multicast source to a multicast socket respectively; the multicast socket is used to indicate the sending address of the multicast data packet.

[0154] In one possible implementation, the multicast configuration unit 44 is further configured to set a multicast address of a multicast source, where the multicast address is used to indicate a multicast group for performing multicast communication; accordingly, the multicast configuration unit 44 is further configured to send a join multicast group message to a target device, where the join multicast group message is used to instruct the target device to join the multicast group; wherein the target device joins the multicast group based on the multicast address.

[0155] In one possible implementation, the multicast configuration unit 44 is further used to determine the new network communication address of the multicast source according to the host network card configuration and create a new multicast address corresponding to the new multicast group when the network communication address of the multicast source changes; and send the new network communication address and the new multicast address to the device to instruct the device to join the new multicast group based on the new multicast address.

[0156] In a possible implementation, the apparatus further includes a sending unit configured to send a multicast data packet to the target device in the multicast group.

[0157] Figure 5 A schematic diagram of the hardware structure of the electronic device 5 is shown.

[0158] like Figure 5 As shown, the electronic device 5 of this embodiment includes: at least one processor 51 ( Figure 5 Only one is shown), a memory 52, wherein the memory 52 stores a computer program 53 that can be run on the processor 51. When the processor 51 executes the computer program 53, the steps in the above method embodiment are implemented, for example Figure 2 Alternatively, the processor 51 implements the functions of the modules / units in the above-mentioned device embodiments when executing the computer program 53. The electronic device 5 may be the cloud server in the above-mentioned embodiment.

[0159] It should be understood that the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the electronic device 5. In other embodiments of the present application, the electronic device 5 may include more or fewer components than shown, or may combine or separate certain components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0160] The electronic device 5 may include, but is not limited to, a processor 51 and a memory 52. Those skilled in the art will appreciate that Figure 5 It is only an example of the electronic device 5 and does not constitute a limitation of the electronic device 5. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the server may also include an input sending device, a network access device, a bus, etc.

[0161] The processor 51 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor.

[0162] The processor 51 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 51 is a cache memory. This memory can store instructions or data that the processor 51 has just used or is reusing. If the processor 51 needs to use the instruction or data again, it can directly call it from the memory. This avoids repeated accesses, reduces the processor 51's waiting time, and thus improves system efficiency.

[0163] In some embodiments, the memory 52 may be an internal storage unit of the electronic device 5, such as a hard drive or memory of the electronic device 5. The memory 52 may also be an external storage device of the electronic device 5, such as a plug-in hard drive, a Smart Media Card (SMC), a Secure Digital (SD) card, a flash memory card, etc. equipped on the electronic device 5. Furthermore, the memory 52 may include both an internal storage unit of the electronic device 5 and an external storage device. The memory 52 is used to store an operating system, application programs, a boot loader, data, and other programs, such as the program code of a computer program. The memory 52 may also be used to temporarily store data that has been sent or is about to be sent.

[0164] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0165] It should be noted that the structure of the above-mentioned electronic device is only illustrative, and based on different application scenarios, it may also include other physical structures, and the physical structure of the electronic device is not limited here.

[0166] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant description of other embodiments.

[0167] An embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it can implement the steps in the above-mentioned various method embodiments.

[0168] An embodiment of the present application provides a computer program product. When the computer program product runs on a server, the server can implement the steps in the above-mentioned method embodiments when executing the computer program product.

[0169] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the process in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form, etc. Computer-readable media may include: any entity or device that can carry computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc.

[0170] The electronic device, computer storage medium, and computer program product provided in the above-mentioned embodiments of the present application are all used to execute the methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects corresponding to the methods provided above, and will not be repeated here.

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

[0172] It should be understood that the above is only to help those skilled in the art better understand the embodiments of the present application, and is not intended to limit the scope of the embodiments of the present application. Based on the above examples given, those skilled in the art can obviously make various equivalent modifications or changes. For example, certain steps in each embodiment of the above detection method may be unnecessary, or certain new steps may be added. Or a combination of any two or any multiple embodiments described above. Such modifications, changes, or combined solutions also fall within the scope of the embodiments of the present application.

[0173] It should also be understood that the division of the modes, situations, categories and embodiments in the embodiments of the present application is only for the convenience of description and should not constitute a special limitation. The features of various modes, categories, situations and embodiments can be combined without contradiction.

[0174] It should also be understood that in the various embodiments of the present application, unless otherwise specified or there is a logical conflict, the terms and / or descriptions between different embodiments are consistent and can be referenced to each other, and the technical features in different embodiments can be combined to form new embodiments according to their internal logical relationships.

[0175] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0176] In the embodiments provided in this application, it should be understood that the disclosed devices / network equipment and methods can be implemented in other ways. For example, the device / network equipment embodiments described above are merely illustrative. For example, the division of the modules or units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0177] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.

[0178] The above-described embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present application, and should all be included in the scope of protection of the present application.

[0179] Finally, it should be noted that the above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.

Claims

1. A multicast source configuration method, characterized in that: The method comprises: Sending discovery messages by multicast and / or broadcast, and monitoring response messages sent by devices based on the discovery messages; Parsing the device address information in the response message, and associating the device address information with the communication address of the host that sent the discovery message and storing the information; Determine, according to the target device selected by the user based on the device list, target device address information of the target device and its associated target host communication address; Configuring the network communication address of the multicast source based on the host network card configuration, the target device address information, and the target host communication address; The device list is determined based on the response message of the device, the device address information includes the target device address information, and the host communication address includes the target host communication address.

2. The method according to claim 1, characterized in that The configuring the network communication address of the multicast source based on the host network card configuration, the target device address information, and the target host communication address includes: In a case where the type of the host network card configuration is a single network card with a single static network address or a single network card with a dynamic network address, the current network address in the host network card configuration is used as the network communication address of the multicast source.

3. The method according to claim 1, characterized in that The configuring the network communication address of the multicast source based on the host network card configuration, the target device address information, and the target host communication address includes: In a case where the type of the host network card configuration is a single network card with multiple static network addresses, using the target network address in the target host communication address as the network communication address of the multicast source; The target network address and the network address in the target device address information belong to the same subnet.

4. The method according to claim 1, wherein The configuring the network communication address of the multicast source based on the host network card configuration, the target device address information, and the target host communication address includes: In a case where the host network card configuration type is multiple network cards, determining a target network card in the host network card configuration according to the physical address in the target host communication address; The current network address corresponding to the target network card is used as the network communication address of the multicast source.

5. The method according to claim 1, wherein After configuring the network communication address of the multicast source, the method further includes: The network communication address of the multicast source and the network card interface corresponding to the multicast source are respectively bound to a multicast socket; the multicast socket is used to indicate the sending address of the multicast data packet.

6. The method according to claim 1, characterized in that After configuring the network communication address of the multicast source, the method further includes: Sending a join multicast group message to the target device, where the join multicast group message is used to instruct the target device to join the multicast group; The target device joins the multicast group based on the multicast address.

7. The method according to any one of claims 1 to 6, characterized in that The method further comprises: In the event that the network communication address of the multicast source changes, determining a new network communication address of the multicast source according to the host network card configuration, and creating a new multicast address corresponding to a new multicast group; The new network communication address and the new multicast address are sent to the device to instruct the device to join the new multicast group based on the new multicast address.

8. The method according to any one of claims 1 to 6, characterized in that The method further comprises: The multicast source sends a multicast data packet to the target device in the multicast group.

9. An electronic device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the method according to any one of claims 1 to 8 is implemented.

10. A computer program product, characterized in that When the computer program product is run on a device, the device is caused to execute the method according to any one of claims 1 to 8.