Terminal auto-discovery method, forwarding device, and readable storage medium

By converting packet identification between the first LAN and the second LAN, the terminal self-discovery of cross-LAN is realized, solving the problem of local discovery within the LAN and improving the system's automatic discovery capability and reliability.

WO2025180205A1PCT designated stage Publication Date: 2025-09-04HUAWEI TECH CO LTD

Patent Information

Application Number
PCT/CN2025/076747
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-02-28
Filing Date
2025-02-11
Publication Date
2025-09-04

AI Technical Summary

Technical Problem

The existing self-discovery technology can only realize terminal discovery within the local area network, and cannot discover terminals in other local area networks across the local area network, and cannot meet development needs.

Method used

Through the forwarding device, the terminal message in the first LAN is copied and replaced with the LAN identifier, the message suitable for the second LAN is generated, and multicast is performed in the second LAN, so that the terminal in the second LAN discovers the terminal in the first LAN, and realizes cross-local network self-discovery.

Benefits of technology

It is realized that the terminal in the first LAN can automatically discover the terminal in the second LAN, simplify the configuration process, and improve the reliability and flexibility of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025076747_04092025_PF_FP_ABST
    Figure CN2025076747_04092025_PF_FP_ABST
Patent Text Reader

Abstract

The present application provides a terminal auto-discovery method, a forwarding device, and a readable storage medium. The method comprises: receiving a first message sent by a first terminal, wherein the first terminal is in a first local area network, the first message comprises an identifier of the first local area network and an Internet Protocol (IP) address of the first terminal, and the first terminal needs to be able to support auto-discovery in a second local area network; multicasting a second message in the second local area network, wherein the second message comprises an identifier of the second local area network and the IP address of the first terminal; and receiving a response message sent by a second terminal, wherein the second terminal is in the second local area network, and a destination IP address of the response message is the IP address of the first terminal. The method enables terminal auto-discovery across local area networks, that is, the first terminal in the first local area network can discover the second terminal in the second local area network by using auto-discovery technology.
Need to check novelty before this filing date? Find Prior Art

Description

Terminal self-discovery method, forwarding device, and readable storage medium

[0001] This application claims priority to Chinese patent application No. 202410226643.1 filed on February 28, 2024, entitled “Terminal self-discovery method, forwarding device and readable storage medium”, the entire contents of which are incorporated by reference into this application. Technical Field

[0002] The present application relates to the field of data communications, and in particular to a terminal self-discovery method, a forwarding device, and a readable storage medium. Background Art

[0003] Self-discovery refers to the ability of a terminal to automatically discover other terminals. This technology allows a terminal to automatically identify the presence of another terminal on the network and establish a communication connection with it, simplifying the configuration process, reducing manual intervention, and improving system reliability and flexibility.

[0004] The proprietary protocols in current self-discovery technologies only support multicasting within a local area network (LAN). This means that a first terminal in a first LAN can only discover another terminal in the first LAN through self-discovery, but cannot discover a second terminal in a second LAN. Therefore, this technology cannot meet development needs. Summary of the Invention

[0005] The present application provides a terminal self-discovery method, a forwarding device, and a readable storage medium, which can realize terminal self-discovery across local area networks, that is, a first terminal in a first local area network can discover a second terminal in a second local area network through self-discovery technology.

[0006] In a first aspect, a terminal self-discovery method is provided. The terminal self-discovery system includes: a forwarding device, a first terminal, and a second terminal. The first terminal is located in a first local area network, and the second terminal is located in a second local area network. The first terminal needs to be able to be self-discovered in both the first local area network and the second local area network. The method includes:

[0007] The first terminal sends a first message to the forwarding device. Correspondingly, the forwarding device receives the first message sent by the first terminal. The first message is a message using a private self-discovery protocol and includes an identifier of the first local area network and an Internet Protocol (IP) address of the first terminal.

[0008] The forwarding device generates a second message based on the first message, wherein the second message includes an identifier of the second local area network and an IP address of the first terminal.

[0009] The forwarding device multicasts a third message in the first local area network, wherein the third message includes an identifier of the first local area network and an IP address of the first terminal.

[0010] The forwarding device multicasts the second message in the second local area network, and the second terminal receives the second message multicast by the forwarding device.

[0011] The second terminal sends a response message to the forwarding device based on the second message. Correspondingly, the forwarding device receives the response message sent by the second terminal. The destination IP address of the response message is the IP address of the first terminal.

[0012] In the above scheme, after receiving the first message sent by the first terminal, the forwarding device will generate a second message that can be multicast in the second local area network based on the first message, and multicast the second message in the second local area network, so that the second terminal in the second local area network can discover the first terminal in the first local area network, and thus establish a connection with the first terminal.

[0013] In some possible designs, the self-discovery protocol instructs the first message to be multicast within the scope of the first local area network.

[0014] In some possible designs, the forwarding device generates the second message according to the first message in the following manner:

[0015] The forwarding device copies the first message to obtain a copied message, and then replaces the identifier of the first local area network in the copied message with the identifier of the second local area network to obtain the second message.

[0016] In the above solution, the forwarding device first copies the first message to obtain a copied message, and then generates a second message based on the copied message. Therefore, the retained first message can continue to be multicast in the first local area network, expanding the scope of the multicast.

[0017] In some possible designs, the first message also includes a destination IP address and a destination port number, and the identifier of the first local area network in the copied message is replaced with the identifier of the second local area network to obtain the second message. The method further includes:

[0018] The forwarding device determines, based on at least one of the destination IP address and the destination port number, that the first message is a message using a private self-discovery protocol.

[0019] The forwarding device determines the identifier of the second local area network based on the IP address and configuration information of the first terminal. The configuration information may include two implementation methods:

[0020] In the first manner, the configuration information includes the correspondence between the IP address of the first terminal and the identifier of the second local area network. In this case, the configuration information clearly indicates that the first terminal needs to perform multicast in the second local area network, and it is assumed that the first terminal needs to perform multicast in the first local area network.

[0021] In the second mode, the configuration information includes a correspondence between the IP address of the first terminal and the identifier of the first local area network and the identifier of the second local area network. In this case, the configuration information clearly indicates that the first terminal needs to perform multicast in the first local area network and the second local area network.

[0022] In the above scheme, at least one of the destination IP address and the destination port number can be used to quickly determine that the first message is a private self-discovery protocol message, and then according to the configuration information, it is determined that the first message needs to be multicast in the second local area network, thereby conveniently and quickly confirming which messages need to be multicast across local area networks.

[0023] In some possible designs, the private self-discovery protocol includes any one of the Simple Service Discovery Protocol, the Constrained Application Protocol, the Multicast Domain Name System, the Service Location Protocol, and the World Wide Web Service Discovery Protocol.

[0024] In some possible designs, the response message is a unicast message.

[0025] In some possible designs, the forwarding device is a convergence switch or a gateway. When the forwarding device is a convergence switch, cross-LAN self-discovery of the Layer 2 network can be achieved. When the forwarding device is a gateway, cross-LAN self-discovery of the Layer 3 network can be achieved.

[0026] In a second aspect, a forwarding device is provided, the forwarding device belonging to a terminal self-discovery system. The terminal self-discovery system further includes: a first terminal and a second terminal. The first terminal is located in a first local area network, and the second terminal is located in a second local area network. The first terminal needs to be self-discoverable in both the first and second local area networks.

[0027] The forwarding device includes: a receiving unit, a generating unit and a sending unit.

[0028] The receiving unit is configured to receive a first message sent by a first terminal, wherein the first message is a message using a private self-discovery protocol and includes an identifier of the first local area network and an Internet Protocol (IP) address of the first terminal.

[0029] The generating unit is configured to generate a second message based on the first message, wherein the first message includes an identifier of the first local area network and an Internet Protocol (IP) address of the first terminal.

[0030] The sending unit is configured to multicast the second message in the second local area network, wherein the second message includes an identifier of the second local area network and an IP address of the first terminal.

[0031] The receiving unit is further configured to receive a response message sent by the second terminal, wherein the destination IP address of the response message is the IP address of the first terminal.

[0032] In some possible designs, the self-discovery protocol instructs the first message to be multicast within the scope of the first local area network.

[0033] In some possible designs, the generation unit generates the second message according to the first message in the following manner:

[0034] The generating unit copies the first message to obtain a copied message, and then replaces the identifier of the first local area network in the copied message with the identifier of the second local area network to obtain the second message.

[0035] In some possible designs, the first message also includes a destination IP address and a destination port number, and the generating unit is further configured to determine, based on at least one of the destination IP address and the destination port number, that the first message is a message using a private self-discovery protocol, and to determine an identifier of the second local area network based on the IP address and configuration information of the first terminal. The configuration information may include two implementations:

[0036] In the first manner, the configuration information includes the correspondence between the IP address of the first terminal and the identifier of the second local area network. In this case, the configuration information clearly indicates that the first terminal needs to perform multicast in the second local area network, and it is assumed that the first terminal needs to perform multicast in the first local area network.

[0037] According to a third aspect, a forwarding device is provided, comprising a processor and a memory, wherein the memory stores instructions, and the processor executes the instructions to implement the method according to any one of the first aspects.

[0038] In a fourth aspect, a readable storage medium is provided, comprising instructions, which, when executed by a forwarding device, can implement the method as described in any one of the first aspects.

[0039] In a fifth aspect, a computer program product is provided, comprising instructions, which, when executed by a forwarding device, can implement the method as described in any one of the first aspects. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] FIG1 is a schematic diagram of the structure of a terminal self-discovery system provided by the present application;

[0041] FIG2 is a flow chart of a terminal self-discovery method provided by the present application;

[0042] FIG3 is a flow chart of another terminal self-discovery method provided by the present application;

[0043] FIG4 is a schematic structural diagram of a forwarding device provided by the present application;

[0044] FIG5 is a schematic structural diagram of another forwarding device provided in this application. DETAILED DESCRIPTION

[0045] Referring to Figure 1 , which is a schematic diagram of the structure of a terminal self-discovery system provided by this application, the terminal self-discovery system includes: a forwarding device 110, a first terminal 120, and a second terminal 130. The first terminal 120 is located in a first local area network, and the second terminal 130 is located in a second local area network.

[0046] Forwarding device 110 can be a device that forwards data packets operating in a Layer 2 network or a Layer 3 network. Forwarding device 110 can be a physical forwarding device, such as a network switch, a router, a network switch-router, a gateway device, and the like. Forwarding device 110 can also be a virtual device created using virtualization technology, such as a virtual switch, a virtual router, a virtual switch-router, and a virtual gateway. The virtualized forwarding device 110 can run on a server, a container, a bare metal server, and the like. It should be understood that the aforementioned forwarding device examples are merely illustrative and do not constitute specific limitations.

[0047] The first terminal 120 can be an electronic device, a mobile device, a computing device, a wearable device, and the like. Electronic devices can include cameras, smart air conditioners, printers, smart refrigerators, robot vacuums, smart rice cookers, and the like. Mobile devices can include smartphones, tablets, and laptops. Computing devices can include desktop computers and servers. Wearable devices can include smart glasses, smart helmets, smart watches, and smart bracelets. It should be understood that the aforementioned forwarding device examples are merely illustrative and do not constitute a limitation.

[0048] The second terminal 130 is similar to the first terminal 120. The first terminal 120 may be located in a first local area network, and the second terminal 130 may be located in a second local area network.

[0049] Optionally, when the forwarding device 110 is located in a server and the first terminal 120 is a server, the forwarding device 110 may be located in the first terminal 120 or outside the first terminal 120. Similarly, when the forwarding device 110 is located in a server and the second terminal 130 is a server, the forwarding device 110 may be located in the second terminal 130 or outside the second terminal 130.

[0050] It should be understood that the above-mentioned terminal self-discovery system is only used as an example. In actual applications, the number of forwarding devices may be more than one, and the number of terminals may be more than one. Other terminals except the first terminal and the second terminal may be located in the first local area network, in the second local area network, or in other local area networks, as well as in the first local area network, the second local area network and the third local area network respectively. No specific limitation is made here.

[0051] Refer to Figure 2, which is a flow chart of a terminal self-discovery method provided by the present application. As shown in Figure 2, the terminal self-discovery method of the present application includes the following steps:

[0052] S101: A first terminal multicasts a first message in a first local area network. Correspondingly, a forwarding device receives the first message multicast by the first terminal.

[0053] The first message includes an identifier of the first local area network, a first source IP address, and a first destination IP address. The identifier of the first local area network is a unique identifier of the first local area network. The first source IP address is the IP address of the first terminal, and the first destination IP address is a multicast address. It is understood that the first message may include more fields in addition to the aforementioned fields, which are not limited here.

[0054] When the first message uses different private self-discovery protocols, the multicast addresses are different. The private self-discovery protocols may include any one of the Simple Service Discovery Protocol (SSDP), the Constrained Application Protocol (CoAP), the Multicast Domain Name System (mDNS), the Service Location Protocol (SLP), and the Web Services Discovery Protocol (WS-Discovery).

[0055] When the private self-discovery protocol is SSDP, the multicast address is 239.255.255.250.

[0056] When the private self-discovery protocol is CoAP, the multicast address is 224.0.1.187.

[0057] When the private self-discovery protocol is mDNS, the multicast address is 224.0.0.251.

[0058] When the private self-discovery protocol is SLP, the multicast address is 239.255.255.253.

[0059] When the private self-discovery protocol is WS-Discovery, the multicast address is 239.255.255.250.

[0060] Here, the examples of private self-discovery protocols and multicast addresses are merely examples and do not constitute specific limitations.

[0061] When a first terminal first accesses a first local area network (LAN), or after disconnecting from and then reconnecting to the LAN, the first terminal hopes that other terminals will be able to discover that it has accessed the LAN. Therefore, the first terminal multicasts a first message within the LAN to notify other terminals that it has accessed the LAN. However, because the LAN identifier of the first message is the identifier of the first LAN, the first message can only be multicast within the LAN. Therefore, only other terminals in the LAN can receive the first message and thus learn that the first terminal has accessed the LAN. Terminals in other LANs cannot learn that the first terminal has accessed the LAN.

[0062] S102: The forwarding device determines that the first message is a message using a private self-discovery protocol.

[0063] The forwarding device determines that the first message is a message using a private self-discovery protocol in at least two ways:

[0064] Method 1: The forwarding device determines, based on a keyword, that the first message is a message using a private self-discovery protocol. As can be seen from step S101, commonly used multicast addresses include 239.255.255.250, 224.0.1.187, 224.0.0.251, 239.255.255.253, 239.255.255.250, and so on. Therefore, these multicast addresses can be set as keywords. After receiving the first message, the keyword and the destination address of the first message are compared character by character. If the characters in the keyword and the first message are exactly the same, the first message is determined to be a message using a private self-discovery protocol.

[0065] The second method: The forwarding device determines, based on a protocol prediction model, that the first message is a message using a proprietary self-discovery protocol. Specifically, some or all of the header information in the first message can be input into the protocol prediction model to obtain a prediction result. The prediction result indicates whether the first message is a message using a proprietary self-discovery protocol. For example, a "yes" prediction result indicates that the first message is a message using a proprietary self-discovery protocol; a "no" prediction result indicates that the first message is not a message using a proprietary self-discovery protocol. The protocol prediction model can be trained using some or all of the header information of historical messages and labels corresponding to the header information. The labels indicate whether the historical messages are messages using a proprietary self-discovery protocol. For example, a "yes" label indicates that the historical messages are messages using a proprietary self-discovery protocol; a "no" label indicates that the historical messages are not messages using a proprietary self-discovery protocol. The protocol prediction model can be any of a deep neural model, a convolutional neural model, a self-recurrent neural model, and so on.

[0066] If it is determined that the first message is a message using a private self-discovery protocol, step S103 is executed. If it is determined that the first message is not a message using a private self-discovery protocol, the process ends.

[0067] S103: The forwarding device determines the identifier of the second local area network according to the identifier of the first terminal and the configuration information.

[0068] Configuration information can be set in the forwarding device in the form of a table, database, etc. The configuration information may include multiple configuration items, each of which includes a key and a value. The key is used to store the unique identifier of the terminal for multicasting, for example, the IP address of the first terminal, the MAC address of the first terminal, etc. The value is used to store the identifier of the local area network for multicasting, for example, a VLAN, etc. Taking the configuration item corresponding to the first terminal as an example, the configuration item may include two implementation methods:

[0069] In the first approach, the key of the configuration item is the IP address of the first terminal, and the value is the identifier of the second LAN. Therefore, the configuration item records the correspondence between the IP address of the first terminal and the identifier of the second LAN. In this case, the configuration item explicitly states that the first terminal needs to multicast in the second LAN, which implies that the first terminal needs to multicast in the first LAN.

[0070] In the second method, the key of the configuration item is the IP address of the first terminal, and the value is the identifier of the first and second LANs. Therefore, the configuration item records the correspondence between the IP address of the first terminal and the identifiers of the first and second LANs. In this case, the configuration information explicitly states that the first terminal needs to perform multicast in both the first and second LANs.

[0071] It can be understood that the above two methods are only specific examples. In actual applications, there may be more implementation methods for configuration items and configuration information, which are not specifically limited here.

[0072] After determining that the first message is a message using a private self-discovery protocol, the forwarding device resolves the source IP address in the first message to obtain the IP address of the first terminal. The forwarding device then matches the first terminal's IP address with the key of the first configuration item in the configuration information. If the match is successful, the value of the matching item is obtained. If the match is unsuccessful, the key of the first configuration item in the configuration information is obtained for matching, and so on, until a match is successful, or all configuration items in the configuration information are traversed. When performing the match, the IP address of the first terminal and the content in the key of the configuration item can be compared character by character. If every character is the same, the match is considered successful. If not every character is the same, the match is considered unsuccessful.

[0073] S104: The forwarding device generates a second message based on the first message.

[0074] After obtaining the identifier of the second local area network, the forwarding device generates the second message based on the first message in at least two ways:

[0075] In the first method, the forwarding device replaces the identifier of the first local area network in the received first message with the identifier of the second local area network. Specifically, the forwarding device interprets the message header of the first message, determines the field containing the identifier of the first local area network, and then replaces the identifier of the first local area network with the identifier of the second local area network.

[0076] In a second manner, the forwarding device copies the first message to obtain a copied message, and then replaces the identifier of the first local area network in the copied message with the identifier of the second local area network.

[0077] Because the second message is generated based on the first message, the second message includes the identifier of the second local area network, the second source IP address, and the second destination IP address. The identifier of the second local area network is a unique identifier for the second local area network. The second source IP address is the IP address of the first terminal, and the second destination IP address is a multicast address. It is understood that the second message may include more fields in addition to the aforementioned fields, which are not limited here.

[0078] S105: The forwarding device multicasts the second message in the second local area network. Correspondingly, the second terminal receives the second message sent by the forwarding device.

[0079] Since the second message includes the identifier of the second local area network, the forwarding device will transparently transmit the second message to the second local area network. Moreover, since the second destination IP address of the second message is a multicast address, the forwarding device will multicast the second message in the second local area network.

[0080] S106: The second terminal sends a response message to the first terminal. Correspondingly, the first terminal receives the response message sent by the second terminal.

[0081] The response message is used to establish a connection between the first terminal and the second terminal, wherein the source IP address of the response message is the IP address of the second terminal, and the destination address is the IP address of the first terminal.

[0082] Because the second message carries the IP address of the first terminal, the second terminal can know that the first terminal has connected to the first local area network and can unicast a response message to the first terminal using the IP address of the first terminal as the target IP address. After receiving the response message, the first terminal can establish a connection with the second terminal.

[0083] Refer to Figure 3, which is a flow chart of another terminal self-discovery method provided by the present application. As shown in Figure 3, the terminal self-discovery method of the present application includes the following steps:

[0084] S201: A first terminal sends a first message to a forwarding device. Correspondingly, the forwarding device receives the first message multicast by the first terminal.

[0085] The first message is used to instruct the forwarding device to perform multicast within a designated local area network so that other terminals within the designated local area network can discover the first terminal. The first message includes an identifier for the first local area network, a first source IP address, and a first destination IP address. The identifier for the first local area network is a unique identifier for the first local area network. The first source IP address is the IP address of the first terminal, and the first destination IP address is the IP address of the forwarding device. It is understood that in addition to the aforementioned fields, the first message may also include further fields, which are not limited here.

[0086] Optionally, the first terminal device sends the first message to the forwarding device in a unicast manner.

[0087] S202: The forwarding device determines an identifier of the second local area network according to the identifier of the first terminal and configuration information.

[0088] The process of the forwarding device determining the identifier of the second local area network according to the identifier of the first terminal and the configuration information can be referred to the description of step S103 in FIG. 2 .

[0089] S203: The forwarding device generates a second message based on the first message.

[0090] After obtaining the identifier of the second local area network, the forwarding device obtains the identifier of the second local area network and the IP address of the first terminal, and then generates a second message using a private self-discovery protocol. The second message includes the identifier of the second local area network, the second source IP address, and the second destination IP address. The identifier of the second local area network is a unique identifier of the second local area network. The second source IP address is the IP address of the first terminal, and the second destination IP address is a multicast address. It is understood that in addition to the aforementioned fields, the second message may also include further fields, which are not limited here.

[0091] S204: The forwarding device generates a third message based on the first message.

[0092] After obtaining the identifier of the first local area network, the forwarding device obtains the identifier of the first local area network and the IP address of the first terminal, and then generates a third message using a private self-discovery protocol. The third message includes the identifier of the first local area network, a third source IP address, and a third destination IP address. The identifier of the first local area network is a unique identifier of the first local area network. The third source IP address is the IP address of the first terminal, and the third destination IP address is a multicast address. It is understood that in addition to the aforementioned fields, the third message may also include further fields, which are not limited here.

[0093] S205: The forwarding device multicasts the second message in the second local area network. Correspondingly, the second terminal receives the second message sent by the forwarding device.

[0094] For details about the content of the second message multicasted by the forwarding device in the second local area network, please refer to the introduction of step S105 in FIG. 2 , which will not be elaborated here.

[0095] S206: The second terminal sends a response message to the first terminal. Correspondingly, the first terminal receives the response message sent by the second terminal.

[0096] The content of the response message sent by the second terminal to the first terminal can be found in the introduction of step S106 in FIG. 2 , and will not be elaborated here.

[0097] 4 , which shows a forwarding device provided by the present application, including a receiving unit 210 , a processing unit 220 , and a sending unit 230 .

[0098] The receiving unit 210 is configured to receive a first message sent by a first terminal, wherein the first terminal is located in a first local area network, the first message includes an identifier of the first local area network and an Internet Protocol (IP) address of the first terminal, and the first terminal needs to be self-discoverable in the second local area network;

[0099] The processing unit 220 is configured to generate a second message based on the first message;

[0100] The sending unit 230 is configured to multicast the second message in the second local area network, wherein the second message includes an identifier of the second local area network and the IP address of the first terminal;

[0101] The receiving unit 210 is further configured to receive a response message sent by a second terminal, wherein the second terminal is located in the second local area network, and the destination IP address of the response message is the IP address of the first terminal.

[0102] In some possible implementations, the receiving unit 210, the processing unit 220, and the sending unit 230 may be implemented by software or hardware. Exemplarily, the implementation of the processing unit 220 will be described below using the processing unit 220 as an example.

[0103] The processing unit 220 is an example of a software functional unit. The processing unit 220 may include code running on a forwarding device. The forwarding device may include at least one of a physical device and a forwarding device virtualized by virtualization technology. Furthermore, the forwarding devices virtualized by virtualization technology may be distributed in the same region or in different regions. Furthermore, the forwarding devices virtualized by virtualization technology may be distributed in the same availability zone (AZ) or in different AZs, each AZ including one data center or multiple geographically close data centers. Typically, a region may include multiple AZs.

[0104] Similarly, forwarding devices created through virtualization technology can be distributed within the same virtual private cloud (VPC) or across multiple VPCs. Typically, a VPC is located within a region. Cross-region communication between two VPCs within the same region, or between VPCs in different regions, requires a communication gateway within each VPC to interconnect the VPCs.

[0105] The processing unit 220 is an example of a hardware functional unit. The processing unit 220 can be implemented using an application-specific integrated circuit (ASIC) or a hardware module implemented using a programmable logic device (PLD). The PLD can be implemented using a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.

[0106] Referring to Figure 5 , which is a schematic diagram of the structure of a forwarding device provided by this application, the forwarding device 300 may be the data query system described above. Furthermore, the forwarding device 300 includes a processor 301, a storage unit 302, a storage medium 303, and a communication interface 304. The processor 301, storage unit 302, storage medium 303, and communication interface 304 communicate via a bus 305, and may also communicate via other means such as wireless transmission.

[0107] Processor 301 is composed of multiple general-purpose processors, such as CPUs. The hardware chip is an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The PLD is a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), a data processing unit (DPU), a system on chip (SoC), or any combination thereof. Processor 301 executes various types of digitally stored instructions, such as software or firmware programs stored in storage unit 302, enabling forwarding device 300 to provide a wide variety of services.

[0108] In a specific implementation, as an embodiment, the processor 301 includes one or more CPUs, such as CPU0 and CPU1 shown in FIG5 .

[0109] In a specific implementation, as an example, forwarding device 300 also includes multiple processors, such as processor 301 shown in FIG5 . Each of these processors can be a single-core processor (single-CPU) or a multi-core processor (multi-CPU). A processor here refers to one or more devices, circuits, and / or processing cores for processing data (e.g., computer program instructions).

[0110] The storage unit 302 is used to store program code and is controlled by the processor 301 to execute steps S102, S103, and S202 to S204 of the terminal self-discovery method in any of the embodiments of Figures 2 or 3. The program code includes one or more software units. These one or more software units are the processing units in the embodiment of Figure 4.

[0111] The storage unit 302 includes a read-only memory and a random access memory, and provides instructions and data to the processor 301. The storage unit 302 also includes a non-volatile random access memory. The storage unit 302 is a volatile memory or a non-volatile memory, or includes both volatile and non-volatile memories. Among them, the non-volatile memory is a read-only memory (ROM), a programmable ROM (PROM), an erasable programmable ROM (EPROM), an electrically erasable programmable ROM (EEPROM), or a flash memory. The volatile memory is a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are used, such as static RAM (SRAM), dynamic random access memory (DRAM), synchronous DRAM (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronized dynamic random access memory (SLDRAM), and direct RAM bus RAM (DR RAM). A hard disk, a universal serial bus (USB), a flash memory, a secure digital memory card (SD card), a memory stick, etc., and a hard disk can be a hard disk drive (HDD), a solid state drive (SSD), a mechanical hard disk (HDD), etc., which is not specifically limited in this application.

[0112] The storage medium 303 is a carrier for storing data, such as a hard disk, a universal serial bus (USB), a flash memory, a secure digital memory card (SD card), a memory stick, etc. The hard disk can be a hard disk drive (HDD), a solid state disk (SSD), a mechanical hard disk (HDD), etc., and this application does not make specific limitations.

[0113] The communication interface 304 is a wired interface (e.g., an Ethernet interface), an internal interface (e.g., a high-speed serial computer expansion bus (Peripheral Component Interconnect express, PCIe) bus interface), a wired interface (e.g., an Ethernet interface), or a wireless interface (e.g., a cellular network interface or a wireless local area network interface) for communicating with other servers or units. The communication interface can be used to execute steps S101, S104 to S106 in the embodiment shown in FIG2 , and the communication interface can be used to execute steps S201, S205, and S206 in the embodiment shown in FIG3 . The communication interface can be the receiving unit and the sending unit in the embodiment shown in FIG4 .

[0114] Bus 305 is a Peripheral Component Interconnect Express (PCIe) bus, an extended industry standard architecture (EISA) bus, a unified bus (UBus or UB), a compute express link (CXL), or a cache coherent interconnect for accelerators (CCIX). Bus 305 is divided into an address bus, a data bus, and a control bus.

[0115] In addition to the data bus, the bus 305 also includes a power bus, a control bus, a status signal bus, etc. However, for the sake of clarity, various buses are labeled as the bus 305 in the figure.

[0116] It should be noted that FIG5 is only one possible implementation of the present application. In actual applications, the forwarding device 300 may also include more or fewer components, which is not limited here. For matters not shown or described in the embodiments of the present application, please refer to the relevant descriptions in the embodiments of FIG1 to FIG4 above, and will not be repeated here.

[0117] The present application also provides a computer program product containing instructions. The computer program product may be software or a program product containing instructions that can be run on a forwarding device or stored on any available medium. When the computer program product is run on at least one forwarding device, it causes the at least one forwarding device to execute the service management method.

[0118] The present application also provides a computer-readable storage medium. The computer-readable storage medium can be any available medium that can be stored by the forwarding device, or a data storage device such as a data center that contains one or more available media. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a magnetic tape), an optical medium (e.g., a high-density digital video disc (DVD)), or a semiconductor medium (e.g., a solid-state drive). The computer-readable storage medium includes instructions that instruct the forwarding device to execute the service management method.

[0119] The above embodiments can be implemented in whole or in part through software, hardware, firmware, or any other combination thereof. When implemented using software, the above embodiments can be implemented in whole or in part in the form of a computer program product. A computer program product includes multiple computer instructions. When the computer program instructions are loaded or executed on a computer, the processes or functions according to the embodiments of the present invention are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transferred from one computer-readable storage medium to another.

[0120] The above are merely specific embodiments of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art can easily conceive of various equivalent repairs or replacements within the technical scope disclosed in the present invention, and such repairs or replacements should be included in the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be based on the scope of protection of the claims.

Claims

1. A terminal self-discovery method, characterized in that: Applicable to forwarding devices, including: receiving a first message sent by a first terminal, wherein the first terminal is located in a first local area network, the first message includes an identifier of the first local area network and an Internet Protocol (IP) address of the first terminal, and the first terminal needs to be self-discoverable in the second local area network; multicasting a second message in the second local area network, wherein the second message includes an identifier of the second local area network and an IP address of the first terminal; A response message sent by a second terminal is received, wherein the second terminal is located in the second local area network, and the destination IP address of the response message is the IP address of the first terminal.

2. The method according to claim 1, characterized in that After receiving the first self-discovery message sent by the first terminal, the method further includes: Multicast a third message in the first local area network, wherein the third message includes an identifier of the first local area network and an IP address of the first terminal.

3. The method according to claim 1, characterized in that The first message is a message using a private self-discovery protocol, and the self-discovery protocol instructs the first message to be multicast within the scope of the first local area network.

4. The method according to claim 1, wherein Before multicasting the second message in the second local area network, the method further includes: Copying the first message to obtain a copied message; The identifier of the first local area network in the copied message is replaced with the identifier of the second local area network to obtain the second message.

5. The method according to claim 4, characterized in that The first message further includes a destination IP address and a destination port number, and before obtaining the second message, the method further includes: replacing the identifier of the first local area network in the copied message with the identifier of the second local area network. Determining, based on at least one of the destination IP address and the destination port number, that the first message is a message using a private self-discovery protocol; The identifier of the second local area network is determined according to the source IP address of the first terminal and configuration information, where the configuration information includes a correspondence between the IP address of the first terminal and the identifier of the second local area network.

6. The method according to any one of claims 1 to 5, characterized in that The private self-discovery protocol includes any one of the Simple Service Discovery Protocol, the Constrained Application Protocol, the Multicast Domain Name System, the Service Location Protocol, and the World Wide Web Service Discovery Protocol.

7. The method according to any one of claims 1 to 6, characterized in that The response message is a unicast message.

8. The method according to any one of claims 1 to 7, characterized in that The forwarding device is a convergence switch or a gateway.

9. A forwarding device, characterized in that: include: Receiving unit and sending unit, The receiving unit is configured to receive a first message sent by a first terminal, wherein the first terminal is located in a first local area network, the first message includes an identifier of the first local area network and an Internet Protocol (IP) address of the first terminal, and the first terminal needs to be self-discoverable in the second local area network; The sending unit is configured to multicast the second message in the second local area network, wherein the second message includes an identifier of the second local area network and an IP address of the first terminal; The receiving unit is further configured to receive a response message sent by a second terminal, wherein the second terminal is located in the second local area network, and the destination IP address of the response message is the IP address of the first terminal.

10. A forwarding device, characterized in that: The method comprises a processor and a memory, wherein the memory stores instructions, and the processor executes the instructions to implement the method according to any one of claims 1 to 8.

11. A readable storage medium, characterized in that: The method comprises instructions, which, when executed by a forwarding device, can implement the method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Equipment discovery method for realizing real-time dynamic networking in personal internet

    CN102130807A

  • Method and system for equipment discovery and server

    CN103516567A

  • Hotel Internet of Things intelligent control system, method for intelligently controlling equipment and electronic equipment

    CN110086782A

  • Screen projection control method and device, screen projection equipment and playing equipment

    CN116962369A

  • Method for accessing wireless local area network, device, system, and storage medium

    WO2024022222A1

Cited By

  • Equipment discovery method, electronic device and storage medium

    CN121462624A