WO2016202205A1 - 一种设备连接方法、装置和系统 - Google Patents
一种设备连接方法、装置和系统 Download PDFInfo
- Publication number
- WO2016202205A1 WO2016202205A1 PCT/CN2016/085214 CN2016085214W WO2016202205A1 WO 2016202205 A1 WO2016202205 A1 WO 2016202205A1 CN 2016085214 W CN2016085214 W CN 2016085214W WO 2016202205 A1 WO2016202205 A1 WO 2016202205A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- audio
- audio signal
- wireless connection
- signal
- target device
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Ceased
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W12/00—Security arrangements; Authentication; Protecting privacy or anonymity
- H04W12/08—Access security
- H04W12/084—Access security using delegated authorisation, e.g. open authorisation [OAuth] protocol
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W12/00—Security arrangements; Authentication; Protecting privacy or anonymity
- H04W12/06—Authentication
Definitions
- the present application relates to the field of computer technology, and in particular, to a device connection method, apparatus, and system.
- the mobile terminal is used to interact with other devices to transmit or acquire information more frequently.
- a user connects a mobile terminal to a wifi (wireless fidelity) device to access the Internet; for example, a user connects a mobile terminal to another user's mobile terminal or other device through a Bluetooth connection to transmit or Receiving data, such as transferring pictures, videos, documents, etc.; for example, a user passes the mobile terminal through OTG (On-The-Go, which is a technology for realizing data transmission between devices without a network node) Connect to another user's device to transmit or receive data.
- OTG On-The-Go
- the user's mobile terminal is connected to a certain device in various ways similar to the foregoing, and the following connection methods exist:
- connection password to connect, generally including the following steps:
- the user obtains the device identification and connection password through a certain channel
- the wifi router Take the wifi router as an example. If user A wants to connect to the wifi router, he can ask the wifi router's identifier and connection password from the wifi router's setter. The way in which it can be asked can be done in a variety of ways. For example, the wifi router is identified as ABC and the password is 123456.
- the user opens the connection interface of the wifi of the mobile phone, and searches for the wifi router identifier corresponding to the ABC in the plurality of wifi router identifiers in the connection interface.
- the user clicks on the logo, enters the login interface, and then inputs Connect the password and click Connect. If the connection password is correct, connect to ABC's wifi router; if the connection password is incorrect, the connection fails.
- the user uses the mobile terminal to scan the two-dimensional code for the device to connect with the device.
- an NFC (Near Field Communication) module is added, and the NFC module is connected to the device.
- connection failure may occur due to human error input errors; user operations are cumbersome and the entire process takes a long time; and since the device identification and password are exposed to the outside world, the user obtains Device IDs and passwords are easily stolen by others.
- the mobile terminal is required to have a camera, and the connected device has a display screen, and there are certain requirements for the accuracy of the camera, auto focus, etc., and the user operation is also cumbersome.
- the application range is narrow and cannot meet the demand.
- embodiments of the present application have been made in order to provide a device connection method, a corresponding device connection device, a device access method and a corresponding one, which overcome the above problems or at least partially solve the above problems.
- Device access device and a device connection system.
- a device connection method including:
- the first audio signal is sent through the audio interface; the first audio signal is used to indicate that the wireless connection authority information of the target device is acquired;
- the audio interface Receiving, by the audio interface, a second audio signal;
- the second audio signal includes wireless connection authority information of the target device;
- the first device is wirelessly connected to the target device according to the wireless connection authority information in the second audio signal.
- the application also discloses a device access method, including:
- the first audio signal is used to indicate that the wireless connection authority information of the target device is acquired;
- the first audio signal is detected, processing is performed on the first audio signal to obtain a second audio signal; the second audio signal includes wireless connection authority information of the target device;
- the application also discloses a device connecting device, comprising:
- An audio interface insertion detecting module is configured to detect whether an audio interface of the first device is inserted
- a first audio signal sending module configured to send, by the audio interface, a first audio signal when detecting that the audio interface of the first device is inserted; the first audio signal is used to indicate that the wireless connection right of the target device is acquired information;
- a second audio signal receiving module configured to receive a second audio signal by using the audio interface;
- the second audio signal includes wireless connection authority information of the target device;
- a wireless connection module configured to wirelessly connect the first device to the target device according to the wireless connection authority information in the second audio signal.
- the application also discloses a device access device, including:
- a first audio signal receiving module configured to detect whether the first audio signal is received; the first audio signal is used to indicate that the wireless connection authority information of the target device is acquired;
- a first audio signal processing module configured to: if the first audio signal is detected, process the first audio signal to obtain a second audio signal; the second audio signal includes wireless connection authority information of the target device;
- a second audio signal returning module configured to return the second audio signal to the first device, so that the first device performs the first device and the target device according to the wireless connection authority information in the second audio signal Wireless connections.
- the application also discloses a device connection system, including:
- the first device includes:
- An audio interface insertion detecting module is configured to detect whether an audio interface of the first device is inserted
- a first audio signal sending module configured to send, by the audio interface, a first audio signal when detecting that the audio interface of the first device is inserted; the first audio signal is used to indicate that the wireless connection right of the target device is acquired information;
- a second audio signal receiving module configured to receive a second audio signal through the audio interface
- a wireless connection module configured to wirelessly connect the first device to the target device according to the wireless connection authority information in the second audio signal
- the target device includes:
- a first audio signal receiving module configured to detect whether the first audio signal is received
- a first audio signal processing module configured to: if the first audio signal is detected, process the first audio signal to obtain a second audio signal; the second audio signal includes wireless connection authority information of the target device;
- a second audio signal returning module configured to return the second audio signal to the first device.
- the application also discloses a device connection system, including:
- First device relay device, and target device
- the first device includes:
- An audio interface insertion detecting module is configured to detect whether an audio interface of the first device is inserted
- a first audio signal sending module configured to send, by the audio interface, a first audio signal when detecting that the audio interface of the first device is inserted; the first audio signal is used to indicate that the wireless connection right of the target device is acquired information;
- a second audio signal receiving module configured to receive a second audio signal through the audio interface
- a wireless connection module configured to wirelessly connect the first device to the target device according to the wireless connection authority information in the second audio signal
- the relay device includes:
- a first audio signal receiving module configured to detect whether the first audio signal is received
- a first audio signal processing module configured to: if the first audio signal is detected, process the first audio signal to obtain a second audio signal; the second audio signal includes wireless connection authority information of the target device;
- a second audio signal returning module configured to return the second audio signal to the first device.
- the embodiments of the present application include the following advantages:
- the first device directly obtains the wireless connection authority information of the target device by using the audio interface, for example, acquiring the device identifier and the connection password of the wireless router, and then automatically according to the obtained wireless connection authority information of the wireless connection device, A device is wirelessly connected to the target device.
- the above process reduces various operations steps of the user connecting the first device to the target device, which reduces the cumbersome operation of the user; secondly, the above process quickly acquires the wireless connection password of the target device through audio and then automatically logs in, and executes the same.
- the process is fast, the elapsed time of the wireless connection is short; secondly, the wireless connection authority information of the target device is internally transmitted between the target device and the first device, and the user does not need to obtain the wireless connection permission information through the exposed environment, and the degree of confidentiality is high; No need for user input operation, no password connection failure due to user input error; Finally, due to the current market, most of the first devices (such as mobile phones, tablets, smart bracelets, smart watches, etc.) All have audio interfaces, so this application has a wide range of applications and can meet the needs of users.
- FIG. 1 is a flow chart showing the steps of an embodiment of a device connection method of the present application.
- FIG. 2 is a flow chart of steps of an embodiment of a device access method corresponding to FIG. 1 according to the present application;
- FIG. 3 is a flow chart showing the steps of an embodiment of a device connection method in an environment where a first device of the present application is directly connected to a target device;
- FIG. 4 is a flow chart showing the steps of an embodiment of a device connection method in an environment where a first device of the present application is connected to a target device by using a relay device;
- FIG. 5 is a structural block diagram of an embodiment of a device connection device of the present application of the present application.
- FIG. 6 is a structural block diagram of an embodiment of a device access device corresponding to FIG. 5 according to the present application;
- FIG. 7 is a structural block diagram of an embodiment of a device connection system of the present application.
- FIG. 8 is a structural block diagram of another embodiment of a device connection system of the present application.
- One of the core ideas of the present application is that for a user to use a first device having an audio interface, when it wants to wirelessly connect the first device with the target device, the audio interface of the first device is connected to the target device or relay.
- the target device or the relay device is used to obtain the wireless connection authority information of the target device through the audio signal, and then the first device can automatically perform wireless connection with the target device according to the wireless connection authority information. It saves the user's operation steps, improves the connection speed, and improves the security of the wireless connection authority information of the target device.
- the foregoing first device includes a mobile terminal
- the mobile terminal refers to a computer device that can be used in mobile, and generally includes a mobile phone, a notebook, a tablet, and a POS (point of sale) , sales terminal) machine, car computer, etc.
- the above target device includes a device with wireless access function, such as a wireless router providing wifi, a mobile terminal that can be set as a wifi hotspot, a mobile terminal that can provide a Bluetooth connection, an infrared connection access function, and the like.
- the relay device is a device between the first device and the target device, and may be independent of the target device, and the relay device acquires wireless connection authority information of the target device; the relay device directly performs audio communication with the first device, and the wireless device The connection permission information is returned to the first device.
- FIG. 1 The embodiment shown in FIG. 1 is described from the side of the first device that initiates the connection, and specifically includes the following steps:
- Step 110 Detect whether the audio interface of the first device is inserted; if it is detected that the audio interface of the first device is inserted, proceed to step 120; if the audio interface of the first device is not detected, the subsequent execution process is not performed. .
- the first device has an audio interface, and for the audio interface, four pins are commonly included: GND (ground line), L (left channel), R (right channel), and MIC (microphone).
- GND ground line
- L left channel
- R right channel
- MIC microphone
- the aperture of the audio interface is not limited, and the technical solution of the embodiment of the present application can be applied to the audio interface.
- an audio interface of a 3.5 mm aperture, an audio interface of a 2.5 mm aperture, or an audio interface of other apertures is not limited in this embodiment.
- detecting whether the audio interface is inserted is by detecting whether the impedance between GND and MIC is a specified value, and when the impedance between GND and MIC reaches a specified value, it is confirmed that the audio interface is inserted.
- the above specified value is, for example, 4.99K of the impedance setting of the general mobile phone, and of course, other values can be set according to the needs of the terminal.
- the API of the corresponding operating system can be called to detect whether the audio interface is inserted.
- the specific API to be called varies with the operating system, and is not limited in this application. For example, for Android system, you can call HeadsetObserver to check if the audio interface is inserted.
- the first device can connect to the target device through the audio line to obtain the wireless connection authority information, or the first device can connect to the relay device through the audio line, and the relay device acquires the connection right of the target device.
- the execution logic of the present application may be preset in the first device in various forms.
- mobile terminals such as mobile phones and tablets can be installed in the system of the mobile terminal through the application of the APP.
- the execution logic of the present application can also be directly written into the operating system of the first device before the first device is listed. Then, the user starts the execution logic of the application in the first device, for example, after opening the corresponding APP application, it can detect whether the audio interface of the first device is inserted.
- step 120 when the user inserts the audio plug into the audio interface of the first device, it is detected that the audio interface of the first device is inserted, and then the process proceeds to step 120.
- Step 120 Send a first audio signal by using the audio interface, where the first audio signal is used to indicate that the wireless connection authority information of the target device is acquired;
- a first audio signal for indicating wireless connection authority information of the acquisition target device may be generated, and then the first audio signal is sent through the audio interface. Then the first audio signal It can be transmitted to the aforementioned target device or the aforementioned relay device through an audio line.
- the target device or the relay device presets a corresponding module for processing an audio signal, parses the received various audio signals, performs corresponding actions to obtain wireless connection authority information of the target device, and then returns.
- a second audio signal including wireless connection authority information.
- the wireless connection authority information of the target device includes the device identifier and the connection password of the target device.
- the wireless connection permission information includes a ssid (Service Set Identifier) and a wifi connection password.
- the wireless connection permission information includes a device identifier of the mobile phone and a connection password of the wireless hotspot.
- the wireless connection permission information includes the mobile device identification and the connection password of the Bluetooth connection.
- the foregoing wireless connection authority information may also use other information, as long as the information required by the first device to wirelessly connect to the target device is not limited by the present application.
- step 120 may include the following sub-steps:
- Sub-step S121 generating a permission acquisition instruction, where the permission acquisition instruction is used to acquire wireless connection authority information of the target device;
- the application may generate a permission acquisition instruction, which is used to obtain wireless connection authority information of the target device.
- the present application can construct a permission acquisition instruction by using various protocols, and adopt a set of protocols between the first device and the target device, or between the first device and the relay device.
- the present application may construct a permission acquisition instruction according to a simple text protocol after determining that the audio interface is inserted.
- the instruction format of the simple text protocol is as follows: “The data content is the string plaintext “ ⁇ r ⁇ n”, where ⁇ r ⁇ n is used as the end of the command or audio response signal. For example, obtaining the ssid and connection password of the router, the constructed permission Get the instruction as "getssid:+Equipment info+" ⁇ r ⁇ n".
- Sub-step S122 the permission acquisition instruction is modulated into a first audio signal
- the previously generated permission acquisition instruction can then be modulated into a first audio signal.
- the first audio signal can also be understood as indicating the wireless connection authority information of the acquisition target device.
- the audio interface and the audio line transmit audio signals, they are waveform signals. While the permission acquisition instruction itself is a digital signal, the digital signal needs to be modulated into an audio signal for transmission to the target device or the relay device through the audio line.
- the digital signal is modulated into an audio signal
- the audio signal is demodulated into a digital signal, which can be modulated and demodulated by means of 2FSK (2binary frequency shift keying).
- 2FSK uses the 0, 1 in the binary to control the frequency of the carrier, thus achieving the purpose of communication.
- 1ms (micron) long, 1KHz (kilohertz) sinusoidal signal to represent 1 in binary
- that series of 1KHz, 2KHz signals are demodulated A series of 0s and 1.
- x micrometer length, y kilohertz sinusoidal signal can be set as 1 in binary code
- set m micrometer long, n kilohertz sinusoidal signal represents 0 in binary.
- the specific modulation and demodulation method may also adopt other manners, which is not limited in this application.
- step S122 the present application modulates the authority acquisition instruction into a first audio signal by means of 2FSK.
- the permission acquisition instruction of the simple text protocol is "getssid:+Equipment info+" ⁇ r ⁇ n", because the characters used in the simple text protocol are characters in the ASCII table (American Standard Code for Information Interchange).
- the characters of the ASCII table have a one-to-one binary code at the bottom, so for "getssid:+Equipment info+" ⁇ r ⁇ n, the substance corresponds to a series of binary codes, and the above-mentioned series of binary codes can be passed through 2FSK. Modulated as a waveform signal, ie a first audio signal.
- Sub-step S123 the first audio signal is sent by the audio interface.
- It can then be transmitted to the audio cable through the audio interface and then transmitted to the target device or relay device via the audio cable.
- sub-step S123 may include the following sub-steps:
- Sub-step S124 the audio output API is called, and the first audio signal is sent through the left channel pin and/or the right channel pin of the audio interface.
- an API Application Programming Interface
- the specific API to be called varies with the operating system, and is not limited in this application.
- AudioTrack can be called to output the above first audio signal from the audio interface. The first audio signal is then delivered along the audio line to the target device or relay device.
- different operating systems may also have different audio output APIs, which are not limited in this application.
- the output of the first audio signal it may be transmitted only by the left channel pin, or only by the right channel pin, or a combination of the two, which is not limited in the present application.
- the corresponding module for processing the audio signal can be set in advance on the target device or the relay device, the same communication protocol is set, and corresponding processing is preset for different instructions under the corresponding communication protocol. logic.
- modules that process audio signals with 2FSK and simple text protocols are preset, and are preset on the target device side.
- the first audio signal is first demodulated into a series of binary codes by 2FSK.
- the series of binary codes are matched from the header to the ASCII table, and the conversion is "getssid:+Equipment info+" ⁇ r ⁇ n"
- the target device or the relay device recognizes the instruction as the ssid and the connection password of the target device.
- the instruction is executed to obtain the ssid and the connection password of the target device, and then modulate the ssid and the connection password into a second audio signal and return the first device through the audio line.
- the target device or the relay device after acquiring the wireless connection authority information, the target device or the relay device generates a return instruction based on the wireless connection authority information, and then modulates the return instruction into a second audio signal and returns to the first device.
- the simple text protocol and the router under the 2FSK mechanism can construct the obtained ssid and connection password in the form of the return instruction "ssid+password" ⁇ r ⁇ n", and then "ssid+password” ⁇ r ⁇ n" uses 2FSK modulation as the second audio signal in the same mechanism as described above, and then returns the second audio signal to the first device.
- the second audio signal returned by the target device or the relay device may be returned through the microphone pin, and then the second audio signal is returned to the first device through the microphone line in the audio line.
- Step 130 Receive, by the audio interface, a second audio signal, where the second audio signal includes wireless connection authority information of the target device.
- the first device receives the second audio signal through the audio interface, and the second audio signal includes wireless connection authority information of the target device.
- step 130 may include the following sub-steps:
- Sub-step S131 the audio input API is called to receive the second audio signal from the microphone pin of the audio interface.
- the second audio signal can be received from the microphone pin of the audio interface by calling an API of the corresponding operating system.
- the specific API to be called varies with the operating system, and is not limited in this application. Taking the Android system as an example, the AudioRecordk can be called to receive the second audio signal from the microphone pin of the audio interface.
- Step 140 Perform wireless connection between the first device and the target device according to the wireless connection authority information in the second audio signal.
- the step may extract the wireless connection authority information from the second audio signal, and then perform the Susie first device and the target device according to the wireless connection authority information. Wireless connections.
- step 140 may include the following sub-steps:
- Sub-step S141 after the first device receives the second audio signal through the audio interface, demodulate the second audio signal
- the present application may demodulate the second audio signal by using a corresponding demodulation mechanism.
- the second audio signal including the back instruction "ssid+password" ⁇ r ⁇ n is used to demodulate the second audio signal by 2FSK to obtain a series of binary codes, and then the series of binary codes are The ASCII table is matched and converted to get "ssid+password" ⁇ r ⁇ n".
- Sub-step S142 extracting wireless connection authority information of the target device from the demodulated result
- the wireless connection authority information ssid and password can be extracted.
- Sub-step S143 the first device is wirelessly connected to the target device based on the wireless connection authority information.
- the first device after obtaining the wireless connection authority information, the first device can be connected to the wifi of the wireless router.
- sub-step S143 may include the following sub-steps:
- Sub-step S144 using a wireless connection API, wirelessly connecting the first device to the target device according to the wireless connection authority information;
- the corresponding wifi module, Bluetooth connection module or infrared connection module of the first device can send the correct connection to the target device. Request so that the first device and the target device can connect successfully.
- the first device takes the Android system as an example, and the WifiConfiguration can be invoked in the first device, and the first device and the target device are wirelessly connected according to the wireless connection authority information.
- sub-step S144 may include the following sub-steps:
- Sub-step S144 calling a wireless configuration API in the wireless connection API, and performing wireless connection configuration according to the wireless connection authority information;
- the first device takes the Android system as an example.
- it calls the WifiManager to perform wifi hotspot configuration in the first device.
- the above WifiManager first obtains the WifiManager object, and then performs the following configuration in the WifiManager object:
- Sub-step S145 the connection API in the wireless connection is invoked, and the first device is connected to the target device according to the wireless connection configuration.
- the first device may be connected to the wifi of the target device.
- the WifiConfiguration can be called to connect.
- the WifiConfiguration acquires the WifiManager object and creates a WifiConfiguration object based on the WifiManager object. Then, in the WifiConfiguration object, a corresponding type of connection mode is selected according to the wifi encryption type to connect the first device to the wifi of the target device.
- connection type of the corresponding type according to the wifi encryption type, for example:
- GroupCipher is set to WEP40, and finally GroupCipher is set to WEP104;
- different operating systems may have different wireless connection APIs, and the specific connection process is different, which is not limited in this application.
- the method may further include the following steps:
- Step 114 Send an audio connection test signal by using an audio interface, where the audio connection test signal is used to indicate that the connection object of the first device returns an audio response signal.
- the application in order to avoid that the object accessed by the audio interface of the first device is not the target device or the relay device, the application also sends a signal to the outside through the audio interface, which affects the user's use of other devices (such as headphones).
- the application first checks whether the audio interface of the first device is a target device or a relay device. If the audio interface of the first device is connected to the target device or the relay device, the subsequent steps are performed.
- the audio connection test signal is sent out through the audio interface of the first device, where the audio connection test signal is used to indicate that the connection object of the first device returns an audio response signal. Then, if the target device or the relay device of the present application receives the audio connection test signal, the audio connection is The test signal is an audio response signal. If it is not the target device or the relay device of the present application, the audio response signal for the above audio connection test signal will not be returned.
- the application may first construct a connection test instruction similar to “ceshi” ⁇ r ⁇ n, and then modulate “ceshi” ⁇ r ⁇ n into an audio connection test. Signal, and then send the above audio connection test signal through the audio interface.
- Step 116 Detect whether an audio interface receives an audio response signal for the audio connection test signal; if an audio response signal for the audio connection test signal is detected, proceed to step 110; if a test for the audio connection is detected The audio response signal of the signal stops subsequent execution.
- the target device or the relay device demodulates the audio connection test signal by using 2FSK to obtain “ceshi” ⁇ r ⁇ n"
- the instruction is recognized by a simple text protocol, and an audio response signal is returned for the instruction. For example, generate an audio response signal command “ok” ⁇ r ⁇ n, and then “ok” ⁇ r ⁇ n is modulated into an audio response signal by 2FSK, and then return the audio response signal to the audio interface of the first device through the audio line.
- the first device demodulates by using 2FSK to obtain "ok" ⁇ r ⁇ n, then the device is identified by the simple text protocol, and the connection object of the audio interface is confirmed as the target device or Relay device, then step 110 is entered.
- the embodiment of the present application may set a time interval, for example, setting the time interval to 5 seconds. After the audio connection test signal is sent, if the audio response signal for the audio connection test signal is not received within 5 seconds, Then the subsequent execution process is stopped.
- the audio interface pin used by the first device to send the audio connection test signal is similar to the foregoing transmitting the first audio signal
- the audio interface pin used by the first device to receive the audio response signal is similar to the foregoing receiving the second audio signal. I am not here.
- time interval can be set as needed, and the present application does not limit it.
- the user can pull the audio plug out of the audio interface of the first device.
- the first device can obtain the wireless connection authority information of the target device that wants to perform wireless connection through the audio interface, and then automatically connect to the target device according to the wireless connection authority information.
- the user's wireless connection is simple to operate, and does not require the user to memorize and input any wireless connection authority information.
- the wireless connection authority information of the target device is transmitted to the first device within the circuit, and the security is high; again, due to the application range of the audio interface It is wide, so the application scope of this application is also wide and adaptable.
- FIG. 2 a flow chart of steps of a device access method of the present application is shown.
- FIG. 2 corresponds to the embodiment shown in FIG. 1 and is described from the side of the connected target device or the relay device.
- Step 210 Detect whether the first audio signal is received; the first audio signal is used to indicate the wireless connection authority information of the target device; if the first audio signal is detected, the process proceeds to step 220; if the first audio is not detected Signal, no subsequent processing;
- the target device or the relay device in the embodiment of the present application parses and processes the audio signal after receiving the first audio signal sent by the first device for indicating the wireless connection authority information of the acquiring target device. And returning the wireless connection authority information of the target device required by the first device according to the corresponding execution logic.
- an audio signal parsing mechanism consistent with the first device is preset in the target device or the relay device, so that the two sides can communicate normally.
- the audio interface of the first device includes 4 pins: GND (ground line), L (left channel), R (right channel), and MIC (microphone).
- the target device or the relay device four pins are correspondingly arranged, so that the first device and the target device, or the first device and the relay device, can be connected through the audio line and pass through the corresponding pins. receive signal.
- each pin in the target device or the relay device can be implemented by an externally exposed audio interface.
- an audio cable with an audio plug at both ends can be used, and one end of the audio cable is inserted into the audio interface of the first device.
- the other end of the plug is inserted into the audio interface of the target device or the relay device to achieve the connection on both sides.
- the pins of the target device or the relay device can also be combined with the corresponding pins of the audio cable, and the other plug of the audio cable is exposed. At this time, the plug is inserted into the audio interface of the first device to realize the connection on both sides.
- the audio output API is invoked, and the first channel is connected via the audio line through the left channel pin and/or the right channel pin of the audio interface.
- the audio signal is sent.
- the foregoing step 210 includes:
- Sub-step S211 detecting whether the first audio signal is received on the left channel pin and/or the right channel pin.
- the target device or the relay device detects whether the first audio signal is received through the corresponding left channel pin and/or right channel.
- Step 220 Perform processing on the first audio signal to obtain a second audio signal; the second audio signal includes wireless connection authority information of the target device;
- the first audio signal may be processed, and the wireless connection authority information of the target device is acquired according to the indication of acquiring the wireless connection authority information of the target device in the first audio signal to generate a second audio signal.
- the second audio signal includes wireless connection authority information of the target device.
- the first audio signal includes a permission acquisition instruction
- step 220 includes:
- a modulation and mediation mode and an instruction protocol consistent with the first device are adopted.
- the first audio signal including the permission acquisition instruction "getssid:+Equipment info+" ⁇ r ⁇ n is demodulated to obtain “getssid:+Equipment info+” ⁇ r ⁇ n.
- Sub-step S222 acquiring wireless connection authority information of the target device according to the permission acquisition instruction
- the permission obtaining instruction “getssid:+Equipment info+” ⁇ r ⁇ n” identifies the permission obtaining instruction according to the simple text protocol, the corresponding logic is called to obtain the wireless connection right of the target device, corresponding to “getssid:+Equipment info+” ⁇ r ⁇ n”, the ssid and connection password password of the target device are obtained.
- the ssid and the connection password password of the target device are acquired, and the return instruction "ssid+password" ⁇ r ⁇ n" is generated according to the simple text protocol.
- Sub-step S224 modulating the return instruction into a second audio signal.
- the return instruction "ssid+password" ⁇ r ⁇ n" is modulated into 2FS by 2FSK.
- Step 230 Return the second audio signal to the first device, so that the first device wirelessly connects the first device with the target device according to the wireless connection authority information in the second audio signal.
- the second audio signal can be returned from the audio line to the audio interface of the first device.
- step 230 may include the following sub-steps:
- Sub-step S231 the second audio signal is returned to the first device through the microphone pin.
- the first device can receive the audio input through the microphone pin, then the target device or the relay device outputs the second audio signal through its microphone pin, and then is transmitted to the first by the microphone line of the audio line.
- the microphone pin of the device can receive the audio input through the microphone pin, then the target device or the relay device outputs the second audio signal through its microphone pin, and then is transmitted to the first by the microphone line of the audio line.
- the microphone pin of the device can receive the audio input through the microphone pin, then the target device or the relay device outputs the second audio signal through its microphone pin, and then is transmitted to the first by the microphone line of the audio line.
- the first device may, by sub-step S131, invoke the audio input API to receive the second audio signal from the microphone pin of the audio interface.
- the method before step 210, the method further includes:
- Step 202 Detect whether an audio connection test signal is received; the audio connection test signal is used to indicate that the connection object of the first device returns an audio response signal; if the audio connection test signal is detected, proceed to step 204; if not detected Go to the audio connection test signal, and then do not enter the subsequent execution process;
- Step 204 returning an audio response signal for the audio connection test signal.
- the embodiment of the present application demodulates the audio connection test signal to obtain an audio response signal command "ceshi” ⁇ r ⁇ n", then recognize and execute the instruction according to the simple text protocol, generate an audio response signal command "ok” ⁇ r ⁇ n, and then "ok" ⁇ r ⁇ n” is modulated into an audio response signal by 2FSK, and then the audio The response signal is returned to the audio interface of the first device through the audio line.
- the wireless connection authority information may be automatically modified periodically for the target device. For example, modify the connection password in the wireless connection permission information. Then, after each wireless connection permission is modified, the first device automatically disconnects the wireless connection with the target device. In this way, the security of the wireless connection of the target device is enhanced.
- a dynamic password (such as a One-time Password) can be set in the target device to dynamically update the connection password of the target device.
- FIG. 3 there is shown a flow chart of the steps of a device connection method of the present application.
- the audio communication process between the first device and the target device is shown in FIG. 3 on the basis of the embodiment of FIG. 1 and the embodiment of FIG. 2.
- the method may include the following steps:
- Step 310 detecting whether the audio interface of the first device is inserted; if detecting that the audio interface of the first device is If it is inserted, it proceeds to step 312; if it is not detected that the audio interface of the first device is inserted, no subsequent execution process is performed.
- the first device may invoke an API of the corresponding operating system to detect whether the audio interface is inserted. If the audio interface of the first device is plugged in by the plug of the audio cable, then step 312 is entered.
- Step 312 The first device sends a first audio signal to the target device by using the audio interface, where the first audio signal is used to indicate that the wireless connection authority information of the target device is acquired.
- the first device may generate a first audio signal indicating that the wireless connection authority information of the target device is acquired, and then send the first audio signal through the audio interface.
- the first audio signal can then be transmitted to the aforementioned target device over the audio line.
- the first device can invoke an audio output API to transmit a first audio signal to the target device via a left channel pin and/or a right channel pin of the audio interface.
- Step 314 The target device detects whether the first audio signal is received. If the target device detects the first audio signal, the process proceeds to step 316. If the target device does not detect the first audio signal, the subsequent execution process is not performed.
- the audio input API that receives the first audio signal may be customized, and the first audio signal is received according to the audio input API.
- the target device when the target device is a hardware module that processes a common audio signal, such as a mobile phone, a tablet computer, etc., the audio input API in its system can be called to receive the first audio signal.
- the target device can call its system's audio input API corresponding to the target device left channel pin and / or the right channel pin receives the first audio signal.
- Step 316 The target device processes the first audio signal to obtain a second audio signal, where the second audio signal includes wireless connection authority information of the target device.
- the target device acquires wireless connection authority information in the target device according to the first audio signal, and then generates a second audio signal according to the wireless connection authority information;
- the target device may process the first audio signal, obtain the wireless connection authority information of the target device according to the indication of the wireless connection authority information of the target device in the first audio signal to generate the second audio.
- the signal, and thus the second audio signal includes wireless connection authority information of the target device.
- Step 318 The target device returns the second audio signal to the first device.
- the audio output API for transmitting the second audio signal can be customized, and the second audio signal is sent according to the audio output API.
- the target device when the target device is a hardware module that processes a common audio signal, such as a mobile phone or a tablet computer, the audio output API in the system can be called to send the second audio signal.
- the target device can output a second audio signal through its microphone pin, and then the second audio signal is transmitted through the audio line to the microphone pin of the audio interface of the first device.
- Step 320 Receive a second audio signal by using an audio interface of the first device.
- the first device receives the second audio signal including the wireless connection authority information of the target device through the audio interface.
- the first device can invoke an audio input API to receive the second audio signal from a microphone pin of the audio interface.
- Step 322 The first device wirelessly connects the first device with the target device according to the wireless connection authority information in the second audio signal.
- the first device may extract wireless connection authority information from the second audio signal, and then wirelessly connect the first device with the target device according to the wireless connection authority information.
- the first device may invoke a wireless connection API in its operating system, and wirelessly connect the first device with the target device according to the wireless connection authority information.
- the audio communication process between the first device, the relay device and the target device is shown in FIG. 4 on the basis of the embodiment of FIG. 1 and the embodiment of FIG. 2.
- the method may include the following steps:
- Step 410 Detect whether the audio interface of the first device is inserted; if it is detected that the audio interface of the first device is inserted, proceed to step 412; if the audio interface of the first device is not detected, the subsequent execution process is not performed. .
- the first device may invoke an API of the corresponding operating system to detect whether the audio interface is inserted. If the audio interface of the first device is plugged in by the plug of the audio cable, then step 412 is entered.
- Step 412 The first device sends a first audio signal to the relay device by using the audio interface, where the first audio signal is used to indicate that the wireless connection authority information of the target device is acquired.
- the first device may generate a first audio signal indicating that the wireless connection authority information of the target device is acquired, and then send the first audio signal through the audio interface.
- the first audio signal can then be transmitted to the aforementioned target device over the audio line.
- the first device can invoke an audio output API to transmit a first audio signal to the target device via a left channel pin and/or a right channel pin of the audio interface.
- Step 414 the relay device detects whether the first audio signal is received; if the relay device detects the first audio signal, then proceeds to step 416; if the relay device does not detect the first audio signal, the subsequent execution process is not performed;
- an audio input API that receives the first audio signal is customized in the relay device, and the first is received according to the audio input API. audio signal.
- Step 416 The relay device processes the first audio signal to obtain a second audio signal, where the second audio signal includes wireless connection authority information of the target device.
- the relay device acquires wireless connection authority information in the target device according to the first audio signal, and then generates a second audio signal according to the wireless connection authority information;
- the relay device may process the first audio signal, obtain the wireless connection authority information of the target device according to the instruction of acquiring the wireless connection authority information of the target device in the first audio signal to generate the second The audio signal, and thus the second audio signal includes wireless connection authority information of the target device.
- the user can write the wireless connection authority information of the target device to the relay device.
- the wireless connection authority information may also be obtained from the target device by the relay device in real time.
- the manner of obtaining the wireless connection authority information of the target device is not limited in this application.
- Step 418 The relay device returns the second audio signal to the first device.
- the audio output API that transmits the second audio signal may be customized, and the second audio signal is sent according to the audio output API.
- Step 420 Receive a second audio signal by using an audio interface of the first device.
- the first device receives the second audio signal including the wireless connection authority information of the target device through the audio interface.
- the first device can invoke an audio input API to receive the second audio signal from a microphone pin of the audio interface.
- Step 422 The first device wirelessly connects the first device with the target device according to the wireless connection authority information in the second audio signal.
- the first device may extract wireless connection authority information from the second audio signal, and then wirelessly connect the first device with the target device according to the wireless connection authority information.
- FIG. 5 it is a structural block diagram of a device connection apparatus of the present application, which may specifically include the following modules:
- the audio interface insertion detecting module 510 is configured to detect whether an audio interface of the first device is inserted
- the first audio signal sending module 520 is configured to: when detecting that the audio interface of the first device is inserted, send the first audio signal by using the audio interface; the first audio signal is used to indicate that the wireless connection of the target device is acquired Permission information
- a second audio signal receiving module 530 configured to receive a second audio signal by using the audio interface; the second audio signal includes wireless connection authority information of the target device;
- the wireless connection module 540 is configured to wirelessly connect the first device to the target device according to the wireless connection authority information in the second audio signal.
- the device connection device described above is applied to the first device.
- the first audio signal sending module 520 includes:
- a permission acquisition instruction generating module configured to generate a permission acquisition instruction; the permission acquisition instruction is configured to acquire wireless connection authority information of the target device;
- a permission acquisition instruction modulation module configured to modulate the permission acquisition instruction into a first audio signal
- the first sending module is configured to send the first audio signal by an audio interface.
- the first sending module includes:
- a channel pin transmitting module for calling an audio output API to emit the first audio signal through a left channel pin and/or a right channel pin of the audio interface.
- the second audio signal receiving module 530 includes:
- a microphone pin receiving module is configured to call an audio input API to receive the second audio signal from a microphone pin of the audio interface.
- the wireless connection module 540 includes:
- a second audio signal demodulation module configured to demodulate the second audio signal after the first device receives the second audio signal through an audio interface
- a permission extraction module configured to extract wireless connection authority information of the target device from the demodulated result
- the first wireless connection module is configured to wirelessly connect the first device with the target device based on the wireless connection authority information.
- the first wireless connection module includes:
- connection execution module configured to invoke a wireless connection API, and wirelessly connect the first device with the target device according to the wireless connection permission information.
- the method further includes:
- connection test sending module configured to send an audio connection test signal through the audio interface before acquiring the wireless connection authority information of the target device by using the audio interface; the audio connection test signal is used to indicate that the connection object of the first device returns an audio response signal;
- an audio response signal detecting module configured to detect whether an audio interface receives an audio response signal for the audio connection test signal; if an audio response signal for the audio connection test signal is detected, enter to send through the audio interface The step of the first audio signal.
- the wireless connection authority information includes a device identifier and a connection password of the target device.
- FIG. 6 is a structural block diagram of a device access device of the present application, specifically including the following modules:
- the first audio signal receiving module 610 is configured to detect whether the first audio signal is received; the first audio signal is used to indicate that the wireless connection authority information of the target device is acquired;
- the first audio signal processing module 620 is configured to: if the first audio signal is detected, process the first audio signal to obtain a second audio signal; the second audio signal includes wireless connection authority information of the target device;
- a second audio signal returning module 630 configured to return the second audio signal to the first device, so that the first device, according to the wireless connection authority information in the second audio signal, the first device and the target device Make a wireless connection.
- the first audio signal includes a permission acquisition instruction
- the first audio signal processing module 620 includes:
- a first audio signal demodulation module configured to demodulate the received first audio signal to obtain a permission acquisition instruction
- a permission obtaining module configured to acquire wireless connection authority information of the target device according to the permission obtaining instruction
- the instruction generating module configured to generate a return instruction including the wireless connection authority information
- a first returning module configured to modulate the return instruction into a second audio signal.
- the first audio signal is sent by a left channel pin and/or a right channel pin of an audio interface of the first device;
- the first audio signal receiving module 610 includes:
- a pin detection module adapted to detect whether the first audio signal is received on the left channel pin and/or the right channel pin.
- the second audio signal returning module 630 includes:
- a microphone pin return module for returning the second audio signal to the first device via a microphone pin.
- the method further includes:
- connection test detection module configured to detect whether an audio connection test signal is received before detecting whether the first audio signal is received; the audio connection test signal is used to indicate that the connection object of the first device returns an audio response signal;
- the audio response signal returning module is configured to return an audio response signal for the audio connection test signal if the audio connection test signal is detected.
- the wireless connection authority information includes a device identifier and a connection password of the target device.
- the device connection device described above is applied to the target device or the relay device.
- FIG. 7 a structural block diagram of a device access system of the present application is shown, which may specifically include the following modules:
- the first device 710 includes:
- the audio interface insertion detecting module 711 is configured to detect whether an audio interface of the first device is inserted
- the first audio signal sending module 712 is configured to: when detecting that the audio interface of the first device is inserted, send the first audio signal by using the audio interface; the first audio signal is used to indicate that the wireless connection of the target device is acquired. Permission information
- a second audio signal receiving module 713 configured to receive a second audio signal through the audio interface
- the wireless connection module 714 is configured to wirelessly connect the first device to the target device according to the wireless connection authority information in the second audio signal;
- the target device 720 includes:
- the first audio signal receiving module 721 is configured to detect whether the first audio signal is received
- the first audio signal processing module 722 is configured to: if the first audio signal is detected, advance to the first audio signal Row processing, obtaining a second audio signal; the second audio signal includes wireless connection authority information of the target device;
- the second audio signal returning module 723 is configured to return the second audio signal to the first device.
- FIG. 8 it is a structural block diagram of a device access system of the present application, which may specifically include the following modules:
- a first device 810 a relay device 820, and a target device 830;
- the first device 810 includes:
- the audio interface insertion detecting module 811 is configured to detect whether an audio interface of the first device is inserted
- the first audio signal sending module 812 is configured to: when detecting that the audio interface of the first device is inserted, send the first audio signal by using the audio interface; the first audio signal is used to indicate that the wireless connection of the target device is acquired Permission information
- a second audio signal receiving module 813 configured to receive a second audio signal by using the audio interface
- the wireless connection module 814 is configured to wirelessly connect the first device to the target device according to the wireless connection authority information in the second audio signal;
- the relay device package 820 includes:
- the first audio signal receiving module 821 is configured to detect whether the first audio signal is received
- the first audio signal processing module 822 is configured to: if the first audio signal is detected, process the first audio signal to obtain a second audio signal; the second audio signal includes wireless connection authority information of the target device;
- the second audio signal returning module 823 is configured to return the second audio signal to the first device.
- the description is relatively simple, and the relevant parts can be referred to the description of the method embodiment.
- embodiments of the embodiments of the present application can be provided as a method, apparatus, or computer program product. Therefore, the embodiments of the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Moreover, embodiments of the present application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) including computer usable program code.
- computer-usable storage media including but not limited to disk storage, CD-ROM, optical storage, etc.
- the computer device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
- the memory may include non-persistent memory in a computer readable medium, random access memory In the form of a memory (RAM) and/or non-volatile memory, such as a read only memory (ROM) or a flash memory (flash RAM).
- RAM random access memory
- ROM read only memory
- flash RAM flash memory
- Memory is an example of a computer readable medium.
- Computer readable media including both permanent and non-persistent, removable and non-removable media may be implemented by any method or technology for signal storage.
- the signals can be computer readable instructions, data structures, modules of programs, or other data.
- Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory. (ROM), electrically erasable programmable read only memory (EEPROM), flash memory or other memory technology, compact disk read only memory (CD-ROM), digital versatile disk (DVD) or other optical storage,
- PRAM phase change memory
- SRAM static random access memory
- DRAM dynamic random access memory
- RAM random access memory
- ROM read only memory
- EEPROM electrically erasable programmable read only memory
- flash memory or other memory technology
- compact disk read only memory CD-ROM
- DVD digital versatile disk
- a magnetic tape cartridge, magnetic tape storage or other magnetic storage device or any other non-transporting medium can be used to store signals that can be accessed by a computing device.
- computer readable media does not include non-persistent computer readable media, such as modulated data signals and carrier waves.
- Embodiments of the present application are described with reference to flowcharts and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the present application. It will be understood that each flow and/or block of the flowchart illustrations and/or FIG.
- These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processor or other programmable data processing terminal device to produce a machine such that instructions are executed by a processor of a computer or other programmable data processing terminal device
- Means are provided for implementing the functions specified in one or more of the flow or in one or more blocks of the flow chart.
- the computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
- the instruction device implements the functions specified in one or more blocks of the flowchart or in a flow or block of the flowchart.
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Telephonic Communication Services (AREA)
- Telephone Function (AREA)
Abstract
本申请公开了一种设备连接方法和装置、设备接入方法和装置、设备连接系统,涉及计算机技术领域。所述设备连接方法包括:检测第一设备的音频接口是否被插入;若检测到第一设备的音频接口被插入,则通过所述音频接口发送第一音频信号;所述第一音频信号用于指示获取目标设备的无线连接权限信息;通过所述音频接口接收第二音频信号;所述第二音频信号包括目标设备的无线连接权限信息;根据所述第二音频信号中的无线连接权限信息,将所述第一设备与目标设备进行无线连接。本申请减少了用户在将其第一设备连接到目标设备的各种操作步骤,降低了用户操作繁琐程度,并且保密程度高、应用范围广,能够满足广大用户的需求。
Description
本申请要求2015年06月16日递交的申请号为201510334071.X、发明名称为“一种设备连接方法、装置和系统”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本申请涉及计算机技术领域,特别是涉及一种设备连接方法、装置和系统。
随着技术的发展,人们使用移动终端的频率越来越高,在人们使用移动终端的过程中,使用该移动终端与其他设备进行交互,以传输或者获取信息的频率也越来越高。比如某个用户将移动终端通过接入wifi(wireless fidelity,无线保真)设备以访问互联网;又比如某个用户将移动终端通过蓝牙连接接入另外一个用户的移动终端或者其他设备,以传输或者接收数据,比如传输图片、视频、文档等等;又比如,某个用户将移动终端通过OTG(On-The-Go,其是在没有网络节点的情况下,实现设备间的数据传送的技术)连接到另外一个用户的设备,以传输或者接收数据。
而用户的移动终端通过类似前述的各种方式连接到某个设备,存在如下几种连接方式:
其一,由用户在移动终端找到设备标识,输入连接密码进行连接,一般包括如下几个步骤:
(1)用户通过某种渠道获取设备标识及连接密码;
以wifi路由器为例,如果用户A想连接到该wifi路由器,可以从该wifi路由器的设置者处问询wifi路由器的标识和连接密码。其问询的方式可以由多种方式。比如wifi路由器的标识为ABC,密码为123456。
(2)用户在其移动终端上打开相应连接界面,查找相应标识所对应的设备;
比如用户打开手机的wifi的连接界面,在该连接界面中众多wifi路由器标识中查找ABC对应的wifi路由器标识。
(3)用户选择相应的设备,进入相应密码输入界面之后,输入连接密码以进行连接。
比如对前述ABC的wifi路由器标识,用户点击该标识,进入登录界面,然后输入
连接密码,点击连接。如果连接密码正确,则连接到ABC的wifi路由器;如果连接密码不正确,则连接失败。
其二,用户利用移动终端扫描针对设备的二维码与该设备进行连接。
其三,在一些特制移动终端中,加入NFC(Near Field Communication,近距离无线通信)模块,通过NFC模块与设备进行连接。
但是,对于上述第一种连接方式,容易发生由于人为的密码输入错误而导致连接失败;用户的操作繁琐,并且整个过程耗时长;还有由于设备标识和密码是对外界暴露的,在用户获取设备标识和密码时容易被他人盗用。
对于上述第二种连接方式,需要移动终端具备摄像头,并且被连接设备具有显示屏,对摄像头的精度、自动对焦等还有一定要求,用户操作也比较繁琐。
对于上述第三种连接方式,由于很多移动终端都不包含NFC模块,其应用范围狭窄,无法满足需求。
发明内容
鉴于上述问题,提出了本申请实施例以便提供一种克服上述问题或者至少部分地解决上述问题的一种设备连接方法和相应的一种设备连接装置、一种设备接入方法和相应的一种设备接入设备、以及一种设备连接系统。
为了解决上述问题,本申请公开了一种设备连接方法,包括:
检测第一设备的音频接口是否被插入;
若检测到第一设备的音频接口被插入,则通过所述音频接口发送第一音频信号;所述第一音频信号用于指示获取目标设备的无线连接权限信息;
通过所述音频接口接收第二音频信号;所述第二音频信号包括目标设备的无线连接权限信息;
根据所述第二音频信号中的无线连接权限信息,将所述第一设备与目标设备进行无线连接。
本申请还公开了一种设备接入方法,包括:
检测是否接收到第一音频信号;所述第一音频信号用于指示获取目标设备的无线连接权限信息;
若检测到第一音频信号,则针对第一音频信号进行处理,获得第二音频信号;所述第二音频信号包括目标设备的无线连接权限信息;
将所述第二音频信号返回第一设备,以使第一设备根据所述第二音频信号中的无线连接权限信息,将所述第一设备与目标设备进行无线连接。
本申请还公开了,一种设备连接装置,包括:
音频接口插入检测模块,用于检测第一设备的音频接口是否被插入;
第一音频信号发送模块,用于在检测到第一设备的音频接口被插入时,则通过所述音频接口发送第一音频信号;所述第一音频信号用于指示获取目标设备的无线连接权限信息;
第二音频信号接收模块,用于通过所述音频接口接收第二音频信号;所述第二音频信号包括目标设备的无线连接权限信息;
无线连接模块,用于根据所述第二音频信号中的无线连接权限信息,将所述第一设备与目标设备进行无线连接。
本申请还公开了,一种设备接入装置,包括:
第一音频信号接收模块,用于检测是否接收到第一音频信号;所述第一音频信号用于指示获取目标设备的无线连接权限信息;
第一音频信号处理模块,用于若检测到第一音频信号,则针对第一音频信号进行处理,获得第二音频信号;所述第二音频信号包括目标设备的无线连接权限信息;
第二音频信号返回模块,用于将所述第二音频信号返回第一设备,以使第一设备根据所述第二音频信号中的无线连接权限信息,将所述第一设备与目标设备进行无线连接。
本申请还公开了,一种设备连接系统,包括:
第一设备和目标设备;
所述第一设备包括:
音频接口插入检测模块,用于检测第一设备的音频接口是否被插入;
第一音频信号发送模块,用于在检测到第一设备的音频接口被插入时,则通过所述音频接口发送第一音频信号;所述第一音频信号用于指示获取目标设备的无线连接权限信息;
第二音频信号接收模块,用于通过所述音频接口接收第二音频信号;
无线连接模块,用于根据所述第二音频信号中的无线连接权限信息,将所述第一设备与目标设备进行无线连接;
所述目标设备包括:
第一音频信号接收模块,用于检测是否接收到第一音频信号;
第一音频信号处理模块,用于若检测到第一音频信号,则针对第一音频信号进行处理,获得第二音频信号;所述第二音频信号包括目标设备的无线连接权限信息;
第二音频信号返回模块,用于将所述第二音频信号返回第一设备。
本申请还公开了,一种设备连接系统,包括:
第一设备、中继设备和目标设备;
所述第一设备包括:
音频接口插入检测模块,用于检测第一设备的音频接口是否被插入;
第一音频信号发送模块,用于在检测到第一设备的音频接口被插入时,则通过所述音频接口发送第一音频信号;所述第一音频信号用于指示获取目标设备的无线连接权限信息;
第二音频信号接收模块,用于通过所述音频接口接收第二音频信号;
无线连接模块,用于根据所述第二音频信号中的无线连接权限信息,将所述第一设备与目标设备进行无线连接;
所述中继设备包括:
第一音频信号接收模块,用于检测是否接收到第一音频信号;
第一音频信号处理模块,用于若检测到第一音频信号,则针对第一音频信号进行处理,获得第二音频信号;所述第二音频信号包括目标设备的无线连接权限信息;
第二音频信号返回模块,用于将所述第二音频信号返回第一设备。
与背景技术相比,本申请实施例包括以下优点:
本申请实施例中,第一设备直接通过音频接口获取目标设备的无线连接权限信息,比如获取无线路由器的设备标识和连接密码,然后自动根据获取到的无线连接设备的无线连接权限信息,将第一设备与目标设备进行无线连接。首先,上述过程减少了用户在将其第一设备连接到目标设备的各种操作步骤,降低了用户操作繁琐程度;其次,上述过程通过音频快速获取目标设备的无线连接密码然后自动登录,其执行过程快,无线连接的耗用时间短;其次,目标设备的无线连接权限信息是在目标设备、第一设备之间内部传输,用户无需通过暴露的环境获取无线连接权限信息,保密程度高;再次,无需用户进行输入操作,不会因为用户的输入错误而导致密码连接失败;最后,由于目前市场中,绝大部分的第一设备(如手机、平板电脑、智能手环、智能手表等终端)都具备音频接口,因而本申请应用范围广,能够满足广大用户的需求。
图1是本申请的一种设备连接方法实施例的步骤流程图;
图2是本申请对应图1的一种设备接入方法实施例的步骤流程图;
图3是本申请第一设备直接连接目标设备的环境下的一种设备连接方法实施例的步骤流程图;
图4是本申请第一设备通过中继设备连接目标设备的环境下的一种设备连接方法实施例的步骤流程图;
图5是本申请的本申请的一种设备连接装置实施例的结构框图;
图6是本申请对应图5的一种设备接入装置实施例的结构框图;
图7是本申请一种设备连接系统实施例的结构框图;
图8是本申请另一种设备连接系统实施例的结构框图。
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员所获得的所有其他实施例,都属于本申请保护的范围。
本申请的核心思想之一在于,对于用户使用具备音频接口的第一设备,当其想要将第一设备与目标设备进行无线连接时,通过第一设备的音频接口连接到目标设备或者中继设备中,通过音频信号指示目标设备或者中继设备去获取目标设备的无线连接权限信息,然后第一设备即可自动根据该无线连接权限信息与目标设备进行无线连接。节省用户的操作步骤,提高连接速度,提高目标设备无线连接权限信息的安全性。
需要说明的是,在本申请实施例中,上述第一设备包括移动终端,上述移动终端是指可以在移动中使用的计算机设备,广义的讲包括手机、笔记本、平板电脑、POS(point of sale,销售终端)机、车载电脑等。
上述目标设备包括具备无线接入功能的设备,比如提供wifi的无线路由器,可以设置为wifi热点的移动终端,可以提供蓝牙连接、红外线连接接入功能的移动终端等。
上述中继设备为第一设备和目标设备之间的设备,可以独立于目标设备,由中继设备获取目标设备的无线连接权限信息;上述中继设备与第一设备直接进行音频通信,将无线连接权限信息返回第一设备。
参照图1,其示出了本申请的一种设备连接方法的步骤流程图。
图1所示实施例从发起连接的第一设备一侧进行描述,具体可以包括如下步骤:
步骤110,检测第一设备的音频接口是否被插入;如果检测到第一设备的音频接口被插入,则进入步骤120;如果未检测到第一设备的音频接口被插入,则不进行后续执行过程。
可以理解,在本申请实施例中,上述第一设备具备音频接口,对于音频接口,常见的包括四个引脚:GND(地底线)、L(左声道)、R(右声道)和MIC(麦克风)。
可以理解,本申请实施例中对音频接口的孔径不进行任何限制,音频接口为任意孔径皆可应用本申请实施例的技术方案。比如3.5毫米孔径的音频接口,2.5毫米孔径的音频接口,或者其他孔径的音频接口,本申请实施例不做限制。
在实际应用中,检测音频接口是否被插入是通过检测GND和MIC之间的阻抗是否为指定值,当GND和MIC之间的阻抗达到指定值,则确认音频接口被插入。上述指定值比如现在通用手机的阻抗设置的4.99K,当然也可根据终端的需要设置其他值。
在实际应用中,可以调用相应操作系统的API去检测音频接口是否被插入。具体调用的API随操作系统的不同而有不同,本申请不对其加以限制。比如对于Android系统,可以调用HeadsetObserver检测音频接口是否被插入。
在本申请实施例中,检测的是第一设备的音频接口是否被音频线的音频接头插入。然后第一设备可以通过音频线连接到目标设备获取无线连接权限信息,或者第一设备可以通过音频线连接到中继设备,由中继设备去获取目标设备的连接权限。
其中,在本申请实施例中,本申请的执行逻辑可通过多种形式预置在第一设备中。比如对于手机、平板等移动终端,可通过APP应用的形式安装到移动终端的系统中。也可以将本申请的执行逻辑在第一设备上市之前直接写入第一设备的操作系统中。那么用户在第一设备中启动本申请的执行逻辑,比如打开相应APP应用之后,即可检测第一设备的音频接口是否被插入。
那么,当用户将音频插头插入第一设备的音频接口后,则检测第一设备的音频接口被插入,然后即可进入步骤120。
步骤120,通过所述音频接口发送第一音频信号;所述第一音频信号用于指示获取目标设备的无线连接权限信息;
在检测到音频接口被插入之后,则可以生成用于指示获取目标设备的无线连接权限信息的第一音频信号,然后将该第一音频信号通过音频接口发出。然后该第一音频信号
可通过音频线传输到前述目标设备或者前述中继设备。
可以理解,上述目标设备或者说中继设备预置了相应的用于处理音频信号的模块,对接收到的各种音频信号进行解析,执行相应动作以获取目标设备的无线连接权限信息,然后返回包括无线连接权限信息的第二音频信号。
可以理解,上述目标设备的无线连接权限信息包括目标设备的设备标识和连接密码。比如对于无线路由器,上述无线连接权限信息包括ssid(Service Set Identifier,服务集标识)和wifi的连接密码。比如对于设置为无线热点的手机,上述无线连接权限信息包括手机的设备标识和无线热点的连接密码。比如对于手机的蓝牙连接,无线连接权限信息包括手机设备标识以及蓝牙连接的连接密码。
当然,上述无线连接权限信息也可采用其他信息,只要是第一设备无线连接目标设备时所需要的信息即可,本申请不对其加以限制。
在本申请的一个实施例中,步骤120可以包括如下子步骤:
子步骤S121,生成权限获取指令;所述权限获取指令用于获取目标设备的无线连接权限信息;
在确定音频接口被插入之后,本申请即可生成权限获取指令,该权限获取指令用于获取目标设备的无线连接权限信息。
本申请可以采用各种协议构建权限获取指令,在第一设备和目标设备,或者第一设备和中继设备之间采用一套协议。
在具体实现中,以简单文本协议为例,本申请可以在确定音频接口被插入后,根据简单文本协议构造权限获取指令。其简单文本协议构造的指令格式如“数据内容为字符串明文“\r\n”,其中以\r\n作为命令或音频响应信号的结束。比如获取路由器的ssid和连接密码,构造的权限获取指令为“getssid:+Equipment info+“\r\n”。
当然,在此仅以简单文本协议为例,本申请还可采用其他协议,本申请不对其加以限制。
子步骤S122,将所述权限获取指令调制为第一音频信号;
然后对于前述生成的权限获取指令,即可将其调制为第一音频信号。如此,第一音频信号也可以理解为用于指示获取目标设备的无线连接权限信息。
由于音频接口和音频线传输的是音频信号,其是波形的信号。而在权限获取指令本身是数字信号,那么需要将数字信号调制为音频信号,才能通过音频线传输给目标设备或者中继设备。
在具体实现中,,将数字信号调制为音频信号,将音频信号解调为数字信号,可以采用2FSK(2binary frequency shift keying,二进制频移键控)的方式进行调制解调。2FSK就是用二进制里的0、1来控制载波的频率,从而达到通信的目的。例如:用1ms(微米)长、1KHz(千赫兹)的正弦信号来代表二进制里的1;用1ms长、2KHz的正弦来代表二进制里的0;那一连串的1KHz、2KHz的信号解调出来就是一连串的0和1。那么在本申请中可以根据需要设置x微米长,y千赫兹的正弦信号代表2进制里的1;设置m微米长,n千赫兹的正弦信号代表2进制里的0。
当然,具体的调制解调方式还可以采用其他方式,本申请不对其加以限制。
那么在步骤S122中,本申请将权限获取指令采用2FSK的方式调制为第一音频信号。
如前述简单文本协议的权限获取指令为“getssid:+Equipment info+“\r\n”,由于简单文本协议采用的字符为ASCII表(American Standard Code for Information Interchange,美国标准信息交换代码)中的字符,而ASCII表的字符在底层都有一个一一对应的二进制代码,那么对于“getssid:+Equipment info+“\r\n”,其实质对应一连串的二进制代码,将上述一连串的二进制代码通过2FSK可以调制为波形信号,即第一音频信号。
子步骤S123,将所述第一音频信号由音频接口发出。
然后即可通过音频接口传输到音频线,再通过音频线传输到目标设备或者中继设备。
在本申请的一个实施例中,子步骤S123可以包括如下子步骤:
子步骤S124,调用音频输出API,通过音频接口的左声道引脚和/或右声道引脚,将上述第一音频信号发出。
在实际应用中,可以调用相应操作系统的API(Application Program Interface,应用程序编程接口)去检测音频接口是否被插入。具体调用的API随操作系统的不同而有不同,本申请不对其加以限制。以Android系统为例,可以调用AudioTrack将上述第一音频信号从音频接口输出。然后第一音频信号沿着音频线就输送到目标设备或者中继设备。当然不同的操作系统,其调用的音频输出API也可能不同,本申请不对其加以限制。
对于第一音频信号的输出,可以只是以左声道引脚传输,也可以只使用右声道引脚传输,也可以两者结合进行传输,本申请不对其加以限制。
可以理解,应用本实施例,可以预先在上述目标设备或者说中继设备设置相应的处理音频信号的模块,设置相同的通信协议,以及在相应的通信协议下,对不同指令预置相应的处理逻辑。
比如都预置了2FSK和简单文本协议的处理音频信号的模块,在目标设备侧预置了
对指令权限获取指令的处理逻辑,那么对于前述转换后的对应“getssid:+Equipment info+“\r\n”的第一音频信号。先将第一音频信号采用2FSK解调为一系列二进制代码,然后将该一系列二进制代码从头部与ASCII表进行匹配,转换即得到“getssid:+Equipment info+“\r\n”,目标设备或中继设备识别该指令为获取目标设备的ssid和连接密码,则执行该指令,获取目标设备的ssid和连接密码,再将ssid和连接密码调制为第二音频信号通过音频线返回第一设备。
在本申请实施例中,目标设备或者中继设备在获取到无线连接权限信息之后,会基于该无线连接权限信息生成返回指令,然后将该返回指令调制为第二音频信号返回第一设备。
如前述简单文本协议和2FSK机制下路由器的例子,可将获取到的ssid和连接密码,构造为返回指令“ssid+password“\r\n”的形式,然后再对“ssid+password“\r\n”以前述相同的机制采用2FSK调制为第二音频信号,再将第二音频信号返回第一设备。
在本申请实施例中,目标设备或中继设备返回的第二音频信号可通过麦克风引脚返回的,第二音频信号然后通过音频线中的麦克风线返回第一设备。
步骤130,通过所述音频接口接收第二音频信号;所述第二音频信号包括目标设备的无线连接权限信息;
第一设备则通过音频接口接收第二音频信号,该第二音频信号则包括了目标设备的无线连接权限信息。
在本申请的一个实施例中,步骤130可以包括如下子步骤:
子步骤S131,调用音频输入API,从音频接口的麦克风引脚中接收所述第二音频信号。
在实际应用中,可以调用相应操作系统的API从音频接口的麦克风引脚中接收上述第二音频信号。具体调用的API随操作系统的不同而有不同,本申请不对其加以限制。以Android系统为例,可以调用AudioRecordk从音频接口的麦克风引脚中接收上述第二音频信号。
步骤140,根据所述第二音频信号中的无线连接权限信息,将所述第一设备与目标设备进行无线连接。
由于第二音频信号中包括了目标设备的连接权限信息,本步骤则可从第二音频信号中提取无线连接权限信息,然后在根据该无线连接权限信息,将苏颂第一设备与目标设备进行无线连接。
在本申请的一个实施例中,步骤140可以包括如下子步骤:
子步骤S141,所述第一设备通过音频接口接收到所述第二音频信号之后,解调所述第二音频信号;
对于目标设备或者中继设备返回的第二音频信号,本申请则可采用相应的解调机制对第二音频信号进行解调。
如前述的包括回指令“ssid+password“\r\n”的第二音频信号,采用2FSK对第二音频信号进行解调,得到一系列二进制码,再将该一系列二进制码从头部与ASCII表进行匹配,转换即得到“ssid+password“\r\n”。
子步骤S142,从解调后的结果中,提取目标设备的无线连接权限信息;
如前述的解调后的结果“ssid+password“\r\n”中,可以提取无线连接权限信息ssid和password。
子步骤S143,基于所述无线连接权限信息,将所述第一设备与目标设备进行无线连接。
以前述无线连接权限信息ssid和password为例,得到该无线连接权限信息之后,即可将第一设备连入前述无线路由器的wifi中。
在本申请的一个实施例中,子步骤S143可以包括如下子步骤:
子步骤S144,用无线连接API,根据所述无线连接权限信息将第一设备与目标设备进行无线连接;
在实际应用中,无论是wifi、蓝牙连接还是红外线连接,均需要目标设备的设备标识和连接密码之后,第一设备的相应wifi模块、蓝牙连接模块或者红外线连接模块才能向目标设备发送正确的连接请求,使第一设备和目标设备可以成功连接。
对于前述无线路由器的连接,第一设备以Android系统为例,在第一设备中可调用WifiConfiguration,根据上述无线连接权限信息将第一设备与目标设备进行无线连接。
在本申请的一个实施例中,子步骤S144可以包括如下子步骤:
子步骤S144,调用无线连接API中的无线配置API,根据所述无线连接权限信息进行无线连接配置;
第一设备以Android系统为例,在连接前述无线路由器的wifi时,其调用WifiManager在第一设备中进行wifi热点配置。
上述WifiManager首先获取WifiManager对象,然后在该WifiManager对象中进行如下配置:
(1)配置wifi热点的类,如WifiConfiguration apConfig=new WifiConfiguration();
(2)配置wifi热点的名称,如apConfig.SSID="YRCCONNECTION";
(3)配置热点的密码,如apConfig.preSharedKey="password";
(4)通过反射调用以设置wifi热点,并确定wifi加密类型,如Method method=wifiManager.getClass().getMethod(
"setWifiApEnabled",WifiConfiguration.class,Boolean.TYPE);
(5)返回热点打开状态,如return(Boolean)method.invoke(wifiManager,apConfig,true);如此,wifi热点在第一设备中配置完毕。
子步骤S145,调用无线连接中的连接API,根据所述无线连接配置,将第一设备连接到目标设。
在前述wifi热点在第一设备中配置完毕,则可将第一设备连接到目标设备的wifi中。
以前述第一设备以Android系统为例,将第一设备连接到目标设备的wifi中时,可调用WifiConfiguration进行连接。
在进行wifi连接时,WifiConfiguration获取WifiManager对象后,以WifiManager对象为基准创建WifiConfiguration对象。然后在WifiConfiguration对象中根据wifi加密类型选择相应类型的连接方式,以将第一设备连接到目标设备的wifi中。
在WifiConfiguration对象中根据wifi加密类型选择相应类型的连接方式比如:
(1)Type=1,表示wifi没有设置密码,则在WifiConfiguration对象中按序进行如下操作:
将KeyMgmt字段设置为NONE;
将wepTxKeyIndex字段设置为0;
可将上述设置添加到wifi列表;
执行WifiConfiguration中的函数wifiManager.enableNetwork(wcgID,true)即可连接到目标设备的wifi。
(2)Type=2,表示wifi为WEP加密类型,则在WifiConfiguration对象中按序进行如下操作:
将config.SSID字段设置为连接密码设备标识;
将config.wepKeys字段设置为连接密码password;将AuthAlgorithm字段设置为SHARED;
将GroupCipher设置为CCMP,再将GroupCipher设置为TKIP;
GroupCipher设置为WEP40,最后GroupCipher设置将WEP104;
将KeyMgmt设置为NONE;将wepTxKeyIndex字段设置为0;
将上述设置添加到wifi列表;
执行WifiConfiguration中的函数wifiManager.enableNetwork(wcgID,true)即可连接到目标设备的wifi。
(3)Type=3,表示wifi为WPA加密类型,则在WifiConfiguration对象中按序进行如下操作:
将config.SSID字段设置为连接密码设备标识;
将config.wepKeys字段设置为连接密码password;
将AuthAlgorithm字段设置为OPEN;
将GroupCipher字段设置为TKIP;
将KeyMgmt字段设置为WPA_PSK;
将Protocol设置为WPA;
将GroupCipher字段设置为CCMP;
将PairwiseCipher字段设置为CCMP;
将status字段设置为ENABLED;
将上述设置添加到wifi列表;最后执行WifiConfiguration中的函数wifiManager.enableNetwork(wcgID,true)即可连接到目标设备的wifi。
当然,对于第一设备来说,不同的操作系统,其调用的无线连接API可能不同,具体的连接过程也不同,本申请不对其加以限制。
在本申请的一种优选实施例中,步骤120之前可以还包括如下步骤:
步骤114,通过音频接口发送音频连接测试信号;所述音频连接测试信号用于指示第一设备的连接对象返回音频响应信号;
在本申请实施例中,为了避免由于第一设备的音频接口接入的对象不是目标设备或者中继设备,本申请还通过音频接口向外发送信号,影响用户对其他设备(比如耳机)的使用,本申请首先检查第一设备的音频接口连接的是否为目标设备或中继设备,如果第一设备的音频接口连接的是目标设备或中继设备,则进入后续步骤。
在本申请实施例中,通过第一设备的音频接口向外发送音频连接测试信号,其中,上述音频连接测试信号用于指示第一设备的连接对象返回音频响应信号。那么,如果是本申请的目标设备或者中继设备接收到上述音频连接测试信号,则会针对上述音频连接
测试信号进行音频响应信号。如果不是本申请的目标设备或中继设备,则不会返回针对上述音频连接测试信号进行音频响应信号。
在具体实现中,以前述简单文本协议和2FSK机制为例,本申请可先构造类似“ceshi“\r\n”的连接测试指令,然后将“ceshi“\r\n”调制为音频连接测试信号,再将上述音频连接测试信号通过音频接口发出。
步骤116,检测音频接口是否接收到针对所述音频连接测试信号的音频响应信号;如果检测到针对所述音频连接测试信号的音频响应信号,则进入步骤110;如果检测到针对所述音频连接测试信号的音频响应信号,则停止后续执行过程。
在具体实现中,如前述例子,目标设备或者中继设备接收到包括“ceshi“\r\n”的音频连接测试信号后,先采用2FSK解调该音频连接测试信号,得到“ceshi“\r\n”,采用简单文本协议识别该指令,则会针对该指令返回一个音频响应信号。比如,生成音频响应信号指令“ok“\r\n”,再将“ok“\r\n”采用2FSK调制为音频响应信号,再将该音频响应信号通过音频线返回第一设备的音频接口。
第一设备在音频接口接收到上述音频响应信号之后,采用2FSK进行解调,获得“ok“\r\n”,那么通过简单文本协议识别该指令,就确认音频接口的连接对象为目标设备或者中继设备,那么可进入步骤110。
在具体实现中,本申请实施例可以设置一个时间间隔,比如设置时间间隔为5秒,在音频连接测试信号发出之后,如果5秒之内未接收到针对上述音频连接测试信号的音频响应信号,则停止后续执行过程。
可以理解第一设备发送音频连接测试信号采用的音频接口引脚与前述发送第一音频信号类似,第一设备接收音频响应信号所采用的音频接口引脚与前述接收第二音频信号类似。在此不在赘叙。
当然上述时间间隔可以根据需要进行设置,本申请不对其加以限制。
在第一设备与目标设备无线连接上之后,用户即可将音频插头从第一设备的音频接口中拔出。
通过本发明实施例,第一设备可以通过音频接口获取到其想要进行无线连接的目标设备的无线连接权限信息,然后自动根据无线连接权限信息与目标设备进行无线连接。用户的无线连接的操作简单,不需用户记忆和输入任何无线连接权限信息;其次,目标设备的无线连接权限信息在电路内部传输给第一设备,安全性高;再次,由于音频接口的应用范围广泛,从而本申请的应用范围也很广泛,适配性强。
需要说明的是,对于方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本申请实施例并不受所描述的动作顺序的限制,因为依据本申请实施例,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作并不一定是本申请实施例所必须的。
参照图2,其示出了本申请的一种设备接入方法的步骤流程图。
图2所示实施例对应图1所示实施例,从被连接的目标设备或中继设备一侧进行描述,具体可以包括如下步骤:
步骤210,检测是否接收到第一音频信号;所述第一音频信号用于指示获取目标设备的无线连接权限信息;若检测到第一音频信号,则进入步骤220;若未检测到第一音频信号,则不进行后续处理;
可以理解,本申请实施例的目标设备或者中继设备在接收到由第一设备发送的用于指示获取目标设备的无线连接权限信息的第一音频信号之后,会在对音频信号进行解析和处理,并根据相应执行逻辑返回第一设备所需求的目标设备的无线连接权限信息。
本申请实施例中,在目标设备或中继设备中会预置与第一设备一致的音频信号解析机制,使两侧可以正常进行通信。
由于第一设备的音频接口包括4个引脚:GND(地底线)、L(左声道)、R(右声道)和MIC(麦克风)。
可以理解,相应的在目标设备或者中继设备中,对应设置4个引脚,使第一设备和目标设备,或者第一设备和中继设备,可以通过音频线进行连接,并通过相应引脚接收信号。
当然,目标设备或者中继设备中的各引脚可以对外暴露的音频接口实现,此时,则可用两端均为音频插头的音频线,该音频线其中一端插头插入第一设备的音频接口,另一端插头插入目标设备或中继设备的音频接口,实现两侧的连接。目标设备或中继设备的各引脚也可与音频线相应引脚合在一起,音频线的另外一个插头暴露在外,此时,该插头插入第一设备的音频接口,实现两侧的连接。
在本申请的一个实施例中,对应于图1实施例的子步骤S124,调用音频输出API,通过音频接口的左声道引脚和/或右声道引脚,经由音频线将上述第一音频信号发出。在本申请实施例中,上述步骤210包括:
子步骤S211,在左声道引脚和/或右声道引脚检测是否接收到第一音频信号。
可以理解,目标设备或者中继设备则通过相应的左声道引脚和/或右声道引检测是否接收到第一音频信号。
步骤220,针对第一音频信号进行处理,获得第二音频信号;所述第二音频信号包括目标设备的无线连接权限信息;
在获得第一音频信号之后,即可对第一音频信号进行处理,根据第一音频信号中获取目标设备的无线连接权限信息的指示,获取目标设备的无线连接权限信息以生成第二音频信号,从而,上述第二音频信号包括了目标设备的无线连接权限信息。
在本申请的一个实施例中,如图1实施例中的,述第一音频信号中包括权限获取指令;
相应的,上述步骤220包括:
子步骤S221,对接收到的所述第一音频信号进行解调,获得权限获取指令;
在具体实现中,采用与第一设备一致的调制调解方式和指令协议。如图1实施例中使用的2FSK和简单文本协议。那么对于包括权限获取指令“getssid:+Equipment info+“\r\n”的第一音频信号进行解调,获得“getssid:+Equipment info+“\r\n”。
子步骤S222,根据所述权限获取指令,获取目标设备的无线连接权限信息;
如前述权限获取指令“getssid:+Equipment info+“\r\n”,根据简单文本协议识别该权限获取指令,则调用相应逻辑获取目标设备的无线连接权限。对应于“getssid:+Equipment info+“\r\n”,则获取目标设备的ssid和连接密码password。
子步骤S223,生成包括所述无线连接权限信息的返回指令;
如前述例子,在获取到目标设备的ssid和连接密码password,根据简单文本协议生成返回指令“ssid+password“\r\n”。
子步骤S224,将所述返回指令调制为第二音频信号。
如前述例子,将返回指令“ssid+password“\r\n”采用2FSK调制为第二音频信号。
步骤230,将所述第二音频信号返回第一设备,以使第一设备根据所述第二音频信号中的无线连接权限信息,将所述第一设备与目标设备进行无线连接。
在目标设备或者中继设备生成第二音频信号之后,即可将第二音频信号由音频线返回第一设备的音频接口中。
在本申请的一个实施例中,步骤230可以包括如下子步骤:
子步骤S231,通过麦克风引脚将所述第二音频信号返回第一设备。
在一种情况下,第一设备可通过麦克风引脚接收音频输入的,那么目标设备或者中继设备则将第二音频信号通过其麦克风引脚输出,然后由音频线的麦克风线传输到第一设备的麦克风引脚。
进而,第一设备则可通过子步骤S131,调用音频输入API,从音频接口的麦克风引脚中接收上述第二音频信号。
在本申请的一个实施例中,在步骤210之前还包括:
步骤202,检测是否接收到音频连接测试信号;所述音频连接测试信号用于指示第一设备的连接对象返回音频响应信号;若检测到所述音频连接测试信号,则进入步骤204;若未检测到所述音频连接测试信号,则不进入后续执行过程;
步骤204,返回针对所述音频连接测试信号的音频响应信号。
如前述步骤116中,第一设备发送的包括“ceshi“\r\n”的音频连接测试信号之后,本申请实施例则解调音频连接测试信号,获得音频响应信号指令“ceshi“\r\n”,然后根据简单文本协议识别并执行该指令,生成音频响应信号指令“ok“\r\n”,再将“ok“\r\n”采用2FSK调制为音频响应信号,再将该音频响应信号通过音频线返回第一设备的音频接口。
另外,在本申请实施例中,对于目标设备,还可自动定时修改无线连接权限信息。比如修改无线连接权限信息中的连接密码。那么每次无线连接权限修改后,第一设备则自动断开与目标设备的无线连接。如此,加强了目标设备的无线连接的安全性。
在实际应用中,可以在目标设备中设置动态口令(如One-time Password),动态更新目标设备的连接密码。
需要说明的是,对于方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本申请实施例并不受所描述的动作顺序的限制,因为依据本申请实施例,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作并不一定是本申请实施例所必须的。
参照图3,其示出了本申请的一种设备连接方法的步骤流程图。
为了更为直观的描述本申请实施例,在图1实施例与图2实施例的基础上,以图3示出第一设备与目标设备音频通信过程。其具体可以包括如下步骤:
步骤310,检测第一设备的音频接口是否被插入;若检测到第一设备的音频接口被
插入,则进入步骤312;如果未检测到第一设备的音频接口被插入,则不进行后续执行过程。
在实际应用中,第一设备可以调用相应操作系统的API去检测音频接口是否被插入。如果第一设备的音频接口被音频线的插头插入,则进入步骤312。
步骤312,第一设备通过所述音频接口发送第一音频信号到目标设备;所述第一音频信号用于指示获取目标设备的无线连接权限信息;
第一设备在检测到音频接口被插入之后,则可以生成用于指示获取目标设备的无线连接权限信息的第一音频信号,然后将该第一音频信号通过音频接口发出。然后该第一音频信号可通过音频线传输到前述目标设备。
在本申请的一种情况中,第一设备可以调用音频输出API,通过音频接口的左声道引脚和/或右声道引脚,将第一音频信号发送到上述目标设备。
步骤314,目标设备检测是否接收到第一音频信号;若目标设备检测到第一音频信号,则进入步骤316;若目标设备未检测到第一音频信号,则不进行后续执行过程;
在本申请的一种情况中,当目标设备为路由器等需要额外预置处理音频信号的硬件模块时,可以自定义接收第一音频信号的音频输入API,根据该音频输入API接收第一音频信号。
在本申请的另一种情况中,当目标设备为手机、平板电脑等已存在通用的处理音频信号的硬件模块时,可以调用其系统中的音频输入API接收第一音频信号。特别对于第一设备通过其音频接口的左声道引脚和/或右声道引脚发送第一音频信号时,目标设备可以调用其系统的音频输入API相应在目标设备左声道引脚和/或右声道引脚接收第一音频信号。
步骤316,目标设备针对第一音频信号进行处理,获得第二音频信号;所述第二音频信号包括目标设备的无线连接权限信息;
在本申请实施例中,目标设备根据第一音频信号,获取目标设备本身中的无线连接权限信息,然后再根据无线连接权限信息生成第二音频信号;
目标设备在获得第一音频信号之后,即可对第一音频信号进行处理,根据第一音频信号中获取目标设备的无线连接权限信息的指示,获取目标设备的无线连接权限信息以生成第二音频信号,从而,上述第二音频信号包括了目标设备的无线连接权限信息。
步骤318,目标设备将所述第二音频信号返回第一设备;
在本申请的一种情况中,当目标设备为路由器等需要额外预置处理音频信号的硬件
模块时,可以自定义发送第二音频信号的音频输出API,根据该音频输出API送第二音频信号。
在本申请的另一种情况中,当目标设备为手机、平板电脑等已存在通用的处理音频信号的硬件模块时,可以调用其系统中的音频输出API送第二音频信号。目标设备可以通过其麦克风引脚输出第二音频信号,然后第二音频信号通过音频线传输到第一设备的音频接口的麦克风引脚。
步骤320,通过第一设备的音频接口接收第二音频信号;
第一设备则通过音频接口,接收包括了目标设备的无线连接权限信息的第二音频信号。
在本申请的一种情况中,第一设备可调用音频输入API,从音频接口的麦克风引脚中接收所述第二音频信号。
步骤322,第一设备根据所述第二音频信号中的无线连接权限信息,将所述第一设备与目标设备进行无线连接。
第一设备可从第二音频信号中提取无线连接权限信息,然后在根据该无线连接权限信息,将苏颂第一设备与目标设备进行无线连接。
在具体应用中,第一设备可以调用其操作系统中的无线连接API,根据所述无线连接权限信息将第一设备与目标设备进行无线连接。
图3所示实施例各步骤执行原理与图1和图2所描述的相应步骤的原理类似,其对各种音频信号的处理、传输等过程原理类似,在此不再赘叙。
参照图4,其示出了本申请的一种设备连接方法的步骤流程图。
为了更为直观的描述本申请实施例,在图1实施例与图2实施例的基础上,以图4示出第一设备、中继设备与目标设备音频通信过程。其具体可以包括如下步骤:
步骤410,检测第一设备的音频接口是否被插入;若检测到第一设备的音频接口被插入,则进入步骤412;如果未检测到第一设备的音频接口被插入,则不进行后续执行过程。
在实际应用中,第一设备可以调用相应操作系统的API去检测音频接口是否被插入。如果第一设备的音频接口被音频线的插头插入,则进入步骤412。
步骤412,第一设备通过所述音频接口发送第一音频信号到中继设备;所述第一音频信号用于指示获取目标设备的无线连接权限信息;
第一设备在检测到音频接口被插入之后,则可以生成用于指示获取目标设备的无线连接权限信息的第一音频信号,然后将该第一音频信号通过音频接口发出。然后该第一音频信号可通过音频线传输到前述目标设备。
在本申请的一种情况中,第一设备可以调用音频输出API,通过音频接口的左声道引脚和/或右声道引脚,将第一音频信号发送到上述目标设备。
步骤414,中继设备检测是否接收到第一音频信号;若中继设备检测到第一音频信号,则进入步骤416;若中继设备未检测到第一音频信号,则不进行后续执行过程;
在本申请的一种情况中,在中继设备中预置处理音频信号的硬件模块时,在该中继设备中自定义接收第一音频信号的音频输入API,根据该音频输入API接收第一音频信号。
步骤416,中继设备针对第一音频信号进行处理,获得第二音频信号;所述第二音频信号包括目标设备的无线连接权限信息;
在本申请实施例中,中继设备根据第一音频信号,获取目标设备本身中的无线连接权限信息,然后再根据无线连接权限信息生成第二音频信号;
中继设备在获得第一音频信号之后,即可对第一音频信号进行处理,根据第一音频信号中获取目标设备的无线连接权限信息的指示,获取目标设备的无线连接权限信息以生成第二音频信号,从而,上述第二音频信号包括了目标设备的无线连接权限信息。
在实际应用中,用户可以将目标设备的无线连接权限信息写入中继设备中。当然,也可以由中继设备实时从目标设备中获取无线连接权限信息。具体获取目标设备的无线连接权限信息的方式,本申请不对其加以限制。
步骤418,中继设备将所述第二音频信号返回第一设备;
在本申请的一种情况中,在中继设备中预置处理音频信号的硬件模块时,可以自定义发送第二音频信号的音频输出API,根据该音频输出API送第二音频信号。
步骤420,通过第一设备的音频接口接收第二音频信号;
第一设备则通过音频接口,接收包括了目标设备的无线连接权限信息的第二音频信号。
在本申请的一种情况中,第一设备可调用音频输入API,从音频接口的麦克风引脚中接收所述第二音频信号。
步骤422,第一设备根据所述第二音频信号中的无线连接权限信息,将所述第一设备与目标设备进行无线连接。
第一设备可从第二音频信号中提取无线连接权限信息,然后在根据该无线连接权限信息,将苏颂第一设备与目标设备进行无线连接。
图4所示实施例各步骤执行原理与图1和图2所描述的相应步骤的原理类似,其对各种音频信号的处理、传输等过程原理类似,在此不再赘叙。
参照图5,其示出了本申请的一种设备连接装置的结构框图,具体可以包括如下模块:
音频接口插入检测模块510,用于检测第一设备的音频接口是否被插入;
第一音频信号发送模块520,用于在检测到第一设备的音频接口被插入时,则通过所述音频接口发送第一音频信号;所述第一音频信号用于指示获取目标设备的无线连接权限信息;
第二音频信号接收模块530,用于通过所述音频接口接收第二音频信号;所述第二音频信号包括目标设备的无线连接权限信息;
无线连接模块540,用于根据所述第二音频信号中的无线连接权限信息,将所述第一设备与目标设备进行无线连接。
本申请实施例上述一种设备连接装置应用于第一设备中。
在本申请实施例的一种优选示例中,所述第一音频信号发送模块520包括:
权限获取指令生成模块,用于生成权限获取指令;所述权限获取指令用于获取目标设备的无线连接权限信息;
权限获取指令调制模块,用于将所述权限获取指令调制为第一音频信号;
第一发送模块,用于将所述第一音频信号由音频接口发出。
在本申请实施例的一种优选示例中,所述第一发送模块包括:
声道引脚发送模块,用于调用音频输出API,通过音频接口的左声道引脚和/或右声道引脚,将所述第一音频信号发出。
在本申请实施例的一种优选示例中,所述第二音频信号接收模块530包括:
麦克风引脚接收模块,用于调用音频输入API,从音频接口的麦克风引脚中接收所述第二音频信号。
在本申请实施例的一种优选示例中,所述无线连接模块540包括:
第二音频信号解调模块,用于所述第一设备通过音频接口接收到所述第二音频信号之后,解调所述第二音频信号;
权限提取模块,用于从解调后的结果中,提取目标设备的无线连接权限信息;
第一无线连接模块,用于基于所述无线连接权限信息,将所述第一设备与目标设备进行无线连接。
在本申请实施例的一种优选示例中,所述第一无线连接模块包括:
连接执行模块,用于调用无线连接API,根据所述无线连接权限信息将第一设备与目标设备进行无线连接。
在本申请实施例的一种优选示例中,还包括:
连接测试发送模块,用于在通过所述音频接口获取目标设备的无线连接权限信息之前,通过音频接口发送音频连接测试信号;所述音频连接测试信号用于指示第一设备的连接对象返回音频响应信号;
连接音频响应信号检测模块,用于检测音频接口是否接收到针对所述音频连接测试信号的音频响应信号;如果检测到针对所述音频连接测试信号的音频响应信号,则进入通过所述音频接口发送第一音频信号的步骤。
在本申请实施例的一种优选示例中,所述无线连接权限信息包括目标设备的设备标识和连接密码。
参照图6,其示出了本申请的一种设备接入装置的结构框图,具体可以包括如下模块:
第一音频信号接收模块610,用于检测是否接收到第一音频信号;所述第一音频信号用于指示获取目标设备的无线连接权限信息;
第一音频信号处理模块620,用于若检测到第一音频信号,则针对第一音频信号进行处理,获得第二音频信号;所述第二音频信号包括目标设备的无线连接权限信息;
第二音频信号返回模块630,用于将所述第二音频信号返回第一设备,以使第一设备根据所述第二音频信号中的无线连接权限信息,将所述第一设备与目标设备进行无线连接。
在本申请实施例的一种优选示例中,所述第一音频信号中包括权限获取指令;
进一步的,所述第一音频信号处理模块620包括:
第一音频信号解调模块,用于对接收到的所述第一音频信号进行解调,获得权限获取指令;
权限获取模块,用于根据所述权限获取指令,获取目标设备的无线连接权限信息;
返回指令生成模块,用于生成包括所述无线连接权限信息的返回指令;
第一返回模块,用于将所述返回指令调制为第二音频信号。
在本申请实施例的一种优选示例中,所述第一音频信号由第一设备的音频接口的左声道引脚和/或右声道引脚发出;
进一步的,所述第一音频信号接收模块610包括:
引脚检测模块,适于在左声道引脚和/或右声道引脚检测是否接收到第一音频信号。
在本申请实施例的一种优选示例中,所述第二音频信号返回模块630包括:
麦克风引脚返回模块,用于通过麦克风引脚将所述第二音频信号返回第一设备。
在本申请实施例的一种优选示例中,还包括:
连接测试检测模块,用于在检测是否接收到第一音频信号之前,检测是否接收到音频连接测试信号;所述音频连接测试信号用于指示第一设备的连接对象返回音频响应信号;
音频响应信号返回模块,用于若检测到所述音频连接测试信号,则返回针对所述音频连接测试信号的音频响应信号。
在本申请实施例的一种优选示例中,所述无线连接权限信息包括目标设备的设备标识和连接密码。
本申请实施例上述一种设备连接装置应用于上述目标设备或者中继设备中。
参照图7,其示出了本申请的一种设备接入系统的结构框图,具体可以包括如下模块:
第一设备710和目标设备720;
所述第一设备710包括:
音频接口插入检测模块711,用于检测第一设备的音频接口是否被插入;
第一音频信号发送模块712,用于在检测到第一设备的音频接口被插入时,则通过所述音频接口发送第一音频信号;所述第一音频信号用于指示获取目标设备的无线连接权限信息;
第二音频信号接收模块713,用于通过所述音频接口接收第二音频信号;
无线连接模块714,用于根据所述第二音频信号中的无线连接权限信息,将所述第一设备与目标设备进行无线连接;
所述目标设备720包括:
第一音频信号接收模块721,用于检测是否接收到第一音频信号;
第一音频信号处理模块722,用于若检测到第一音频信号,则针对第一音频信号进
行处理,获得第二音频信号;所述第二音频信号包括目标设备的无线连接权限信息;
第二音频信号返回模块723,用于将所述第二音频信号返回第一设备。
参照图8,其示出了本申请的一种设备接入系统的结构框图,具体可以包括如下模块:
第一设备810、中继设备820和目标设备830;
所述第一设备810包括:
音频接口插入检测模块811,用于检测第一设备的音频接口是否被插入;
第一音频信号发送模块812,用于在检测到第一设备的音频接口被插入时,则通过所述音频接口发送第一音频信号;所述第一音频信号用于指示获取目标设备的无线连接权限信息;
第二音频信号接收模块813,用于通过所述音频接口接收第二音频信号;
无线连接模块814,用于根据所述第二音频信号中的无线连接权限信息,将所述第一设备与目标设备进行无线连接;
所述中继设备包820包括:
第一音频信号接收模块821,用于检测是否接收到第一音频信号;
第一音频信号处理模块822,用于若检测到第一音频信号,则针对第一音频信号进行处理,获得第二音频信号;所述第二音频信号包括目标设备的无线连接权限信息;
第二音频信号返回模块823,用于将所述第二音频信号返回第一设备。
对于装置实施例而言,由于其与方法实施例基本相似,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。
本说明书中的各个实施例均采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似的部分互相参见即可。
本领域内的技术人员应明白,本申请实施例的实施例可提供为方法、装置、或计算机程序产品。因此,本申请实施例可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请实施例可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。
在一个典型的配置中,所述计算机设备包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。内存可能包括计算机可读介质中的非永久性存储器,随机存取存
储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信号存储。信号可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信号。按照本文中的界定,计算机可读介质不包括非持续性的电脑可读媒体(transitory media),如调制的数据信号和载波。
本申请实施例是参照根据本申请实施例的方法、终端设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理终端设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理终端设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理终端设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理终端设备上,使得在计算机或其他可编程终端设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程终端设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
尽管已描述了本申请实施例的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例做出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本申请实施例范围的所有变更和修改。
最后,还需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操
作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者终端设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者终端设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者终端设备中还存在另外的相同要素。
以上对本申请所提供的一种设备连接方法、一种设备接入方法、一种设备连接装置、一种设备接入装置和一种设备连接系统,进行了详细介绍,本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领域的一般技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本申请的限制。
Claims (30)
- 一种设备连接方法,其特征在于,包括:检测第一设备的音频接口是否被插入;若检测到第一设备的音频接口被插入,则通过所述音频接口发送第一音频信号;所述第一音频信号用于指示获取目标设备的无线连接权限信息;通过所述音频接口接收第二音频信号;所述第二音频信号包括目标设备的无线连接权限信息;根据所述第二音频信号中的无线连接权限信息,将所述第一设备与目标设备进行无线连接。
- 根据权利要求1所述的方法,其特征在于,所述通过所述音频接口发送第一音频信号的步骤,包括:生成权限获取指令;所述权限获取指令用于获取目标设备的无线连接权限信息;将所述权限获取指令调制为第一音频信号;将所述第一音频信号由音频接口发出。
- 根据权利要求2所述的方法,其特征在于,将所述第一音频信号由音频接口发出的步骤,包括:调用音频输出API,通过音频接口的左声道引脚和/或右声道引脚,将所述第一音频信号发出。
- 根据权利要求1所述的方法,其特征在于,通过所述音频接口接收第二音频信号的步骤,包括:调用音频输入API,从音频接口的麦克风引脚中接收所述第二音频信号。
- 根据权利要求1所述的方法,其特征在于,所述根据所述第二音频信号中的无线连接权限信息,将所述第一设备与目标设备进行无线连接的步骤,包括:所述第一设备通过音频接口接收到所述第二音频信号之后,解调所述第二音频信号;从解调后的结果中,提取目标设备的无线连接权限信息;基于所述无线连接权限信息,将所述第一设备与目标设备进行无线连接。
- 根据权利要求5所述的方法,其特征在于,所述基于所述无线连接权限信息,将所述第一设备与目标设备进行无线连接的步骤,包括:调用无线连接API,根据所述无线连接权限信息将第一设备与目标设备进行无线连 接。
- 根据权利要求1所述的方法,其特征在于,在通过所述音频接口获取目标设备的无线连接权限信息的步骤之前,还包括:通过音频接口发送音频连接测试信号;所述音频连接测试信号用于指示第一设备的连接对象返回音频响应信号;检测音频接口是否接收到针对所述音频连接测试信号的音频响应信号;如果检测到针对所述音频连接测试信号的音频响应信号,则进入通过所述音频接口发送第一音频信号的步骤。
- 根据权利要求1-7其中之一所述的方法,其特征在于,所述无线连接权限信息包括目标设备的设备标识和连接密码。
- 一种设备接入方法,其特征在于,包括:检测是否接收到第一音频信号;所述第一音频信号用于指示获取目标设备的无线连接权限信息;若检测到第一音频信号,则针对第一音频信号进行处理,获得第二音频信号;所述第二音频信号包括目标设备的无线连接权限信息;将所述第二音频信号返回第一设备,以使第一设备根据所述第二音频信号中的无线连接权限信息,将所述第一设备与目标设备进行无线连接。
- 根据权利要求9所述的方法,其特征在于,所述第一音频信号中包括权限获取指令;进一步的,所述若检测到第一音频信号,则针对第一音频信号进行处理,获得第二音频信号的步骤,包括:对接收到的所述第一音频信号进行解调,获得权限获取指令;根据所述权限获取指令,获取目标设备的无线连接权限信息;生成包括所述无线连接权限信息的返回指令;将所述返回指令调制为第二音频信号。
- 根据权利要求9所述的方法,其特征在于,所述第一音频信号由第一设备的音频接口的左声道引脚和/或右声道引脚发出;进一步的,所述检测是否接收到第一音频信号的步骤,包括:在左声道引脚和/或右声道引脚检测是否接收到第一音频信号。
- 根据权利要求9所述的方法,其特征在于,所述将所述第二音频信号返回第一 设备的步骤,包括:通过麦克风引脚将所述第二音频信号返回第一设备。
- 根据权利要求9所述的方法,其特征在于,在检测是否接收到第一音频信号的步骤之前,还包括:检测是否接收到音频连接测试信号;所述音频连接测试信号用于指示第一设备的连接对象返回音频响应信号;若检测到所述音频连接测试信号,则返回针对所述音频连接测试信号的音频响应信号。
- 根据权利要求9-13其中之一所述的方法,其特征在于,所述无线连接权限信息包括目标设备的设备标识和连接密码。
- 一种设备连接装置,其特征在于,包括:音频接口插入检测模块,用于检测第一设备的音频接口是否被插入;第一音频信号发送模块,用于在检测到第一设备的音频接口被插入时,则通过所述音频接口发送第一音频信号;所述第一音频信号用于指示获取目标设备的无线连接权限信息;第二音频信号接收模块,用于通过所述音频接口接收第二音频信号;所述第二音频信号包括目标设备的无线连接权限信息;无线连接模块,用于根据所述第二音频信号中的无线连接权限信息,将所述第一设备与目标设备进行无线连接。
- 根据权利要求15所述的装置,其特征在于,所述第一音频信号发送模块包括:权限获取指令生成模块,用于生成权限获取指令;所述权限获取指令用于获取目标设备的无线连接权限信息;权限获取指令调制模块,用于将所述权限获取指令调制为第一音频信号;第一发送模块,用于将所述第一音频信号由音频接口发出。
- 根据权利要求16所述的装置,其特征在于,所述第一发送模块包括:声道引脚发送模块,用于调用音频输出API,通过音频接口的左声道引脚和/或右声道引脚,将所述第一音频信号发出。
- 根据权利要求15所述的装置,其特征在于,所述第二音频信号接收模块包括:麦克风引脚接收模块,用于调用音频输入API,从音频接口的麦克风引脚中接收所述第二音频信号。
- 根据权利要求15所述的装置,其特征在于,所述无线连接模块包括:第二音频信号解调模块,用于所述第一设备通过音频接口接收到所述第二音频信号之后,解调所述第二音频信号;权限提取模块,用于从解调后的结果中,提取目标设备的无线连接权限信息;第一无线连接模块,用于基于所述无线连接权限信息,将所述第一设备与目标设备进行无线连接。
- 根据权利要求19所述的装置,其特征在于,所述无线连接模块包括:连接执行模块,用于调用无线连接API,根据所述无线连接权限信息将第一设备与目标设备进行无线连接。
- 根据权利要求15所述的装置,其特征在于,还包括:连接测试发送模块,用于在通过所述音频接口获取目标设备的无线连接权限信息之前,通过音频接口发送音频连接测试信号;所述音频连接测试信号用于指示第一设备的连接对象返回音频响应信号;连接音频响应信号检测模块,用于检测音频接口是否接收到针对所述音频连接测试信号的音频响应信号;如果检测到针对所述音频连接测试信号的音频响应信号,则进入通过所述音频接口发送第一音频信号的步骤。
- 根据权利要求15-21其中之一所述的装置,其特征在于,所述无线连接权限信息包括目标设备的设备标识和连接密码。
- 一种设备接入装置,其特征在于,包括:第一音频信号接收模块,用于检测是否接收到第一音频信号;所述第一音频信号用于指示获取目标设备的无线连接权限信息;第一音频信号处理模块,用于若检测到第一音频信号,则针对第一音频信号进行处理,获得第二音频信号;所述第二音频信号包括目标设备的无线连接权限信息;第二音频信号返回模块,用于将所述第二音频信号返回第一设备,以使第一设备根据所述第二音频信号中的无线连接权限信息,将所述第一设备与目标设备进行无线连接。
- 根据权利要求23所述的装置,其特征在于,所述第一音频信号中包括权限获取指令;进一步的,所述第一音频信号处理模块包括:第一音频信号解调模块,用于对接收到的所述第一音频信号进行解调,获得权限获 取指令;权限获取模块,用于根据所述权限获取指令,获取目标设备的无线连接权限信息;返回指令生成模块,用于生成包括所述无线连接权限信息的返回指令;第一返回模块,用于将所述返回指令调制为第二音频信号。
- 根据权利要求23所述的装置,其特征在于,所述第一音频信号由第一设备的音频接口的左声道引脚和/或右声道引脚发出;进一步的,所述第一音频信号接收模块包括:引脚检测模块,适于在左声道引脚和/或右声道引脚检测是否接收到第一音频信号。
- 根据权利要求23所述的装置,其特征在于,所述第二音频信号返回模块包括:麦克风引脚返回模块,用于通过麦克风引脚将所述第二音频信号返回第一设备。
- 根据权利要求23所述的装置,其特征在于,还包括:连接测试检测模块,用于在检测是否接收到第一音频信号之前,检测是否接收到音频连接测试信号;所述音频连接测试信号用于指示第一设备的连接对象返回音频响应信号;音频响应信号返回模块,用于若检测到所述音频连接测试信号,则返回针对所述音频连接测试信号的音频响应信号。
- 根据权利要求23-27其中之一所述的装置,其特征在于,所述无线连接权限信息包括目标设备的设备标识和连接密码。
- 一种设备连接系统,其特征在于,包括:第一设备和目标设备;所述第一设备包括:音频接口插入检测模块,用于检测第一设备的音频接口是否被插入;第一音频信号发送模块,用于在检测到第一设备的音频接口被插入时,则通过所述音频接口发送第一音频信号;所述第一音频信号用于指示获取目标设备的无线连接权限信息;第二音频信号接收模块,用于通过所述音频接口接收第二音频信号;无线连接模块,用于根据所述第二音频信号中的无线连接权限信息,将所述第一设备与目标设备进行无线连接;所述目标设备包括:第一音频信号接收模块,用于检测是否接收到第一音频信号;第一音频信号处理模块,用于若检测到第一音频信号,则针对第一音频信号进行处理,获得第二音频信号;所述第二音频信号包括目标设备的无线连接权限信息;第二音频信号返回模块,用于将所述第二音频信号返回第一设备。
- 一种设备连接系统,其特征在于,包括:第一设备、中继设备和目标设备;所述第一设备包括:音频接口插入检测模块,用于检测第一设备的音频接口是否被插入;第一音频信号发送模块,用于在检测到第一设备的音频接口被插入时,则通过所述音频接口发送第一音频信号;所述第一音频信号用于指示获取目标设备的无线连接权限信息;第二音频信号接收模块,用于通过所述音频接口接收第二音频信号;无线连接模块,用于根据所述第二音频信号中的无线连接权限信息,将所述第一设备与目标设备进行无线连接;所述中继设备包括:第一音频信号接收模块,用于检测是否接收到第一音频信号;第一音频信号处理模块,用于若检测到第一音频信号,则针对第一音频信号进行处理,获得第二音频信号;所述第二音频信号包括目标设备的无线连接权限信息;第二音频信号返回模块,用于将所述第二音频信号返回第一设备。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201510334071.XA CN106332075A (zh) | 2015-06-16 | 2015-06-16 | 一种设备连接方法、装置和系统 |
| CN201510334071.X | 2015-06-16 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2016202205A1 true WO2016202205A1 (zh) | 2016-12-22 |
Family
ID=57544957
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2016/085214 Ceased WO2016202205A1 (zh) | 2015-06-16 | 2016-06-08 | 一种设备连接方法、装置和系统 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN106332075A (zh) |
| WO (1) | WO2016202205A1 (zh) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN108901056A (zh) * | 2018-06-21 | 2018-11-27 | 百度在线网络技术(北京)有限公司 | 用于交互信息的方法和装置 |
Families Citing this family (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN107889091A (zh) * | 2017-11-15 | 2018-04-06 | 珠海市魅族科技有限公司 | WiFi连接方法、WiFi连接系统及计算机设备 |
| CN114285873B (zh) * | 2021-12-09 | 2024-01-02 | 阿波罗智联(北京)科技有限公司 | 建立通信连接的方法、装置、设备以及存储介质 |
| CN114979903B (zh) * | 2022-06-14 | 2026-01-09 | 联想长风科技(北京)有限公司 | 一种麦克风信息安全保护方法及系统 |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20080307515A1 (en) * | 2005-12-21 | 2008-12-11 | Cronto Limited | System and Method For Dynamic Multifactor Authentication |
| CN203027256U (zh) * | 2012-11-22 | 2013-06-26 | 国民技术股份有限公司 | 一种通信设备及通信系统 |
| CN103944723A (zh) * | 2014-04-18 | 2014-07-23 | 天地融科技股份有限公司 | 蓝牙设备认证方法和蓝牙设备 |
| CN204305268U (zh) * | 2014-09-27 | 2015-04-29 | 漳州市爱德电子技术有限公司 | 一种蓝牙窗口对讲机 |
-
2015
- 2015-06-16 CN CN201510334071.XA patent/CN106332075A/zh active Pending
-
2016
- 2016-06-08 WO PCT/CN2016/085214 patent/WO2016202205A1/zh not_active Ceased
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20080307515A1 (en) * | 2005-12-21 | 2008-12-11 | Cronto Limited | System and Method For Dynamic Multifactor Authentication |
| CN203027256U (zh) * | 2012-11-22 | 2013-06-26 | 国民技术股份有限公司 | 一种通信设备及通信系统 |
| CN103944723A (zh) * | 2014-04-18 | 2014-07-23 | 天地融科技股份有限公司 | 蓝牙设备认证方法和蓝牙设备 |
| CN204305268U (zh) * | 2014-09-27 | 2015-04-29 | 漳州市爱德电子技术有限公司 | 一种蓝牙窗口对讲机 |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN108901056A (zh) * | 2018-06-21 | 2018-11-27 | 百度在线网络技术(北京)有限公司 | 用于交互信息的方法和装置 |
| CN108901056B (zh) * | 2018-06-21 | 2020-09-08 | 百度在线网络技术(北京)有限公司 | 用于交互信息的方法和装置 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN106332075A (zh) | 2017-01-11 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US9357385B2 (en) | Configuration of a new enrollee device for use in a communication network | |
| EP2833653B1 (en) | Method and apparatus for establishing communication between an image photographing apparatus and a user device | |
| US20250063338A1 (en) | Electronic device for managing embedded subscriber identification module and method for same | |
| US20090319673A1 (en) | Automated Wireless Device Pairing | |
| US11838116B2 (en) | Communication apparatus, control method, and computer-readable storage medium | |
| CN110651241A (zh) | 将多个移动设备连接到智能家庭助理账户 | |
| WO2019052532A1 (zh) | 关于物联网设备的信息交互方法、装置及设备 | |
| US9860738B2 (en) | Method for processing multiple pieces of SIM information and electronic device thereof | |
| JP2016538623A (ja) | アプリケーションのための認証 | |
| US10425809B2 (en) | Communication apparatus, method for controlling communication apparatus, and program | |
| WO2020007158A1 (zh) | 一种网络接入方法及装置 | |
| US20210136577A1 (en) | Method and a device for wireless connection | |
| CN105450614A (zh) | 一种服务器账户登录方法、装置以及系统 | |
| US10581532B2 (en) | System and a method for establishing data communication between devices using audio frequency | |
| US20160021230A1 (en) | Communication apparatus connectable with external apparatus by wireless communication, method for controlling communication apparatus, and storage medium | |
| WO2016202205A1 (zh) | 一种设备连接方法、装置和系统 | |
| CN106411865A (zh) | 一种数据传输方法、装置及终端 | |
| WO2018077084A1 (zh) | 智能设备的连网方法、智能设备及移动客户端 | |
| CN111970676A (zh) | WiFi热点接入方法、装置、设备及存储介质 | |
| EP3100484A1 (en) | Device to device user service sharing using shared trusted id | |
| US10117099B2 (en) | Communication apparatus, method for controlling the same, and program | |
| CN116962114A (zh) | 基于分布式软总线的设备互联方法、装置、设备及介质 | |
| CN113301537B (zh) | 用于建立通信连接的方法、装置、电子设备以及存储介质 | |
| WO2016150191A1 (zh) | 一种数据共享方法及装置 | |
| US9763028B2 (en) | Systems and methods for wireless communication interoperability |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 16810946 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 16810946 Country of ref document: EP Kind code of ref document: A1 |