Equipment connection method and electronic equipment
By interconnecting and triggering operations through sensor detection devices to generate and broadcast characteristic data, a simple device connection without user intervention is achieved, solving the problem of cumbersome initial device connection and improving connection efficiency and security.
Patent Information
- Application Number
- CN202511416426.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-29
- Publication Date
- 2025-12-30
AI Technical Summary
The initial connection process is cumbersome, especially the registration, login, and scanning binding processes, and user privacy and security concerns affect the efficiency of data sharing.
The operation is triggered by interconnecting sensor detection devices, generating and broadcasting feature data. After verification by the second device, a connection request is sent, realizing a simple connection process that requires no user intervention.
It simplifies the device connection process, improves connection efficiency, meets users' needs for rapid interconnection, and avoids complicated registration and login operations.
Smart Images

Figure CN121240174A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, and more specifically, to a device connection method and an electronic device. Background Technology
[0002] Current device interconnection faces numerous limitations, especially during the initial connection, which may require registration, login, scanning, and binding, making the process cumbersome. Furthermore, due to privacy and security concerns, most users are reluctant to log in or bind devices on unfamiliar computers, thus affecting data sharing efficiency or even preventing data sharing altogether. Summary of the Invention
[0003] In view of the above, this application provides the following technical solution:
[0004] A first aspect of this application provides a device connection method applied to a first device, the method comprising:
[0005] In response to the first sensor detecting a first device interconnection trigger operation, the first device sends a broadcast message, the broadcast message carrying first feature data, the first feature data being determined using the first sensor data;
[0006] The system receives a connection request sent by a second device and establishes a communication connection with the second device. The connection request is a request sent by the second device to the first device after successfully verifying the first feature data following the detection of the second device interconnection trigger operation based on the second sensor. The verification of the first feature data includes matching the second feature data determined based on the second sensor data with the first feature data.
[0007] One possible implementation also includes:
[0008] If no connection request is received within the first time period after the broadcast message is sent, the broadcast message is stopped, and within the second time period after the broadcast message is stopped, the device listens for broadcast messages from the second device only as the second device.
[0009] If a broadcast message from the second device is detected within the second time period, a connection request is sent to the second device in the role of the second device.
[0010] If no broadcast message from the second device is detected within the second time period, the device will restart and send a broadcast message again as the first device.
[0011] The second duration is the sum of the base time and a random value.
[0012] In one possible implementation, the first device interconnection trigger operation includes M setting actions, and the second device interconnection trigger operation includes N setting actions, where M and N are both positive integers not less than 2, and M and N are different.
[0013] In one possible implementation, the first device interconnection operation includes a setting action for a first direction, and the second device interconnection triggering operation includes a setting action for a second direction, wherein the first direction and the second direction are opposite to or opposite to each other.
[0014] In one possible implementation, receiving the connection request sent by the second device includes:
[0015] Receive multiple connection requests from multiple second devices;
[0016] Based on the multiple connection requests, a communication connection is established between the first device role and multiple second devices that act as second devices.
[0017] In one possible implementation, the first sensor is a light sensor, and the first feature data characterizes the waveform of light change.
[0018] The verification of the first feature data by the second device includes determining whether the light change waveform represented by the first feature data is the same as the light change waveform represented by the second feature data.
[0019] In one possible implementation, the first sensor and the second sensor are sensors of different types, the first sensor is used to obtain the user's gestures through a first sensing technology, and the second sensor is used to obtain the user's gestures through a second sensing technology.
[0020] A second aspect of this application provides a device connection method applied to a second device, the method comprising:
[0021] In response to the second sensor detecting a second device interconnection trigger operation, second feature data is determined based on the second sensor data;
[0022] Receive a broadcast message sent by a first device, the broadcast message carrying first feature data, the first feature data being determined using first sensor data;
[0023] Verify whether the first feature data and the second feature data match;
[0024] If a match is found, a connection request is sent to the first device.
[0025] In one possible implementation, the first feature data includes a timestamp, the timestamp representing the time when the broadcast message was generated, and the verification of whether the first feature data and the second feature data match includes:
[0026] Determine whether the first feature data and the second feature data meet the matching conditions;
[0027] Determine whether the time difference between the timestamp indicated and the current time exceeds a set time;
[0028] If the first feature data and the second feature data meet the matching conditions, and the time difference does not exceed the set time, the verification is confirmed to be successful.
[0029] A third aspect of this application provides an electronic device that plays a first device role in device interconnection, comprising at least one processor and a memory connected to the processor, wherein:
[0030] The memory is used to store computer programs;
[0031] The processor is used to execute the computer program to achieve:
[0032] In response to the first sensor detecting a first device interconnection trigger operation, the first device sends a broadcast message, the broadcast message carrying first feature data, the first feature data being determined using the first sensor data;
[0033] The system receives a connection request sent by a second device and establishes a communication connection with the second device. The connection request is a request sent by the second device to the first device after successfully verifying the first feature data following the detection of the second device interconnection trigger operation based on the second sensor. The verification of the first feature data includes matching the second feature data determined based on the second sensor data with the first feature data. Attached Figure Description
[0034] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0035] Figure 1 This is a flowchart of a device connection method disclosed in an embodiment of this application;
[0036] Figure 2 A timing diagram for establishing a connection between the first device and the second device disclosed in the embodiments of this application;
[0037] Figure 3 This application discloses a device role processing flow in its embodiments.
[0038] Figure 4 This is a flowchart illustrating another device connection method disclosed in an embodiment of this application;
[0039] Figure 5 This is a schematic diagram of the structure of an electronic device disclosed in an embodiment of this application. Detailed Implementation
[0040] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0041] The embodiments of this application can be applied to electronic devices. This application does not limit the product form of the electronic device, which may include but is not limited to smartphones, tablets, wearable devices, personal computers (PCs), netbooks, etc., and can be selected according to application requirements.
[0042] Figure 1 This is a flowchart of a device connection method disclosed in an embodiment of this application. Figure 1 The method shown is applied to a first device; in this application, the first device can be understood as a device that assumes the role of a master device in a wireless ad hoc network containing at least two devices. See also Figure 1 As shown, the device connection method may include:
[0043] Step 101: In response to the first sensor detecting a first device interconnection trigger operation, the first device sends a broadcast message, the broadcast message carrying first feature data, the first feature data being determined using the first sensor data.
[0044] In this embodiment, the device interconnection function is activated by a first device interconnection triggering operation, which is determined by a first sensor on the first device. After the first sensor detects the first device interconnection triggering operation, first feature data can be generated based on the first sensor data. The first device interconnection triggering operation is not fixed; it can be tapping the first device (within the detection range of the first sensor) two or three times, swiping the palm to the left, swiping the palm to the right, etc. The first sensor can be an existing sensor on the first device; that is, this application does not require a dedicated sensor and can reuse conventionally configured sensors in electronic devices. The first sensor can be any of the following: an ALS (Ambient Light Sensor), an image sensor, a TOF (Time-of-Flight) sensor, or any sensor capable of detecting hand gestures.
[0045] The first feature data is a "connection code" for interconnection between different devices. That is, when different devices (second devices) determine that the first feature data matches the feature data they generate after activating the device interconnection function, they will confirm that the first device is the interconnection object they need to connect to to realize a wireless self-organizing network.
[0046] In practical applications, the system has a pre-set mapping relationship between the first device interconnection trigger operation and the device interconnection function, and also has pre-set characteristics of the sensor data corresponding to the first device interconnection trigger operation. Therefore, when the user performs the first device interconnection trigger operation near the first sensor of the first device, the system detects sensor data that matches the characteristics corresponding to the first device interconnection trigger operation and determines to start the device interconnection function.
[0047] After confirming the activation of the device interconnection function, the first device, acting as the master device, sends a broadcast message carrying first characteristic data, waiting for the second device that needs to interconnect with it to listen to the broadcast message and send a connection request to it.
[0048] Step 102: Receive a connection request sent by the second device and establish a communication connection with the second device. The connection request is a request sent by the second device to the first device after successfully verifying the first feature data after detecting the second device interconnection trigger operation based on the second sensor. The verification of the first feature data includes matching the second feature data determined based on the second sensor data with the first feature data.
[0049] When the device interconnection function is activated, the second device can listen for broadcast messages in the environment. If a broadcast message is detected and the first feature data carried in it is verified, the second device will determine that the first device is the target device it needs to connect to. Based on the relevant data of the first device identifier carried in the broadcast message, the second device will send a connection request to the first device. After the first device receives the connection request and agrees, the first device and the second device will establish a communication connection.
[0050] It should be noted that the second device also needs to receive a trigger operation to start the device interconnection function. This is referred to as the second device interconnection trigger operation in this article. After the second sensor of the second device detects the second device interconnection trigger operation, it will also determine a second feature data based on the second sensor data and verify whether the first feature data and the second feature data match. Only if they match will a connection request be sent to the first device. If the match fails, the received broadcast message will not be responded to.
[0051] For example, a user taps three times on a laptop (first device) and then taps three times on a mobile phone (second device). After detecting the "three taps" action, the laptop activates the device interconnection function, synchronously generating first feature data and broadcasting a message. After detecting the "three taps" action, the mobile phone activates the device interconnection function, synchronously generating second feature data. If it hears the broadcast message from the laptop, it will also match and verify the first feature data in the broadcast data with its own generated second feature data. If the verification determines that the two feature data are the same or similar, the mobile phone will determine that it needs to establish a connection with the laptop, and therefore sends a connection request to the laptop. After receiving the connection request from the mobile phone, the laptop agrees to the request and establishes a connection with the mobile phone.
[0052] Figure 2 The timing diagram for establishing a connection between the first device and the second device disclosed in the embodiments of this application can be combined with... Figure 2 Understand the implementation of the solution in this application. The connection between the first device and the second device can be established based on Wi-Fi Direct technology, also known as Wi-Fi Direct connection technology.
[0053] In the implementation of the device connection method described in this embodiment, the user does not need to perform registration or login operations, and the user does not need to participate in connection verification during the connection establishment process between the two devices. The user only needs to perform a simple gesture operation on the first device and / or the second device. The whole implementation process is simple and efficient, and can meet the user's need for rapid interconnection in various scenarios.
[0054] In one implementation, the device connection method may include other content besides the steps described in the aforementioned embodiments, which involves the processing and determination of device roles. Figure 3For the device role processing flow disclosed in the embodiments of this application, please refer to [link / reference]. Figure 3 The device connection method may further include:
[0055] Step 301: If no connection request is received within the first time period after the broadcast message is sent, stop sending the broadcast message, and within the second time period after stopping sending the broadcast message, listen for broadcast messages from the second device only as the second device, and proceed to step 302 or step 303.
[0056] As those skilled in the art know, in the process of establishing an interconnection between devices, there are master devices and slave devices (or secondary devices), and the functions of different device roles differ. Master devices and slave devices differ in terms of control, resource performance, and communication modes. Generally speaking, the master device has bus control, actively initiates communication requests and dominates the data transmission process, usually has strong processing capabilities, can actively initiate communication requests, and obtain control through the bus arbitration mechanism. Slave devices usually passively respond to the requests of the master device and complete data transmission or specific operations according to instructions. In the embodiments of this application, the first device role can be understood as the master device, and the second device role can be understood as the slave device.
[0057] It is understandable that the device interconnection triggering operation on the first device side and the second device side can be the same, that is, the first device interconnection triggering operation and the second device interconnection triggering operation are the same, such as "tap three times" in the previous example. After the device confirms that it has received the device interconnection triggering operation, it will send a broadcast message as the first device by default, and can listen for broadcast messages sent by other devices as the second device.
[0058] If no connection request is received within the first time period after the broadcast message is sent, a device role conflict may occur. This means that because both the first and second devices are broadcasting and listening simultaneously, signal disturbances may occur, preventing either device from recognizing or listening to the other's broadcast message. Therefore, to avoid this conflict, a backoff algorithm can be used. Specifically, if the first device does not receive a connection request within the first time period after the broadcast message, it closes its first device role (i.e., master device role), stops sending broadcast messages, and for the second time period after stopping broadcast messages, it listens only for broadcast messages from the second device (i.e., slave device role).
[0059] The second duration is the sum of a base time and a random value. The first duration and the base time can be several seconds, and their specific values are not fixed. Since neither the first nor the second device receives a connection request within the first duration, they will both switch to the second device role, only listening for broadcast requests from other devices. To prevent both devices from switching to the second device role simultaneously and for the same duration, thus preventing the interconnection operation from being completed, the second duration for each device is the sum of a base time and a random value. Because the second duration contains a random value, the second duration of the first and second devices will generally not be the same. This ensures that the times when the two devices start broadcasting again after the second duration will be staggered, guaranteeing that only one device broadcasts a message during a given period, while the other device only listens, allowing the other device to receive the broadcast message.
[0060] Step 302: If a broadcast message from the second device is detected within the second time period, send a connection request to the second device in the role of the second device.
[0061] If the first device detects a broadcast message from the second device within the second time period, it will act as a slave device and send a connection request to the first device after verifying the second feature data carried in the broadcast message based on the first feature data.
[0062] Step 303: If no broadcast message from the second device is detected within the second time period, restart the broadcast message as the first device.
[0063] If the first device does not receive a broadcast message from the second device within the second time period, it will resume its role as the first device, i.e., the master device, and start broadcasting messages again, while waiting for connection requests from other devices.
[0064] The solution described in this embodiment can avoid the problem of the first device and the second device being triggered to enable the device interconnection function at the same time. Due to the role conflict problem that may exist due to the simultaneous broadcasting and listening of devices, the solution implements role avoidance processing so that only one device broadcasts at a certain time, and the other device can listen to the broadcast message, thereby realizing the interconnection of the two devices.
[0065] In one implementation, the first device interconnection trigger operation includes M setting actions, and the second device interconnection trigger operation includes N setting actions, where M and N are both positive integers not less than 2, and M and N are different.
[0066] The previous embodiments described the same implementation of the first device interconnection trigger operation and the second device interconnection trigger operation. This embodiment, however, describes a different implementation of the first and second device interconnection trigger operations. The set action can be a tapping action on the device (or sensor area). Both the first and second device interconnection trigger operations can be tapping actions, but the number of taps differs. For example, the first device interconnection trigger operation involves two consecutive taps, while the second device interconnection trigger operation involves three consecutive taps.
[0067] In the implementation, different device roles can be pre-configured for different tap counts. For example, M taps indicate that the current device is enabling the device interconnection function as the first device, and N taps indicate that the current device is enabling the device interconnection function as a slave device. When the first sensor detects M taps, the first device, as the master device, generates first feature data and sends a broadcast message. When the second sensor detects N taps, the second device, as the slave device, generates second feature data and listens for broadcast messages from other devices.
[0068] In other implementations, the first device interconnection operation and the second device interconnection trigger operation contain the same number of set actions, but may have different directions. Therefore, the first device interconnection operation includes set actions in a first direction, and the second device interconnection trigger operation includes set actions in a second direction, with the first and second directions being opposite or opposite. For example, the first device interconnection operation is a hand swipe from left to right, and the second device interconnection operation is a hand swipe from right to left. Alternatively, the implementation can be pre-configured so that the set actions in the first direction correspond to the master device role, and the set actions in the second direction correspond to the slave device role.
[0069] Of course, in practical applications, there are also scenarios where multiple devices need to be interconnected. Therefore, receiving connection requests sent by the second device in the aforementioned embodiments may include: receiving multiple connection requests sent by multiple second devices; and establishing communication connections between the first device and the multiple second devices acting as the second device, respectively, based on the multiple connection requests.
[0070] In scenarios where multiple devices need to be interconnected, it is necessary to determine which device is the master device. When triggering device interconnection, the corresponding master device triggering operation can be performed on the device that needs to act as the master device. For example, if a hand moves from left to right, this device (corresponding to the first device) will start sending broadcast messages. In addition, the corresponding slave device triggering operation needs to be performed on the other interconnected devices. For example, if a hand moves from right to left, these devices (corresponding to the second devices) will start listening for broadcast messages. After listening to the broadcast message of the first device, each second device verifies the first feature data. If the verification confirms that the broadcast message was sent by the master device (first device), it will send a connection request to that device. The first device receives the connection requests from each second device in turn and establishes connections with each second device in the order in which the connection requests are received.
[0071] Based on the above implementation scheme, in scenarios that require interconnection of multiple devices, it can quickly and conveniently realize one-to-many (one master device and multiple slave devices) device interconnection without the need for the master device and multiple devices to scan and identify separately. Only a gesture action needs to be performed on each device, making the interconnection process efficient and easy to operate.
[0072] In one implementation, the first sensor can be a light sensor, such as an ALS sensor, which can detect changes in nearby light. Correspondingly, the first feature data obtained based on the first sensor data can characterize the light change waveform. In applications, the waveform can be processed and filtered to monitor whether it conforms to a set pattern, such as whether it exhibits three identical darkening patterns (when the sensor is blocked by a hand). If it does, the waveform is identified as the user's action of tapping three times.
[0073] The second sensor on the second device side can also be a light sensor, which will also detect light change data. The second feature data obtained based on the second sensor data can characterize the light change waveform. The verification of the first feature data by the second device includes determining whether the light change waveform characterized by the first feature data is the same as the light change waveform characterized by the second feature data.
[0074] In other implementations, the first sensor and the second sensor can be different types of sensors. The first sensor is used to obtain the user's gestures through a first sensing technology, and the second sensor is used to obtain the user's gestures through a second sensing technology. The working principles of the first sensing technology and the second sensing technology for detecting gestures are different.
[0075] For example, when the first device is in normal working condition, its image sensor can detect and collect the user's gestures, that is, collect the first device interconnection trigger operation; when the second device is in low power mode, its image sensor is in sleep or standby mode, and it can collect the user's gestures through the TOF sensor, that is, collect the second device interconnection trigger operation.
[0076] In this implementation, device interconnection trigger operations can be detected by different types of sensors on different devices, as long as there are sensors on the device that can detect the set trigger operation. This further expands the application scenarios and scope of the solution, meeting the device interconnection needs in multiple scenarios.
[0077] Figure 4 This is a flowchart of another device connection method disclosed in an embodiment of this application. Figure 4 The method shown is applied to the second device, see [link / reference]. Figure 4 As shown, the device connection method applied to the second device may include:
[0078] Step 401: In response to the second sensor detecting a second device interconnection trigger operation, determine second feature data based on the second sensor data.
[0079] In this text, the second device is a slave device in the interconnected devices. When a user wants to interconnect the devices, in addition to inputting a first device interconnection trigger operation on the first device side, a second device interconnection trigger operation is also input on the second device side. The second sensor on the second device detects the second device interconnection trigger operation and then determines the second feature data based on the second sensor data. The second sensor can be a light sensor, image sensor, TOF sensor, or other sensor capable of detecting gestures. The second sensor data is sensor data that can characterize the features of specific gestures, such as light change waveforms, light spatial position variation characteristics, target object posture, and target object movement patterns.
[0080] Step 402: Receive a broadcast message sent by the first device, the broadcast message carrying first feature data, the first feature data being determined using first sensor data.
[0081] After detecting the interconnection trigger operation, the second device can broadcast messages as a master device and / or listen to broadcast messages as a slave device. In this embodiment, the second device, as a slave device, can listen to the broadcast messages sent by the first device and parse them to obtain the first feature data carried therein.
[0082] Step 403: Verify whether the first feature data and the second feature data match.
[0083] After obtaining the first feature data and the second feature data, the second device will control the matching verification of the two. The matching verification is used to determine whether the first feature data and the second feature data are the same or correspond to each other, that is, to determine whether the device interconnection trigger operations received by the two devices are the same or correspond to each other.
[0084] Step 404: If a match is found, send a connection request to the first device.
[0085] If the verification confirms that the first characteristic data and the second characteristic data are the same or correspond, then the first device is determined to be the device requiring interconnection. Based on the first device identifier in the broadcast message, a connection request is sent to the second device. Upon receiving the connection request from the second device, the first device agrees to the request, thus establishing a communication connection with the second device. After a successful connection, the first and second devices can perform network transmission functions.
[0086] In the implementation of the device connection method described in this embodiment, the user does not need to perform registration or login operations, and the user does not need to participate in connection verification during the connection establishment process between the two devices. The user only needs to perform a simple gesture operation on the first device and / or the second device. The whole implementation process is simple and efficient, and can meet the user's need for rapid interconnection in various scenarios.
[0087] In one implementation, the first feature data includes a timestamp, which represents the time when the broadcast message was generated. The verification of whether the first feature data and the second feature data match includes: determining whether the first feature data and the second feature data meet a matching condition; determining whether the time difference between the time indicated by the timestamp and the current time exceeds a set time; if the first feature data and the second feature data meet the matching condition and the time difference does not exceed the set time, the verification is deemed successful.
[0088] In this implementation, in addition to verifying the feature data, it is also necessary to verify the time difference between the timestamp and the current time. This is because when a user performs a device interconnection operation, the devices to be interconnected typically receive the trigger operation sequentially, with minimal time intervals. Therefore, this implementation only verifies and matches broadcast messages within a set time frame. For example, when a second device detects a Wi-Fi Direct device (i.e., after detecting a broadcast message sent by the first device), it can verify the device's first feature data. Devices matching the feature data and whose broadcast time differs from the current time by less than 15 seconds are identified as potential connection devices, request a connection, and wait for the connection to complete. This implementation avoids interference from expired broadcast messages in the current device interconnection process.
[0089] In other implementations, the first device interconnection trigger operation may be the same as or different from the second device interconnection trigger operation. If the first device interconnection trigger operation is the same as the second device interconnection trigger operation, both the first device and the second device send broadcast messages and listen for the presence of devices to be connected, such as the device interconnection trigger operation of both the first device and the second device being "tap the device three times". If the first device interconnection trigger operation is different from the second device interconnection trigger operation, the first device sends broadcast messages and listens for the presence of devices to be connected, while the second device only listens for the presence of devices to be connected, such as the first device interconnection trigger operation of the first device being "tap the device twice", and the second device interconnection trigger operation of the second device being "tap the device three times".
[0090] For the foregoing method embodiments, in order to simplify the description, they are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, because according to this application, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to this application.
[0091] The methods described in the above-disclosed embodiments of this application are detailed in terms of their specific implementation methods. These methods can be implemented using various types of devices. Therefore, this application also discloses a device, and specific embodiments are given below for detailed explanation.
[0092] This application also discloses a device connection apparatus, applied to a first device, which may include:
[0093] The message broadcast module is used to respond to the first device interconnection trigger operation detected by the first sensor, wherein the first device sends a broadcast message, the broadcast message carrying first feature data, the first feature data being determined using the first sensor data;
[0094] A connection control module is used to receive a connection request sent by a second device and establish a communication connection with the second device. The connection request is a request sent by the second device to the first device after successfully verifying the first feature data following the detection of the second device interconnection trigger operation based on the second sensor. The verification of the first feature data includes matching the second feature data determined based on the second sensor data with the first feature data.
[0095] This application also discloses a device connection apparatus, applied to a second device, which may include:
[0096] The data determination module is used to determine second feature data based on the data from the second sensor in response to the second sensor detecting a second device interconnection trigger operation.
[0097] The message receiving module is used to receive a broadcast message sent by the first device, wherein the broadcast message carries first feature data, and the first feature data is determined using first sensor data;
[0098] The data verification module is used to verify whether the first feature data and the second feature data match;
[0099] The request sending module is used to send a link request to the first device when the verification result of the data verification module is a match.
[0100] In the device interconnection implementation of the above-mentioned device connection device, the user does not need to perform operations such as registration and login, and the user does not need to participate in connection verification during the connection establishment process between the two devices. The user only needs to perform a simple gesture operation on the first device and / or the second device. The whole implementation process is simple and efficient, and can meet the user's need for rapid interconnection in various scenarios.
[0101] The specific implementation of the above-mentioned device interconnection device, as well as the specific implementation of each of its modules, can be found in the corresponding sections of the method embodiments, and will not be repeated here.
[0102] Any of the device interconnection devices described in the above embodiments includes a processor and a memory. The message broadcasting module, connection control module, data determination module, message receiving module, data verification module, request sending module, etc. in the above embodiments are all stored as program modules in the memory, and the processor executes the above program modules stored in the memory to realize the corresponding functions.
[0103] The processor contains a kernel, which retrieves the corresponding program modules from memory. One or more kernels can be configured, and the processing of backtracking data can be achieved by adjusting kernel parameters.
[0104] The memory may include non-permanent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0105] In an exemplary embodiment, a computer-readable storage medium is also provided, which can be directly loaded into the internal memory of a computer and contains software code. After being loaded and executed by the computer, the computer program can implement the steps shown in any of the embodiments of the above-described device connection method.
[0106] In an exemplary embodiment, a computer program product is also provided, which can be directly loaded into the internal memory of a computer and contains software code. After being loaded and executed by the computer, the computer program can implement the steps shown in any embodiment of the device connection method described above.
[0107] Furthermore, embodiments of this application provide an electronic device. Figure 5 This is a schematic diagram of the structure of an electronic device disclosed in an embodiment of this application. See also... Figure 5 As shown, the electronic device 50 includes at least one processor 501, at least one memory 502 connected to the processor, and a bus 503; wherein the processor and the memory communicate with each other through the bus; the processor is used to call program instructions in the memory to execute the corresponding device connection method.
[0108] Specifically, if the electronic device is a device with the role of a second device, it executes program instructions to achieve the following:
[0109] In response to the first sensor detecting a first device interconnection trigger operation, the first device sends a broadcast message, the broadcast message carrying first feature data, the first feature data being determined using the first sensor data;
[0110] The system receives a connection request sent by a second device and establishes a communication connection with the second device. The connection request is a request sent by the second device to the first device after successfully verifying the first feature data following the detection of the second device interconnection trigger operation based on the second sensor. The verification of the first feature data includes matching the second feature data determined based on the second sensor data with the first feature data.
[0111] If the electronic device is a device with a second device role, it executes program instructions to achieve the following:
[0112] In response to the second sensor detecting a second device interconnection trigger operation, second feature data is determined based on the second sensor data;
[0113] Receive a broadcast message sent by a first device, the broadcast message carrying first feature data, the first feature data being determined using first sensor data;
[0114] Verify whether the first feature data and the second feature data match;
[0115] If a match is found, a link request is sent to the first device.
[0116] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to the method section.
[0117] It should also be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0118] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.
[0119] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A device connection method applied to a first device, the method comprising: in response to a first sensor detecting a first device interconnection trigger operation, the first device sending a broadcast message carrying first feature data determined by first sensor data; receiving a connection request sent by a second device, and establishing a communication connection with the second device, the connection request being a request sent by the second device to the first device after the second device detects a second device interconnection trigger operation based on second sensor data, and after the first feature data is verified successfully, wherein the verification of the first feature data comprises matching second feature data determined based on second sensor data with the first feature data. 2.The device connection method of claim 1, further comprising: if no connection request is received within a first time duration after sending the broadcast message, stopping sending the broadcast message, and listening for a second time duration after stopping sending the broadcast message whether there is a broadcast message of the second device in a second device role; if the broadcast message of the second device is listened to within the second time duration, sending a connection request to the second device in the second device role; if the broadcast message of the second device is not listened to within the second time duration, starting sending the broadcast message again in the first device role; wherein the second time duration is a sum of a base time and a random value. 3.The device connection method of claim 1, wherein the first device interconnection trigger operation comprises M times of a set action, and the second device interconnection trigger operation comprises N times of the set action, M and N are positive integers not less than 2, and M and N are different. 4.The device connection method of claim 1, wherein the first device interconnection operation comprises a set action in a first direction, and the second device interconnection trigger operation comprises a set action in a second direction, the first direction and the second direction are opposite or opposite. 5.The device connection method of claim 3 or 4, wherein the receiving a connection request sent by the second device comprises: receiving a plurality of connection requests sent by a plurality of second devices; based on the plurality of connection requests, establishing a communication connection with the plurality of second devices in the second device role respectively in the first device role. 6.The device connection method of claim 1, wherein the first sensor is a light sensor, and the first feature data represents a light change waveform; the verification of the first feature data by the second device comprises determining whether the light change waveform represented by the first feature data is the same as the light change waveform represented by the second feature data. 7.The device connection method of claim 1, wherein the first sensor and the second sensor are different types of sensors, the first sensor is used to obtain a gesture action of a user by a first sensing technology, and the second sensor is used to obtain a gesture action of a user by a second sensing technology. 8.A device connection method applied to a second device, the method comprising: in response to a second sensor detecting a second device interconnection trigger operation, determining second feature data based on second sensor data; receiving a broadcast message sent by a first device, the broadcast message carrying first feature data determined by first sensor data; verifying whether the first feature data and second feature data match; if the first feature data and second feature data match, sending a connection request to the first device.
9. The device connection method of claim 8, wherein the first feature data comprises a time stamp indicating a time when the broadcast message is generated, and the verifying whether the first feature data and second feature data match comprises: determining whether the first feature data and second feature data satisfy a matching condition; determining whether a time difference between the time indicated by the time stamp and a current time exceeds a set time; and if the first feature data and second feature data satisfy the matching condition and the time difference does not exceed the set time, determining that the verification is passed.
10. An electronic device having a first device role in device interconnection, comprising at least one processor and a memory connected to the processor, wherein: the memory is configured to store a computer program; the processor is configured to execute the computer program to implement: in response to a first sensor detecting a first device interconnection trigger operation, sending, by the first device, a broadcast message carrying first feature data determined by first sensor data; receiving a connection request sent by a second device, and establishing a communication connection with the second device, the connection request being a request sent by the second device to the first device after the second device detects a second device interconnection trigger operation based on second sensor data, and after the first feature data is successfully verified, wherein the verifying the first feature data comprises matching second feature data determined based on second sensor data with the first feature data.