Connection method and device of target equipment, storage medium and electronic device
By receiving and analyzing wireless device signals and using device information to weighted sorting to determine the target device, the problem of cumbersome and inaccurate connection of wireless audio equipment is solved, and fast and accurate device connection and automatic adjustment are achieved, improving user experience.
Patent Information
- Application Number
- CN202410961060.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-17
- Publication Date
- 2024-11-01
AI Technical Summary
The connection method of existing wireless audio devices is complicated and error-prone, and it is impossible to accurately determine the target device that needs to be connected from multiple devices, resulting in inconvenient user experience.
By receiving wireless signals sent by multiple devices, a device list is generated based on device information, and the device history connection number, distance, signal strength and operating status are used to weight sort, determine the target device and connect, and automatically when the device information changes. Adjust the connection.
It realizes fast and accurate connection of wireless audio equipment, reduces user manual operations, improves connection efficiency and stability, and ensures connection reliability.
Smart Images

Figure CN118890713A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a connection method, device, storage medium and electronic device for a target device. Background Art
[0002] With the development and popularization of wireless communication technology, wireless audio devices such as Bluetooth headsets and Bluetooth speakers have become common devices in life. However, with the increase in user devices, the connection problem between wireless audio devices and terminal devices has gradually become prominent. The traditional way of connecting wireless audio devices to terminal devices usually relies on manual operation. When users need to use wireless audio devices, they need to manually search, pair and connect to connect the wireless audio devices to the terminal devices. This connection method is not only cumbersome, but also prone to errors. In the prior art, wireless audio devices are matched based only on a single rule during automatic matching, such as matching based only on signal strength or a preset order, so they may be connected to devices that are not currently operating, causing users to have to manually disconnect the matched device connection and reconnect to the device they want to match, causing great inconvenience to the user experience.
[0003] Therefore, in the related art, there is a problem that a target device to be connected cannot be accurately determined from multiple devices.
[0004] In view of the problem in the related art that a target device to be connected cannot be accurately determined from multiple devices, no effective solution has been proposed yet. Summary of the invention
[0005] The embodiments of the present application provide a method, device, storage medium and electronic device for connecting a target device, so as to at least solve the problem in the related art that a target device to be connected cannot be accurately determined from multiple devices.
[0006] According to one embodiment of the embodiments of the present application, a method for connecting a target device is provided, including: receiving wireless signals sent by multiple devices, determining a first device list based on device information included in the wireless signals, wherein the first device list includes device information of each of the multiple devices; processing the devices in the first device list based on various types of information in the device information to generate a second device list; determining a target device from the second device list, and connecting to the target device.
[0007] In an exemplary embodiment, the devices in the first device list are processed based on various types of information in the device information to generate a second device list, including: for each device in the first device list, obtaining a score value corresponding to each type of information to obtain multiple score values; performing weighted summation on the multiple score values to obtain a weighted sum value of each device; and sorting the devices in the first device list in descending order according to the size of the weighted sum values of the multiple devices to generate the second device list.
[0008] In an exemplary embodiment, the various types of information in the device information include at least: the number of historical device connections, the device distance, and the device signal strength. For each device in the first device list, a score corresponding to each type of information is obtained to obtain multiple scores, including: when it is determined that the number of historical device connections of each device is less than the first connection number, a first preset value is determined as the score value of the historical device connection number; when it is determined that the number of historical device connections is greater than or equal to the first connection number and less than the second connection number, a second preset value is determined as the score value of the historical device connection number; when it is determined that the number of historical device connections is greater than or equal to the second connection number, a third preset value is determined as the score value of the historical device connection number, wherein the second connection number is greater than the first connection number, the third preset value is greater than the second preset value, and the second preset value is greater than the first preset value; when it is determined that the device distance of each device is less than In the case of a first device distance, the third preset value is determined as the score value of the device distance; in the case of determining that the device distance is greater than or equal to the first device distance and less than the second device distance, the second preset value is determined as the score value of the device distance; in the case of determining that the device distance is greater than or equal to the second device distance, the first preset value is determined as the score value of the device distance, wherein the second device distance is greater than the first device distance; in the case of determining that the device signal strength of each device is less than the first strength, the first preset value is determined as the score value of the device signal strength of the device; in the case of determining that the device signal strength is greater than or equal to the first strength and less than the second strength, the second preset value is determined as the score value of the device signal strength; in the case of determining that the device signal strength is greater than or equal to the second strength, the third preset value is determined as the score value of the device signal strength, wherein the second strength is greater than the first strength.
[0009] In an exemplary embodiment, the various types of information in the device information also include: device operating status, for each device in the first device list, obtaining a score corresponding to each type of information to obtain multiple scores, and also including: when it is detected that the device operating status of each device is a sleep state, determining the first preset value as the score value of the device operating status; when it is detected that the device operating status of each device is a working state, determining the third preset value as the score value of the device operating status.
[0010] In an exemplary embodiment, before performing weighted summation on the multiple score values to obtain the weighted sum value of each device, the method also includes: setting the same initial weight value for the score value corresponding to each type of information; and adjusting the weight value of the score value corresponding to each type of information based on the result of the target object's active selection of the connection device.
[0011] In an exemplary embodiment, determining a target device from the second device list and connecting to the target device includes: determining the device ranked first in the second device list as the target device; and in a case where it is determined that the connection to the target device fails, deleting the device ranked first in the second device list and re-determining the target device from the second device list.
[0012] In an exemplary embodiment, after determining a target device from the second device list and connecting to the target device, the method further includes: monitoring device information of each device in the first device list, and when it is determined that the device information has changed, reprocessing the first device list based on the changed device information to generate a third device list; when it is determined that the device ranked first in the third device list is inconsistent with the currently connected device, switching the currently connected device to the device ranked first in the third device list; when it is determined that the device ranked first in the third device list is consistent with the currently connected device, maintaining the current connection state.
[0013] According to another aspect of an embodiment of the present application, a connection device for a target device is also provided, including: a receiving module, used to receive wireless signals sent by multiple devices, and determine a first device list based on the device information included in the wireless signals, wherein the first device list includes the device information of each device in the multiple devices; a processing module, used to process the devices in the first device list based on various types of information in the device information to generate a second device list; and a connection module, used to determine a target device from the second device list and connect to the target device.
[0014] According to another aspect of the embodiments of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the above-mentioned target device connection method when running.
[0015] According to another aspect of an embodiment of the present application, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the target device connection method through the computer program.
[0016] According to another aspect of the embodiments of the present application, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.
[0017] In an embodiment of the present application, a first device list is determined by receiving device information included in wireless signals sent by multiple devices, and the first device list is sorted based on various types of information in the device information to obtain a second device list, and then a target device is determined from the second device list for connection; the above technical solution is adopted to solve the problem of being unable to accurately determine the target device to be connected from multiple devices, thereby achieving the effect of accurately determining the target device to be connected from multiple devices. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] 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.
[0019] 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.
[0020] Figure 1 It is a hardware environment diagram of a target device connection method according to an embodiment of the present application;
[0021] Figure 2 is a flow chart of a method for connecting a target device according to an embodiment of the present application;
[0022] Figure 3 is a schematic flow chart of a method for connecting a target device according to an embodiment of the present application;
[0023] Figure 4 is a schematic diagram of a method for connecting a target device according to an embodiment of the present application;
[0024] Figure 5 It is a structural block diagram of a connection device for a target device according to an embodiment of the present application. DETAILED DESCRIPTION
[0025] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution 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 the present application.
[0026] 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 data used in this way can be interchangeable 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 of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0027] According to one aspect of an embodiment of the present application, a method for connecting a target device is provided. The method for connecting a target device is widely used in smart home, smart home, smart home device ecology, smart residential (Intelligence House) ecology and other whole-house intelligent digital control application scenarios. Optionally, in this embodiment, the method for connecting the target device can be applied to Figure 1 In the hardware environment composed of the terminal device 102 and the server 104 shown in FIG. Figure 1 As shown, the server 104 is connected to the terminal device 102 via a network, and can be used to provide services (such as application services, etc.) for the terminal or a client installed on the terminal. A database can be set on the server or independently of the server to provide data storage services for the server 104. Cloud computing and / or edge computing services can be configured on the server or independently of the server to provide data computing services for the server 104.
[0028] The network may include but is not limited to at least one of the following: wired network, wireless network. The wired network may include but is not limited to at least one of the following: wide area network, metropolitan area network, local area network, and the wireless network may include but is not limited to at least one of the following: WIFI (Wireless Fidelity), Bluetooth. The terminal device 102 may be but is not limited to a PC, a mobile phone, a tablet computer, a smart air conditioner, a smart range hood, a smart refrigerator, a smart oven, a smart stove, a smart washing machine, a smart water heater, a smart washing device, a smart dishwasher, a smart projection device, a smart TV, a smart clothes drying rack, a smart curtain, a smart audio and video, a smart socket, a smart speaker, a smart fresh air device, a smart kitchen and bathroom device, a smart bathroom device, a smart sweeping robot, a smart window cleaning robot, a smart mopping robot, a smart air purification device, a smart steamer, a smart microwave oven, a smart kitchen treasure, a smart purifier, a smart water dispenser, a smart door lock, etc.
[0029] In this embodiment, a target device connection method is provided, which is applied to the above terminal device. Figure 2 : is a flow chart of a method for connecting a target device according to an embodiment of the present application, the flow includes the following steps:
[0030] Step S202, receiving wireless signals sent by multiple devices, and determining a first device list according to device information included in the wireless signals, wherein the first device list includes device information of each of the multiple devices;
[0031] Optionally, in the above step S202, for example, when the user turns on the Bluetooth headset and prepares to use it, the Bluetooth headset will receive wireless signals from multiple nearby devices, such as wireless signals from smart phones, laptops, tablet computers and other devices, and then determine the first device list based on the above devices. At the same time, it will also obtain information about each device from the wireless signal, including but not limited to historical connection records, signal strength, device distance and other information.
[0032] Step S204, processing the devices in the first device list based on various types of information in the device information to generate a second device list;
[0033] It should be noted that in the above step S204, various types of information include but are not limited to historical connection records, signal strength, device distance and other information. The above processing of the devices in the first device list based on various types of information is post-processing after comprehensive evaluation of various types of information, rather than processing based on one type of information. The above processing process includes but is not limited to sorting, screening, filtering and the like.
[0034] Step S206: determine a target device from the second device list, and connect to the target device.
[0035] Through the above steps, the first device list is determined by receiving the device information included in the wireless signals sent by multiple devices, and the first device list is sorted based on various types of information in the device information to obtain the second device list, and then the target device is determined from the second device list for connection, which solves the problem in the related art that the target device to be connected cannot be accurately determined from multiple devices, and then the target device to be connected can be accurately determined from multiple devices.
[0036] In an exemplary embodiment, the above-mentioned step S204 processes the devices in the first device list based on various types of information in the device information to generate a specific execution process of the second device list, including: for each device in the first device list, obtaining a score value corresponding to each type of information to obtain multiple score values; performing weighted summation on the multiple score values to obtain a weighted sum value of each device; and sorting the devices in the first device list in descending order according to the size of the weighted sum values of the multiple devices to generate the second device list.
[0037] Optionally, in the above embodiment, for example, scores are performed based on the historical number of connections between the smartphone and the Bluetooth headset, the device distance, and the device signal strength, and the historical connection number score is 5 points, the device distance score is 3 points, and the signal strength score is 1 point. The above multiple scores are then weighted and summed. Assuming that the weights corresponding to the historical connection number, device distance, and device signal strength are 0.2, 0.3, and 0.5, respectively, the weighted sum of the smartphone is 2.4 points. Other devices in the first device list are also scored according to the above method to obtain a weighted sum. The devices in the first device list are sorted in descending order according to the size of the weighted sum values of the multiple devices to generate a second device list.
[0038] In an exemplary embodiment, the various types of information in the above-mentioned device information at least include: the number of historical device connections, the device distance, and the device signal strength. The above-mentioned process of obtaining the score corresponding to each type of information for each device in the first device list and obtaining multiple scores specifically includes: when it is determined that the number of historical device connections of each device is less than the first connection number, determining a first preset value as the score value of the number of historical device connections; when it is determined that the number of historical device connections is greater than or equal to the first connection number and less than the second connection number, determining a second preset value as the score value of the number of historical device connections; when it is determined that the number of historical device connections is greater than or equal to the second connection number, determining a third preset value as the score value of the number of historical device connections, wherein the second connection number is greater than the first connection number, the third preset value is greater than the second preset value, and the second preset value is greater than the first preset value; when determining the number of historical device connections of each device When the distance is less than the first device distance, the third preset value is determined as the score value of the device distance; when it is determined that the device distance is greater than or equal to the first device distance and less than the second device distance, the second preset value is determined as the score value of the device distance; when it is determined that the device distance is greater than or equal to the second device distance, the first preset value is determined as the score value of the device distance, wherein the second device distance is greater than the first device distance; when it is determined that the device signal strength of each device is less than the first strength, the first preset value is determined as the score value of the device signal strength of the device; when it is determined that the device signal strength is greater than or equal to the first strength and less than the second strength, the second preset value is determined as the score value of the device signal strength; when it is determined that the device signal strength is greater than or equal to the second strength, the third preset value is determined as the score value of the device signal strength, wherein the second strength is greater than the first strength.
[0039] Optionally, in the above embodiment, various types of information are scored, for example, in the following manner: 1 point is given if the device has a history of connection times less than five times, 3 points are given if the device has a history of connection times between 5 and 10 times, and 5 points are given if the device has a history of connection times greater than 10 times; 5 points are given if the device distance is less than 1 meter, 3 points are given if the device distance is between 2 and 10 meters, and 1 point is given if the device distance is greater than 10 meters; 1 point is given if the signal strength is weak, 3 points if the signal strength is medium, and 5 points if the signal strength is strong; it should be noted that the above scoring rules are only used as examples and are not intended to be a limitation of this solution. In actual application, the scoring thresholds for the above indicators and the scoring granularity can be adjusted.
[0040] In an exemplary embodiment, the various types of information in the above-mentioned device information also include: device operating status. For each device in the first device list, a score corresponding to each type of information is obtained to obtain multiple scores. It also includes: when it is detected that the device operating status of each device is a sleep state, the first preset value is determined as the score value of the device operating status; when it is detected that the device operating status of each device is a working state, the third preset value is determined as the score value of the device operating status.
[0041] Optionally, in the above embodiment, for example, if the target device is detected to be in sleep state, the score of the device operation status is 1 point, and if the device is in working state, the score of the device operation status is 5 points. In actual application, the device may have more operation states, and a corresponding score can be set for each state respectively. The specific score value can also be determined according to needs.
[0042] Optionally, in the above embodiment, new types of information may be added to the device for scoring, such as user behavior, which includes picking up the device, putting down the device, turning off the device, turning on the device, etc., and a corresponding score may be set for each of the above behaviors.
[0043] In an exemplary embodiment, before executing the above steps to perform weighted summation of the multiple score values to obtain the weighted sum value of each device, the method also includes: setting the same initial weight value for the score value corresponding to each type of information; and adjusting the weight value of the score value corresponding to each type of information based on the result of the target object's active selection of the connection device.
[0044] Optionally, in the above embodiment, the score value corresponding to each type of information can be set with the same initial weight value. For example, if the target object often chooses to connect to a device that is far away, the weight value of the device distance is reduced. For example, if the target object often chooses to connect to a device with a weak signal, the weight value of the signal strength is reduced. The specific weights need to be machine-learned to give the optimal implementation solution.
[0045] In an exemplary embodiment, the above-mentioned step S206 determines the target device from the second device list, and the implementation process of connecting to the target device specifically includes: determining the device ranked first in the second device list as the target device; when it is determined that the connection to the target device fails, deleting the device ranked first in the second device list, and re-determining the target device from the second device list.
[0046] In an exemplary embodiment, the above step S206 determines the target device from the second device list, and after connecting to the target device, the method further includes: monitoring the device information of each device in the first device list, and when it is determined that the device information has changed, reprocessing the first device list based on the changed device information to generate a third device list; when it is determined that the device ranked first in the third device list is inconsistent with the currently connected device, switching the currently connected device to the device ranked first in the third device list; when it is determined that the device ranked first in the third device list is consistent with the currently connected device, maintaining the current connection state.
[0047] Optionally, in the above embodiment, when a change in device information is detected, all devices need to be re-evaluated. If the connected device indicated by the new evaluation result is consistent with the currently connected device, the current connection state is maintained; if they are inconsistent, the connection state is switched to the connected device indicated by the latest evaluation result.
[0048] In order to better understand the process of the connection method of the above-mentioned target device, the implementation method flow of the connection of the above-mentioned target device is described below in combination with an optional embodiment, but it is not used to limit the technical solution of the embodiment of the present application.
[0049] In this embodiment, a method for connecting a target device is provided. Figure 3 is a schematic flow chart of a method for connecting a target device according to an embodiment of the present application, such as Figure 3 As shown, the specific steps are as follows:
[0050] Step S301: Start;
[0051] Step S302: The user turns on the wireless audio device;
[0052] Step S303: Initialize the device, start the scanning module, processing module, and connection module of the device, start scanning nearby wireless device signals, and prepare the signal processing and connection environment;
[0053] Step S304: Collect wireless device information, including but not limited to device name, MAC address, device connection history, device status, device distance, signal strength, etc., and save the collected device information in a device list (equivalent to the first device list);
[0054] Step S305: Determine the device with priority connection by combining various information through a matching algorithm, obtain a list of devices with priority connection (equivalent to the second device list), and determine the device with the highest ranking in the list of devices with priority connection as the target device;
[0055] Optionally, the core of the matching algorithm in the above step S305 is to assign different weights to different data items or features according to certain rules and strategies, and to influence the final matching result through these weights.
[0056] Step S306: Try to establish a connection with the target device;
[0057] Step S307: Determine whether the connection is successful. If the connection is successful, execute step S308. If the connection fails, execute step S306. If the number of failures reaches a preset number, execute step S309.
[0058] Optionally, if the connection fails in the above step S307, the target device may be switched to the next device in the priority connection list and then connected again until the connection is successful or all devices in the list have been tried.
[0059] Step S308: monitor whether the device status, signal strength, device distance, operation instructions and other information have changed. If yes, execute step S305; otherwise, execute step S309;
[0060] Step S309: End.
[0061] Through the above embodiments, multiple factors such as user usage habits, connection history between devices, device distance, etc. can be comprehensively considered to evaluate and sort the scanned terminal devices. Through the matching algorithm operation, the device that the user currently wants to connect to can be quickly and accurately determined. The time for users to search and select devices is greatly reduced, and the efficiency of matching connected devices is improved. In the above process, no manual operation by the user is required, and the device can automatically complete the matching and connection. At the same time, the device also has the function of automatic monitoring and adjustment, which can continuously monitor the connection status and automatically adjust or re-match when necessary to ensure the stability and reliability of the connection.
[0062] In an alternative embodiment, Figure 4 is a schematic diagram of a method for connecting a target device according to an embodiment of the present application, such as Figure 4 As shown, taking the connection matching of Bluetooth devices as an example, the Bluetooth master device needs to select a target device from multiple Bluetooth slave devices for connection. The Bluetooth master device first performs device scanning to collect information of each Bluetooth slave device, and then processes the device information through a matching algorithm to determine the target device, and then connects to the target device. Optionally, the above matching process can be implemented by building a matching algorithm into the device, or by installing an external device with a matching algorithm on the device.
[0063] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods of each embodiment of the present application.
[0064] Figure 5 is a structural block diagram of a connection device for a target device according to an embodiment of the present application; Figure 5 As shown, including:
[0065] A receiving module 52, configured to receive wireless signals sent by a plurality of devices, and determine a first device list according to device information included in the wireless signals, wherein the first device list includes device information of each of the plurality of devices;
[0066] A processing module 54, configured to process the devices in the first device list based on various types of information in the device information to generate a second device list;
[0067] The connection module 56 is used to determine a target device from the second device list and connect to the target device.
[0068] Through the above-mentioned device, a first device list is determined by receiving device information included in wireless signals sent by multiple devices, and the first device list is sorted based on various types of information in the device information to obtain a second device list, and then a target device is determined from the second device list for connection, thereby solving the problem in the related art that the target device to be connected cannot be accurately determined from multiple devices, and thus achieving the effect of accurately determining the target device to be connected from multiple devices.
[0069] In an exemplary embodiment, the processing module 54 is further used to: obtain a score value corresponding to each type of information for each device in the first device list to obtain multiple score values; perform weighted summation on the multiple score values to obtain a weighted sum value for each device; and sort the devices in the first device list in descending order according to the size of the weighted sum values of the multiple devices to generate the second device list.
[0070] In an exemplary embodiment, the processing module 54 is further used to: when it is determined that the number of historical device connections of each device is less than the first number of connections, determine the first preset value as the score value of the historical device connection times; when it is determined that the number of historical device connections is greater than or equal to the first number of connections and less than the second number of connections, determine the second preset value as the score value of the historical device connection times; when it is determined that the number of historical device connections is greater than or equal to the second number of connections, determine the third preset value as the score value of the historical device connection times, wherein the second number of connections is greater than the first number of connections, the third preset value is greater than the second preset value, and the second preset value is greater than the first preset value; when it is determined that the device distance of each device is less than the first device distance, determine the third preset value as the score value of the device distance, and when determining When the device distance is greater than or equal to the first device distance and less than the second device distance, the second preset value is determined as the score value of the device distance; when it is determined that the device distance is greater than or equal to the second device distance, the first preset value is determined as the score value of the device distance, wherein the second device distance is greater than the first device distance; when it is determined that the device signal strength of each device is less than the first strength, the first preset value is determined as the score value of the device signal strength of the device; when it is determined that the device signal strength is greater than or equal to the first strength and less than the second strength, the second preset value is determined as the score value of the device signal strength; when it is determined that the device signal strength is greater than or equal to the second strength, the third preset value is determined as the score value of the device signal strength, wherein the second strength is greater than the first strength.
[0071] In an exemplary embodiment, the processing module 54 is also used to: when it is detected that the device operating state of each device is a sleep state, determine the first preset value as the score value of the device operating state; when it is detected that the device operating state of each device is a working state, determine the third preset value as the score value of the device operating state.
[0072] In an exemplary embodiment, the processing module 54 is further used to: set the same initial weight value for the score value corresponding to each type of information; and adjust the weight value of the score value corresponding to each type of information based on the result of the target object actively selecting a connection device.
[0073] In an exemplary embodiment, the connection module 56 is further used to: determine the device ranked first in the second device list as the target device; when it is determined that the connection to the target device fails, delete the device ranked first in the second device list and re-determine the target device from the second device list.
[0074] In an exemplary embodiment, the connection module 56 is further used to: monitor the device information of each device in the first device list, and when it is determined that the device information has changed, reprocess the first device list based on the changed device information to generate a third device list; when it is determined that the device ranked first in the third device list is inconsistent with the currently connected device, switch the currently connected device to the device ranked first in the third device list; when it is determined that the device ranked first in the third device list is consistent with the currently connected device, maintain the current connection state.
[0075] An embodiment of the present application further provides a storage medium, which includes a stored program, wherein the program executes any of the above methods when it is run.
[0076] Optionally, in this embodiment, the storage medium may be configured to store program codes for executing the following steps:
[0077] S1, receiving wireless signals sent by multiple devices, and determining a first device list according to device information included in the wireless signals, wherein the first device list includes device information of each of the multiple devices;
[0078] S2, processing the devices in the first device list based on various types of information in the device information to generate a second device list;
[0079] S3: Determine a target device from the second device list, and connect to the target device.
[0080] An embodiment of the present application further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0081] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0082] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:
[0083] S1, receiving wireless signals sent by multiple devices, and determining a first device list according to device information included in the wireless signals, wherein the first device list includes device information of each of the multiple devices;
[0084] S2, processing the devices in the first device list based on various types of information in the device information to generate a second device list;
[0085] S3: Determine a target device from the second device list, and connect to the target device.
[0086] Optionally, in this embodiment, the above-mentioned storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store program codes.
[0087] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps in any one of the above method embodiments are implemented.
[0088] An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.
[0089] The embodiments of the present application also provide a computer program, which includes computer instructions, which are stored in a computer-readable storage medium; a processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the steps in any one of the above method embodiments.
[0090] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be described in detail here.
[0091] Obviously, those skilled in the art should understand that the above modules or steps of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, and optionally, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.
[0092] 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
1. A method for connecting a target device, characterized in that: include: Receiving wireless signals sent by multiple devices, and determining a first device list according to device information included in the wireless signals, wherein the first device list includes device information of each of the multiple devices; Processing the devices in the first device list based on various types of information in the device information to generate a second device list; A target device is determined from the second device list, and a connection is established with the target device.
2. The method for connecting a target device according to claim 1, characterized in that: Processing the devices in the first device list based on various types of information in the device information to generate a second device list includes: For each device in the first device list, obtaining a score value corresponding to each type of information to obtain multiple score values; Performing weighted summation on the multiple score values to obtain a weighted sum value of each device; The devices in the first device list are sorted in descending order according to the weighted sum values of the multiple devices to generate the second device list.
3. The target device connection method according to claim 2, characterized in that: The various types of information in the device information include at least: the number of historical device connections, the device distance, and the device signal strength. For each device in the first device list, a score corresponding to each type of information is obtained to obtain multiple scores, including: In the case where it is determined that the number of device history connections of each device is less than the first number of connections, a first preset value is determined as the score value of the number of device history connections; in the case where it is determined that the number of device history connections is greater than or equal to the first number of connections and less than the second number of connections, a second preset value is determined as the score value of the number of device history connections; in the case where it is determined that the number of device history connections is greater than or equal to the second number of connections, a third preset value is determined as the score value of the number of device history connections, wherein the second number of connections is greater than the first number of connections, the third preset value is greater than the second preset value, and the second preset value is greater than the first preset value; In the case where it is determined that the device distance of each device is less than the first device distance, the third preset value is determined as the score value of the device distance; in the case where it is determined that the device distance is greater than or equal to the first device distance and less than the second device distance, the second preset value is determined as the score value of the device distance; in the case where it is determined that the device distance is greater than or equal to the second device distance, the first preset value is determined as the score value of the device distance, wherein the second device distance is greater than the first device distance; When it is determined that the device signal strength of each device is less than the first strength, the first preset value is determined as the score value of the device signal strength of the device; when it is determined that the device signal strength is greater than or equal to the first strength and less than the second strength, the second preset value is determined as the score value of the device signal strength; when it is determined that the device signal strength is greater than or equal to the second strength, the third preset value is determined as the score value of the device signal strength, wherein the second strength is greater than the first strength.
4. The method for connecting a target device according to claim 3, characterized in that: The various types of information in the device information also include: device operation status, for each device in the first device list, obtaining a score corresponding to each type of information to obtain multiple scores, and also including: In the case where it is detected that the device operation state of each device is a dormant state, determining the first preset value as the score value of the device operation state; When it is detected that the device operating state of each device is in the working state, the third preset value is determined as the score value of the device operating state.
5. The method for connecting a target device according to claim 2, characterized in that: Before performing weighted summation on the multiple score values to obtain the weighted sum value of each device, the method further includes: Setting the same initial weight value for the score value corresponding to each type of information; The weight value of the score value corresponding to each type of information is adjusted based on the result of the target object actively selecting the connection device.
6. The method for connecting a target device according to claim 2, characterized in that: Determining a target device from the second device list and connecting to the target device includes: Determine the device ranked first in the second device list as the target device; When it is determined that the connection to the target device fails, the device ranked first is deleted from the second device list, and the target device is re-determined from the second device list.
7. The target device connection method according to claim 1, characterized in that: After determining a target device from the second device list and connecting to the target device, the method further includes: Monitoring device information of each device in the first device list, and when determining that the device information has changed, reprocessing the first device list based on the changed device information to generate a third device list; If it is determined that the device ranked first in the third device list is inconsistent with the currently connected device, switching the currently connected device to the device ranked first in the third device list; When it is determined that the device ranked first in the third device list is consistent with the currently connected device, the current connection state is maintained.
8. A target device connection device, characterized in that: include: a receiving module, configured to receive wireless signals sent by a plurality of devices, and determine a first device list according to device information included in the wireless signals, wherein the first device list includes device information of each of the plurality of devices; A processing module, configured to process the devices in the first device list based on various types of information in the device information to generate a second device list; A connection module is used to determine a target device from the second device list and connect to the target device.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein the program executes the method described in any one of claims 1 to 7 when executed.
10. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 7 through the computer program.
