Equipment discovery method and device, equipment and storage medium
By sending detection signals of multiple wireless connection protocols in the device discovery method and generating a device list containing multiple protocol information, the problem of inefficient device discovery caused by a single protocol is solved, and more efficient device discovery and connection establishment is achieved.
Patent Information
- Application Number
- CN202311129552.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-01
- Publication Date
- 2025-03-04
- Estimated Expiration
- 2043-09-01
AI Technical Summary
In the prior art, device discovery methods are based only on a single wireless connection protocol, resulting in slow and inefficient device discovery processes.
The first device sends detection signals corresponding to at least two wireless connection protocols, receives response information of other devices, and generates a list of connectable devices based on the attribute information, including identification information of the connectable devices discovered based on multiple protocols.
Improves the efficiency of equipment discovery, improves the success rate of discovering other equipment and the reliability of connection establishment.
Smart Images

Figure CN119562242A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a device discovery method, apparatus, device and storage medium. Background Art
[0002] With the vigorous development of industrial Internet and Internet of Things, communication sharing of multiple devices has been widely used in industrial automation, smart medical care, intelligent transportation and other fields. In order to realize communication sharing of multiple devices, device discovery is very critical.
[0003] When studying the device discovery method, in the device retrieval stage, a detection signal of a certain wireless connection protocol is sent to detect whether the wireless connection protocol of other devices is reachable. For example, the first device determines whether the BT function of other devices is reachable by sending a detection signal of the BT (Bluetooth) protocol. After receiving the detection signal, other devices supporting the BT protocol will send a response message to the first device to respond to the BT detection signal. The above-mentioned first device can be any device that supports the BT protocol.
[0004] The device discovery method provided by the above-mentioned related technologies only performs device discovery based on one wireless connection protocol, which will make the entire device discovery process slow and inefficient. Summary of the invention
[0005] The embodiments of the present application provide a method, apparatus, device and storage medium for device discovery. The technical solutions provided by the embodiments of the present application are as follows:
[0006] According to one aspect of an embodiment of the present application, a device discovery method is provided, the method being performed by a first device, the first device supporting at least two wireless connection protocols; the method comprising:
[0007] Sending detection signals corresponding to the at least two wireless connection protocols respectively;
[0008] Receiving response information sent by other devices in the current network environment, wherein the response information is sent by the other devices after receiving a detection signal corresponding to any one of the wireless connection protocols, and the response information includes attribute information of the other devices;
[0009] A connectable device list under the current network environment is generated according to the attribute information of the other devices included in the received response information, wherein the connectable device list includes identification information of the connectable devices discovered based on the at least two wireless connection protocols.
[0010] According to one aspect of an embodiment of the present application, a device discovery apparatus is provided, the apparatus being arranged in a first device, the first device supporting at least two wireless connection protocols; the apparatus comprising:
[0011] A sending module, used for sending detection signals corresponding to the at least two wireless connection protocols respectively;
[0012] A receiving module, used to receive response information sent by other devices in the current network environment, wherein the response information is sent by the other devices after receiving a detection signal corresponding to any one of the wireless connection protocols, and the response information includes attribute information of the other devices;
[0013] A generation module generates a list of connectable devices in the current network environment according to the attribute information of the other devices included in the received response information, wherein the list of connectable devices includes identification information of the connectable devices discovered based on the at least two wireless connection protocols.
[0014] According to one aspect of an embodiment of the present application, an electronic device is provided, the electronic device comprising a processor and a memory, the memory storing a computer program, the computer program being loaded and executed by the processor to implement the above-mentioned device discovery method.
[0015] According to one aspect of an embodiment of the present application, a computer-readable storage medium is provided, in which a computer program is stored. The computer program is loaded and executed by a processor to implement the above-mentioned device discovery method.
[0016] According to one aspect of an embodiment of the present application, a computer program product is provided, which includes a computer program stored in a computer-readable storage medium, and a processor reads and executes the computer program from the computer-readable storage medium to implement the above-mentioned device discovery method.
[0017] The technical solution provided by the embodiments of the present application includes at least the following beneficial effects:
[0018] By sending detection signals corresponding to at least two wireless connection protocols respectively through the first device, after receiving the detection signal of any of the above wireless connection protocols, other devices can send response information to the first device if they support the wireless connection protocol, which solves the problem of low efficiency caused by device discovery based on only a single wireless connection protocol. Since device discovery can be performed based on multiple protocols at the same time, the efficiency of discovering other devices is improved. In addition, the list of connectable devices includes identification information of connectable devices discovered based on multiple protocols, and users can select any connectable device from them to establish a connection with the first device, which improves the success rate and reliability of connection establishment. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0020] Figure 1 It is a schematic diagram of an implementation environment of a solution provided by an embodiment of the present application;
[0021] Figure 2 is a flow chart of a device discovery method provided by an embodiment of the present application;
[0022] Figure 3 is a flow chart of sending a detection signal provided by an embodiment of the present application;
[0023] Figure 4 is a schematic diagram of a device discovery and connection module provided by an embodiment of the present application;
[0024] Figure 5 is a schematic diagram of a user interface of attribute parameters provided by an embodiment of the present application;
[0025] Figure 6 is a schematic diagram of angle calculation provided by an embodiment of the present application;
[0026] Figure 7 is a schematic diagram of the orientation of a sensor provided by an embodiment of the present application;
[0027] Figure 8 is a schematic diagram of calculating a connection score provided by an embodiment of the present application;
[0028] Fig. 9 is a schematic diagram of an automatic connection module provided by an embodiment of the present application;
[0029] Fig.10 is a block diagram of a device discovery apparatus provided by an embodiment of the present application;
[0030] Fig.11 It is a structural block diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0031] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.
[0032] Please refer to Figure 1, which shows a schematic diagram of a solution implementation environment provided by an embodiment of the present application, and the solution implementation environment may include: a first device 10 and at least one other device 20.
[0033] In the embodiment of the present application, the first device 10 may be any device, which is used to discover other devices 20. During the device discovery process, the first device 10 sends a detection signal corresponding to the wireless connection protocol; after receiving the detection signal corresponding to the wireless connection protocol, the other device 20 sends a response message to the first device 10 that sent the detection signal.
[0034] In the embodiment of the present application, the first device 10 supports at least two wireless connection protocols. During the device discovery process, the first device 10 will send detection signals corresponding to the at least two wireless connection protocols for device discovery. After receiving the detection signal corresponding to any one of the wireless connection protocols sent by the first device 10, the other devices 20 in the current network environment can send response information corresponding to the wireless connection protocol to the first device 10 to indicate that the other devices 20 can establish a connection with the first device 10 based on the wireless connection protocol. The above-mentioned current network environment can be understood as the network environment in which the first device 10 is currently located.
[0035] The above-mentioned first device 10 and other devices 20 can be electronic devices such as mobile phones, tablet computers, PCs (Personal Computers), vehicle-mounted terminals, smart home appliances, smart home devices, wearable devices, multimedia playback devices, etc.
[0036] In a possible application scenario, such as a smart home scenario, the first device 10 may be a mobile phone, and other devices 20 may include smart door locks, smart smoke alarms, smart curtains, smart lights, air conditioners, sweeping robots, smart TVs, etc.
[0037] In another possible application scenario, such as a smart campus scenario, the first device 10 may be the school's network center server, and other devices 20 may include students' mobile phones, tablets, electronic textbooks, teachers' laptops, smart podiums, and smart air conditioners, security cameras, electronic access control, etc. connected to the campus network.
[0038] Please refer to Figure 2 , which shows a flow chart of a device discovery method provided by an embodiment of the present application. The execution subject of each step of the method may be the first device 10. The method may include at least one of the following steps 210 to 230.
[0039] Step 210: Send detection signals corresponding to at least two wireless connection protocols.
[0040] The first device supports at least two wireless connection protocols. A wireless connection protocol refers to a series of rules, standards or procedures for communication and connection between wireless devices. Exemplarily, the wireless connection protocol includes, but is not limited to, at least one of the following: BT, BLE (Bluetooth Low Energy), WLAN (Wireless Local Area Network) direct connection, Wi-Fi (Wireless Fidelity), ZigBee, Z-Wave, NFC (Near Field Communication), Thread, DECT (Digitally Enhanced Cordless Telecommunications), NB-IoT (Narrow Band Internet of Things), etc. Optionally, the first device supports at least two or more wireless connection protocols, and the present application does not limit the types of wireless connection protocols supported by the first device. Exemplarily, the first device supports three wireless connection protocols: BT, BLE and WLAN direct connection.
[0041] For each wireless connection protocol, the detection signal corresponding to the wireless connection protocol refers to a specific signal constructed according to the protocol standard, which is used to detect whether there is a device supporting the protocol in the network environment. Different wireless connection protocols have different detection signals, such as differences in signal format, content contained in the signal, etc.
[0042] In some embodiments, before sending a detection signal corresponding to a supported wireless connection protocol, the first device also needs to collect its own connection information about the wireless connection protocol, which may include: address information, name information, working parameters, etc., wherein the address information may include a MAC (Media Access Control) address, an IP (Internet Protocol) address, etc., for constructing a detection signal; the name information may include the name of the first device, for other devices to understand the first device; the working parameters may include the version, frequency band, channel, rate, security encryption and other parameter information supported by the wireless connection protocol, which is used to match version requirements, etc. This application does not limit the content of the connection information of the wireless connection protocol collected by the first device.
[0043] In some embodiments, before sending the detection signal, the first device sequentially detects the support status of multiple wireless connection protocols respectively, and sends the detection signal corresponding to the supported wireless connection protocol.
[0044] Before sending the detection signal, the first device first detects the availability of various wireless connection protocols supported by itself one by one, and then sends the detection signal corresponding to the supported wireless connection protocol. The purpose of detecting the availability of multiple wireless connection protocols in sequence is to avoid the channel interference problem caused by the first device sending detection signals corresponding to multiple wireless connection protocols at the same time if the first device supports multiple wireless connection protocols. The detection signal sent may include the above-mentioned collected connection information.
[0045] Please refer to Figure 3 , which shows a flowchart of sending a detection signal provided by an embodiment of the present application. Assuming that the first device is judged whether it supports the three wireless connection protocols of BT, BLE and WLAN direct connection, first judge whether the first device supports the WLAN direct connection protocol. Regardless of whether it supports it, it will enter the BLE protocol judgment. On the other hand, if it supports the WLAN direct connection protocol, it will start to collect the connection information of its own WLAN direct connection protocol, and after the collection is completed, it will send the detection signal corresponding to the WLAN direct connection protocol to the outside, and wait for the response information corresponding to the WLAN direct connection protocol of other devices; then judge whether the BLE protocol is supported. Regardless of whether it supports it, it will enter the BT judgment. If it supports the BLE protocol, it will start to collect the connection information of its own BLE protocol, and after the collection is completed, it will send the detection signal corresponding to the BLE protocol to the outside, and wait for the response information corresponding to the BLE protocol of other devices; finally, judge whether the first device supports the BT protocol. If it does not support it, it will end. If it supports it, it will start to collect the connection information of its own BT protocol, and after the collection is completed, it will send the detection signal corresponding to the BT protocol to the outside, and wait for the response information corresponding to the BT protocol of other devices.
[0046] Through the above method, all wireless connection capabilities of the first device are detected in sequence, and then the detection signal corresponding to the supported wireless connection protocol is sent. This method can avoid unnecessary channel interference, optimize the connection process, ensure high-quality and efficient establishment of wireless connections, and bring a smoother experience to users.
[0047] Step 220, receiving response information sent by other devices in the current network environment. The response information is sent by other devices after receiving a detection signal corresponding to any wireless connection protocol. The response information includes attribute information of other devices.
[0048] The current network environment refers to the network environment in which the first device is currently located. The response information is a piece of data that other devices that receive the detection signal actively send back to the first device, which is used to respond to the detection signal of the first device. The response information contains various attribute information of the device, such as device name information, location information, recent connection information, MAC address, etc., to inform the information of this device. In order to obtain the attribute information contained in the response information, the response information needs to be parsed. Specifically, by parsing the header and payload of the data packet, the device name, model, MAC address, device location, recent connection time and other attribute information are gradually extracted according to the format specification of the wireless connection protocol.
[0049] In some embodiments, the first device can also determine the type of wireless connection protocol specifically supported by other devices. Specifically, after the first device sends detection signals corresponding to different wireless connection protocols, if the other devices support the corresponding wireless connection protocols, they will respond to the detection signals in the format of the corresponding wireless connection protocol. Since the response information of different wireless connection protocols has different unique physical characteristics such as frequency and modulation mode, the first device can identify which protocol the response information belongs to by detecting these physical characteristics. The first device can also analyze the data content of the response information. The identifiers and message formats of different protocols are different. This difference can be used to identify the type of wireless connection protocol specifically supported by other devices.
[0050] In one possible implementation, the attribute information included in the response information is customizable, and the first device sends a detection signal corresponding to the wireless connection protocol. The detection signal may include a specific indication field for indicating which attribute information needs to be transmitted back by other devices. In other words, the detection signal indicates which attribute information needs to be obtained, and other devices can transmit the corresponding attribute information accordingly. This can avoid the transmission of useless additional information and improve detection efficiency. Exemplarily, the detection signal can indicate that only basic information such as the device model and brand needs to be transmitted back, or it can indicate that more attribute information is needed, such as hardware version, software version, etc. The detection signal can also require the transmission of all possible device attribute information, which is not limited in this application.
[0051] Step 230: Generate a connectable device list in the current network environment according to the attribute information of other devices included in the received response information, wherein the connectable device list includes identification information of connectable devices discovered based on at least two wireless connection protocols.
[0052] The identification information is used to indicate the display information of the connectable device in the connectable device list. Through the identification information, the first device can display the connectable device list in the current network environment in a reasonable form on the interface. Optionally, the identification information may include all or part of the attribute information received from the response information. For example, it may include the type of device, such as a smart phone, smart speaker, etc., and may also include the wireless connection protocol supported by the device, such as WIFI, BT. This application does not limit the content form of the identification information.
[0053] In some embodiments, the connectable devices are displayed in a list by classifying and sorting the attribute information of the devices. The connectable device list may include a primary list and a primary list sub-list, the primary list includes wireless connection protocols supported by the connectable devices, and the primary list sub-list includes connectable devices supporting the same wireless connection protocol.
[0054] In one possible implementation, a list of connectable devices is generated based on the device name information and supported protocol information according to the signal strength. For example, the following devices are found through WLAN direct connection and BT detection: mobile phone A, protocol: WLAN direct connection / BT; speaker B, protocol: WLAN direct connection / BT; TV C, protocol: WLAN direct connection; headset D, protocol: BT, where under the WLAN direct connection protocol, the order of signal strength is: mobile phone A>speaker B>TV C; under the BT protocol, mobile phone A>speaker B>headphone D.
[0055] According to the above information, the list of connectable devices can be displayed as follows: WLAN direct connection devices: mobile phone A, speaker B, TV C; BT devices: mobile phone A, speaker B, headset D.
[0056] In some embodiments, the connectable device list may also include a primary list and a primary list sub-list, wherein the primary list includes different connectable devices, and the primary list sub-list includes all wireless connection protocols supported by the same type of connectable devices.
[0057] In a possible implementation, a list of connectable devices is generated based on the device name information and supported protocol information according to the response time. For example, the following devices are found through WLAN direct connection and BT detection: mobile phone A, protocol: WLAN direct connection / BT; speaker B, protocol: WLAN direct connection / BT; TV C, protocol: WLAN direct connection; headset D, protocol: BT. Among them, mobile phone A, response time: WLAN direct connection protocol < BT protocol; speaker B, response time: WLAN direct connection protocol < BT protocol; TV C, WLAN direct connection protocol; headset D: BT protocol.
[0058] Based on the above information, the list of connectable devices can be displayed as follows: mobile phone A: WLAN direct connection protocol, BT protocol; speaker B: WLAN direct connection protocol, BT protocol; TV C: WLAN direct connection protocol; headset D: BT protocol. Users can trigger the connection command according to their needs. Because a device may support more than one wireless connection protocol, users can choose one of the wireless connection protocols to connect according to actual needs. For example, for mobile phone A, users can choose to connect using the WLAN direct connection protocol or the BT protocol.
[0059] Please refer to Figure 4 , which shows a schematic diagram of a device discovery and connection module provided by an embodiment of the present application. In some embodiments, the device can be divided into a device detection module, a response processing module, an interaction processing module, a display module and a connection establishment module.
[0060] The main function of the device detection module can be, if the current device is the detection signal sending end (such as the first device), it is mainly responsible for sending the detection signal corresponding to the wireless connection protocol to other devices and receiving the response information corresponding to the detection signal sent by other devices; if the current device is the detection signal receiving end (such as other devices), it is mainly responsible for collecting its own connection information and responding to the response information corresponding to the wireless connection protocol detection signal. Figure 4 The current device here refers to the first device.
[0061] The response processing module is used to generate a connectable device list according to the response information received by the first device and the generation method of the connectable device list set by the first device, and then send the connectable device list to the display module. Exemplarily, after the device detection module of the first device receives the response information of other devices, it passes the response information to the response processing module, and the response processing module processes the response information. This processing process can be the above-mentioned process of parsing the response information. The connectable device list is then generated as described above, and finally the connectable device list is sent to the display module.
[0062] The display module is used to receive the connectable device list sent by the response processing module and provide a display window for interacting with the user, wherein the display content may include the connectable device list received above and may respond to the connection instruction triggered by the user.
[0063] The connection establishment module is used to send a connection request to the target device according to the user's connection instruction, establish a connection, and synchronize the current device connection status to the display module in real time.
[0064] In summary, the technical solution provided by the embodiment of the present application is that the first device sends detection signals corresponding to at least two wireless connection protocols respectively. After receiving the detection signal of any of the above wireless connection protocols, other devices can send response information to the first device if they support the wireless connection protocol, which solves the problem of low efficiency caused by device discovery based on only a single wireless connection protocol. Since device discovery can be performed based on multiple protocols at the same time, the efficiency of discovering other devices is improved. In addition, the list of connectable devices includes identification information of connectable devices discovered based on multiple protocols, and the user can select any connectable device from them to establish a connection with the first device, which improves the success rate and reliability of connection establishment.
[0065] In order to speed up the detection of high-priority key devices and optimize the speed of connecting important devices, the support status of multiple wireless connection protocols can be detected in order from high to low according to the priorities of the multiple wireless connection protocols. Optionally, the priority setting method can be set by the user, by the first device, or by the user and the first device.
[0066] If it is set by the user, the user can set a priority list of each wireless connection protocol in the setting menu of the first device to specify the priority of each wireless connection protocol, such as setting Wi-Fi as the highest priority, followed by BT, ZigBee, etc., and then the first device will detect the support status of each wireless connection protocol in this priority order.
[0067] If it is set by the first device, the priority can be automatically calculated by the first device. For example, the first device can determine the user's usage habits based on historical connection records, automatically calculate the priority, and then the first device can determine the support status of each wireless connection protocol in order of priority. For example, the first device can automatically set the priority of the protocol based on its transmission speed, stability, security and other attributes, which is not limited in this application.
[0068] If the setting is made by the user and the first device, the first device can preset the priority order for different demand modes in advance, and the user selects the current demand mode to execute the corresponding priority order. Exemplarily, the first device presets the priority order for different demand modes in advance, which can be considered based on the use scenario requirements, use frequency, power consumption, etc.
[0069] Optionally, according to the requirements of the usage scenario, set the priority according to the importance of the wireless connection protocol in the application environment, and give priority to sending the protocol that is most critical to the current scenario. Suppose it is necessary to perform device discovery in an environment containing smart home devices, involving three common protocols: Wi-Fi, ZigBee, and BT. It can be considered that for smart homes, the ZigBee protocol is used to connect various sensor devices and is the basis of home automation, with the highest priority. Wi-Fi is mainly used for large data transmission such as video and music of terminal devices, with the second highest priority. BT is mainly used to connect some audio accessories, with the lowest priority. Therefore, in this usage scenario, the priority order of ZigBee>Wi-Fi>BT can be determined.
[0070] Optionally, according to the usage frequency, the higher the usage frequency of the wireless connection protocol, the higher its priority. Suppose the following three protocols are used simultaneously in an environment: Wi-Fi for employee office work and Internet access, BT for connecting audio devices such as headphones and speakers, and ZigBee for connecting health sensors such as fitness trackers and blood pressure monitors. According to statistics, the usage frequency ratios in the past week are as follows: Wi-Fi: 80% of the data traffic, BT: 15% of the data traffic, ZigBee: 5% of the data traffic. It can be clearly seen that the usage frequency of Wi-Fi is much higher than that of the other two protocols. Therefore, the set priority order is: Wi-Fi>BT>ZigBee.
[0071] Optionally, according to the power consumption, for battery-powered devices, to save power to the greatest extent, signals with low power consumption should be sent first. Suppose the following three protocols are used simultaneously in a wireless device: BT: connecting headphones and speakers, with a working current of 10 mA; Wi-Fi: providing network connection, with a working current of 100 mA; NB-IoT: low-power wide-area network, with a working current of 300 mA. According to the working currents of each protocol, the power consumption order can be estimated as: BT<Wi-Fi<NB-IoT. Therefore, the order of sending detection signals can be BT>Wi-Fi>NB-IoT. The priority setting method can also follow other methods, such as according to network conditions, compatibility, security, etc. This application does not make any limitations in this regard.
[0072] In summary, the technical solution provided by the embodiment of this application can detect and set the priority for the support situations corresponding to multiple wireless connection protocols, and can first discover the devices supported by the protocol with higher priority, and achieve rapid discovery and connection for the device types that users are more concerned about.
[0073] Currently, in the stage of generating the connectable device list, the connectable device list is mainly generated based on the signal strength of the wireless connection protocol supported by the connectable device. In order to improve the flexibility of the system, this application proposes a more dimensional consideration standard based on the current single signal strength sorting, so as to obtain multiple presentation methods of the connectable device list.
[0074] Specifically, at least two attribute parameters corresponding to each other device may be determined based on the attribute information of other devices included in the received response information, and then a list of connectable devices may be generated based on the at least two attribute parameters.
[0075] Attribute information usually indicates the overall condition of the device, while attribute parameters are more specific and detailed.
[0076] In some embodiments, the at least two attribute parameters include at least two of the following parameters: a distance parameter, an orientation parameter, a name parameter, and a preference parameter. The distance parameter is used to indicate the distance between the other device and the first device; the orientation parameter is used to indicate the angle between the other device and the first device; the name parameter is used to indicate the name of the other device; the preference parameter is used to indicate the situation where the other device is selected as the connection device. Figure 5 , which shows a schematic diagram of a user interface of attribute parameters provided by an embodiment of the present application. The present application does not limit the design style of the user interface of attribute parameters.
[0077] In one possible implementation, the distance parameter can be obtained from the location information. The location information can obtain the longitude and latitude and altitude of the device according to the GPS (Global Positioning System) or positioning service carried by the device, and then this information can be converted into a spatial coordinate system position. This spatial coordinate system can be a rectangular coordinate system (Cartesian coordinate system): composed of three mutually perpendicular coordinate axes X, Y, and Z, the position of a point can be represented by an ordered array (X, Y, Z). For conversion to a spatial coordinate system using GPS, WGS84 (World Geodetic System 1984) to ENU (East-North-Up) can be used, or WGS8 to ECEF (Earth-Centered Earth-Fixed) can be used, or other methods can be used for conversion. Exemplarily, the longitude and latitude data in WGS8 can be converted to the Cartesian coordinate system in ECEF. The characteristics of ECEF are as follows: the origin is located at the center of mass of the earth, the Z axis points to the pole of the earth, the X axis points to the intersection of the prime meridian and the equatorial plane, and the Y axis is on the equatorial plane, forming a right-handed coordinate system with the X and Z axes. The following is the program implementation code:
[0078]
[0079] After obtaining the spatial coordinate system, the spatial distance is calculated using the distance coordinate formula based on the position coordinates of the spatial coordinate system. Assuming that the spatial coordinates of the first device are (x1, y1, z1), the coordinates of the other devices are (x2, y2, z2), and d represents the distance between the two devices, the calculation formula is:
[0080]
[0081] In one possible implementation, the distance parameter can also be obtained using the signal propagation time method. When the first device sends a detection signal, the sending time is recorded. After receiving the signal, the other device responds immediately. The first device receives the response information and records the receiving time. Since the propagation speed of electromagnetic waves is known (i.e., the speed of light), the signal movement time can be calculated by the time difference between the sending time and the receiving time, and then multiplied by the electromagnetic wave speed to obtain the propagation distance. This application does not limit the method for obtaining the distance parameter.
[0082] Generally, if the first device is a handheld device, when the user wants to connect to other devices, he or she will tend to point the first device toward the other devices to be connected, so it is very necessary to establish the orientation parameter.
[0083] In one possible implementation, the position information can be obtained from the response information analysis, and then the angle parameter can be calculated from the position information. For example, the spatial coordinates of the device can be obtained according to the above steps, without considering the spatial height of the device, and the device coordinates are mapped from the three-dimensional space to the two-dimensional space. Please refer to Figure 6 , which shows a schematic diagram of angle calculation provided by an embodiment of the present application. Specifically, directly discard the z-axis coordinates of the spatial coordinates of the first device and the other devices, that is, project the spatial coordinates of the first device and the other devices onto the xoy plane, take the center of the first device as the origin o, take the top of the device as the y-axis, and the direction perpendicular to the y-axis as the x-axis, and re-establish the coordinate system. The establishment of the coordinate system depends on the calculation method of the device sensor orientation, please refer to Figure 7 , which shows a schematic diagram of the sensor orientation provided by an embodiment of the present application. Taking a mobile phone as an example, when the device is in a natural position, the angle is 0 degrees; when the left side of the device is on top, the angle is 90 degrees; when the device is upside down, the angle is 180 degrees; when the right side of the device is on top, the angle is 270 degrees.
[0084] Then, the angle is calculated according to the relative positions of the first device and the other device, where the angle refers to the angle α between the other device point (x, y) and the positive direction of the first device, i.e., the y axis, and the calculation formula is as follows:
[0085]
[0086] The angle α can be calculated by the arc cosine function. For example, the spatial coordinates of the first device are (2, 3, 4), and the spatial coordinates of the other devices are (5, 6, 7). According to the above steps, the coordinates of the first device are the origin (0, 0), and the coordinates (x, y) of the other devices are (3, 3). According to the calculation formula, α is 45 degrees.
[0087] Since users are more familiar with device names, sorting by name may be more in line with users' usage habits and cognitive patterns. In one possible implementation, users can sort in alphabetical order of the devices, or in other ways, which is not limited in this application.
[0088] In a possible implementation, the preference parameter may be obtained through the most recent connection information. Specifically, the preference parameter may be the time when the device was most recently connected, the frequency of connecting to the device over a period of time, and the like.
[0089] In some embodiments, a list of connectable devices in the current network environment is generated based on the connection scores of each other device. Figure 8 , which shows a schematic diagram of calculating the connection score provided by an embodiment of the present application. In one possible implementation, for each other device, the connection score of the other device is determined according to at least two attribute parameters corresponding to the other device. Specifically, according to at least two attribute parameters corresponding to the other device, the single scores corresponding to the at least two attribute parameters are determined; according to the weights corresponding to the at least two attribute parameters, the single scores corresponding to the at least two attribute parameters are weighted summed to obtain the connection score of the other device.
[0090] For the setting of the weight of each attribute parameter, in one possible implementation, the preference setting information customized by the user is obtained, and the preference setting information is used to indicate the importance of each attribute parameter; the weights corresponding to at least two attribute parameters are determined according to the preference setting information. By way of example, the calculation method of the device connection score is described in detail below. The calculation formula and specific values used for each attribute parameter used below are for reference only, and actual use is adjusted according to needs.
[0091] Weight distribution: Parameters selected by the user have a higher weight of 40%, and parameters not selected have a lower weight of 20%.
[0092] Calculation method of each parameter: The calculation formula of angle parameter is:
[0093]
[0094] Where α is the angle mentioned above, that is, if the other device is located in the positive direction of the device, 100 points are obtained, and if the other device is located in the opposite direction, 0 points are obtained.
[0095] Distance parameter calculation method: Taking 20 meters as the distance limit, the calculation formula is:
[0096]
[0097] Where dis is the spatial distance calculated above, in meters. If the distance is less than or equal to 20 meters, it is calculated according to the above formula. If the distance exceeds 20 meters, all points are 0.
[0098] Name parameter calculation method: Take letter A as the first letter, and the calculation formula is:
[0099]
[0100] Where d is the distance from the first letter of the device name to the letter A, that is, the distance to A is 0 and the distance to Z is 25. In addition, numbers, Chinese and other languages are uniformly converted into English expressions for calculation.
[0101] Preference parameter calculation method: Taking 24 hours as the limit, the calculation formula is:
[0102]
[0103] Where h is the time when the last connection was established. If the time when the last connection was established is less than or equal to 24 hours, the above formula is used for calculation. If the time when the last connection was established is more than 24 hours, 0 points are awarded.
[0104] Score summary: The above scores are weighted to get the final device connection score, taking orientation priority, angle 45 degrees, distance 5 meters, name starting with the letter A, and the last connection time 6 hours as an example:
[0105] Connection score = 75 × 0.4 + 75 × 0.2 + 100 × 0.2 + 75 × 0.2 = 80
[0106] The connection score of each connectable device can be calculated in the same way. After calculation, the scores are sorted from large to small and displayed in the connectable device list.
[0107] In some embodiments, see Figure 4 In addition to generating a connectable device list according to the generation method of the connectable device list set by the first device, the response processing module is also used to generate a connectable device list according to the device list preference set by the user; the interaction processing module is also used to respond to the user's interaction request to set the device list preference; see Figure 5 , the display content of the display module can also include device list preferences.
[0108] In some embodiments, in the device connection scenario, the user is currently generally required to manually select the target device to establish a connection in order to improve the efficiency of the connection. Here is a device discovery and automatic connection solution, please refer to Fig. 9 , which shows a schematic diagram of an automatic connection module provided by an embodiment of the present application, and the automatic connection judgment module is used to judge whether the first device can automatically connect to other target devices.
[0109] Based on the connection score described above, the automatic connection threshold can be set in advance by the user, or by the first device, and this application does not limit this. If there is a target other device with a connection score greater than the threshold, a connection is automatically established with the target other device. If the set threshold is high and there is currently no target other device that meets the conditions, a list of connectable devices is output, and the user manually selects the other device to connect.
[0110] In some embodiments, see Fig. 9 The response processing module is also used to calculate the connection score of each connectable device; the interaction processing module is also used to respond to the user's request for automatic connection threshold setting and pass the threshold to the automatic connection judgment module.
[0111] In summary, the technical solution provided by the embodiment of the present application proposes a variety of preference setting methods in the presentation of the list of connectable devices, and users can choose according to their needs, which is more in line with the usage preferences of different users. Finally, a device discovery and automatic connection solution is proposed, and users can set the automatic connection threshold. When the conditions are met, the connection is automatically completed without the need for users to manually connect, which is more intelligent and convenient.
[0112] This solution comprehensively considers aspects such as the performance, customization and intelligence of device discovery and connection. By sending detection signals corresponding to multiple wireless connection protocols, priority control, customizable presentation of connectable device lists and automatic connection, it can greatly optimize the user experience and provide a more personalized and intelligent device interconnection solution.
[0113] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.
[0114] Please refer to Fig.10 , which shows a block diagram of a device discovery device provided by an embodiment of the present application. The device has the function of realizing the above-mentioned device discovery, and the function can be realized by hardware, or by hardware executing corresponding software. The device is set in a first device, and the first device supports at least two wireless connection protocols. The device 1000 may include: a sending module 1010, a receiving module 1020 and a generating module 1030.
[0115] The sending module 1010 is configured to send detection signals corresponding to the at least two wireless connection protocols respectively.
[0116] The receiving module 1020 is used to receive response information sent by other devices in the current network environment. The response information is sent by the other devices after receiving a detection signal corresponding to any one of the wireless connection protocols. The response information includes attribute information of the other devices.
[0117] The generation module 1030 is used to generate a list of connectable devices in the current network environment according to the attribute information of the other devices included in the received response information, wherein the list of connectable devices includes identification information of the connectable devices discovered based on the at least two wireless connection protocols.
[0118] In some embodiments, the sending module 1010 includes: a detection unit and a sending unit ( Fig.10 not shown).
[0119] The detection unit is used to detect the support status of multiple wireless connection protocols in sequence.
[0120] The sending unit is used to send a detection signal corresponding to the supported wireless connection protocol.
[0121] In some embodiments, the detection unit is used to detect the support status of the multiple wireless connection protocols in sequence according to the priorities of the multiple wireless connection protocols in descending order of the priorities.
[0122] In some embodiments, the generating module 1030 includes: a parameter determining unit, a score determining unit and a generating unit ( Fig.10 not shown).
[0123] A parameter determination unit is used to determine at least two attribute parameters corresponding to each of the other devices according to the attribute information of the other devices included in the received response information.
[0124] The score determination unit is used to determine, for each of the other devices, a connection score of the other device according to at least two attribute parameters corresponding to the other device.
[0125] A generating unit is used to generate a list of connectable devices in the current network environment according to the connection scores of each of the other devices.
[0126] In some embodiments, the score determination unit is used to:
[0127] Determine, according to the at least two attribute parameters corresponding to the other devices, the single scores corresponding to the at least two attribute parameters respectively;
[0128] According to the weights respectively corresponding to the at least two attribute parameters, weighted sum is performed on the single scores respectively corresponding to the at least two attribute parameters to obtain the connection score of the other device.
[0129] In some embodiments, the score determination unit is further configured to:
[0130] Acquire preference setting information customized by the user, wherein the preference setting information is used to indicate the importance of each of the attribute parameters;
[0131] The weights corresponding to the at least two attribute parameters are determined according to the preference setting information.
[0132] In some embodiments, the at least two attribute parameters include at least two of the following parameters:
[0133] an orientation parameter, used to indicate an angle between the other device and the first device;
[0134] a distance parameter, used to indicate the distance between the other device and the first device;
[0135] A name parameter, used to indicate the name of the other device;
[0136] The preference parameter is used to indicate a situation in which the other device is selected as the connection device.
[0137] In some embodiments, the device 1000 further includes a connection module ( Fig.10 ), which is used to automatically establish a connection with the target other device if there is a target other device whose connection score is greater than a threshold.
[0138] It should be noted that the device provided in the above embodiment, when implementing its functions, is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the device and method embodiments provided in the above embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.
[0139] Please refer to Fig.11 , which shows a structural block diagram of an electronic device 1100 provided in one embodiment of the present application.
[0140] Typically, the electronic device 1100 includes a processor 1101 and a memory 1102 .
[0141] The processor 1101 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and the like. The processor 1101 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field Programmable Gate Array), and PLA (Programmable Logic Array). The processor 1101 may also include a main processor and a coprocessor. The main processor is a processor for processing data in an awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 1101 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 1101 may also include an AI processor for processing computing operations related to machine learning.
[0142] The memory 1102 may include one or more computer-readable storage media, which may be non-transitory. The memory 1102 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 1102 is used to store a computer program, which is configured to be executed by one or more processors to implement the above-mentioned device discovery method.
[0143] Those skilled in the art will understand that Fig.11 The structure shown in the figure does not constitute a limitation on the electronic device 1100, and may include more or less components than those shown in the figure, or combine certain components, or adopt a different component arrangement.
[0144] In some embodiments, a computer-readable storage medium is further provided, wherein a computer program is stored in the storage medium, and the computer program is loaded and executed by a processor to implement the above-mentioned device discovery method.
[0145] Optionally, the computer readable storage medium may include: ROM (Read-Only Memory), RAM (Random-Access Memory), SSD (Solid State Drives) or optical disks, etc. Among them, the random access memory may include ReRAM (Resistance Random Access Memory) and DRAM (Dynamic Random Access Memory).
[0146] In some embodiments, a computer program product is also provided, the computer program product comprising a computer program, the computer program is stored in a computer-readable storage medium, and a processor reads and executes the computer program from the computer-readable storage medium to implement the above-mentioned device discovery method.
[0147] It should be understood that the "multiple" mentioned in this article refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. In addition, the step numbers described in this article only illustrate a possible execution sequence between the steps. In some other embodiments, the above steps may not be executed in the order of the numbers, such as two steps with different numbers are executed at the same time, or two steps with different numbers are executed in the opposite order to the diagram. The embodiments of the present application are not limited to this.
[0148] The above description is only an exemplary embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. A device discovery method, characterized in that: The method is performed by a first device, wherein the first device supports at least two wireless connection protocols; the method includes: Sending detection signals corresponding to the at least two wireless connection protocols respectively; Receiving response information sent by other devices in the current network environment, wherein the response information is sent by the other devices after receiving a detection signal corresponding to any one of the wireless connection protocols, and the response information includes attribute information of the other devices; A connectable device list under the current network environment is generated according to the attribute information of the other devices included in the received response information, wherein the connectable device list includes identification information of the connectable devices discovered based on the at least two wireless connection protocols.
2. The method according to claim 1, characterized in that The sending of detection signals corresponding to the at least two wireless connection protocols respectively includes: Detect the support status of multiple wireless connection protocols in sequence; Sends a detection signal corresponding to the supported wireless connection protocol.
3. The method according to claim 2, characterized in that The detecting the support status of the multiple wireless connection protocols in sequence respectively includes: According to the priorities of the multiple wireless connection protocols, the support conditions corresponding to the multiple wireless connection protocols are detected in sequence from high to low priority.
4. The method according to claim 1, characterized in that: The generating, according to the attribute information of the other devices included in the received response information, a list of connectable devices in the current network environment includes: Determine at least two attribute parameters corresponding to each of the other devices according to the attribute information of the other devices included in the received response information; For each of the other devices, determining a connection score of the other device according to at least two attribute parameters corresponding to the other device; A list of connectable devices in the current network environment is generated according to the connection scores of the other devices.
5. The method according to claim 4, characterized in that The determining the connection score of the other device according to the at least two attribute parameters corresponding to the other device includes: Determine, according to the at least two attribute parameters corresponding to the other devices, the single scores corresponding to the at least two attribute parameters respectively; According to the weights respectively corresponding to the at least two attribute parameters, weighted sum is performed on the single scores respectively corresponding to the at least two attribute parameters to obtain the connection score of the other device.
6. The method according to claim 5, characterized in that The method further comprises: Acquire preference setting information customized by the user, wherein the preference setting information is used to indicate the importance of each of the attribute parameters; The weights corresponding to the at least two attribute parameters are determined according to the preference setting information.
7. The method according to claim 4, characterized in that The at least two attribute parameters include at least two of the following parameters: an orientation parameter, used to indicate an angle between the other device and the first device; a distance parameter, used to indicate the distance between the other device and the first device; A name parameter, used to indicate the name of the other device; The preference parameter is used to indicate a situation in which the other device is selected as the connection device.
8. The method according to claim 4, characterized in that The method further comprises: If there is a target other device whose connection score is greater than the threshold, a connection is automatically established with the target other device.
9. A device discovery apparatus, characterized in that: The apparatus is arranged in a first device, and the first device supports at least two wireless connection protocols; the apparatus comprises: A sending module, used for sending detection signals corresponding to the at least two wireless connection protocols respectively; A receiving module, used to receive response information sent by other devices in the current network environment, wherein the response information is sent by the other devices after receiving a detection signal corresponding to any one of the wireless connection protocols, and the response information includes attribute information of the other devices; A generation module is used to generate a list of connectable devices in the current network environment according to the attribute information of the other devices included in the received response information, wherein the list of connectable devices includes identification information of the connectable devices discovered based on the at least two wireless connection protocols.
10. An electronic device, characterized in that: The electronic device comprises a processor and a memory, wherein a computer program is stored in the memory, and the computer program is loaded and executed by the processor to implement the method according to any one of claims 1 to 8.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which is loaded and executed by a processor to implement the method according to any one of claims 1 to 8.
12. A computer program product, characterized in that The computer program product comprises a computer program, wherein the computer program is stored in a computer-readable storage medium, and a processor reads and executes the computer program from the computer-readable storage medium to implement the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Communication apparatus and method of controlling the same
CN103959827A
Method and device for discovering local area network equipment
CN103986631A
Mobile access terminal with network selection function
CN107040970A
Method for discovering and connecting electronic equipment and electronic equipment
CN115150789A
Method and apparatus for controlling electronic device in wireless communication system supporting bluetooth communication
US20170223579A1