WO2024113583A1 - Method for searching for smart device, and electronic apparatus and conversion device - Google Patents

Method for searching for smart device, and electronic apparatus and conversion device Download PDF

Info

Publication number
WO2024113583A1
WO2024113583A1 PCT/CN2023/085939 CN2023085939W WO2024113583A1 WO 2024113583 A1 WO2024113583 A1 WO 2024113583A1 CN 2023085939 W CN2023085939 W CN 2023085939W WO 2024113583 A1 WO2024113583 A1 WO 2024113583A1
Authority
WO
WIPO (PCT)
Prior art keywords
smart
mdns
mdns service
device information
service
Prior art date
Application number
PCT/CN2023/085939
Other languages
French (fr)
Chinese (zh)
Inventor
刘健
Original Assignee
海尔优家智能科技(北京)有限公司
青岛海尔科技有限公司
海尔智家股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 海尔优家智能科技(北京)有限公司, 青岛海尔科技有限公司, 海尔智家股份有限公司 filed Critical 海尔优家智能科技(北京)有限公司
Publication of WO2024113583A1 publication Critical patent/WO2024113583A1/en

Links

Definitions

  • the present application relates to the field of smart homes, and in particular, to a method, storage medium, electronic device and conversion device for searching for smart devices.
  • UDP User Datagram Protocol
  • smart devices and terminal devices define corresponding sending ports and receiving ports respectively. After receiving requests on fixed ports, smart devices report the information of each device to the terminal device, so that the terminal device can scan all smart devices in the local area network.
  • the search process is easily interfered by the communication of other devices, and the data security and reliability are not high.
  • the related technology has the following problems:
  • the search process requires that the data formats sent and received by the terminal device and the smart device must be completely consistent.
  • the UDP data format is private, and the UDP data formats supported by different manufacturers or different platforms are often different.
  • the success rate of the terminal device searching for smart devices is low.
  • the embodiments of the present disclosure provide a method, storage medium, electronic device, and conversion device for searching smart devices, so as to improve the success rate of smart device search in a cross-vendor or cross-platform smart device search scenario.
  • the method includes: monitoring a UDP port; obtaining device information of one or more smart devices based on the monitored messages; determining the mDNS service of the smart device based on the device information; and multicasting the mDNS service of the smart device for terminal devices to query.
  • the storage medium includes a stored program, wherein the program executes the above method when it is executed.
  • the electronic device includes a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the above method through the computer program.
  • the conversion device includes: a conversion device body; and the above-mentioned electronic device is installed in the conversion device body.
  • FIG1 is a schematic diagram of a hardware environment of a method for searching for smart devices provided by an embodiment of the present disclosure
  • FIG2 is a schematic diagram of a method for searching for smart devices provided by an embodiment of the present disclosure
  • FIG3 is a schematic diagram of another method for searching for smart devices provided by an embodiment of the present disclosure.
  • FIG4 is a schematic diagram of another method for searching for smart devices provided by an embodiment of the present disclosure.
  • FIG5 is a schematic diagram of another method for searching for smart devices provided by an embodiment of the present disclosure.
  • FIG6 is a schematic diagram of an apparatus for searching for smart devices provided by an embodiment of the present disclosure.
  • FIG. 7 is a schematic diagram of a conversion device provided in an embodiment of the present disclosure.
  • UDP User Datagram Protocol
  • smart devices and terminal devices define corresponding sending ports and receiving ports respectively. After receiving the request at the fixed port, the smart device reports the information of each device to the terminal device, so that the terminal device can scan all smart devices in the local area network.
  • the search process is easily interfered by the communication of other devices, and the data security and reliability are not high.
  • a method for searching smart devices including: step 1, the smart device listens to the UDP fixed IP address and communication port; step 2, the terminal device sends a device search instruction to the fixed UDP address and UDP communication port; step 3, when the smart device receives the device search instruction sent by the terminal device using UDP unicast, it uses the public key to perform tea decryption, and then extracts the IP address and UDP communication port of the terminal device, and replies with a UDP unicast data packet to the terminal device; step 4, when the terminal device receives the UDP unicast data packet replied by the smart device, it extracts the information of the smart device from the UDP unicast data packet and starts operating communication with the smart device.
  • the relevant technology has improved the data security and reliability of the smart device search process to a certain extent, but the search process requires that the data formats sent and received by the terminal device and the smart device must be completely consistent.
  • the UDP data format is private, and the UDP data formats supported by different manufacturers or different platforms are often different. Therefore, when the smart device and the terminal device support different UDP data formats, the terminal device cannot search for the smart device. As a result, in the cross-manufacturer or cross-platform smart device search scenario, the success rate of the terminal device searching for smart devices is low.
  • the present application provides a method, storage medium, electronic device and conversion device for searching smart devices.
  • Fig. 1 is a schematic diagram of a hardware environment of a method for searching smart devices provided by an embodiment of the present disclosure.
  • the hardware environment includes a smart device 10, a conversion device 20 and a terminal device 30.
  • the smart device 10 does not only refer to a single device, but may also be multiple devices.
  • the smart device 10 and the conversion device 20 communicate with each other via the UDP protocol and support the same UDP data format.
  • the conversion device 20 and the terminal device 30 communicate with each other based on the mDNS (multicast DNS) protocol.
  • the terminal device is a user terminal, which can be a mobile phone, personal computer or other device that can input control information.
  • the user controls the smart device and conversion device through the terminal device.
  • the smart device is a household appliance that communicates with the terminal device to transmit data or execute control instructions issued by the terminal device, including but not limited to smart air conditioners, smart refrigerators, smart sweeping robots, smart cooking equipment, etc.
  • the conversion device is also a household appliance that communicates with the terminal device to transmit data or execute control instructions sent by the terminal device, such as a smart air conditioner, a smart refrigerator, a smart sweeping robot, a smart cooking device, etc.
  • the difference between the conversion device and the above-mentioned smart device is mainly that it can communicate based on the UDP and mDNS protocols.
  • the conversion device can also be a separately set data processing device without having the actual household appliance function.
  • the conversion device includes at least two functional modules: a decoding module and a data packet conversion module.
  • the decoding module can decode the received UDP broadcast message to obtain the device information of the smart device.
  • the data packet conversion module can convert the decoded device information into an mDNS service to achieve format conversion.
  • the conversion device also includes a management module that can manage the generated mDNS service.
  • the management module manages the mDNS service through the mDNS service list.
  • the management module manages the mDNS service through the mDNS service list.
  • the mDNS service corresponding to the new smart device is added to the mDNS service list.
  • the mDNS service corresponding to the offline smart device is deleted from the mDNS service list.
  • an embodiment of the present disclosure provides a method for searching for smart devices, including:
  • the conversion device listens to the UDP port.
  • the conversion device obtains device information of one or more smart devices according to the monitored message.
  • the conversion device decodes the monitored UDP broadcast message according to the data format specified by the manufacturer, thereby obtaining the device information of the smart device.
  • the conversion device determines the mDNS service of the smart device according to the device information.
  • the conversion device multicasts the mDNS service of the smart device for query by the terminal device.
  • the mDNS service of the multicast smart device here is to convert the device to multicast the mDNS service to a specific mDNS port.
  • the specific mDNS port is port 5353 in the local area network.
  • the method for searching smart devices is used to monitor the UDP port to obtain information that supports the UDP data format, thereby determining the device information of the smart device that supports the UDP format.
  • the mDNS service corresponding to the smart device is determined based on the device information, and the mDNS service of the smart device is multicast to the mDNS port.
  • the terminal device can directly obtain the device information of the smart device through the mDNS service of the smart device, thereby realizing the search and discovery of the smart device.
  • mDNS is a standard protocol, and the data transmission and reception process is not Restricted by the manufacturer or platform.
  • terminal devices belonging to different manufacturers or different platforms can receive the mDNS service that stores the device information of the smart device sent by the conversion device, thereby realizing the search and discovery of the smart device and the conversion device by the terminal device. It can be seen that in the cross-manufacturer or cross-platform smart device search scenario, the method for searching smart devices provided by the embodiment of the present disclosure effectively improves the success rate of the search.
  • the device information includes a MAC (Media Access Control) address of the device.
  • a MAC address corresponds to a smart device one-to-one, so a unique smart device can be determined based on the MAC address, thereby realizing search and discovery of the smart device.
  • the device information also includes information such as device product number, device software version, etc.
  • the device information can represent the actual situation of the smart device in more detail.
  • the embodiment of the present disclosure provides another method for searching for smart devices, including:
  • the conversion device listens to the UDP port.
  • the conversion device obtains device information of one or more smart devices according to the monitored message.
  • the device information of the smart device already exists in the mDNS service list, it means that the smart device has registered the mDNS service. You can directly retrieve the historical information to obtain the mDNS service of the smart device, thereby obtaining the device information of the smart device and realizing the search and discovery of the smart device. In this case, there is no need to register the mDNS service.
  • the conversion device multicasts the mDNS service of the smart device for query by the terminal device.
  • the conversion device monitors the UDP port to obtain information that supports the UDP data format, thereby determining the device information of the smart device that supports the UDP format.
  • the mDNS service corresponding to the smart device is determined based on the device information, and the mDNS service of the smart device is multicast to the mDNS port.
  • the terminal device can directly obtain the device information of the smart device through the mDNS service of the smart device, thereby realizing the search and discovery of the smart device.
  • the sending and receiving process of the mDNS service is not restricted by the manufacturer or platform.
  • the search and discovery of the device can also be realized through the mDNS service.
  • the success rate of smart device search is effectively improved.
  • the device information is used to determine whether the online smart device already exists in the existing mDNS service list. If it already exists, it means that the smart device has registered with the mDNS service before. Only a call is needed to determine the device information of the smart device and complete the search and discovery of the smart device. In this way, the service registration process is performed only when the currently online smart device has not registered the mDNS service, which is conducive to simplifying the logic and avoiding program redundancy.
  • the conversion device queries the device information in the mDNS service list, including: the conversion device uses the MAC address in the device information as identification information to determine the service name of the smart device, and queries the service name of the smart device in the mDNS service list.
  • the conversion device uses the MAC address in the device information as identification information to determine the service name of the smart device, and queries the service name of the smart device in the mDNS service list.
  • naming with the MAC address as identification information can ensure that the service name corresponds to the smart device one-to-one, so as to accurately query whether the smart device already exists in the mDNS service list.
  • the query of the smart device can be realized based on the naming, without calling more device information, which is conducive to simplifying the query process.
  • the conversion device uses the MAC address in the device information as identification information to determine the service name of the smart device, including: determining "MAC._transfer._udp.local" as the mDNS service name of the smart device.
  • the MAC is the MAC address of the smart device. In this way, using the MAC address in the device information as identification information can ensure that the only corresponding smart device is determined, and naming in a unified format is convenient for terminal devices to query.
  • the conversion device queries the mDNS service list for device information, including: the conversion device queries the mDNS service list for a MAC address of the smart device. Since the MAC address corresponds to the smart device one-to-one, querying through the MAC address can accurately determine whether the smart device already exists in the mDNS service list.
  • the conversion device registering the mDNS service device according to the device information includes: the conversion device registering the mDNS service name according to the device information, and saving the device information as a service parameter associated with the mDNS service name.
  • the device information of the smart device can be directly determined according to the mDNS service name, and the search and discovery of the smart device can be realized.
  • the device information can be saved in TXT text format.
  • the TXT text format can save data more conveniently.
  • data can also be stored in a database, written into a memory, etc.
  • the specific saving method can be selected according to the amount of data saved.
  • the conversion device saves the device information as a service parameter associated with the mDNS service name, including: recording the device information in the form of a key-value pair as a service parameter of the smart device.
  • the device information is recorded in the form of a key-value pair, that is, a "key” corresponds to a "value” in the device information.
  • the device product number of a smart device is recorded as "0001” and the device software version is recorded as "1.0.0". In this way, various device information of the smart device can be simply and accurately recorded.
  • the conversion device after the conversion device registers the mDNS service according to the device information, it also includes: adding the mDNS service name to the mDNS service list.
  • the newly registered smart device is added to the mDNS service list, and the mDNS service list is automatically updated.
  • the mDNS service list can be used to determine whether the current smart device has completed the mDNS service registration, thereby avoiding repeated registration of the mDNS service of the same smart device. At the same time, it can directly call to obtain device information when the registration has been completed, thereby simplifying the process.
  • the method for searching for smart devices further includes: converting the device to obtain the online status of each smart device in the mDNS service list.
  • the offline smart device is deleted from the mDNS service list.
  • the mDNS service list is updated in real time, and the real-time online smart devices can be determined according to the mDNS service list.
  • the conversion device obtains the online status of each smart device in the mDNS service list, including: the conversion device determines the online status of the smart device according to the online announcement or offline notification sent by the smart device. When receiving the offline notification of the smart device, it is determined that the smart device is offline.
  • the conversion device monitors the UDP port.
  • the conversion device obtains device information of one or more smart devices according to the monitored message.
  • the conversion device obtains the online status of each smart device in the mDNS service.
  • the conversion device determines whether the service name exists in the mDNS service list.
  • the conversion device keeps the DNS service list unchanged, and upon receiving a query instruction sent by the terminal device, calls the mDNS service of the smart device.
  • the conversion device registers the mDNS service name according to the device information, and saves the device information as a service parameter associated with the mDNS service name.
  • S409 The conversion device adds the mDNS service name to the mDNS service list.
  • the conversion device multicasts the mDNS service of the smart device for query by the terminal device.
  • the conversion device can be divided into three functional modules: a decoding module, a data packet conversion module and a management module.
  • the decoding module is responsible for decoding the received UDP format data packet to obtain the device information of the smart device.
  • the data packet conversion module is responsible for judging whether the smart device already exists in the existing mDNS service list based on the device information obtained by decoding. And if there is no smart device in the mDNS service list, the mDNS service is registered according to the decoded device information to complete the data conversion from UDP to mDNS.
  • the management module is responsible for managing the mDNS service list.
  • the newly registered mDNS service is added to the list, and on the other hand, the offline smart device is deleted from the list to realize the automatic update of the mDNS service list. This facilitates the next round of format conversion when the new smart device is online.
  • the conversion device monitors the UDP port to obtain information supporting the UDP data format, thereby determining the device information of the smart device supporting the UDP format.
  • the MAC address in the information is used as identification information to determine the mDNS service name, and then the service name is used to determine whether the service name already exists in the mDNS service list, thereby determining whether the currently online smart device has registered the mDNS service. If the mDNS service has been registered, when the query instruction sent by the terminal device is received, the mDNS service of the smart device can be called without re-registration.
  • the service name is registered according to the device information, and the device information is saved under the service name.
  • the mDNS service of the smart device is multicast to the mDNS port for the terminal device to query.
  • the terminal device can directly obtain the device information of the smart device through the mDNS service of the smart device, thereby realizing the search and discovery of the smart device.
  • the sending and receiving process of the mDNS service is not restricted by the manufacturer or platform. Therefore, when the smart device supports the UDP format and the smart device and the terminal device belong to different manufacturers or platforms, the search and discovery of the device can also be realized through the mDNS service. In the cross-manufacturer or cross-platform smart device search scenario, the success rate of smart device search is effectively improved.
  • the online status of the smart device in the mDNS service list is detected, so that the mDNS service corresponding to the offline smart device is deleted in time when the device is offline, and the mDNS service list is updated in real time, so that the terminal device can search for the currently online smart device.
  • the embodiment of the present disclosure provides another method for searching for smart devices, including:
  • the conversion device monitors the UDP port.
  • S502 smart device accesses the network.
  • the smart device broadcasts a data packet.
  • the data packet here is a data packet in UDP format, including an online announcement.
  • the conversion device can obtain the device information of the smart device according to the data announcement.
  • the smart device broadcasts the data packet to the UDP data port in the local area network.
  • the conversion device obtains device information of one or more smart devices according to the monitored message.
  • the conversion device determines the mDNS service of the smart device according to the device information.
  • the conversion device multicasts the mDNS service of the smart device.
  • the terminal device sends a query instruction.
  • the conversion device sends device information to the terminal device in response to the query instruction.
  • the conversion device monitors the UDP port to obtain information that supports the UDP data format, thereby determining the device information of the smart device that supports the UDP format.
  • the mDNS service corresponding to the smart device is determined based on the device information, and the mDNS service of the smart device is multicast to the mDNS port.
  • the terminal device can directly obtain the device information of the smart device through the mDNS service of the smart device, thereby realizing the search and discovery of the smart device.
  • the sending and receiving process of the mDNS service is not restricted by the manufacturer or platform.
  • the mDNS service can also be used to search and discover devices.
  • the success rate of smart device search is effectively improved.
  • the query instruction sent by the terminal device is compatible with the registered mDNS service.
  • the query instruction queries the mDNS service of the "transfer._udp.local” type.
  • the conversion device sending the device information to the terminal device includes: the conversion device sending the device information recorded in a TXT text format to the terminal device.
  • an embodiment of the present disclosure provides an electronic device 200, including a processor 61 and a memory 62.
  • the electronic device may further include a communication interface 63 and a bus 64.
  • the processor 61, the communication interface 63, and the memory 62 may communicate with each other through the bus 64.
  • the communication interface 63 may be used for information transmission.
  • the processor 61 may call the logic instructions in the memory 62 to execute the method for searching for smart devices in the above embodiment.
  • logic instructions in the memory 62 described above may be implemented in the form of software functional units and when sold or used as independent products, may be stored in a computer-readable storage medium.
  • the memory 62 is a computer-readable storage medium that can be used to store software programs and computer executable programs, such as program instructions/modules corresponding to the method in the embodiment of the present disclosure.
  • the processor 61 executes the function application and data processing by running the program instructions/modules stored in the memory 62, that is, the method for searching smart devices in the above embodiment is implemented.
  • the memory 62 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and an application required for at least one function; the data storage area may store data created according to the use of the terminal device, etc.
  • the memory 62 may include a high-speed random access memory and may also include a non-volatile memory.
  • an embodiment of the present disclosure provides a conversion device 100, including: a conversion device body, and the above-mentioned electronic device 200.
  • the electronic device 200 is installed in the conversion device 100 body.
  • the installation relationship described here is not limited to placement inside the product, but also includes installation connections with other components of the product, including but not limited to physical connections, electrical connections, or signal transmission connections. It can be understood by those skilled in the art that the electronic device 200 can be adapted to a feasible product body, thereby realizing other feasible embodiments.
  • An embodiment of the present disclosure provides a computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are configured to execute the method for searching for smart devices.
  • the computer-readable storage medium mentioned above may be a transient computer-readable storage medium or a non-transitory computer-readable storage medium.
  • the present disclosure provides a computer program, which, when executed by a computer, enables the computer to:
  • the computer implements the above method.
  • An embodiment of the present disclosure provides a computer program product, which includes computer instructions stored on a computer-readable storage medium.
  • the program instructions When executed by a computer, the computer implements the above method.
  • the technical solution of the embodiment of the present disclosure can be embodied in the form of a software product, which is stored in a storage medium and includes one or more instructions for enabling a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in the embodiment of the present disclosure.
  • the aforementioned storage medium may be a non-transient storage medium, including: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes, or a transient storage medium.
  • the term “and/or” as used in this application refers to any and all possible combinations of one or more associated listings.
  • the term “comprise” and its variants “comprises” and/or including (comprising) refer to the existence of stated features, wholes, steps, operations, elements, and/or components, but do not exclude the existence or addition of one or more other features, wholes, steps, operations, elements, components and/or groups of these.
  • the elements defined by the sentence “comprising a " do not exclude the existence of other identical elements in the process, method or device comprising the elements.
  • each embodiment may focus on the differences from other embodiments, and the same or similar parts between the embodiments may refer to each other.
  • the relevant parts can refer to the description of the method part.
  • the disclosed methods and products can be implemented in other ways.
  • the device embodiments described above are only schematic.
  • the division of the units can be only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.
  • the coupling or direct coupling or communication connection between each other shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
  • each functional unit in the embodiment of the present disclosure may be integrated in a processing unit, or each unit may exist physically alone, or two or more units may be integrated in one unit.
  • each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, program segment or a part of the code contains one or more executable instructions for implementing the specified logical function.
  • the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, which can depend on the functions involved.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Transfer Between Computers (AREA)
  • Computer Security & Cryptography (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The present application relates to the technical field of smart homes. Disclosed are a method for searching for a smart device, and a storage medium, an electronic apparatus and a conversion device. The method for searching for a smart device comprises: monitoring a UDP port; obtaining device information of one or more smart devices according to a detected message; determining an mDNS service of the smart device(s) according to the device information; and multicasting the mDNS service of the smart device for use by a terminal device for querying.

Description

用于搜索智能设备的方法、电子装置和转换设备Method, electronic device and conversion device for searching smart devices
本申请基于申请号为202211529938.3、申请日为2022年11月30日的中国专利申请提出,并要求该中国专利申请的优先权,该中国专利申请的全部内容在此引入本申请作为参考。This application is based on the Chinese patent application with application number 202211529938.3 and application date November 30, 2022, and claims the priority of the Chinese patent application. The entire content of the Chinese patent application is hereby introduced into this application as a reference.
技术领域Technical Field
本申请涉及智能家居领域,具体而言,涉及一种用于搜索智能设备的方法、存储介质、电子装置和转换设备。The present application relates to the field of smart homes, and in particular, to a method, storage medium, electronic device and conversion device for searching for smart devices.
背景技术Background technique
随着物联网技术的发展,越来越多的智能设备走进家庭生活。用户往往需要通过手机等终端设备对这些智能设备进行搜索和控制。目前被广泛应用于搜索智能设备的方式是基于UDP(User Datagram Protocol,用户数据报协议)广播的方式。在UDP协议下,智能设备与终端设备分别定义相对应的发送端口和接收端口,智能设备在固定端口接受请求后,将各个设备信息上报给终端设备,使终端设备可扫描出本局域网内所有的智能设备。该搜索过程易受到其他设备的通信干扰,数据安全性和可靠性不高。With the development of Internet of Things technology, more and more smart devices are entering family life. Users often need to search and control these smart devices through mobile phones and other terminal devices. The method currently widely used to search for smart devices is based on UDP (User Datagram Protocol) broadcast. Under the UDP protocol, smart devices and terminal devices define corresponding sending ports and receiving ports respectively. After receiving requests on fixed ports, smart devices report the information of each device to the terminal device, so that the terminal device can scan all smart devices in the local area network. The search process is easily interfered by the communication of other devices, and the data security and reliability are not high.
相关技术中存在如下问题:The related technology has the following problems:
搜索过程要求终端设备和智能设备所收发的数据格式必须完全一致。而UDP数据格式具有私有化的特点,不同厂家或不同平台所支持的UDP数据格式往往不同。导致在跨厂商或者跨平台的智能设备搜索场景中,终端设备搜索智能设备的成功率较低。The search process requires that the data formats sent and received by the terminal device and the smart device must be completely consistent. However, the UDP data format is private, and the UDP data formats supported by different manufacturers or different platforms are often different. As a result, in the cross-manufacturer or cross-platform smart device search scenario, the success rate of the terminal device searching for smart devices is low.
发明内容Summary of the invention
为了对披露的实施例的一些方面有基本的理解,下面给出了简单的概括。所述概括不是泛泛评述,也不是要确定关键/重要组成元素或描绘这些实施例的保护范围,而是作为后面的详细说明的序言。In order to provide a basic understanding of some aspects of the disclosed embodiments, a brief summary is given below. The summary is not an extensive review, nor is it intended to identify key/critical components or delineate the scope of protection of these embodiments, but rather serves as a prelude to the detailed description that follows.
本公开实施例提供了一种用于搜索智能设备的方法、存储介质、电子装置和转换设备,以在跨厂商或者跨平台的智能设备搜索场景中,提升智能设备搜索的成功率。The embodiments of the present disclosure provide a method, storage medium, electronic device, and conversion device for searching smart devices, so as to improve the success rate of smart device search in a cross-vendor or cross-platform smart device search scenario.
在一些实施例中,所述方法包括:监听UDP端口;根据监听得到的消息,获得一个或多个智能设备的设备信息;根据所述设备信息确定所述智能设备的mDNS服务;组播所述智能设备的mDNS服务,以供终端设备查询。 In some embodiments, the method includes: monitoring a UDP port; obtaining device information of one or more smart devices based on the monitored messages; determining the mDNS service of the smart device based on the device information; and multicasting the mDNS service of the smart device for terminal devices to query.
在一些实施例中,所述存储介质包括存储的程序,其中,所述程序运行时执行上述的方法。In some embodiments, the storage medium includes a stored program, wherein the program executes the above method when it is executed.
在一些实施例中,所述电子装置包括存储器和处理器,述存储器中存储有计算机程序,所述处理器被设置为通过所述计算机程序执行上述的方法。In some embodiments, the electronic device includes a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the above method through the computer program.
在一些实施例中,所述转换设备包括:转换装置本体;和,上述的电子装置,被安装于所述转换设备本体。In some embodiments, the conversion device includes: a conversion device body; and the above-mentioned electronic device is installed in the conversion device body.
以上的总体描述和下文中的描述仅是示例性和解释性的,不用于限制本申请。The above general description and the following description are exemplary and explanatory only and are not intended to limit the present application.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本申请的实施例,并与说明书一起用于解释本申请的原理。The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,对于本领域普通技术人员而言,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
图1是本公开实施例提供的一种用于搜索智能设备的方法的硬件环境示意图;FIG1 is a schematic diagram of a hardware environment of a method for searching for smart devices provided by an embodiment of the present disclosure;
图2是本公开实施例提供的一种用于搜索智能设备的方法的示意图;FIG2 is a schematic diagram of a method for searching for smart devices provided by an embodiment of the present disclosure;
图3是本公开实施例提供的另一种用于搜索智能设备的方法的示意图;FIG3 is a schematic diagram of another method for searching for smart devices provided by an embodiment of the present disclosure;
图4是本公开实施例提供的另一种用于搜索智能设备的方法的示意图;FIG4 is a schematic diagram of another method for searching for smart devices provided by an embodiment of the present disclosure;
图5是本公开实施例提供的另一种用于搜索智能设备的方法的示意图;FIG5 is a schematic diagram of another method for searching for smart devices provided by an embodiment of the present disclosure;
图6是本公开实施例提供的一种用于搜索智能设备的装置的示意图;FIG6 is a schematic diagram of an apparatus for searching for smart devices provided by an embodiment of the present disclosure;
图7是本公开实施例提供的一种转换设备的示意图。FIG. 7 is a schematic diagram of a conversion device provided in an embodiment of the present disclosure.
具体实施方式Detailed ways
为了使本技术领域的人员更好地理解本申请方案,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分的实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都应当属于本申请保护的范围。In order to enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this application.
需要说明的是,本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本申请的实施例能够以除了在这里图示或描述的那些以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖 不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover Non-exclusive inclusion, for example, a process, method, system, product, or apparatus that includes a series of steps or elements is not necessarily limited to those steps or elements explicitly listed, but may include other steps or elements not explicitly listed or inherent to such process, method, product, or apparatus.
随着物联网技术的发展,越来越多的智能设备走进家庭生活。用户可以通过手机、个人电脑等终端设备对智能设备的运行进行控制,很大程度上摆脱了空间的限制。在进入实际的控制过程之前,用户往往需要通过手机、个人电脑等终端设备对这些智能设备进行搜索。With the development of Internet of Things technology, more and more smart devices are entering family life. Users can control the operation of smart devices through mobile phones, personal computers and other terminal devices, which is largely free from the limitation of space. Before entering the actual control process, users often need to search for these smart devices through mobile phones, personal computers and other terminal devices.
目前被广泛应用于搜索智能设备的方式是基于UDP(User Datagram Protocol,用户数据报协议)广播的方式。在UDP协议下,智能设备与终端设备分别定义相对应的发送端口和接收端口,智能设备在固定端口接受请求后,将各个设备信息上报给终端设备,使终端设备可扫描出本局域网内所有的智能设备。该搜索过程易受到其他设备的通信干扰,数据安全性和可靠性不高。Currently, the method widely used to search for smart devices is based on UDP (User Datagram Protocol) broadcast. Under the UDP protocol, smart devices and terminal devices define corresponding sending ports and receiving ports respectively. After receiving the request at the fixed port, the smart device reports the information of each device to the terminal device, so that the terminal device can scan all smart devices in the local area network. The search process is easily interfered by the communication of other devices, and the data security and reliability are not high.
为提升数据安全性和可靠性,相关技术中公开了一种用于搜索智能设备的方法,包括:步骤1,智能设备监听UDP固定IP地址和通信端口;步骤2,终端设备向固定的UDP地址和UDP通信端口发送设备搜索指令;步骤3,智能设备接收到终端设备使用UDP单播方式发送的设备搜索指令时,使用公共密钥进行tea解密,然后提取终端设备的IP地址和UDP通信端口,并向终端设备回复UDP单播数据包;步骤4,终端设备接收到智能设备回复的UDP单播数据包时,从UDP单播数据包中提取出智能设备的信息,开始与智能设备进行作业通信。In order to improve data security and reliability, a method for searching smart devices is disclosed in the related technology, including: step 1, the smart device listens to the UDP fixed IP address and communication port; step 2, the terminal device sends a device search instruction to the fixed UDP address and UDP communication port; step 3, when the smart device receives the device search instruction sent by the terminal device using UDP unicast, it uses the public key to perform tea decryption, and then extracts the IP address and UDP communication port of the terminal device, and replies with a UDP unicast data packet to the terminal device; step 4, when the terminal device receives the UDP unicast data packet replied by the smart device, it extracts the information of the smart device from the UDP unicast data packet and starts operating communication with the smart device.
相关技术在一定程度上提升了智能设备搜索过程中的数据安全性和可靠性,但是搜索过程要求终端设备和智能设备所收发的数据格式必须完全一致。而UDP数据格式具有私有化的特点,不同厂家或不同平台所支持的UDP数据格式往往不同。因此在智能设备和终端设备支持不同UDP数据格式的情况下,终端设备无法实现智能设备的搜索。导致在跨厂商或者跨平台的智能设备搜索场景中,终端设备搜索智能设备的成功率较低。The relevant technology has improved the data security and reliability of the smart device search process to a certain extent, but the search process requires that the data formats sent and received by the terminal device and the smart device must be completely consistent. The UDP data format is private, and the UDP data formats supported by different manufacturers or different platforms are often different. Therefore, when the smart device and the terminal device support different UDP data formats, the terminal device cannot search for the smart device. As a result, in the cross-manufacturer or cross-platform smart device search scenario, the success rate of the terminal device searching for smart devices is low.
为在跨厂商或跨平台的智能设备搜索场景中,提升终端设备搜索智能设备的成功率,本申请提供一种用于搜索智能设备的方法、存储介质、电子装置和转换设备。In order to improve the success rate of terminal devices searching for smart devices in cross-vendor or cross-platform smart device search scenarios, the present application provides a method, storage medium, electronic device and conversion device for searching smart devices.
图1是本公开实施例提供的一种用于搜索智能设备的方法的硬件环境示意图。结合图1所示,该硬件环境包括智能设备10、转换设备20和终端设备30。智能设备10不仅仅指单一设备,也可能是多个设备。Fig. 1 is a schematic diagram of a hardware environment of a method for searching smart devices provided by an embodiment of the present disclosure. As shown in Fig. 1, the hardware environment includes a smart device 10, a conversion device 20 and a terminal device 30. The smart device 10 does not only refer to a single device, but may also be multiple devices.
智能设备10与转换设备20之间通过UDP协议进行通信,支持同一种UDP数据格式。转换设备20和终端设备30之间基于mDNS(multicast DNS,多播DNS)协议进行通信。 The smart device 10 and the conversion device 20 communicate with each other via the UDP protocol and support the same UDP data format. The conversion device 20 and the terminal device 30 communicate with each other based on the mDNS (multicast DNS) protocol.
其中,终端设备为用户终端,具体可以为手机、个人电脑等能够输入控制信息的设备,用户通过终端设备实现对智能设备和转换设备的控制。智能设备为与终端设备进行通信,以进行数据传输或者执行终端设备发动的控制指令的家电设备,包括但不限于智能空调、智能冰箱、智能扫地机器人、智能烹饪设备等。The terminal device is a user terminal, which can be a mobile phone, personal computer or other device that can input control information. The user controls the smart device and conversion device through the terminal device. The smart device is a household appliance that communicates with the terminal device to transmit data or execute control instructions issued by the terminal device, including but not limited to smart air conditioners, smart refrigerators, smart sweeping robots, smart cooking equipment, etc.
转换设备同样为与终端设备进行通信,以进行数据传输或者执行终端设备发送的控制指令的家电设备,例如智能空调、智能冰箱、智能扫地机器人、智能烹饪设备等。在此情况下,转换设备与上述的智能设备之间的区别主要在于能够基于UDP和mDNS两种协议进行通信。在其他实施例中,转换设备也可以是单独设置的数据处理装置,而不具备实际的家用电器功能。The conversion device is also a household appliance that communicates with the terminal device to transmit data or execute control instructions sent by the terminal device, such as a smart air conditioner, a smart refrigerator, a smart sweeping robot, a smart cooking device, etc. In this case, the difference between the conversion device and the above-mentioned smart device is mainly that it can communicate based on the UDP and mDNS protocols. In other embodiments, the conversion device can also be a separately set data processing device without having the actual household appliance function.
具体地,转换设备至少包括解码模块和数据包转换模块两个功能模块。其中,解码模块能够对接收到的UDP广播消息进行解码,从而获得智能设备的设备信息。数据包转换模块能够解码得到的设备信息转换为mDNS服务,从而实现格式转换。Specifically, the conversion device includes at least two functional modules: a decoding module and a data packet conversion module. The decoding module can decode the received UDP broadcast message to obtain the device information of the smart device. The data packet conversion module can convert the decoded device information into an mDNS service to achieve format conversion.
可选地,转换设备还包括管理模块,能够对生成的mDNS服务进行管理。具体地,管理模块通过mDNS服务列表实现对mDNS服务的管理。在有新的智能设备上线的情况下,将新的智能设备所对应的mDNS服务增加至mDNS服务列表中。在mDNS服务列表中的智能设备离线的情况下,从mDNS服务列表中删除该离线的智能设备所对应的mDNS服务。Optionally, the conversion device also includes a management module that can manage the generated mDNS service. Specifically, the management module manages the mDNS service through the mDNS service list. When a new smart device is online, the mDNS service corresponding to the new smart device is added to the mDNS service list. When a smart device in the mDNS service list is offline, the mDNS service corresponding to the offline smart device is deleted from the mDNS service list.
结合图2所示,本公开实施例提供一种用于搜索智能设备的方法,包括:As shown in FIG. 2 , an embodiment of the present disclosure provides a method for searching for smart devices, including:
S201,转换设备监听UDP端口。S201, the conversion device listens to the UDP port.
S202,转换设备根据监听得到的消息,获得一个或多个智能设备的设备信息。S202: The conversion device obtains device information of one or more smart devices according to the monitored message.
转换设备根据厂家规定的数据格式对监听得到的UDP广播消息进行解码,从而得到智能设备的设备信息。The conversion device decodes the monitored UDP broadcast message according to the data format specified by the manufacturer, thereby obtaining the device information of the smart device.
S203,转换设备根据设备信息确定智能设备的mDNS服务。S203: The conversion device determines the mDNS service of the smart device according to the device information.
S204,转换设备组播智能设备的mDNS服务,以供终端设备查询。S204, the conversion device multicasts the mDNS service of the smart device for query by the terminal device.
这里的组播智能设备的mDNS服务即转换设备向特定的mDNS端口组播mDNS服务。可选地,特定的mDNS端口为局域网中的5353端口。The mDNS service of the multicast smart device here is to convert the device to multicast the mDNS service to a specific mDNS port. Optionally, the specific mDNS port is port 5353 in the local area network.
采用本公开实施例提供的用于搜索智能设备的方法,对UDP端口进行监听,得到支持UDP数据格式的信息,从而确定支持UDP格式的智能设备的设备信息。根据该设备信息确定智能设备对应的mDNS服务,并向mDNS端口组播该智能设备的mDNS服务。这样,终端设备在搜索智能设备时,能够直接通过智能设备的mDNS服务获得该智能设备的设备信息,从而实现对该智能设备的搜索发现。mDNS属于标准协议,数据的收发过程不 受到厂家或平台的限制。因此,属于不同厂商或不同平台的终端设备都可以接收到转换设备发送的存储有智能设备的设备信息的mDNS服务,从而实现了终端设备对智能设备以及转换设备的搜索发现。可见在跨厂商或者跨平台的智能设备搜索场景中,本公开实施例提供的用于搜索智能设备的方法有效提升了搜索的成功率。The method for searching smart devices provided by the embodiment of the present disclosure is used to monitor the UDP port to obtain information that supports the UDP data format, thereby determining the device information of the smart device that supports the UDP format. The mDNS service corresponding to the smart device is determined based on the device information, and the mDNS service of the smart device is multicast to the mDNS port. In this way, when searching for a smart device, the terminal device can directly obtain the device information of the smart device through the mDNS service of the smart device, thereby realizing the search and discovery of the smart device. mDNS is a standard protocol, and the data transmission and reception process is not Restricted by the manufacturer or platform. Therefore, terminal devices belonging to different manufacturers or different platforms can receive the mDNS service that stores the device information of the smart device sent by the conversion device, thereby realizing the search and discovery of the smart device and the conversion device by the terminal device. It can be seen that in the cross-manufacturer or cross-platform smart device search scenario, the method for searching smart devices provided by the embodiment of the present disclosure effectively improves the success rate of the search.
可选地,设备信息包括设备的MAC(Media Access Control,媒介存取控制)地址。MAC地址与智能设备一一对应,因此根据MAC地址能够确定唯一的智能设备,从而实现对智能设备的搜索发现。Optionally, the device information includes a MAC (Media Access Control) address of the device. A MAC address corresponds to a smart device one-to-one, so a unique smart device can be determined based on the MAC address, thereby realizing search and discovery of the smart device.
可选地,设备信息还包括设备产品编号、设备软件版本等信息。这样,设备信息能够更详细地表征智能设备的实际情况。Optionally, the device information also includes information such as device product number, device software version, etc. In this way, the device information can represent the actual situation of the smart device in more detail.
结合图3所示,本公开实施例提供另一种用于搜索智能设备的方法,包括:As shown in FIG3 , the embodiment of the present disclosure provides another method for searching for smart devices, including:
S301,转换设备监听UDP端口。S301, the conversion device listens to the UDP port.
S302,转换设备根据监听得到的消息,获得一个或多个智能设备的设备信息。S302: The conversion device obtains device information of one or more smart devices according to the monitored message.
S303,转换设备在mDNS服务列表中查询设备信息。S303: The conversion device queries the mDNS service list for device information.
S304,若mDNS服务列表中存在设备信息,则转换设备在接收到终端设备发送的查询指令的情况下,调取智能设备的mDNS服务。S304: If the device information exists in the mDNS service list, the conversion device calls the mDNS service of the smart device when receiving the query instruction sent by the terminal device.
mDNS服务列表中已经存在该智能设备的设备信息,说明该智能设备已经注册过mDNS服务,直接调取历史信息即可获得该智能设备的mDNS服务,从而获得该智能设备的设备信息,进而实现对该智能设备的搜索发现。该情况无需进行mDNS服务注册。If the device information of the smart device already exists in the mDNS service list, it means that the smart device has registered the mDNS service. You can directly retrieve the historical information to obtain the mDNS service of the smart device, thereby obtaining the device information of the smart device and realizing the search and discovery of the smart device. In this case, there is no need to register the mDNS service.
S305,若mDNS服务列表中不存在设备信息,则转换设备根据设备信息注册mDNS服务。S305: If the device information does not exist in the mDNS service list, the conversion device registers the mDNS service according to the device information.
S306,转换设备组播智能设备的mDNS服务,以供终端设备查询。S306, the conversion device multicasts the mDNS service of the smart device for query by the terminal device.
采用本公开实施例提供的用于搜索智能设备的方法,转换设备对UDP端口进行监听,得到支持UDP数据格式的信息,从而确定支持UDP格式的智能设备的设备信息。根据该设备信息确定智能设备对应的mDNS服务,并向mDNS端口组播该智能设备的mDNS服务。这样,终端设备在搜索智能设备时,能够直接通过智能设备的mDNS服务获得该智能设备的设备信息,从而实现对该智能设备的搜索发现。mDNS服务的收发过程不受到厂家或平台的限制,因此,在智能设备支持UDP格式,且智能设备和终端设备属于不同厂商或平台时,也能通过mDNS服务实现对设备的搜索发现。在跨厂商或者跨平台的智能设备搜索场景中,有效提升了智能设备搜索的成功率。Using the method for searching smart devices provided by the embodiment of the present disclosure, the conversion device monitors the UDP port to obtain information that supports the UDP data format, thereby determining the device information of the smart device that supports the UDP format. The mDNS service corresponding to the smart device is determined based on the device information, and the mDNS service of the smart device is multicast to the mDNS port. In this way, when searching for a smart device, the terminal device can directly obtain the device information of the smart device through the mDNS service of the smart device, thereby realizing the search and discovery of the smart device. The sending and receiving process of the mDNS service is not restricted by the manufacturer or platform. Therefore, when the smart device supports the UDP format and the smart device and the terminal device belong to different manufacturers or platforms, the search and discovery of the device can also be realized through the mDNS service. In the cross-manufacturer or cross-platform smart device search scenario, the success rate of smart device search is effectively improved.
此外,在智能设备上线的情况下,根据设备信息判断现有的mDNS服务列表中是否已经存在该上线的智能设备。若已经存在,则说明该智能设备曾经注册过mDNS服务,只 需进行调用即可确定智能设备的设备信息,完成对该智能设备的搜索发现。这样,只在当前上线的智能设备没有注册过mDNS服务的情况下,才进行服务注册过程,有利于简化逻辑,避免程序冗余。In addition, when a smart device is online, the device information is used to determine whether the online smart device already exists in the existing mDNS service list. If it already exists, it means that the smart device has registered with the mDNS service before. Only a call is needed to determine the device information of the smart device and complete the search and discovery of the smart device. In this way, the service registration process is performed only when the currently online smart device has not registered the mDNS service, which is conducive to simplifying the logic and avoiding program redundancy.
可选地,转换设备在mDNS服务列表中查询设备信息,包括:转换设备以设备信息中的MAC地址作为标识信息,确定智能设备的服务名,并在mDNS服务列表中查询该智能设备的服务名。这样,以MAC地址作为标识信息进行命名,能够保证服务名与智能设备一一对应,从而准确查询到mDNS服务列表中是否已经存在该智能设备。此外,根据命名即可实现对智能设备的查询,无需调用更多设备信息,有利于简化查询过程。Optionally, the conversion device queries the device information in the mDNS service list, including: the conversion device uses the MAC address in the device information as identification information to determine the service name of the smart device, and queries the service name of the smart device in the mDNS service list. In this way, naming with the MAC address as identification information can ensure that the service name corresponds to the smart device one-to-one, so as to accurately query whether the smart device already exists in the mDNS service list. In addition, the query of the smart device can be realized based on the naming, without calling more device information, which is conducive to simplifying the query process.
可选地,转换设备以设备信息中的MAC地址作为标识信息,确定智能设备的服务名,包括:将“MAC._transfer._udp.local”确定为智能设备的mDNS服务名。其中的MAC为智能设备的MAC地址。这样,以设备信息中的MAC地址作为标识信息能够保证确定唯一对应的智能设备,同时按照统一的格式进行命名便于终端设备进行查询。Optionally, the conversion device uses the MAC address in the device information as identification information to determine the service name of the smart device, including: determining "MAC._transfer._udp.local" as the mDNS service name of the smart device. The MAC is the MAC address of the smart device. In this way, using the MAC address in the device information as identification information can ensure that the only corresponding smart device is determined, and naming in a unified format is convenient for terminal devices to query.
可选地,转换设备在mDNS服务列表中查询设备信息,包括:转换设备在所述mDNS服务列表中查询智能设备的MAC地址。由于MAC地址与智能设备一一对应,因此,通过MAC地址进行查询,能够准确判断出智能设备是否已经存在于mDNS服务列表中。Optionally, the conversion device queries the mDNS service list for device information, including: the conversion device queries the mDNS service list for a MAC address of the smart device. Since the MAC address corresponds to the smart device one-to-one, querying through the MAC address can accurately determine whether the smart device already exists in the mDNS service list.
可选地,转换设备根据设备信息注册mDNS服务设备包括:转换设备根据设备信息注册mDNS服务名,并将设备信息保存为与mDNS服务名相关联的服务参数。这样,根据mDNS服务名能够直接确定智能设备的设备信息,实现智能设备的搜索发现。Optionally, the conversion device registering the mDNS service device according to the device information includes: the conversion device registering the mDNS service name according to the device information, and saving the device information as a service parameter associated with the mDNS service name. In this way, the device information of the smart device can be directly determined according to the mDNS service name, and the search and discovery of the smart device can be realized.
这里,可以将设备信息保存为TXT文本格式。在所保存的设备信息体量较小的情况下,TXT文本格式能够较为便捷的保存数据。在其他实施例中,也可以通过数据库、写入存储器等方式存储数据。具体保存方式可以根据保存的数据量进行选择。Here, the device information can be saved in TXT text format. When the amount of device information saved is small, the TXT text format can save data more conveniently. In other embodiments, data can also be stored in a database, written into a memory, etc. The specific saving method can be selected according to the amount of data saved.
可选地,转换设备将设备信息保存为与mDNS服务名相关联的服务参数包括:以键值对的形式记录设备信息,作为智能设备的服务参数。以键值对的形式记录设备信息,即一个“键”对应设备信息中的一个“值”。例如一个智能设备的设备产品编号对应记录为“0001”,设备软件版本对应记录为“1.0.0”。这样,能够简单准确地记录下智能设备的各项设备信息。Optionally, the conversion device saves the device information as a service parameter associated with the mDNS service name, including: recording the device information in the form of a key-value pair as a service parameter of the smart device. The device information is recorded in the form of a key-value pair, that is, a "key" corresponds to a "value" in the device information. For example, the device product number of a smart device is recorded as "0001" and the device software version is recorded as "1.0.0". In this way, various device information of the smart device can be simply and accurately recorded.
可选地,转换设备根据设备信息注册mDNS服务之后,还包括:将mDNS服务名增加至mDNS服务列表中。这样,将新注册的智能设备增加至mDNS服务列表中,实现了对mDNS服务列表的自动更新。后续搜索智能设备的过程中,通过mDNS服务列表即可确定当前的智能设备是否已经完成mDNS服务注册,避免重复注册同一台智能设备的mDNS服务。同时能够在已经完成注册的情况下直接调用获得设备信息,进而简化流程。 Optionally, after the conversion device registers the mDNS service according to the device information, it also includes: adding the mDNS service name to the mDNS service list. In this way, the newly registered smart device is added to the mDNS service list, and the mDNS service list is automatically updated. In the subsequent search for smart devices, the mDNS service list can be used to determine whether the current smart device has completed the mDNS service registration, thereby avoiding repeated registration of the mDNS service of the same smart device. At the same time, it can directly call to obtain device information when the registration has been completed, thereby simplifying the process.
可选地,该用于搜索智能设备的方法,还包括:转换设备获得mDNS服务列表中各个智能设备的上线状态。在智能设备离线的情况下,从mDNS服务列表中删除离线的智能设备。这样,实现了对mDNS服务列表的实时更新,根据mDNS服务列表即可确定实时在线的智能设备。Optionally, the method for searching for smart devices further includes: converting the device to obtain the online status of each smart device in the mDNS service list. When the smart device is offline, the offline smart device is deleted from the mDNS service list. In this way, the mDNS service list is updated in real time, and the real-time online smart devices can be determined according to the mDNS service list.
可选地,转换设备获得mDNS服务列表中各个智能设备的上线状态,包括:转换设备根据智能设备发送的上线宣告或离线通知确定智能设备的上线状态。在接收到智能设备的离线通知的情况下,即确定该智能设备离线。Optionally, the conversion device obtains the online status of each smart device in the mDNS service list, including: the conversion device determines the online status of the smart device according to the online announcement or offline notification sent by the smart device. When receiving the offline notification of the smart device, it is determined that the smart device is offline.
结合图4所示,本公开实施例提供另一种用于搜索智能设备的方法,包括:As shown in FIG. 4 , the embodiment of the present disclosure provides another method for searching for smart devices, including:
S401,转换设备监测UDP端口。S401, the conversion device monitors the UDP port.
S402,转换设备根据监听得到的消息,获得一个或多个智能设备的设备信息。S402: The conversion device obtains device information of one or more smart devices according to the monitored message.
S403,转换设备以设备信息中的MAC地址作为标识信息,确定智能设备的服务名。S403: The conversion device uses the MAC address in the device information as identification information to determine the service name of the smart device.
S404,转换设备获得mDNS服务中各个智能设备的上线状态。S404: The conversion device obtains the online status of each smart device in the mDNS service.
S405,在智能设备离线的情况下,转换设备从mDNS服务列表中删除离线的智能设备。S405: When the smart device is offline, the conversion device deletes the offline smart device from the mDNS service list.
S406,转换设备判断mDNS服务列表是否存在该服务名。S406: The conversion device determines whether the service name exists in the mDNS service list.
若存在,S407,转换设备保持DNS服务列表不变,并在接收到终端设备发送的查询指令的情况下,调取智能设备的mDNS服务。If so, in S407, the conversion device keeps the DNS service list unchanged, and upon receiving a query instruction sent by the terminal device, calls the mDNS service of the smart device.
若不存在,S408,转换设备根据设备信息注册mDNS服务名,并将设备信息保存为与mDNS服务名相关联的服务参数。If not, S408, the conversion device registers the mDNS service name according to the device information, and saves the device information as a service parameter associated with the mDNS service name.
S409,转换设备将该mDNS服务名增加至mDNS服务列表。S409: The conversion device adds the mDNS service name to the mDNS service list.
S410,转换设备组播智能设备的mDNS服务,以供终端设备查询。S410, the conversion device multicasts the mDNS service of the smart device for query by the terminal device.
与上述的方法相对应的,可以将转换设备划分为三个功能模块:解码模块、数据包转换模块和管理模块。其中,解码模块负责将接收到的UDP格式的数据包进行解码获得智能设备的设备信息。数据包转换模块负责根据解码获得的设备信息判断现有的mDNS服务列表中是否已经存在该智能设备。并在mDNS服务列表中不存在智能设备的情况下根据解码得到的设备信息进行mDNS服务注册,完成从UDP到mDNS的数据转换。管理模块负责对mDNS服务列表进行管理。一方面将新注册的mDNS服务添加至列表,另一方面将已经离线的智能设备从列表中删除,实现mDNS服务列表的自动更新。从而便于后续新的智能设备上线时进行下一轮的格式转换。Corresponding to the above method, the conversion device can be divided into three functional modules: a decoding module, a data packet conversion module and a management module. Among them, the decoding module is responsible for decoding the received UDP format data packet to obtain the device information of the smart device. The data packet conversion module is responsible for judging whether the smart device already exists in the existing mDNS service list based on the device information obtained by decoding. And if there is no smart device in the mDNS service list, the mDNS service is registered according to the decoded device information to complete the data conversion from UDP to mDNS. The management module is responsible for managing the mDNS service list. On the one hand, the newly registered mDNS service is added to the list, and on the other hand, the offline smart device is deleted from the list to realize the automatic update of the mDNS service list. This facilitates the next round of format conversion when the new smart device is online.
采用本公开实施例提供的用于搜索智能设备的方法,转换设备对UDP端口进行监听,得到支持UDP数据格式的信息,从而确定支持UDP格式的智能设备的设备信息。将设备 信息中的MAC地址作为标识信息确定mDNS服务名,然后根据该服务名判断mDNS服务列表中是否已经存在该服务名,从而确定当前上线的智能设备是否注册过mDNS服务。若已经注册过mDNS服务,则在接收到终端设备发送的查询指令的情况下,调取智能设备的mDNS服务即可,无需重新注册。若当前上线的智能设备并未注册过mDNS服务,则根据设备信息注册服务名,并将设备信息保存在该服务名名下。向mDNS端口组播该智能设备的mDNS服务,以便终端设备查询。这样,终端设备在搜索智能设备时,能够直接通过智能设备的mDNS服务获得该智能设备的设备信息,从而实现对该智能设备的搜索发现。mDNS服务的收发过程不受到厂家或平台的限制,因此,在智能设备支持UDP格式,且智能设备和终端设备属于不同厂商或平台时,也能通过mDNS服务实现对设备的搜索发现。在跨厂商或者跨平台的智能设备搜索场景中,有效提升了智能设备搜索的成功率。By using the method for searching smart devices provided by the embodiment of the present disclosure, the conversion device monitors the UDP port to obtain information supporting the UDP data format, thereby determining the device information of the smart device supporting the UDP format. The MAC address in the information is used as identification information to determine the mDNS service name, and then the service name is used to determine whether the service name already exists in the mDNS service list, thereby determining whether the currently online smart device has registered the mDNS service. If the mDNS service has been registered, when the query instruction sent by the terminal device is received, the mDNS service of the smart device can be called without re-registration. If the currently online smart device has not registered the mDNS service, the service name is registered according to the device information, and the device information is saved under the service name. The mDNS service of the smart device is multicast to the mDNS port for the terminal device to query. In this way, when searching for smart devices, the terminal device can directly obtain the device information of the smart device through the mDNS service of the smart device, thereby realizing the search and discovery of the smart device. The sending and receiving process of the mDNS service is not restricted by the manufacturer or platform. Therefore, when the smart device supports the UDP format and the smart device and the terminal device belong to different manufacturers or platforms, the search and discovery of the device can also be realized through the mDNS service. In the cross-manufacturer or cross-platform smart device search scenario, the success rate of smart device search is effectively improved.
在此过程中对mDNS服务列表中的智能设备的上线状态进行检测,从而在设备离线的情况下及时删除该离线的智能设备所对应的mDNS服务,实现mDNS服务列表的实时更新,从而使得终端设备搜索到当前在线的智能设备。During this process, the online status of the smart device in the mDNS service list is detected, so that the mDNS service corresponding to the offline smart device is deleted in time when the device is offline, and the mDNS service list is updated in real time, so that the terminal device can search for the currently online smart device.
结合图5所示,本公开实施例提供另一种用于搜索智能设备的方法,包括:As shown in FIG5 , the embodiment of the present disclosure provides another method for searching for smart devices, including:
S501,转换设备监测UDP端口。S501, the conversion device monitors the UDP port.
S502,智能设备入网。S502, smart device accesses the network.
S503,智能设备广播数据包。S503, the smart device broadcasts a data packet.
这里的数据包为UDP格式的数据包,包括上线宣告。转换设备根据数据宣告能够得到智能设备的设备信息。相适应的,智能设备广播数据包为向局域网中的UDP数据端口广播数据包。The data packet here is a data packet in UDP format, including an online announcement. The conversion device can obtain the device information of the smart device according to the data announcement. Correspondingly, the smart device broadcasts the data packet to the UDP data port in the local area network.
S504,转换设备根据监听得到的消息,获得一个或多个智能设备的设备信息。S504: The conversion device obtains device information of one or more smart devices according to the monitored message.
S505,转换设备根据设备信息确定智能设备的mDNS服务。S505: The conversion device determines the mDNS service of the smart device according to the device information.
S506,转换设备组播智能设备的mDNS服务。S506, the conversion device multicasts the mDNS service of the smart device.
S507,终端设备发送查询指令。S507, the terminal device sends a query instruction.
S508,转换设备响应于查询指令,向终端设备发送设备信息。S508: The conversion device sends device information to the terminal device in response to the query instruction.
采用本公开实施例提供的用于搜索智能设备的方法,转换设备对UDP端口进行监听,得到支持UDP数据格式的信息,从而确定支持UDP格式的智能设备的设备信息。根据该设备信息确定智能设备对应的mDNS服务,并向mDNS端口组播该智能设备的mDNS服务。这样,终端设备在搜索智能设备时,能够直接通过智能设备的mDNS服务获得该智能设备的设备信息,从而实现对该智能设备的搜索发现。mDNS服务的收发过程不受到厂家或平台的限制,因此,在智能设备支持UDP格式,且智能设备和终端设备属于不同厂商 或平台时,也能通过mDNS服务实现对设备的搜索发现。在跨厂商或者跨平台的智能设备搜索场景中,有效提升了智能设备搜索的成功率。Using the method for searching smart devices provided by the embodiment of the present disclosure, the conversion device monitors the UDP port to obtain information that supports the UDP data format, thereby determining the device information of the smart device that supports the UDP format. The mDNS service corresponding to the smart device is determined based on the device information, and the mDNS service of the smart device is multicast to the mDNS port. In this way, when searching for a smart device, the terminal device can directly obtain the device information of the smart device through the mDNS service of the smart device, thereby realizing the search and discovery of the smart device. The sending and receiving process of the mDNS service is not restricted by the manufacturer or platform. Therefore, when the smart device supports the UDP format and the smart device and the terminal device belong to different manufacturers, When searching for smart devices across manufacturers or platforms, the mDNS service can also be used to search and discover devices. In the cross-vendor or cross-platform smart device search scenario, the success rate of smart device search is effectively improved.
可选地,终端设备发送的查询指令与注册的mDNS服务相适应。例如在mDNS服务名为“MAC._transfer._udp.local”的情况下,查询指令查询“transfer._udp.local”类型的mDNS服务。Optionally, the query instruction sent by the terminal device is compatible with the registered mDNS service. For example, when the mDNS service name is "MAC._transfer._udp.local", the query instruction queries the mDNS service of the "transfer._udp.local" type.
可选地,转换设备向终端设备发送设备信息包括:转换设备向终端设备发送以TXT文本格式记录的设备信息。Optionally, the conversion device sending the device information to the terminal device includes: the conversion device sending the device information recorded in a TXT text format to the terminal device.
结合图6所示,本公开实施例提供一种电子装置200,包括处理器(processor)61和存储器(memory)62。可选地,该电子装置还可以包括通信接口(Communication Interface)63和总线64。其中,处理器61、通信接口63、存储器62可以通过总线64完成相互间的通信。通信接口63可以用于信息传输。处理器61可以调用存储器62中的逻辑指令,以执行上述实施例的用于搜索智能设备的方法。As shown in FIG6 , an embodiment of the present disclosure provides an electronic device 200, including a processor 61 and a memory 62. Optionally, the electronic device may further include a communication interface 63 and a bus 64. The processor 61, the communication interface 63, and the memory 62 may communicate with each other through the bus 64. The communication interface 63 may be used for information transmission. The processor 61 may call the logic instructions in the memory 62 to execute the method for searching for smart devices in the above embodiment.
此外,上述的存储器62中的逻辑指令可以通过软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。In addition, the logic instructions in the memory 62 described above may be implemented in the form of software functional units and when sold or used as independent products, may be stored in a computer-readable storage medium.
存储器62作为一种计算机可读存储介质,可用于存储软件程序、计算机可执行程序,如本公开实施例中的方法对应的程序指令/模块。处理器61通过运行存储在存储器62中的程序指令/模块,从而执行功能应用以及数据处理,即实现上述实施例中用于搜索智能设备的方法。The memory 62 is a computer-readable storage medium that can be used to store software programs and computer executable programs, such as program instructions/modules corresponding to the method in the embodiment of the present disclosure. The processor 61 executes the function application and data processing by running the program instructions/modules stored in the memory 62, that is, the method for searching smart devices in the above embodiment is implemented.
存储器62可包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序;存储数据区可存储根据终端设备的使用所创建的数据等。此外,存储器62可以包括高速随机存取存储器,还可以包括非易失性存储器。The memory 62 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and an application required for at least one function; the data storage area may store data created according to the use of the terminal device, etc. In addition, the memory 62 may include a high-speed random access memory and may also include a non-volatile memory.
结合图7所示,本公开实施例提供了一种转换设备100,包括:转换设备本体,以及上述的电子装置200。电子装置200被安装于转换设备100本体。这里所表述的安装关系,并不仅限于在产品内部放置,还包括了与产品的其他元器件的安装连接,包括但不限于物理连接、电性连接或者信号传输连接等。本领域技术人员可以理解的是,电子装置200可以适配于可行的产品主体,进而实现其他可行的实施例。As shown in FIG7 , an embodiment of the present disclosure provides a conversion device 100, including: a conversion device body, and the above-mentioned electronic device 200. The electronic device 200 is installed in the conversion device 100 body. The installation relationship described here is not limited to placement inside the product, but also includes installation connections with other components of the product, including but not limited to physical connections, electrical connections, or signal transmission connections. It can be understood by those skilled in the art that the electronic device 200 can be adapted to a feasible product body, thereby realizing other feasible embodiments.
本公开实施例提供了一种计算机可读存储介质,存储有计算机可执行指令,所述计算机可执行指令设置为执行上述用于搜索智能设备的方法。An embodiment of the present disclosure provides a computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are configured to execute the method for searching for smart devices.
上述的计算机可读存储介质可以是暂态计算机可读存储介质,也可以是非暂态计算机可读存储介质。The computer-readable storage medium mentioned above may be a transient computer-readable storage medium or a non-transitory computer-readable storage medium.
本公开实施例提供了一种计算机程序,当所述计算机程序被计算机执行时,使所述计 算机实现上述方法。The present disclosure provides a computer program, which, when executed by a computer, enables the computer to: The computer implements the above method.
本公开实施例提供了一种计算机程序产品,所述计算机程序产品包括存储在计算机可读存储介质上的计算机指令,当所述程序指令被计算机执行时,使所述计算机实现上述方法。An embodiment of the present disclosure provides a computer program product, which includes computer instructions stored on a computer-readable storage medium. When the program instructions are executed by a computer, the computer implements the above method.
本公开实施例的技术方案可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括一个或多个指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本公开实施例所述方法的全部或部分步骤。而前述的存储介质可以是非暂态存储介质,包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等多种可以存储程序代码的介质,也可以是暂态存储介质。The technical solution of the embodiment of the present disclosure can be embodied in the form of a software product, which is stored in a storage medium and includes one or more instructions for enabling a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in the embodiment of the present disclosure. The aforementioned storage medium may be a non-transient storage medium, including: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes, or a transient storage medium.
以上描述和附图充分地示出了本公开的实施例,以使本领域的技术人员能够实践它们。其他实施例可以包括结构的、逻辑的、电气的、过程的以及其他的改变。实施例仅代表可能的变化。除非明确要求,否则单独的部件和功能是可选的,并且操作的顺序可以变化。一些实施例的部分和特征可以被包括在或替换其他实施例的部分和特征。而且,本申请中使用的用词仅用于描述实施例并且不用于限制权利要求。如在实施例以及权利要求的描述中使用的,除非上下文清楚地表明,否则单数形式的“一个”(a)、“一个”(an)和“所述”(the)旨在同样包括复数形式。类似地,如在本申请中所使用的术语“和/或”是指包含一个或一个以上相关联的列出的任何以及所有可能的组合。另外,当用于本申请中时,术语“包括”(comprise)及其变型“包括”(comprises)和/或包括(comprising)等指陈述的特征、整体、步骤、操作、元素,和/或组件的存在,但不排除一个或一个以上其它特征、整体、步骤、操作、元素、组件和/或这些的分组的存在或添加。在没有更多限制的情况下,由语句“包括一个…”限定的要素,并不排除在包括所述要素的过程、方法或者设备中还存在另外的相同要素。本文中,每个实施例重点说明的可以是与其他实施例的不同之处,各个实施例之间相同相似部分可以互相参见。对于实施例公开的方法、产品等而言,如果其与实施例公开的方法部分相对应,那么相关之处可以参见方法部分的描述。The above description and the accompanying drawings fully illustrate the embodiments of the present disclosure so that those skilled in the art can practice them. Other embodiments may include structural, logical, electrical, process and other changes. The embodiments represent only possible changes. Unless explicitly required, individual components and functions are optional, and the order of operations may vary. Parts and features of some embodiments may be included in or replace parts and features of other embodiments. Moreover, the words used in this application are only used to describe the embodiments and are not used to limit the claims. As used in the description of the embodiments and the claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms as well. Similarly, the term "and/or" as used in this application refers to any and all possible combinations of one or more associated listings. In addition, when used in this application, the term "comprise" and its variants "comprises" and/or including (comprising) refer to the existence of stated features, wholes, steps, operations, elements, and/or components, but do not exclude the existence or addition of one or more other features, wholes, steps, operations, elements, components and/or groups of these. In the absence of further restrictions, the elements defined by the sentence "comprising a ..." do not exclude the existence of other identical elements in the process, method or device comprising the elements. In this article, each embodiment may focus on the differences from other embodiments, and the same or similar parts between the embodiments may refer to each other. For the methods, products, etc. disclosed in the embodiments, if they correspond to the method part disclosed in the embodiments, then the relevant parts can refer to the description of the method part.
本领域技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,可以取决于技术方案的特定应用和设计约束条件。所述技术人员可以对每个特定的应用来使用不同方法以实现所描述的功能,但是这种实现不应认为超出本公开实施例的范围。所述技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘 述。Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software may depend on the specific application and design constraints of the technical solution. The technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the embodiments of the present disclosure. The technicians will clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. State.
本文所披露的实施例中,所揭露的方法、产品(包括但不限于装置、设备等),可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,可以仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另外,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例。另外,在本公开实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。In the embodiments disclosed herein, the disclosed methods and products (including but not limited to devices, equipment, etc.) can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units can be only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between each other shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms. The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to implement this embodiment. In addition, each functional unit in the embodiment of the present disclosure may be integrated in a processing unit, or each unit may exist physically alone, or two or more units may be integrated in one unit.
附图中的流程图和框图显示了根据本公开实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段或代码的一部分,所述模块、程序段或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个连续的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这可以依所涉及的功能而定。在附图中的流程图和框图所对应的描述中,不同的方框所对应的操作或步骤也可以以不同于描述中所披露的顺序发生,有时不同的操作或步骤之间不存在特定的顺序。例如,两个连续的操作或步骤实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这可以依所涉及的功能而定。框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或动作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。The flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the system, method and computer program product according to the embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, program segment or a part of the code contains one or more executable instructions for implementing the specified logical function. In some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, which can depend on the functions involved. In the descriptions corresponding to the flowcharts and block diagrams in the accompanying drawings, the operations or steps corresponding to different boxes can also occur in an order different from that disclosed in the description, and sometimes there is no specific order between different operations or steps. For example, two consecutive operations or steps can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, which can depend on the functions involved. Each box in the block diagram and/or flowchart, and the combination of boxes in the block diagram and/or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
以上所述仅是本申请的优选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本申请原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视为本申请的保护范围。 The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims (18)

  1. 一种用于搜索智能设备的方法,包括:A method for searching for a smart device, comprising:
    监听UDP端口;Listen to UDP port;
    根据监听得到的消息,获得一个或多个智能设备的设备信息;According to the monitored messages, obtain device information of one or more smart devices;
    根据所述设备信息确定所述智能设备的mDNS服务;Determine the mDNS service of the smart device according to the device information;
    组播所述智能设备的mDNS服务,以供终端设备查询。The mDNS service of the smart device is multicasted for terminal devices to query.
  2. 根据权利要求1所述的方法,其中所述根据所述设备信息确定所述智能设备的mDNS服务,包括:The method according to claim 1, wherein determining the mDNS service of the smart device according to the device information comprises:
    在mDNS服务列表中查询所述设备信息;Query the device information in the mDNS service list;
    若所述mDNS服务列表中存在所述设备信息,则在接收到终端设备发送的查询指令的情况下,调取所述智能设备的mDNS服务;If the device information exists in the mDNS service list, upon receiving a query instruction sent by the terminal device, the mDNS service of the smart device is called;
    若所述mDNS服务列表中不存在所述设备信息,则根据所述设备信息注册mDNS服务。If the device information does not exist in the mDNS service list, register the mDNS service according to the device information.
  3. 根据权利要求2所述的方法,其中所述在mDNS服务列表中查询所述设备信息,包括:The method according to claim 2, wherein querying the device information in the mDNS service list comprises:
    以所述设备信息中的MAC地址作为标识信息,确定所述智能设备的服务名,并在所述mDNS服务列表中查询所述智能设备的服务名。The MAC address in the device information is used as identification information to determine the service name of the smart device, and the service name of the smart device is queried in the mDNS service list.
  4. 根据权利要求2所述的方法,其中所述根据所述设备信息注册mDNS服务包括:The method according to claim 2, wherein registering the mDNS service according to the device information comprises:
    根据所述设备信息注册mDNS服务名;Register the mDNS service name according to the device information;
    将所述设备信息保存为与所述mDNS服务名相关联的服务参数。The device information is saved as a service parameter associated with the mDNS service name.
  5. 根据权利要求4所述的方法,其中所述将所述设备信息保存为与所述mDNS服务名相关联的服务参数,包括:The method according to claim 4, wherein the saving the device information as a service parameter associated with the mDNS service name comprises:
    以键值对的形式记录所述设备信息,作为所述智能设备的服务参数。The device information is recorded in the form of a key-value pair as a service parameter of the smart device.
  6. 根据权利要求4所述的方法,其中所述根据所述设备信息注册mDNS服务名之后,还包括:The method according to claim 4, wherein after registering the mDNS service name according to the device information, the method further comprises:
    将所述mDNS服务名增加至mDNS服务列表。Add the mDNS service name to the mDNS service list.
  7. 根据权利要求1至6任一项所述的方法,其中所述方法还包括:The method according to any one of claims 1 to 6, wherein the method further comprises:
    获得mDNS服务列表中各个智能设备的上线状态;Get the online status of each smart device in the mDNS service list;
    在智能设备离线的情况下,从所述mDNS服务列表中删除离线的智能设备。When the smart device is offline, the offline smart device is deleted from the mDNS service list.
  8. 一种计算机可读的存储介质,其中所述计算机可读的存储介质包括存储的程序, 其中,所述程序运行时执行权利要求1至7中任一项所述的方法。A computer-readable storage medium, wherein the computer-readable storage medium includes a stored program, Wherein, when the program is run, the method according to any one of claims 1 to 7 is executed.
  9. 一种电子装置,包括存储器和处理器,其中所述存储器中存储有计算机程序,所述处理器被设置为通过所述计算机程序执行以下步骤:An electronic device comprises a memory and a processor, wherein the memory stores a computer program, and the processor is configured to perform the following steps through the computer program:
    监听UDP端口;Listen to UDP port;
    根据监听得到的消息,获得一个或多个智能设备的设备信息;According to the monitored messages, obtain device information of one or more smart devices;
    根据所述设备信息确定所述智能设备的mDNS服务;Determine the mDNS service of the smart device according to the device information;
    组播所述智能设备的mDNS服务,以供终端设备查询。The mDNS service of the smart device is multicasted for terminal devices to query.
  10. 根据权利要求9所述的电子装置,其中所述根据所述设备信息确定所述智能设备的mDNS服务,包括:The electronic device according to claim 9, wherein determining the mDNS service of the smart device according to the device information comprises:
    在mDNS服务列表中查询所述设备信息;Query the device information in the mDNS service list;
    若所述mDNS服务列表中存在所述设备信息,则在接收到终端设备发送的查询指令的情况下,调取所述智能设备的mDNS服务;If the device information exists in the mDNS service list, upon receiving a query instruction sent by the terminal device, the mDNS service of the smart device is called;
    若所述mDNS服务列表中不存在所述设备信息,则根据所述设备信息注册mDNS服务。If the device information does not exist in the mDNS service list, register the mDNS service according to the device information.
  11. 根据权利要求10所述的电子装置,其中所述在mDNS服务列表中查询所述设备信息,包括:The electronic device according to claim 10, wherein querying the device information in the mDNS service list comprises:
    以所述设备信息中的MAC地址作为标识信息,确定所述智能设备的服务名,并在所述mDNS服务列表中查询所述智能设备的服务名。The MAC address in the device information is used as identification information to determine the service name of the smart device, and the service name of the smart device is queried in the mDNS service list.
  12. 根据权利要求10所述的电子装置,其中所述根据所述设备信息注册mDNS服务包括:The electronic device according to claim 10, wherein registering the mDNS service according to the device information comprises:
    根据所述设备信息注册mDNS服务名;Register the mDNS service name according to the device information;
    将所述设备信息保存为与所述mDNS服务名相关联的服务参数。The device information is saved as a service parameter associated with the mDNS service name.
  13. 根据权利要求12所述的电子装置,其中所述将所述设备信息保存为与所述mDNS服务名相关联的服务参数,包括:The electronic device according to claim 12, wherein the step of saving the device information as a service parameter associated with the mDNS service name comprises:
    以键值对的形式记录所述设备信息,作为所述智能设备的服务参数。The device information is recorded in the form of a key-value pair as a service parameter of the smart device.
  14. 根据权利要求12所述的电子装置,其中所述根据所述设备信息注册mDNS服务名之后,还包括:The electronic device according to claim 12, wherein after registering the mDNS service name according to the device information, the electronic device further comprises:
    将所述mDNS服务名增加至mDNS服务列表。Add the mDNS service name to the mDNS service list.
  15. 根据权利要求9至14任一项所述的电子装置,其中所述方法还包括:The electronic device according to any one of claims 9 to 14, wherein the method further comprises:
    获得mDNS服务列表中各个智能设备的上线状态;Get the online status of each smart device in the mDNS service list;
    在智能设备离线的情况下,从所述mDNS服务列表中删除离线的智能设备。 When the smart device is offline, the offline smart device is deleted from the mDNS service list.
  16. 一种转换设备,包括:A conversion device, comprising:
    转换设备本体;和,a conversion device body; and,
    如权利要求9至15任一所述的电子装置,被安装于所述转换设备本体。The electronic device according to any one of claims 9 to 15, mounted on the conversion device body.
  17. 一种计算机程序,当所述计算机程序被计算机执行时,使所述计算机实现如权利要求1至7任一项所述的方法。A computer program, when executed by a computer, causes the computer to implement the method according to any one of claims 1 to 7.
  18. 一种计算机程序产品,所述计算机程序产品包括存储在计算机可读存储介质上的计算机指令,当所述程序指令被计算机执行时,使所述计算机实现如权利要求1至7任一项所述的方法。 A computer program product, comprising computer instructions stored on a computer-readable storage medium, and when the program instructions are executed by a computer, the computer is enabled to implement the method according to any one of claims 1 to 7.
PCT/CN2023/085939 2022-11-30 2023-04-03 Method for searching for smart device, and electronic apparatus and conversion device WO2024113583A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202211529938.3A CN115987939A (en) 2022-11-30 2022-11-30 Method for searching intelligent equipment, electronic device and conversion equipment
CN202211529938.3 2022-11-30

Publications (1)

Publication Number Publication Date
WO2024113583A1 true WO2024113583A1 (en) 2024-06-06

Family

ID=85974822

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/085939 WO2024113583A1 (en) 2022-11-30 2023-04-03 Method for searching for smart device, and electronic apparatus and conversion device

Country Status (2)

Country Link
CN (1) CN115987939A (en)
WO (1) WO2024113583A1 (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103533432A (en) * 2013-04-19 2014-01-22 Tcl集团股份有限公司 Method and system for starting television application
US20160065830A1 (en) * 2014-09-03 2016-03-03 Canon Kabushiki Kaisha Communication apparatus capable of communicating with external apparatus, control method for communication apparatus, and storage medium
CN105847019A (en) * 2016-04-18 2016-08-10 海尔优家智能科技(北京)有限公司 Intelligent equipment control method, control node and intelligent equipment
CN110351300A (en) * 2019-07-25 2019-10-18 深圳康佳电子科技有限公司 SAMBA equipment access processing method, main equipment, system and storage medium
CN112596406A (en) * 2020-12-18 2021-04-02 深圳市欧瑞博科技股份有限公司 Control method and device of intelligent equipment, control panel and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103533432A (en) * 2013-04-19 2014-01-22 Tcl集团股份有限公司 Method and system for starting television application
US20160065830A1 (en) * 2014-09-03 2016-03-03 Canon Kabushiki Kaisha Communication apparatus capable of communicating with external apparatus, control method for communication apparatus, and storage medium
CN105847019A (en) * 2016-04-18 2016-08-10 海尔优家智能科技(北京)有限公司 Intelligent equipment control method, control node and intelligent equipment
CN110351300A (en) * 2019-07-25 2019-10-18 深圳康佳电子科技有限公司 SAMBA equipment access processing method, main equipment, system and storage medium
CN112596406A (en) * 2020-12-18 2021-04-02 深圳市欧瑞博科技股份有限公司 Control method and device of intelligent equipment, control panel and storage medium

Also Published As

Publication number Publication date
CN115987939A (en) 2023-04-18

Similar Documents

Publication Publication Date Title
CN107508795B (en) Cross-container cluster access processing device and method
US8767737B2 (en) Data center network system and packet forwarding method thereof
TWI712295B (en) Method, device and system for binding user terminal and equipment
CN111405042B (en) Electronic device discovery method and device, storage medium and electronic device
US20070286209A1 (en) System and method for handling address resolution protocol requests
US9015344B2 (en) Method, apparatus and system for managing private network remotely using session initiation protocol
WO2019153722A1 (en) Terminal communication method and device, terminal and storage medium
CN103109517A (en) Double-stack terminal accessing service method, terminal and system
CN101772920A (en) Method and apparatus for discovering universal plug and play device using resource information
EP2974159B1 (en) Method, device and system for voice communication
CN108924043A (en) System monitoring method, gateway communication, gateway apparatus, service processing equipment
CN112311907A (en) ARP request response method, load balancing equipment and related device
WO2020177020A1 (en) Internet of things device discovery method, apparatus, and terminal device
CN112187486B (en) Interaction method between intelligent devices and intelligent device
WO2014015743A1 (en) Method for downloading application program, user equipment and application server
WO2024113583A1 (en) Method for searching for smart device, and electronic apparatus and conversion device
CN113098776B (en) Method, device, equipment and storage medium for determining network topology
US11177977B2 (en) Method and system for GRE tunnel control based on client activity detection
JP2000293272A (en) Unit and method for power supply control over common equipment
CN112511440B (en) Message forwarding method, system, storage medium and electronic equipment
US8335795B2 (en) Data storing system and data processing method of informational household appliance
WO2021196963A1 (en) Information synchronization method, terminal, and information synchronization system
CN101459620B (en) Method and device for multicast data forwarding
CN110661895A (en) Network address mapping method and network address mapping equipment of server
CN105634789A (en) Method of collector for associating device and log collection system