WO2019153722A1 - Terminal communication method and device, terminal and storage medium - Google Patents
Terminal communication method and device, terminal and storage medium Download PDFInfo
- Publication number
- WO2019153722A1 WO2019153722A1 PCT/CN2018/102819 CN2018102819W WO2019153722A1 WO 2019153722 A1 WO2019153722 A1 WO 2019153722A1 CN 2018102819 W CN2018102819 W CN 2018102819W WO 2019153722 A1 WO2019153722 A1 WO 2019153722A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- terminal
- receiving terminal
- sending
- packet
- attribute information
- Prior art date
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/14—Session management
- H04L67/141—Setup of application sessions
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/24—Negotiation of communication capabilities
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/26—Special purpose or proprietary protocols or architectures
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L45/00—Routing or path finding of packets in data switching networks
- H04L45/16—Multipoint routing
Definitions
- Embodiments of the present disclosure relate to the field of communications technologies, and relate, for example, to a method, an apparatus, a terminal, and a storage medium for terminal communication.
- PCs personal computers
- Sharing mobile content such as photos, videos, or music
- devices such as TVs, PCs, or mobile phones
- the premise of sharing and mutual control between devices is that they can discover each other, so the discovery protocol between devices becomes a core component of the interactive technology between devices.
- the mainstream device interconnection protocol in the local area network is Zero configuration networking (Zeroconf) protocol, and the goal is to enable users to easily connect various network devices, such as computers and printers.
- Zeroconf Zero configuration networking
- the entire process of building a network is automated through program automation. Apple's products use the Zeroconf service in its entirety, so you want to be able to interoperate with Apple products and you must add the Zeroconf service to your device.
- the embodiments of the present disclosure provide a method, an apparatus, a terminal, and a storage medium for terminal communication, which improve the success rate of mutual recognition of multiple terminals in a local area network, and realize communication between multiple terminals.
- an embodiment of the present disclosure provides a method for terminal communication, which is applied to a transmitting terminal, and the method includes:
- the sending terminal is any one of the terminals connected to the local area network, and the receiving terminal is all terminals except the sending terminal in the local area network.
- an embodiment of the present disclosure further provides an apparatus for terminal communication, which is applied to a transmitting terminal, and the apparatus includes:
- the packet sending module is configured to send a packet to the receiving terminal by using a router according to the zero-configuration network service protocol, where the preset packet sending manner includes a broadcast mode;
- the attribute information storage module is configured to: when obtaining the response information to the message sent by the receiving terminal, storing the attribute information of the receiving terminal in the response information, according to the attribute information of the receiving terminal Said receiving terminal establishes a communication connection;
- the sending terminal is any one of the terminals connected to the local area network, and the receiving terminal is all terminals except the sending terminal in the local area network.
- an embodiment of the present disclosure further provides a method for terminal communication, which is applied to a receiving terminal, where the method includes:
- the receiving terminal When the receiving terminal is in the listening response state, obtaining a packet sent by the sending terminal based on the zero-configuration network service protocol, where the packet includes a broadcast packet;
- the sending terminal is any one of the terminals connected to the local area network, and the receiving terminal is all terminals except the sending terminal in the local area network.
- an embodiment of the present disclosure further provides an apparatus for terminal communication, which is applied to a receiving terminal, where the apparatus includes:
- the packet obtaining module is configured to: when the receiving terminal is in the monitoring response state, obtain the packet sent by the sending terminal according to the zero-configuration network service protocol, where the packet includes a broadcast packet;
- An attribute information storage module configured to store attribute information of the sending terminal included in the message
- the attribute information sending module is configured to send the attribute information of the receiving terminal to the sending terminal according to the attribute information of the sending terminal, so that the sending terminal and the receiving terminal according to the attribute information of the receiving terminal Establish a communication connection;
- the sending terminal is any one of the terminals connected to the local area network, and the receiving terminal is all terminals except the sending terminal in the local area network.
- an embodiment of the present disclosure further provides a terminal, where the terminal includes:
- One or more processors are One or more processors;
- a storage device configured to store one or more programs
- the one or more programs are executed by the one or more processors such that the one or more processors implement a method of terminal communication for a transmitting terminal provided by any of the embodiments of the present disclosure.
- an embodiment of the present disclosure further provides a terminal, where the terminal includes:
- One or more processors are One or more processors;
- a storage device configured to store one or more programs
- the one or more programs are executed by the one or more processors such that the one or more processors implement a method for terminal communication applied to a receiving terminal provided by any of the embodiments of the present disclosure.
- an embodiment of the present disclosure further provides a computer readable storage medium having stored thereon a computer program, when executed by a processor, implementing a terminal applied to a transmitting terminal according to any embodiment of the present disclosure.
- the method of communication is not limited to any embodiment of the present disclosure.
- an embodiment of the present disclosure further provides a computer readable storage medium having stored thereon a computer program, when executed by a processor, implementing a terminal applied to a receiving terminal provided by any embodiment of the present disclosure The method of communication.
- the embodiment of the present disclosure improves the zero-configuration network service protocol, and adds a broadcast mode as one of the preset message transmission modes on the basis that the default packet transmission mode is multicast transmission. Since all routers are compatible with the forwarding of broadcast packets, the packets are sent to the receiving terminal according to the preset packet sending manner, which solves the problem that different terminals cannot be mutually discovered due to poor compatibility of the router in the related art. problem.
- the attribute information of the receiving terminal is stored in the response information, and the transmitting terminal can identify all receiving terminals accessed in the local area network by using the attribute information of the receiving terminal, and can The attribute information establishes a communication connection with all receiving terminals, thereby laying a foundation for realizing mutual control between multiple terminals.
- FIG. 1 is a flowchart of a method for communication of a terminal according to Embodiment 1 of the present disclosure
- FIG. 2 is a flowchart of a method for communication of a terminal according to Embodiment 2 of the present disclosure
- FIG. 3 is a structural block diagram of an apparatus for terminal communication according to Embodiment 3 of the present disclosure.
- FIG. 4a is a flowchart of a method for terminal communication according to Embodiment 4 of the present disclosure
- FIG. 4b is a schematic diagram of a television set and a plurality of mobile terminals being discovered by each other according to Embodiment 4 of the present disclosure
- FIG. 5 is a structural block diagram of an apparatus for terminal communication according to Embodiment 5 of the present disclosure.
- FIG. 6 is a schematic structural diagram of a terminal according to Embodiment 6 of the present disclosure.
- FIG. 1 is a flowchart of a method for communication of a terminal according to Embodiment 1 of the present disclosure.
- the method may be implemented by a device for communication by a terminal, and the device may be implemented by software and/or hardware, and the device may be integrated in an electronic device.
- the electronic device may include a television, a smart phone, a tablet, a printer, and the like.
- the method in this embodiment can be applied to a sending terminal, and the sending terminal can be any one of the terminals accessed in the local area network. Referring to FIG. 1, the method of this embodiment includes:
- the device sends a packet to the receiving terminal by using a router according to the zero-configuration network service protocol, where the preset packet sending manner includes a broadcast mode.
- the zero-configuration network service protocol is a network technology for automatically generating an available Internet Protocol (IP) address, without requiring additional manual configuration and a dedicated configuration server.
- IP Internet Protocol
- devices connected to the local area network transmit packets in the multicast mode based on the multicast domain name system (MDNS) protocol.
- MDNS multicast domain name system
- the preset packet sending manner provided in this embodiment further includes a broadcast mode. As all the routers can forward the broadcast packets, the routers cannot forward the multicast packets because the routers cannot forward the packets based on the multicast mode of the traditional zero-configuration network service protocol. , resulting in problems that cannot be discovered by different devices.
- the technical solution provided in this embodiment is an improvement on the traditional zero-configuration network service protocol, and any terminal (including the transmitting terminal and the receiving terminal) in the access LAN does not need to install the corresponding client software, and does not need to add new broadcasts and groups.
- the transmission protocol of the broadcast message As long as any terminal accesses the local area network and the terminal is in normal working condition, the improved zero-configuration network service protocol can be started, and different terminals can discover each other, thereby establishing a communication connection with each other.
- the embodiment of the present disclosure may also apply the same to the Android system, that is, in addition to the mobile operating system (iPhone Operating System, which is installed by Apple).
- the device provided by the IOS can enjoy the service provided by the protocol, and the device installed with the Android system can also recognize and interact with each other by using the technical solutions provided by the embodiments of the present disclosure.
- the message sent by the sending terminal may include a service type of the sending terminal (such as a print service or a television service, etc.), an Internet Protocol Address (IP address), or a service port number.
- the message may be sent by using a User Datagram Protocol (UDP) packet.
- UDP User Datagram Protocol
- the receiving terminal may be all terminals except the transmitting terminal in the local area network, and any terminal newly accessing the local area network may also serve as the receiving terminal.
- the attribute information of the receiving terminal includes the service type, IP address, and service port number of the receiving terminal.
- the attribute information of the different receiving terminal may be stored in the service list.
- the service list information such as the service name and service type of different receiving terminals can be displayed.
- the user can see a plurality of receiving terminals that have accessed the local area network in the service list of the sending terminal, so that service sharing between the plurality of terminal devices can be implemented.
- the user can choose according to the actual needs. For example, if the sending terminal is a mobile phone, and the receiving terminal is a printer, a television, a tablet, and the like, there will be a printer, a television, and a service list in the mobile phone. The identity of the terminal such as a tablet.
- the mobile phone held by the user can establish a communication connection with the printer, and by performing operations on the mobile phone, the file to be printed in the mobile phone can be printed through the printer.
- the transmitting terminal can perform one-to-one access by receiving the IP address in the attribute information of the terminal when accessing or controlling the receiving terminal. Or control.
- the technical solution of the embodiment improves the zero-configuration network service protocol, and the broadcast mode is added as one of the preset message sending modes on the basis that the default packet sending mode is multicast. Since all routers are compatible with the forwarding of broadcast packets, the packets are sent to the receiving terminal according to the preset packet sending manner, which solves the problem that different terminals cannot be mutually discovered due to poor compatibility of the router in the related art. problem.
- the attribute information of the receiving terminal is stored in the response information, and the transmitting terminal can identify all receiving terminals accessed in the local area network by using the attribute information of the receiving terminal, and can The attribute information establishes a communication connection with all receiving terminals, thereby laying a foundation for realizing mutual control between multiple terminals.
- the method for providing terminal communication in this embodiment includes:
- the multicast message corresponding to the multicast mode is forwarded to the primary router level by the primary router according to the multicast mode and the broadcast mode.
- Each secondary router of the connection, and the broadcast message corresponding to the broadcast mode is forwarded by the primary router to at least one secondary router cascading with the primary router, wherein each secondary router is set to at least one of the following
- the item is sent to the receiving terminal that has a communication connection with the secondary router: a multicast message and a broadcast message.
- the preset message sending manner in the embodiment of the present disclosure includes a default multicast mode based on the zero-configuration network service protocol in addition to the broadcast mode.
- the broadcast mode is adopted, although the message can be transmitted at one time, but the message cannot be transmitted to all target nodes once.
- the message can be transmitted at one time, but the message cannot be transmitted to all target nodes once.
- the broadcast mode is adopted, although the message can be transmitted at one time, but the message cannot be transmitted to all target nodes once.
- the message can be transmitted at one time, but the message cannot be transmitted to all target nodes once.
- the primary router A if there are two secondary routers B and R below the primary router A, and only the broadcast mode is used to send the message, there can be only one router in the router B and the router C. Received a broadcast message.
- the multicast mode can be used to transmit the packets to all the destination nodes at a time.
- the multicast packets can be forwarded to the router B and the router C through the router A.
- the packet can be sent in the multicast mode or in the broadcast mode.
- the broadcast packet can be forwarded to the receiving terminal to ensure that the device discovery in the LAN is not affected.
- the multicast packets can be sent to all receiving terminals to ensure the comprehensiveness of device discovery.
- the multicast message and the broadcast message include the attribute information of the sending terminal, and the attribute information of the sending terminal includes the service type of the sending terminal and the sending.
- the Internet Protocol address of the terminal and the service port number of the sending terminal are included in the multicast mode and the broadcast mode.
- the multicast packet when the broadcast packet and the multicast packet are respectively sent according to the broadcast mode and the multicast mode, the multicast packet may be sent first, and if the receiving terminal is not received within a set time (for example, 30 seconds)
- the response message to the multicast packet indicates that the router does not support the forwarding of multicast packets or that there is no receiving terminal other than the current transmitting terminal in the local area network.
- the current transmitting terminal sends the broadcast message according to the broadcast mode.
- the response information of the other terminal to the broadcast message is received within the set time (for example, 10 seconds)
- the receiving terminal has a multicast terminal in the local area network.
- the response message was not received after the packet was sent because the router does not support the forwarding of multicast packets.
- the method of simultaneously transmitting the multicast packet and the broadcast packet in the embodiment may be sent in sequence (for example, the interval is not more than 5). second).
- the response information of the receiving terminal is acquired at a set time (for example, 10 seconds), it is explained that other terminal devices exist in the local area network in addition to the current transmitting terminal.
- the response information of the receiving terminal is not acquired within the set time (for example, 10 seconds), it means that there is no terminal device other than the current transmitting terminal in the local area network.
- the time used by the former is relatively long compared to the manner in which the multicast packet and the broadcast packet are not continuously transmitted (for example, 30 seconds). Short, you can quickly discover all the terminal devices connected to the LAN, so that it is easy to establish communication connections between different terminals, which is convenient for user control.
- the sending frequency of the message may be increased, for example, according to a set period (for example, 5 seconds), and according to a preset packet sending manner, the router may The receiving terminal sends a packet to prevent the receiving terminal from acquiring the packet when it is in the non-working mode.
- the wireless Fidelity (WiFi) network of the device is configured into a power saving mode without the user operating. .
- the device in the power saving mode does not answer the packet of the sending terminal, which may cause some mobile devices to be undetected by other devices for a long time. Therefore, in this embodiment, a packet of 5 seconds is used, and a multicast packet and a broadcast packet are simultaneously sent every 5 seconds.
- the advantage of the setting is that the device waking up from the non-working mode can immediately receive the report of the sender. The message is replied to the transmitting terminal to identify the existence of the device, which lays a foundation for realizing mutual control between the transmitting terminal and the device.
- the present embodiment increases the success rate of device discovery by using the method of cyclically transmitting packets in a set period.
- the method of transmitting multicast packets and broadcast packets simultaneously or sequentially not only solves the problem that the routers cannot communicate with multicast packets when the compatibility of the routers is poor, but also avoids the use of cascading when using broadcast packets. Only some mobile terminals in the LAN caused by multiple routers can receive packets. When the router is compatible with the forwarding of multicast packets, if there are multiple routers, all receiving terminals can receive multicast packets from the sending terminal, thus ensuring the comprehensiveness of the shared services.
- the apparatus may be implemented by software and/or hardware, and may be integrated into a transmitting terminal such as a television set, a set top box, a mobile phone, a tablet computer, or the like.
- a transmitting terminal such as a television set, a set top box, a mobile phone, a tablet computer, or the like.
- the device for terminal communication provided by this embodiment includes: a message sending module 310 and an attribute information storage module 320.
- the packet sending module 310 is configured to send a packet to the receiving terminal by using the router according to the zero-configuration network service protocol, where the preset packet sending manner includes a broadcast mode;
- the attribute information storage module 320 is configured to: when obtaining the response information to the message sent by the receiving terminal, storing the attribute information of the receiving terminal in the response information, according to the attribute information of the receiving terminal The receiving terminal establishes a communication connection;
- the sending terminal is any one of the terminals connected to the local area network, and the receiving terminal is all terminals except the sending terminal in the local area network.
- the technical solution provided in this embodiment improves the zero-configuration network service protocol, and the broadcast mode is added as one of the preset message sending modes on the basis that the default packet sending mode is multicast. Since all routers are compatible with the forwarding of broadcast packets, the packets are sent to the receiving terminal according to the preset packet sending manner, which solves the problem that different terminals cannot be mutually discovered due to poor compatibility of the router in the related art. problem.
- the attribute information of the receiving terminal is stored in the response information, and the transmitting terminal can identify all receiving terminals accessed in the local area network by using the attribute information of the receiving terminal, and can The attribute information establishes a communication connection with all receiving terminals, thereby laying a foundation for realizing mutual control between multiple terminals.
- the message sending module is configured to:
- the packet is sent to the receiving terminal by the router according to the preset period and according to the preset packet sending manner, so as to prevent the receiving terminal from being unable to obtain the packet when the receiving terminal is in the non-working mode.
- the packet sending module is further configured to:
- the primary router forwards the multicast packet corresponding to the multicast mode to the primary router according to the zero-configuration network service protocol, in the case that the primary router supports the forwarding of the multicast packet, according to the multicast mode and the broadcast mode.
- Each secondary router cascading with the primary router, and a broadcast message corresponding to the broadcast mode by the primary router is forwarded to at least one secondary router cascading with the primary router, wherein each The secondary routers are configured to send the multicast message and/or the broadcast message to a receiving terminal that is in communication connection with the secondary router.
- the multicast message and the broadcast message both include the attribute information of the sending terminal, where the attribute information of the sending terminal includes the service type and sending of the sending terminal.
- the attribute information of the receiving terminal includes a service type of the receiving terminal, an internet protocol address of the receiving terminal, and a service port number of the receiving terminal.
- the device for providing terminal communication can perform the method for terminal communication provided by any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects of the execution method.
- the device for providing terminal communication can perform the method for terminal communication provided by any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects of the execution method.
- a method for terminal communication applied to a transmitting terminal provided by any embodiment of the present disclosure.
- FIG. 4a is a flowchart of a method for communication of a terminal according to Embodiment 4 of the present disclosure.
- the method may be implemented by a device for communication by a terminal, and the device may be implemented by software and/or hardware, and the device may be integrated in an electronic device.
- the electronic device may include a television, a smart phone, a tablet, a printer, and the like.
- the method of this embodiment is applied to a receiving terminal, and the explanation of the same or corresponding terms as the above embodiment is not described herein again.
- the method for providing terminal communication in this embodiment includes:
- the router may not support the transmission of the multicast packet. Therefore, in order to ensure that the receiving terminal can forward the packet sent by the sending terminal, the transmitting terminal includes at least the broadcast packet.
- the attribute information of the sending terminal includes a service type of the sending terminal, an internet protocol address of the sending terminal, and a service port number of the sending terminal.
- the transmitting terminal in this embodiment is any terminal that is accessed in the local area network, and the receiving terminal is all terminals except the transmitting terminal in the local area network.
- the attribute information of the receiving terminal includes a service type of the receiving terminal, an internet protocol address of the receiving terminal, and a service port number of the receiving terminal.
- FIG. 4b is a schematic diagram of a television set and a plurality of mobile terminals that are mutually discovered according to Embodiment 4 of the present disclosure.
- the router 600 forwards the multicast packet and the broadcast packet to the broadcast packet.
- the router 600 supports the forwarding of the multicast message, the multicast message and the broadcast message are obtained. If it is not supported, only the broadcast packet is obtained.
- the attribute information of the TV 100 in the multicast packet or the broadcast packet is stored in the service list, and the attribute information of the broadcast packet is unicast (for example, The MDNS response is fed back to the television set 100 according to the IP address access in the attribute information of the television set.
- the newly entered mobile device will also record the television after receiving the message of the television set 100.
- the attribute information of the machine is replied to, so that all terminals in the LAN can discover each other.
- the receiving terminal when the receiving terminal is in the listening state, obtains the packet sent by the sending terminal based on the zero-configuration network service protocol, and the packet does not support the forwarding group because the packet includes at least the broadcast packet.
- the receiving terminal caused by the broadcast message cannot obtain the message sent by the sending terminal.
- the attribute information of the sending terminal in the message is stored, and the attribute information of the receiving terminal is also fed back to the sending terminal according to the attribute information of the sending terminal, so that the sending terminal establishes a communication connection with the receiving terminal, thereby implementing multiple terminals.
- the basis for mutual control of communication has been laid.
- FIG. 5 is a structural block diagram of an apparatus for terminal communication according to Embodiment 5 of the present disclosure.
- the apparatus may be implemented by software and/or hardware, and may be integrated into a receiving terminal such as a television, a set top box, a mobile phone, a tablet computer, or the like.
- the device for terminal communication provided by this embodiment includes: a message acquiring module 510, an attribute information storage module 520, and an attribute information sending module 520.
- the packet obtaining module 510 is configured to: when the receiving terminal is in the listening response state, obtain the packet sent by the sending terminal according to the zero-configuration network service protocol, where the packet includes a broadcast packet;
- the attribute information storage module 520 is configured to store attribute information of the sending terminal included in the message
- the attribute information sending module 520 is configured to send the attribute information of the receiving terminal to the sending terminal according to the attribute information of the sending terminal, so that the sending terminal according to the attribute information of the receiving terminal and the receiving The terminal establishes a communication connection;
- the sending terminal is any one of the terminals connected to the local area network, and the receiving terminal is all terminals except the sending terminal in the local area network.
- the receiving terminal when the receiving terminal is in the listening state, obtains the packet sent by the sending terminal based on the zero-configuration network service protocol, and the packet does not support the forwarding group because the packet includes at least the broadcast packet.
- the receiving terminal caused by the broadcast message cannot obtain the message sent by the sending terminal.
- the attribute information of the sending terminal in the message is stored, and the attribute information of the receiving terminal is also fed back to the sending terminal according to the attribute information of the sending terminal, so that the sending terminal establishes a communication connection with the receiving terminal, thereby implementing multiple terminals.
- the attribute information of the sending terminal includes a service type of the sending terminal, an internet protocol address of the sending terminal, and a service port number of the sending terminal.
- the attribute information of the receiving terminal includes a service type of the receiving terminal, an internet protocol address of the receiving terminal, and a service port number of the receiving terminal.
- the device for providing terminal communication can perform the method for terminal communication provided by any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects of the execution method.
- the device for providing terminal communication can perform the method for terminal communication provided by any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects of the execution method.
- a method for terminal communication applied to a receiving terminal provided by any embodiment of the present disclosure.
- FIG. 6 is a schematic structural diagram of a terminal according to Embodiment 6 of the present disclosure.
- FIG. 6 illustrates a block diagram of an exemplary terminal 12 suitable for use in implementing embodiments of the present disclosure.
- the terminal 12 shown in FIG. 6 is merely an example and should not impose any limitation on the function and scope of use of the embodiments of the present disclosure.
- terminal 12 is embodied in the form of a general purpose computing device.
- the components of terminal 12 may include, but are not limited to, one or more processors or processing units 16, system memory 28, and bus 18 that connects different system components, including system memory 28 and processing unit 16.
- Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any of a variety of bus structures.
- these architectures include, but are not limited to, the Industry Standard Architecture (ISA) bus, the MicroChannel Architecture (MAC) bus, the Enhanced ISA Bus, and the Video Electronics Standards Association. , VESA) Local Bus and Peripheral Component Interconnect (PCI) bus.
- Terminal 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by terminal 12, including volatile and non-volatile media, removable and non-removable media.
- System memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and/or cache memory 32.
- Terminal 12 may further include other removable/non-removable, volatile/non-volatile computer system storage media.
- storage system 34 may be configured to read and write non-removable, non-volatile magnetic media (not shown in Figure 6, commonly referred to as "hard disk drives”).
- a disk drive configured to read and write to a removable non-volatile disk (eg, a "floppy disk"), and a removable non-volatile disk (eg, a compact disk read-only memory) may be provided.
- each drive can be coupled to bus 18 via one or more data medium interfaces.
- Memory 28 can include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of each embodiment of the present disclosure.
- a program/utility 40 having a set (at least one) of program modules 42 may be stored, for example, in memory 28, such program modules 42 including but not limited to an operating system, one or more applications, other program modules, and program data. An implementation of the network environment may be included in each or some of these examples.
- Program module 42 typically performs the functions and/or methods of the embodiments described in this disclosure.
- Terminal 12 may also be in communication with one or more external devices 14 (e.g., a keyboard, pointing device, display 24, etc.), and may also be in communication with one or more devices that enable a user to interact with the terminal 12, and/or Terminal 12 can communicate with any device (e.g., network card, modem, etc.) that is in communication with one or more other computing devices. This communication can take place via an input/output (I/O) interface 22.
- the terminal 12 can also communicate with one or more networks (such as a local area network (LAN), a wide area network (WAN), and/or a public network, such as the Internet) through the network adapter 20. As shown, network adapter 20 communicates with other modules of terminal 12 via bus 18.
- LAN local area network
- WAN wide area network
- public network such as the Internet
- terminal 12 may be utilized in connection with terminal 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, independent redundant disk arrays ( Redundant Arrays of Independent Disks (RAID) systems, tape drives, and data backup storage systems.
- RAID Redundant Arrays of Independent Disks
- the processing unit 16 executes a plurality of functional applications and data processing by running a program stored in the system memory 28, for example, implementing a terminal communication method applied to the transmitting terminal provided by the embodiments of the present disclosure.
- Embodiments of the present disclosure also provide an apparatus comprising: one or more processors; storage means for storing one or more programs when the one or more programs are used by the one or more processors Executing, the one or more processors to implement the terminal communication method applied to the receiving terminal provided by the embodiment of the present disclosure, including:
- the receiving terminal When the receiving terminal is in the listening response state, obtaining a packet sent by the sending terminal based on the zero-configuration network service protocol, where the packet includes a broadcast packet;
- the sending terminal is any one of the terminals connected to the local area network, and the receiving terminal is all terminals except the sending terminal in the local area network.
- processor can also implement the technical solution of the terminal communication method applied to the receiving terminal provided by any embodiment of the present disclosure.
- the hardware structure and function of the device can be explained in the content of Embodiment 6.
- Embodiment 7 of the present disclosure further provides a computer readable storage medium having stored thereon a computer program, wherein the program is executed by a processor to implement a method for terminal communication applied to a transmitting terminal provided by any embodiment of the present disclosure , the method includes:
- the sending terminal is any one of the terminals connected to the local area network, and the receiving terminal is all terminals except the sending terminal in the local area network.
- the computer executable instructions are not limited to the method operations as described above, and may also be applied to the transmitting terminal provided by any embodiment of the present disclosure. Related operations in the terminal communication method.
- the computer storage medium of an embodiment of the present disclosure may employ any combination of one or more computer readable mediums.
- the computer readable medium can be a computer readable signal medium or a computer readable storage medium.
- the computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above.
- a computer readable storage medium includes: an electrical connection having one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read only memory (Read-Only Memory) , ROM), Erasable Programmable Read Only Memory (EPROM) or flash memory, optical fiber, portable compact disk read only memory (CD-ROM), optical storage device, magnetic storage device, or any of the above A suitable combination.
- a computer readable storage medium can be any tangible medium that can contain or store a program, which can be used by or in connection with an instruction execution system, apparatus or device.
- a computer readable signal medium may include a data signal that is propagated in the baseband or as part of a carrier, carrying computer readable program code. Such propagated data signals can take a variety of forms including, but not limited to, electromagnetic signals, optical signals, or any suitable combination of the foregoing.
- the computer readable signal medium can also be any computer readable medium other than a computer readable storage medium, which can transmit, propagate, or transport a program for use by or in connection with the instruction execution system, apparatus, or device. .
- Program code embodied on a computer readable medium can be transmitted by any suitable medium, including but not limited to wireless, wire, fiber optic cable, radio frequency (RF), etc., or any suitable combination of the foregoing.
- suitable medium including but not limited to wireless, wire, fiber optic cable, radio frequency (RF), etc., or any suitable combination of the foregoing.
- Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, or a combination thereof, including an object oriented programming language - such as Java, Smalltalk, C++, and also conventional. Procedural programming language - such as the "C" language or a similar programming language.
- the program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer, partly on the remote computer, or entirely on the remote computer or server.
- the remote computer can be connected to the user's computer via any kind of network, including a local area network (LAN) or wide area network (WAN), or can be connected to an external computer (eg, using an Internet service provider) Internet connection).
- LAN local area network
- WAN wide area network
- Internet service provider Internet service provider
- the embodiment of the present disclosure further provides another computer readable storage medium, when executed by a computer processor, for performing a terminal communication method applied to a receiving terminal, the method comprising:
- the receiving terminal When the receiving terminal is in the listening response state, obtaining a packet sent by the sending terminal based on the zero-configuration network service protocol, where the packet includes a broadcast packet;
- the sending terminal is any one of the terminals connected to the local area network, and the receiving terminal is all terminals except the sending terminal in the local area network.
- a storage medium containing computer executable instructions the computer executable instructions are not limited to the method operations as described above, and may also be applied to the receiving terminal provided by any embodiment of the present disclosure. Related operations in the terminal communication method. For an introduction to the storage medium, refer to the explanation in the content of the seventh embodiment.
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer Security & Cryptography (AREA)
- Computing Systems (AREA)
- Mobile Radio Communication Systems (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
Disclosed is a terminal communication method, comprising: transmitting a message to reception terminals by means of a router on the basis of a zero configuration network service protocol according to a preset message transmission mode, the preset message transmission mode including a broadcasting mode; and when response information, transmitted by the reception terminals, for the message is acquired, storing attribute information of the reception terminals in the response information, and establishing a communication connection with the reception terminals according to the attribute information of the reception terminals, the transmission terminal being any one terminal accessing a local area network, and the reception terminals being all the other terminals except the transmission terminal in the local area network. Further disclosed are a terminal communication device, a terminal and a storage medium.
Description
本申请要求在2018年2月6日提交中国专利局、申请号为201810117224.9的中国专利申请的优先权,该申请的全部内容通过引用结合在本申请中。The present application claims the priority of the Chinese Patent Application, the entire disclosure of which is hereby incorporated by reference.
本公开实施例涉及通信技术领域,例如涉及一种终端通信的方法、装置、终端及存储介质。Embodiments of the present disclosure relate to the field of communications technologies, and relate, for example, to a method, an apparatus, a terminal, and a storage medium for terminal communication.
近年来,随着移动互联网技术的飞速发展,手机已经逐步替代个人计算机(Personal Computer,PC)成为个人数据与计算的中心节点。通过无线网络将手机内容(如照片、视频或音乐等)共享到其它设备(如电视、PC或手机等),并实现互相控制的多屏互动技术应运而生。而设备间共享和互控的前提是能够互相发现,因此设备间的发现协议就成了设备间互动技术的核心组成部分。In recent years, with the rapid development of mobile Internet technology, mobile phones have gradually replaced personal computers (PCs) as the central node of personal data and computing. Sharing mobile content (such as photos, videos, or music) over a wireless network to other devices (such as TVs, PCs, or mobile phones) and implementing multi-screen interactive technology that controls each other has emerged. The premise of sharing and mutual control between devices is that they can discover each other, so the discovery protocol between devices becomes a core component of the interactive technology between devices.
目前主流的局域网内设备互联互通协议为零配置网络服务(Zero configuration networking,Zeroconf)协议,目标是让用户能便捷的连接多种网络设备,例如计算机、打印机等。整个搭建网络的过程都是通过程式自动化实现。苹果公司的产品全面使用了Zeroconf服务,因此想要和苹果产品实现互通也必须在设备上加入Zeroconf服务。At present, the mainstream device interconnection protocol in the local area network is Zero configuration networking (Zeroconf) protocol, and the goal is to enable users to easily connect various network devices, such as computers and printers. The entire process of building a network is automated through program automation. Apple's products use the Zeroconf service in its entirety, so you want to be able to interoperate with Apple products and you must add the Zeroconf service to your device.
然而,在基于Zeroconf协议实现多个设备相互发现的过程中,由于很多路由器的兼容性较差,导致局域网中某个设备基于Zeroconf协议所发送的报文不能通过路由器转发到其它设备,从而导致该设备与其他设备之间不能相互识别,影响设备之间的通信和互控。However, in the process of realizing the mutual discovery of multiple devices based on the Zeroconf protocol, due to the poor compatibility of many routers, packets sent by a device on the local area network based on the Zeroconf protocol cannot be forwarded to other devices through the router. Devices and other devices cannot recognize each other and affect communication and mutual control between devices.
发明内容Summary of the invention
本公开实施例提供一种终端通信的方法、装置、终端及存储介质,提升了局域网中的多个终端彼此相互识别的成功率,实现了多个终端之间的通信。The embodiments of the present disclosure provide a method, an apparatus, a terminal, and a storage medium for terminal communication, which improve the success rate of mutual recognition of multiple terminals in a local area network, and realize communication between multiple terminals.
在一实施例中,本公开实施例提供了一种终端通信的方法,应用于发送终端,该方法包括:In an embodiment, an embodiment of the present disclosure provides a method for terminal communication, which is applied to a transmitting terminal, and the method includes:
基于零配置网络服务协议,按照预设报文发送方式通过路由器向接收终端发送报文,其中,所述预设报文发送方式包括广播方式;And sending, according to the zero-configuration network service protocol, the packet to the receiving terminal by using a preset packet sending manner, where the preset packet sending manner includes a broadcast mode;
当获取到所述接收终端发送的对所述报文的应答信息时,存储所述应答信息中所述接收终端的属性信息,根据所述接收终端的属性信息与所述接收终端建立通信连接;And storing, by the receiving terminal, the response information of the receiving message, storing the attribute information of the receiving terminal in the response information, and establishing a communication connection with the receiving terminal according to the attribute information of the receiving terminal;
其中,所述发送终端为局域网中所接入的任意一个终端,所述接收终端为所述局域网中除所述发送终端之外的所有终端。The sending terminal is any one of the terminals connected to the local area network, and the receiving terminal is all terminals except the sending terminal in the local area network.
在一实施例中,本公开实施例还提供了一种终端通信的装置,应用于发送终端,该装置包括:In an embodiment, an embodiment of the present disclosure further provides an apparatus for terminal communication, which is applied to a transmitting terminal, and the apparatus includes:
报文发送模块,设置为基于零配置网络服务协议,按照预设报文发送方式通过路由器向接收终端发送报文,其中,所述预设报文发送方式包括广播方式;The packet sending module is configured to send a packet to the receiving terminal by using a router according to the zero-configuration network service protocol, where the preset packet sending manner includes a broadcast mode;
属性信息存储模块,设置为当获取到所述接收终端发送的对所述报文的应答信息时,存储所述应答信息中所述接收终端的属性信息,根据所述接收终端的属性信息与所述接收终端建立通信连接;The attribute information storage module is configured to: when obtaining the response information to the message sent by the receiving terminal, storing the attribute information of the receiving terminal in the response information, according to the attribute information of the receiving terminal Said receiving terminal establishes a communication connection;
其中,所述发送终端为局域网中所接入的任意一个终端,所述接收终端为所述局域网中除所述发送终端之外的所有终端。The sending terminal is any one of the terminals connected to the local area network, and the receiving terminal is all terminals except the sending terminal in the local area network.
在一实施例中,本公开实施例还提供了一种终端通信的方法,应用于接收终端,该方法包括:In an embodiment, an embodiment of the present disclosure further provides a method for terminal communication, which is applied to a receiving terminal, where the method includes:
当接收终端处于监听应答状态时,获取发送终端基于零配置网络服务协议发送的报文,所述报文包括广播报文;When the receiving terminal is in the listening response state, obtaining a packet sent by the sending terminal based on the zero-configuration network service protocol, where the packet includes a broadcast packet;
存储所述报文中所包含的所述发送终端的属性信息;Storing attribute information of the sending terminal included in the packet;
根据所述发送终端的属性信息,将所述接收终端的属性信息发送给所述发送终端,以使所述发送终端根据所述接收终端的属性信息与所述接收终端建立通信连接;Transmitting the attribute information of the receiving terminal to the sending terminal according to the attribute information of the sending terminal, so that the sending terminal establishes a communication connection with the receiving terminal according to the attribute information of the receiving terminal;
其中,所述发送终端为局域网中所接入的任意一个终端,所述接收终端为所述局域网中除所述发送终端之外的所有终端。The sending terminal is any one of the terminals connected to the local area network, and the receiving terminal is all terminals except the sending terminal in the local area network.
在一实施例中,本公开实施例还提供了一种终端通信的装置,应用于接收终端,该装置包括:In an embodiment, an embodiment of the present disclosure further provides an apparatus for terminal communication, which is applied to a receiving terminal, where the apparatus includes:
报文获取模块,设置为当接收终端处于监听应答状态时,获取发送终端基于零配置网络服务协议发送的报文,所述报文包括广播报文;The packet obtaining module is configured to: when the receiving terminal is in the monitoring response state, obtain the packet sent by the sending terminal according to the zero-configuration network service protocol, where the packet includes a broadcast packet;
属性信息存储模块,设置为存储所述报文中所包含的所述发送终端的属性信息;An attribute information storage module, configured to store attribute information of the sending terminal included in the message;
属性信息发送模块,设置为根据所述发送终端的属性信息,将所述接收终端的属性信息发送给所述发送终端,以使所述发送终端根据所述接收终端的属性信息与所述接收终端建立通信连接;The attribute information sending module is configured to send the attribute information of the receiving terminal to the sending terminal according to the attribute information of the sending terminal, so that the sending terminal and the receiving terminal according to the attribute information of the receiving terminal Establish a communication connection;
其中,所述发送终端为局域网中所接入的任意一个终端,所述接收终端为所述局域网中除所述发送终端之外的所有终端。The sending terminal is any one of the terminals connected to the local area network, and the receiving terminal is all terminals except the sending terminal in the local area network.
在一实施例中,本公开实施例还提供了一种终端,该终端包括:In an embodiment, an embodiment of the present disclosure further provides a terminal, where the terminal includes:
一个或多个处理器;One or more processors;
存储装置,设置为存储一个或多个程序,a storage device configured to store one or more programs,
当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多 个处理器实现本公开任意实施例所提供的应用于发送终端的终端通信的方法。The one or more programs are executed by the one or more processors such that the one or more processors implement a method of terminal communication for a transmitting terminal provided by any of the embodiments of the present disclosure.
在一实施例中,本公开实施例还提供了一种终端,该终端包括:In an embodiment, an embodiment of the present disclosure further provides a terminal, where the terminal includes:
一个或多个处理器;One or more processors;
存储装置,设置为存储一个或多个程序,a storage device configured to store one or more programs,
当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现本公开任意实施例所提供的应用于接收终端的终端通信的方法。The one or more programs are executed by the one or more processors such that the one or more processors implement a method for terminal communication applied to a receiving terminal provided by any of the embodiments of the present disclosure.
在一实施例中,本公开实施例还提供了一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现本公开任意实施例所提供的应用于发送终端的终端通信的方法。In an embodiment, an embodiment of the present disclosure further provides a computer readable storage medium having stored thereon a computer program, when executed by a processor, implementing a terminal applied to a transmitting terminal according to any embodiment of the present disclosure. The method of communication.
在一实施例中,本公开实施例还提供了一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现本公开任意实施例所提供的应用于接收终端的终端通信的方法。In an embodiment, an embodiment of the present disclosure further provides a computer readable storage medium having stored thereon a computer program, when executed by a processor, implementing a terminal applied to a receiving terminal provided by any embodiment of the present disclosure The method of communication.
本公开实施例通过改进零配置网络服务协议,在默认的报文发送方式为组播发送的基础上,增加了广播方式作为其中一种预设报文发送方式。由于所有路由器都可兼容广播报文的转发,因此,通过按照预设报文发送方式向接收终端发送报文,解决了相关技术中由于路由器的兼容性差而导致的不同终端之间无法相互发现的问题。当获取到接收终端发送的对报文的应答信息时,存储应答信息中接收终端的属性信息,发送终端可通过接收终端的属性信息识别局域网中接入的所有接收终端,并可通过接收终端的属性信息与所有接收终端建立通信连接,从而为实现多个终端之间的互控奠定基础。The embodiment of the present disclosure improves the zero-configuration network service protocol, and adds a broadcast mode as one of the preset message transmission modes on the basis that the default packet transmission mode is multicast transmission. Since all routers are compatible with the forwarding of broadcast packets, the packets are sent to the receiving terminal according to the preset packet sending manner, which solves the problem that different terminals cannot be mutually discovered due to poor compatibility of the router in the related art. problem. When the response information of the packet sent by the receiving terminal is obtained, the attribute information of the receiving terminal is stored in the response information, and the transmitting terminal can identify all receiving terminals accessed in the local area network by using the attribute information of the receiving terminal, and can The attribute information establishes a communication connection with all receiving terminals, thereby laying a foundation for realizing mutual control between multiple terminals.
图1为本公开实施例一提供的一种终端通信的方法的流程图;FIG. 1 is a flowchart of a method for communication of a terminal according to Embodiment 1 of the present disclosure;
图2为本公开实施例二提供的一种终端通信的方法的流程图;2 is a flowchart of a method for communication of a terminal according to Embodiment 2 of the present disclosure;
图3为本公开实施例三提供的一种终端通信的装置的结构框图;3 is a structural block diagram of an apparatus for terminal communication according to Embodiment 3 of the present disclosure;
图4a为本公开实施例四提供的一种终端通信的方法的流程图;4a is a flowchart of a method for terminal communication according to Embodiment 4 of the present disclosure;
图4b为本公开实施例四提供的电视机与多个移动终端相互发现的示意图;4b is a schematic diagram of a television set and a plurality of mobile terminals being discovered by each other according to Embodiment 4 of the present disclosure;
图5为本公开实施例五提供的一种终端通信的装置的结构框图;5 is a structural block diagram of an apparatus for terminal communication according to Embodiment 5 of the present disclosure;
图6为本公开实施例六提供的一种终端的结构示意图。FIG. 6 is a schematic structural diagram of a terminal according to Embodiment 6 of the present disclosure.
下面结合附图和实施例对本公开作进一步的说明。此处所描述的实施例仅仅用于解释本公开,而非对本公开的限定。为了便于描述,附图中仅示出了与本公开相关的部分而非全部结构。The present disclosure will be further described below in conjunction with the accompanying drawings and embodiments. The embodiments described herein are merely illustrative of the disclosure and are not intended to limit the invention. For the convenience of description, only some but not all of the structures related to the present disclosure are shown in the drawings.
实施例一Embodiment 1
图1为本公开实施例一提供的一种终端通信的方法的流程图,该方法可以由终端通信的装置来执行,该装置可以通过软件和/或硬件的方式实现,该装置可以集成在电子设备中,该电子设备可以包括电视机、智能手机、平板电脑以及打印机等。本实施例的方法可应用于发送终端,该发送终端可以为局域网中所接入的任意一个终端。参见图1,本实施例的方法包括:FIG. 1 is a flowchart of a method for communication of a terminal according to Embodiment 1 of the present disclosure. The method may be implemented by a device for communication by a terminal, and the device may be implemented by software and/or hardware, and the device may be integrated in an electronic device. In the device, the electronic device may include a television, a smart phone, a tablet, a printer, and the like. The method in this embodiment can be applied to a sending terminal, and the sending terminal can be any one of the terminals accessed in the local area network. Referring to FIG. 1, the method of this embodiment includes:
S110、基于零配置网络服务协议,按照预设报文发送方式通过路由器向接收终端发送报文,其中,所述预设报文发送方式包括广播方式。S110. The device sends a packet to the receiving terminal by using a router according to the zero-configuration network service protocol, where the preset packet sending manner includes a broadcast mode.
其中,零配置网络服务协议是一种用于自动生成可用互联网协议(Internet Protocol,IP)地址的网络技术,不需要额外的手动配置和专属的配置服务器。基于零配置网络服务协议,接入局域网中的设备以组播域名系统(multicast Domain Name System,MDNS)协议为基础的组播方式发送报文。Among them, the zero-configuration network service protocol is a network technology for automatically generating an available Internet Protocol (IP) address, without requiring additional manual configuration and a dedicated configuration server. Based on the zero-configuration network service protocol, devices connected to the local area network transmit packets in the multicast mode based on the multicast domain name system (MDNS) protocol.
然而,由于很多路由器不能兼容组播报文的转发,导致接收终端都无法获取到发送终端所发送的组播报文,从而影响了终端之间的相互发现。因此,为了提高不同终端之间相互发现的成功率,本实施例提供的预设报文发送方式中还包括了广播方式。由于所有路由器都可以转发广播报文,因此,在传统零配置网络服务协议的报文发送方式为组播方式的基础上,通过增加广播方式,解决了相关技术中因为路由器无法转发组播报文,而导致的不同设备之间无法相互发现的问题。However, because many routers are not compatible with the forwarding of multicast packets, the receiving terminal cannot obtain the multicast packets sent by the sending terminal, which affects the mutual discovery between the terminals. Therefore, in order to improve the success rate of mutual discovery between different terminals, the preset packet sending manner provided in this embodiment further includes a broadcast mode. As all the routers can forward the broadcast packets, the routers cannot forward the multicast packets because the routers cannot forward the packets based on the multicast mode of the traditional zero-configuration network service protocol. , resulting in problems that cannot be discovered by different devices.
本实施例提供的技术方案是对传统零配置网络服务协议的改进,接入局域网中的任何终端(包括发送终端和接收终端)都无需安装对应的客户端软件,也无需增加新的广播和组播报文的发送协议。任意一个终端只要接入了局域网,且该终端处于正常工作的情况下,改进后的零配置网络服务协议都可得到启动,不同终端可以相互发现,从而建立相互之间的通信连接。The technical solution provided in this embodiment is an improvement on the traditional zero-configuration network service protocol, and any terminal (including the transmitting terminal and the receiving terminal) in the access LAN does not need to install the corresponding client software, and does not need to add new broadcasts and groups. The transmission protocol of the broadcast message. As long as any terminal accesses the local area network and the terminal is in normal working condition, the improved zero-configuration network service protocol can be started, and different terminals can discover each other, thereby establishing a communication connection with each other.
在一实施例中,由于零配置网络服务协议是苹果公司所提供的服务协议,本公开实施例还可将其应用到安卓系统中,即除了安装有苹果公司的移动操作系统(iPhone Operating System,IOS)的设备可以享受该协议所提供的服务,安装有安卓系统的设备也可以应用本公开实施例提供的技术方案与其他设备相互识别,并进行相互控制。In an embodiment, since the zero-configuration network service protocol is a service protocol provided by Apple, the embodiment of the present disclosure may also apply the same to the Android system, that is, in addition to the mobile operating system (iPhone Operating System, which is installed by Apple). The device provided by the IOS can enjoy the service provided by the protocol, and the device installed with the Android system can also recognize and interact with each other by using the technical solutions provided by the embodiments of the present disclosure.
示例性的,本实施例中,发送终端所发送的报文中可包括发送终端的服务类型(例如打印服务或电视服务等)、互联网协议地址(Internet Protocol Address,IP地址)或服务端口号等,该报文可采用用户数据报协议(User Datagram Protocol,UDP)包的方式发送。接收终端在获取到发送终端的报文后,将回馈给发送终端自身的属性信息,以供与发送终端建立通信连接。Exemplarily, in this embodiment, the message sent by the sending terminal may include a service type of the sending terminal (such as a print service or a television service, etc.), an Internet Protocol Address (IP address), or a service port number. The message may be sent by using a User Datagram Protocol (UDP) packet. After receiving the packet of the sending terminal, the receiving terminal feeds back the attribute information of the sending terminal itself to establish a communication connection with the sending terminal.
S120、当获取到接收终端发送的对报文的应答信息时,存储应答信息中接 收终端的属性信息,根据所述接收终端的属性信息与接收终端建立通信连接。S120. When obtaining the response information to the packet sent by the receiving terminal, storing the attribute information of the receiving terminal in the response information, and establishing a communication connection with the receiving terminal according to the attribute information of the receiving terminal.
其中,接收终端可以为局域网中除发送终端之外的所有终端,任何新接入局域网的终端也都可作为接收终端。接收终端的属性信息包括接收终端的服务类型、IP地址以及服务端口号。The receiving terminal may be all terminals except the transmitting terminal in the local area network, and any terminal newly accessing the local area network may also serve as the receiving terminal. The attribute information of the receiving terminal includes the service type, IP address, and service port number of the receiving terminal.
示例性的,当发送终端获取到接收终端发送的对报文的应答信息时,可将不同接收终端的属性信息存储到服务列表中。在服务列表中,可以显示不同接收终端对应服务名称、服务类型等信息。当局域网中每新接入一个设备时,如果获取到发送终端所发送的报文,则可通过向发送终端反馈对该报文的应答信息,使得发送终端能够快速发现该新接入的设备。Exemplarily, when the sending terminal acquires the response information of the packet sent by the receiving terminal, the attribute information of the different receiving terminal may be stored in the service list. In the service list, information such as the service name and service type of different receiving terminals can be displayed. When a device is newly connected to the local area network, if the message sent by the sending terminal is obtained, the sending terminal can feed back the newly accessed device by feeding back the response message to the sending terminal.
在一实施例中,发送终端在存储接收终端的属性信息之后,用户可在发送终端的服务列表中看到多个已经接入局域网的接收终端,从而可实现多个终端设备间的服务共享。对于共享的服务,用户可根据实际需求选择自行选择,例如,如果发送终端为手机,接收终端为打印机、电视机以及平板电脑等多个终端,在手机端的服务列表里将存在打印机、电视机以及平板电脑等终端的标识。当用户点击了打印机对应的标识时,用户所持手机可与打印机建立通信连接,通过在手机端进行操作,即可将手机中需要打印的文件通过该打印机进行打印。In an embodiment, after the transmitting terminal stores the attribute information of the receiving terminal, the user can see a plurality of receiving terminals that have accessed the local area network in the service list of the sending terminal, so that service sharing between the plurality of terminal devices can be implemented. For the shared service, the user can choose according to the actual needs. For example, if the sending terminal is a mobile phone, and the receiving terminal is a printer, a television, a tablet, and the like, there will be a printer, a television, and a service list in the mobile phone. The identity of the terminal such as a tablet. When the user clicks on the identifier corresponding to the printer, the mobile phone held by the user can establish a communication connection with the printer, and by performing operations on the mobile phone, the file to be printed in the mobile phone can be printed through the printer.
示例性的,由于接收终端的属性信息已被发送终端存入服务列表中,因此,发送终端在访问或控制接收终端时,通过接收终端的属性信息中的IP地址即可进行一对一的访问或控制。Exemplarily, since the attribute information of the receiving terminal has been stored in the service list by the sending terminal, the transmitting terminal can perform one-to-one access by receiving the IP address in the attribute information of the terminal when accessing or controlling the receiving terminal. Or control.
本实施例的技术方案,通过改进零配置网络服务协议,在默认的报文发送方式为组播发送的基础上,增加了广播方式作为其中一种预设报文发送方式。由于所有路由器都可兼容广播报文的转发,因此,通过按照预设报文发送方式向接收终端发送报文,解决了相关技术中由于路由器的兼容性差而导致的不同 终端之间无法相互发现的问题。当获取到接收终端发送的对报文的应答信息时,存储应答信息中接收终端的属性信息,发送终端可通过接收终端的属性信息识别局域网中接入的所有接收终端,并可通过接收终端的属性信息与所有接收终端建立通信连接,从而为实现多个终端之间的互控奠定基础。The technical solution of the embodiment improves the zero-configuration network service protocol, and the broadcast mode is added as one of the preset message sending modes on the basis that the default packet sending mode is multicast. Since all routers are compatible with the forwarding of broadcast packets, the packets are sent to the receiving terminal according to the preset packet sending manner, which solves the problem that different terminals cannot be mutually discovered due to poor compatibility of the router in the related art. problem. When the response information of the packet sent by the receiving terminal is obtained, the attribute information of the receiving terminal is stored in the response information, and the transmitting terminal can identify all receiving terminals accessed in the local area network by using the attribute information of the receiving terminal, and can The attribute information establishes a communication connection with all receiving terminals, thereby laying a foundation for realizing mutual control between multiple terminals.
实施例二Embodiment 2
图2为本公开实施例二提供的一种终端通信的方法的流程图,本实施例在上述实施例的基础上进行了优化,在广播方式的基础上,增加了按照组播方式发送报文,其中与上述实施例相同或相应的术语的解释在此不再赘述。参见图2,本实施例提供终端通信的方法包括:2 is a flowchart of a method for communication of a terminal according to Embodiment 2 of the present disclosure. This embodiment is optimized on the basis of the foregoing embodiment, and based on the broadcast mode, a message is sent according to the multicast mode. The explanation of the same or corresponding terms as in the above embodiments will not be repeated herein. Referring to FIG. 2, the method for providing terminal communication in this embodiment includes:
S210、基于零配置网络服务协议,在初级路由器支持转发组播报文情况下,按照组播方式和广播方式,通过该初级路由器将组播方式对应的组播报文转发到与该初级路由器级联的每个次级路由器,以及通过该初级路由器将广播方式对应的广播报文转发到与该初级路由器级联的至少一个次级路由器,其中,每个次级路由器设置为将下述至少一项发送到与该次级路由器存在通信连接的接收终端:组播报文和广播报文。S210, based on the zero-configuration network service protocol, in the case that the primary router supports the forwarding of the multicast packet, the multicast message corresponding to the multicast mode is forwarded to the primary router level by the primary router according to the multicast mode and the broadcast mode. Each secondary router of the connection, and the broadcast message corresponding to the broadcast mode is forwarded by the primary router to at least one secondary router cascading with the primary router, wherein each secondary router is set to at least one of the following The item is sent to the receiving terminal that has a communication connection with the secondary router: a multicast message and a broadcast message.
示例性的,本公开实施例中的预设报文发送方式除了广播方式之外,还包括基于零配置网络服务协议默认的组播方式。Exemplarily, the preset message sending manner in the embodiment of the present disclosure includes a default multicast mode based on the zero-configuration network service protocol in addition to the broadcast mode.
其中,采用广播方式,虽然可以一次传送完报文,但是不可实现一次将报文传送到所有目标节点。例如对于家庭中存在级联路由器的情况,如果初级路由器A下面还级联有两个次级路由器B和路由器C,单纯采用广播方式发送报文,则路由器B和路由器C中只能有一个路由器接收到广播报文。Among them, the broadcast mode is adopted, although the message can be transmitted at one time, but the message cannot be transmitted to all target nodes once. For example, in the case where there is a cascade router in the home, if there are two secondary routers B and R below the primary router A, and only the broadcast mode is used to send the message, there can be only one router in the router B and the router C. Received a broadcast message.
然而,在路由器支持转发组播报文情况下,组播方式可以实现一次将报文 传送到所有目标节点的目的,例如可通过路由器A将组播报文同时转发到路由器B和路由器C。However, in the case that the router supports the forwarding of multicast packets, the multicast mode can be used to transmit the packets to all the destination nodes at a time. For example, the multicast packets can be forwarded to the router B and the router C through the router A.
综上所述,可以采用组播方式和广播方式发送报文,当路由器不支持组播报文的转发时,可将广播报文转发到接收终端,保证了局域网中设备的发现不受影响。而当路由器支持组播报文的转发时,可组播报文发送到所有接收终端,保证了设备发现的全面性。In summary, the packet can be sent in the multicast mode or in the broadcast mode. When the router does not support the forwarding of the multicast packet, the broadcast packet can be forwarded to the receiving terminal to ensure that the device discovery in the LAN is not affected. When the router supports the forwarding of multicast packets, the multicast packets can be sent to all receiving terminals to ensure the comprehensiveness of device discovery.
示例性的,如果按照组播方式和广播方式发送报文,则组播报文和广播报文中均包括所述发送终端的属性信息,该发送终端的属性信息包括发送终端的服务类型、发送终端的互联网协议地址以及发送终端的服务端口号。For example, if the packet is sent in the multicast mode and the broadcast mode, the multicast message and the broadcast message include the attribute information of the sending terminal, and the attribute information of the sending terminal includes the service type of the sending terminal and the sending. The Internet Protocol address of the terminal and the service port number of the sending terminal.
在一实施例中,在按照广播方式和组播方式分别发送广播报文和组播报文时,可首先发送组播报文,若在设定时间内(例如30秒)未收到接收终端对该组播报文的应答信息,则说明路由器不支持组播报文的转发或者局域网中除当前发送终端之外,不存在任何接收终端。此时,当前发送终端再按照广播方式发送广播报文,如果在设定时间内(例如10秒),接收到了其他终端对该广播报文的应答信息,则说明局域网中存在接收终端,组播报文发送后未收到应答信息是因为路由器不支持组播报文的转发。通过采用上述方式,可验证路由器是否兼容组播报文的发送。In an embodiment, when the broadcast packet and the multicast packet are respectively sent according to the broadcast mode and the multicast mode, the multicast packet may be sent first, and if the receiving terminal is not received within a set time (for example, 30 seconds) The response message to the multicast packet indicates that the router does not support the forwarding of multicast packets or that there is no receiving terminal other than the current transmitting terminal in the local area network. At this time, the current transmitting terminal sends the broadcast message according to the broadcast mode. If the response information of the other terminal to the broadcast message is received within the set time (for example, 10 seconds), the receiving terminal has a multicast terminal in the local area network. The response message was not received after the packet was sent because the router does not support the forwarding of multicast packets. By adopting the above method, it can be verified whether the router is compatible with the transmission of multicast packets.
在一实施例中,为了节省接收终端的应答时间,同时提升用户体验,本实施例中采用组播报文和广播报文同时发送的方式,当然也可先后依次发送(例如间隔时间不超过5秒)。当在设定时间(例如10秒)获取到接收终端的应答信息时,说明局域网中除了当前发送终端之外,还存在其他的终端设备。而如果在设定时间(例如10秒)未获取到接收终端的应答信息,则说明局域网中除了当前发送终端之外,不存在任何终端设备。因此,采用组播报文和广播报文 同时发送或先后依次发送的方式,相对于上述组播报文和广播报文相隔较长时间(例如30秒)不连续发送的方式,前者所用时间较短,可以快速发现局域网中所接入的所有终端设备,从而便于将不同终端建立通信连接,方便用户控制。In an embodiment, in order to save the response time of the receiving terminal and improve the user experience, the method of simultaneously transmitting the multicast packet and the broadcast packet in the embodiment may be sent in sequence (for example, the interval is not more than 5). second). When the response information of the receiving terminal is acquired at a set time (for example, 10 seconds), it is explained that other terminal devices exist in the local area network in addition to the current transmitting terminal. On the other hand, if the response information of the receiving terminal is not acquired within the set time (for example, 10 seconds), it means that there is no terminal device other than the current transmitting terminal in the local area network. Therefore, when the multicast packet and the broadcast packet are simultaneously transmitted or sequentially sent, the time used by the former is relatively long compared to the manner in which the multicast packet and the broadcast packet are not continuously transmitted (for example, 30 seconds). Short, you can quickly discover all the terminal devices connected to the LAN, so that it is easy to establish communication connections between different terminals, which is convenient for user control.
在一实施例中,为了使得设备之间能够更加快速的发现彼此,可增加报文的发送频率,例如,可根据设定周期(例如5秒),并按照预设报文发送方式通过路由器向接收终端发送报文,以避免接收终端处于非工作模式时无法获取到所述报文。In an embodiment, in order to enable devices to discover each other more quickly, the sending frequency of the message may be increased, for example, according to a set period (for example, 5 seconds), and according to a preset packet sending manner, the router may The receiving terminal sends a packet to prevent the receiving terminal from acquiring the packet when it is in the non-working mode.
在一实施例中,对于移动设备,例如手机或平板电脑等,处于节约电能的考虑,会在用户没有操作的情况下,将设备的无线保真(Wireless Fidelity,WiFi)网络配置成节电模式。此时,如果有发送终端发出组播报文或广播报文时,处于节电模式下的设备不会应答发送终端的报文,这样就会造成一些移动设备长时间无法被其他设备发现。因此,本实施例可以采用5秒为周期,每间隔5秒同时发送组播报文和广播报文,这样设置的好处在于,保证了从非工作模式中唤醒的设备能够立即接收到发送端的报文并进行应答,以供发送终端识别该设备的存在,为实现发送终端与该设备之间的互控奠定基础。In an embodiment, for a mobile device, such as a mobile phone or a tablet computer, in consideration of saving power, the wireless Fidelity (WiFi) network of the device is configured into a power saving mode without the user operating. . At this time, if a sending terminal sends a multicast packet or a broadcast packet, the device in the power saving mode does not answer the packet of the sending terminal, which may cause some mobile devices to be undetected by other devices for a long time. Therefore, in this embodiment, a packet of 5 seconds is used, and a multicast packet and a broadcast packet are simultaneously sent every 5 seconds. The advantage of the setting is that the device waking up from the non-working mode can immediately receive the report of the sender. The message is replied to the transmitting terminal to identify the existence of the device, which lays a foundation for realizing mutual control between the transmitting terminal and the device.
S220、当获取到接收终端发送的对所述报文的应答信息时,存储应答信息中接收终端的属性信息,根据所述接收终端的属性信息与接收终端建立通信连接。S220. When obtaining the response information to the packet sent by the receiving terminal, storing the attribute information of the receiving terminal in the response information, and establishing a communication connection with the receiving terminal according to the attribute information of the receiving terminal.
本实施例在上述实施例的基础上,通过采用设定周期循环发送报文的方式,增加了设备彼此发现的成功率。此外,采用组播报文和广播报文同时或先后依次发送的方式,不仅解决了路由器兼容性差无法转发组播报文的问题,同时也避免了单纯采用广播报文时,如果存在级联的多个路由器而导致的局域网中只有部分移动终端能够接收到报文的现象。当路由器兼容组播报文的转发时,如 果存在多级路由器,所有接收终端都可接收到发送终端的组播报文,从而可以保证共享服务的全面性。On the basis of the foregoing embodiment, the present embodiment increases the success rate of device discovery by using the method of cyclically transmitting packets in a set period. In addition, the method of transmitting multicast packets and broadcast packets simultaneously or sequentially, not only solves the problem that the routers cannot communicate with multicast packets when the compatibility of the routers is poor, but also avoids the use of cascading when using broadcast packets. Only some mobile terminals in the LAN caused by multiple routers can receive packets. When the router is compatible with the forwarding of multicast packets, if there are multiple routers, all receiving terminals can receive multicast packets from the sending terminal, thus ensuring the comprehensiveness of the shared services.
实施例三Embodiment 3
图3为本公开实施例三提供的一种终端通信的装置的结构框图,该装置可由软件和/或硬件的方式实现,一般可集成在如电视机、机顶盒、手机、平板电脑等作为发送终端的电子设备中。如图3所示,本实施例提供的终端通信的装置包括:报文发送模块310和属性信息存储模块320。3 is a structural block diagram of an apparatus for terminal communication according to Embodiment 3 of the present disclosure. The apparatus may be implemented by software and/or hardware, and may be integrated into a transmitting terminal such as a television set, a set top box, a mobile phone, a tablet computer, or the like. In the electronic device. As shown in FIG. 3, the device for terminal communication provided by this embodiment includes: a message sending module 310 and an attribute information storage module 320.
其中,报文发送模块310,设置为基于零配置网络服务协议,按照预设报文发送方式通过路由器向接收终端发送报文,其中,所述预设报文发送方式包括广播方式;The packet sending module 310 is configured to send a packet to the receiving terminal by using the router according to the zero-configuration network service protocol, where the preset packet sending manner includes a broadcast mode;
属性信息存储模块320,设置为当获取到所述接收终端发送的对所述报文的应答信息时,存储所述应答信息中所述接收终端的属性信息,根据所述接收终端的属性信息与所述接收终端建立通信连接;The attribute information storage module 320 is configured to: when obtaining the response information to the message sent by the receiving terminal, storing the attribute information of the receiving terminal in the response information, according to the attribute information of the receiving terminal The receiving terminal establishes a communication connection;
其中,所述发送终端为局域网中所接入的任意一个终端,所述接收终端为所述局域网中除所述发送终端之外的所有终端。The sending terminal is any one of the terminals connected to the local area network, and the receiving terminal is all terminals except the sending terminal in the local area network.
本实施例提供的技术方案,通过改进零配置网络服务协议,在默认的报文发送方式为组播发送的基础上,增加了广播方式作为其中一种预设报文发送方式。由于所有路由器都可兼容广播报文的转发,因此,通过按照预设报文发送方式向接收终端发送报文,解决了相关技术中由于路由器的兼容性差而导致的不同终端之间无法相互发现的问题。当获取到接收终端发送的对报文的应答信息时,存储应答信息中接收终端的属性信息,发送终端可通过接收终端的属性信息识别局域网中接入的所有接收终端,并可通过接收终端的属性信息与所有 接收终端建立通信连接,从而为实现多个终端之间的互控奠定基础。The technical solution provided in this embodiment improves the zero-configuration network service protocol, and the broadcast mode is added as one of the preset message sending modes on the basis that the default packet sending mode is multicast. Since all routers are compatible with the forwarding of broadcast packets, the packets are sent to the receiving terminal according to the preset packet sending manner, which solves the problem that different terminals cannot be mutually discovered due to poor compatibility of the router in the related art. problem. When the response information of the packet sent by the receiving terminal is obtained, the attribute information of the receiving terminal is stored in the response information, and the transmitting terminal can identify all receiving terminals accessed in the local area network by using the attribute information of the receiving terminal, and can The attribute information establishes a communication connection with all receiving terminals, thereby laying a foundation for realizing mutual control between multiple terminals.
在上述实施例的基础上,所述报文发送模块是设置为:Based on the foregoing embodiment, the message sending module is configured to:
基于零配置网络服务协议,根据设定周期,并按照预设报文发送方式通过路由器向所述接收终端发送报文,以避免所述接收终端处于非工作模式时无法获取到所述报文。The packet is sent to the receiving terminal by the router according to the preset period and according to the preset packet sending manner, so as to prevent the receiving terminal from being unable to obtain the packet when the receiving terminal is in the non-working mode.
在上述实施例的基础上,所述报文发送模块还设置为:On the basis of the foregoing embodiment, the packet sending module is further configured to:
基于零配置网络服务协议,在初级路由器支持转发组播报文情况下,按照所述组播方式和所述广播方式,通过所述初级路由器将所述组播方式对应的组播报文转发到与所述初级路由器级联的每个次级路由器,以及和通过所述初级路由器将所述广播方式对应的广播报文转发到与所述初级路由器级联的至少一个次级路由器,其中,每个所述次级路由器设置为将所述组播报文和/或所述广播报文发送到与所述次级路由器存在通信连接的接收终端。And the primary router forwards the multicast packet corresponding to the multicast mode to the primary router according to the zero-configuration network service protocol, in the case that the primary router supports the forwarding of the multicast packet, according to the multicast mode and the broadcast mode. Each secondary router cascading with the primary router, and a broadcast message corresponding to the broadcast mode by the primary router is forwarded to at least one secondary router cascading with the primary router, wherein each The secondary routers are configured to send the multicast message and/or the broadcast message to a receiving terminal that is in communication connection with the secondary router.
在上述实施例的基础上,所述组播报文和所述广播报文中均包括所述发送终端的属性信息,其中,所述发送终端的属性信息包括所述发送终端的服务类型、发送终端的互联网协议地址以及发送终端的服务端口号;On the basis of the foregoing embodiment, the multicast message and the broadcast message both include the attribute information of the sending terminal, where the attribute information of the sending terminal includes the service type and sending of the sending terminal. The internet protocol address of the terminal and the service port number of the transmitting terminal;
所述接收终端的属性信息包括所述接收终端的服务类型、接收终端的互联网协议地址以及接收终端的服务端口号。The attribute information of the receiving terminal includes a service type of the receiving terminal, an internet protocol address of the receiving terminal, and a service port number of the receiving terminal.
本实施例提供终端通信的装置可执行本公开任意实施例所提供终端通信的方法,具备执行方法相应的功能模块和有益效果。未在上述实施例中详尽描述的技术细节,可参见本公开任意实施例所提供的应用于发送终端的终端通信的方法。The device for providing terminal communication can perform the method for terminal communication provided by any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects of the execution method. For technical details that are not described in detail in the above embodiments, reference may be made to a method for terminal communication applied to a transmitting terminal provided by any embodiment of the present disclosure.
实施例四Embodiment 4
图4a为本公开实施例四提供的一种终端通信的方法的流程图,该方法可以 由终端通信的装置来执行,该装置可以通过软件和/或硬件的方式实现,该装置可以集成在电子设备中,该电子设备可包括电视机、智能手机、平板电脑和打印机等。本实施例的方法应用于接收终端,其中与上述实施例相同或相应的术语的解释在此不再赘述。参见图4a,本实施例提供终端通信的方法包括:4a is a flowchart of a method for communication of a terminal according to Embodiment 4 of the present disclosure. The method may be implemented by a device for communication by a terminal, and the device may be implemented by software and/or hardware, and the device may be integrated in an electronic device. In the device, the electronic device may include a television, a smart phone, a tablet, a printer, and the like. The method of this embodiment is applied to a receiving terminal, and the explanation of the same or corresponding terms as the above embodiment is not described herein again. Referring to FIG. 4a, the method for providing terminal communication in this embodiment includes:
S410、当接收终端处于监听应答状态时,获取发送终端基于零配置网络服务协议发送的报文,所述报文包括广播报文。S410. When the receiving terminal is in the listening response state, obtain a packet sent by the sending terminal according to the zero-configuration network service protocol, where the packet includes a broadcast packet.
其中,由于路由器可能不支持组播报文的发送,因此,为了保证发送终端所发报文能够转发的接收终端,在发送终端中至少包括广播报文。The router may not support the transmission of the multicast packet. Therefore, in order to ensure that the receiving terminal can forward the packet sent by the sending terminal, the transmitting terminal includes at least the broadcast packet.
S420、存储报文中所包含的发送终端的属性信息。S420. Store attribute information of the sending terminal included in the message.
其中,发送终端的属性信息包括发送终端的服务类型、发送终端的互联网协议地址以及发送终端的服务端口号。The attribute information of the sending terminal includes a service type of the sending terminal, an internet protocol address of the sending terminal, and a service port number of the sending terminal.
S430、根据发送终端的属性信息,将接收终端的属性信息发送给发送终端,以使发送终端根据所述接收终端的属性信息与所述接收终端建立通信连接。S430. Send the attribute information of the receiving terminal to the sending terminal according to the attribute information of the sending terminal, so that the sending terminal establishes a communication connection with the receiving terminal according to the attribute information of the receiving terminal.
其中,本实施例中的所述发送终端为局域网中所接入的任意一个终端,接收终端为局域网中除发送终端之外的所有终端。The transmitting terminal in this embodiment is any terminal that is accessed in the local area network, and the receiving terminal is all terminals except the transmitting terminal in the local area network.
示例性的,接收终端的属性信息包括接收终端的服务类型、接收终端的互联网协议地址以及接收终端的服务端口号。Exemplarily, the attribute information of the receiving terminal includes a service type of the receiving terminal, an internet protocol address of the receiving terminal, and a service port number of the receiving terminal.
示例性的,图4b为本公开实施例四提供的电视机与多个移动终端相互发现的示意图。如图4b所示,电视机100按照组播方式向路由器600发送了组播报文以及按照广播方式向路由器600发送了广播报文后,路由器600将该组播报文和广播报文转发到局域网中的手机200、台式电脑300、打印机400和笔记本电脑500的5353端口(由国际互联网工程组织IETE约定)。手机200、台式电脑300、打印机400和笔记本电脑500在接收到组播报文或广播报文后(如果路 由器600支持组播报文的转发,则将获取到组播报文和广播报文,如果不支持,则只获取到广播报文),会将组播报文或广播报文中电视机100的属性信息存入服务列表中,同时将自身的属性信息以单播的方式(例如可根据电视机的属性信息中的IP地址访问)将MDNS应答反馈给电视机100,除上述4个接收终端之外,新进入的移动设备在接收到电视机100的报文后,也将记录电视机的属性信息并进行应答回复,这样可使得局域网中所有的终端都可发现彼此。Illustratively, FIG. 4b is a schematic diagram of a television set and a plurality of mobile terminals that are mutually discovered according to Embodiment 4 of the present disclosure. As shown in FIG. 4b, after the television 100 transmits the multicast packet to the router 600 in the multicast mode and the broadcast packet to the router 600 according to the broadcast mode, the router 600 forwards the multicast packet and the broadcast packet to the broadcast packet. The mobile phone 200, the desktop computer 300, the printer 400, and the port 5353 of the notebook computer 500 in the local area network (committed by the Internet Engineering Organization IETE). After the mobile phone 200, the desktop computer 300, the printer 400, and the notebook computer 500 receive the multicast message or the broadcast message, if the router 600 supports the forwarding of the multicast message, the multicast message and the broadcast message are obtained. If it is not supported, only the broadcast packet is obtained. The attribute information of the TV 100 in the multicast packet or the broadcast packet is stored in the service list, and the attribute information of the broadcast packet is unicast (for example, The MDNS response is fed back to the television set 100 according to the IP address access in the attribute information of the television set. In addition to the above four receiving terminals, the newly entered mobile device will also record the television after receiving the message of the television set 100. The attribute information of the machine is replied to, so that all terminals in the LAN can discover each other.
本公开实施例的技术方案,当接收终端处于监听状态时,获取发送终端基于零配置网络服务协议所发送的报文,由于该报文中至少包括广播报文,因此可以避免路由器不支持转发组播报文而导致的接收终端无法获取发送终端所发报文的问题。通过存储报文中发送终端的属性信息,并可根据发送终端的属性信息将该接收终端的属性信息也反馈给发送终端,以供发送终端和接收终端建立通信连接,从而为实现多个终端之间的通信额互控奠定了基础。The technical solution of the embodiment of the present disclosure, when the receiving terminal is in the listening state, obtains the packet sent by the sending terminal based on the zero-configuration network service protocol, and the packet does not support the forwarding group because the packet includes at least the broadcast packet. The receiving terminal caused by the broadcast message cannot obtain the message sent by the sending terminal. The attribute information of the sending terminal in the message is stored, and the attribute information of the receiving terminal is also fed back to the sending terminal according to the attribute information of the sending terminal, so that the sending terminal establishes a communication connection with the receiving terminal, thereby implementing multiple terminals. The basis for mutual control of communication has been laid.
实施例五Embodiment 5
图5为本公开实施例五提供的一种终端通信的装置的结构框图,该装置可由软件和/或硬件的方式实现,一般可集成在如电视机、机顶盒、手机、平板电脑等作为接收终端的电子设备中。如图5所示,本实施例提供的终端通信的装置包括:报文获取模块510、属性信息存储模块520和属性信息发送模块520。FIG. 5 is a structural block diagram of an apparatus for terminal communication according to Embodiment 5 of the present disclosure. The apparatus may be implemented by software and/or hardware, and may be integrated into a receiving terminal such as a television, a set top box, a mobile phone, a tablet computer, or the like. In the electronic device. As shown in FIG. 5, the device for terminal communication provided by this embodiment includes: a message acquiring module 510, an attribute information storage module 520, and an attribute information sending module 520.
其中,报文获取模块510,设置为当接收终端处于监听应答状态时,获取发送终端基于零配置网络服务协议发送的报文,所述报文包括广播报文;The packet obtaining module 510 is configured to: when the receiving terminal is in the listening response state, obtain the packet sent by the sending terminal according to the zero-configuration network service protocol, where the packet includes a broadcast packet;
属性信息存储模块520,设置为存储所述报文中所包含的所述发送终端的属性信息;The attribute information storage module 520 is configured to store attribute information of the sending terminal included in the message;
属性信息发送模块520,设置为根据所述发送终端的属性信息,将所述接收 终端的属性信息发送给所述发送终端,以使所述发送终端根据所述接收终端的属性信息与所述接收终端建立通信连接;The attribute information sending module 520 is configured to send the attribute information of the receiving terminal to the sending terminal according to the attribute information of the sending terminal, so that the sending terminal according to the attribute information of the receiving terminal and the receiving The terminal establishes a communication connection;
其中,所述发送终端为局域网中所接入的任意一个终端,所述接收终端为所述局域网中除所述发送终端之外的所有终端。The sending terminal is any one of the terminals connected to the local area network, and the receiving terminal is all terminals except the sending terminal in the local area network.
本公开实施例的技术方案,当接收终端处于监听状态时,获取发送终端基于零配置网络服务协议所发送的报文,由于该报文中至少包括广播报文,因此可以避免路由器不支持转发组播报文而导致的接收终端无法获取发送终端所发报文的问题。通过存储报文中发送终端的属性信息,并可根据该发送终端的属性信息将该接收终端的属性信息也反馈给发送终端,以供发送终端和接收终端建立通信连接,从而为实现多个终端之间的互控奠定基础。The technical solution of the embodiment of the present disclosure, when the receiving terminal is in the listening state, obtains the packet sent by the sending terminal based on the zero-configuration network service protocol, and the packet does not support the forwarding group because the packet includes at least the broadcast packet. The receiving terminal caused by the broadcast message cannot obtain the message sent by the sending terminal. The attribute information of the sending terminal in the message is stored, and the attribute information of the receiving terminal is also fed back to the sending terminal according to the attribute information of the sending terminal, so that the sending terminal establishes a communication connection with the receiving terminal, thereby implementing multiple terminals. The foundation between the mutual control.
在上述实施例的基础上,所述发送终端的属性信息包括发送终端的服务类型、发送终端的互联网协议地址和发送终端的服务端口号;On the basis of the foregoing embodiment, the attribute information of the sending terminal includes a service type of the sending terminal, an internet protocol address of the sending terminal, and a service port number of the sending terminal.
所述接收终端的属性信息包括接收终端的服务类型、接收终端的互联网协议地址和接收终端的服务端口号。The attribute information of the receiving terminal includes a service type of the receiving terminal, an internet protocol address of the receiving terminal, and a service port number of the receiving terminal.
本实施例提供终端通信的装置可执行本公开任意实施例所提供终端通信的方法,具备执行方法相应的功能模块和有益效果。未在上述实施例中详尽描述的技术细节,可参见本公开任意实施例所提供的应用于接收终端的终端通信的方法。The device for providing terminal communication can perform the method for terminal communication provided by any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects of the execution method. For technical details that are not described in detail in the above embodiments, reference may be made to a method for terminal communication applied to a receiving terminal provided by any embodiment of the present disclosure.
实施例六Embodiment 6
图6为本公开实施例六提供的一种终端的结构示意图。图6示出了适于用来实现本公开实施方式的示例性终端12的框图。图6显示的终端12仅仅是一个示例,不应对本公开实施例的功能和使用范围带来任何限制。FIG. 6 is a schematic structural diagram of a terminal according to Embodiment 6 of the present disclosure. FIG. 6 illustrates a block diagram of an exemplary terminal 12 suitable for use in implementing embodiments of the present disclosure. The terminal 12 shown in FIG. 6 is merely an example and should not impose any limitation on the function and scope of use of the embodiments of the present disclosure.
如图6所示,终端12以通用计算设备的形式表现。终端12的组件可以包括但不限于:一个或者多个处理器或者处理单元16,系统存储器28,连接不同系统组件(包括系统存储器28和处理单元16)的总线18。As shown in Figure 6, terminal 12 is embodied in the form of a general purpose computing device. The components of terminal 12 may include, but are not limited to, one or more processors or processing units 16, system memory 28, and bus 18 that connects different system components, including system memory 28 and processing unit 16.
总线18表示几类总线结构中的一种或多种,包括存储器总线或者存储器控制器,外围总线,图形加速端口,处理器或者使用多种总线结构中的任意总线结构的局域总线。举例来说,这些体系结构包括但不限于工业标准体系结构(Industry Standard Architecture,ISA)总线,微通道体系结构(MicroChannel Architecture,MAC)总线,增强型ISA总线、视频电子标准协会(Video Electronics Standards Association,VESA)局域总线以及外围组件互连(Peripheral Component Interconnect,PCI)总线。 Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any of a variety of bus structures. For example, these architectures include, but are not limited to, the Industry Standard Architecture (ISA) bus, the MicroChannel Architecture (MAC) bus, the Enhanced ISA Bus, and the Video Electronics Standards Association. , VESA) Local Bus and Peripheral Component Interconnect (PCI) bus.
终端12典型地包括多种计算机系统可读介质。这些介质可以是任何能够被终端12访问的可用介质,包括易失性和非易失性介质,可移动的和不可移动的介质。 Terminal 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by terminal 12, including volatile and non-volatile media, removable and non-removable media.
系统存储器28可以包括易失性存储器形式的计算机系统可读介质,例如随机存取存储器(Random Access Memory,RAM)30和/或高速缓存存储器32。终端12可以进一步包括其它可移动/不可移动的、易失性/非易失性计算机系统存储介质。仅作为举例,存储系统34可以设置为读写不可移动的、非易失性磁介质(图6未显示,通常称为“硬盘驱动器”)。尽管图6中未示出,可以提供设置为对可移动非易失性磁盘(例如“软盘”)读写的磁盘驱动器,以及对可移动非易失性光盘(例如紧凑型光盘只读储存器(Compact Disc Read-Only Memory,CD-ROM)、数字视盘只读储存器(Digital Video Disc-Read Only Memory,DVD-ROM)或者其它光介质)读写的光盘驱动器。在这些情况下,每个驱动器可以通过一个或者多个数据介质接口与总线18相连。存储器28可以包括至少 一个程序产品,该程序产品具有一组(例如至少一个)程序模块,这些程序模块被配置以执行本公开每个实施例的功能。 System memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and/or cache memory 32. Terminal 12 may further include other removable/non-removable, volatile/non-volatile computer system storage media. By way of example only, storage system 34 may be configured to read and write non-removable, non-volatile magnetic media (not shown in Figure 6, commonly referred to as "hard disk drives"). Although not shown in FIG. 6, a disk drive configured to read and write to a removable non-volatile disk (eg, a "floppy disk"), and a removable non-volatile disk (eg, a compact disk read-only memory) may be provided. (Compact Disc Read-Only Memory, CD-ROM), Digital Video Disc-Read Only Memory (DVD-ROM) or other optical media. In these cases, each drive can be coupled to bus 18 via one or more data medium interfaces. Memory 28 can include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of each embodiment of the present disclosure.
具有一组(至少一个)程序模块42的程序/实用工具40,可以存储在例如存储器28中,这样的程序模块42包括但不限于操作系统、一个或者多个应用程序、其它程序模块以及程序数据,这些示例中的每一个或某种组合中可能包括网络环境的实现。程序模块42通常执行本公开所描述的实施例中的功能和/或方法。A program/utility 40 having a set (at least one) of program modules 42 may be stored, for example, in memory 28, such program modules 42 including but not limited to an operating system, one or more applications, other program modules, and program data. An implementation of the network environment may be included in each or some of these examples. Program module 42 typically performs the functions and/or methods of the embodiments described in this disclosure.
终端12也可以与一个或多个外部设备14(例如键盘、指向设备、显示器24等)通信,还可与一个或者多个使得用户能与该终端12交互的设备通信,和/或与使得该终端12能与一个或多个其它计算设备进行通信的任何设备(例如网卡,调制解调器等等)通信。这种通信可以通过输入/输出(Input/Output,I/O)接口22进行。并且,终端12还可以通过网络适配器20与一个或者多个网络(例如局域网(Local Area Network,LAN),广域网(Wide Area Network,WAN)和/或公共网络,例如因特网)通信。如图所示,网络适配器20通过总线18与终端12的其它模块通信。应当明白,尽管图中未示出,可以结合终端12使用其它硬件和/或软件模块,包括但不限于:微代码、设备驱动器、冗余处理单元、外部磁盘驱动阵列、独立冗余磁盘阵列(Redundant Arrays of Independent Disks,RAID)系统、磁带驱动器以及数据备份存储系统等。 Terminal 12 may also be in communication with one or more external devices 14 (e.g., a keyboard, pointing device, display 24, etc.), and may also be in communication with one or more devices that enable a user to interact with the terminal 12, and/or Terminal 12 can communicate with any device (e.g., network card, modem, etc.) that is in communication with one or more other computing devices. This communication can take place via an input/output (I/O) interface 22. Moreover, the terminal 12 can also communicate with one or more networks (such as a local area network (LAN), a wide area network (WAN), and/or a public network, such as the Internet) through the network adapter 20. As shown, network adapter 20 communicates with other modules of terminal 12 via bus 18. It should be understood that although not shown in the figures, other hardware and/or software modules may be utilized in connection with terminal 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, independent redundant disk arrays ( Redundant Arrays of Independent Disks (RAID) systems, tape drives, and data backup storage systems.
处理单元16通过运行存储在系统存储器28中的程序,从而执行多种功能应用以及数据处理,例如实现本公开实施例所提供的应用于发送终端的终端通信方法。The processing unit 16 executes a plurality of functional applications and data processing by running a program stored in the system memory 28, for example, implementing a terminal communication method applied to the transmitting terminal provided by the embodiments of the present disclosure.
本公开实施例还提供了一种设备,其包括:一个或多个处理器;存储装置,用于存储一个或多个程序,当所述一个或多个程序被所述一个或多个处理器执 行,使得所述一个或多个处理器实现本公开实施例所提供的应用于接收终端的终端通信方法,包括:Embodiments of the present disclosure also provide an apparatus comprising: one or more processors; storage means for storing one or more programs when the one or more programs are used by the one or more processors Executing, the one or more processors to implement the terminal communication method applied to the receiving terminal provided by the embodiment of the present disclosure, including:
当接收终端处于监听应答状态时,获取发送终端基于零配置网络服务协议发送的报文,所述报文包括广播报文;When the receiving terminal is in the listening response state, obtaining a packet sent by the sending terminal based on the zero-configuration network service protocol, where the packet includes a broadcast packet;
存储所述报文中所包含的所述发送终端的属性信息;Storing attribute information of the sending terminal included in the packet;
根据所述发送终端的属性信息,将所述接收终端的属性信息发送给所述发送终端,以使所述发送终端根据所述接收终端的属性信息与所述接收终端建立通信连接;Transmitting the attribute information of the receiving terminal to the sending terminal according to the attribute information of the sending terminal, so that the sending terminal establishes a communication connection with the receiving terminal according to the attribute information of the receiving terminal;
其中,所述发送终端为局域网中所接入的任意一个终端,所述接收终端为所述局域网中除所述发送终端之外的所有终端。The sending terminal is any one of the terminals connected to the local area network, and the receiving terminal is all terminals except the sending terminal in the local area network.
当然,本领域技术人员可以理解,处理器还可以实现本公开任意实施例所提供的应用于接收终端的终端通信方法的技术方案。该设备的硬件结构以及功能可参见实施例六的内容解释。Of course, those skilled in the art can understand that the processor can also implement the technical solution of the terminal communication method applied to the receiving terminal provided by any embodiment of the present disclosure. The hardware structure and function of the device can be explained in the content of Embodiment 6.
实施例七Example 7
本公开实施例七还提供了一种计算机可读存储介质,其上存储有计算机程序,其中,该程序被处理器执行时实现本公开任意实施例所提供的应用于发送终端的终端通信的方法,该方法包括:Embodiment 7 of the present disclosure further provides a computer readable storage medium having stored thereon a computer program, wherein the program is executed by a processor to implement a method for terminal communication applied to a transmitting terminal provided by any embodiment of the present disclosure , the method includes:
基于零配置网络服务协议,按照预设报文发送方式通过路由器向接收终端发送报文,其中,所述预设报文发送方式包括广播方式;And sending, according to the zero-configuration network service protocol, the packet to the receiving terminal by using a preset packet sending manner, where the preset packet sending manner includes a broadcast mode;
当获取到所述接收终端发送的对所述报文的应答信息时,存储所述应答信息中所述接收终端的属性信息,根据所述接收终端的属性信息与所述接收终端建立通信连接;And storing, by the receiving terminal, the response information of the receiving message, storing the attribute information of the receiving terminal in the response information, and establishing a communication connection with the receiving terminal according to the attribute information of the receiving terminal;
其中,所述发送终端为局域网中所接入的任意一个终端,所述接收终端为所述局域网中除所述发送终端之外的所有终端。The sending terminal is any one of the terminals connected to the local area network, and the receiving terminal is all terminals except the sending terminal in the local area network.
当然,本公开实施例所提供的一种包含计算机可执行指令的存储介质,其计算机可执行指令不限于如上所述的方法操作,还可以执行本公开任意实施例所提供的应用于发送终端的终端通信方法中的相关操作。Certainly, a storage medium containing computer executable instructions, the computer executable instructions are not limited to the method operations as described above, and may also be applied to the transmitting terminal provided by any embodiment of the present disclosure. Related operations in the terminal communication method.
本公开实施例的计算机存储介质,可以采用一个或多个计算机可读的介质的任意组合。计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质(非穷举的列表)包括:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机存取存储器(Random Access Memory,RAM)、只读存储器(Read-Only Memory,ROM)、可擦式可编程只读存储器(Erasable Programmable read only memory,EPROM)或闪存、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本文件中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。The computer storage medium of an embodiment of the present disclosure may employ any combination of one or more computer readable mediums. The computer readable medium can be a computer readable signal medium or a computer readable storage medium. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. A computer readable storage medium (non-exhaustive list) includes: an electrical connection having one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read only memory (Read-Only Memory) , ROM), Erasable Programmable Read Only Memory (EPROM) or flash memory, optical fiber, portable compact disk read only memory (CD-ROM), optical storage device, magnetic storage device, or any of the above A suitable combination. In this document, a computer readable storage medium can be any tangible medium that can contain or store a program, which can be used by or in connection with an instruction execution system, apparatus or device.
计算机可读的信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读的信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。A computer readable signal medium may include a data signal that is propagated in the baseband or as part of a carrier, carrying computer readable program code. Such propagated data signals can take a variety of forms including, but not limited to, electromagnetic signals, optical signals, or any suitable combination of the foregoing. The computer readable signal medium can also be any computer readable medium other than a computer readable storage medium, which can transmit, propagate, or transport a program for use by or in connection with the instruction execution system, apparatus, or device. .
计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括—— 但不限于无线、电线、光缆、射频(Radio Frequency,RF)等等,或者上述的任意合适的组合。Program code embodied on a computer readable medium can be transmitted by any suitable medium, including but not limited to wireless, wire, fiber optic cable, radio frequency (RF), etc., or any suitable combination of the foregoing.
可以以一种或多种程序设计语言或其组合来编写用于执行本公开操作的计算机程序代码,所述程序设计语言包括面向对象的程序设计语言-诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言-诸如”C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络——包括局域网(LAN)或广域网(WAN)-连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, or a combination thereof, including an object oriented programming language - such as Java, Smalltalk, C++, and also conventional. Procedural programming language - such as the "C" language or a similar programming language. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer, partly on the remote computer, or entirely on the remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer via any kind of network, including a local area network (LAN) or wide area network (WAN), or can be connected to an external computer (eg, using an Internet service provider) Internet connection).
本公开实施例还提供了另一种计算机可读存储介质,所述计算机可执行指令在由计算机处理器执行时用于执行一种应用于接收终端的终端通信方法,该方法包括:The embodiment of the present disclosure further provides another computer readable storage medium, when executed by a computer processor, for performing a terminal communication method applied to a receiving terminal, the method comprising:
当接收终端处于监听应答状态时,获取发送终端基于零配置网络服务协议发送的报文,所述报文包括广播报文;When the receiving terminal is in the listening response state, obtaining a packet sent by the sending terminal based on the zero-configuration network service protocol, where the packet includes a broadcast packet;
存储所述报文中所包含的所述发送终端的属性信息;Storing attribute information of the sending terminal included in the packet;
根据所述发送终端的属性信息,将所述接收终端的属性信息发送给所述发送终端,以使所述发送终端根据所述接收终端的属性信息与所述接收终端建立通信连接;Transmitting the attribute information of the receiving terminal to the sending terminal according to the attribute information of the sending terminal, so that the sending terminal establishes a communication connection with the receiving terminal according to the attribute information of the receiving terminal;
其中,所述发送终端为局域网中所接入的任意一个终端,所述接收终端为所述局域网中除所述发送终端之外的所有终端。The sending terminal is any one of the terminals connected to the local area network, and the receiving terminal is all terminals except the sending terminal in the local area network.
当然,本公开实施例所提供的一种包含计算机可执行指令的存储介质,其 计算机可执行指令不限于如上所述的方法操作,还可以执行本公开任意实施例所提供的应用于接收终端的终端通信方法中的相关操作。对存储介质的介绍可参见实施例七中的内容解释。Certainly, a storage medium containing computer executable instructions, the computer executable instructions are not limited to the method operations as described above, and may also be applied to the receiving terminal provided by any embodiment of the present disclosure. Related operations in the terminal communication method. For an introduction to the storage medium, refer to the explanation in the content of the seventh embodiment.
Claims (15)
- 一种终端通信的方法,应用于发送终端,包括:A method for terminal communication, applied to a transmitting terminal, comprising:基于零配置网络服务协议,按照预设报文发送方式通过路由器向接收终端发送报文,其中,所述预设报文发送方式包括广播方式;And sending, according to the zero-configuration network service protocol, the packet to the receiving terminal by using a preset packet sending manner, where the preset packet sending manner includes a broadcast mode;当获取到所述接收终端发送的对所述报文的应答信息时,存储所述应答信息中所述接收终端的属性信息,根据所述接收终端的属性信息与所述接收终端建立通信连接;And storing, by the receiving terminal, the response information of the receiving message, storing the attribute information of the receiving terminal in the response information, and establishing a communication connection with the receiving terminal according to the attribute information of the receiving terminal;其中,所述发送终端为局域网中所接入的任意一个终端,所述接收终端为所述局域网中除所述发送终端之外的所有终端。The sending terminal is any one of the terminals connected to the local area network, and the receiving terminal is all terminals except the sending terminal in the local area network.
- 根据权利要求1所述的方法,其中,所述按照预设报文发送方式通过路由器向接收终端发送报文,包括:The method of claim 1, wherein the sending the message to the receiving terminal by using the router according to the preset packet sending manner comprises:根据设定周期,并按照所述预设报文发送方式通过路由器向接收终端发送报文,以避免所述接收终端处于非工作模式时无法获取到所述报文。The packet is sent to the receiving terminal by the router according to the preset period, and the packet is not received by the router when the receiving terminal is in the non-working mode.
- 根据权利要求1或2所述的方法,其中,所述预设报文发送方式还包括组播方式;The method according to claim 1 or 2, wherein the preset message sending manner further comprises a multicast mode;所述按照预设报文发送方式通过路由器向接收终端发送报文,包括:The sending, by the router, the packet to the receiving terminal according to the preset packet sending manner, including:在初级路由器支持转发组播报文情况下,按照所述组播方式和所述广播方式,通过所述初级路由器将所述组播方式对应的组播报文转发到与所述初级路由器级联的每个次级路由器,以及通过所述初级路由器将所述广播方式对应的广播报文转发到与所述初级路由器级联的至少一个次级路由器,其中,每个所述次级路由器设置为将下述至少一项发送到与所述次级路由器存在通信连接的接收终端:所述组播报文和广播报文。When the primary router supports the forwarding of the multicast packet, the multicast packet corresponding to the multicast mode is forwarded to the primary router by using the primary router according to the multicast mode and the broadcast mode. Each of the secondary routers, and the broadcast message corresponding to the broadcast mode is forwarded by the primary router to at least one secondary router cascading with the primary router, wherein each of the secondary routers is configured to Sending at least one of the following to a receiving terminal having a communication connection with the secondary router: the multicast message and the broadcast message.
- 根据权利要求3所述的方法,其中,所述组播报文和所述广播报文中均包括所述发送终端的属性信息,其中,所述发送终端的属性信息包括所述发送 终端的服务类型、所述发送终端的互联网协议地址以及所述发送终端的服务端口号;The method according to claim 3, wherein the multicast message and the broadcast message both include attribute information of the sending terminal, wherein the attribute information of the sending terminal includes a service of the sending terminal. Type, an internet protocol address of the transmitting terminal, and a service port number of the transmitting terminal;所述接收终端的属性信息包括所述接收终端的服务类型、所述接收终端的互联网协议地址以及所述接收终端的服务端口号。The attribute information of the receiving terminal includes a service type of the receiving terminal, an internet protocol address of the receiving terminal, and a service port number of the receiving terminal.
- 一种终端通信的装置,应用于发送终端,包括:A device for terminal communication, applied to a transmitting terminal, comprising:报文发送模块,设置为基于零配置网络服务协议,按照预设报文发送方式通过路由器向接收终端发送报文,其中,所述预设报文发送方式包括广播方式;The packet sending module is configured to send a packet to the receiving terminal by using a router according to the zero-configuration network service protocol, where the preset packet sending manner includes a broadcast mode;属性信息存储模块,设置为当获取到所述接收终端发送的对所述报文的应答信息时,存储所述应答信息中所述接收终端的属性信息,根据所述接收终端的属性信息与所述接收终端建立通信连接;The attribute information storage module is configured to: when obtaining the response information to the message sent by the receiving terminal, storing the attribute information of the receiving terminal in the response information, according to the attribute information of the receiving terminal Said receiving terminal establishes a communication connection;其中,所述发送终端为局域网中所接入的任意一个终端,所述接收终端为所述局域网中除所述发送终端之外的所有终端。The sending terminal is any one of the terminals connected to the local area network, and the receiving terminal is all terminals except the sending terminal in the local area network.
- 根据权利要求5所述的装置,其中,所述报文发送模块是设置为:The apparatus according to claim 5, wherein said message sending module is configured to:根据设定周期,并按照所述预设报文发送方式通过路由器向所述接收终端发送报文,以避免所述接收终端处于非工作模式时无法获取到所述报文。The packet is sent to the receiving terminal by the router according to the preset period, and the packet is not received by the router when the receiving terminal is in the non-working mode.
- 根据权利要求5或6所述的装置,其中,所述报文发送模块还设置为:The device according to claim 5 or 6, wherein the message sending module is further configured to:在初级路由器支持转发组播报文情况下,按照所述组播方式和所述广播方式,通过所述初级路由器将所述组播方式对应的组播报文转发到与所述初级路由器级联的每个次级路由器,以及通过所述初级路由器将所述广播方式对应的广播报文转发到与所述初级路由器级联的至少一个次级路由器,其中,每个所述次级路由器设置为将下述至少一项发送到与所述次级路由器存在通信连接的接收终端:所述组播报文和广播报文。When the primary router supports the forwarding of the multicast packet, the multicast packet corresponding to the multicast mode is forwarded to the primary router by using the primary router according to the multicast mode and the broadcast mode. Each of the secondary routers, and the broadcast message corresponding to the broadcast mode is forwarded by the primary router to at least one secondary router cascading with the primary router, wherein each of the secondary routers is configured to Sending at least one of the following to a receiving terminal having a communication connection with the secondary router: the multicast message and the broadcast message.
- 根据权利要求7所述的装置,其中,所述组播报文和所述广播报文中均 包括所述发送终端的属性信息,其中,所述发送终端的属性信息包括所述发送终端的服务类型、所述发送终端的互联网协议地址以及所述发送终端的服务端口号;所述接收终端的属性信息包括所述接收终端的服务类型、所述接收终端的互联网协议地址以及所述接收终端的服务端口号。The device according to claim 7, wherein the multicast message and the broadcast message both include attribute information of the sending terminal, wherein the attribute information of the sending terminal includes a service of the sending terminal a type, an internet protocol address of the transmitting terminal, and a service port number of the transmitting terminal; the attribute information of the receiving terminal includes a service type of the receiving terminal, an internet protocol address of the receiving terminal, and the receiving terminal Service port number.
- 一种终端通信的方法,应用于接收终端,包括:A method for terminal communication, applied to a receiving terminal, comprising:当接收终端处于监听应答状态时,获取发送终端基于零配置网络服务协议发送的报文,所述报文包括广播报文;When the receiving terminal is in the listening response state, obtaining a packet sent by the sending terminal based on the zero-configuration network service protocol, where the packet includes a broadcast packet;存储所述报文中所包含的所述发送终端的属性信息;Storing attribute information of the sending terminal included in the packet;根据所述发送终端的属性信息,将所述接收终端的属性信息发送给所述发送终端,以使所述发送终端根据所述接收终端的属性信息与所述接收终端建立通信连接;Transmitting the attribute information of the receiving terminal to the sending terminal according to the attribute information of the sending terminal, so that the sending terminal establishes a communication connection with the receiving terminal according to the attribute information of the receiving terminal;其中,所述发送终端为局域网中所接入的任意一个终端,所述接收终端为所述局域网中除所述发送终端之外的所有终端。The sending terminal is any one of the terminals connected to the local area network, and the receiving terminal is all terminals except the sending terminal in the local area network.
- 根据权利要求9所述的方法,其中,所述发送终端的属性信息包括发送终端的服务类型、所述发送终端的互联网协议地址以及所述发送终端的服务端口号;The method according to claim 9, wherein the attribute information of the transmitting terminal comprises a service type of the transmitting terminal, an internet protocol address of the transmitting terminal, and a service port number of the transmitting terminal;所述接收终端的属性信息包括接收终端的服务类型、所述接收终端的互联网协议地址以及所述接收终端的服务端口号。The attribute information of the receiving terminal includes a service type of the receiving terminal, an internet protocol address of the receiving terminal, and a service port number of the receiving terminal.
- 一种终端通信的装置,应用于接收终端,包括:A device for terminal communication, which is applied to a receiving terminal, and includes:报文获取模块,设置为当接收终端处于监听应答状态时,获取发送终端基于零配置网络服务协议发送的报文,所述报文包括广播报文;The packet obtaining module is configured to: when the receiving terminal is in the monitoring response state, obtain the packet sent by the sending terminal according to the zero-configuration network service protocol, where the packet includes a broadcast packet;属性信息存储模块,设置为存储所述报文中所包含的所述发送终端的属性信息;An attribute information storage module, configured to store attribute information of the sending terminal included in the message;属性信息发送模块,设置为根据所述发送终端的属性信息,将所述接收终端的属性信息发送给所述发送终端,以使所述发送终端根据所述接收终端的属性信息与所述接收终端建立通信连接;The attribute information sending module is configured to send the attribute information of the receiving terminal to the sending terminal according to the attribute information of the sending terminal, so that the sending terminal and the receiving terminal according to the attribute information of the receiving terminal Establish a communication connection;其中,所述发送终端为局域网中所接入的任意一个终端,所述接收终端为所述局域网中除所述发送终端之外的所有终端。The sending terminal is any one of the terminals connected to the local area network, and the receiving terminal is all terminals except the sending terminal in the local area network.
- 一种终端,包括:A terminal comprising:一个或多个处理器;One or more processors;存储装置,设置为存储一个或多个程序,a storage device configured to store one or more programs,当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现如权利要求1-4中任一所述的终端通信的方法。The method of communicating with the terminal of any of claims 1-4 when the one or more programs are executed by the one or more processors.
- 一种终端,包括:A terminal comprising:一个或多个处理器;One or more processors;存储装置,设置为存储一个或多个程序,a storage device configured to store one or more programs,当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现如权利要求9或10所述的终端通信的方法。The method of communicating with the terminal of claim 9 or 10 when the one or more programs are executed by the one or more processors.
- 一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现如权利要求1-4中任一所述的终端通信的方法。A computer readable storage medium having stored thereon a computer program, the program being executed by a processor to implement the method of terminal communication according to any of claims 1-4.
- 一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现如权利要求9或10所述的终端通信的方法。A computer readable storage medium having stored thereon a computer program for performing the method of terminal communication according to claim 9 or 10 when executed by a processor.
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810117224.9 | 2018-02-06 | ||
CN201810117224.9A CN108234518A (en) | 2018-02-06 | 2018-02-06 | A kind of method, apparatus, terminal and the storage medium of terminal communication |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2019153722A1 true WO2019153722A1 (en) | 2019-08-15 |
Family
ID=62669806
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2018/102819 WO2019153722A1 (en) | 2018-02-06 | 2018-08-29 | Terminal communication method and device, terminal and storage medium |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN108234518A (en) |
WO (1) | WO2019153722A1 (en) |
Families Citing this family (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108234518A (en) * | 2018-02-06 | 2018-06-29 | 深圳创维-Rgb电子有限公司 | A kind of method, apparatus, terminal and the storage medium of terminal communication |
CN109363586A (en) * | 2018-12-26 | 2019-02-22 | 江苏美的清洁电器股份有限公司 | Sweeping robot and its communication means, device and system and mobile terminal |
CN109816897A (en) * | 2019-02-27 | 2019-05-28 | 北京三快在线科技有限公司 | A kind of method, apparatus, equipment and storage medium accessing data |
CN112616171B (en) * | 2020-12-11 | 2024-03-01 | 深圳市越疆科技有限公司 | Communication method and device based on wireless local area network and computer readable storage medium |
CN113490198A (en) * | 2021-06-25 | 2021-10-08 | 深圳Tcl新技术有限公司 | Terminal discovery method and device, storage medium and electronic equipment |
CN114338700A (en) * | 2021-12-23 | 2022-04-12 | 杭州星布智能科技有限公司 | Local area network point-to-point distributed storage method |
CN114125031B (en) * | 2022-01-28 | 2022-06-21 | 南湖实验室 | Broadcast response method and system based on internet regional linkage |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105637819A (en) * | 2013-10-28 | 2016-06-01 | 柏思科技有限公司 | Methods and systems for transmitting broadcast data |
CN106685776A (en) * | 2017-02-14 | 2017-05-17 | 上海斐讯数据通信技术有限公司 | Method and system of intelligent device discovery in local area network |
CN107493213A (en) * | 2017-09-26 | 2017-12-19 | 四川长虹电器股份有限公司 | A kind of method for improving lan device ability of discovery |
CN108234518A (en) * | 2018-02-06 | 2018-06-29 | 深圳创维-Rgb电子有限公司 | A kind of method, apparatus, terminal and the storage medium of terminal communication |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7281058B1 (en) * | 2002-10-09 | 2007-10-09 | Juniper Networks, Inc. | Delivering and receiving multicast content across a unicast network |
-
2018
- 2018-02-06 CN CN201810117224.9A patent/CN108234518A/en active Pending
- 2018-08-29 WO PCT/CN2018/102819 patent/WO2019153722A1/en active Application Filing
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105637819A (en) * | 2013-10-28 | 2016-06-01 | 柏思科技有限公司 | Methods and systems for transmitting broadcast data |
CN106685776A (en) * | 2017-02-14 | 2017-05-17 | 上海斐讯数据通信技术有限公司 | Method and system of intelligent device discovery in local area network |
CN107493213A (en) * | 2017-09-26 | 2017-12-19 | 四川长虹电器股份有限公司 | A kind of method for improving lan device ability of discovery |
CN108234518A (en) * | 2018-02-06 | 2018-06-29 | 深圳创维-Rgb电子有限公司 | A kind of method, apparatus, terminal and the storage medium of terminal communication |
Also Published As
Publication number | Publication date |
---|---|
CN108234518A (en) | 2018-06-29 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2019153722A1 (en) | Terminal communication method and device, terminal and storage medium | |
CN111459433B (en) | Screen transmission method, device and storage medium | |
US9883376B2 (en) | Apparatus and method for providing universal plug and play service based on Wi-Fi direct connection in portable terminal | |
WO2019134306A1 (en) | Message processing method, device, terminal apparatus, and readable storage medium | |
US10034057B2 (en) | Message processing method, device, gateway, STB and IPTV | |
US20130346591A1 (en) | Clientless Cloud Computing | |
US20180006976A1 (en) | Voice chat mode self-adapting method and apparatus | |
US9065666B2 (en) | System and method of multi-media conferencing between universal plug and play (UPnP) enabled telephony devices and wireless area network (WAN) devices | |
CN104301373A (en) | Push notification via file sharing service synchronization | |
US20140089431A1 (en) | Instant messaging method, terminal, server, and system | |
BR112015021786B1 (en) | HOST DEVICE FOR WIRELESS COMMUNICATION WITH MULTIPLE COUPLER DEVICES, COUPLER DEVICE FOR WIRELESS COMMUNICATION WITH HOST DEVICE AND METHOD OF WIRELESS COMMUNICATION BETWEEN A HOST DEVICE AND MULTIPLE COUPLER DEVICES | |
US20130080560A1 (en) | System and Method for Sharing Digital Data on a Presenter Device to a Plurality of Participant Devices | |
US20170171496A1 (en) | Method and Electronic Device for Screen Projection | |
US10908889B2 (en) | Method, user equipment, and application server for downloading application | |
CN102724334A (en) | Notification and acquisition method, device and system for address information change in digital living network alliance (DLNA) | |
CN112752245B (en) | Distribution network method and device, electronic equipment and storage medium | |
JP2011113565A (en) | Terminal device and usb device control method therefor | |
KR102580917B1 (en) | Set-top box for digital broadcasting, and server, device and method for providing remote computing service using thereof | |
WO2015139390A1 (en) | Multicast data processing method, apparatus, and system, sending device, and receiving client | |
CN107332894B (en) | Live broadcast method, device and system, server and storage medium | |
CN112187911A (en) | Message transmission method, device, storage medium and system based on network isolation | |
CN109257392A (en) | A kind of command handling method, device, server and storage medium | |
JP6850893B2 (en) | Extended multicast network communication | |
WO2017092323A1 (en) | Main control device, playing device and data transmission method therefor | |
CN103533054B (en) | Method for realizing coordinated processing among multiple terminals and multi-terminal coordinated processing device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 18905234 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
32PN | Ep: public notification in the ep bulletin as address of the adressee cannot be established |
Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 03/12/2020) |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 18905234 Country of ref document: EP Kind code of ref document: A1 |